@agentic-sdlc-kit/contracts 0.0.0-stage → 0.8.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/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/agent/capability.d.ts +9 -0
- package/dist/agent/capability.d.ts.map +1 -0
- package/dist/agent/capability.js +31 -0
- package/dist/agent/capability.js.map +1 -0
- package/dist/agent/errors.d.ts +30 -0
- package/dist/agent/errors.d.ts.map +1 -0
- package/dist/agent/errors.js +62 -0
- package/dist/agent/errors.js.map +1 -0
- package/dist/agent/events.d.ts +222 -0
- package/dist/agent/events.d.ts.map +1 -0
- package/dist/agent/events.js +92 -0
- package/dist/agent/events.js.map +1 -0
- package/dist/agent/execution.d.ts +553 -0
- package/dist/agent/execution.d.ts.map +1 -0
- package/dist/agent/execution.js +229 -0
- package/dist/agent/execution.js.map +1 -0
- package/dist/agent/index.d.ts +8 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +19 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/policy.d.ts +135 -0
- package/dist/agent/policy.d.ts.map +1 -0
- package/dist/agent/policy.js +78 -0
- package/dist/agent/policy.js.map +1 -0
- package/dist/agent/provider.d.ts +82 -0
- package/dist/agent/provider.d.ts.map +1 -0
- package/dist/agent/provider.js +33 -0
- package/dist/agent/provider.js.map +1 -0
- package/dist/agent/session.d.ts +17 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/session.js +23 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/application/application-context.d.ts +512 -0
- package/dist/application/application-context.d.ts.map +1 -0
- package/dist/application/application-context.js +42 -0
- package/dist/application/application-context.js.map +1 -0
- package/dist/application/application-persistence.d.ts +846 -0
- package/dist/application/application-persistence.d.ts.map +1 -0
- package/dist/application/application-persistence.js +37 -0
- package/dist/application/application-persistence.js.map +1 -0
- package/dist/application/application-state.d.ts +89 -0
- package/dist/application/application-state.d.ts.map +1 -0
- package/dist/application/application-state.js +66 -0
- package/dist/application/application-state.js.map +1 -0
- package/dist/application/application-transitions.d.ts +23 -0
- package/dist/application/application-transitions.d.ts.map +1 -0
- package/dist/application/application-transitions.js +60 -0
- package/dist/application/application-transitions.js.map +1 -0
- package/dist/application/index.d.ts +5 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +6 -0
- package/dist/application/index.js.map +1 -0
- package/dist/architecture/api-contract.d.ts +259 -0
- package/dist/architecture/api-contract.d.ts.map +1 -0
- package/dist/architecture/api-contract.js +43 -0
- package/dist/architecture/api-contract.js.map +1 -0
- package/dist/architecture/architecture-approval.d.ts +40 -0
- package/dist/architecture/architecture-approval.d.ts.map +1 -0
- package/dist/architecture/architecture-approval.js +24 -0
- package/dist/architecture/architecture-approval.js.map +1 -0
- package/dist/architecture/architecture-options.d.ts +103 -0
- package/dist/architecture/architecture-options.d.ts.map +1 -0
- package/dist/architecture/architecture-options.js +35 -0
- package/dist/architecture/architecture-options.js.map +1 -0
- package/dist/architecture/component-map.d.ts +76 -0
- package/dist/architecture/component-map.d.ts.map +1 -0
- package/dist/architecture/component-map.js +28 -0
- package/dist/architecture/component-map.js.map +1 -0
- package/dist/architecture/data-model.d.ts +252 -0
- package/dist/architecture/data-model.d.ts.map +1 -0
- package/dist/architecture/data-model.js +53 -0
- package/dist/architecture/data-model.js.map +1 -0
- package/dist/architecture/index.d.ts +8 -0
- package/dist/architecture/index.d.ts.map +1 -0
- package/dist/architecture/index.js +9 -0
- package/dist/architecture/index.js.map +1 -0
- package/dist/architecture/operational-design.d.ts +134 -0
- package/dist/architecture/operational-design.d.ts.map +1 -0
- package/dist/architecture/operational-design.js +46 -0
- package/dist/architecture/operational-design.js.map +1 -0
- package/dist/architecture/security-design.d.ts +107 -0
- package/dist/architecture/security-design.d.ts.map +1 -0
- package/dist/architecture/security-design.js +40 -0
- package/dist/architecture/security-design.js.map +1 -0
- package/dist/common/errors.d.ts +40 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +45 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/identifier.d.ts +12 -0
- package/dist/common/identifier.d.ts.map +1 -0
- package/dist/common/identifier.js +21 -0
- package/dist/common/identifier.js.map +1 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +5 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/result.d.ts +28 -0
- package/dist/common/result.d.ts.map +1 -0
- package/dist/common/result.js +33 -0
- package/dist/common/result.js.map +1 -0
- package/dist/evaluation/benchmark.d.ts +88 -0
- package/dist/evaluation/benchmark.d.ts.map +1 -0
- package/dist/evaluation/benchmark.js +34 -0
- package/dist/evaluation/benchmark.js.map +1 -0
- package/dist/evaluation/index.d.ts +3 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +4 -0
- package/dist/evaluation/index.js.map +1 -0
- package/dist/evaluation/metrics.d.ts +164 -0
- package/dist/evaluation/metrics.d.ts.map +1 -0
- package/dist/evaluation/metrics.js +64 -0
- package/dist/evaluation/metrics.js.map +1 -0
- package/dist/evolution/experiment.d.ts +85 -0
- package/dist/evolution/experiment.d.ts.map +1 -0
- package/dist/evolution/experiment.js +52 -0
- package/dist/evolution/experiment.js.map +1 -0
- package/dist/evolution/improvement-hypothesis.d.ts +98 -0
- package/dist/evolution/improvement-hypothesis.d.ts.map +1 -0
- package/dist/evolution/improvement-hypothesis.js +59 -0
- package/dist/evolution/improvement-hypothesis.js.map +1 -0
- package/dist/evolution/index.d.ts +3 -0
- package/dist/evolution/index.d.ts.map +1 -0
- package/dist/evolution/index.js +4 -0
- package/dist/evolution/index.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/index.d.ts +4 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +5 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/install-plan.d.ts +168 -0
- package/dist/installer/install-plan.d.ts.map +1 -0
- package/dist/installer/install-plan.js +40 -0
- package/dist/installer/install-plan.js.map +1 -0
- package/dist/installer/ownership-manifest.d.ts +78 -0
- package/dist/installer/ownership-manifest.d.ts.map +1 -0
- package/dist/installer/ownership-manifest.js +30 -0
- package/dist/installer/ownership-manifest.js.map +1 -0
- package/dist/installer/package-manifest.d.ts +55 -0
- package/dist/installer/package-manifest.d.ts.map +1 -0
- package/dist/installer/package-manifest.js +46 -0
- package/dist/installer/package-manifest.js.map +1 -0
- package/dist/learning/engineering-lesson.d.ts +84 -0
- package/dist/learning/engineering-lesson.d.ts.map +1 -0
- package/dist/learning/engineering-lesson.js +47 -0
- package/dist/learning/engineering-lesson.js.map +1 -0
- package/dist/learning/engineering-memory.d.ts +66 -0
- package/dist/learning/engineering-memory.d.ts.map +1 -0
- package/dist/learning/engineering-memory.js +44 -0
- package/dist/learning/engineering-memory.js.map +1 -0
- package/dist/learning/experience-episode.d.ts +176 -0
- package/dist/learning/experience-episode.d.ts.map +1 -0
- package/dist/learning/experience-episode.js +68 -0
- package/dist/learning/experience-episode.js.map +1 -0
- package/dist/learning/experience.d.ts +68 -0
- package/dist/learning/experience.d.ts.map +1 -0
- package/dist/learning/experience.js +22 -0
- package/dist/learning/experience.js.map +1 -0
- package/dist/learning/hypothesis.d.ts +57 -0
- package/dist/learning/hypothesis.d.ts.map +1 -0
- package/dist/learning/hypothesis.js +27 -0
- package/dist/learning/hypothesis.js.map +1 -0
- package/dist/learning/index.d.ts +8 -0
- package/dist/learning/index.d.ts.map +1 -0
- package/dist/learning/index.js +9 -0
- package/dist/learning/index.js.map +1 -0
- package/dist/learning/memory.d.ts +42 -0
- package/dist/learning/memory.d.ts.map +1 -0
- package/dist/learning/memory.js +20 -0
- package/dist/learning/memory.js.map +1 -0
- package/dist/learning/promotion.d.ts +31 -0
- package/dist/learning/promotion.d.ts.map +1 -0
- package/dist/learning/promotion.js +16 -0
- package/dist/learning/promotion.js.map +1 -0
- package/dist/maintenance/bug-fix-workflow.d.ts +57 -0
- package/dist/maintenance/bug-fix-workflow.d.ts.map +1 -0
- package/dist/maintenance/bug-fix-workflow.js +100 -0
- package/dist/maintenance/bug-fix-workflow.js.map +1 -0
- package/dist/maintenance/bug-report.d.ts +62 -0
- package/dist/maintenance/bug-report.d.ts.map +1 -0
- package/dist/maintenance/bug-report.js +49 -0
- package/dist/maintenance/bug-report.js.map +1 -0
- package/dist/maintenance/index.d.ts +6 -0
- package/dist/maintenance/index.d.ts.map +1 -0
- package/dist/maintenance/index.js +7 -0
- package/dist/maintenance/index.js.map +1 -0
- package/dist/maintenance/performance-baseline.d.ts +80 -0
- package/dist/maintenance/performance-baseline.d.ts.map +1 -0
- package/dist/maintenance/performance-baseline.js +32 -0
- package/dist/maintenance/performance-baseline.js.map +1 -0
- package/dist/maintenance/refactor-contract.d.ts +158 -0
- package/dist/maintenance/refactor-contract.d.ts.map +1 -0
- package/dist/maintenance/refactor-contract.js +65 -0
- package/dist/maintenance/refactor-contract.js.map +1 -0
- package/dist/maintenance/refactor-workflow.d.ts +79 -0
- package/dist/maintenance/refactor-workflow.d.ts.map +1 -0
- package/dist/maintenance/refactor-workflow.js +100 -0
- package/dist/maintenance/refactor-workflow.js.map +1 -0
- package/dist/observer/event-schema.d.ts +49 -0
- package/dist/observer/event-schema.d.ts.map +1 -0
- package/dist/observer/event-schema.js +48 -0
- package/dist/observer/event-schema.js.map +1 -0
- package/dist/observer/index.d.ts +5 -0
- package/dist/observer/index.d.ts.map +1 -0
- package/dist/observer/index.js +6 -0
- package/dist/observer/index.js.map +1 -0
- package/dist/observer/journal.d.ts +83 -0
- package/dist/observer/journal.d.ts.map +1 -0
- package/dist/observer/journal.js +76 -0
- package/dist/observer/journal.js.map +1 -0
- package/dist/observer/retention.d.ts +25 -0
- package/dist/observer/retention.d.ts.map +1 -0
- package/dist/observer/retention.js +21 -0
- package/dist/observer/retention.js.map +1 -0
- package/dist/observer/run-summary.d.ts +260 -0
- package/dist/observer/run-summary.d.ts.map +1 -0
- package/dist/observer/run-summary.js +32 -0
- package/dist/observer/run-summary.js.map +1 -0
- package/dist/patterns/index.d.ts +2 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +3 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/pattern.d.ts +106 -0
- package/dist/patterns/pattern.d.ts.map +1 -0
- package/dist/patterns/pattern.js +69 -0
- package/dist/patterns/pattern.js.map +1 -0
- package/dist/planning/index.d.ts +2 -0
- package/dist/planning/index.d.ts.map +1 -0
- package/dist/planning/index.js +3 -0
- package/dist/planning/index.js.map +1 -0
- package/dist/planning/task.d.ts +178 -0
- package/dist/planning/task.d.ts.map +1 -0
- package/dist/planning/task.js +35 -0
- package/dist/planning/task.js.map +1 -0
- package/dist/policy/index.d.ts +2 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +3 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/policy.d.ts +83 -0
- package/dist/policy/policy.d.ts.map +1 -0
- package/dist/policy/policy.js +57 -0
- package/dist/policy/policy.js.map +1 -0
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +6 -0
- package/dist/product/index.js.map +1 -0
- package/dist/product/mvp-scope.d.ts +25 -0
- package/dist/product/mvp-scope.d.ts.map +1 -0
- package/dist/product/mvp-scope.js +18 -0
- package/dist/product/mvp-scope.js.map +1 -0
- package/dist/product/product-brief.d.ts +94 -0
- package/dist/product/product-brief.d.ts.map +1 -0
- package/dist/product/product-brief.js +44 -0
- package/dist/product/product-brief.js.map +1 -0
- package/dist/product/requirements.d.ts +251 -0
- package/dist/product/requirements.d.ts.map +1 -0
- package/dist/product/requirements.js +50 -0
- package/dist/product/requirements.js.map +1 -0
- package/dist/product/traceability.d.ts +50 -0
- package/dist/product/traceability.d.ts.map +1 -0
- package/dist/product/traceability.js +20 -0
- package/dist/product/traceability.js.map +1 -0
- package/dist/project/index.d.ts +3 -0
- package/dist/project/index.d.ts.map +1 -0
- package/dist/project/index.js +4 -0
- package/dist/project/index.js.map +1 -0
- package/dist/project/project-profile.d.ts +79 -0
- package/dist/project/project-profile.d.ts.map +1 -0
- package/dist/project/project-profile.js +53 -0
- package/dist/project/project-profile.js.map +1 -0
- package/dist/project/repository-scan.d.ts +82 -0
- package/dist/project/repository-scan.d.ts.map +1 -0
- package/dist/project/repository-scan.js +29 -0
- package/dist/project/repository-scan.js.map +1 -0
- package/dist/routing/capability-registry.d.ts +87 -0
- package/dist/routing/capability-registry.d.ts.map +1 -0
- package/dist/routing/capability-registry.js +26 -0
- package/dist/routing/capability-registry.js.map +1 -0
- package/dist/routing/escalation.d.ts +25 -0
- package/dist/routing/escalation.d.ts.map +1 -0
- package/dist/routing/escalation.js +21 -0
- package/dist/routing/escalation.js.map +1 -0
- package/dist/routing/index.d.ts +5 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +6 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/routing-policy.d.ts +103 -0
- package/dist/routing/routing-policy.d.ts.map +1 -0
- package/dist/routing/routing-policy.js +32 -0
- package/dist/routing/routing-policy.js.map +1 -0
- package/dist/routing/routing-request.d.ts +63 -0
- package/dist/routing/routing-request.d.ts.map +1 -0
- package/dist/routing/routing-request.js +46 -0
- package/dist/routing/routing-request.js.map +1 -0
- package/dist/runtime-guard/action-classification.d.ts +54 -0
- package/dist/runtime-guard/action-classification.d.ts.map +1 -0
- package/dist/runtime-guard/action-classification.js +90 -0
- package/dist/runtime-guard/action-classification.js.map +1 -0
- package/dist/runtime-guard/audit-event.d.ts +98 -0
- package/dist/runtime-guard/audit-event.d.ts.map +1 -0
- package/dist/runtime-guard/audit-event.js +45 -0
- package/dist/runtime-guard/audit-event.js.map +1 -0
- package/dist/runtime-guard/index.d.ts +4 -0
- package/dist/runtime-guard/index.d.ts.map +1 -0
- package/dist/runtime-guard/index.js +5 -0
- package/dist/runtime-guard/index.js.map +1 -0
- package/dist/runtime-guard/policy-schema.d.ts +139 -0
- package/dist/runtime-guard/policy-schema.d.ts.map +1 -0
- package/dist/runtime-guard/policy-schema.js +50 -0
- package/dist/runtime-guard/policy-schema.js.map +1 -0
- package/dist/scaffolding/index.d.ts +3 -0
- package/dist/scaffolding/index.d.ts.map +1 -0
- package/dist/scaffolding/index.js +4 -0
- package/dist/scaffolding/index.js.map +1 -0
- package/dist/scaffolding/scaffold-contract.d.ts +528 -0
- package/dist/scaffolding/scaffold-contract.d.ts.map +1 -0
- package/dist/scaffolding/scaffold-contract.js +50 -0
- package/dist/scaffolding/scaffold-contract.js.map +1 -0
- package/dist/scaffolding/template-manifest.d.ts +105 -0
- package/dist/scaffolding/template-manifest.d.ts.map +1 -0
- package/dist/scaffolding/template-manifest.js +44 -0
- package/dist/scaffolding/template-manifest.js.map +1 -0
- package/dist/secret-guard/detection-rule.d.ts +33 -0
- package/dist/secret-guard/detection-rule.d.ts.map +1 -0
- package/dist/secret-guard/detection-rule.js +109 -0
- package/dist/secret-guard/detection-rule.js.map +1 -0
- package/dist/secret-guard/finding.d.ts +89 -0
- package/dist/secret-guard/finding.d.ts.map +1 -0
- package/dist/secret-guard/finding.js +85 -0
- package/dist/secret-guard/finding.js.map +1 -0
- package/dist/secret-guard/index.d.ts +5 -0
- package/dist/secret-guard/index.d.ts.map +1 -0
- package/dist/secret-guard/index.js +6 -0
- package/dist/secret-guard/index.js.map +1 -0
- package/dist/secret-guard/redaction-policy.d.ts +26 -0
- package/dist/secret-guard/redaction-policy.d.ts.map +1 -0
- package/dist/secret-guard/redaction-policy.js +30 -0
- package/dist/secret-guard/redaction-policy.js.map +1 -0
- package/dist/secret-guard/scanner-failure.d.ts +59 -0
- package/dist/secret-guard/scanner-failure.d.ts.map +1 -0
- package/dist/secret-guard/scanner-failure.js +40 -0
- package/dist/secret-guard/scanner-failure.js.map +1 -0
- package/dist/specification/index.d.ts +2 -0
- package/dist/specification/index.d.ts.map +1 -0
- package/dist/specification/index.js +3 -0
- package/dist/specification/index.js.map +1 -0
- package/dist/specification/specification.d.ts +229 -0
- package/dist/specification/specification.d.ts.map +1 -0
- package/dist/specification/specification.js +67 -0
- package/dist/specification/specification.js.map +1 -0
- package/dist/stack-pack/index.d.ts +2 -0
- package/dist/stack-pack/index.d.ts.map +1 -0
- package/dist/stack-pack/index.js +3 -0
- package/dist/stack-pack/index.js.map +1 -0
- package/dist/stack-pack/manifest.d.ts +88 -0
- package/dist/stack-pack/manifest.d.ts.map +1 -0
- package/dist/stack-pack/manifest.js +51 -0
- package/dist/stack-pack/manifest.js.map +1 -0
- package/dist/verification/index.d.ts +2 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +3 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/report.d.ts +95 -0
- package/dist/verification/report.d.ts.map +1 -0
- package/dist/verification/report.js +57 -0
- package/dist/verification/report.js.map +1 -0
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +4 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/next-action.d.ts +130 -0
- package/dist/workflow/next-action.d.ts.map +1 -0
- package/dist/workflow/next-action.js +92 -0
- package/dist/workflow/next-action.js.map +1 -0
- package/dist/workflow/workflow.d.ts +68 -0
- package/dist/workflow/workflow.d.ts.map +1 -0
- package/dist/workflow/workflow.js +33 -0
- package/dist/workflow/workflow.js.map +1 -0
- package/package.json +31 -3
- package/src/agent/agent.test.ts +451 -0
- package/src/agent/capability.ts +35 -0
- package/src/agent/errors.ts +69 -0
- package/src/agent/events.ts +107 -0
- package/src/agent/execution.ts +275 -0
- package/src/agent/index.ts +19 -0
- package/src/agent/policy.ts +82 -0
- package/src/agent/provider.ts +124 -0
- package/src/agent/session.ts +29 -0
- package/src/application/application-context.ts +47 -0
- package/src/application/application-persistence.ts +44 -0
- package/src/application/application-state.test.ts +107 -0
- package/src/application/application-state.ts +81 -0
- package/src/application/application-transitions.ts +71 -0
- package/src/application/index.ts +5 -0
- package/src/architecture/api-contract.ts +56 -0
- package/src/architecture/architecture-approval.ts +27 -0
- package/src/architecture/architecture-options.ts +42 -0
- package/src/architecture/architecture.test.ts +263 -0
- package/src/architecture/component-map.ts +35 -0
- package/src/architecture/data-model.ts +66 -0
- package/src/architecture/index.ts +8 -0
- package/src/architecture/operational-design.ts +55 -0
- package/src/architecture/security-design.ts +47 -0
- package/src/common/errors.test.ts +46 -0
- package/src/common/errors.ts +114 -0
- package/src/common/identifier.test.ts +51 -0
- package/src/common/identifier.ts +33 -0
- package/src/common/index.ts +4 -0
- package/src/common/result.test.ts +52 -0
- package/src/common/result.ts +50 -0
- package/src/evaluation/benchmark.ts +42 -0
- package/src/evaluation/index.ts +3 -0
- package/src/evaluation/metrics.ts +76 -0
- package/src/evolution/experiment.ts +61 -0
- package/src/evolution/improvement-hypothesis.ts +67 -0
- package/src/evolution/index.ts +3 -0
- package/src/index.test.ts +54 -0
- package/src/index.ts +53 -0
- package/src/installer/index.ts +4 -0
- package/src/installer/install-plan.ts +49 -0
- package/src/installer/ownership-manifest.ts +36 -0
- package/src/installer/package-manifest.ts +54 -0
- package/src/learning/engineering-lesson.ts +55 -0
- package/src/learning/engineering-memory.ts +51 -0
- package/src/learning/experience-episode.ts +76 -0
- package/src/learning/experience.ts +27 -0
- package/src/learning/hypothesis.ts +33 -0
- package/src/learning/index.ts +8 -0
- package/src/learning/memory.ts +25 -0
- package/src/learning/promotion.ts +19 -0
- package/src/maintenance/bug-fix-workflow.ts +119 -0
- package/src/maintenance/bug-report.ts +58 -0
- package/src/maintenance/index.ts +6 -0
- package/src/maintenance/maintenance.test.ts +219 -0
- package/src/maintenance/performance-baseline.ts +35 -0
- package/src/maintenance/refactor-contract.ts +77 -0
- package/src/maintenance/refactor-workflow.ts +121 -0
- package/src/observer/event-schema.ts +54 -0
- package/src/observer/index.ts +5 -0
- package/src/observer/journal.test.ts +73 -0
- package/src/observer/journal.ts +84 -0
- package/src/observer/retention.ts +24 -0
- package/src/observer/run-summary.ts +37 -0
- package/src/patterns/index.ts +2 -0
- package/src/patterns/pattern.ts +80 -0
- package/src/planning/index.ts +2 -0
- package/src/planning/task.ts +47 -0
- package/src/policy/index.ts +2 -0
- package/src/policy/policy.test.ts +50 -0
- package/src/policy/policy.ts +67 -0
- package/src/product/index.ts +5 -0
- package/src/product/mvp-scope.ts +21 -0
- package/src/product/product-brief.test.ts +108 -0
- package/src/product/product-brief.ts +53 -0
- package/src/product/requirements.ts +59 -0
- package/src/product/traceability.ts +25 -0
- package/src/project/index.ts +3 -0
- package/src/project/project-profile.test.ts +98 -0
- package/src/project/project-profile.ts +65 -0
- package/src/project/repository-scan.ts +34 -0
- package/src/routing/capability-registry.ts +31 -0
- package/src/routing/escalation.ts +24 -0
- package/src/routing/index.ts +5 -0
- package/src/routing/routing-policy.ts +38 -0
- package/src/routing/routing-request.ts +55 -0
- package/src/runtime-guard/action-classification.ts +99 -0
- package/src/runtime-guard/audit-event.ts +49 -0
- package/src/runtime-guard/index.ts +4 -0
- package/src/runtime-guard/policy-schema.ts +56 -0
- package/src/runtime-guard/runtime-guard.test.ts +147 -0
- package/src/scaffolding/index.ts +3 -0
- package/src/scaffolding/scaffold-contract.test.ts +107 -0
- package/src/scaffolding/scaffold-contract.ts +63 -0
- package/src/scaffolding/template-manifest.ts +52 -0
- package/src/secret-guard/detection-rule.ts +115 -0
- package/src/secret-guard/finding.ts +93 -0
- package/src/secret-guard/index.ts +5 -0
- package/src/secret-guard/redaction-policy.ts +34 -0
- package/src/secret-guard/scanner-failure.ts +47 -0
- package/src/secret-guard/secret-guard.test.ts +130 -0
- package/src/specification/index.ts +2 -0
- package/src/specification/specification.ts +79 -0
- package/src/stack-pack/index.ts +2 -0
- package/src/stack-pack/manifest.ts +60 -0
- package/src/verification/index.ts +2 -0
- package/src/verification/report.test.ts +91 -0
- package/src/verification/report.ts +62 -0
- package/src/workflow/index.ts +3 -0
- package/src/workflow/next-action.test.ts +101 -0
- package/src/workflow/next-action.ts +101 -0
- package/src/workflow/workflow.ts +49 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/architecture/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// packages/contracts/src/architecture/index.ts
|
|
2
|
+
export * from './architecture-options.js';
|
|
3
|
+
export * from './component-map.js';
|
|
4
|
+
export * from './data-model.js';
|
|
5
|
+
export * from './api-contract.js';
|
|
6
|
+
export * from './security-design.js';
|
|
7
|
+
export * from './operational-design.js';
|
|
8
|
+
export * from './architecture-approval.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/architecture/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DeploymentTargetSchema: z.ZodEnum<["container-orchestrated", "container-single-host", "serverless", "paas", "self-hosted-vm", "static-hosting"]>;
|
|
3
|
+
export declare const ObservabilityChannelSchema: z.ZodEnum<["logs", "metrics", "traces", "events"]>;
|
|
4
|
+
export declare const OperationalDesignSchema: z.ZodObject<{
|
|
5
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
6
|
+
briefId: z.ZodString;
|
|
7
|
+
deployment: z.ZodObject<{
|
|
8
|
+
target: z.ZodEnum<["container-orchestrated", "container-single-host", "serverless", "paas", "self-hosted-vm", "static-hosting"]>;
|
|
9
|
+
rationale: z.ZodString;
|
|
10
|
+
regions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
rationale: string;
|
|
13
|
+
target: "serverless" | "container-orchestrated" | "container-single-host" | "paas" | "self-hosted-vm" | "static-hosting";
|
|
14
|
+
regions: string[];
|
|
15
|
+
}, {
|
|
16
|
+
rationale: string;
|
|
17
|
+
target: "serverless" | "container-orchestrated" | "container-single-host" | "paas" | "self-hosted-vm" | "static-hosting";
|
|
18
|
+
regions?: string[] | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
configuration: z.ZodObject<{
|
|
21
|
+
source: z.ZodEnum<["env", "file", "secret-manager", "mixed"]>;
|
|
22
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
required: z.ZodBoolean;
|
|
25
|
+
sensitive: z.ZodBoolean;
|
|
26
|
+
description: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
sensitive: boolean;
|
|
32
|
+
}, {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
sensitive: boolean;
|
|
37
|
+
}>, "many">;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
source: "env" | "file" | "secret-manager" | "mixed";
|
|
40
|
+
variables: {
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
required: boolean;
|
|
44
|
+
sensitive: boolean;
|
|
45
|
+
}[];
|
|
46
|
+
}, {
|
|
47
|
+
source: "env" | "file" | "secret-manager" | "mixed";
|
|
48
|
+
variables: {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
sensitive: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
}>;
|
|
55
|
+
observability: z.ZodObject<{
|
|
56
|
+
channels: z.ZodArray<z.ZodEnum<["logs", "metrics", "traces", "events"]>, "many">;
|
|
57
|
+
sinks: z.ZodArray<z.ZodString, "many">;
|
|
58
|
+
traceSampling: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
channels: ("logs" | "metrics" | "traces" | "events")[];
|
|
61
|
+
sinks: string[];
|
|
62
|
+
traceSampling?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
channels: ("logs" | "metrics" | "traces" | "events")[];
|
|
65
|
+
sinks: string[];
|
|
66
|
+
traceSampling?: string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
scaling: z.ZodObject<{
|
|
69
|
+
strategy: z.ZodEnum<["horizontal", "vertical", "none"]>;
|
|
70
|
+
triggers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
strategy: "none" | "horizontal" | "vertical";
|
|
73
|
+
triggers: string[];
|
|
74
|
+
}, {
|
|
75
|
+
strategy: "none" | "horizontal" | "vertical";
|
|
76
|
+
triggers?: string[] | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
schemaVersion: 1;
|
|
80
|
+
briefId: string;
|
|
81
|
+
deployment: {
|
|
82
|
+
rationale: string;
|
|
83
|
+
target: "serverless" | "container-orchestrated" | "container-single-host" | "paas" | "self-hosted-vm" | "static-hosting";
|
|
84
|
+
regions: string[];
|
|
85
|
+
};
|
|
86
|
+
configuration: {
|
|
87
|
+
source: "env" | "file" | "secret-manager" | "mixed";
|
|
88
|
+
variables: {
|
|
89
|
+
name: string;
|
|
90
|
+
description: string;
|
|
91
|
+
required: boolean;
|
|
92
|
+
sensitive: boolean;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
observability: {
|
|
96
|
+
channels: ("logs" | "metrics" | "traces" | "events")[];
|
|
97
|
+
sinks: string[];
|
|
98
|
+
traceSampling?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
scaling: {
|
|
101
|
+
strategy: "none" | "horizontal" | "vertical";
|
|
102
|
+
triggers: string[];
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
schemaVersion: 1;
|
|
106
|
+
briefId: string;
|
|
107
|
+
deployment: {
|
|
108
|
+
rationale: string;
|
|
109
|
+
target: "serverless" | "container-orchestrated" | "container-single-host" | "paas" | "self-hosted-vm" | "static-hosting";
|
|
110
|
+
regions?: string[] | undefined;
|
|
111
|
+
};
|
|
112
|
+
configuration: {
|
|
113
|
+
source: "env" | "file" | "secret-manager" | "mixed";
|
|
114
|
+
variables: {
|
|
115
|
+
name: string;
|
|
116
|
+
description: string;
|
|
117
|
+
required: boolean;
|
|
118
|
+
sensitive: boolean;
|
|
119
|
+
}[];
|
|
120
|
+
};
|
|
121
|
+
observability: {
|
|
122
|
+
channels: ("logs" | "metrics" | "traces" | "events")[];
|
|
123
|
+
sinks: string[];
|
|
124
|
+
traceSampling?: string | undefined;
|
|
125
|
+
};
|
|
126
|
+
scaling: {
|
|
127
|
+
strategy: "none" | "horizontal" | "vertical";
|
|
128
|
+
triggers?: string[] | undefined;
|
|
129
|
+
};
|
|
130
|
+
}>;
|
|
131
|
+
export type DeploymentTarget = z.infer<typeof DeploymentTargetSchema>;
|
|
132
|
+
export type ObservabilityChannel = z.infer<typeof ObservabilityChannelSchema>;
|
|
133
|
+
export type OperationalDesign = z.infer<typeof OperationalDesignSchema>;
|
|
134
|
+
//# sourceMappingURL=operational-design.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-design.d.ts","sourceRoot":"","sources":["../../src/architecture/operational-design.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB,0HAOjC,CAAC;AAEH,eAAO,MAAM,0BAA0B,oDAAkD,CAAC;AAE1F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgClC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// packages/contracts/src/architecture/operational-design.ts
|
|
2
|
+
//
|
|
3
|
+
// Operational design contract (M8 Phase C — M8-18).
|
|
4
|
+
// Deployment, configuration, observability plan.
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const DeploymentTargetSchema = z.enum([
|
|
7
|
+
'container-orchestrated',
|
|
8
|
+
'container-single-host',
|
|
9
|
+
'serverless',
|
|
10
|
+
'paas',
|
|
11
|
+
'self-hosted-vm',
|
|
12
|
+
'static-hosting',
|
|
13
|
+
]);
|
|
14
|
+
export const ObservabilityChannelSchema = z.enum(['logs', 'metrics', 'traces', 'events']);
|
|
15
|
+
export const OperationalDesignSchema = z.object({
|
|
16
|
+
schemaVersion: z.literal(1),
|
|
17
|
+
briefId: z.string(),
|
|
18
|
+
deployment: z.object({
|
|
19
|
+
target: DeploymentTargetSchema,
|
|
20
|
+
rationale: z.string().min(1),
|
|
21
|
+
regions: z.array(z.string()).default([]),
|
|
22
|
+
}),
|
|
23
|
+
configuration: z.object({
|
|
24
|
+
// How the app loads config (env, file, secret manager).
|
|
25
|
+
source: z.enum(['env', 'file', 'secret-manager', 'mixed']),
|
|
26
|
+
// Schema for the config variables (names only — never values).
|
|
27
|
+
variables: z.array(z.object({
|
|
28
|
+
name: z.string(),
|
|
29
|
+
required: z.boolean(),
|
|
30
|
+
sensitive: z.boolean(),
|
|
31
|
+
description: z.string(),
|
|
32
|
+
})),
|
|
33
|
+
}),
|
|
34
|
+
observability: z.object({
|
|
35
|
+
channels: z.array(ObservabilityChannelSchema),
|
|
36
|
+
sinks: z.array(z.string()),
|
|
37
|
+
// Sampling rate for traces (0.0 to 1.0). Documented as a string to
|
|
38
|
+
// avoid float precision issues in JSON.
|
|
39
|
+
traceSampling: z.string().optional(),
|
|
40
|
+
}),
|
|
41
|
+
scaling: z.object({
|
|
42
|
+
strategy: z.enum(['horizontal', 'vertical', 'none']),
|
|
43
|
+
triggers: z.array(z.string()).default([]),
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=operational-design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operational-design.js","sourceRoot":"","sources":["../../src/architecture/operational-design.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,oDAAoD;AACpD,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,wBAAwB;IACxB,uBAAuB;IACvB,YAAY;IACZ,MAAM;IACN,gBAAgB;IAChB,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC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AE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AuthMethodSchema: z.ZodEnum<["session", "jwt", "oauth2", "api-key", "service-account", "none"]>;
|
|
3
|
+
export declare const SecurityDesignSchema: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
5
|
+
briefId: z.ZodString;
|
|
6
|
+
authentication: z.ZodObject<{
|
|
7
|
+
method: z.ZodEnum<["session", "jwt", "oauth2", "api-key", "service-account", "none"]>;
|
|
8
|
+
rationale: z.ZodString;
|
|
9
|
+
credentialStore: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
rationale: string;
|
|
12
|
+
method: "session" | "jwt" | "oauth2" | "api-key" | "service-account" | "none";
|
|
13
|
+
credentialStore: string;
|
|
14
|
+
}, {
|
|
15
|
+
rationale: string;
|
|
16
|
+
method: "session" | "jwt" | "oauth2" | "api-key" | "service-account" | "none";
|
|
17
|
+
credentialStore: string;
|
|
18
|
+
}>;
|
|
19
|
+
authorization: z.ZodObject<{
|
|
20
|
+
model: z.ZodEnum<["rbac", "abac", "acl", "none"]>;
|
|
21
|
+
roles: z.ZodArray<z.ZodString, "many">;
|
|
22
|
+
protectedResources: z.ZodArray<z.ZodString, "many">;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
model: "none" | "rbac" | "abac" | "acl";
|
|
25
|
+
roles: string[];
|
|
26
|
+
protectedResources: string[];
|
|
27
|
+
}, {
|
|
28
|
+
model: "none" | "rbac" | "abac" | "acl";
|
|
29
|
+
roles: string[];
|
|
30
|
+
protectedResources: string[];
|
|
31
|
+
}>;
|
|
32
|
+
threats: z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
threat: z.ZodString;
|
|
35
|
+
severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
36
|
+
mitigation: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
id: string;
|
|
39
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
40
|
+
threat: string;
|
|
41
|
+
mitigation: string;
|
|
42
|
+
}, {
|
|
43
|
+
id: string;
|
|
44
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
45
|
+
threat: string;
|
|
46
|
+
mitigation: string;
|
|
47
|
+
}>, "many">;
|
|
48
|
+
secrets: z.ZodObject<{
|
|
49
|
+
loader: z.ZodEnum<["env", "vault", "file"]>;
|
|
50
|
+
rotationPolicy: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
loader: "env" | "vault" | "file";
|
|
53
|
+
rotationPolicy: string;
|
|
54
|
+
}, {
|
|
55
|
+
loader: "env" | "vault" | "file";
|
|
56
|
+
rotationPolicy: string;
|
|
57
|
+
}>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
schemaVersion: 1;
|
|
60
|
+
briefId: string;
|
|
61
|
+
authentication: {
|
|
62
|
+
rationale: string;
|
|
63
|
+
method: "session" | "jwt" | "oauth2" | "api-key" | "service-account" | "none";
|
|
64
|
+
credentialStore: string;
|
|
65
|
+
};
|
|
66
|
+
authorization: {
|
|
67
|
+
model: "none" | "rbac" | "abac" | "acl";
|
|
68
|
+
roles: string[];
|
|
69
|
+
protectedResources: string[];
|
|
70
|
+
};
|
|
71
|
+
threats: {
|
|
72
|
+
id: string;
|
|
73
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
74
|
+
threat: string;
|
|
75
|
+
mitigation: string;
|
|
76
|
+
}[];
|
|
77
|
+
secrets: {
|
|
78
|
+
loader: "env" | "vault" | "file";
|
|
79
|
+
rotationPolicy: string;
|
|
80
|
+
};
|
|
81
|
+
}, {
|
|
82
|
+
schemaVersion: 1;
|
|
83
|
+
briefId: string;
|
|
84
|
+
authentication: {
|
|
85
|
+
rationale: string;
|
|
86
|
+
method: "session" | "jwt" | "oauth2" | "api-key" | "service-account" | "none";
|
|
87
|
+
credentialStore: string;
|
|
88
|
+
};
|
|
89
|
+
authorization: {
|
|
90
|
+
model: "none" | "rbac" | "abac" | "acl";
|
|
91
|
+
roles: string[];
|
|
92
|
+
protectedResources: string[];
|
|
93
|
+
};
|
|
94
|
+
threats: {
|
|
95
|
+
id: string;
|
|
96
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
97
|
+
threat: string;
|
|
98
|
+
mitigation: string;
|
|
99
|
+
}[];
|
|
100
|
+
secrets: {
|
|
101
|
+
loader: "env" | "vault" | "file";
|
|
102
|
+
rotationPolicy: string;
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
export type AuthMethod = z.infer<typeof AuthMethodSchema>;
|
|
106
|
+
export type SecurityDesign = z.infer<typeof SecurityDesignSchema>;
|
|
107
|
+
//# sourceMappingURL=security-design.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-design.d.ts","sourceRoot":"","sources":["../../src/architecture/security-design.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,+EAO3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B/B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// packages/contracts/src/architecture/security-design.ts
|
|
2
|
+
//
|
|
3
|
+
// Security architecture contract (M8 Phase C — M8-16).
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const AuthMethodSchema = z.enum([
|
|
6
|
+
'session',
|
|
7
|
+
'jwt',
|
|
8
|
+
'oauth2',
|
|
9
|
+
'api-key',
|
|
10
|
+
'service-account',
|
|
11
|
+
'none',
|
|
12
|
+
]);
|
|
13
|
+
export const SecurityDesignSchema = z.object({
|
|
14
|
+
schemaVersion: z.literal(1),
|
|
15
|
+
briefId: z.string(),
|
|
16
|
+
authentication: z.object({
|
|
17
|
+
method: AuthMethodSchema,
|
|
18
|
+
rationale: z.string().min(1),
|
|
19
|
+
// Where credentials are stored (never in code).
|
|
20
|
+
credentialStore: z.string().min(1),
|
|
21
|
+
}),
|
|
22
|
+
authorization: z.object({
|
|
23
|
+
model: z.enum(['rbac', 'abac', 'acl', 'none']),
|
|
24
|
+
roles: z.array(z.string()),
|
|
25
|
+
protectedResources: z.array(z.string()),
|
|
26
|
+
}),
|
|
27
|
+
// Threats identified during design and their mitigations.
|
|
28
|
+
threats: z.array(z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
threat: z.string().min(1),
|
|
31
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']),
|
|
32
|
+
mitigation: z.string().min(1),
|
|
33
|
+
})),
|
|
34
|
+
// Secrets handling: how the app loads credentials at runtime.
|
|
35
|
+
secrets: z.object({
|
|
36
|
+
loader: z.enum(['env', 'vault', 'file']),
|
|
37
|
+
rotationPolicy: z.string().min(1),
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=security-design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-design.js","sourceRoot":"","sources":["../../src/architecture/security-design.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,uDAAuD;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,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IAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAClC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type KitErrorCode = 'CONTRACT_INVALID' | 'PROFILE_INVALID' | 'PLAN_INVALID' | 'SPEC_INVALID' | 'VERIFICATION_FAILED' | 'APPROVAL_DENIED' | 'APPROVAL_REQUIRED' | 'POLICY_VIOLATION' | 'DISCOVERY_FAILED' | 'ARTIFACT_WRITE_DENIED' | 'ARTIFACT_READ_DENIED' | 'TIMEOUT' | 'NOT_IMPLEMENTED' | 'AGENT_PROVIDER_NOT_CONFIGURED' | 'INTERNAL';
|
|
2
|
+
export interface KitError {
|
|
3
|
+
readonly code: KitErrorCode;
|
|
4
|
+
readonly message: string;
|
|
5
|
+
readonly cause?: unknown;
|
|
6
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const kitError: (code: KitErrorCode, message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
9
|
+
/**
|
|
10
|
+
* Convenience constructors for the most common error codes. Keeping these
|
|
11
|
+
* in one place makes it easy to audit every site that produces a given code.
|
|
12
|
+
*
|
|
13
|
+
* Each factory accepts an optional `details` and an optional `cause`. The
|
|
14
|
+
* `cause` is attached when the error wraps another error (e.g., a caught
|
|
15
|
+
* exception); `details` carries structured context for logs and reports.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Errors: {
|
|
18
|
+
readonly contractInvalid: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
19
|
+
readonly profileInvalid: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
20
|
+
readonly planInvalid: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
21
|
+
readonly specInvalid: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
22
|
+
readonly verificationFailed: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
23
|
+
readonly approvalDenied: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
24
|
+
readonly approvalRequired: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
25
|
+
readonly policyViolation: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
26
|
+
readonly discoveryFailed: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
27
|
+
readonly artifactWriteDenied: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
28
|
+
readonly artifactReadDenied: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
29
|
+
readonly timeout: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
30
|
+
readonly notImplemented: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
31
|
+
/**
|
|
32
|
+
* Mode 1 (kit-orchestrated) execution was requested but no agent
|
|
33
|
+
* provider is configured/registered (ADR-0019 §1). The CLI maps this to
|
|
34
|
+
* exit code 3 (blocked / prerequisite missing) and NEVER falls back to
|
|
35
|
+
* pretending a manual workflow completed.
|
|
36
|
+
*/
|
|
37
|
+
readonly agentProviderNotConfigured: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
38
|
+
readonly internal: (message: string, details?: Record<string, unknown>, cause?: unknown) => KitError;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,qBAAqB,GACrB,iBAAiB,G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ACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UACzB,OAAO,KACd,QAAQ;4CAEA,MAAM,YACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UACzB,OAAO,KACd,QAAQ;2CAEA,MAAM,YACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UACzB,OAAO,KACd,QAAQ;gCACQ,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,OAAO,KAAG,QAAQ;uCAE9D,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,OAAO,KAAG,QAAQ;IAE/F;;;;;OAKG;mDAEQ,MAAM,YACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UACzB,OAAO,KACd,QAAQ;iCACS,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,OAAO,KAAG,QAAQ;CAEjF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// packages/contracts/src/common/errors.ts
|
|
2
|
+
//
|
|
3
|
+
// Structured error type used by every Result<T, KitError>. The `code`
|
|
4
|
+
// field is the contract the caller switches on; the `message` is for
|
|
5
|
+
// humans; `details` is structured context for logs and reports.
|
|
6
|
+
//
|
|
7
|
+
// See docs/contracts/CONTRACTS.md §1.1.
|
|
8
|
+
export const kitError = (code, message, details, cause) => ({
|
|
9
|
+
code,
|
|
10
|
+
message,
|
|
11
|
+
...(details !== undefined ? { details } : {}),
|
|
12
|
+
...(cause !== undefined ? { cause } : {}),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Convenience constructors for the most common error codes. Keeping these
|
|
16
|
+
* in one place makes it easy to audit every site that produces a given code.
|
|
17
|
+
*
|
|
18
|
+
* Each factory accepts an optional `details` and an optional `cause`. The
|
|
19
|
+
* `cause` is attached when the error wraps another error (e.g., a caught
|
|
20
|
+
* exception); `details` carries structured context for logs and reports.
|
|
21
|
+
*/
|
|
22
|
+
export const Errors = {
|
|
23
|
+
contractInvalid: (message, details, cause) => kitError('CONTRACT_INVALID', message, details, cause),
|
|
24
|
+
profileInvalid: (message, details, cause) => kitError('PROFILE_INVALID', message, details, cause),
|
|
25
|
+
planInvalid: (message, details, cause) => kitError('PLAN_INVALID', message, details, cause),
|
|
26
|
+
specInvalid: (message, details, cause) => kitError('SPEC_INVALID', message, details, cause),
|
|
27
|
+
verificationFailed: (message, details, cause) => kitError('VERIFICATION_FAILED', message, details, cause),
|
|
28
|
+
approvalDenied: (message, details, cause) => kitError('APPROVAL_DENIED', message, details, cause),
|
|
29
|
+
approvalRequired: (message, details, cause) => kitError('APPROVAL_REQUIRED', message, details, cause),
|
|
30
|
+
policyViolation: (message, details, cause) => kitError('POLICY_VIOLATION', message, details, cause),
|
|
31
|
+
discoveryFailed: (message, details, cause) => kitError('DISCOVERY_FAILED', message, details, cause),
|
|
32
|
+
artifactWriteDenied: (message, details, cause) => kitError('ARTIFACT_WRITE_DENIED', message, details, cause),
|
|
33
|
+
artifactReadDenied: (message, details, cause) => kitError('ARTIFACT_READ_DENIED', message, details, cause),
|
|
34
|
+
timeout: (message, details, cause) => kitError('TIMEOUT', message, details, cause),
|
|
35
|
+
notImplemented: (message, details, cause) => kitError('NOT_IMPLEMENTED', message, details, cause),
|
|
36
|
+
/**
|
|
37
|
+
* Mode 1 (kit-orchestrated) execution was requested but no agent
|
|
38
|
+
* provider is configured/registered (ADR-0019 §1). The CLI maps this to
|
|
39
|
+
* exit code 3 (blocked / prerequisite missing) and NEVER falls back to
|
|
40
|
+
* pretending a manual workflow completed.
|
|
41
|
+
*/
|
|
42
|
+
agentProviderNotConfigured: (message, details, cause) => kitError('AGENT_PROVIDER_NOT_CONFIGURED', message, details, cause),
|
|
43
|
+
internal: (message, details, cause) => kitError('INTERNAL', message, details, cause),
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"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;IACjF,QAAQ,EAAE,CAAC,OAAe,EAAE,OAAiC,EAAE,KAAe,EAAY,EAAE,CAC1F,QAAQ,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const IdentifierSchema: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
3
|
+
export type Identifier = z.infer<typeof IdentifierSchema>;
|
|
4
|
+
export type FeatureId = Identifier;
|
|
5
|
+
export type TaskId = Identifier;
|
|
6
|
+
export type RunId = Identifier;
|
|
7
|
+
export type CheckId = Identifier;
|
|
8
|
+
/**
|
|
9
|
+
* Predicate form for use in non-zod contexts.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isValidIdentifier(value: string): boolean;
|
|
12
|
+
//# sourceMappingURL=identifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../src/common/identifier.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,wCAG3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAK1D,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AACnC,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAChC,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAC/B,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AAEjC;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// packages/contracts/src/common/identifier.ts
|
|
2
|
+
//
|
|
3
|
+
// Identifier format contract for FeatureId, TaskId, RunId, CheckId.
|
|
4
|
+
//
|
|
5
|
+
// Two accepted shapes:
|
|
6
|
+
// 1. Uppercase prefix + dash + 3+ digits: FEATURE-001, TASK-014, RUN-002
|
|
7
|
+
// 2. Lowercase kebab-case: unit-tests, typecheck, model-router
|
|
8
|
+
//
|
|
9
|
+
// See docs/contracts/CONTRACTS.md §1.2.
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export const IdentifierSchema = z.union([
|
|
12
|
+
z.string().regex(/^[A-Z]+-[0-9]{3,}$/, 'must match FEATURE-NNN pattern'),
|
|
13
|
+
z.string().regex(/^[a-z][a-z0-9-]{0,63}$/, 'must be lowercase kebab-case, max 64 chars'),
|
|
14
|
+
]);
|
|
15
|
+
/**
|
|
16
|
+
* Predicate form for use in non-zod contexts.
|
|
17
|
+
*/
|
|
18
|
+
export function isValidIdentifier(value) {
|
|
19
|
+
return IdentifierSchema.safeParse(value).success;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/common/identifier.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,oEAAoE;AACpE,EAAE;AACF,uBAAuB;AACvB,2EAA2E;AAC3E,iEAAiE;AACjE,EAAE;AACF,wCAAwC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC;IACtC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,oBAAoB,EAAE,gCAAgC,CAAC;IACxE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,EAAE,4CAA4C,CAAC;CACzF,CAAC,CAAC;AAYH;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { KitError } from './errors.js';
|
|
2
|
+
export interface Ok<T> {
|
|
3
|
+
readonly ok: true;
|
|
4
|
+
readonly value: T;
|
|
5
|
+
}
|
|
6
|
+
export interface Err<E> {
|
|
7
|
+
readonly ok: false;
|
|
8
|
+
readonly error: E;
|
|
9
|
+
}
|
|
10
|
+
export type Result<T, E = KitError> = Ok<T> | Err<E>;
|
|
11
|
+
export declare const ok: <T>(value: T) => Ok<T>;
|
|
12
|
+
export declare const err: <E>(error: E) => Err<E>;
|
|
13
|
+
/**
|
|
14
|
+
* Type-level exhaustiveness helper. Returns the error if `result` is `Err`,
|
|
15
|
+
* otherwise throws (programmer error: the caller should have checked `ok`
|
|
16
|
+
* first). Used in tests and in code paths where a `Err` is genuinely
|
|
17
|
+
* impossible by construction.
|
|
18
|
+
*/
|
|
19
|
+
export declare function unwrap<T, E>(result: Result<T, E>): T;
|
|
20
|
+
/**
|
|
21
|
+
* Functional map over the Ok value. Passes through Err unchanged.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mapOk<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
|
|
24
|
+
/**
|
|
25
|
+
* Functional map over the Err value. Passes through Ok unchanged.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mapErr<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>;
|
|
28
|
+
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E,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAEvF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// packages/contracts/src/common/result.ts
|
|
2
|
+
//
|
|
3
|
+
// Result<T, E> is the standard return shape for every function in `core`
|
|
4
|
+
// and `cli` that can fail in an expected way. Exceptions are reserved for
|
|
5
|
+
// programmer errors (e.g., violating an architectural invariant).
|
|
6
|
+
//
|
|
7
|
+
// See docs/contracts/CONTRACTS.md §1.1 and ADR-0007.
|
|
8
|
+
export const ok = (value) => ({ ok: true, value });
|
|
9
|
+
export const err = (error) => ({ ok: false, error });
|
|
10
|
+
/**
|
|
11
|
+
* Type-level exhaustiveness helper. Returns the error if `result` is `Err`,
|
|
12
|
+
* otherwise throws (programmer error: the caller should have checked `ok`
|
|
13
|
+
* first). Used in tests and in code paths where a `Err` is genuinely
|
|
14
|
+
* impossible by construction.
|
|
15
|
+
*/
|
|
16
|
+
export function unwrap(result) {
|
|
17
|
+
if (result.ok)
|
|
18
|
+
return result.value;
|
|
19
|
+
throw new Error(`unwrap called on Err: ${JSON.stringify(result.error)}`);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Functional map over the Ok value. Passes through Err unchanged.
|
|
23
|
+
*/
|
|
24
|
+
export function mapOk(result, fn) {
|
|
25
|
+
return result.ok ? ok(fn(result.value)) : result;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Functional map over the Err value. Passes through Ok unchanged.
|
|
29
|
+
*/
|
|
30
|
+
export function mapErr(result, fn) {
|
|
31
|
+
return result.ok ? result : err(fn(result.error));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/common/result.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,kEAAkE;AAClE,EAAE;AACF,qDAAqD;AAgBrD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAI,KAAQ,EAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAI,KAAQ,EAAU,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAO,MAAoB;IAC/C,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IACnC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAU,MAAoB,EAAE,EAAmB;IACtE,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAU,MAAoB,EAAE,EAAmB;IACvE,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC"}
|