Skip to content

feat: integrate Task-3 enhanced semantic search features #22

feat: integrate Task-3 enhanced semantic search features

feat: integrate Task-3 enhanced semantic search features #22

Workflow file for this run

name: UCKN Validation
# Project-specific validation for UCKN atomic design architecture
# Complements ci-framework with domain-specific checks
on:
push:
branches: [main, development]
paths:
- 'src/**'
- 'tests/**'
pull_request:
branches: [main, development]
paths:
- 'src/**'
- 'tests/**'
workflow_dispatch:
env:
PYTHONUNBUFFERED: 1
UCKN_DISABLE_TORCH: "1"
HF_HUB_DISABLE_PROGRESS_BARS: "1"
HF_HUB_DISABLE_TELEMETRY: "1"
jobs:
atomic-design-validation:
name: Atomic Design Standards
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.62.2
cache: true
- name: Install dependencies
run: pixi install -e quality
- name: Install package
run: pixi run dev
- name: Validate atomic structure
run: |
echo "Validating UCKN atomic design structure..."
python << 'EOF'
import os
import sys
violations = []
# Check required atomic directories exist
required_dirs = [
'src/uckn/core/atoms',
'src/uckn/core/molecules',
'src/uckn/core/organisms'
]
for dir_path in required_dirs:
if not os.path.isdir(dir_path):
violations.append(f"Missing required atomic directory: {dir_path}")
# Check file size limits (1000 lines max - warning at 500)
warnings = []
for root, dirs, files in os.walk('src/uckn'):
# Skip __pycache__ directories
dirs[:] = [d for d in dirs if d != '__pycache__']
for file in files:
if file.endswith('.py'):
file_path = os.path.join(root, file)
with open(file_path, 'r') as f:
line_count = sum(1 for _ in f)
if line_count > 1000:
violations.append(f"{file_path}: {line_count} lines (exceeds 1000-line limit)")
elif line_count > 500:
warnings.append(f"{file_path}: {line_count} lines (consider refactoring)")
# Check core modules are in proper atomic locations
for root, dirs, files in os.walk('src/uckn/core'):
dirs[:] = [d for d in dirs if d != '__pycache__']
# Skip the base core directory checks for __init__.py and utility files
if root == 'src/uckn/core':
continue
for file in files:
if file.endswith('.py') and file != '__init__.py':
file_path = os.path.join(root, file)
if not any(atomic in file_path for atomic in ['atoms/', 'molecules/', 'organisms/']):
violations.append(f"{file_path}: not in atomic structure (atoms/molecules/organisms)")
if violations:
print("Atomic design violations found:")
for violation in violations:
print(f" - {violation}")
sys.exit(1)
else:
print("Atomic design validation passed")
print(f" - All required directories present")
print(f" - All files under 1000-line limit")
print(f" - Core modules in proper atomic locations")
if warnings:
print("\nWarnings (consider refactoring):")
for w in warnings:
print(f" - {w}")
EOF
- name: Check import structure
run: |
echo "Checking import structure..."
python << 'EOF'
import os
import ast
import sys
def check_imports(file_path):
"""Check for proper import structure"""
violations = []
try:
with open(file_path, 'r') as f:
tree = ast.parse(f.read())
for node in ast.walk(tree):
if isinstance(node, ast.ImportFrom):
if node.module and 'framework.' in node.module:
violations.append(f"Legacy framework import: {node.module}")
except SyntaxError:
pass # Skip files with syntax errors
return violations
all_violations = []
for root, dirs, files in os.walk("src/uckn"):
dirs[:] = [d for d in dirs if d != '__pycache__']
for file in files:
if file.endswith(".py"):
file_path = os.path.join(root, file)
violations = check_imports(file_path)
all_violations.extend([f"{file_path}: {v}" for v in violations])
if all_violations:
print("Import violations found:")
for violation in all_violations:
print(f" - {violation}")
sys.exit(1)
else:
print("Import structure is clean")
EOF
- name: Test UCKN CLI
run: |
echo "Testing UCKN CLI commands..."
pixi run uckn-version || echo "CLI version check completed"
- name: Validation Summary
if: always()
run: |
echo "## UCKN Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- Atomic Design Structure: Validated" >> $GITHUB_STEP_SUMMARY
echo "- File Size Limits: Checked (500 lines max)" >> $GITHUB_STEP_SUMMARY
echo "- Import Structure: Verified" >> $GITHUB_STEP_SUMMARY
echo "- CLI Commands: Tested" >> $GITHUB_STEP_SUMMARY