ai-delivery-workflow 0.2.2 → 0.4.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/README.md +45 -14
- package/bin/ai-delivery.mjs +181 -6
- package/bin/benchmark-autonomy.mjs +217 -0
- package/bin/release-check.mjs +382 -0
- package/docs/CLI-PARAMETER-REFERENCE.zh-CN.md +346 -0
- package/docs/CODEGRAPH-INTEGRATION.zh-CN.md +89 -0
- package/docs/DUAL-REPOSITORY-WORKSPACE.zh-CN.md +2 -2
- package/docs/EVOLUTION-MAINTENANCE.zh-CN.md +7 -7
- package/docs/EVOLUTION-USER-GUIDE.zh-CN.md +2 -2
- package/docs/FILE-REFERENCE.zh-CN.md +120 -39
- package/docs/MAINTENANCE-VERIFICATION.zh-CN.md +51 -0
- package/docs/MOCK-SYSTEM.zh-CN.md +141 -0
- package/docs/NPM-RELEASE-MANAGEMENT.zh-CN.md +106 -0
- package/docs/PROJECT-MANUAL.zh-CN.md +154 -95
- package/docs/PROTOTYPE-MIGRATION.zh-CN.md +164 -0
- package/docs/STATE-CLI-MAINTENANCE.zh-CN.md +35 -17
- package/docs/STATE-CLI-USER-GUIDE.zh-CN.md +115 -39
- package/docs/VIEWER-MAINTENANCE.zh-CN.md +101 -324
- package/docs/VIEWER-USER-GUIDE.zh-CN.md +68 -190
- package/docs/adr/0001-prototype-first-ui-governance.md +3 -0
- package/docs/adr/0002-microcks-as-default-mock-system.md +3 -0
- package/docs/adr/0003-workflow-manager-governed-control-surface.md +46 -0
- package/docs/adr/0004-operational-carbon-visual-standard.md +9 -0
- package/docs/adr/0005-prototype-management-as-routed-pages.md +7 -0
- package/docs/agents/domain.md +12 -0
- package/docs/agents/issue-tracker.md +27 -0
- package/docs/agents/triage-labels.md +11 -0
- package/docs/agents/workflow-manager-acceptance-matrix.md +93 -0
- package/docs/agents/workflow-manager-agent-interface.md +145 -0
- package/docs/agents/workflow-manager-current-state.md +205 -0
- package/lib/artifact-files.mjs +47 -0
- package/lib/codegraph.mjs +405 -0
- package/lib/delivery-state.mjs +3079 -198
- package/lib/frontend-guard.mjs +288 -0
- package/lib/fs-utils.mjs +53 -0
- package/lib/history-anchor.mjs +98 -0
- package/lib/mock-scenario-pack.mjs +687 -0
- package/lib/mock-system.mjs +897 -0
- package/lib/npm-package-result.mjs +11 -0
- package/lib/png-evidence.mjs +149 -0
- package/lib/project-bootstrap.mjs +96 -55
- package/lib/project-installer.mjs +1484 -164
- package/lib/project-migration.mjs +1193 -0
- package/lib/prototype-migration.mjs +713 -0
- package/lib/prototype-page-review.mjs +384 -0
- package/lib/prototype-review-target.mjs +334 -0
- package/lib/prototype-revision.mjs +812 -0
- package/lib/stable-value.mjs +15 -0
- package/lib/toml-hooks.mjs +69 -0
- package/lib/ui-acceptance.mjs +565 -0
- package/lib/visual-standard.mjs +232 -0
- package/lib/workflow-manager-contracts.mjs +367 -0
- package/lib/workflow-manager-facts.mjs +778 -0
- package/lib/workflow-manager-governance.mjs +514 -0
- package/lib/workflow-manager-mock.mjs +183 -0
- package/lib/workflow-manager-prototypes.mjs +1847 -0
- package/lib/workflow-manager-public/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/lib/workflow-manager-public/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/lib/workflow-manager-public/assets/index-Chlg6r8f.css +1 -0
- package/lib/workflow-manager-public/assets/index-E-hGB5ZD.js +13 -0
- package/lib/workflow-manager-public/fonts/OFL-1.1.txt +90 -0
- package/lib/workflow-manager-public/index.html +14 -0
- package/lib/workflow-manager-systems.mjs +519 -0
- package/lib/workflow-manager-transaction.mjs +397 -0
- package/lib/workflow-manager.mjs +745 -0
- package/package.json +8 -2
- package/skills/ai-delivery-assemble-release/agents/openai.yaml +3 -3
- package/skills/ai-delivery-assemble-release/assets/release-material-index.csv +1 -1
- package/skills/ai-delivery-assemble-release/assets/version-inclusion.csv +1 -1
- package/skills/ai-delivery-bootstrap/SKILL.md +4 -4
- package/skills/ai-delivery-bootstrap/agents/openai.yaml +3 -3
- package/skills/ai-delivery-bootstrap/references/bootstrap-contract.md +4 -2
- package/skills/ai-delivery-checkpoint-task/SKILL.md +17 -3
- package/skills/ai-delivery-checkpoint-task/agents/openai.yaml +3 -3
- package/skills/ai-delivery-checkpoint-task/assets/runtime-template/task.json +7 -1
- package/skills/ai-delivery-checkpoint-task/references/checkpoint-contract.md +22 -8
- package/skills/ai-delivery-checkpoint-task/scripts/hook-event.mjs +91 -0
- package/skills/ai-delivery-checkpoint-task/scripts/task-state.mjs +1086 -51
- package/skills/ai-delivery-close-version/SKILL.md +9 -8
- package/skills/ai-delivery-close-version/agents/openai.yaml +3 -3
- package/skills/ai-delivery-close-version/assets/version-lineage.yaml +1 -1
- package/skills/ai-delivery-close-version/references/version-closeout-contract.md +2 -2
- package/skills/ai-delivery-define-product/SKILL.md +8 -4
- package/skills/ai-delivery-define-product/agents/openai.yaml +4 -4
- package/skills/ai-delivery-define-product/references/product-contract.md +2 -2
- package/skills/ai-delivery-deploy-production/agents/openai.yaml +3 -3
- package/skills/ai-delivery-design-architecture/SKILL.md +9 -5
- package/skills/ai-delivery-design-architecture/assets/architecture-template/prototype-architecture-validation.yaml +16 -16
- package/skills/ai-delivery-design-architecture/references/architecture-contract.md +1 -1
- package/skills/ai-delivery-design-experience/SKILL.md +36 -30
- package/skills/ai-delivery-design-experience/agents/openai.yaml +4 -4
- package/skills/ai-delivery-design-experience/assets/experience-template/LEGACY-COMPATIBILITY.md +16 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/design-reference-selection.yaml +32 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/experience-baseline.yaml +2 -2
- package/skills/ai-delivery-design-experience/assets/experience-template/formal-ui-confirmation.yaml +16 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/frontend-change-scope.yaml +30 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/interaction-contract.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-admin-export.yaml +8 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-scenario-mappings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/mock-scenario-pack-request.yaml +24 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/product-prototype-reconciliation.yaml +2 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-adjustment-log.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-component-bindings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-component-candidates.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-components.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-confirmation.yaml +18 -18
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-data-contracts.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-impact-assessment.yaml +5 -5
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-implementation-bindings.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-manifest.yaml +2 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-pages.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-product-coverage.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-comments.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-decision.yaml +13 -12
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-scenes.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-sessions.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-unit-pages.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-units.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-revision.yaml +88 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-routes.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-set.yaml +2 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-source-inspection-snapshots.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-terminals.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-candidates.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-selection.yaml +2 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-traceability.csv +1 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-trigger-conditions.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype.yaml +6 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-framework-selection.yaml +17 -1
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-handoff.yaml +6 -5
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-mapping.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-direction.yaml +4 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-reference-manifest.yaml +23 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-reference.html +163 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-system-confirmation.yaml +11 -0
- package/skills/ai-delivery-design-experience/references/experience-contract.md +26 -27
- package/skills/ai-delivery-design-experience/references/prototype-management-contract.md +42 -21
- package/skills/ai-delivery-design-tests/SKILL.md +13 -7
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-scope.csv +1 -1
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-validation.yaml +17 -16
- package/skills/ai-delivery-design-tests/references/test-design-contract.md +7 -5
- package/skills/ai-delivery-develop-iteration/SKILL.md +18 -11
- package/skills/ai-delivery-develop-iteration/agents/openai.yaml +3 -3
- package/skills/ai-delivery-develop-iteration/assets/development-template/candidate-manifest.yaml +36 -0
- package/skills/ai-delivery-develop-iteration/assets/development-template/task-prototype-traceability.csv +1 -1
- package/skills/ai-delivery-develop-iteration/references/development-contract.md +5 -3
- package/skills/ai-delivery-evolve-workflow/agents/openai.yaml +3 -3
- package/skills/ai-delivery-execute-test/SKILL.md +6 -2
- package/skills/ai-delivery-execute-test/agents/openai.yaml +4 -4
- package/skills/ai-delivery-execute-work-package/SKILL.md +10 -3
- package/skills/ai-delivery-execute-work-package/agents/openai.yaml +4 -4
- package/skills/ai-delivery-execute-work-package/references/work-package-contract.md +1 -1
- package/skills/ai-delivery-manage-git/agents/openai.yaml +3 -3
- package/skills/ai-delivery-manage-standards/agents/openai.yaml +4 -4
- package/skills/ai-delivery-orchestrate/SKILL.md +47 -29
- package/skills/ai-delivery-orchestrate/agents/openai.yaml +3 -3
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/control/migrations/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/control/repairs/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/project.yaml +1 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/workflow-state.yaml +2 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/frontend-guard/frontend-guard.mjs +50 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/hooks/hook-event.mjs +91 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/manager.mjs +64 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/start.cmd +4 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/manager/start.ps1 +2 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/{viewer → manager}/start.sh +1 -1
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/mock/mock.mjs +50 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/ui-acceptance/ui-acceptance.mjs +37 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/AGENTS.md +32 -6
- package/skills/ai-delivery-orchestrate/assets/project-template/gitignore.template +1 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/CONTRIBUTING.md +25 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/LICENSE +21 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/README.md +250 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/UPSTREAM.yaml +19 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airbnb/DESIGN.md +545 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airbnb/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airtable/DESIGN.md +554 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/airtable/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/apple/DESIGN.md +562 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/apple/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/binance/DESIGN.md +634 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/binance/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw-m/DESIGN.md +503 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bmw-m/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bugatti/DESIGN.md +454 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/bugatti/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cal/DESIGN.md +542 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cal/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/claude/DESIGN.md +589 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/claude/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clay/DESIGN.md +541 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clay/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clickhouse/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/clickhouse/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cohere/DESIGN.md +451 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cohere/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/coinbase/DESIGN.md +570 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/coinbase/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/composio/DESIGN.md +506 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/composio/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cursor/DESIGN.md +537 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/cursor/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/dell-1996/DESIGN.md +632 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/dell-1996/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/elevenlabs/DESIGN.md +504 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/elevenlabs/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/expo/DESIGN.md +526 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/expo/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ferrari/DESIGN.md +531 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ferrari/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/figma/DESIGN.md +578 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/figma/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/framer/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/framer/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hashicorp/DESIGN.md +575 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hashicorp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hp/DESIGN.md +670 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/hp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ibm/DESIGN.md +550 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ibm/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/intercom/DESIGN.md +546 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/intercom/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/kraken/DESIGN.md +125 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/kraken/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lamborghini/DESIGN.md +288 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lamborghini/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/linear.app/DESIGN.md +548 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/linear.app/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lovable/DESIGN.md +298 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/lovable/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mastercard/DESIGN.md +365 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mastercard/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/meta/DESIGN.md +683 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/meta/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/minimax/DESIGN.md +746 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/minimax/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mintlify/DESIGN.md +852 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mintlify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/miro/DESIGN.md +825 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/miro/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mistral.ai/DESIGN.md +773 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mistral.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mongodb/DESIGN.md +767 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/mongodb/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nike/DESIGN.md +575 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nike/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nintendo-2001/DESIGN.md +649 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nintendo-2001/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/notion/DESIGN.md +821 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/notion/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nvidia/DESIGN.md +640 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/nvidia/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ollama/DESIGN.md +539 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/ollama/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/opencode.ai/DESIGN.md +521 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/opencode.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/pinterest/DESIGN.md +597 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/pinterest/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/playstation/DESIGN.md +661 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/playstation/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/posthog/DESIGN.md +690 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/posthog/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/raycast/DESIGN.md +669 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/raycast/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/renault/DESIGN.md +589 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/renault/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/replicate/DESIGN.md +616 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/replicate/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/resend/DESIGN.md +585 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/resend/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/revolut/DESIGN.md +636 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/revolut/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/runwayml/DESIGN.md +244 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/runwayml/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sanity/DESIGN.md +357 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sanity/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sentry/DESIGN.md +551 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/sentry/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/shopify/DESIGN.md +516 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/shopify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/slack/DESIGN.md +482 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spacex/DESIGN.md +363 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spacex/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spotify/DESIGN.md +246 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/spotify/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/starbucks/DESIGN.md +580 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/starbucks/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/stripe/DESIGN.md +487 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/stripe/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/supabase/DESIGN.md +462 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/supabase/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/superhuman/DESIGN.md +448 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/superhuman/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/tesla/DESIGN.md +286 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/tesla/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/theverge/DESIGN.md +339 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/theverge/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/together.ai/DESIGN.md +633 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/together.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/uber/DESIGN.md +636 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/uber/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vercel/DESIGN.md +736 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vercel/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vodafone/DESIGN.md +538 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/vodafone/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/voltagent/DESIGN.md +521 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/voltagent/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/warp/DESIGN.md +526 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/warp/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/webflow/DESIGN.md +588 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/webflow/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wired/DESIGN.md +497 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wired/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wise/DESIGN.md +544 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/wise/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/x.ai/DESIGN.md +465 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/x.ai/README.md +5 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/zapier/DESIGN.md +537 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/ref/ui/design-md/zapier/README.md +5 -0
- package/skills/ai-delivery-orchestrate/references/formal-state-contract.md +65 -20
- package/skills/ai-delivery-orchestrate/references/workflow-model.md +7 -5
- package/skills/ai-delivery-orchestrate-release/SKILL.md +2 -2
- package/skills/ai-delivery-orchestrate-release/agents/openai.yaml +4 -4
- package/skills/ai-delivery-orchestrate-release/references/release-workflow-contract.md +1 -1
- package/skills/ai-delivery-plan-iteration/SKILL.md +11 -4
- package/skills/ai-delivery-plan-iteration/agents/openai.yaml +4 -4
- package/skills/ai-delivery-plan-iteration/assets/planning-template/scope-manifest.yaml +17 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-prototype-traceability.csv +1 -1
- package/skills/ai-delivery-plan-iteration/references/planning-contract.md +8 -2
- package/skills/ai-delivery-prepare-platform/SKILL.md +5 -1
- package/skills/ai-delivery-prepare-platform/agents/openai.yaml +4 -4
- package/skills/ai-delivery-prepare-release/agents/openai.yaml +4 -4
- package/skills/ai-delivery-review-change/SKILL.md +14 -4
- package/skills/ai-delivery-review-change/agents/openai.yaml +4 -4
- package/skills/ai-delivery-review-change/references/review-contract.md +6 -0
- package/skills/ai-delivery-triage-failure/SKILL.md +5 -1
- package/skills/ai-delivery-triage-failure/agents/openai.yaml +4 -4
- package/skills/ai-delivery-validate-artifacts/SKILL.md +6 -3
- package/skills/ai-delivery-validate-artifacts/agents/openai.yaml +4 -4
- package/skills/ai-delivery-validate-artifacts/references/artifact-contract.md +13 -13
- package/skills/ai-delivery-verify-candidate/SKILL.md +13 -6
- package/skills/ai-delivery-verify-candidate/agents/openai.yaml +3 -3
- package/skills/ai-delivery-verify-candidate/assets/verification-template/ui-acceptance-request.yaml +19 -0
- package/skills/ai-delivery-verify-candidate/assets/verification-template/ui-acceptance-results.yaml +53 -0
- package/skills/ai-delivery-verify-candidate/references/candidate-verification-contract.md +10 -2
- package/skills/ai-delivery-verify-production/agents/openai.yaml +3 -3
- package/skills/ai-delivery-design-experience/assets/experience-template/low-fidelity-confirmation.yaml +0 -32
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/app.js +0 -546
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/index.html +0 -199
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/styles.css +0 -529
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/server.mjs +0 -780
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.cmd +0 -4
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.ps1 +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-delivery-workflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Project-scoped Codex skills and hooks for artifact-driven AI software delivery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -23,9 +23,12 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"test": "node --test verification/*.test.mjs",
|
|
26
|
+
"manager:build": "npm --prefix manager run build",
|
|
26
27
|
"skills:validate": "node bin/validate-skills.mjs",
|
|
27
28
|
"audit:generate": "node audit/generate-all.mjs",
|
|
28
29
|
"audit:verify": "node verification/audit/verify-audit.mjs",
|
|
30
|
+
"benchmark:autonomy": "node bin/benchmark-autonomy.mjs",
|
|
31
|
+
"release:check": "node bin/release-check.mjs",
|
|
29
32
|
"pack:check": "npm pack --dry-run"
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
@@ -35,5 +38,8 @@
|
|
|
35
38
|
"engines": {
|
|
36
39
|
"node": ">=18"
|
|
37
40
|
},
|
|
38
|
-
"license": "MIT"
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"playwright-core": "^1.55.0"
|
|
44
|
+
}
|
|
39
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Assemble Release"
|
|
3
|
-
short_description: "Validate version lineage and aggregate release materials"
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Assemble Release"
|
|
3
|
+
short_description: "Validate version lineage and aggregate release materials"
|
|
4
4
|
default_prompt: "Use $ai-delivery-assemble-release to validate both repositories, calculate the version closure, and assemble its candidate."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
item_id,category,source_version_id,artifact_id,repo_id,code_commit,code_tag,source_path,original_workflow_path,sha256,target_environment,apply_order,verification,rollback_or_recovery
|
|
2
|
-
ITEM-0001,container-image,VER-0001,ART-IMAGE-0001,app,<git-sha>,version-ready/VER-0001/r1,code,.workflow/iterations/VER-0001/
|
|
2
|
+
ITEM-0001,container-image,VER-0001,ART-IMAGE-0001,app,<git-sha>,version-ready/VER-0001/r1,code,.workflow/iterations/VER-0001/06-version-closeout/version-manifest.yaml,<sha256>,production,10,verify image digest,deploy previous immutable image digest
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
sequence,version_id,predecessor_version_id,candidate_id,candidate_commit,version_ready_tag,manifest_path,manifest_sha256,inclusion_type
|
|
2
|
-
1,VER-0001,,CAND-0001,<git-sha>,version-ready/VER-0001/r1,.workflow/iterations/VER-0001/
|
|
2
|
+
1,VER-0001,,CAND-0001,<git-sha>,version-ready/VER-0001/r1,.workflow/iterations/VER-0001/06-version-closeout/version-manifest.yaml,<sha256>,dependency-closure
|
|
@@ -32,8 +32,8 @@ When inspection returns `workflow-ready`, there are no task shards, and the form
|
|
|
32
32
|
|
|
33
33
|
1. Run `node .workflow/tools/bootstrap/bootstrap.mjs bootstrap` to create the observed bootstrap context.
|
|
34
34
|
2. Start development scope `INIT-0001` through the formal state CLI.
|
|
35
|
-
3. Register `TASK-INIT-0001-00` for `00-bootstrap` and `TASK-INIT-0001-01` for `01-product-
|
|
36
|
-
4. Finish the bootstrap task only after its report and handoff evidence are registered, then activate the
|
|
35
|
+
3. Register `TASK-INIT-0001-00` for `00-bootstrap` and `TASK-INIT-0001-01` for `01-product-shaping`, with the latter depending on the former.
|
|
36
|
+
4. Finish the bootstrap task only after its report and handoff evidence are registered, then activate the Product Shaping task.
|
|
37
37
|
5. Let `task-state.mjs` resolve `code_branch` and `code_commit` from the authoritative `.workflow/config/workspace.yaml`; never use the install manifest copy or record the workflow Git identity as code identity.
|
|
38
38
|
|
|
39
39
|
The first product question is the safe stopping point. Do not invent the initial business need and do not leave product artifacts outside an initialized task.
|
|
@@ -44,13 +44,13 @@ The first product question is the safe stopping point. Do not invent the initial
|
|
|
44
44
|
- `codebase-uninitialized`: use packaged `ai-delivery bootstrap`, review the repository baseline, inventory, context index, and adoption assessment, then invoke `$ai-delivery-define-product` to distinguish observed behavior from intended product behavior.
|
|
45
45
|
- `workflow-interrupted`: do not write bootstrap artifacts. If `runtime.next_action_owner` is `user`, return the recorded `next_action` as the single business question and perform no recovery, activation, checkpoint, task, artifact, or Git mutation. If it is `external`, report the recorded wait condition without mutation. Only an `agent`-owned next action may invoke `$ai-delivery-checkpoint-task recover`, reconcile reality, inspect the pending Evolution queue without applying changes mid-task, and continue `recommended_task_id`. When required input arrives, transfer ownership with both `--next-action-owner agent` and a new idempotent `--next-action`.
|
|
46
46
|
- `workflow-ready`: when a queued task is recommended, first apply the same `next_action_owner` boundary; activate it through `$ai-delivery-checkpoint-task` only when the owner is `agent`. Otherwise use the reported specialist skill or `$ai-delivery-orchestrate` to derive the next development node. Treat `release-ready` versions as completed development evidence, not implicit release intent. Route to `$ai-delivery-orchestrate-release` only when the user explicitly requests a release.
|
|
47
|
-
- `workflow-inconsistent`: stop automatic mutation, run the available project/package doctor internally, report exact conflicts, and obtain a repair decision.
|
|
47
|
+
- `workflow-inconsistent`: stop automatic mutation, run the available project/package doctor internally, report exact conflicts, and obtain a repair decision. An installed project must use packaged `upgrade --dry-run` for managed installation drift and `migrate --dry-run` for legacy schema, task grouping, anchor, or archive conflicts rather than repeat `init`. Structural migration copies legacy-root workflow material, adds explicit task attempts, and preserves lifecycle and scope facts; grouping ambiguities require a source-checksum-bound `--decisions` document with a `human:` actor and rationale. Route an approved premature-archive correction through packaged `repair --invalidate-archive` with a human actor, reason, RCA evidence, and recovery evidence; the original archive remains immutable. Use `upgrade --force` only when the user explicitly approves replacing the reported managed files.
|
|
48
48
|
|
|
49
49
|
## Brownfield Rules
|
|
50
50
|
|
|
51
51
|
Treat repository scans as observations, not approved product or architecture truth. Keep generated artifacts `draft`. Exclude secrets, dependency/build directories, workflow internals, and files outside the project. Verify inferred commands before recording them as supported.
|
|
52
52
|
|
|
53
|
-
Do not replace existing product, architecture, test, or release baselines.
|
|
53
|
+
Do not replace existing product, architecture, test, or release baselines. Keep the project-state report and related observations outside the formal artifact registry while they remain working drafts, preserve every timestamped bootstrap run, and update only the `.workflow/delivery/bootstrap/latest.yaml` pointer.
|
|
54
54
|
|
|
55
55
|
## Resume Boundary
|
|
56
56
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Bootstrap AI Delivery"
|
|
3
|
-
short_description: "Inspect project state and route the next workflow action"
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Bootstrap AI Delivery"
|
|
3
|
+
short_description: "Inspect project state and route the next workflow action"
|
|
4
4
|
default_prompt: "Use $ai-delivery-bootstrap to inspect the dual-repository workspace, recover shared checkpoints, or initialize the minimum delivery context."
|
|
@@ -28,6 +28,8 @@ After installation, `node .workflow/tools/bootstrap/bootstrap.mjs inspect` is th
|
|
|
28
28
|
|
|
29
29
|
`ai-delivery bootstrap <project-root>` may initialize only `empty-uninitialized` and `codebase-uninitialized` projects through the project-scoped installer. Preserve existing code and configuration. On partial or conflicting installation, return `workflow-inconsistent` without writes. `--force` is allowed only after explicit user approval.
|
|
30
30
|
|
|
31
|
+
For an installed legacy or conflicting state, keep Bootstrap read-only. Use packaged `migrate --dry-run` to report schema conversion, semantic task groups and ambiguities, state/archive conflicts, verified anchors, and exact file changes. A legacy root migration copies `delivery/`, `control/`, and `standards/` into `.workflow/` while preserving source bytes; flat task shards gain explicit attempts with checksummed rollback backups. Resolve grouping ambiguities only through a checksum-bound `--decisions` document with a `human:` actor and rationale. Migration must not activate or close tasks, infer completion, change scope, or rewrite legacy events. Incorrect archives require the separate packaged `repair --invalidate-archive` forward transaction with an explicit human actor, reason, RCA evidence, and recovery evidence; the original archive bytes remain authoritative history.
|
|
32
|
+
|
|
31
33
|
For an uninitialized project, generate repository inventory and context artifacts from the first read-only scan snapshot. Do not let installer-generated `AGENTS.md`, `.gitignore`, Hook, skill, standard, or delivery files contaminate the observed pre-install codebase baseline.
|
|
32
34
|
|
|
33
35
|
When an active or dependency-ready runtime task exists, defer to its task contract and write no bootstrap artifacts. An `agent`-owned next action routes to checkpoint recovery. A `user`-owned next action returns the recorded question verbatim and forbids all task, checkpoint, artifact, formal-state, and Git mutation until the user answers. An `external`-owned next action reports the wait condition and also forbids mutation. Read-only inspection must return `mutation_allowed: false` for the latter two cases.
|
|
@@ -46,7 +48,7 @@ For a newly initialized project or a ready project without a recoverable task, c
|
|
|
46
48
|
bootstrap-plan.yaml
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
Keep every generated artifact `draft` and do not register it in the formal artifact registry. `project-state-report.yaml` remains discoverable through the checksummed `.workflow/delivery/bootstrap/latest.yaml` pointer until a later workflow node creates an immutable semantic revision. Bootstrap code must not parse or rewrite the registry itself.
|
|
50
52
|
|
|
51
53
|
## Artifact Meaning
|
|
52
54
|
|
|
@@ -61,7 +63,7 @@ Register `project-state-report.yaml` through `.workflow/tools/state/state.mjs ar
|
|
|
61
63
|
|
|
62
64
|
Natural-language startup is the public user interface. The AI must translate “开始”, “继续”, “下一步”, status questions, product ideas, and release intent into internal Skill and CLI calls; it must never delegate workflow command selection or execution to the user.
|
|
63
65
|
|
|
64
|
-
For a ready installation with no formal delivery artifact and no task shard, initialize the deterministic `INIT-0001`
|
|
66
|
+
For a ready installation with no formal delivery artifact and no task shard, initialize the deterministic `INIT-0001` Bootstrap/Product Shaping task pair before writing product material. This is runtime state, unlike the draft tasks in `bootstrap-plan.yaml`. Resolve every shared task's code identity from the nested repository configured by `.workflow/config/workspace.yaml`, never from the install manifest or workflow repository.
|
|
65
67
|
|
|
66
68
|
For an empty project, hand off to `$ai-delivery-define-product` and ask for the problem to solve, target users, and success measure one decision at a time.
|
|
67
69
|
|
|
@@ -11,6 +11,10 @@ Treat explicit task snapshots as authoritative. Treat Hook events as an audit tr
|
|
|
11
11
|
|
|
12
12
|
Write portable task state to `.workflow/control/tasks/<task-id>.yaml` and `.workflow/control/checkpoints/<task-id>/<checkpoint-id>.yaml`. Keep only PID, heartbeat, temporary locks, raw Hook events, and unshared context under ignored `.workflow/delivery/runtime/`. Keep durable node documents under `.workflow/iterations/<iteration-id>/<node-id>/`; runtime snapshots never replace registered delivery artifacts. Resolve code branch and commit from `.workflow/config/workspace.yaml` and the nested code repository.
|
|
13
13
|
|
|
14
|
+
## Legacy Node Boundary
|
|
15
|
+
|
|
16
|
+
Legacy development nodes are read-only compatibility. `inspect` remains a strictly read-only diagnosis path for historical tasks. `init`, `activate`, `checkpoint`, `finish`, and `archive-version` reject legacy task targets before mutation or Hook dispatch; `recover` refuses to materialize them and `publish` refuses to share them. New tasks use only the `development-seven-node` route, while `R00-release-request` through `R10-release-archive` remain writable.
|
|
17
|
+
|
|
14
18
|
## Start Or Resume
|
|
15
19
|
|
|
16
20
|
1. Locate the project root and shared state root.
|
|
@@ -25,6 +29,16 @@ Write portable task state to `.workflow/control/tasks/<task-id>.yaml` and `.work
|
|
|
25
29
|
|
|
26
30
|
Use statuses `queued`, `preparing`, `running`, `checkpointed`, `pending-review`, `blocked`, `interrupted`, `completed`, `failed`, and `abandoned`.
|
|
27
31
|
|
|
32
|
+
## Stable Logical Tasks And Attempts
|
|
33
|
+
|
|
34
|
+
Keep one stable logical task identity while iteration, node, skill, goal, scope, responsibility, dependencies, and acceptance remain unchanged. Register those fields with `init`, including repeatable `--scope` and `--acceptance` values plus `--responsibility`; every new task is initialized as `queued`, and any other requested status is rejected. Repeating the same `init` is zero-write and idempotent; attempting to register the same logical contract under another task ID is rejected. If any logical contract field changes, create a new task ID and link it with `--derived-from <task-id>` or `--supersedes <task-id>`; never encode planning, review, triage, repair, test, or version rounds in a new task-name suffix.
|
|
35
|
+
|
|
36
|
+
A queued task has no attempt and cannot be checkpointed or finished; `activate --phase <phase>` creates attempt `A1`. Phase status is derived from the task transition, and `--phase-status` is not supported. Record planning, implementation, review, triage, repair, test, verification, and handoff as structured phases. Entering a review phase captures its immutable `review_subject_baseline`; later approval fails if Git changed during feedback collection. Record a review or test finding with `--finding-json <json>`; finding records are append-only, and the latest record with the same ID is its current task-level conclusion. Close feedback collection in the review phase with `--change-set-json <json>` containing `change_set_id`, `approval_actor`, `rationale`, exact `finding_ids`, repository-relative `allowed_files`, `expected_evidence`, `review_axes`, and `collection_decision`. The CLI promotes the pinned subject to `repair_baseline`, persists the canonical `feedback_collection`, and computes its SHA-256 `collection_checksum`; a caller-supplied checksum is optional and must match. A `resolved` record must reference an existing open finding and recorded approved change set, be written during concentrated rereview in the review phase, carry the expected evidence, and declare `changed_files` exactly equal to the real Git changes since approval and within the allowed files. `completed` is refused while any current blocking finding is still `open`. Optionally attribute elapsed time with paired `--time-category <category> --elapsed-minutes <minutes>`. A failed attempt cannot satisfy dependencies. Retry the unchanged task only with `activate --new-attempt --phase repair`; this creates the next attempt under the same task ID. A later task becomes dependency-ready only after the logical task itself reaches `completed`.
|
|
37
|
+
|
|
38
|
+
During review, finish feedback collection across the pinned subject before any repair begins. Group every current open finding into one immutable approved `--change-set-json` record; the executor applies only that set in a repair phase and records its evidence before concentrated rereview. Never interleave code changes with feedback collection or add an unapproved finding or file to the active set.
|
|
39
|
+
|
|
40
|
+
Run `scripts/task-state.mjs inspect --task-id <task-id> --include-closed` for strict read-only diagnosis. It returns source reconciliation, dependency state, attempt totals, current phase, and time by category without hydrating runtime, writing a resume, checkpointing, or changing Git state.
|
|
41
|
+
|
|
28
42
|
## Checkpoint
|
|
29
43
|
|
|
30
44
|
Checkpoint after every externally meaningful milestone, before a long command, after test or review evidence, before context compaction, and before returning control. Keep `next_action` concrete and idempotent and set `next_action_owner` to `agent`, `user`, or `external`. Store decisions in their owning product, architecture, design, standard, or release artifact rather than in runtime notes alone. Repeated evidence references are idempotent and must remain unique.
|
|
@@ -33,7 +47,7 @@ Checkpoint after every externally meaningful milestone, before a long command, a
|
|
|
33
47
|
|
|
34
48
|
1. Validate expected outputs and update the artifact registry through `.workflow/tools/state/state.mjs`.
|
|
35
49
|
2. Record evidence, actual outputs, residual blockers, and the next workflow action.
|
|
36
|
-
3. Atomically set `completed`, `blocked`, `failed`, `interrupted`, or explicitly `abandoned`.
|
|
50
|
+
3. Atomically set `completed`, `blocked`, `failed`, `interrupted`, or explicitly `abandoned`. Closed statuses `completed`, `failed`, and `abandoned` may be written only by `finish`, never `checkpoint`. Treat them as closed for historical counts and archival eligibility. Default recovery omits `completed` and `abandoned`, but returns `failed` as retryable work until a new attempt completes or the version is abandoned.
|
|
37
51
|
4. After the task snapshot succeeds, update formal workflow state only through `.workflow/tools/state/state.mjs`, then run its `verify` command.
|
|
38
52
|
5. Invoke `$ai-delivery-evolve-workflow evaluate --safe-point task` after the task and formal-state writes are complete. Apply any newly eligible extension only to the next task; do not change the task that just finished.
|
|
39
53
|
6. Never mark production deployment complete from a Hook event.
|
|
@@ -43,14 +57,14 @@ Checkpoint after every externally meaningful milestone, before a long command, a
|
|
|
43
57
|
1. Use the iteration version as the archive unit; never archive one completed task independently.
|
|
44
58
|
2. Require version status `release-ready`, `released`, or `abandoned` and at least one completion evidence reference. Require `candidate_id` for `release-ready`; require `release_id` for `released`.
|
|
45
59
|
3. Refuse archival while any version task is queued, preparing, running, checkpointed, pending review, blocked, or interrupted.
|
|
46
|
-
4.
|
|
60
|
+
4. Before writing any archive file, require `state.mjs snapshot references` to project the target version from the latest trusted version-boundary anchor. Fail closed unless it returns the scope manifest, selected candidate, Gate decisions, and history anchor. Then write the portable archive manifest, task snapshots, and shared checkpoints under `.workflow/control/archives/versions/<version-id>/`. The manifest references checksummed task summary files and the complete referenced attempt values within that archive, plus every formal projection by relative path and checksum rather than copying their bodies. Retain detailed local event, heartbeat, and recovery copies under ignored runtime by default; use `--portable-only` to omit that disposable, non-authoritative copy.
|
|
47
61
|
5. Only after the portable archive is complete, remove the version's shards from `.workflow/control/tasks/` and `.workflow/control/checkpoints/` and remove local active records. Normal recovery scans active collections only and must not load archived details, even with `--include-closed`.
|
|
48
62
|
|
|
49
63
|
## Recover
|
|
50
64
|
|
|
51
65
|
Use shared shards and the newest shared checkpoint as the portable recovery source. If local runtime is absent and `next_action_owner` is `agent`, `recover` restores it from shared state. For `user` or `external`, report the wait state without hydration; after the input arrives, `activate` performs the atomic hydration and owner transfer. If local and shared revisions or semantic checksums differ, stop for reconciliation. Inspect both Git repositories before resuming. Report pending `.workflow/delivery/runtime/evolution/pending/` events, but defer their evaluation until the recovered task reaches a safe point.
|
|
52
66
|
|
|
53
|
-
Generate a compact recovery report from snapshots, checkpoints, Hook events, Git, and workspace state. Return
|
|
67
|
+
Generate a compact recovery report from snapshots, checkpoints, Hook events, Git, and workspace state. Return active work and failed tasks in `retryable_task_ids` by default; use `--include-closed` only when completed or abandoned details are required for an explicit audit. For each iteration, report total, completed, closed, remaining, active, retryable, queued, dependency-ready, and waiting tasks plus one deterministic `recommended_task_id`. Prefer an interrupted or active task, then the lowest-sequence failed task requiring `activate --new-attempt --phase repair`, then the lowest-sequence queued task whose dependencies are all `completed`. Resume only idempotent steps. Re-read production and external systems before any deployment recovery; never replay production deployment automatically.
|
|
54
68
|
|
|
55
69
|
## Hook Boundary
|
|
56
70
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Checkpoint Delivery Task"
|
|
3
|
-
short_description: "Persist task checkpoints, hook events, and resume context"
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Checkpoint Delivery Task"
|
|
3
|
+
short_description: "Persist task checkpoints, hook events, and resume context"
|
|
4
4
|
default_prompt: "Use $ai-delivery-checkpoint-task to start, checkpoint, publish, finish, or recover a shared delivery task."
|
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
"status": "queued",
|
|
7
7
|
"sequence": 1,
|
|
8
8
|
"depends_on": [],
|
|
9
|
-
"attempt":
|
|
9
|
+
"attempt": 0,
|
|
10
|
+
"attempts": [],
|
|
11
|
+
"change_sets": [],
|
|
10
12
|
"goal": "",
|
|
13
|
+
"responsibility": "",
|
|
11
14
|
"scope": [],
|
|
15
|
+
"acceptance": [],
|
|
16
|
+
"derived_from": null,
|
|
17
|
+
"supersedes": null,
|
|
12
18
|
"input_artifacts": [],
|
|
13
19
|
"standards": [],
|
|
14
20
|
"branch": null,
|
|
@@ -34,6 +34,8 @@ Keep `.workflow/delivery/runtime/` local and ignored. Persist durable stage outp
|
|
|
34
34
|
|
|
35
35
|
`task-state.mjs` is the only runtime-state writer. Do not directly edit task JSON, checkpoint JSON, active-task markers, recovery output, or archive indexes. Formal workflow and artifact state belong to `.workflow/tools/state/state.mjs`; do not edit its YAML or JSONL streams directly.
|
|
36
36
|
|
|
37
|
+
Legacy development nodes are read-only compatibility. `inspect` remains read-only for historical task diagnosis. `init`, `activate`, `checkpoint`, `finish`, and `archive-version` reject legacy task targets before mutation or Hook dispatch; `recover` does not hydrate them and `publish` does not share them. New task contracts use only the `development-seven-node` route, while `R00-release-request` through `R10-release-archive` remain writable.
|
|
38
|
+
|
|
37
39
|
When the installed Evolution CLI exists, `init`, `activate`, `checkpoint`, `finish`, and `archive-version` emit idempotent schema 1 `task.before`, `task.after`, and `task.failed` events. An approved blocking `task.before` result stops the task command before mutation. Hook dispatch failures otherwise fail open as warnings and never replace checkpoint state as the completion authority.
|
|
38
40
|
|
|
39
41
|
## Commands
|
|
@@ -41,12 +43,16 @@ When the installed Evolution CLI exists, `init`, `activate`, `checkpoint`, `fini
|
|
|
41
43
|
Resolve `scripts/task-state.mjs` relative to this skill directory when invoking the bundled script.
|
|
42
44
|
|
|
43
45
|
```text
|
|
44
|
-
node scripts/task-state.mjs init --task-id TASK-0001 --iteration-id ITER-0001 --node development --skill ai-delivery-develop-iteration --goal "Implement slice" --next-action "Derive work packages" --next-action-owner agent
|
|
46
|
+
node scripts/task-state.mjs init --task-id TASK-0001 --iteration-id ITER-0001 --node development --skill ai-delivery-develop-iteration --goal "Implement slice" --responsibility delivery-agent --scope SLICE-001 --acceptance AC-001 --next-action "Derive work packages" --next-action-owner agent
|
|
45
47
|
node scripts/task-state.mjs init --task-id TASK-0002 --iteration-id ITER-0001 --node test --skill ai-delivery-verify-candidate --goal "Verify candidate" --status queued --sequence 2 --depends-on TASK-0001 --next-action "Run candidate verification"
|
|
46
48
|
node scripts/task-state.mjs recover --iteration-id ITER-0001
|
|
47
|
-
node scripts/task-state.mjs
|
|
48
|
-
node scripts/task-state.mjs
|
|
49
|
-
node scripts/task-state.mjs
|
|
49
|
+
node scripts/task-state.mjs inspect --task-id TASK-0001 --include-closed
|
|
50
|
+
node scripts/task-state.mjs activate --task-id TASK-0002 --phase implementation
|
|
51
|
+
node scripts/task-state.mjs checkpoint --task-id TASK-0001 --status pending-review --phase review --completed-step "Public contract validated" --next-action "Collect review findings"
|
|
52
|
+
node scripts/task-state.mjs finish --task-id TASK-0001 --status failed --phase review --finding-json '{"finding_id":"FIND-001","severity":"blocking","status":"open","summary":"Acceptance branch is missing","evidence":["review@1"]}' --change-set-json '{"change_set_id":"CHANGESET-001","approval_actor":"product-owner@example.invalid","rationale":"Repair the complete review batch","finding_ids":["FIND-001"],"allowed_files":["src/acceptance.mjs"],"expected_evidence":["test-report@2"],"review_axes":["standards","spec"],"collection_decision":"fail"}' --time-category review --elapsed-minutes 12 --next-action "Apply one repair set"
|
|
53
|
+
node scripts/task-state.mjs activate --task-id TASK-0001 --new-attempt --phase repair --next-action "Apply one repair set"
|
|
54
|
+
node scripts/task-state.mjs finish --task-id TASK-0001 --status completed --phase review --finding-json '{"finding_id":"FIND-001","severity":"blocking","status":"resolved","summary":"Acceptance branch is covered","evidence":["test-report@2"],"changed_files":["src/acceptance.mjs"],"change_set_id":"CHANGESET-001"}' --next-action "Run candidate verification"
|
|
55
|
+
node scripts/task-state.mjs init --task-id TASK-0001-V2 --iteration-id ITER-0001 --node development --skill ai-delivery-develop-iteration --goal "Implement expanded slice" --scope SLICE-002 --acceptance AC-002 --derived-from TASK-0001 --status queued --next-action "Await scope approval"
|
|
50
56
|
node scripts/task-state.mjs finish --task-id TASK-0001 --status interrupted --next-action "Which user group is affected first?" --next-action-owner user
|
|
51
57
|
node scripts/task-state.mjs recover --mark-interrupted --stale-minutes 15
|
|
52
58
|
node scripts/task-state.mjs recover --include-closed
|
|
@@ -59,6 +65,12 @@ node scripts/task-state.mjs publish --task-id TASK-0001 --push
|
|
|
59
65
|
|
|
60
66
|
Every state transition writes both the local runtime snapshot and the portable task shard/checkpoint. `publish` refuses unrelated dirty paths, commits only the selected task scope, and does not push unless `--push` is explicit. When local runtime is missing, `recover` reconstructs an `agent`-owned task from shared shards; `user` and `external` wait states remain read-only until an explicit `activate` transfer. A revision or semantic-checksum mismatch is a hard conflict, not a last-writer-wins update.
|
|
61
67
|
|
|
68
|
+
`task-state.mjs inspect` is strictly read-only. It never hydrates shared state into runtime, writes a resume or checkpoint, changes timestamps, creates a lock, or changes Git state. Use it for task-level diagnosis; use `recover` only when an agent-owned task must actually be hydrated and resumed.
|
|
69
|
+
|
|
70
|
+
The stable logical task contract consists of iteration, node/responsibility, skill, goal, scope, dependencies, and acceptance. `init` always creates queued work and rejects every other requested status; activation is the only path that starts A1 and checks dependencies. Completed, failed, and abandoned require an activated attempt and `finish`. Repeating `init` with the same contract and task ID is idempotent and zero-write. Registering the same contract under another task ID, or changing any contract field under the same task ID, fails closed. Create a new task and declare `--derived-from` or `--supersedes` only when that contract materially changes.
|
|
71
|
+
|
|
72
|
+
Queued tasks have `attempt: 0` and an empty `attempts` collection, and `checkpoint` or `finish` refuses them until activation. Activation creates `TASK-ID/A1`; ordinary blocked or interrupted recovery continues that attempt. Phase status is always derived from the task transition; `--phase-status` is rejected. A failed task cannot satisfy dependencies and cannot be reactivated implicitly. `activate --new-attempt --phase <phase>` explicitly creates the next attempt under the same task identity. Each attempt contains ordered phases, structured findings, and optional time entries categorized as implementation, test, review, workflow, user wait, external wait, or rework. Entering review captures `review_subject_baseline`; approval fails unless the current Git subject still matches it. Findings use stable IDs plus severity, status, summary, evidence, changed files, and an optional stable `change_set_id`; every record is append-only and the latest record for one ID is its current conclusion. `--change-set-json` is accepted only in review and must name every current open finding plus review axes and the collection decision. The CLI promotes the pinned subject to `repair_baseline`, persists the canonical `feedback_collection`, computes its `collection_checksum`, and stores the immutable approval actor, rationale, exact finding IDs, allowed files, and expected evidence. During concentrated rereview, a resolved record must refer to an existing open finding in that approved set, include the expected evidence, and declare exactly the real Git changes since approval; the CLI rejects undeclared changes and files outside the approval. A task cannot become `completed` while any current blocking finding remains `open`. Failed and abandoned tasks cannot satisfy dependencies; only `completed` can.
|
|
73
|
+
|
|
62
74
|
For an installed dual-repository project, `task-state.mjs` resolves `code_branch` and `code_commit` from the authoritative `.workflow/config/workspace.yaml` and its configured nested code Git root. The install manifest and task worktree are not workspace identity fallbacks. The task's workflow worktree or workflow branch must never be persisted as code identity. If the workspace configuration is missing, its code path is not a direct child, or the configured code root is not an independent Git repository, the mutation fails instead of recording a fallback identity.
|
|
63
75
|
|
|
64
76
|
`blockers` represents current unresolved blockers. A `blocked` update replaces that list; any transition to another status clears it. Historical blocker text remains available in prior checkpoints and events.
|
|
@@ -67,11 +79,13 @@ For an installed dual-repository project, `task-state.mjs` resolves `code_branch
|
|
|
67
79
|
|
|
68
80
|
Pass `--state-root` when worktrees must write to one shared primary state directory. Pass `--worktree` during init so the script writes a local `.workflow/delivery/runtime/active-task.json` marker pointing to that state root. Later `checkpoint`, `finish`, and `recover` commands automatically use the marker's shared state root.
|
|
69
81
|
|
|
70
|
-
Use `finish` only with `completed`, `blocked`, `interrupted`, `failed`, or `abandoned`.
|
|
82
|
+
Use `finish` only with `completed`, `blocked`, `interrupted`, `failed`, or `abandoned`. Closed statuses `completed`, `failed`, and `abandoned` are rejected by `checkpoint`; use `checkpoint` only for continuing or paused work.
|
|
71
83
|
|
|
72
84
|
Register all known iteration tasks as `queued` before execution. `queued` registration does not write `.workflow/delivery/runtime/active-task.json`, so several future tasks may share a worktree safely. `activate` verifies that every `depends_on` task exists and is `completed`, changes the selected task to `running` or `preparing`, writes a new checkpoint, and creates the active task marker for Hook correlation.
|
|
73
85
|
|
|
74
|
-
`finish` closes an individual task but does not archive it.
|
|
86
|
+
`finish` closes an individual task but does not archive it. Closed counts include completed, failed, and abandoned tasks, but default recovery returns failed tasks as retryable work and omits only completed and abandoned details. Archive the entire planned version after version closeout marks it `release-ready`, after historical production verification marks it `released`, or when explicitly `abandoned`. A release-ready archive requires the immutable candidate ID and verification evidence; a released archive requires release ID and production evidence. Every task in that version must be closed. Before the first archive write, `archive-version` calls the installed formal-state CLI's `snapshot references` command and fails closed unless the latest trusted anchor contains the target scope manifest and candidate. The version manifest references checksummed archived task summaries and each attempt receipt (whose checksum covers the complete attempt value addressed by its reference), plus the anchored scope manifest, candidate, Gate decisions, and history anchor; it does not duplicate those formal records inline. Archival first writes the portable version package, then removes that version from active shared task/checkpoint collections; `recover` never scans `.workflow/control/archives/`.
|
|
87
|
+
|
|
88
|
+
If an archived version is later proven ineligible, keep every archive byte unchanged. The packaged top-level `ai-delivery repair --invalidate-archive` command appends the only valid correction/invalidation record under `.workflow/control/repairs/transactions/`, with the archive checksum, an explicit human actor, reason, RCA evidence, and recovery evidence. Recovery continues to ignore archived task details; current eligibility projections exclude an invalidated archive through that forward transaction.
|
|
75
89
|
|
|
76
90
|
## Hook Events
|
|
77
91
|
|
|
@@ -83,9 +97,9 @@ Hooks receive lifecycle JSON on stdin. Redact secrets, cap payload size, append
|
|
|
83
97
|
|
|
84
98
|
- Reconcile recorded branch, worktree, dirty files, heartbeat, and next action.
|
|
85
99
|
- Stop without mutation when the recommended task's `next_action_owner` is `user` or `external`; only report the recorded question or wait condition.
|
|
86
|
-
- Keep closed tasks in the current version until version archival
|
|
100
|
+
- Keep closed tasks in the current version until version archival. Normal recovery excludes completed and abandoned details but includes failed tasks in `retryable_task_ids`.
|
|
87
101
|
- Determine iteration progress from all task snapshots, including the closed snapshots hidden from the normal task list.
|
|
88
|
-
- Prefer an existing active or interrupted task during recovery. If none exists, recommend the lowest-sequence queued task whose dependencies are all `completed`.
|
|
102
|
+
- Prefer an existing active or interrupted task during recovery. If none exists, recommend the lowest-sequence failed task for explicit `activate --new-attempt --phase repair`; only then recommend the lowest-sequence queued task whose dependencies are all `completed`.
|
|
89
103
|
- Never activate a task with a missing, failed, abandoned, blocked, or otherwise incomplete dependency.
|
|
90
104
|
- Use one portable version archive under `.workflow/control/archives/versions/`; runtime archive copies are disposable and non-authoritative. Pass `--portable-only` when no local detailed copy should be created.
|
|
91
105
|
- Treat a stale `running` task as a recovery candidate, not automatically failed.
|
|
@@ -53,6 +53,96 @@ async function readStdin() {
|
|
|
53
53
|
return Buffer.concat(chunks).toString("utf8");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function preToolUsePaths(input) {
|
|
57
|
+
const eventName = String(input.hook_event_name || input.hookEventName || "").toLowerCase();
|
|
58
|
+
if (eventName !== "pretooluse") return [];
|
|
59
|
+
const toolName = String(input.tool_name || input.toolName || "")
|
|
60
|
+
.toLowerCase()
|
|
61
|
+
.replace(/[^a-z0-9]/g, "");
|
|
62
|
+
const mutatingFileTools = [
|
|
63
|
+
"applypatch", "edit", "editfile", "multiedit", "write", "writefile",
|
|
64
|
+
"createfile", "deletefile", "movefile", "renamefile", "replacefile",
|
|
65
|
+
];
|
|
66
|
+
if (!mutatingFileTools.some((name) => toolName === name || toolName.endsWith(name))) return [];
|
|
67
|
+
const toolInput = input.tool_input && typeof input.tool_input === "object"
|
|
68
|
+
? input.tool_input
|
|
69
|
+
: {};
|
|
70
|
+
const candidates = [];
|
|
71
|
+
for (const field of ["file_path", "path", "target_file"]) {
|
|
72
|
+
if (typeof toolInput[field] === "string") candidates.push(toolInput[field]);
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(toolInput.edits)) {
|
|
75
|
+
for (const edit of toolInput.edits) {
|
|
76
|
+
if (!edit || typeof edit !== "object") continue;
|
|
77
|
+
for (const field of ["file_path", "path", "target_file"]) {
|
|
78
|
+
if (typeof edit[field] === "string") candidates.push(edit[field]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const field of ["patch", "input"]) {
|
|
83
|
+
if (typeof toolInput[field] !== "string") continue;
|
|
84
|
+
for (const line of toolInput[field].split(/\r?\n/)) {
|
|
85
|
+
const match = line.match(/^\*\*\* (?:Add|Update|Delete) File: (.+)$/)
|
|
86
|
+
|| line.match(/^\*\*\* Move to: (.+)$/);
|
|
87
|
+
if (match) candidates.push(match[1]);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [...new Set(candidates.map((item) => item.trim()).filter(Boolean))];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function owningGitRoot(file) {
|
|
94
|
+
let current = fs.existsSync(file) && fs.statSync(file).isDirectory() ? file : path.dirname(file);
|
|
95
|
+
while (!fs.existsSync(current)) {
|
|
96
|
+
const parent = path.dirname(current);
|
|
97
|
+
if (parent === current) return null;
|
|
98
|
+
current = parent;
|
|
99
|
+
}
|
|
100
|
+
const result = spawnSync("git", ["-C", current, "rev-parse", "--show-toplevel"], {
|
|
101
|
+
encoding: "utf8",
|
|
102
|
+
timeout: 5_000,
|
|
103
|
+
windowsHide: true,
|
|
104
|
+
});
|
|
105
|
+
return result.status === 0 ? path.resolve(result.stdout.trim()) : null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function samePath(left, right) {
|
|
109
|
+
const normalize = (value) => process.platform === "win32"
|
|
110
|
+
? path.resolve(value).toLowerCase()
|
|
111
|
+
: path.resolve(value);
|
|
112
|
+
return normalize(left) === normalize(right);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function enforceFrontendGuard(projectRoot, input) {
|
|
116
|
+
const changedPaths = preToolUsePaths(input);
|
|
117
|
+
if (!changedPaths.length) return;
|
|
118
|
+
const guardCli = path.join(projectRoot, ".workflow", "tools", "frontend-guard", "frontend-guard.mjs");
|
|
119
|
+
if (!fs.existsSync(guardCli)) {
|
|
120
|
+
throw new Error(`Frontend guard runtime is missing: ${guardCli}`);
|
|
121
|
+
}
|
|
122
|
+
for (const changedPath of changedPaths) {
|
|
123
|
+
const resolvedChangedPath = path.isAbsolute(changedPath)
|
|
124
|
+
? changedPath
|
|
125
|
+
: path.resolve(process.cwd(), changedPath);
|
|
126
|
+
const gitRoot = owningGitRoot(resolvedChangedPath);
|
|
127
|
+
if (gitRoot && samePath(gitRoot, projectRoot)) continue;
|
|
128
|
+
const guarded = spawnSync(process.execPath, [
|
|
129
|
+
guardCli, "check-file", projectRoot, "--path", resolvedChangedPath,
|
|
130
|
+
], {
|
|
131
|
+
cwd: projectRoot,
|
|
132
|
+
encoding: "utf8",
|
|
133
|
+
timeout: 15_000,
|
|
134
|
+
windowsHide: true,
|
|
135
|
+
});
|
|
136
|
+
if (guarded.error || guarded.status !== 0) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
guarded.error?.message
|
|
139
|
+
|| guarded.stderr.trim()
|
|
140
|
+
|| `Frontend guard rejected ${resolvedChangedPath}.`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
56
146
|
try {
|
|
57
147
|
const currentProjectFile = findUp(process.cwd(), path.join(".workflow", "delivery", "project.yaml"));
|
|
58
148
|
const legacyProjectFile = currentProjectFile
|
|
@@ -67,6 +157,7 @@ try {
|
|
|
67
157
|
const marker = fs.existsSync(markerFile) ? JSON.parse(fs.readFileSync(markerFile, "utf8")) : null;
|
|
68
158
|
const raw = await readStdin();
|
|
69
159
|
const input = raw.trim() ? JSON.parse(raw) : {};
|
|
160
|
+
enforceFrontendGuard(projectRoot, input);
|
|
70
161
|
const taskId = safeId(process.env.AI_DELIVERY_TASK_ID || marker?.task_id || input.turn_id || input.session_id);
|
|
71
162
|
const stateRoot = path.resolve(process.env.AI_DELIVERY_STATE_ROOT || marker?.state_root || projectRoot);
|
|
72
163
|
const workflowRoot = fs.existsSync(path.join(stateRoot, ".workflow", "delivery", "project.yaml"))
|