aios-core 2.1.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/.session/current-session.json +14 -0
- package/.aios-core/cli/commands/generate/index.js +222 -0
- package/.aios-core/cli/commands/manifest/index.js +46 -0
- package/.aios-core/cli/commands/manifest/regenerate.js +96 -0
- package/.aios-core/cli/commands/manifest/validate.js +66 -0
- package/.aios-core/cli/commands/mcp/add.js +234 -0
- package/.aios-core/cli/commands/mcp/index.js +76 -0
- package/.aios-core/cli/commands/mcp/link.js +217 -0
- package/.aios-core/cli/commands/mcp/setup.js +164 -0
- package/.aios-core/cli/commands/mcp/status.js +183 -0
- package/.aios-core/cli/commands/metrics/cleanup.js +91 -0
- package/.aios-core/cli/commands/metrics/index.js +65 -0
- package/.aios-core/cli/commands/metrics/record.js +154 -0
- package/.aios-core/cli/commands/metrics/seed.js +126 -0
- package/.aios-core/cli/commands/metrics/show.js +209 -0
- package/.aios-core/cli/commands/migrate/analyze.js +353 -0
- package/.aios-core/cli/commands/migrate/backup.js +352 -0
- package/.aios-core/cli/commands/migrate/execute.js +292 -0
- package/.aios-core/cli/commands/migrate/index.js +441 -0
- package/.aios-core/cli/commands/migrate/rollback.js +323 -0
- package/.aios-core/cli/commands/migrate/update-imports.js +396 -0
- package/.aios-core/cli/commands/migrate/validate.js +452 -0
- package/.aios-core/cli/commands/qa/index.js +56 -0
- package/.aios-core/cli/commands/qa/run.js +163 -0
- package/.aios-core/cli/commands/qa/status.js +195 -0
- package/.aios-core/cli/commands/workers/formatters/info-formatter.js +274 -0
- package/.aios-core/cli/commands/workers/formatters/list-table.js +265 -0
- package/.aios-core/cli/commands/workers/formatters/list-tree.js +159 -0
- package/.aios-core/cli/commands/workers/index.js +56 -0
- package/.aios-core/cli/commands/workers/info.js +194 -0
- package/.aios-core/cli/commands/workers/list.js +214 -0
- package/.aios-core/cli/commands/workers/search-filters.js +185 -0
- package/.aios-core/cli/commands/workers/search-keyword.js +310 -0
- package/.aios-core/cli/commands/workers/search-semantic.js +293 -0
- package/.aios-core/cli/commands/workers/search.js +154 -0
- package/.aios-core/cli/commands/workers/utils/pagination.js +102 -0
- package/.aios-core/cli/index.js +128 -0
- package/.aios-core/cli/utils/output-formatter-cli.js +232 -0
- package/.aios-core/cli/utils/score-calculator.js +221 -0
- package/.aios-core/core/README.md +229 -0
- package/.aios-core/core/config/config-cache.js +233 -0
- package/.aios-core/core/config/config-loader.js +277 -0
- package/.aios-core/core/data/agent-config-requirements.yaml +368 -0
- package/.aios-core/core/data/aios-kb.md +924 -0
- package/.aios-core/core/data/workflow-patterns.yaml +267 -0
- package/.aios-core/core/docs/SHARD-TRANSLATION-GUIDE.md +335 -0
- package/.aios-core/core/docs/component-creation-guide.md +458 -0
- package/.aios-core/core/docs/session-update-pattern.md +307 -0
- package/.aios-core/core/docs/template-syntax.md +267 -0
- package/.aios-core/core/docs/troubleshooting-guide.md +625 -0
- package/.aios-core/core/elicitation/agent-elicitation.js +272 -0
- package/.aios-core/core/elicitation/elicitation-engine.js +479 -0
- package/.aios-core/core/elicitation/session-manager.js +320 -0
- package/.aios-core/core/elicitation/task-elicitation.js +281 -0
- package/.aios-core/core/elicitation/workflow-elicitation.js +315 -0
- package/.aios-core/core/index.esm.js +42 -0
- package/.aios-core/core/index.js +76 -0
- package/.aios-core/core/manifest/manifest-generator.js +386 -0
- package/.aios-core/core/manifest/manifest-validator.js +429 -0
- package/.aios-core/core/mcp/config-migrator.js +340 -0
- package/.aios-core/core/mcp/global-config-manager.js +369 -0
- package/.aios-core/core/mcp/index.js +34 -0
- package/.aios-core/core/mcp/os-detector.js +188 -0
- package/.aios-core/core/mcp/symlink-manager.js +413 -0
- package/.aios-core/core/migration/migration-config.yaml +83 -0
- package/.aios-core/core/migration/module-mapping.yaml +89 -0
- package/.aios-core/core/quality-gates/base-layer.js +134 -0
- package/.aios-core/core/quality-gates/checklist-generator.js +329 -0
- package/.aios-core/core/quality-gates/focus-area-recommender.js +359 -0
- package/.aios-core/core/quality-gates/human-review-orchestrator.js +529 -0
- package/.aios-core/core/quality-gates/layer1-precommit.js +336 -0
- package/.aios-core/core/quality-gates/layer2-pr-automation.js +324 -0
- package/.aios-core/core/quality-gates/layer3-human-review.js +348 -0
- package/.aios-core/core/quality-gates/notification-manager.js +550 -0
- package/.aios-core/core/quality-gates/quality-gate-config.yaml +86 -0
- package/.aios-core/core/quality-gates/quality-gate-manager.js +601 -0
- package/.aios-core/core/registry/README.md +179 -0
- package/.aios-core/core/registry/build-registry.js +452 -0
- package/.aios-core/core/registry/registry-loader.js +330 -0
- package/.aios-core/core/registry/registry-schema.json +166 -0
- package/.aios-core/core/registry/service-registry.json +6586 -0
- package/.aios-core/core/registry/validate-registry.js +340 -0
- package/.aios-core/core/session/context-detector.js +229 -0
- package/.aios-core/core/session/context-loader.js +288 -0
- package/.aios-core/core/utils/output-formatter.js +298 -0
- package/.aios-core/core/utils/security-utils.js +333 -0
- package/.aios-core/core/utils/yaml-validator.js +419 -0
- package/.aios-core/core-config.yaml +382 -0
- package/.aios-core/data/agent-config-requirements.yaml +368 -0
- package/.aios-core/data/aios-kb.md +924 -0
- package/.aios-core/data/technical-preferences.md +4 -0
- package/.aios-core/data/workflow-patterns.yaml +267 -0
- package/.aios-core/development/README.md +142 -0
- package/.aios-core/development/agent-teams/team-all.yaml +15 -0
- package/.aios-core/development/agent-teams/team-fullstack.yaml +18 -0
- package/.aios-core/development/agent-teams/team-ide-minimal.yaml +10 -0
- package/.aios-core/development/agent-teams/team-no-ui.yaml +13 -0
- package/.aios-core/development/agent-teams/team-qa-focused.yaml +155 -0
- package/.aios-core/development/agents/aios-master.md +339 -0
- package/.aios-core/development/agents/analyst.md +195 -0
- package/.aios-core/development/agents/architect.md +359 -0
- package/.aios-core/development/agents/data-engineer.md +468 -0
- package/.aios-core/development/agents/dev.md +390 -0
- package/.aios-core/development/agents/devops.md +398 -0
- package/.aios-core/development/agents/pm.md +198 -0
- package/.aios-core/development/agents/po.md +256 -0
- package/.aios-core/development/agents/qa.md +312 -0
- package/.aios-core/development/agents/sm.md +220 -0
- package/.aios-core/development/agents/ux-design-expert.md +451 -0
- package/.aios-core/development/scripts/agent-assignment-resolver.js +231 -0
- package/.aios-core/development/scripts/agent-config-loader.js +624 -0
- package/.aios-core/development/scripts/agent-exit-hooks.js +96 -0
- package/.aios-core/development/scripts/apply-inline-greeting-all-agents.js +146 -0
- package/.aios-core/development/scripts/audit-agent-config.js +380 -0
- package/.aios-core/development/scripts/backlog-manager.js +404 -0
- package/.aios-core/development/scripts/batch-update-agents-session-context.js +95 -0
- package/.aios-core/development/scripts/decision-context.js +228 -0
- package/.aios-core/development/scripts/decision-log-generator.js +293 -0
- package/.aios-core/development/scripts/decision-log-indexer.js +284 -0
- package/.aios-core/development/scripts/decision-recorder.js +168 -0
- package/.aios-core/development/scripts/dev-context-loader.js +297 -0
- package/.aios-core/development/scripts/generate-greeting.js +160 -0
- package/.aios-core/development/scripts/greeting-builder.js +866 -0
- package/.aios-core/development/scripts/greeting-config-cli.js +85 -0
- package/.aios-core/development/scripts/greeting-preference-manager.js +145 -0
- package/.aios-core/development/scripts/migrate-task-to-v2.js +377 -0
- package/.aios-core/development/scripts/story-index-generator.js +337 -0
- package/.aios-core/development/scripts/story-manager.js +375 -0
- package/.aios-core/development/scripts/story-update-hook.js +259 -0
- package/.aios-core/development/scripts/task-identifier-resolver.js +145 -0
- package/.aios-core/development/scripts/test-greeting-system.js +142 -0
- package/.aios-core/development/scripts/validate-task-v2.js +319 -0
- package/.aios-core/development/scripts/workflow-navigator.js +214 -0
- package/.aios-core/development/tasks/add-mcp.md +319 -0
- package/.aios-core/development/tasks/advanced-elicitation.md +319 -0
- package/.aios-core/development/tasks/analyst-facilitate-brainstorming.md +342 -0
- package/.aios-core/development/tasks/analyze-framework.md +697 -0
- package/.aios-core/development/tasks/analyze-performance.md +637 -0
- package/.aios-core/development/tasks/apply-qa-fixes.md +340 -0
- package/.aios-core/development/tasks/architect-analyze-impact.md +827 -0
- package/.aios-core/development/tasks/audit-codebase.md +429 -0
- package/.aios-core/development/tasks/audit-tailwind-config.md +270 -0
- package/.aios-core/development/tasks/audit-utilities.md +358 -0
- package/.aios-core/development/tasks/bootstrap-shadcn-library.md +286 -0
- package/.aios-core/development/tasks/brownfield-create-epic.md +486 -0
- package/.aios-core/development/tasks/brownfield-create-story.md +357 -0
- package/.aios-core/development/tasks/build-component.md +478 -0
- package/.aios-core/development/tasks/calculate-roi.md +455 -0
- package/.aios-core/development/tasks/ci-cd-configuration.md +764 -0
- package/.aios-core/development/tasks/cleanup-utilities.md +670 -0
- package/.aios-core/development/tasks/collaborative-edit.md +1109 -0
- package/.aios-core/development/tasks/compose-molecule.md +284 -0
- package/.aios-core/development/tasks/consolidate-patterns.md +414 -0
- package/.aios-core/development/tasks/correct-course.md +280 -0
- package/.aios-core/development/tasks/create-agent.md +322 -0
- package/.aios-core/development/tasks/create-brownfield-story.md +727 -0
- package/.aios-core/development/tasks/create-deep-research-prompt.md +499 -0
- package/.aios-core/development/tasks/create-doc.md +316 -0
- package/.aios-core/development/tasks/create-next-story.md +774 -0
- package/.aios-core/development/tasks/create-suite.md +284 -0
- package/.aios-core/development/tasks/create-task.md +372 -0
- package/.aios-core/development/tasks/create-workflow.md +371 -0
- package/.aios-core/development/tasks/db-analyze-hotpaths.md +572 -0
- package/.aios-core/development/tasks/db-apply-migration.md +381 -0
- package/.aios-core/development/tasks/db-bootstrap.md +642 -0
- package/.aios-core/development/tasks/db-domain-modeling.md +693 -0
- package/.aios-core/development/tasks/db-dry-run.md +293 -0
- package/.aios-core/development/tasks/db-env-check.md +260 -0
- package/.aios-core/development/tasks/db-expansion-pack-integration.md +663 -0
- package/.aios-core/development/tasks/db-explain.md +631 -0
- package/.aios-core/development/tasks/db-impersonate.md +495 -0
- package/.aios-core/development/tasks/db-load-csv.md +593 -0
- package/.aios-core/development/tasks/db-policy-apply.md +653 -0
- package/.aios-core/development/tasks/db-rls-audit.md +411 -0
- package/.aios-core/development/tasks/db-rollback.md +739 -0
- package/.aios-core/development/tasks/db-run-sql.md +613 -0
- package/.aios-core/development/tasks/db-schema-audit.md +1011 -0
- package/.aios-core/development/tasks/db-seed.md +390 -0
- package/.aios-core/development/tasks/db-smoke-test.md +351 -0
- package/.aios-core/development/tasks/db-snapshot.md +569 -0
- package/.aios-core/development/tasks/db-supabase-setup.md +712 -0
- package/.aios-core/development/tasks/db-verify-order.md +515 -0
- package/.aios-core/development/tasks/deprecate-component.md +957 -0
- package/.aios-core/development/tasks/dev-apply-qa-fixes.md +318 -0
- package/.aios-core/development/tasks/dev-backlog-debt.md +469 -0
- package/.aios-core/development/tasks/dev-develop-story.md +846 -0
- package/.aios-core/development/tasks/dev-improve-code-quality.md +873 -0
- package/.aios-core/development/tasks/dev-optimize-performance.md +1034 -0
- package/.aios-core/development/tasks/dev-suggest-refactoring.md +871 -0
- package/.aios-core/development/tasks/dev-validate-next-story.md +349 -0
- package/.aios-core/development/tasks/document-project.md +553 -0
- package/.aios-core/development/tasks/environment-bootstrap.md +1311 -0
- package/.aios-core/development/tasks/execute-checklist.md +301 -0
- package/.aios-core/development/tasks/export-design-tokens-dtcg.md +274 -0
- package/.aios-core/development/tasks/extend-pattern.md +269 -0
- package/.aios-core/development/tasks/extract-tokens.md +467 -0
- package/.aios-core/development/tasks/facilitate-brainstorming-session.md +518 -0
- package/.aios-core/development/tasks/generate-ai-frontend-prompt.md +261 -0
- package/.aios-core/development/tasks/generate-documentation.md +284 -0
- package/.aios-core/development/tasks/generate-migration-strategy.md +522 -0
- package/.aios-core/development/tasks/generate-shock-report.md +501 -0
- package/.aios-core/development/tasks/github-devops-github-pr-automation.md +427 -0
- package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +733 -0
- package/.aios-core/development/tasks/github-devops-repository-cleanup.md +374 -0
- package/.aios-core/development/tasks/github-devops-version-management.md +483 -0
- package/.aios-core/development/tasks/improve-self.md +823 -0
- package/.aios-core/development/tasks/index-docs.md +388 -0
- package/.aios-core/development/tasks/init-project-status.md +506 -0
- package/.aios-core/development/tasks/integrate-expansion-pack.md +314 -0
- package/.aios-core/development/tasks/kb-mode-interaction.md +284 -0
- package/.aios-core/development/tasks/learn-patterns.md +901 -0
- package/.aios-core/development/tasks/mcp-workflow.md +437 -0
- package/.aios-core/development/tasks/modify-agent.md +382 -0
- package/.aios-core/development/tasks/modify-task.md +425 -0
- package/.aios-core/development/tasks/modify-workflow.md +466 -0
- package/.aios-core/development/tasks/po-backlog-add.md +370 -0
- package/.aios-core/development/tasks/po-manage-story-backlog.md +523 -0
- package/.aios-core/development/tasks/po-pull-story-from-clickup.md +540 -0
- package/.aios-core/development/tasks/po-pull-story.md +316 -0
- package/.aios-core/development/tasks/po-stories-index.md +351 -0
- package/.aios-core/development/tasks/po-sync-story-to-clickup.md +457 -0
- package/.aios-core/development/tasks/po-sync-story.md +303 -0
- package/.aios-core/development/tasks/pr-automation.md +701 -0
- package/.aios-core/development/tasks/propose-modification.md +843 -0
- package/.aios-core/development/tasks/qa-backlog-add-followup.md +425 -0
- package/.aios-core/development/tasks/qa-gate.md +374 -0
- package/.aios-core/development/tasks/qa-generate-tests.md +1175 -0
- package/.aios-core/development/tasks/qa-nfr-assess.md +558 -0
- package/.aios-core/development/tasks/qa-review-proposal.md +1158 -0
- package/.aios-core/development/tasks/qa-review-story.md +683 -0
- package/.aios-core/development/tasks/qa-risk-profile.md +567 -0
- package/.aios-core/development/tasks/qa-run-tests.md +277 -0
- package/.aios-core/development/tasks/qa-test-design.md +388 -0
- package/.aios-core/development/tasks/qa-trace-requirements.md +477 -0
- package/.aios-core/development/tasks/release-management.md +723 -0
- package/.aios-core/development/tasks/security-audit.md +554 -0
- package/.aios-core/development/tasks/security-scan.md +790 -0
- package/.aios-core/development/tasks/setup-database.md +741 -0
- package/.aios-core/development/tasks/setup-design-system.md +462 -0
- package/.aios-core/development/tasks/setup-github.md +874 -0
- package/.aios-core/development/tasks/setup-llm-routing.md +229 -0
- package/.aios-core/development/tasks/setup-mcp-docker.md +584 -0
- package/.aios-core/development/tasks/shard-doc.md +538 -0
- package/.aios-core/development/tasks/sm-create-next-story.md +480 -0
- package/.aios-core/development/tasks/sync-documentation.md +865 -0
- package/.aios-core/development/tasks/tailwind-upgrade.md +294 -0
- package/.aios-core/development/tasks/test-as-user.md +621 -0
- package/.aios-core/development/tasks/test-validation-task.md +171 -0
- package/.aios-core/development/tasks/undo-last.md +347 -0
- package/.aios-core/development/tasks/update-manifest.md +410 -0
- package/.aios-core/development/tasks/ux-create-wireframe.md +617 -0
- package/.aios-core/development/tasks/ux-ds-scan-artifact.md +672 -0
- package/.aios-core/development/tasks/ux-user-research.md +559 -0
- package/.aios-core/development/tasks/validate-next-story.md +423 -0
- package/.aios-core/development/tasks/validate-structure.md +243 -0
- package/.aios-core/development/workflows/README.md +84 -0
- package/.aios-core/development/workflows/brownfield-fullstack.yaml +297 -0
- package/.aios-core/development/workflows/brownfield-service.yaml +187 -0
- package/.aios-core/development/workflows/brownfield-ui.yaml +197 -0
- package/.aios-core/development/workflows/greenfield-fullstack.yaml +333 -0
- package/.aios-core/development/workflows/greenfield-service.yaml +206 -0
- package/.aios-core/development/workflows/greenfield-ui.yaml +235 -0
- package/.aios-core/docs/SHARD-TRANSLATION-GUIDE.md +335 -0
- package/.aios-core/docs/component-creation-guide.md +458 -0
- package/.aios-core/docs/session-update-pattern.md +307 -0
- package/.aios-core/docs/standards/AGENT-PERSONALIZATION-STANDARD-V1.md +572 -0
- package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-QUICK-REFERENCE.md +185 -0
- package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-V2.1.md +354 -0
- package/.aios-core/docs/standards/AIOS-FRAMEWORK-MASTER.md +1963 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +821 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md +1190 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1.md +439 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +1339 -0
- package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO.md +5398 -0
- package/.aios-core/docs/standards/EXECUTOR-DECISION-TREE.md +697 -0
- package/.aios-core/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +511 -0
- package/.aios-core/docs/standards/QUALITY-GATES-SPECIFICATION.md +556 -0
- package/.aios-core/docs/standards/STANDARDS-INDEX.md +210 -0
- package/.aios-core/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +550 -0
- package/.aios-core/docs/standards/TASK-FORMAT-SPECIFICATION-V1.md +1414 -0
- package/.aios-core/docs/standards/V3-ARCHITECTURAL-DECISIONS.md +523 -0
- package/.aios-core/docs/template-syntax.md +267 -0
- package/.aios-core/docs/troubleshooting-guide.md +625 -0
- package/.aios-core/elicitation/agent-elicitation.js +272 -0
- package/.aios-core/elicitation/task-elicitation.js +281 -0
- package/.aios-core/elicitation/workflow-elicitation.js +315 -0
- package/.aios-core/index.d.ts +8 -0
- package/.aios-core/index.esm.js +16 -0
- package/.aios-core/index.js +16 -0
- package/.aios-core/infrastructure/README.md +126 -0
- package/.aios-core/infrastructure/index.js +199 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/README.md +59 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/clickup-adapter.js +345 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/github-adapter.js +392 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/jira-adapter.js +448 -0
- package/.aios-core/infrastructure/integrations/pm-adapters/local-adapter.js +175 -0
- package/.aios-core/infrastructure/scripts/_archived/final-todo-count.js +122 -0
- package/.aios-core/infrastructure/scripts/_archived/fix-yaml-formatting.js +89 -0
- package/.aios-core/infrastructure/scripts/_archived/migration-generator.js +780 -0
- package/.aios-core/infrastructure/scripts/_archived/migration-path-generator.js +950 -0
- package/.aios-core/infrastructure/scripts/_archived/phase2-entrada-saida-errors.js +425 -0
- package/.aios-core/infrastructure/scripts/_archived/phase2-spot-check.js +132 -0
- package/.aios-core/infrastructure/scripts/_archived/phase3-tools-scripts-validation.js +381 -0
- package/.aios-core/infrastructure/scripts/_archived/phase4-metadata-performance.js +203 -0
- package/.aios-core/infrastructure/scripts/_archived/test-yaml-parsing.js +24 -0
- package/.aios-core/infrastructure/scripts/_archived/verify-yaml-fix.js +51 -0
- package/.aios-core/infrastructure/scripts/aios-validator.js +294 -0
- package/.aios-core/infrastructure/scripts/approval-workflow.js +643 -0
- package/.aios-core/infrastructure/scripts/atomic-layer-classifier.js +308 -0
- package/.aios-core/infrastructure/scripts/backup-manager.js +607 -0
- package/.aios-core/infrastructure/scripts/batch-creator.js +608 -0
- package/.aios-core/infrastructure/scripts/branch-manager.js +391 -0
- package/.aios-core/infrastructure/scripts/capability-analyzer.js +535 -0
- package/.aios-core/infrastructure/scripts/clickup-helpers.js +226 -0
- package/.aios-core/infrastructure/scripts/code-quality-improver.js +1312 -0
- package/.aios-core/infrastructure/scripts/commit-message-generator.js +850 -0
- package/.aios-core/infrastructure/scripts/component-generator.js +738 -0
- package/.aios-core/infrastructure/scripts/component-metadata.js +627 -0
- package/.aios-core/infrastructure/scripts/component-search.js +277 -0
- package/.aios-core/infrastructure/scripts/config-cache.js +322 -0
- package/.aios-core/infrastructure/scripts/config-loader.js +349 -0
- package/.aios-core/infrastructure/scripts/conflict-resolver.js +675 -0
- package/.aios-core/infrastructure/scripts/coverage-analyzer.js +882 -0
- package/.aios-core/infrastructure/scripts/dependency-analyzer.js +638 -0
- package/.aios-core/infrastructure/scripts/dependency-impact-analyzer.js +703 -0
- package/.aios-core/infrastructure/scripts/diff-generator.js +129 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/brownfield-analyzer.js +501 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +329 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +282 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js +331 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js +313 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/index.js +74 -0
- package/.aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js +358 -0
- package/.aios-core/infrastructure/scripts/documentation-synchronizer.js +1432 -0
- package/.aios-core/infrastructure/scripts/framework-analyzer.js +746 -0
- package/.aios-core/infrastructure/scripts/git-config-detector.js +293 -0
- package/.aios-core/infrastructure/scripts/git-wrapper.js +443 -0
- package/.aios-core/infrastructure/scripts/improvement-engine.js +758 -0
- package/.aios-core/infrastructure/scripts/improvement-validator.js +710 -0
- package/.aios-core/infrastructure/scripts/llm-routing/install-llm-routing.js +267 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free.cmd +80 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free.sh +62 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-max.cmd +26 -0
- package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-max.sh +18 -0
- package/.aios-core/infrastructure/scripts/modification-risk-assessment.js +970 -0
- package/.aios-core/infrastructure/scripts/modification-validator.js +555 -0
- package/.aios-core/infrastructure/scripts/output-formatter.js +297 -0
- package/.aios-core/infrastructure/scripts/performance-analyzer.js +758 -0
- package/.aios-core/infrastructure/scripts/performance-and-error-resolver.js +258 -0
- package/.aios-core/infrastructure/scripts/performance-optimizer.js +1902 -0
- package/.aios-core/infrastructure/scripts/performance-tracker.js +452 -0
- package/.aios-core/infrastructure/scripts/pm-adapter-factory.js +181 -0
- package/.aios-core/infrastructure/scripts/pm-adapter.js +134 -0
- package/.aios-core/infrastructure/scripts/project-status-loader.js +445 -0
- package/.aios-core/infrastructure/scripts/refactoring-suggester.js +1139 -0
- package/.aios-core/infrastructure/scripts/repository-detector.js +64 -0
- package/.aios-core/infrastructure/scripts/sandbox-tester.js +618 -0
- package/.aios-core/infrastructure/scripts/security-checker.js +359 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/index.js +375 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/manifest-generator.js +410 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/naming-rules.yaml +285 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/placement-rules.yaml +262 -0
- package/.aios-core/infrastructure/scripts/source-tree-guardian/validator.js +468 -0
- package/.aios-core/infrastructure/scripts/spot-check-validator.js +149 -0
- package/.aios-core/infrastructure/scripts/status-mapper.js +115 -0
- package/.aios-core/infrastructure/scripts/template-engine.js +240 -0
- package/.aios-core/infrastructure/scripts/template-validator.js +279 -0
- package/.aios-core/infrastructure/scripts/test-generator.js +844 -0
- package/.aios-core/infrastructure/scripts/test-quality-assessment.js +1081 -0
- package/.aios-core/infrastructure/scripts/test-utilities-fast.js +126 -0
- package/.aios-core/infrastructure/scripts/test-utilities.js +200 -0
- package/.aios-core/infrastructure/scripts/tool-resolver.js +360 -0
- package/.aios-core/infrastructure/scripts/transaction-manager.js +590 -0
- package/.aios-core/infrastructure/scripts/usage-analytics.js +634 -0
- package/.aios-core/infrastructure/scripts/validate-output-pattern.js +213 -0
- package/.aios-core/infrastructure/scripts/visual-impact-generator.js +1056 -0
- package/.aios-core/infrastructure/scripts/yaml-validator.js +397 -0
- package/.aios-core/infrastructure/templates/coderabbit.yaml.template +279 -0
- package/.aios-core/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +182 -0
- package/.aios-core/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +127 -0
- package/.aios-core/infrastructure/templates/github-workflows/README.md +109 -0
- package/.aios-core/infrastructure/templates/github-workflows/ci.yml.template +169 -0
- package/.aios-core/infrastructure/templates/github-workflows/pr-automation.yml.template +330 -0
- package/.aios-core/infrastructure/templates/github-workflows/release.yml.template +196 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +63 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -0
- package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -0
- package/.aios-core/infrastructure/templates/project-docs/coding-standards-tmpl.md +346 -0
- package/.aios-core/infrastructure/templates/project-docs/source-tree-tmpl.md +177 -0
- package/.aios-core/infrastructure/templates/project-docs/tech-stack-tmpl.md +267 -0
- package/.aios-core/infrastructure/tests/project-status-loader.test.js +394 -0
- package/.aios-core/infrastructure/tests/regression-suite-v2.md +621 -0
- package/.aios-core/infrastructure/tests/utilities-audit-results.json +501 -0
- package/.aios-core/infrastructure/tests/validate-module.js +97 -0
- package/.aios-core/infrastructure/tools/README.md +222 -0
- package/.aios-core/infrastructure/tools/cli/github-cli.yaml +200 -0
- package/.aios-core/infrastructure/tools/cli/llm-routing.yaml +126 -0
- package/.aios-core/infrastructure/tools/cli/railway-cli.yaml +260 -0
- package/.aios-core/infrastructure/tools/cli/supabase-cli.yaml +224 -0
- package/.aios-core/infrastructure/tools/local/ffmpeg.yaml +261 -0
- package/.aios-core/infrastructure/tools/mcp/21st-dev-magic.yaml +127 -0
- package/.aios-core/infrastructure/tools/mcp/browser.yaml +103 -0
- package/.aios-core/infrastructure/tools/mcp/clickup.yaml +534 -0
- package/.aios-core/infrastructure/tools/mcp/context7.yaml +78 -0
- package/.aios-core/infrastructure/tools/mcp/desktop-commander.yaml +180 -0
- package/.aios-core/infrastructure/tools/mcp/exa.yaml +103 -0
- package/.aios-core/infrastructure/tools/mcp/google-workspace.yaml +930 -0
- package/.aios-core/infrastructure/tools/mcp/n8n.yaml +551 -0
- package/.aios-core/infrastructure/tools/mcp/supabase.yaml +808 -0
- package/.aios-core/install-manifest.yaml +347 -0
- package/.aios-core/manifests/agents.csv +1 -0
- package/.aios-core/manifests/schema/manifest-schema.json +190 -0
- package/.aios-core/manifests/tasks.csv +121 -0
- package/.aios-core/manifests/workers.csv +204 -0
- package/.aios-core/package.json +103 -0
- package/.aios-core/product/README.md +56 -0
- package/.aios-core/product/checklists/architect-checklist.md +444 -0
- package/.aios-core/product/checklists/change-checklist.md +183 -0
- package/.aios-core/product/checklists/database-design-checklist.md +119 -0
- package/.aios-core/product/checklists/dba-predeploy-checklist.md +97 -0
- package/.aios-core/product/checklists/dba-rollback-checklist.md +99 -0
- package/.aios-core/product/checklists/pm-checklist.md +376 -0
- package/.aios-core/product/checklists/po-master-checklist.md +442 -0
- package/.aios-core/product/checklists/pre-push-checklist.md +108 -0
- package/.aios-core/product/checklists/release-checklist.md +122 -0
- package/.aios-core/product/checklists/story-dod-checklist.md +102 -0
- package/.aios-core/product/checklists/story-draft-checklist.md +216 -0
- package/.aios-core/product/data/brainstorming-techniques.md +37 -0
- package/.aios-core/product/data/elicitation-methods.md +135 -0
- package/.aios-core/product/data/mode-selection-best-practices.md +471 -0
- package/.aios-core/product/data/test-levels-framework.md +149 -0
- package/.aios-core/product/data/test-priorities-matrix.md +175 -0
- package/.aios-core/product/templates/1mcp-config.yaml +225 -0
- package/.aios-core/product/templates/activation-instructions-inline-greeting.yaml +63 -0
- package/.aios-core/product/templates/activation-instructions-template.md +258 -0
- package/.aios-core/product/templates/adr.hbs +125 -0
- package/.aios-core/product/templates/agent-template.yaml +121 -0
- package/.aios-core/product/templates/architecture-tmpl.yaml +651 -0
- package/.aios-core/product/templates/brainstorming-output-tmpl.yaml +156 -0
- package/.aios-core/product/templates/brownfield-architecture-tmpl.yaml +476 -0
- package/.aios-core/product/templates/brownfield-prd-tmpl.yaml +280 -0
- package/.aios-core/product/templates/changelog-template.md +134 -0
- package/.aios-core/product/templates/command-rationalization-matrix.md +152 -0
- package/.aios-core/product/templates/competitor-analysis-tmpl.yaml +293 -0
- package/.aios-core/product/templates/component-react-tmpl.tsx +98 -0
- package/.aios-core/product/templates/dbdr.hbs +241 -0
- package/.aios-core/product/templates/design-story-tmpl.yaml +587 -0
- package/.aios-core/product/templates/ds-artifact-analysis.md +70 -0
- package/.aios-core/product/templates/engine/elicitation.js +298 -0
- package/.aios-core/product/templates/engine/index.js +308 -0
- package/.aios-core/product/templates/engine/loader.js +231 -0
- package/.aios-core/product/templates/engine/renderer.js +343 -0
- package/.aios-core/product/templates/engine/schemas/adr.schema.json +102 -0
- package/.aios-core/product/templates/engine/schemas/dbdr.schema.json +205 -0
- package/.aios-core/product/templates/engine/schemas/epic.schema.json +175 -0
- package/.aios-core/product/templates/engine/schemas/pmdr.schema.json +175 -0
- package/.aios-core/product/templates/engine/schemas/prd-v2.schema.json +300 -0
- package/.aios-core/product/templates/engine/schemas/prd.schema.json +152 -0
- package/.aios-core/product/templates/engine/schemas/story.schema.json +222 -0
- package/.aios-core/product/templates/engine/schemas/task.schema.json +154 -0
- package/.aios-core/product/templates/engine/validator.js +294 -0
- package/.aios-core/product/templates/epic.hbs +212 -0
- package/.aios-core/product/templates/eslintrc-security.json +32 -0
- package/.aios-core/product/templates/front-end-architecture-tmpl.yaml +206 -0
- package/.aios-core/product/templates/front-end-spec-tmpl.yaml +349 -0
- package/.aios-core/product/templates/fullstack-architecture-tmpl.yaml +805 -0
- package/.aios-core/product/templates/github-actions-cd.yml +212 -0
- package/.aios-core/product/templates/github-actions-ci.yml +172 -0
- package/.aios-core/product/templates/github-pr-template.md +67 -0
- package/.aios-core/product/templates/gordon-mcp.yaml +140 -0
- package/.aios-core/product/templates/ide-rules/antigravity-rules.md +115 -0
- package/.aios-core/product/templates/ide-rules/claude-rules.md +221 -0
- package/.aios-core/product/templates/ide-rules/cline-rules.md +84 -0
- package/.aios-core/product/templates/ide-rules/copilot-rules.md +92 -0
- package/.aios-core/product/templates/ide-rules/cursor-rules.md +115 -0
- package/.aios-core/product/templates/ide-rules/gemini-rules.md +85 -0
- package/.aios-core/product/templates/ide-rules/roo-rules.md +86 -0
- package/.aios-core/product/templates/ide-rules/trae-rules.md +104 -0
- package/.aios-core/product/templates/ide-rules/windsurf-rules.md +80 -0
- package/.aios-core/product/templates/index-strategy-tmpl.yaml +53 -0
- package/.aios-core/product/templates/market-research-tmpl.yaml +252 -0
- package/.aios-core/product/templates/mcp-workflow.js +271 -0
- package/.aios-core/product/templates/migration-plan-tmpl.yaml +1022 -0
- package/.aios-core/product/templates/migration-strategy-tmpl.md +524 -0
- package/.aios-core/product/templates/personalized-agent-template.md +258 -0
- package/.aios-core/product/templates/personalized-checklist-template.md +340 -0
- package/.aios-core/product/templates/personalized-task-template-v2.md +905 -0
- package/.aios-core/product/templates/personalized-task-template.md +344 -0
- package/.aios-core/product/templates/personalized-template-file.yaml +322 -0
- package/.aios-core/product/templates/personalized-workflow-template.yaml +460 -0
- package/.aios-core/product/templates/pmdr.hbs +186 -0
- package/.aios-core/product/templates/prd-tmpl.yaml +202 -0
- package/.aios-core/product/templates/prd-v2.0.hbs +216 -0
- package/.aios-core/product/templates/prd.hbs +201 -0
- package/.aios-core/product/templates/project-brief-tmpl.yaml +221 -0
- package/.aios-core/product/templates/qa-gate-tmpl.yaml +240 -0
- package/.aios-core/product/templates/rls-policies-tmpl.yaml +1203 -0
- package/.aios-core/product/templates/schema-design-tmpl.yaml +428 -0
- package/.aios-core/product/templates/shock-report-tmpl.html +502 -0
- package/.aios-core/product/templates/state-persistence-tmpl.yaml +219 -0
- package/.aios-core/product/templates/story-tmpl.yaml +332 -0
- package/.aios-core/product/templates/story.hbs +263 -0
- package/.aios-core/product/templates/task-execution-report.md +495 -0
- package/.aios-core/product/templates/task-template.md +123 -0
- package/.aios-core/product/templates/task.hbs +170 -0
- package/.aios-core/product/templates/tmpl-comment-on-examples.sql +158 -0
- package/.aios-core/product/templates/tmpl-migration-script.sql +91 -0
- package/.aios-core/product/templates/tmpl-rls-granular-policies.sql +104 -0
- package/.aios-core/product/templates/tmpl-rls-kiss-policy.sql +10 -0
- package/.aios-core/product/templates/tmpl-rls-roles.sql +135 -0
- package/.aios-core/product/templates/tmpl-rls-simple.sql +77 -0
- package/.aios-core/product/templates/tmpl-rls-tenant.sql +152 -0
- package/.aios-core/product/templates/tmpl-rollback-script.sql +77 -0
- package/.aios-core/product/templates/tmpl-seed-data.sql +140 -0
- package/.aios-core/product/templates/tmpl-smoke-test.sql +16 -0
- package/.aios-core/product/templates/tmpl-staging-copy-merge.sql +139 -0
- package/.aios-core/product/templates/tmpl-stored-proc.sql +140 -0
- package/.aios-core/product/templates/tmpl-trigger.sql +152 -0
- package/.aios-core/product/templates/tmpl-view-materialized.sql +133 -0
- package/.aios-core/product/templates/tmpl-view.sql +177 -0
- package/.aios-core/product/templates/token-exports-css-tmpl.css +240 -0
- package/.aios-core/product/templates/token-exports-tailwind-tmpl.js +395 -0
- package/.aios-core/product/templates/tokens-schema-tmpl.yaml +305 -0
- package/.aios-core/product/templates/workflow-template.yaml +134 -0
- package/.aios-core/quality/metrics-collector.js +572 -0
- package/.aios-core/quality/metrics-hook.js +260 -0
- package/.aios-core/quality/schemas/quality-metrics.schema.json +233 -0
- package/.aios-core/quality/seed-metrics.js +336 -0
- package/.aios-core/scripts/README.md +354 -0
- package/.aios-core/scripts/aios-doc-template.md +325 -0
- package/.aios-core/scripts/batch-migrate-phase1.ps1 +36 -0
- package/.aios-core/scripts/batch-migrate-phase2.ps1 +88 -0
- package/.aios-core/scripts/batch-migrate-phase3.ps1 +45 -0
- package/.aios-core/scripts/command-execution-hook.js +201 -0
- package/.aios-core/scripts/context-detector.js +226 -0
- package/.aios-core/scripts/elicitation-engine.js +385 -0
- package/.aios-core/scripts/elicitation-session-manager.js +300 -0
- package/.aios-core/scripts/migrate-framework-docs.sh +300 -0
- package/.aios-core/scripts/session-context-loader.js +286 -0
- package/.aios-core/scripts/test-template-system.js +941 -0
- package/.aios-core/scripts/validate-phase1.ps1 +35 -0
- package/.aios-core/scripts/workflow-management.md +69 -0
- package/.aios-core/tasks/find-component.md.legacy +391 -0
- package/.aios-core/tasks/generate-commit-message.md.legacy +426 -0
- package/.aios-core/tasks/generate-migration.md.legacy +382 -0
- package/.aios-core/tasks/rollback-modification.md.legacy +307 -0
- package/.aios-core/tasks/update-tests.md.legacy +283 -0
- package/.aios-core/user-guide.md +1413 -0
- package/.aios-core/working-in-the-brownfield.md +361 -0
- package/.claude/CLAUDE.md +221 -0
- package/LICENSE +48 -0
- package/README.md +703 -0
- package/bin/aios-init-old.js +532 -0
- package/bin/aios-init-v4.js +390 -0
- package/bin/aios-init.backup-v1.1.4.js +352 -0
- package/bin/aios-init.js +736 -0
- package/bin/aios-minimal.js +26 -0
- package/bin/aios.js +279 -0
- package/bin/migrate-pm-config.js +219 -0
- package/bin/modules/env-config.js +436 -0
- package/bin/modules/mcp-installer.js +383 -0
- package/bin/utils/install-errors.js +339 -0
- package/bin/utils/install-transaction.js +445 -0
- package/index.d.ts +19 -0
- package/index.esm.js +21 -0
- package/index.js +94 -0
- package/package.json +161 -0
- package/packages/installer/package.json +39 -0
- package/packages/installer/src/config/configure-environment.js +312 -0
- package/packages/installer/src/config/templates/core-config-template.js +183 -0
- package/packages/installer/src/config/templates/env-template.js +127 -0
- package/packages/installer/src/config/validation/config-validator.js +243 -0
- package/packages/installer/src/detection/detect-project-type.js +81 -0
- package/packages/installer/src/wizard/wizard.js +244 -0
- package/packages/installer/tests/integration/environment-configuration.test.js +328 -0
- package/packages/installer/tests/integration/wizard-detection.test.js +349 -0
- package/packages/installer/tests/unit/config-validator.test.js +315 -0
- package/packages/installer/tests/unit/detection/detect-project-type.test.js +401 -0
- package/packages/installer/tests/unit/env-template.test.js +185 -0
- package/src/config/ide-configs.js +189 -0
- package/src/installer/aios-core-installer.js +319 -0
- package/src/installer/dependency-installer.js +335 -0
- package/src/utils/aios-colors.js +234 -0
- package/src/wizard/feedback.js +218 -0
- package/src/wizard/ide-config-generator.js +488 -0
- package/src/wizard/ide-selector.js +84 -0
- package/src/wizard/index.js +589 -0
- package/src/wizard/questions.js +249 -0
- package/src/wizard/validation/index.js +120 -0
- package/src/wizard/validation/report-generator.js +269 -0
- package/src/wizard/validation/troubleshooting-system.js +346 -0
- package/src/wizard/validation/validators/config-validator.js +362 -0
- package/src/wizard/validation/validators/dependency-validator.js +333 -0
- package/src/wizard/validation/validators/file-structure-validator.js +181 -0
- package/src/wizard/validation/validators/mcp-health-checker.js +310 -0
- package/src/wizard/validators.js +274 -0
- package/templates/squad/LICENSE +21 -0
- package/templates/squad/README.md +37 -0
- package/templates/squad/agents/example-agent.yaml +36 -0
- package/templates/squad/package.json +19 -0
- package/templates/squad/squad.yaml +25 -0
- package/templates/squad/tasks/example-task.yaml +46 -0
- package/templates/squad/templates/example-template.md +24 -0
- package/templates/squad/tests/example-agent.test.js +53 -0
- package/templates/squad/workflows/example-workflow.yaml +54 -0
- package/tools/package-builder.js +35 -0
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Modification risk assessment for AIOS-FULLSTACK framework
|
|
7
|
+
* Evaluates modification risks across multiple dimensions
|
|
8
|
+
*/
|
|
9
|
+
class ModificationRiskAssessment {
|
|
10
|
+
constructor(options = {}) {
|
|
11
|
+
this.rootPath = options.rootPath || process.cwd();
|
|
12
|
+
this.riskFactors = new Map();
|
|
13
|
+
this.riskProfiles = new Map();
|
|
14
|
+
this.assessmentHistory = [];
|
|
15
|
+
this.riskThresholds = {
|
|
16
|
+
low: { min: 0, max: 3 },
|
|
17
|
+
medium: { min: 3, max: 6 },
|
|
18
|
+
high: { min: 6, max: 8 },
|
|
19
|
+
critical: { min: 8, max: 10 },
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Assess risks for a component modification
|
|
25
|
+
*/
|
|
26
|
+
async assessRisks(targetComponent, analysisData, options = {}) {
|
|
27
|
+
const assessmentId = `risk-${Date.now()}`;
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
console.log(chalk.blue(`⚠️ Assessing modification risks for: ${targetComponent.path}`));
|
|
31
|
+
|
|
32
|
+
const config = {
|
|
33
|
+
riskThreshold: options.riskThreshold || 'medium',
|
|
34
|
+
includeMitigations: options.includeMitigations !== false,
|
|
35
|
+
assessmentDepth: options.assessmentDepth || 'comprehensive',
|
|
36
|
+
modificationType: options.modificationType || 'modify',
|
|
37
|
+
...options,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Analyze risk factors across multiple dimensions
|
|
41
|
+
const riskDimensions = await this.analyzeRiskDimensions(targetComponent, analysisData, config);
|
|
42
|
+
|
|
43
|
+
// Calculate overall risk score
|
|
44
|
+
const overallRisk = this.calculateOverallRisk(riskDimensions);
|
|
45
|
+
|
|
46
|
+
// Identify critical issues
|
|
47
|
+
const criticalIssues = this.identifyCriticalIssues(riskDimensions, analysisData);
|
|
48
|
+
|
|
49
|
+
// Generate risk factors list
|
|
50
|
+
const riskFactors = this.generateRiskFactors(riskDimensions, analysisData);
|
|
51
|
+
|
|
52
|
+
// Create risk mitigation recommendations
|
|
53
|
+
const recommendations = await this.generateRiskRecommendations(
|
|
54
|
+
targetComponent,
|
|
55
|
+
riskDimensions,
|
|
56
|
+
criticalIssues,
|
|
57
|
+
config,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// Generate risk timeline and impact projection
|
|
61
|
+
const riskProjection = await this.generateRiskProjection(
|
|
62
|
+
targetComponent,
|
|
63
|
+
riskDimensions,
|
|
64
|
+
analysisData,
|
|
65
|
+
config,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const assessment = {
|
|
69
|
+
assessmentId: assessmentId,
|
|
70
|
+
targetComponent: {
|
|
71
|
+
path: targetComponent.path,
|
|
72
|
+
type: targetComponent.type,
|
|
73
|
+
},
|
|
74
|
+
modificationType: config.modificationType,
|
|
75
|
+
overallRisk: overallRisk.level,
|
|
76
|
+
riskScore: overallRisk.score,
|
|
77
|
+
riskDimensions: riskDimensions,
|
|
78
|
+
criticalIssues: criticalIssues,
|
|
79
|
+
riskFactors: riskFactors,
|
|
80
|
+
recommendations: recommendations,
|
|
81
|
+
riskProjection: riskProjection,
|
|
82
|
+
assessmentMetadata: {
|
|
83
|
+
threshold: config.riskThreshold,
|
|
84
|
+
depth: config.assessmentDepth,
|
|
85
|
+
timestamp: new Date().toISOString(),
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Store assessment for tracking
|
|
90
|
+
this.assessmentHistory.push({
|
|
91
|
+
assessmentId: assessmentId,
|
|
92
|
+
componentPath: targetComponent.path,
|
|
93
|
+
riskLevel: overallRisk.level,
|
|
94
|
+
riskScore: overallRisk.score,
|
|
95
|
+
timestamp: assessment.assessmentMetadata.timestamp,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
console.log(chalk.green('✅ Risk assessment completed'));
|
|
99
|
+
console.log(chalk.gray(` Overall risk: ${this.formatRiskLevel(overallRisk.level)}`));
|
|
100
|
+
console.log(chalk.gray(` Critical issues: ${criticalIssues.length}`));
|
|
101
|
+
console.log(chalk.gray(` Recommendations: ${recommendations.length}`));
|
|
102
|
+
|
|
103
|
+
return assessment;
|
|
104
|
+
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error(chalk.red(`Risk assessment failed: ${error.message}`));
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Analyze risk across multiple dimensions
|
|
113
|
+
*/
|
|
114
|
+
async analyzeRiskDimensions(targetComponent, analysisData, config) {
|
|
115
|
+
const dimensions = {
|
|
116
|
+
dependency_risk: await this.assessDependencyRisk(targetComponent, analysisData.dependencyImpact),
|
|
117
|
+
propagation_risk: await this.assessPropagationRisk(targetComponent, analysisData.propagationAnalysis),
|
|
118
|
+
structural_risk: await this.assessStructuralRisk(targetComponent, config),
|
|
119
|
+
operational_risk: await this.assessOperationalRisk(targetComponent, analysisData, config),
|
|
120
|
+
security_risk: await this.assessSecurityRisk(targetComponent, config),
|
|
121
|
+
compatibility_risk: await this.assessCompatibilityRisk(targetComponent, analysisData, config),
|
|
122
|
+
rollback_risk: await this.assessRollbackRisk(targetComponent, config),
|
|
123
|
+
testing_risk: await this.assessTestingRisk(targetComponent, analysisData),
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return dimensions;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Assess dependency-related risks
|
|
131
|
+
*/
|
|
132
|
+
async assessDependencyRisk(targetComponent, dependencyImpact) {
|
|
133
|
+
const risk = {
|
|
134
|
+
score: 0,
|
|
135
|
+
factors: [],
|
|
136
|
+
severity: 'low',
|
|
137
|
+
description: 'Risk from component dependencies and dependents',
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
if (!dependencyImpact) {
|
|
141
|
+
risk.score = 2;
|
|
142
|
+
risk.factors.push('Dependency analysis not available');
|
|
143
|
+
return risk;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// High number of affected components increases risk
|
|
147
|
+
const affectedCount = dependencyImpact.affectedComponents.length;
|
|
148
|
+
if (affectedCount > 20) {
|
|
149
|
+
risk.score += 3;
|
|
150
|
+
risk.factors.push(`High number of affected components (${affectedCount})`);
|
|
151
|
+
} else if (affectedCount > 10) {
|
|
152
|
+
risk.score += 2;
|
|
153
|
+
risk.factors.push(`Moderate number of affected components (${affectedCount})`);
|
|
154
|
+
} else if (affectedCount > 5) {
|
|
155
|
+
risk.score += 1;
|
|
156
|
+
risk.factors.push(`Some affected components (${affectedCount})`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Critical and high impact components increase risk
|
|
160
|
+
const criticalComponents = dependencyImpact.impactCategories?.critical?.length || 0;
|
|
161
|
+
const highImpactComponents = dependencyImpact.impactCategories?.high?.length || 0;
|
|
162
|
+
|
|
163
|
+
if (criticalComponents > 0) {
|
|
164
|
+
risk.score += 3;
|
|
165
|
+
risk.factors.push(`${criticalComponents} critical impact components`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (highImpactComponents > 0) {
|
|
169
|
+
risk.score += 2;
|
|
170
|
+
risk.factors.push(`${highImpactComponents} high impact components`);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Framework core dependencies are high risk
|
|
174
|
+
const frameworkCoreComponents = dependencyImpact.affectedComponents.filter(comp =>
|
|
175
|
+
comp.path.includes('aios-core') && comp.impactScore >= 7,
|
|
176
|
+
).length;
|
|
177
|
+
|
|
178
|
+
if (frameworkCoreComponents > 0) {
|
|
179
|
+
risk.score += 2;
|
|
180
|
+
risk.factors.push(`${frameworkCoreComponents} framework core dependencies affected`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
risk.score = Math.min(10, risk.score);
|
|
184
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
185
|
+
|
|
186
|
+
return risk;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Assess change propagation risks
|
|
191
|
+
*/
|
|
192
|
+
async assessPropagationRisk(targetComponent, propagationAnalysis) {
|
|
193
|
+
const risk = {
|
|
194
|
+
score: 0,
|
|
195
|
+
factors: [],
|
|
196
|
+
severity: 'low',
|
|
197
|
+
description: 'Risk from change propagation through system',
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
if (!propagationAnalysis) {
|
|
201
|
+
risk.score = 2;
|
|
202
|
+
risk.factors.push('Propagation analysis not available');
|
|
203
|
+
return risk;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Deep propagation increases risk
|
|
207
|
+
const maxDepth = propagationAnalysis.statistics?.maxDepth || 0;
|
|
208
|
+
if (maxDepth >= 5) {
|
|
209
|
+
risk.score += 3;
|
|
210
|
+
risk.factors.push(`Very deep propagation (depth: ${maxDepth})`);
|
|
211
|
+
} else if (maxDepth >= 3) {
|
|
212
|
+
risk.score += 2;
|
|
213
|
+
risk.factors.push(`Deep propagation (depth: ${maxDepth})`);
|
|
214
|
+
} else if (maxDepth >= 2) {
|
|
215
|
+
risk.score += 1;
|
|
216
|
+
risk.factors.push(`Moderate propagation (depth: ${maxDepth})`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Many cascading effects increase risk
|
|
220
|
+
const cascadingCount = propagationAnalysis.cascadingEffects?.length || 0;
|
|
221
|
+
if (cascadingCount > 10) {
|
|
222
|
+
risk.score += 2;
|
|
223
|
+
risk.factors.push(`Many cascading effects (${cascadingCount})`);
|
|
224
|
+
} else if (cascadingCount > 5) {
|
|
225
|
+
risk.score += 1;
|
|
226
|
+
risk.factors.push(`Some cascading effects (${cascadingCount})`);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Breaking changes in propagation
|
|
230
|
+
const breakingChanges = [...(propagationAnalysis.directEffects || []), ...(propagationAnalysis.cascadingEffects || [])]
|
|
231
|
+
.filter(effect => effect.changeType?.severity === 'breaking').length;
|
|
232
|
+
|
|
233
|
+
if (breakingChanges > 0) {
|
|
234
|
+
risk.score += 3;
|
|
235
|
+
risk.factors.push(`${breakingChanges} breaking changes in propagation`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Critical propagation paths
|
|
239
|
+
const criticalPaths = propagationAnalysis.criticalPaths?.length || 0;
|
|
240
|
+
if (criticalPaths > 0) {
|
|
241
|
+
risk.score += 2;
|
|
242
|
+
risk.factors.push(`${criticalPaths} critical propagation paths identified`);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
risk.score = Math.min(10, risk.score);
|
|
246
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
247
|
+
|
|
248
|
+
return risk;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Assess structural risks
|
|
253
|
+
*/
|
|
254
|
+
async assessStructuralRisk(targetComponent, config) {
|
|
255
|
+
const risk = {
|
|
256
|
+
score: 0,
|
|
257
|
+
factors: [],
|
|
258
|
+
severity: 'low',
|
|
259
|
+
description: 'Risk from structural component changes',
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// Component type risk
|
|
263
|
+
switch (targetComponent.type) {
|
|
264
|
+
case 'agent':
|
|
265
|
+
risk.score += 2;
|
|
266
|
+
risk.factors.push('Agent modification affects system behavior');
|
|
267
|
+
break;
|
|
268
|
+
case 'workflow':
|
|
269
|
+
risk.score += 2;
|
|
270
|
+
risk.factors.push('Workflow modification affects process flow');
|
|
271
|
+
break;
|
|
272
|
+
case 'util':
|
|
273
|
+
if (targetComponent.path.includes('core') || targetComponent.path.includes('utils')) {
|
|
274
|
+
risk.score += 3;
|
|
275
|
+
risk.factors.push('Core utility modification affects multiple components');
|
|
276
|
+
} else {
|
|
277
|
+
risk.score += 1;
|
|
278
|
+
risk.factors.push('Utility modification has moderate impact');
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case 'task':
|
|
282
|
+
risk.score += 1;
|
|
283
|
+
risk.factors.push('Task modification has localized impact');
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Modification type risk
|
|
288
|
+
switch (config.modificationType) {
|
|
289
|
+
case 'remove':
|
|
290
|
+
risk.score += 4;
|
|
291
|
+
risk.factors.push('Component removal is high-risk');
|
|
292
|
+
break;
|
|
293
|
+
case 'deprecate':
|
|
294
|
+
risk.score += 2;
|
|
295
|
+
risk.factors.push('Component deprecation requires migration planning');
|
|
296
|
+
break;
|
|
297
|
+
case 'refactor':
|
|
298
|
+
risk.score += 2;
|
|
299
|
+
risk.factors.push('Refactoring may introduce breaking changes');
|
|
300
|
+
break;
|
|
301
|
+
case 'modify':
|
|
302
|
+
risk.score += 1;
|
|
303
|
+
risk.factors.push('Modification may affect component behavior');
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// File size and complexity risk
|
|
308
|
+
try {
|
|
309
|
+
const stats = await fs.stat(targetComponent.fullPath || targetComponent.path);
|
|
310
|
+
if (stats.size > 50000) { // Large files are riskier to modify
|
|
311
|
+
risk.score += 1;
|
|
312
|
+
risk.factors.push('Large file size increases modification risk');
|
|
313
|
+
}
|
|
314
|
+
} catch (error) {
|
|
315
|
+
// File stats not available
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
risk.score = Math.min(10, risk.score);
|
|
319
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
320
|
+
|
|
321
|
+
return risk;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Assess operational risks
|
|
326
|
+
*/
|
|
327
|
+
async assessOperationalRisk(targetComponent, analysisData, config) {
|
|
328
|
+
const risk = {
|
|
329
|
+
score: 0,
|
|
330
|
+
factors: [],
|
|
331
|
+
severity: 'low',
|
|
332
|
+
description: 'Risk to operational stability and performance',
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// Production usage risk
|
|
336
|
+
if (targetComponent.path.includes('agent') || targetComponent.path.includes('workflow')) {
|
|
337
|
+
risk.score += 2;
|
|
338
|
+
risk.factors.push('Component likely used in production workflows');
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Performance impact risk
|
|
342
|
+
if (targetComponent.type === 'util' && targetComponent.path.includes('core')) {
|
|
343
|
+
risk.score += 2;
|
|
344
|
+
risk.factors.push('Core utility changes may impact performance');
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Memory and resource usage changes
|
|
348
|
+
if (config.modificationType === 'refactor' || config.modificationType === 'modify') {
|
|
349
|
+
risk.score += 1;
|
|
350
|
+
risk.factors.push('Changes may affect resource usage patterns');
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Error handling and recovery
|
|
354
|
+
const hasErrorHandling = targetComponent.content &&
|
|
355
|
+
(targetComponent.content.includes('try') || targetComponent.content.includes('catch'));
|
|
356
|
+
|
|
357
|
+
if (!hasErrorHandling && targetComponent.type !== 'task') {
|
|
358
|
+
risk.score += 1;
|
|
359
|
+
risk.factors.push('Component lacks comprehensive error handling');
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Monitoring and observability
|
|
363
|
+
const hasLogging = targetComponent.content &&
|
|
364
|
+
(targetComponent.content.includes('console.log') || targetComponent.content.includes('logger'));
|
|
365
|
+
|
|
366
|
+
if (!hasLogging && (targetComponent.type === 'agent' || targetComponent.type === 'workflow')) {
|
|
367
|
+
risk.score += 1;
|
|
368
|
+
risk.factors.push('Limited observability for operational monitoring');
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
risk.score = Math.min(10, risk.score);
|
|
372
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
373
|
+
|
|
374
|
+
return risk;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Assess security risks
|
|
379
|
+
*/
|
|
380
|
+
async assessSecurityRisk(targetComponent, config) {
|
|
381
|
+
const risk = {
|
|
382
|
+
score: 0,
|
|
383
|
+
factors: [],
|
|
384
|
+
severity: 'low',
|
|
385
|
+
description: 'Security-related modification risks',
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// File system access
|
|
389
|
+
if (targetComponent.content && targetComponent.content.includes('fs.')) {
|
|
390
|
+
risk.score += 2;
|
|
391
|
+
risk.factors.push('Component has file system access');
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// External network access
|
|
395
|
+
if (targetComponent.content &&
|
|
396
|
+
(targetComponent.content.includes('http') || targetComponent.content.includes('fetch') ||
|
|
397
|
+
targetComponent.content.includes('axios'))) {
|
|
398
|
+
risk.score += 2;
|
|
399
|
+
risk.factors.push('Component makes external network requests');
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Process execution
|
|
403
|
+
if (targetComponent.content &&
|
|
404
|
+
(targetComponent.content.includes('exec') || targetComponent.content.includes('spawn'))) {
|
|
405
|
+
risk.score += 3;
|
|
406
|
+
risk.factors.push('Component executes external processes');
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// User input handling
|
|
410
|
+
if (targetComponent.content &&
|
|
411
|
+
(targetComponent.content.includes('input') || targetComponent.content.includes('prompt'))) {
|
|
412
|
+
risk.score += 1;
|
|
413
|
+
risk.factors.push('Component handles user input');
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Removal of security components
|
|
417
|
+
if (config.modificationType === 'remove' &&
|
|
418
|
+
(targetComponent.path.includes('security') || targetComponent.path.includes('validation'))) {
|
|
419
|
+
risk.score += 4;
|
|
420
|
+
risk.factors.push('Removing security-related component');
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
risk.score = Math.min(10, risk.score);
|
|
424
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
425
|
+
|
|
426
|
+
return risk;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Assess compatibility risks
|
|
431
|
+
*/
|
|
432
|
+
async assessCompatibilityRisk(targetComponent, analysisData, config) {
|
|
433
|
+
const risk = {
|
|
434
|
+
score: 0,
|
|
435
|
+
factors: [],
|
|
436
|
+
severity: 'low',
|
|
437
|
+
description: 'Risk to backward and forward compatibility',
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
// API changes
|
|
441
|
+
if (targetComponent.content &&
|
|
442
|
+
(targetComponent.content.includes('module.exports') || targetComponent.content.includes('export'))) {
|
|
443
|
+
if (config.modificationType === 'refactor' || config.modificationType === 'modify') {
|
|
444
|
+
risk.score += 2;
|
|
445
|
+
risk.factors.push('Modification may change public API');
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Configuration changes
|
|
450
|
+
if (targetComponent.type === 'agent' || targetComponent.type === 'workflow') {
|
|
451
|
+
if (config.modificationType !== 'remove') {
|
|
452
|
+
risk.score += 1;
|
|
453
|
+
risk.factors.push('Configuration changes may break existing setups');
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Version compatibility
|
|
458
|
+
if (config.modificationType === 'remove' || config.modificationType === 'deprecate') {
|
|
459
|
+
risk.score += 3;
|
|
460
|
+
risk.factors.push('Change affects version compatibility');
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// Framework evolution compatibility
|
|
464
|
+
if (targetComponent.path.includes('core') || targetComponent.path.includes('utils')) {
|
|
465
|
+
risk.score += 2;
|
|
466
|
+
risk.factors.push('Core component changes affect framework evolution');
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
risk.score = Math.min(10, risk.score);
|
|
470
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
471
|
+
|
|
472
|
+
return risk;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Assess rollback risks
|
|
477
|
+
*/
|
|
478
|
+
async assessRollbackRisk(targetComponent, config) {
|
|
479
|
+
const risk = {
|
|
480
|
+
score: 0,
|
|
481
|
+
factors: [],
|
|
482
|
+
severity: 'low',
|
|
483
|
+
description: 'Risk and difficulty of rolling back changes',
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
// Complex changes are harder to rollback
|
|
487
|
+
if (config.modificationType === 'refactor') {
|
|
488
|
+
risk.score += 2;
|
|
489
|
+
risk.factors.push('Refactoring changes are complex to rollback');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Removal is difficult to rollback
|
|
493
|
+
if (config.modificationType === 'remove') {
|
|
494
|
+
risk.score += 4;
|
|
495
|
+
risk.factors.push('Component removal difficult to rollback');
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// Multiple file dependencies
|
|
499
|
+
const hasMultipleDependencies = targetComponent.content &&
|
|
500
|
+
(targetComponent.content.match(/require\s*\(/g) || []).length > 5;
|
|
501
|
+
|
|
502
|
+
if (hasMultipleDependencies) {
|
|
503
|
+
risk.score += 1;
|
|
504
|
+
risk.factors.push('Multiple dependencies complicate rollback');
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// State changes
|
|
508
|
+
if (targetComponent.type === 'workflow' || targetComponent.type === 'agent') {
|
|
509
|
+
risk.score += 1;
|
|
510
|
+
risk.factors.push('State changes may persist after rollback');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// Database or persistent storage
|
|
514
|
+
if (targetComponent.content &&
|
|
515
|
+
(targetComponent.content.includes('database') || targetComponent.content.includes('storage'))) {
|
|
516
|
+
risk.score += 2;
|
|
517
|
+
risk.factors.push('Persistent storage changes complicate rollback');
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
risk.score = Math.min(10, risk.score);
|
|
521
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
522
|
+
|
|
523
|
+
return risk;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Assess testing-related risks
|
|
528
|
+
*/
|
|
529
|
+
async assessTestingRisk(targetComponent, analysisData) {
|
|
530
|
+
const risk = {
|
|
531
|
+
score: 0,
|
|
532
|
+
factors: [],
|
|
533
|
+
severity: 'low',
|
|
534
|
+
description: 'Risk from insufficient or outdated testing',
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
// Check if component has tests
|
|
538
|
+
const testFiles = await this.findComponentTestFiles(targetComponent);
|
|
539
|
+
|
|
540
|
+
if (testFiles.length === 0) {
|
|
541
|
+
risk.score += 3;
|
|
542
|
+
risk.factors.push('No existing tests found for component');
|
|
543
|
+
} else if (testFiles.length < 2) {
|
|
544
|
+
risk.score += 1;
|
|
545
|
+
risk.factors.push('Limited test coverage');
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Complex components without comprehensive tests
|
|
549
|
+
if (targetComponent.content) {
|
|
550
|
+
const functionCount = (targetComponent.content.match(/function\s+\w+/g) || []).length;
|
|
551
|
+
const methodCount = (targetComponent.content.match(/\w+\s*\([^)]*\)\s*{/g) || []).length;
|
|
552
|
+
|
|
553
|
+
if ((functionCount + methodCount) > 5 && testFiles.length < 2) {
|
|
554
|
+
risk.score += 2;
|
|
555
|
+
risk.factors.push('Complex component with insufficient tests');
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Integration testing gap
|
|
560
|
+
const hasIntegrationTests = testFiles.some(test => test.includes('integration'));
|
|
561
|
+
if (!hasIntegrationTests && (targetComponent.type === 'agent' || targetComponent.type === 'workflow')) {
|
|
562
|
+
risk.score += 2;
|
|
563
|
+
risk.factors.push('Missing integration tests for critical component');
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
risk.score = Math.min(10, risk.score);
|
|
567
|
+
risk.severity = this.scoresToSeverity(risk.score);
|
|
568
|
+
|
|
569
|
+
return risk;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Calculate overall risk from all dimensions
|
|
574
|
+
*/
|
|
575
|
+
calculateOverallRisk(riskDimensions) {
|
|
576
|
+
const dimensionWeights = {
|
|
577
|
+
dependency_risk: 0.2,
|
|
578
|
+
propagation_risk: 0.18,
|
|
579
|
+
structural_risk: 0.15,
|
|
580
|
+
operational_risk: 0.12,
|
|
581
|
+
security_risk: 0.15,
|
|
582
|
+
compatibility_risk: 0.1,
|
|
583
|
+
rollback_risk: 0.05,
|
|
584
|
+
testing_risk: 0.05,
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
let weightedScore = 0;
|
|
588
|
+
let totalWeight = 0;
|
|
589
|
+
|
|
590
|
+
for (const [dimension, weight] of Object.entries(dimensionWeights)) {
|
|
591
|
+
if (riskDimensions[dimension]) {
|
|
592
|
+
weightedScore += riskDimensions[dimension].score * weight;
|
|
593
|
+
totalWeight += weight;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
const overallScore = totalWeight > 0 ? weightedScore / totalWeight : 0;
|
|
598
|
+
const roundedScore = Math.round(overallScore * 10) / 10;
|
|
599
|
+
|
|
600
|
+
return {
|
|
601
|
+
score: roundedScore,
|
|
602
|
+
level: this.scoresToRiskLevel(roundedScore),
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Identify critical issues requiring immediate attention
|
|
608
|
+
*/
|
|
609
|
+
identifyCriticalIssues(riskDimensions, analysisData) {
|
|
610
|
+
const criticalIssues = [];
|
|
611
|
+
|
|
612
|
+
// Check each dimension for critical severity
|
|
613
|
+
for (const [dimension, riskData] of Object.entries(riskDimensions)) {
|
|
614
|
+
if (riskData.severity === 'critical' || riskData.score >= 8) {
|
|
615
|
+
criticalIssues.push({
|
|
616
|
+
dimension: dimension,
|
|
617
|
+
severity: 'critical',
|
|
618
|
+
score: riskData.score,
|
|
619
|
+
description: riskData.description,
|
|
620
|
+
factors: riskData.factors,
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// Special critical conditions
|
|
626
|
+
if (analysisData.dependencyImpact?.impactCategories?.critical?.length > 0) {
|
|
627
|
+
criticalIssues.push({
|
|
628
|
+
dimension: 'dependency_critical',
|
|
629
|
+
severity: 'critical',
|
|
630
|
+
score: 9,
|
|
631
|
+
description: 'Critical components affected by modification',
|
|
632
|
+
factors: [`${analysisData.dependencyImpact.impactCategories.critical.length} critical dependencies`],
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (analysisData.propagationAnalysis?.criticalPaths?.length > 2) {
|
|
637
|
+
criticalIssues.push({
|
|
638
|
+
dimension: 'propagation_critical',
|
|
639
|
+
severity: 'critical',
|
|
640
|
+
score: 8,
|
|
641
|
+
description: 'Multiple critical propagation paths detected',
|
|
642
|
+
factors: [`${analysisData.propagationAnalysis.criticalPaths.length} critical paths`],
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return criticalIssues;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Generate comprehensive risk factors list
|
|
651
|
+
*/
|
|
652
|
+
generateRiskFactors(riskDimensions, analysisData) {
|
|
653
|
+
const riskFactors = [];
|
|
654
|
+
|
|
655
|
+
for (const [dimension, riskData] of Object.entries(riskDimensions)) {
|
|
656
|
+
if (riskData.score > 0) {
|
|
657
|
+
riskFactors.push({
|
|
658
|
+
category: dimension.replace('_risk', ''),
|
|
659
|
+
severity: riskData.severity,
|
|
660
|
+
score: riskData.score,
|
|
661
|
+
description: riskData.description,
|
|
662
|
+
factors: riskData.factors,
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return riskFactors.sort((a, b) => b.score - a.score);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Generate risk mitigation recommendations
|
|
672
|
+
*/
|
|
673
|
+
async generateRiskRecommendations(targetComponent, riskDimensions, criticalIssues, config) {
|
|
674
|
+
const recommendations = [];
|
|
675
|
+
|
|
676
|
+
// Critical issue recommendations
|
|
677
|
+
if (criticalIssues.length > 0) {
|
|
678
|
+
recommendations.push({
|
|
679
|
+
priority: 'critical',
|
|
680
|
+
title: 'Address Critical Risk Issues',
|
|
681
|
+
description: `${criticalIssues.length} critical issues identified that require immediate attention`,
|
|
682
|
+
actions: [
|
|
683
|
+
'Review all critical issues before proceeding',
|
|
684
|
+
'Implement additional safeguards for high-risk areas',
|
|
685
|
+
'Consider staged rollout or additional testing',
|
|
686
|
+
'Ensure comprehensive rollback plan is in place',
|
|
687
|
+
],
|
|
688
|
+
risk_reduction: 'high',
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// Dependency risk recommendations
|
|
693
|
+
if (riskDimensions.dependency_risk?.score >= 6) {
|
|
694
|
+
recommendations.push({
|
|
695
|
+
priority: 'high',
|
|
696
|
+
title: 'Mitigate Dependency Risks',
|
|
697
|
+
description: 'High dependency risk requires careful coordination',
|
|
698
|
+
actions: [
|
|
699
|
+
'Review all affected components before modification',
|
|
700
|
+
'Implement gradual rollout to minimize impact',
|
|
701
|
+
'Ensure dependent components have adequate tests',
|
|
702
|
+
'Create communication plan for affected teams',
|
|
703
|
+
],
|
|
704
|
+
risk_reduction: 'medium',
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// Propagation risk recommendations
|
|
709
|
+
if (riskDimensions.propagation_risk?.score >= 6) {
|
|
710
|
+
recommendations.push({
|
|
711
|
+
priority: 'high',
|
|
712
|
+
title: 'Control Change Propagation',
|
|
713
|
+
description: 'Deep change propagation requires careful management',
|
|
714
|
+
actions: [
|
|
715
|
+
'Implement change in phases to limit propagation',
|
|
716
|
+
'Add circuit breakers for cascading effects',
|
|
717
|
+
'Monitor propagation paths during rollout',
|
|
718
|
+
'Prepare targeted rollback for each propagation level',
|
|
719
|
+
],
|
|
720
|
+
risk_reduction: 'medium',
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// Security risk recommendations
|
|
725
|
+
if (riskDimensions.security_risk?.score >= 5) {
|
|
726
|
+
recommendations.push({
|
|
727
|
+
priority: 'high',
|
|
728
|
+
title: 'Review Security Implications',
|
|
729
|
+
description: 'Security-sensitive component requires additional review',
|
|
730
|
+
actions: [
|
|
731
|
+
'Conduct security review of modifications',
|
|
732
|
+
'Validate input handling and sanitization',
|
|
733
|
+
'Review access controls and permissions',
|
|
734
|
+
'Test security boundaries and edge cases',
|
|
735
|
+
],
|
|
736
|
+
risk_reduction: 'high',
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Testing risk recommendations
|
|
741
|
+
if (riskDimensions.testing_risk?.score >= 5) {
|
|
742
|
+
recommendations.push({
|
|
743
|
+
priority: 'medium',
|
|
744
|
+
title: 'Improve Test Coverage',
|
|
745
|
+
description: 'Insufficient testing increases modification risk',
|
|
746
|
+
actions: [
|
|
747
|
+
'Add comprehensive unit tests before modification',
|
|
748
|
+
'Implement integration tests for component interactions',
|
|
749
|
+
'Add end-to-end tests for critical workflows',
|
|
750
|
+
'Set up monitoring and alerting for post-modification validation',
|
|
751
|
+
],
|
|
752
|
+
risk_reduction: 'medium',
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// Rollback risk recommendations
|
|
757
|
+
if (riskDimensions.rollback_risk?.score >= 6) {
|
|
758
|
+
recommendations.push({
|
|
759
|
+
priority: 'medium',
|
|
760
|
+
title: 'Prepare Comprehensive Rollback Plan',
|
|
761
|
+
description: 'Complex changes require detailed rollback preparation',
|
|
762
|
+
actions: [
|
|
763
|
+
'Create step-by-step rollback procedures',
|
|
764
|
+
'Test rollback process in staging environment',
|
|
765
|
+
'Prepare data backup and restoration procedures',
|
|
766
|
+
'Document rollback decision criteria and triggers',
|
|
767
|
+
],
|
|
768
|
+
risk_reduction: 'medium',
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// General recommendations based on modification type
|
|
773
|
+
if (config.modificationType === 'remove') {
|
|
774
|
+
recommendations.push({
|
|
775
|
+
priority: 'high',
|
|
776
|
+
title: 'Component Removal Strategy',
|
|
777
|
+
description: 'Component removal requires careful migration planning',
|
|
778
|
+
actions: [
|
|
779
|
+
'Provide migration guide for dependent components',
|
|
780
|
+
'Implement deprecation warnings in advance',
|
|
781
|
+
'Offer alternative component recommendations',
|
|
782
|
+
'Establish sunset timeline with clear milestones',
|
|
783
|
+
],
|
|
784
|
+
risk_reduction: 'high',
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
return recommendations;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Generate risk projection and timeline
|
|
793
|
+
*/
|
|
794
|
+
async generateRiskProjection(targetComponent, riskDimensions, analysisData, config) {
|
|
795
|
+
const projection = {
|
|
796
|
+
immediate_risks: [],
|
|
797
|
+
short_term_risks: [],
|
|
798
|
+
long_term_risks: [],
|
|
799
|
+
risk_timeline: [],
|
|
800
|
+
risk_evolution: {},
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
// Immediate risks (0-24 hours)
|
|
804
|
+
if (riskDimensions.operational_risk?.score >= 6) {
|
|
805
|
+
projection.immediate_risks.push({
|
|
806
|
+
risk: 'operational_disruption',
|
|
807
|
+
probability: 'medium',
|
|
808
|
+
impact: 'high',
|
|
809
|
+
description: 'Immediate operational impact from component changes',
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
if (riskDimensions.security_risk?.score >= 7) {
|
|
814
|
+
projection.immediate_risks.push({
|
|
815
|
+
risk: 'security_vulnerability',
|
|
816
|
+
probability: 'low',
|
|
817
|
+
impact: 'critical',
|
|
818
|
+
description: 'Potential security vulnerabilities from modification',
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// Short-term risks (1-7 days)
|
|
823
|
+
if (riskDimensions.dependency_risk?.score >= 6) {
|
|
824
|
+
projection.short_term_risks.push({
|
|
825
|
+
risk: 'dependency_failures',
|
|
826
|
+
probability: 'medium',
|
|
827
|
+
impact: 'high',
|
|
828
|
+
description: 'Dependent components may fail after modification',
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
if (riskDimensions.propagation_risk?.score >= 6) {
|
|
833
|
+
projection.short_term_risks.push({
|
|
834
|
+
risk: 'cascading_effects',
|
|
835
|
+
probability: 'medium',
|
|
836
|
+
impact: 'medium',
|
|
837
|
+
description: 'Cascading effects may emerge in dependent systems',
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// Long-term risks (1+ weeks)
|
|
842
|
+
if (riskDimensions.compatibility_risk?.score >= 5) {
|
|
843
|
+
projection.long_term_risks.push({
|
|
844
|
+
risk: 'compatibility_degradation',
|
|
845
|
+
probability: 'low',
|
|
846
|
+
impact: 'medium',
|
|
847
|
+
description: 'Long-term compatibility issues may emerge',
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// Risk timeline
|
|
852
|
+
const riskEvents = [
|
|
853
|
+
{ time: 'T+0h', event: 'Modification applied', risk_level: riskDimensions.structural_risk?.score || 0 },
|
|
854
|
+
{ time: 'T+1h', event: 'Immediate effects manifest', risk_level: riskDimensions.operational_risk?.score || 0 },
|
|
855
|
+
{ time: 'T+24h', event: 'Dependency effects emerge', risk_level: riskDimensions.dependency_risk?.score || 0 },
|
|
856
|
+
{ time: 'T+1w', event: 'Propagation effects stabilize', risk_level: riskDimensions.propagation_risk?.score || 0 },
|
|
857
|
+
{ time: 'T+1m', event: 'Long-term stability assessment', risk_level: Math.max(riskDimensions.compatibility_risk?.score || 0, 2) },
|
|
858
|
+
];
|
|
859
|
+
|
|
860
|
+
projection.risk_timeline = riskEvents;
|
|
861
|
+
|
|
862
|
+
// Risk evolution patterns
|
|
863
|
+
projection.risk_evolution = {
|
|
864
|
+
peak_risk_period: 'T+1h to T+24h',
|
|
865
|
+
stabilization_period: 'T+1w',
|
|
866
|
+
risk_decay_rate: this.calculateRiskDecayRate(riskDimensions),
|
|
867
|
+
monitoring_period: this.calculateMonitoringPeriod(riskDimensions),
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
return projection;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// Helper methods
|
|
874
|
+
|
|
875
|
+
async findComponentTestFiles(component) {
|
|
876
|
+
const testFiles = [];
|
|
877
|
+
const possibleTestPaths = [
|
|
878
|
+
path.join(this.rootPath, 'tests', 'unit', component.type, `${component.name}.test.js`),
|
|
879
|
+
path.join(this.rootPath, 'tests', 'integration', component.type, `${component.name}.integration.test.js`),
|
|
880
|
+
path.join(this.rootPath, 'test', `${component.name}.test.js`),
|
|
881
|
+
];
|
|
882
|
+
|
|
883
|
+
for (const testPath of possibleTestPaths) {
|
|
884
|
+
try {
|
|
885
|
+
await fs.access(testPath);
|
|
886
|
+
testFiles.push(testPath);
|
|
887
|
+
} catch (error) {
|
|
888
|
+
// File doesn't exist
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return testFiles;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
scoresToSeverity(score) {
|
|
896
|
+
if (score >= 8) return 'critical';
|
|
897
|
+
if (score >= 6) return 'high';
|
|
898
|
+
if (score >= 3) return 'medium';
|
|
899
|
+
return 'low';
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
scoresToRiskLevel(score) {
|
|
903
|
+
if (score >= 8) return 'critical';
|
|
904
|
+
if (score >= 6) return 'high';
|
|
905
|
+
if (score >= 3) return 'medium';
|
|
906
|
+
return 'low';
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
formatRiskLevel(riskLevel) {
|
|
910
|
+
const colors = {
|
|
911
|
+
low: chalk.green,
|
|
912
|
+
medium: chalk.yellow,
|
|
913
|
+
high: chalk.red,
|
|
914
|
+
critical: chalk.red.bold,
|
|
915
|
+
};
|
|
916
|
+
return colors[riskLevel] ? colors[riskLevel](riskLevel.toUpperCase()) : riskLevel;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
calculateRiskDecayRate(riskDimensions) {
|
|
920
|
+
// Higher structural and operational risks decay slower
|
|
921
|
+
const structuralWeight = riskDimensions.structural_risk?.score || 0;
|
|
922
|
+
const operationalWeight = riskDimensions.operational_risk?.score || 0;
|
|
923
|
+
|
|
924
|
+
const avgWeight = (structuralWeight + operationalWeight) / 2;
|
|
925
|
+
|
|
926
|
+
if (avgWeight >= 7) return 'slow';
|
|
927
|
+
if (avgWeight >= 4) return 'medium';
|
|
928
|
+
return 'fast';
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
calculateMonitoringPeriod(riskDimensions) {
|
|
932
|
+
const maxRisk = Math.max(...Object.values(riskDimensions).map(risk => risk.score));
|
|
933
|
+
|
|
934
|
+
if (maxRisk >= 8) return '1 month';
|
|
935
|
+
if (maxRisk >= 6) return '2 weeks';
|
|
936
|
+
if (maxRisk >= 4) return '1 week';
|
|
937
|
+
return '3 days';
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Get assessment history
|
|
942
|
+
*/
|
|
943
|
+
getAssessmentHistory() {
|
|
944
|
+
return {
|
|
945
|
+
total_assessments: this.assessmentHistory.length,
|
|
946
|
+
risk_distribution: this.calculateRiskDistribution(),
|
|
947
|
+
recent_assessments: this.assessmentHistory.slice(-10),
|
|
948
|
+
average_risk_score: this.calculateAverageRiskScore(),
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
calculateRiskDistribution() {
|
|
953
|
+
const distribution = { low: 0, medium: 0, high: 0, critical: 0 };
|
|
954
|
+
|
|
955
|
+
this.assessmentHistory.forEach(assessment => {
|
|
956
|
+
distribution[assessment.riskLevel]++;
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
return distribution;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
calculateAverageRiskScore() {
|
|
963
|
+
if (this.assessmentHistory.length === 0) return 0;
|
|
964
|
+
|
|
965
|
+
const totalScore = this.assessmentHistory.reduce((sum, assessment) => sum + assessment.riskScore, 0);
|
|
966
|
+
return Math.round((totalScore / this.assessmentHistory.length) * 10) / 10;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
module.exports = ModificationRiskAssessment;
|