aios-core 3.9.6 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aios-core/cli/commands/validate/index.js +429 -0
- package/.aios-core/constitution.md +171 -0
- package/.aios-core/core/config/config-loader.js +2 -2
- package/.aios-core/core/elicitation/elicitation-engine.js +1 -1
- package/.aios-core/core/elicitation/session-manager.js +1 -1
- package/.aios-core/core/elicitation/workflow-elicitation.js +34 -0
- package/.aios-core/core/events/dashboard-emitter.js +292 -0
- package/.aios-core/core/events/index.js +16 -0
- package/.aios-core/core/events/types.js +44 -0
- package/.aios-core/core/execution/autonomous-build-loop.js +1066 -0
- package/.aios-core/core/execution/build-orchestrator.js +1054 -0
- package/.aios-core/core/execution/build-state-manager.js +1529 -0
- package/.aios-core/core/execution/context-injector.js +536 -0
- package/.aios-core/core/execution/parallel-monitor.js +429 -0
- package/.aios-core/core/execution/rate-limit-manager.js +314 -0
- package/.aios-core/core/execution/result-aggregator.js +485 -0
- package/.aios-core/core/execution/semantic-merge-engine.js +1735 -0
- package/.aios-core/core/execution/subagent-dispatcher.js +521 -0
- package/.aios-core/core/execution/wave-executor.js +397 -0
- package/.aios-core/core/health-check/base-check.js +222 -0
- package/.aios-core/core/health-check/check-registry.js +251 -0
- package/.aios-core/core/health-check/checks/deployment/build-config.js +109 -0
- package/.aios-core/core/health-check/checks/deployment/ci-config.js +123 -0
- package/.aios-core/core/health-check/checks/deployment/deployment-readiness.js +150 -0
- package/.aios-core/core/health-check/checks/deployment/docker-config.js +120 -0
- package/.aios-core/core/health-check/checks/deployment/env-file.js +109 -0
- package/.aios-core/core/health-check/checks/deployment/index.js +27 -0
- package/.aios-core/core/health-check/checks/index.js +54 -0
- package/.aios-core/core/health-check/checks/local/disk-space.js +212 -0
- package/.aios-core/core/health-check/checks/local/environment-vars.js +134 -0
- package/.aios-core/core/health-check/checks/local/git-install.js +156 -0
- package/.aios-core/core/health-check/checks/local/ide-detection.js +146 -0
- package/.aios-core/core/health-check/checks/local/index.js +33 -0
- package/.aios-core/core/health-check/checks/local/memory.js +136 -0
- package/.aios-core/core/health-check/checks/local/network.js +168 -0
- package/.aios-core/core/health-check/checks/local/npm-install.js +147 -0
- package/.aios-core/core/health-check/checks/local/shell-environment.js +118 -0
- package/.aios-core/core/health-check/checks/project/agent-config.js +165 -0
- package/.aios-core/core/health-check/checks/project/aios-directory.js +141 -0
- package/.aios-core/core/health-check/checks/project/dependencies.js +148 -0
- package/.aios-core/core/health-check/checks/project/framework-config.js +131 -0
- package/.aios-core/core/health-check/checks/project/index.js +33 -0
- package/.aios-core/core/health-check/checks/project/node-version.js +161 -0
- package/.aios-core/core/health-check/checks/project/package-json.js +105 -0
- package/.aios-core/core/health-check/checks/project/task-definitions.js +190 -0
- package/.aios-core/core/health-check/checks/project/workflow-dependencies.js +212 -0
- package/.aios-core/core/health-check/checks/repository/branch-protection.js +105 -0
- package/.aios-core/core/health-check/checks/repository/commit-history.js +142 -0
- package/.aios-core/core/health-check/checks/repository/conflicts.js +150 -0
- package/.aios-core/core/health-check/checks/repository/git-repo.js +157 -0
- package/.aios-core/core/health-check/checks/repository/git-status.js +147 -0
- package/.aios-core/core/health-check/checks/repository/gitignore.js +192 -0
- package/.aios-core/core/health-check/checks/repository/index.js +33 -0
- package/.aios-core/core/health-check/checks/repository/large-files.js +181 -0
- package/.aios-core/core/health-check/checks/repository/lockfile-integrity.js +142 -0
- package/.aios-core/core/health-check/checks/services/api-endpoints.js +166 -0
- package/.aios-core/core/health-check/checks/services/claude-code.js +137 -0
- package/.aios-core/core/health-check/checks/services/github-cli.js +115 -0
- package/.aios-core/core/health-check/checks/services/index.js +25 -0
- package/.aios-core/core/health-check/checks/services/mcp-integration.js +123 -0
- package/.aios-core/core/health-check/engine.js +405 -0
- package/.aios-core/core/health-check/healers/backup-manager.js +338 -0
- package/.aios-core/core/health-check/healers/index.js +328 -0
- package/.aios-core/core/health-check/index.js +368 -0
- package/.aios-core/core/health-check/reporters/console.js +329 -0
- package/.aios-core/core/health-check/reporters/index.js +115 -0
- package/.aios-core/core/health-check/reporters/json.js +299 -0
- package/.aios-core/core/health-check/reporters/markdown.js +321 -0
- package/.aios-core/core/ideation/ideation-engine.js +832 -0
- package/.aios-core/core/index.js +12 -0
- package/.aios-core/core/manifest/manifest-generator.js +3 -3
- package/.aios-core/core/manifest/manifest-validator.js +2 -2
- package/.aios-core/core/mcp/config-migrator.js +2 -2
- package/.aios-core/core/mcp/symlink-manager.js +4 -4
- package/.aios-core/core/memory/__tests__/gaps-implementation.verify.js +381 -0
- package/.aios-core/core/memory/context-snapshot.js +647 -0
- package/.aios-core/core/memory/file-evolution-tracker.js +1002 -0
- package/.aios-core/core/memory/gotchas-memory.js +1152 -0
- package/.aios-core/core/memory/timeline-manager.js +745 -0
- package/.aios-core/core/orchestration/agent-invoker.js +611 -0
- package/.aios-core/core/orchestration/checklist-runner.js +327 -0
- package/.aios-core/core/orchestration/cli-commands.js +574 -0
- package/.aios-core/core/orchestration/condition-evaluator.js +379 -0
- package/.aios-core/core/orchestration/context-manager.js +287 -0
- package/.aios-core/core/orchestration/dashboard-integration.js +503 -0
- package/.aios-core/core/orchestration/executors/epic-3-executor.js +221 -0
- package/.aios-core/core/orchestration/executors/epic-4-executor.js +268 -0
- package/.aios-core/core/orchestration/executors/epic-5-executor.js +328 -0
- package/.aios-core/core/orchestration/executors/epic-6-executor.js +264 -0
- package/.aios-core/core/orchestration/executors/epic-7-executor.js +355 -0
- package/.aios-core/core/orchestration/executors/epic-executor.js +237 -0
- package/.aios-core/core/orchestration/executors/index.js +89 -0
- package/.aios-core/core/orchestration/gate-evaluator.js +500 -0
- package/.aios-core/core/orchestration/index.js +113 -0
- package/.aios-core/core/orchestration/master-orchestrator.js +1548 -0
- package/.aios-core/core/orchestration/parallel-executor.js +225 -0
- package/.aios-core/core/orchestration/recovery-handler.js +720 -0
- package/.aios-core/core/orchestration/skill-dispatcher.js +361 -0
- package/.aios-core/core/orchestration/subagent-prompt-builder.js +366 -0
- package/.aios-core/core/orchestration/tech-stack-detector.js +599 -0
- package/.aios-core/core/orchestration/workflow-orchestrator.js +798 -0
- package/.aios-core/core/permissions/__tests__/permission-mode.test.js +292 -0
- package/.aios-core/core/permissions/index.js +82 -0
- package/.aios-core/core/permissions/operation-guard.js +395 -0
- package/.aios-core/core/permissions/permission-mode.js +270 -0
- package/.aios-core/core/quality-gates/base-layer.js +1 -1
- package/.aios-core/core/quality-gates/focus-area-recommender.js +2 -2
- package/.aios-core/core/quality-gates/human-review-orchestrator.js +1 -1
- package/.aios-core/core/quality-gates/layer2-pr-automation.js +13 -6
- package/.aios-core/core/quality-gates/layer3-human-review.js +1 -1
- package/.aios-core/core/quality-gates/quality-gate-config.yaml +1 -1
- package/.aios-core/core/quality-gates/quality-gate-manager.js +4 -4
- package/.aios-core/core/registry/build-registry.js +2 -2
- package/.aios-core/core/registry/validate-registry.js +1 -1
- package/.aios-core/core/session/context-detector.js +1 -1
- package/.aios-core/core/utils/security-utils.js +3 -1
- package/.aios-core/core/utils/yaml-validator.js +3 -7
- package/.aios-core/core-config.yaml +64 -33
- package/.aios-core/data/tech-presets/_template.md +257 -0
- package/.aios-core/data/tech-presets/nextjs-react.md +931 -0
- package/.aios-core/data/technical-preferences.md +81 -2
- package/.aios-core/data/workflow-patterns.yaml +82 -0
- package/.aios-core/data/workflow-state-schema.yaml +202 -0
- package/.aios-core/development/agents/aios-master.md +99 -45
- package/.aios-core/development/agents/analyst.md +84 -20
- package/.aios-core/development/agents/architect.md +135 -38
- package/.aios-core/development/agents/data-engineer.md +66 -53
- package/.aios-core/development/agents/dev.md +212 -62
- package/.aios-core/development/agents/devops.md +113 -69
- package/.aios-core/development/agents/pm.md +101 -21
- package/.aios-core/development/agents/po.md +93 -34
- package/.aios-core/development/agents/qa.md +113 -45
- package/.aios-core/development/agents/sm.md +79 -29
- package/.aios-core/development/agents/squad-creator.md +55 -32
- package/.aios-core/development/agents/ux-design-expert.md +131 -102
- package/.aios-core/development/checklists/self-critique-checklist.md +273 -0
- package/.aios-core/development/scripts/agent-assignment-resolver.js +1 -1
- package/.aios-core/development/scripts/agent-config-loader.js +12 -9
- package/.aios-core/development/scripts/agent-exit-hooks.js +2 -2
- package/.aios-core/development/scripts/audit-agent-config.js +2 -2
- package/.aios-core/development/scripts/backlog-manager.js +7 -4
- package/.aios-core/development/scripts/decision-log-generator.js +1 -1
- package/.aios-core/development/scripts/decision-log-indexer.js +3 -3
- package/.aios-core/development/scripts/decision-recorder.js +3 -3
- package/.aios-core/development/scripts/dev-context-loader.js +8 -9
- package/.aios-core/development/scripts/generate-greeting.js +19 -7
- package/.aios-core/development/scripts/greeting-builder.js +170 -88
- package/.aios-core/development/scripts/migrate-task-to-v2.js +1 -1
- package/.aios-core/development/scripts/squad/squad-analyzer.js +25 -26
- package/.aios-core/development/scripts/squad/squad-extender.js +8 -8
- package/.aios-core/development/scripts/squad/squad-migrator.js +10 -15
- package/.aios-core/development/scripts/squad/squad-validator.js +74 -2
- package/.aios-core/development/scripts/story-manager.js +2 -2
- package/.aios-core/development/scripts/story-update-hook.js +2 -2
- package/.aios-core/development/scripts/test-greeting-system.js +3 -3
- package/.aios-core/development/scripts/verify-workflow-gaps.js +1032 -0
- package/.aios-core/development/scripts/workflow-navigator.js +113 -0
- package/.aios-core/development/scripts/workflow-state-manager.js +518 -0
- package/.aios-core/development/scripts/workflow-validator.js +695 -0
- package/.aios-core/development/tasks/analyze-cross-artifact.md +357 -0
- package/.aios-core/development/tasks/build-autonomous.md +186 -0
- package/.aios-core/development/tasks/build-resume.md +125 -0
- package/.aios-core/development/tasks/build-status.md +155 -0
- package/.aios-core/development/tasks/build.md +141 -0
- package/.aios-core/development/tasks/capture-session-insights.md +637 -0
- package/.aios-core/development/tasks/check-docs-links.md +114 -0
- package/.aios-core/development/tasks/cleanup-worktrees.md +39 -0
- package/.aios-core/development/tasks/create-workflow.md +41 -2
- package/.aios-core/development/tasks/create-worktree.md +437 -0
- package/.aios-core/development/tasks/dev-develop-story.md +65 -1
- package/.aios-core/development/tasks/document-gotchas.md +477 -0
- package/.aios-core/development/tasks/environment-bootstrap.md +78 -66
- package/.aios-core/development/tasks/extract-patterns.md +397 -0
- package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +73 -16
- package/.aios-core/development/tasks/gotcha.md +136 -0
- package/.aios-core/development/tasks/gotchas.md +153 -0
- package/.aios-core/development/tasks/health-check.yaml +226 -0
- package/.aios-core/development/tasks/list-mcps.md +33 -0
- package/.aios-core/development/tasks/list-worktrees.md +342 -0
- package/.aios-core/development/tasks/merge-worktree.md +42 -0
- package/.aios-core/development/tasks/modify-workflow.md +31 -3
- package/.aios-core/development/tasks/orchestrate-resume.md +59 -0
- package/.aios-core/development/tasks/orchestrate-status.md +63 -0
- package/.aios-core/development/tasks/orchestrate-stop.md +54 -0
- package/.aios-core/development/tasks/orchestrate.md +65 -0
- package/.aios-core/development/tasks/plan-create-context.md +810 -0
- package/.aios-core/development/tasks/plan-create-implementation.md +797 -0
- package/.aios-core/development/tasks/plan-execute-subtask.md +960 -0
- package/.aios-core/development/tasks/qa-browser-console-check.md +343 -0
- package/.aios-core/development/tasks/qa-create-fix-request.md +623 -0
- package/.aios-core/development/tasks/qa-evidence-requirements.md +314 -0
- package/.aios-core/development/tasks/qa-false-positive-detection.md +374 -0
- package/.aios-core/development/tasks/qa-fix-issues.md +685 -0
- package/.aios-core/development/tasks/qa-library-validation.md +496 -0
- package/.aios-core/development/tasks/qa-migration-validation.md +583 -0
- package/.aios-core/development/tasks/qa-review-build.md +1224 -0
- package/.aios-core/development/tasks/qa-security-checklist.md +551 -0
- package/.aios-core/development/tasks/release-management.md +46 -17
- package/.aios-core/development/tasks/remove-mcp.md +35 -0
- package/.aios-core/development/tasks/remove-worktree.md +433 -0
- package/.aios-core/development/tasks/run-design-system-pipeline.md +640 -0
- package/.aios-core/development/tasks/run-workflow-engine.md +859 -0
- package/.aios-core/development/tasks/run-workflow.md +387 -0
- package/.aios-core/development/tasks/spec-assess-complexity.md +461 -0
- package/.aios-core/development/tasks/spec-critique.md +595 -0
- package/.aios-core/development/tasks/spec-gather-requirements.md +545 -0
- package/.aios-core/development/tasks/spec-research-dependencies.md +445 -0
- package/.aios-core/development/tasks/spec-write-spec.md +531 -0
- package/.aios-core/development/tasks/squad-creator-sync-ide-command.md +404 -0
- package/.aios-core/development/tasks/validate-tech-preset.md +186 -0
- package/.aios-core/development/tasks/validate-workflow.md +321 -0
- package/.aios-core/development/tasks/verify-subtask.md +235 -0
- package/.aios-core/development/templates/aios-doc-template.md +494 -0
- package/.aios-core/development/templates/subagent-step-prompt.md +120 -0
- package/.aios-core/development/workflows/README.md +8 -7
- package/.aios-core/development/workflows/auto-worktree.yaml +421 -0
- package/.aios-core/development/workflows/brownfield-discovery.yaml +932 -0
- package/.aios-core/development/workflows/brownfield-fullstack.yaml +116 -46
- package/.aios-core/development/workflows/brownfield-service.yaml +82 -25
- package/.aios-core/development/workflows/brownfield-ui.yaml +86 -25
- package/.aios-core/development/workflows/design-system-build-quality.yaml +227 -0
- package/.aios-core/development/workflows/greenfield-fullstack.yaml +85 -34
- package/.aios-core/development/workflows/greenfield-service.yaml +96 -26
- package/.aios-core/development/workflows/greenfield-ui.yaml +74 -27
- package/.aios-core/development/workflows/qa-loop.yaml +443 -0
- package/.aios-core/development/workflows/spec-pipeline.yaml +576 -0
- package/.aios-core/development/workflows/story-development-cycle.yaml +284 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +103 -87
- package/.aios-core/infrastructure/integrations/pm-adapters/clickup-adapter.js +5 -5
- package/.aios-core/infrastructure/integrations/pm-adapters/github-adapter.js +5 -5
- package/.aios-core/infrastructure/integrations/pm-adapters/jira-adapter.js +2 -2
- package/.aios-core/infrastructure/integrations/pm-adapters/local-adapter.js +2 -2
- package/.aios-core/infrastructure/schemas/agent-v3-schema.json +159 -0
- package/.aios-core/infrastructure/schemas/build-state.schema.json +157 -0
- package/.aios-core/infrastructure/schemas/task-v3-schema.json +151 -0
- package/.aios-core/infrastructure/scripts/aios-validator.js +2 -2
- package/.aios-core/infrastructure/scripts/approach-manager.js +1003 -0
- package/.aios-core/infrastructure/scripts/asset-inventory.js +620 -0
- package/.aios-core/infrastructure/scripts/changelog-generator.js +553 -0
- package/.aios-core/infrastructure/scripts/cicd-discovery.js +1268 -0
- package/.aios-core/infrastructure/scripts/codebase-mapper.js +1286 -0
- package/.aios-core/infrastructure/scripts/config-loader.js +2 -2
- package/.aios-core/infrastructure/scripts/dashboard-status-writer.js +309 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +2 -2
- package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +3 -3
- package/.aios-core/infrastructure/scripts/documentation-synchronizer.js +3 -3
- package/.aios-core/infrastructure/scripts/framework-analyzer.js +17 -1
- package/.aios-core/infrastructure/scripts/gotchas-documenter.js +1295 -0
- package/.aios-core/infrastructure/scripts/ide-sync/README.md +180 -0
- package/.aios-core/infrastructure/scripts/ide-sync/index.js +58 -43
- package/.aios-core/infrastructure/scripts/ide-sync/redirect-generator.js +0 -22
- package/.aios-core/infrastructure/scripts/migrate-agent.js +526 -0
- package/.aios-core/infrastructure/scripts/path-analyzer.js +474 -0
- package/.aios-core/infrastructure/scripts/pattern-extractor.js +1561 -0
- package/.aios-core/infrastructure/scripts/plan-tracker.js +920 -0
- package/.aios-core/infrastructure/scripts/pm-adapter-factory.js +3 -3
- package/.aios-core/infrastructure/scripts/pr-review-ai.js +1061 -0
- package/.aios-core/infrastructure/scripts/project-status-loader.js +91 -12
- package/.aios-core/infrastructure/scripts/qa-loop-orchestrator.js +1262 -0
- package/.aios-core/infrastructure/scripts/qa-report-generator.js +1152 -0
- package/.aios-core/infrastructure/scripts/recovery-tracker.js +963 -0
- package/.aios-core/infrastructure/scripts/repository-detector.js +2 -2
- package/.aios-core/infrastructure/scripts/rollback-manager.js +732 -0
- package/.aios-core/infrastructure/scripts/story-worktree-hooks.js +425 -0
- package/.aios-core/infrastructure/scripts/stuck-detector.js +1249 -0
- package/.aios-core/infrastructure/scripts/subtask-verifier.js +793 -0
- package/.aios-core/infrastructure/scripts/test-discovery.js +1259 -0
- package/.aios-core/infrastructure/scripts/validate-agents.js +526 -0
- package/.aios-core/infrastructure/scripts/worktree-manager.js +703 -0
- package/.aios-core/infrastructure/templates/aios-sync.yaml.template +193 -0
- package/.aios-core/infrastructure/tests/project-status-loader.test.js +200 -26
- package/.aios-core/infrastructure/tests/worktree-manager.test.js +619 -0
- package/.aios-core/install-manifest.yaml +1253 -277
- package/.aios-core/lib/build.json +1 -0
- package/.aios-core/monitor/hooks/lib/__init__.py +1 -0
- package/.aios-core/monitor/hooks/lib/enrich.py +58 -0
- package/.aios-core/monitor/hooks/lib/send_event.py +47 -0
- package/.aios-core/monitor/hooks/notification.py +29 -0
- package/.aios-core/monitor/hooks/post_tool_use.py +45 -0
- package/.aios-core/monitor/hooks/pre_compact.py +29 -0
- package/.aios-core/monitor/hooks/pre_tool_use.py +40 -0
- package/.aios-core/monitor/hooks/stop.py +29 -0
- package/.aios-core/monitor/hooks/subagent_stop.py +29 -0
- package/.aios-core/monitor/hooks/user_prompt_submit.py +38 -0
- package/.aios-core/package.json +6 -7
- package/.aios-core/presets/README.md +359 -0
- package/.aios-core/product/checklists/self-critique-checklist.md +386 -0
- package/.aios-core/product/templates/current-approach-tmpl.md +56 -0
- package/.aios-core/product/templates/qa-report-tmpl.md +234 -0
- package/.aios-core/product/templates/spec-tmpl.md +234 -0
- package/.aios-core/product/templates/workflow-template.yaml +17 -0
- package/.aios-core/schemas/README.md +403 -0
- package/.aios-core/schemas/agent-v3-schema.json +394 -0
- package/.aios-core/schemas/task-v3-schema.json +353 -0
- package/.aios-core/schemas/validate-v3-schema.js +430 -0
- package/{tools → .aios-core/scripts/diagnostics}/diagnose-installation.js +19 -11
- package/.aios-core/scripts/diagnostics/health-dashboard/README.md +121 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/index.html +13 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/package-lock.json +5144 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/package.json +24 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/public/favicon.svg +10 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/App.jsx +22 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/AutoFixLog.css +122 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/AutoFixLog.jsx +72 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/DomainCard.css +121 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/DomainCard.jsx +116 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/HealthScore.css +80 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/HealthScore.jsx +81 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/IssuesList.css +184 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/IssuesList.jsx +145 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/TechDebtList.css +114 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/TechDebtList.jsx +72 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/index.js +9 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Card.css +44 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Card.jsx +25 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Chart.css +14 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Chart.jsx +138 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Header.css +54 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/Header.jsx +21 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/StatusBadge.css +77 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/StatusBadge.jsx +45 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/components/shared/index.js +4 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/hooks/index.js +2 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/hooks/useAutoRefresh.js +89 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/hooks/useHealthData.js +307 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/main.jsx +13 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/pages/Dashboard.css +238 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/pages/Dashboard.jsx +153 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/pages/DomainDetail.css +259 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/pages/DomainDetail.jsx +163 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/pages/index.js +2 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/styles/App.css +19 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/src/styles/index.css +67 -0
- package/.aios-core/scripts/diagnostics/health-dashboard/vite.config.js +23 -0
- package/.aios-core/utils/format-duration.js +95 -0
- package/.aios-core/workflow-intelligence/__tests__/confidence-scorer.test.js +27 -27
- package/.aios-core/workflow-intelligence/__tests__/integration.test.js +25 -23
- package/.aios-core/workflow-intelligence/__tests__/suggestion-engine.test.js +28 -24
- package/.aios-core/workflow-intelligence/__tests__/wave-analyzer.test.js +25 -36
- package/.aios-core/workflow-intelligence/__tests__/workflow-registry.test.js +2 -2
- package/.aios-core/workflow-intelligence/engine/confidence-scorer.js +25 -24
- package/.aios-core/workflow-intelligence/engine/output-formatter.js +23 -9
- package/.aios-core/workflow-intelligence/engine/suggestion-engine.js +130 -45
- package/.aios-core/workflow-intelligence/engine/wave-analyzer.js +31 -24
- package/.aios-core/workflow-intelligence/index.js +33 -31
- package/.aios-core/workflow-intelligence/learning/capture-hook.js +7 -7
- package/.aios-core/workflow-intelligence/learning/gotcha-registry.js +653 -0
- package/.aios-core/workflow-intelligence/learning/index.js +84 -9
- package/.aios-core/workflow-intelligence/learning/pattern-capture.js +17 -28
- package/.aios-core/workflow-intelligence/learning/pattern-store.js +24 -25
- package/.aios-core/workflow-intelligence/learning/pattern-validator.js +18 -18
- package/.aios-core/workflow-intelligence/learning/qa-feedback.js +585 -0
- package/.aios-core/workflow-intelligence/learning/semantic-search.js +521 -0
- package/.aios-core/workflow-intelligence/registry/workflow-registry.js +13 -14
- package/.claude/CLAUDE.md +304 -0
- package/LICENSE +2 -2
- package/README.md +136 -192
- package/bin/aios-init.js +245 -72
- package/bin/aios.js +92 -17
- package/bin/modules/env-config.js +1 -1
- package/package.json +13 -52
- package/packages/installer/package.json +1 -1
- package/{src → packages/installer/src}/config/ide-configs.js +15 -56
- package/{src → packages/installer/src}/installer/aios-core-installer.js +3 -3
- package/packages/installer/src/installer/manifest-signature.js +378 -0
- package/packages/installer/src/installer/post-install-validator.js +1482 -0
- package/{src → packages/installer/src}/wizard/feedback.js +45 -33
- package/packages/installer/src/wizard/i18n.js +194 -0
- package/{src → packages/installer/src}/wizard/ide-config-generator.js +3 -3
- package/{src → packages/installer/src}/wizard/ide-selector.js +4 -3
- package/packages/installer/src/wizard/index.js +707 -0
- package/{src → packages/installer/src}/wizard/questions.js +78 -27
- package/{src → packages/installer/src}/wizard/validation/report-generator.js +39 -55
- package/{src → packages/installer/src}/wizard/validation/validators/config-validator.js +2 -2
- package/{src → packages/installer/src}/wizard/validation/validators/file-structure-validator.js +7 -14
- package/scripts/check-markdown-links.py +352 -0
- package/scripts/dashboard-parallel-dev.sh +183 -0
- package/scripts/dashboard-parallel-phase3.sh +129 -0
- package/scripts/dashboard-parallel-phase4.sh +130 -0
- package/scripts/generate-install-manifest.js +30 -3
- package/scripts/install-monitor-hooks.sh +81 -0
- package/scripts/sign-manifest.ps1 +130 -0
- package/scripts/sign-manifest.sh +120 -0
- package/scripts/validate-manifest.js +1 -1
- package/squads/.gitkeep +2 -0
- package/.aios-core/.session/current-session.json +0 -14
- package/.aios-core/docs/SHARD-TRANSLATION-GUIDE.md +0 -335
- package/.aios-core/docs/component-creation-guide.md +0 -458
- package/.aios-core/docs/session-update-pattern.md +0 -307
- package/.aios-core/docs/standards/AIOS-FRAMEWORK-MASTER.md +0 -1963
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md +0 -1190
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1.md +0 -439
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO.md +0 -5398
- package/.aios-core/docs/standards/V3-ARCHITECTURAL-DECISIONS.md +0 -523
- package/.aios-core/docs/template-syntax.md +0 -267
- package/.aios-core/docs/troubleshooting-guide.md +0 -625
- package/.aios-core/index.d.ts +0 -8
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/trae.js +0 -125
- package/.aios-core/infrastructure/tests/utilities-audit-results.json +0 -501
- package/.aios-core/manifests/agents.csv +0 -1
- package/.aios-core/manifests/tasks.csv +0 -121
- package/.aios-core/manifests/workers.csv +0 -204
- package/.aios-core/product/templates/ide-rules/gemini-rules.md +0 -85
- package/.aios-core/product/templates/ide-rules/trae-rules.md +0 -104
- package/bin/aios-init-old.js +0 -532
- package/bin/aios-init-v4.js +0 -390
- package/bin/migrate-pm-config.js +0 -219
- package/index.d.ts +0 -19
- package/index.esm.js +0 -21
- package/index.js +0 -94
- package/squads/.designs/duplicate-test-design.yaml +0 -23
- package/squads/.designs/force-test-design.yaml +0 -23
- package/squads/.designs/nested-test-design.yaml +0 -23
- package/squads/.designs/test-squad-design.yaml +0 -23
- package/src/wizard/index.js +0 -589
- package/tools/package-builder.js +0 -35
- /package/{templates/squad → .aios-core/development/templates/squad-template}/LICENSE +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/README.md +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/agents/example-agent.yaml +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/package.json +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/squad.yaml +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/tasks/example-task.yaml +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/templates/example-template.md +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/tests/example-agent.test.js +0 -0
- /package/{templates/squad → .aios-core/development/templates/squad-template}/workflows/example-workflow.yaml +0 -0
- /package/{tools → .aios-core/scripts/diagnostics}/diagnose-npx-issue.ps1 +0 -0
- /package/{tools → .aios-core/scripts/diagnostics}/quick-diagnose.cmd +0 -0
- /package/{tools → .aios-core/scripts/diagnostics}/quick-diagnose.ps1 +0 -0
- /package/{src → packages/installer/src}/installer/brownfield-upgrader.js +0 -0
- /package/{src → packages/installer/src}/installer/dependency-installer.js +0 -0
- /package/{src → packages/installer/src}/installer/file-hasher.js +0 -0
- /package/{src → packages/installer/src}/utils/aios-colors.js +0 -0
- /package/{src → packages/installer/src}/wizard/validation/index.js +0 -0
- /package/{src → packages/installer/src}/wizard/validation/troubleshooting-system.js +0 -0
- /package/{src → packages/installer/src}/wizard/validation/validators/dependency-validator.js +0 -0
- /package/{src → packages/installer/src}/wizard/validation/validators/mcp-health-checker.js +0 -0
- /package/{src → packages/installer/src}/wizard/validators.js +0 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate Command Module
|
|
3
|
+
*
|
|
4
|
+
* CLI command for validating AIOS-Core installation integrity.
|
|
5
|
+
* Compares installed files against the install manifest.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/commands/validate
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
* @story 6.19 - Post-Installation Validation & Integrity Verification
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* aios validate # Validate current installation
|
|
13
|
+
* aios validate --repair # Repair missing/corrupted files
|
|
14
|
+
* aios validate --repair --dry-run # Preview repairs without applying
|
|
15
|
+
* aios validate --detailed # Show detailed file list
|
|
16
|
+
* aios validate --json # Output as JSON
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
const { Command } = require('commander');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const fs = require('fs-extra');
|
|
24
|
+
const chalk = require('chalk');
|
|
25
|
+
const ora = require('ora');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Exit codes for CLI consistency
|
|
29
|
+
* @enum {number}
|
|
30
|
+
*/
|
|
31
|
+
const ExitCode = {
|
|
32
|
+
SUCCESS: 0,
|
|
33
|
+
VALIDATION_FAILED: 1,
|
|
34
|
+
ERROR: 2,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Resolve validator module path
|
|
38
|
+
const validatorPath = path.resolve(__dirname, '../../../../src/installer/post-install-validator');
|
|
39
|
+
let PostInstallValidator, formatReport;
|
|
40
|
+
|
|
41
|
+
let validatorLoadError = null;
|
|
42
|
+
try {
|
|
43
|
+
const validator = require(validatorPath);
|
|
44
|
+
PostInstallValidator = validator.PostInstallValidator;
|
|
45
|
+
formatReport = validator.formatReport;
|
|
46
|
+
} catch (error) {
|
|
47
|
+
// Store error for later - will be reported during command execution
|
|
48
|
+
// This allows proper JSON output when --json flag is used
|
|
49
|
+
validatorLoadError = error;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Create the validate command
|
|
54
|
+
* @returns {Command} Commander command instance
|
|
55
|
+
*/
|
|
56
|
+
function createValidateCommand() {
|
|
57
|
+
const validate = new Command('validate');
|
|
58
|
+
|
|
59
|
+
validate
|
|
60
|
+
.description('Validate AIOS-Core installation integrity')
|
|
61
|
+
.option('-r, --repair', 'Repair missing or corrupted files')
|
|
62
|
+
.option('-d, --dry-run', 'Preview repairs without applying (use with --repair)')
|
|
63
|
+
.option('--detailed', 'Show detailed file list')
|
|
64
|
+
.option('--no-hash', 'Skip hash verification (faster)')
|
|
65
|
+
.option('--extras', 'Detect extra files not in manifest')
|
|
66
|
+
.option('-v, --verbose', 'Enable verbose output')
|
|
67
|
+
.option('--json', 'Output results as JSON')
|
|
68
|
+
.option('--source <dir>', 'Source directory for repairs')
|
|
69
|
+
.addHelpText(
|
|
70
|
+
'after',
|
|
71
|
+
`
|
|
72
|
+
Examples:
|
|
73
|
+
${chalk.dim('# Validate current installation')}
|
|
74
|
+
$ aios validate
|
|
75
|
+
|
|
76
|
+
${chalk.dim('# Validate with detailed file list')}
|
|
77
|
+
$ aios validate --detailed
|
|
78
|
+
|
|
79
|
+
${chalk.dim('# Repair missing/corrupted files')}
|
|
80
|
+
$ aios validate --repair
|
|
81
|
+
|
|
82
|
+
${chalk.dim('# Preview what would be repaired')}
|
|
83
|
+
$ aios validate --repair --dry-run
|
|
84
|
+
|
|
85
|
+
${chalk.dim('# Quick validation (skip hash check)')}
|
|
86
|
+
$ aios validate --no-hash
|
|
87
|
+
|
|
88
|
+
${chalk.dim('# Output as JSON for CI/CD')}
|
|
89
|
+
$ aios validate --json
|
|
90
|
+
|
|
91
|
+
Exit Codes:
|
|
92
|
+
0 - Validation passed
|
|
93
|
+
1 - Validation failed (missing/corrupted files)
|
|
94
|
+
2 - Validation error (could not complete)
|
|
95
|
+
`
|
|
96
|
+
)
|
|
97
|
+
.action(async (options) => {
|
|
98
|
+
await runValidation(options);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return validate;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Run the validation process
|
|
106
|
+
* @param {Object} options - Command options
|
|
107
|
+
*/
|
|
108
|
+
async function runValidation(options) {
|
|
109
|
+
const projectRoot = process.cwd();
|
|
110
|
+
const aiosCoreDir = path.join(projectRoot, '.aios-core');
|
|
111
|
+
|
|
112
|
+
// Check if AIOS-Core is installed
|
|
113
|
+
if (!fs.existsSync(aiosCoreDir)) {
|
|
114
|
+
if (options.json) {
|
|
115
|
+
console.log(
|
|
116
|
+
JSON.stringify(
|
|
117
|
+
{
|
|
118
|
+
status: 'failed',
|
|
119
|
+
error: 'AIOS-Core not found in current directory',
|
|
120
|
+
// SECURITY: Sanitize path - only show relative indicator
|
|
121
|
+
location: '.aios-core',
|
|
122
|
+
},
|
|
123
|
+
null,
|
|
124
|
+
2
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
console.error(chalk.red('\nError: AIOS-Core not found in current directory'));
|
|
129
|
+
console.error(chalk.dim(`Expected at: ${aiosCoreDir}`));
|
|
130
|
+
console.error(chalk.dim('\nRun `npx aios-core install` to install AIOS-Core'));
|
|
131
|
+
}
|
|
132
|
+
process.exit(ExitCode.ERROR);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Check if validator module is available
|
|
136
|
+
if (!PostInstallValidator) {
|
|
137
|
+
const errorMsg = validatorLoadError
|
|
138
|
+
? `Validator module failed to load: ${validatorLoadError.message}`
|
|
139
|
+
: 'Validator module not available';
|
|
140
|
+
|
|
141
|
+
if (options.json) {
|
|
142
|
+
console.log(
|
|
143
|
+
JSON.stringify(
|
|
144
|
+
{
|
|
145
|
+
status: 'error',
|
|
146
|
+
error: errorMsg,
|
|
147
|
+
hint: 'This may indicate a corrupted installation',
|
|
148
|
+
},
|
|
149
|
+
null,
|
|
150
|
+
2
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
} else {
|
|
154
|
+
console.error(chalk.red(`\nError: ${errorMsg}`));
|
|
155
|
+
console.error(chalk.dim('This may indicate a corrupted installation'));
|
|
156
|
+
}
|
|
157
|
+
process.exit(ExitCode.ERROR);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Determine source directory for repairs
|
|
161
|
+
let sourceDir = options.source;
|
|
162
|
+
|
|
163
|
+
// SECURITY: Validate --source directory if provided
|
|
164
|
+
if (sourceDir) {
|
|
165
|
+
const sourceManifest = path.join(sourceDir, '.aios-core', 'install-manifest.yaml');
|
|
166
|
+
if (!fs.existsSync(sourceManifest)) {
|
|
167
|
+
if (options.json) {
|
|
168
|
+
console.log(
|
|
169
|
+
JSON.stringify(
|
|
170
|
+
{
|
|
171
|
+
status: 'error',
|
|
172
|
+
error: 'Invalid source directory: manifest not found',
|
|
173
|
+
path: sourceDir,
|
|
174
|
+
},
|
|
175
|
+
null,
|
|
176
|
+
2
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
} else {
|
|
180
|
+
console.error(chalk.red('\nError: Invalid source directory'));
|
|
181
|
+
console.error(chalk.dim(`Expected manifest at: ${sourceManifest}`));
|
|
182
|
+
}
|
|
183
|
+
process.exit(ExitCode.ERROR);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (!sourceDir && options.repair) {
|
|
188
|
+
// Try to find source in common locations
|
|
189
|
+
const possibleSources = [
|
|
190
|
+
path.join(__dirname, '../../../../..'), // npm package root
|
|
191
|
+
path.join(projectRoot, 'node_modules/aios-core'),
|
|
192
|
+
path.join(projectRoot, 'node_modules/@synkra/aios-core'),
|
|
193
|
+
];
|
|
194
|
+
|
|
195
|
+
for (const src of possibleSources) {
|
|
196
|
+
if (fs.existsSync(path.join(src, '.aios-core', 'install-manifest.yaml'))) {
|
|
197
|
+
sourceDir = src;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Show spinner for non-JSON output (must be defined before validator for closure)
|
|
204
|
+
let spinner = null;
|
|
205
|
+
if (!options.json) {
|
|
206
|
+
console.log('');
|
|
207
|
+
spinner = ora({
|
|
208
|
+
text: 'Loading installation manifest...',
|
|
209
|
+
color: 'cyan',
|
|
210
|
+
}).start();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Create validator instance
|
|
214
|
+
const validator = new PostInstallValidator(projectRoot, sourceDir, {
|
|
215
|
+
verifyHashes: options.hash !== false,
|
|
216
|
+
detectExtras: options.extras === true,
|
|
217
|
+
verbose: options.verbose === true,
|
|
218
|
+
onProgress: options.json
|
|
219
|
+
? () => {}
|
|
220
|
+
: (current, total, file) => {
|
|
221
|
+
if (spinner) {
|
|
222
|
+
spinner.text = `Validating ${current}/${total}: ${truncatePath(file, 40)}`;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
// Run validation
|
|
229
|
+
const report = await validator.validate();
|
|
230
|
+
|
|
231
|
+
if (spinner) {
|
|
232
|
+
spinner.succeed('Validation complete');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Handle repair mode
|
|
236
|
+
let repairResult = null;
|
|
237
|
+
let repairAttempted = false;
|
|
238
|
+
|
|
239
|
+
if (options.repair && (report.stats.missingFiles > 0 || report.stats.corruptedFiles > 0)) {
|
|
240
|
+
repairAttempted = true;
|
|
241
|
+
if (!sourceDir) {
|
|
242
|
+
if (!options.json) {
|
|
243
|
+
console.error(chalk.yellow('\nWarning: Cannot repair - source directory not found'));
|
|
244
|
+
console.error(
|
|
245
|
+
chalk.dim('Specify source with --source <dir> or ensure package is installed')
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
repairResult = {
|
|
249
|
+
success: false,
|
|
250
|
+
error: 'Source directory not found',
|
|
251
|
+
repaired: [],
|
|
252
|
+
failed: [],
|
|
253
|
+
};
|
|
254
|
+
} else {
|
|
255
|
+
repairResult = await runRepair(validator, options, spinner);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Output results
|
|
260
|
+
if (options.json) {
|
|
261
|
+
// Include repair results in JSON output for CI/CD pipelines
|
|
262
|
+
// SECURITY: Use explicit property copy to prevent prototype pollution
|
|
263
|
+
const output = {
|
|
264
|
+
status: report.status,
|
|
265
|
+
integrityScore: report.integrityScore,
|
|
266
|
+
manifestVerified: report.manifestVerified,
|
|
267
|
+
timestamp: report.timestamp,
|
|
268
|
+
duration: report.duration,
|
|
269
|
+
manifest: report.manifest,
|
|
270
|
+
stats: report.stats,
|
|
271
|
+
summary: report.summary,
|
|
272
|
+
recommendations: report.recommendations,
|
|
273
|
+
// Only include issues count in JSON to avoid leaking internal paths
|
|
274
|
+
issueCount: report.issues?.length ?? 0,
|
|
275
|
+
repair: repairAttempted
|
|
276
|
+
? {
|
|
277
|
+
attempted: true,
|
|
278
|
+
success: repairResult?.success ?? false,
|
|
279
|
+
error: repairResult?.error ?? null,
|
|
280
|
+
dryRun: options.dryRun === true,
|
|
281
|
+
repairedCount: repairResult?.repaired?.length ?? 0,
|
|
282
|
+
failedCount: repairResult?.failed?.length ?? 0,
|
|
283
|
+
repaired: repairResult?.repaired ?? [],
|
|
284
|
+
failed: repairResult?.failed ?? [],
|
|
285
|
+
}
|
|
286
|
+
: { attempted: false },
|
|
287
|
+
};
|
|
288
|
+
console.log(JSON.stringify(output, null, 2));
|
|
289
|
+
} else {
|
|
290
|
+
console.log(formatReport(report, { colors: true, detailed: options.detailed }));
|
|
291
|
+
|
|
292
|
+
// Surface repair refusal errors in human-readable output
|
|
293
|
+
if (repairAttempted && !repairResult?.success && repairResult?.error) {
|
|
294
|
+
console.log('');
|
|
295
|
+
console.log(chalk.red(`Repair failed: ${repairResult.error}`));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Exit with appropriate code
|
|
300
|
+
// If repair was attempted and successful (not dry-run), exit 0
|
|
301
|
+
// If repair failed or was not attempted and there are issues, exit 1
|
|
302
|
+
if (repairAttempted && !options.dryRun && repairResult?.success) {
|
|
303
|
+
// Repair succeeded - exit 0
|
|
304
|
+
process.exit(ExitCode.SUCCESS);
|
|
305
|
+
} else if (report.status === 'failed') {
|
|
306
|
+
process.exit(ExitCode.VALIDATION_FAILED);
|
|
307
|
+
} else if (
|
|
308
|
+
report.status === 'warning' &&
|
|
309
|
+
(report.stats.missingFiles > 0 || report.stats.corruptedFiles > 0)
|
|
310
|
+
) {
|
|
311
|
+
process.exit(ExitCode.VALIDATION_FAILED);
|
|
312
|
+
} else {
|
|
313
|
+
process.exit(ExitCode.SUCCESS);
|
|
314
|
+
}
|
|
315
|
+
} catch (error) {
|
|
316
|
+
if (spinner) {
|
|
317
|
+
spinner.fail('Validation failed');
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (options.json) {
|
|
321
|
+
console.log(
|
|
322
|
+
JSON.stringify(
|
|
323
|
+
{
|
|
324
|
+
status: 'error',
|
|
325
|
+
error: error.message,
|
|
326
|
+
// SECURITY: Only include stack in verbose mode for debugging
|
|
327
|
+
stack: options.verbose ? error.stack : undefined,
|
|
328
|
+
},
|
|
329
|
+
null,
|
|
330
|
+
2
|
|
331
|
+
)
|
|
332
|
+
);
|
|
333
|
+
} else {
|
|
334
|
+
console.error(chalk.red(`\nError: ${error.message}`));
|
|
335
|
+
if (options.verbose) {
|
|
336
|
+
console.error(chalk.dim(error.stack));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
process.exit(ExitCode.ERROR);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Run repair process
|
|
346
|
+
* @param {PostInstallValidator} validator - Validator instance
|
|
347
|
+
* @param {Object} options - Command options
|
|
348
|
+
* @param {Object} spinner - Ora spinner instance
|
|
349
|
+
* @returns {Object} Repair result with success status, repaired files, and failed files
|
|
350
|
+
*/
|
|
351
|
+
async function runRepair(validator, options, spinner) {
|
|
352
|
+
const dryRun = options.dryRun === true;
|
|
353
|
+
|
|
354
|
+
if (!options.json) {
|
|
355
|
+
console.log('');
|
|
356
|
+
if (dryRun) {
|
|
357
|
+
spinner = ora({
|
|
358
|
+
text: 'Analyzing files to repair (dry run)...',
|
|
359
|
+
color: 'yellow',
|
|
360
|
+
}).start();
|
|
361
|
+
} else {
|
|
362
|
+
spinner = ora({
|
|
363
|
+
text: 'Repairing files...',
|
|
364
|
+
color: 'green',
|
|
365
|
+
}).start();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const repairResult = await validator.repair({
|
|
370
|
+
dryRun,
|
|
371
|
+
onProgress: options.json
|
|
372
|
+
? () => {}
|
|
373
|
+
: (current, total, file) => {
|
|
374
|
+
if (spinner) {
|
|
375
|
+
const action = dryRun ? 'Checking' : 'Repairing';
|
|
376
|
+
spinner.text = `${action} ${current}/${total}: ${truncatePath(file, 40)}`;
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
if (spinner) {
|
|
382
|
+
if (repairResult.success) {
|
|
383
|
+
const action = dryRun ? 'would be repaired' : 'repaired';
|
|
384
|
+
spinner.succeed(`${repairResult.repaired.length} file(s) ${action}`);
|
|
385
|
+
} else {
|
|
386
|
+
spinner.warn('Repair completed with some failures');
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (!options.json) {
|
|
391
|
+
// Show repair summary
|
|
392
|
+
if (repairResult.repaired.length > 0) {
|
|
393
|
+
console.log('');
|
|
394
|
+
console.log(chalk.bold(dryRun ? 'Files that would be repaired:' : 'Repaired files:'));
|
|
395
|
+
for (const file of repairResult.repaired.slice(0, 20)) {
|
|
396
|
+
const icon = dryRun ? chalk.yellow('○') : chalk.green('✓');
|
|
397
|
+
console.log(` ${icon} ${file.path}`);
|
|
398
|
+
}
|
|
399
|
+
if (repairResult.repaired.length > 20) {
|
|
400
|
+
console.log(chalk.dim(` ... and ${repairResult.repaired.length - 20} more`));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (repairResult.failed.length > 0) {
|
|
405
|
+
console.log('');
|
|
406
|
+
console.log(chalk.bold(chalk.red('Failed to repair:')));
|
|
407
|
+
for (const file of repairResult.failed) {
|
|
408
|
+
console.log(` ${chalk.red('✗')} ${file.path}: ${file.reason}`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return repairResult;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Truncate path for display
|
|
418
|
+
* @param {string} filePath - File path
|
|
419
|
+
* @param {number} maxLen - Maximum length
|
|
420
|
+
* @returns {string} - Truncated path
|
|
421
|
+
*/
|
|
422
|
+
function truncatePath(filePath, maxLen) {
|
|
423
|
+
if (!filePath || filePath.length <= maxLen) return filePath;
|
|
424
|
+
return '...' + filePath.slice(-(maxLen - 3));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
module.exports = {
|
|
428
|
+
createValidateCommand,
|
|
429
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Synkra AIOS Constitution
|
|
2
|
+
|
|
3
|
+
> **Version:** 1.0.0 | **Ratified:** 2025-01-30 | **Last Amended:** 2025-01-30
|
|
4
|
+
|
|
5
|
+
Este documento define os princípios fundamentais e inegociáveis do Synkra AIOS. Todos os agentes, tasks, e workflows DEVEM respeitar estes princípios. Violações são bloqueadas automaticamente via gates.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Core Principles
|
|
10
|
+
|
|
11
|
+
### I. CLI First (NON-NEGOTIABLE)
|
|
12
|
+
|
|
13
|
+
O CLI é a fonte da verdade onde toda inteligência, execução, e automação vivem.
|
|
14
|
+
|
|
15
|
+
**Regras:**
|
|
16
|
+
- MUST: Toda funcionalidade nova DEVE funcionar 100% via CLI antes de qualquer UI
|
|
17
|
+
- MUST: Dashboards apenas observam, NUNCA controlam ou tomam decisões
|
|
18
|
+
- MUST: A UI NUNCA é requisito para operação do sistema
|
|
19
|
+
- MUST: Ao decidir onde implementar, sempre CLI > Observability > UI
|
|
20
|
+
|
|
21
|
+
**Hierarquia:**
|
|
22
|
+
```
|
|
23
|
+
CLI (Máxima) → Observability (Secundária) → UI (Terciária)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Gate:** `dev-develop-story.md` - WARN se UI criada antes de CLI funcional
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### II. Agent Authority (NON-NEGOTIABLE)
|
|
31
|
+
|
|
32
|
+
Cada agente tem autoridades exclusivas que não podem ser violadas.
|
|
33
|
+
|
|
34
|
+
**Regras:**
|
|
35
|
+
- MUST: Apenas @devops pode executar `git push` para remote
|
|
36
|
+
- MUST: Apenas @devops pode criar Pull Requests
|
|
37
|
+
- MUST: Apenas @devops pode criar releases e tags
|
|
38
|
+
- MUST: Agentes DEVEM delegar para o agente apropriado quando fora de seu escopo
|
|
39
|
+
- MUST: Nenhum agente pode assumir autoridade de outro
|
|
40
|
+
|
|
41
|
+
**Exclusividades:**
|
|
42
|
+
|
|
43
|
+
| Autoridade | Agente Exclusivo |
|
|
44
|
+
|------------|------------------|
|
|
45
|
+
| git push | @devops |
|
|
46
|
+
| PR creation | @devops |
|
|
47
|
+
| Release/Tag | @devops |
|
|
48
|
+
| Story creation | @sm, @po |
|
|
49
|
+
| Architecture decisions | @architect |
|
|
50
|
+
| Quality verdicts | @qa |
|
|
51
|
+
|
|
52
|
+
**Gate:** Implementado via definição de agentes (não requer gate adicional)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### III. Story-Driven Development (MUST)
|
|
57
|
+
|
|
58
|
+
Todo desenvolvimento começa e termina com uma story.
|
|
59
|
+
|
|
60
|
+
**Regras:**
|
|
61
|
+
- MUST: Nenhum código é escrito sem uma story associada
|
|
62
|
+
- MUST: Stories DEVEM ter acceptance criteria claros antes de implementação
|
|
63
|
+
- MUST: Progresso DEVE ser rastreado via checkboxes na story
|
|
64
|
+
- MUST: File List DEVE ser mantida atualizada na story
|
|
65
|
+
- SHOULD: Stories seguem o workflow: @po/@sm cria → @dev implementa → @qa valida → @devops push
|
|
66
|
+
|
|
67
|
+
**Gate:** `dev-develop-story.md` - BLOCK se não houver story válida
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### IV. No Invention (MUST)
|
|
72
|
+
|
|
73
|
+
Especificações não inventam - apenas derivam dos requisitos.
|
|
74
|
+
|
|
75
|
+
**Regras:**
|
|
76
|
+
- MUST: Todo statement em spec.md DEVE rastrear para:
|
|
77
|
+
- Um requisito funcional (FR-*)
|
|
78
|
+
- Um requisito não-funcional (NFR-*)
|
|
79
|
+
- Uma constraint (CON-*)
|
|
80
|
+
- Um finding de research (verificado e documentado)
|
|
81
|
+
- MUST NOT: Adicionar features não presentes nos requisitos
|
|
82
|
+
- MUST NOT: Assumir detalhes de implementação não pesquisados
|
|
83
|
+
- MUST NOT: Especificar tecnologias não validadas
|
|
84
|
+
|
|
85
|
+
**Gate:** `spec-write-spec.md` - BLOCK se spec contiver invenções
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### V. Quality First (MUST)
|
|
90
|
+
|
|
91
|
+
Qualidade não é negociável. Todo código passa por múltiplos gates antes de merge.
|
|
92
|
+
|
|
93
|
+
**Regras:**
|
|
94
|
+
- MUST: `npm run lint` passa sem erros
|
|
95
|
+
- MUST: `npm run typecheck` passa sem erros
|
|
96
|
+
- MUST: `npm test` passa sem falhas
|
|
97
|
+
- MUST: `npm run build` completa com sucesso
|
|
98
|
+
- MUST: CodeRabbit não reporta issues CRITICAL
|
|
99
|
+
- MUST: Story status é "Done" ou "Ready for Review"
|
|
100
|
+
- SHOULD: Cobertura de testes não diminui
|
|
101
|
+
|
|
102
|
+
**Gate:** `pre-push.md` - BLOCK se qualquer check falhar
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### VI. Absolute Imports (SHOULD)
|
|
107
|
+
|
|
108
|
+
Imports relativos criam acoplamento e dificultam refatoração.
|
|
109
|
+
|
|
110
|
+
**Regras:**
|
|
111
|
+
- SHOULD: Sempre usar imports absolutos com alias `@/`
|
|
112
|
+
- SHOULD NOT: Usar imports relativos (`../../../`)
|
|
113
|
+
- EXCEPTION: Imports dentro do mesmo módulo/feature podem ser relativos
|
|
114
|
+
|
|
115
|
+
**Exemplo:**
|
|
116
|
+
```typescript
|
|
117
|
+
// CORRETO
|
|
118
|
+
import { useStore } from '@/stores/feature/store'
|
|
119
|
+
|
|
120
|
+
// INCORRETO
|
|
121
|
+
import { useStore } from '../../../stores/feature/store'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Gate:** ESLint rule (já implementado)
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Governance
|
|
129
|
+
|
|
130
|
+
### Amendment Process
|
|
131
|
+
|
|
132
|
+
1. Proposta de mudança documentada com justificativa
|
|
133
|
+
2. Review por @architect e @po
|
|
134
|
+
3. Aprovação requer consenso
|
|
135
|
+
4. Mudança implementada com atualização de versão
|
|
136
|
+
5. Propagação para templates e tasks dependentes
|
|
137
|
+
|
|
138
|
+
### Versioning
|
|
139
|
+
|
|
140
|
+
- **MAJOR:** Remoção ou redefinição incompatível de princípio
|
|
141
|
+
- **MINOR:** Novo princípio ou expansão significativa
|
|
142
|
+
- **PATCH:** Clarificações, correções de texto, refinamentos
|
|
143
|
+
|
|
144
|
+
### Compliance
|
|
145
|
+
|
|
146
|
+
- Todos os PRs DEVEM verificar compliance com Constitution
|
|
147
|
+
- Gates automáticos BLOQUEIAM violações de princípios NON-NEGOTIABLE
|
|
148
|
+
- Gates automáticos ALERTAM violações de princípios MUST
|
|
149
|
+
- Violações de SHOULD são reportadas mas não bloqueiam
|
|
150
|
+
|
|
151
|
+
### Gate Severity Levels
|
|
152
|
+
|
|
153
|
+
| Severidade | Comportamento | Uso |
|
|
154
|
+
|------------|---------------|-----|
|
|
155
|
+
| BLOCK | Impede execução, requer correção | NON-NEGOTIABLE, MUST críticos |
|
|
156
|
+
| WARN | Permite continuar com alerta | MUST não-críticos |
|
|
157
|
+
| INFO | Apenas reporta | SHOULD |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## References
|
|
162
|
+
|
|
163
|
+
- **Princípios derivados de:** `.claude/CLAUDE.md`
|
|
164
|
+
- **Inspirado por:** GitHub Spec-Kit Constitution System
|
|
165
|
+
- **Gates implementados em:** `.aios-core/development/tasks/`
|
|
166
|
+
- **Checklists relacionados:** `.aios-core/product/checklists/`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
*Synkra AIOS Constitution v1.0.0*
|
|
171
|
+
*CLI First | Agent-Driven | Quality First*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
const fs = require('fs').promises;
|
|
24
24
|
const path = require('path');
|
|
25
|
-
const yaml = require('yaml');
|
|
25
|
+
const yaml = require('js-yaml');
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Config cache with TTL
|
|
@@ -96,7 +96,7 @@ async function loadFullConfig() {
|
|
|
96
96
|
|
|
97
97
|
try {
|
|
98
98
|
const content = await fs.readFile(configPath, 'utf8');
|
|
99
|
-
const config = yaml.
|
|
99
|
+
const config = yaml.load(content);
|
|
100
100
|
|
|
101
101
|
const loadTime = Date.now() - startTime;
|
|
102
102
|
|
|
@@ -19,7 +19,7 @@ const ElicitationSessionManager = require('./session-manager');
|
|
|
19
19
|
let SecurityChecker = null;
|
|
20
20
|
try {
|
|
21
21
|
SecurityChecker = require('../../infrastructure/scripts/security-checker');
|
|
22
|
-
} catch (
|
|
22
|
+
} catch (_e) {
|
|
23
23
|
// Security checker not available - will use basic validation
|
|
24
24
|
console.warn('[ElicitationEngine] SecurityChecker not found, using basic validation');
|
|
25
25
|
}
|
|
@@ -138,7 +138,7 @@ class ElicitationSessionManager {
|
|
|
138
138
|
progress: session.totalSteps > 0 ?
|
|
139
139
|
Math.round((session.currentStep / session.totalSteps) * 100) : 0,
|
|
140
140
|
});
|
|
141
|
-
} catch (
|
|
141
|
+
} catch (_error) {
|
|
142
142
|
// Skip invalid session files
|
|
143
143
|
console.warn(`Invalid session file: ${file}`);
|
|
144
144
|
}
|
|
@@ -4,6 +4,40 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const workflowElicitationSteps = [
|
|
7
|
+
{
|
|
8
|
+
title: 'Target Context',
|
|
9
|
+
description: 'Where should this workflow be created?',
|
|
10
|
+
help: 'Workflows can live in the AIOS core framework or within a specific squad.',
|
|
11
|
+
questions: [
|
|
12
|
+
{
|
|
13
|
+
type: 'list',
|
|
14
|
+
name: 'targetContext',
|
|
15
|
+
message: 'Where should this workflow be created?',
|
|
16
|
+
choices: [
|
|
17
|
+
{ name: 'AIOS Core - Framework-level workflow', value: 'core' },
|
|
18
|
+
{ name: 'Squad - Squad-specific workflow', value: 'squad' },
|
|
19
|
+
{ name: 'Hybrid - Uses agents from both core AND a squad', value: 'hybrid' },
|
|
20
|
+
],
|
|
21
|
+
default: 'core',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'input',
|
|
25
|
+
name: 'squadName',
|
|
26
|
+
message: 'Which squad? (kebab-case name, e.g., "pedro-valerio"):',
|
|
27
|
+
when: (answers) => answers.targetContext === 'squad' || answers.targetContext === 'hybrid',
|
|
28
|
+
validate: (input) => {
|
|
29
|
+
if (!input) return 'Squad name is required';
|
|
30
|
+
if (!/^[a-z][a-z0-9-]*$/.test(input)) {
|
|
31
|
+
return 'Squad name must be kebab-case (lowercase with hyphens only)';
|
|
32
|
+
}
|
|
33
|
+
// Squad directory existence is validated at task execution time (pre-conditions)
|
|
34
|
+
return true;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
required: ['targetContext'],
|
|
39
|
+
},
|
|
40
|
+
|
|
7
41
|
{
|
|
8
42
|
title: 'Basic Workflow Information',
|
|
9
43
|
description: 'Define the core details of your workflow',
|