@agentic-sdlc-kit/contracts 0.0.0-stage → 0.9.1
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 +86 -0
- package/dist/installer/ownership-manifest.d.ts.map +1 -0
- package/dist/installer/ownership-manifest.js +34 -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 +153 -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 +87 -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 +40 -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 +168 -0
- package/src/secret-guard/finding.ts +95 -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,91 @@
|
|
|
1
|
+
// packages/contracts/src/verification/report.test.ts
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { CheckSchema, VerificationReportSchema, rollupReportStatus, type Check } from './report.js';
|
|
4
|
+
|
|
5
|
+
const baseCheck = (overrides: Partial<Check> = {}): Check => ({
|
|
6
|
+
id: 'unit-tests',
|
|
7
|
+
status: 'passed',
|
|
8
|
+
...overrides,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
describe('CheckSchema', () => {
|
|
12
|
+
it('accepts a minimal check', () => {
|
|
13
|
+
expect(CheckSchema.safeParse({ id: 'x', status: 'passed' }).success).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('rejects an unknown status', () => {
|
|
16
|
+
expect(CheckSchema.safeParse({ id: 'x', status: 'ok' }).success).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('VerificationReportSchema', () => {
|
|
21
|
+
it('accepts a valid report', () => {
|
|
22
|
+
const r = VerificationReportSchema.safeParse({
|
|
23
|
+
schemaVersion: 1,
|
|
24
|
+
runId: 'RUN-001',
|
|
25
|
+
status: 'passed',
|
|
26
|
+
checks: [{ id: 'unit-tests', status: 'passed' }],
|
|
27
|
+
});
|
|
28
|
+
expect(r.success).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
it('rejects an invalid commitSha', () => {
|
|
31
|
+
const r = VerificationReportSchema.safeParse({
|
|
32
|
+
schemaVersion: 1,
|
|
33
|
+
runId: 'RUN-001',
|
|
34
|
+
status: 'passed',
|
|
35
|
+
checks: [],
|
|
36
|
+
commitSha: 'not-a-sha',
|
|
37
|
+
});
|
|
38
|
+
expect(r.success).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('rollupReportStatus', () => {
|
|
43
|
+
it("returns 'passed' when all checks passed", () => {
|
|
44
|
+
expect(rollupReportStatus([baseCheck(), baseCheck({ id: 'x', status: 'passed' })])).toBe(
|
|
45
|
+
'passed',
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
it("returns 'failed' when any check failed", () => {
|
|
49
|
+
expect(
|
|
50
|
+
rollupReportStatus([
|
|
51
|
+
baseCheck({ status: 'passed' }),
|
|
52
|
+
baseCheck({ id: 'x', status: 'failed' }),
|
|
53
|
+
]),
|
|
54
|
+
).toBe('failed');
|
|
55
|
+
});
|
|
56
|
+
it("returns 'blocked' when any check is blocked and none failed", () => {
|
|
57
|
+
expect(
|
|
58
|
+
rollupReportStatus([
|
|
59
|
+
baseCheck({ status: 'passed' }),
|
|
60
|
+
baseCheck({ id: 'x', status: 'blocked' }),
|
|
61
|
+
]),
|
|
62
|
+
).toBe('blocked');
|
|
63
|
+
});
|
|
64
|
+
it("returns 'blocked' when ALL checks are skipped (never 'passed')", () => {
|
|
65
|
+
expect(
|
|
66
|
+
rollupReportStatus([
|
|
67
|
+
baseCheck({ status: 'skipped' }),
|
|
68
|
+
baseCheck({ id: 'x', status: 'skipped' }),
|
|
69
|
+
]),
|
|
70
|
+
).toBe('blocked');
|
|
71
|
+
});
|
|
72
|
+
it("returns 'passed' when checks are passed + skipped (no failed, no blocked)", () => {
|
|
73
|
+
expect(
|
|
74
|
+
rollupReportStatus([
|
|
75
|
+
baseCheck({ status: 'passed' }),
|
|
76
|
+
baseCheck({ id: 'x', status: 'skipped' }),
|
|
77
|
+
]),
|
|
78
|
+
).toBe('passed');
|
|
79
|
+
});
|
|
80
|
+
it("returns 'blocked' when there are no checks", () => {
|
|
81
|
+
expect(rollupReportStatus([])).toBe('blocked');
|
|
82
|
+
});
|
|
83
|
+
it("prioritizes 'failed' over 'blocked'", () => {
|
|
84
|
+
expect(
|
|
85
|
+
rollupReportStatus([
|
|
86
|
+
baseCheck({ status: 'failed' }),
|
|
87
|
+
baseCheck({ id: 'x', status: 'blocked' }),
|
|
88
|
+
]),
|
|
89
|
+
).toBe('failed');
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// packages/contracts/src/verification/report.ts
|
|
2
|
+
//
|
|
3
|
+
// Verification report contract. The status union is exhaustive and
|
|
4
|
+
// forbids the "skipped = passed" failure mode by construction.
|
|
5
|
+
//
|
|
6
|
+
// Critical invariants (see docs/contracts/CONTRACTS.md §6):
|
|
7
|
+
// - passed: execution succeeded.
|
|
8
|
+
// - failed: execution found a failure.
|
|
9
|
+
// - skipped: the check was not performed. NEVER counts as passed.
|
|
10
|
+
// - blocked: the check could not safely proceed. NEVER counts as passed.
|
|
11
|
+
// - A scanner failure is `failed` or `blocked`, never `passed`.
|
|
12
|
+
//
|
|
13
|
+
// See docs/security/SECURITY.md §1 (no false assurance).
|
|
14
|
+
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
|
|
17
|
+
export const CheckStatusSchema = z.enum(['passed', 'failed', 'skipped', 'blocked']);
|
|
18
|
+
export type CheckStatus = z.infer<typeof CheckStatusSchema>;
|
|
19
|
+
|
|
20
|
+
export const VERIFICATION_REPORT_SCHEMA_VERSION = 1 as const;
|
|
21
|
+
|
|
22
|
+
export const CheckSchema = z.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
status: CheckStatusSchema,
|
|
25
|
+
command: z.array(z.string()).optional(),
|
|
26
|
+
durationMs: z.number().int().nonnegative().optional(),
|
|
27
|
+
evidence: z.array(z.string()).optional(),
|
|
28
|
+
errors: z.array(z.string()).optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const VerificationReportSchema = z.object({
|
|
32
|
+
schemaVersion: z.literal(VERIFICATION_REPORT_SCHEMA_VERSION),
|
|
33
|
+
runId: z.string(),
|
|
34
|
+
commitSha: z
|
|
35
|
+
.string()
|
|
36
|
+
.regex(/^[0-9a-f]{40}$/)
|
|
37
|
+
.optional(),
|
|
38
|
+
status: z.enum(['passed', 'failed', 'blocked']),
|
|
39
|
+
checks: z.array(CheckSchema),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export type Check = z.infer<typeof CheckSchema>;
|
|
43
|
+
export type VerificationReport = z.infer<typeof VerificationReportSchema>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Roll up check statuses into the report status.
|
|
47
|
+
*
|
|
48
|
+
// - Any `failed` check → report `failed`.
|
|
49
|
+
// - Any `blocked` check (and no failed) → report `blocked`.
|
|
50
|
+
// - Otherwise → `passed`.
|
|
51
|
+
//
|
|
52
|
+
// A `skipped` check NEVER promotes a report to `passed` on its own; if
|
|
53
|
+
// every check is `skipped`, the report is `blocked` (we could not safely
|
|
54
|
+
// verify anything). This is a contract invariant, not a convenience.
|
|
55
|
+
*/
|
|
56
|
+
export function rollupReportStatus(checks: ReadonlyArray<Check>): VerificationReport['status'] {
|
|
57
|
+
if (checks.length === 0) return 'blocked';
|
|
58
|
+
if (checks.some((c) => c.status === 'failed')) return 'failed';
|
|
59
|
+
if (checks.some((c) => c.status === 'blocked')) return 'blocked';
|
|
60
|
+
if (checks.every((c) => c.status === 'skipped')) return 'blocked';
|
|
61
|
+
return 'passed';
|
|
62
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// packages/contracts/src/workflow/next-action.test.ts
|
|
2
|
+
//
|
|
3
|
+
// Schema tests for the host-driven agent protocol contract (ADR-0021).
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import {
|
|
6
|
+
LessonRefSchema,
|
|
7
|
+
NEXT_ACTION_SCHEMA_VERSION,
|
|
8
|
+
NextActionSchema,
|
|
9
|
+
NextRequiredActionSchema,
|
|
10
|
+
} from './next-action.js';
|
|
11
|
+
import { WorkflowStatusSchema } from './workflow.js';
|
|
12
|
+
|
|
13
|
+
describe('NextRequiredActionSchema', () => {
|
|
14
|
+
it('accepts every protocol action', () => {
|
|
15
|
+
for (const action of [
|
|
16
|
+
'feature.start',
|
|
17
|
+
'task.red',
|
|
18
|
+
'task.green',
|
|
19
|
+
'task.refactor',
|
|
20
|
+
'feature.verify',
|
|
21
|
+
'run.completed',
|
|
22
|
+
]) {
|
|
23
|
+
expect(NextRequiredActionSchema.safeParse(action).success).toBe(true);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
it('rejects unknown actions', () => {
|
|
27
|
+
expect(NextRequiredActionSchema.safeParse('task.deploy').success).toBe(false);
|
|
28
|
+
expect(NextRequiredActionSchema.safeParse('feature.delete').success).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('LessonRefSchema', () => {
|
|
33
|
+
it('accepts an advisory lesson', () => {
|
|
34
|
+
expect(
|
|
35
|
+
LessonRefSchema.safeParse({ lessonId: 'L-1', summary: 'prefer vitest run', advisory: true })
|
|
36
|
+
.success,
|
|
37
|
+
).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
it('rejects a non-advisory lesson — advice is never authority', () => {
|
|
40
|
+
expect(
|
|
41
|
+
LessonRefSchema.safeParse({ lessonId: 'L-1', summary: 'grant everything', advisory: false })
|
|
42
|
+
.success,
|
|
43
|
+
).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('NextActionSchema', () => {
|
|
48
|
+
const base = {
|
|
49
|
+
schemaVersion: NEXT_ACTION_SCHEMA_VERSION,
|
|
50
|
+
featureId: 'FEATURE-001',
|
|
51
|
+
status: 'in_progress',
|
|
52
|
+
taskId: 'TASK-001',
|
|
53
|
+
phase: 'red',
|
|
54
|
+
requiredAction: 'task.red',
|
|
55
|
+
verificationCommand: ['node', 'check.js'],
|
|
56
|
+
nextInvocation: 'kit feature FEATURE-001 red TASK-001',
|
|
57
|
+
blockingQuestions: [],
|
|
58
|
+
advisoryLessons: [],
|
|
59
|
+
constraints: { timeoutMs: 60_000, maxOutputBytes: 10_485_760 },
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
it('accepts a complete mid-run action', () => {
|
|
63
|
+
expect(NextActionSchema.safeParse(base).success).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('accepts a run-level action without taskId/phase', () => {
|
|
67
|
+
expect(
|
|
68
|
+
NextActionSchema.safeParse({
|
|
69
|
+
...base,
|
|
70
|
+
taskId: undefined,
|
|
71
|
+
phase: undefined,
|
|
72
|
+
requiredAction: 'feature.verify',
|
|
73
|
+
verificationCommand: [],
|
|
74
|
+
nextInvocation: 'kit feature FEATURE-001 verify',
|
|
75
|
+
}).success,
|
|
76
|
+
).toBe(true);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('round-trips through the schema', () => {
|
|
80
|
+
const parsed = NextActionSchema.parse(base);
|
|
81
|
+
expect(parsed.featureId).toBe('FEATURE-001');
|
|
82
|
+
expect(parsed.requiredAction).toBe('task.red');
|
|
83
|
+
expect(parsed.constraints.timeoutMs).toBe(60_000);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('rejects a mismatched schema version (wire compatibility, CONTRACTS.md §9)', () => {
|
|
87
|
+
expect(NextActionSchema.safeParse({ ...base, schemaVersion: 2 }).success).toBe(false);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('rejects a non-positive constraint bound', () => {
|
|
91
|
+
expect(
|
|
92
|
+
NextActionSchema.safeParse({ ...base, constraints: { timeoutMs: 0, maxOutputBytes: 1 } })
|
|
93
|
+
.success,
|
|
94
|
+
).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('rejects an unknown workflow status', () => {
|
|
98
|
+
expect(WorkflowStatusSchema.safeParse('exploding').success).toBe(false);
|
|
99
|
+
expect(NextActionSchema.safeParse({ ...base, status: 'exploding' }).success).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// packages/contracts/src/workflow/next-action.ts
|
|
2
|
+
//
|
|
3
|
+
// Host-driven agent protocol (ADR-0021): the `kit next` primitive.
|
|
4
|
+
//
|
|
5
|
+
// Tier C hosts (Cursor, AGY, CI, any terminal-capable agent) drive the
|
|
6
|
+
// kit through the CLI rather than being driven by it (that is the
|
|
7
|
+
// ADR-0019 provider direction). `kit next --json` is their ONLY required
|
|
8
|
+
// entry point: a bounded, machine-readable answer to "what is the next
|
|
9
|
+
// action, against what target, under which constraints?".
|
|
10
|
+
//
|
|
11
|
+
// Protocol rules (ADR-0021 §2):
|
|
12
|
+
// - The payload is bounded. An agent never needs to read prose docs to
|
|
13
|
+
// make progress; every field it needs to act is present.
|
|
14
|
+
// - `verificationCommand` is the TASK'S OWN command from the plan
|
|
15
|
+
// (ADR-0018 P1) — empty when the next action is not task-scoped.
|
|
16
|
+
// - `advisoryLessons` are ADVISORY ONLY. A lesson never authorizes an
|
|
17
|
+
// action and never satisfies a phase invariant; the evidence gate in
|
|
18
|
+
// core.workflows.feature-workflow is the sole authority (mirrors the
|
|
19
|
+
// model-router invariant: the router cannot be the authority for
|
|
20
|
+
// security).
|
|
21
|
+
// - `blockingQuestions` is honest: an empty array means "the kit is
|
|
22
|
+
// not waiting on a human", not "no question could ever matter".
|
|
23
|
+
// Tier C has no approval surface today; absence of an approval UI is
|
|
24
|
+
// a capability downgrade, never a policy bypass (SECURITY.md §3.1).
|
|
25
|
+
//
|
|
26
|
+
// This schema is a wire contract: any host may parse it. Breaking
|
|
27
|
+
// changes require a new schemaVersion (CONTRACTS.md §9).
|
|
28
|
+
|
|
29
|
+
import { z } from 'zod';
|
|
30
|
+
import { WorkflowStatusSchema } from './workflow.js';
|
|
31
|
+
|
|
32
|
+
export const NEXT_ACTION_SCHEMA_VERSION = 1 as const;
|
|
33
|
+
|
|
34
|
+
/** What the driver must do next to make progress on this run. */
|
|
35
|
+
export const NextRequiredActionSchema = z.enum([
|
|
36
|
+
/** No run state exists for this feature — start one. */
|
|
37
|
+
'feature.start',
|
|
38
|
+
/** Write the failing test for `taskId`, then run its red phase. */
|
|
39
|
+
'task.red',
|
|
40
|
+
/** Implement `taskId` minimally, then run its green phase. */
|
|
41
|
+
'task.green',
|
|
42
|
+
/** Refactor `taskId` (behavior preserved), then run its refactor phase. */
|
|
43
|
+
'task.refactor',
|
|
44
|
+
/** All tasks completed — audit the evidence chain and run final verification. */
|
|
45
|
+
'feature.verify',
|
|
46
|
+
/** The run passed final verification; nothing further is required. */
|
|
47
|
+
'run.completed',
|
|
48
|
+
]);
|
|
49
|
+
export type NextRequiredAction = z.infer<typeof NextRequiredActionSchema>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A reference to an advisory lesson surfaced by the learning loop.
|
|
53
|
+
* `advisory: true` is a literal, not a flag: the type system carries the
|
|
54
|
+
* promise that a lesson is advice, never authority.
|
|
55
|
+
*/
|
|
56
|
+
export const LessonRefSchema = z.object({
|
|
57
|
+
lessonId: z.string().min(1),
|
|
58
|
+
summary: z.string().min(1),
|
|
59
|
+
advisory: z.literal(true),
|
|
60
|
+
});
|
|
61
|
+
export type LessonRef = z.infer<typeof LessonRefSchema>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Execution constraints the kit will enforce on the next phase
|
|
65
|
+
* verification. Bounded by default; a host may not raise them beyond
|
|
66
|
+
* what the phase runner enforces (core.workflows feature-workflow,
|
|
67
|
+
* ProcessVerificationRunner).
|
|
68
|
+
*/
|
|
69
|
+
export const NextActionConstraintsSchema = z.object({
|
|
70
|
+
/** Phase verification timeout (default 60_000 ms, runTddPhase). */
|
|
71
|
+
timeoutMs: z.number().int().positive(),
|
|
72
|
+
/** Output capture bound (default 10 MiB, ProcessVerificationRunner). */
|
|
73
|
+
maxOutputBytes: z.number().int().positive(),
|
|
74
|
+
});
|
|
75
|
+
export type NextActionConstraints = z.infer<typeof NextActionConstraintsSchema>;
|
|
76
|
+
|
|
77
|
+
export const NextActionSchema = z.object({
|
|
78
|
+
schemaVersion: z.literal(NEXT_ACTION_SCHEMA_VERSION),
|
|
79
|
+
/** The feature run this action belongs to (one run per feature id). */
|
|
80
|
+
featureId: z.string().min(1),
|
|
81
|
+
status: WorkflowStatusSchema,
|
|
82
|
+
/** Target task of the next action; absent for run-level actions. */
|
|
83
|
+
taskId: z.string().optional(),
|
|
84
|
+
/** TDD phase the target task is in; present iff taskId is present. */
|
|
85
|
+
phase: z.enum(['red', 'green', 'refactor']).optional(),
|
|
86
|
+
requiredAction: NextRequiredActionSchema,
|
|
87
|
+
/**
|
|
88
|
+
* The task's own verification command from the plan (ADR-0018 P1).
|
|
89
|
+
* Empty when the next action is not task-scoped (feature.start,
|
|
90
|
+
* feature.verify, run.completed) — the profile commands govern there.
|
|
91
|
+
*/
|
|
92
|
+
verificationCommand: z.array(z.string()),
|
|
93
|
+
/** The literal CLI invocation that executes the required action. */
|
|
94
|
+
nextInvocation: z.string().min(1),
|
|
95
|
+
/** Questions the kit is waiting on a human to answer. Honest, possibly empty. */
|
|
96
|
+
blockingQuestions: z.array(z.string()),
|
|
97
|
+
/** Advisory lessons (ADVISORY ONLY — never authority; ADR-0021 §4). */
|
|
98
|
+
advisoryLessons: z.array(LessonRefSchema),
|
|
99
|
+
constraints: NextActionConstraintsSchema,
|
|
100
|
+
});
|
|
101
|
+
export type NextAction = z.infer<typeof NextActionSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// packages/contracts/src/workflow/workflow.ts
|
|
2
|
+
//
|
|
3
|
+
// Workflow mode, status, state, and transitions.
|
|
4
|
+
//
|
|
5
|
+
// The state machine in core.workflows.engine enforces the transition table
|
|
6
|
+
// in docs/workflows/WORKFLOWS.md §2. No transition may turn `failed` back
|
|
7
|
+
// into `completed` without a new run.
|
|
8
|
+
//
|
|
9
|
+
// See docs/contracts/CONTRACTS.md §3.
|
|
10
|
+
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import type { RunId, TaskId } from '../common/identifier.js';
|
|
13
|
+
import type { CheckStatus } from '../verification/report.js';
|
|
14
|
+
|
|
15
|
+
export const WorkflowModeSchema = z.enum(['app', 'feature', 'fix', 'refactor']);
|
|
16
|
+
export type WorkflowMode = z.infer<typeof WorkflowModeSchema>;
|
|
17
|
+
|
|
18
|
+
export const WorkflowStatusSchema = z.enum([
|
|
19
|
+
'pending',
|
|
20
|
+
'in_progress',
|
|
21
|
+
'blocked',
|
|
22
|
+
'completed',
|
|
23
|
+
'failed',
|
|
24
|
+
]);
|
|
25
|
+
export type WorkflowStatus = z.infer<typeof WorkflowStatusSchema>;
|
|
26
|
+
|
|
27
|
+
export const WorkflowTransitionSchema = z.enum(['start', 'block', 'resume', 'complete', 'fail']);
|
|
28
|
+
export type WorkflowTransition = z.infer<typeof WorkflowTransitionSchema>;
|
|
29
|
+
|
|
30
|
+
export const TaskHistoryEntrySchema = z.object({
|
|
31
|
+
taskId: z.string(),
|
|
32
|
+
status: z.enum(['passed', 'failed', 'skipped', 'blocked']),
|
|
33
|
+
evidence: z.array(z.string()).optional(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const WorkflowStateSchema = z.object({
|
|
37
|
+
runId: z.string(),
|
|
38
|
+
mode: WorkflowModeSchema,
|
|
39
|
+
status: WorkflowStatusSchema,
|
|
40
|
+
startedAt: z.string().optional(),
|
|
41
|
+
currentTaskId: z.string().optional(),
|
|
42
|
+
taskHistory: z.array(TaskHistoryEntrySchema),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export type WorkflowState = z.infer<typeof WorkflowStateSchema>;
|
|
46
|
+
export type TaskHistoryEntry = z.infer<typeof TaskHistoryEntrySchema>;
|
|
47
|
+
|
|
48
|
+
// Re-export for ergonomic imports.
|
|
49
|
+
export type { RunId, TaskId, CheckStatus };
|