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/README.md
CHANGED
|
@@ -6,18 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
一套只安装到当前项目的 AI 全流程研发 Skills、Hook、产物契约和 checkpoint 机制。研发版本可以持续递进并归档为 `release-ready`;生产发布由用户独立触发并选择累计截止版本。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
体验设计采用生产兼容的可运行原型:先确认视觉系统和 UI 框架(`UX-VS`),再交付覆盖完整交互与状态的正式 UI 原型(`UX-UI`)。每次调整立即记录;全部候选确认后统一与产品需求双向核对。下游只消费 `ui-handoff.yaml` 和结构化 `experience_change_id`,不从截图或视觉差异猜测新增、修改与停用内容。
|
|
10
10
|
|
|
11
11
|
## 文档
|
|
12
12
|
|
|
13
13
|
- [维护仓库 AI 边界](AGENTS.md)
|
|
14
14
|
- [完整中文项目手册](docs/PROJECT-MANUAL.zh-CN.md)
|
|
15
|
+
- [CLI 安装参数参考](docs/CLI-PARAMETER-REFERENCE.zh-CN.md)
|
|
16
|
+
- [CodeGraph 可选集成指南](docs/CODEGRAPH-INTEGRATION.zh-CN.md)
|
|
17
|
+
- [Microcks Mock System 使用指南](docs/MOCK-SYSTEM.zh-CN.md)
|
|
15
18
|
- [双仓工作区使用与维护说明](docs/DUAL-REPOSITORY-WORKSPACE.zh-CN.md)
|
|
16
19
|
- [逐文件参考](docs/FILE-REFERENCE.zh-CN.md)
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
20
|
+
- [工作流管理器使用指南](docs/VIEWER-USER-GUIDE.zh-CN.md)
|
|
21
|
+
- [工作流管理器维护指南](docs/VIEWER-MAINTENANCE.zh-CN.md)
|
|
19
22
|
- [正式状态 CLI 使用指南](docs/STATE-CLI-USER-GUIDE.zh-CN.md)
|
|
20
23
|
- [正式状态 CLI 维护指南](docs/STATE-CLI-MAINTENANCE.zh-CN.md)
|
|
24
|
+
- [npm 版本与发布管理规范](docs/NPM-RELEASE-MANAGEMENT.zh-CN.md)
|
|
25
|
+
- [维护仓库验证工具:发布预检、成本基准与可信平台证明](docs/MAINTENANCE-VERIFICATION.zh-CN.md)
|
|
21
26
|
- [审计物料:历史 V1、当前契约 V2 与五版本发布列车示例](audit/README.md)
|
|
22
27
|
- [审计物料逐文件用途](audit/FILE-GUIDE.zh-CN.md)
|
|
23
28
|
- [永久验证源码说明](verification/README.zh-CN.md)
|
|
@@ -31,6 +36,27 @@ npx ai-delivery-workflow@latest init <workspace> --code-path code --code-id app
|
|
|
31
36
|
npx ai-delivery-workflow@latest doctor <workspace>
|
|
32
37
|
```
|
|
33
38
|
|
|
39
|
+
已由用户安装 CodeGraph CLI 时,可显式为配置中的代码仓初始化或同步本地索引:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx ai-delivery-workflow@latest codegraph setup <workspace>
|
|
43
|
+
npx ai-delivery-workflow@latest codegraph sync <workspace>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
该能力是可降级的代码导航适配器,不进入正式状态或 Gate,也不会安装全局 MCP。完整边界见 [CodeGraph 可选集成指南](docs/CODEGRAPH-INTEGRATION.zh-CN.md)。
|
|
47
|
+
|
|
48
|
+
需要为 Prototype 模拟第三方协议时,显式初始化并启动项目级 Microcks,再从 tracked External Dependency Mock catalog 同步合同:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx ai-delivery-workflow@latest mock setup <workspace>
|
|
52
|
+
npx ai-delivery-workflow@latest mock start <workspace>
|
|
53
|
+
npx ai-delivery-workflow@latest mock sync <workspace>
|
|
54
|
+
npx ai-delivery-workflow@latest mock freeze <workspace> --experience .workflow/experience \
|
|
55
|
+
--scenario-pack mock-scenario-pack-request.yaml --dry-run
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
系统只绑定 loopback,运行数据库与流量可丢弃,不自动安装 Docker/Podman。External Dependency 与 Product Backend Mock 使用隔离 catalog;每个 Review Scene 经合同和脱敏校验映射到唯一 scenario,受管 UI 的实际导出定义以 checksum 绑定并通过同一协议/场景校验后,才可在人工确认 candidate checksum 后冻结、正式登记为不可变 Mock Scenario Pack。Product Backend Mock 不构成真实后端或端到端验收证据。完整契约见 [Microcks Mock System 使用指南](docs/MOCK-SYSTEM.zh-CN.md)。
|
|
59
|
+
|
|
34
60
|
安装器会把 25 个 Skills 写入 `.agents/skills/`,把项目 Hook 合并到 `.codex/config.toml`,安装本地 Hook 记录器,并创建 `.workflow/iterations/`、`.workflow/releases/` 与项目级自进化控制环。所有研发流程文档默认写入 `.workflow/`;源码、自动化测试源码、仓库配置、镜像和二进制制品保留在各自原位置。安装器会保留既有项目配置,并在受管文件冲突时停止。
|
|
35
61
|
|
|
36
62
|
安装器会在需要跨 Git clone 保留的空工作流目录中写入 `.gitkeep`,包括产品、架构、体验、迭代、发布及共享控制分片目录。删除这些占位文件会导致空目录不进入 Git,重新克隆后的 `doctor` 将判定核心结构缺失。
|
|
@@ -47,9 +73,9 @@ node .workflow/tools/state/state.mjs verify
|
|
|
47
73
|
|
|
48
74
|
日常使用无需记忆这些命令。用户在项目根目录对 AI 说“开始”“继续”“下一步”或直接描述需求即可;AI 根据项目内 `AGENTS.md` 和 Skills 自主调用 Bootstrap、Checkpoint、专业节点与发布流程,用户只负责业务回答和人工 Gate。中断任务通过 `next_action_owner` 区分 AI、用户和外部责任方;等待用户或外部输入时只读恢复,不得重复增加 attempt、revision、evidence 或 checkpoint。
|
|
49
75
|
|
|
50
|
-
正式状态 schema 2 将研发与发布拆成 `development_state` 和 `release_state`。研发使用 `iteration-started`,用户明确发起发布后使用 `release-started`;两者分别维护 scope、节点、Gate 和局部 revision
|
|
76
|
+
正式状态 schema 2 将研发与发布拆成 `development_state` 和 `release_state`。研发使用 `iteration-started`,用户明确发起发布后使用 `release-started`;两者分别维护 scope、节点、Gate 和局部 revision,可基于各自 revision 并发推进且互不重置,同一 scope 的过期 writer 会 fail-closed。workflow 与 artifact mutation 使用统一的 schema 2 增量事务和崩溃恢复 journal;带已登记 evidence 的 transition/Gate 会在同一跨 aggregate 事务中同步登记物料交接历史。状态 CLI 同时强制节点依赖、成功证据和当前节点尝试的必需 Gate。
|
|
51
77
|
|
|
52
|
-
版本归档的可携带权威位置是 `.workflow/control/archives/versions/<version-id>/`。归档成功后,对应任务和 checkpoint 会从活动集合移出,后续 `recover` 不再加载它们。`doctor` 使用发行包固定的 25 个 Skill 与受管 Hook、Bootstrap
|
|
78
|
+
版本归档的可携带权威位置是 `.workflow/control/archives/versions/<version-id>/`。归档成功后,对应任务和 checkpoint 会从活动集合移出,后续 `recover` 不再加载它们。`doctor` 使用发行包固定的 25 个 Skill 与受管 Hook、Bootstrap、状态、Evolution 和 Workflow Manager 运行时摘要进行完整性检查,并实际执行只读 `inspect/verify` 冒烟验证。
|
|
53
79
|
|
|
54
80
|
安装后的工作流通过 `$ai-delivery-evolve-workflow` 在安全点记录反馈、聚合重复信号、试运行项目级扩展并按指标自动启用或回退。扩展只存在于 `.workflow/extensions/`,不能修改受管核心、正式状态、人工 Gate 或已批准规范。完整用法见[自进化使用指南](docs/EVOLUTION-USER-GUIDE.zh-CN.md)。
|
|
55
81
|
|
|
@@ -57,14 +83,17 @@ node .workflow/tools/state/state.mjs verify
|
|
|
57
83
|
|
|
58
84
|
累计研发版本、当前生产版本和当前生产 release ID 的权威来源是 `.workflow/delivery/workflow-state.yaml` 中经审计事件写入的 `latest_line_version_id`、`production_version_id` 和 `production_release_id`。版本收尾使用 `version-closed`,发布归档使用 `release-archived`;`project.yaml` 中的同名旧字段只作兼容回退。
|
|
59
85
|
|
|
60
|
-
|
|
86
|
+
正式工作流管理入口是工作流管理器。它通过同一个应用服务向 CLI、HTTP 和 React 界面投影正式状态,节点状态只来自 `state inspect.derived_node_states`:
|
|
61
87
|
|
|
62
88
|
```powershell
|
|
63
|
-
|
|
89
|
+
npx ai-delivery-workflow@latest manager inspect .
|
|
90
|
+
npx ai-delivery-workflow@latest manager list . --resource contracts
|
|
91
|
+
.\.workflow\tools\manager\start.cmd
|
|
64
92
|
```
|
|
65
93
|
|
|
66
|
-
|
|
67
|
-
|
|
94
|
+
macOS/Linux 使用 `sh ./.workflow/tools/manager/start.sh`。也可运行 `npx ai-delivery-workflow@latest manager serve . --no-open`;服务只绑定 loopback。P01-P19 共 19 个固定 Page 均连接真实项目投影,P13 作为上下文详情页从原型审批或路由页面进入。未登记事实明确显示“尚未登记”,不会填充演示数据。AI 先从 `contracts` 资源和 `manager action <action-name> --help` 发现当前 Schema;安装后完整流程位于 `.workflow/tools/manager/AGENT-INTERFACE.md`。原型评论/截图/审核、项目系统脚本/生命周期、Mock 同步、Gate 决定、关系确认和设置修改只通过白名单动作执行,并校验 actor、revision/checksum、幂等键及所需的 plan checksum。
|
|
95
|
+
|
|
96
|
+
旧 `.workflow/tools/viewer/` 和独立 Prototype Review Server 已退役。新安装不再包含它们;旧项目升级时,Viewer 由带备份和 checksum 的 `remove` 操作登记,受保护回滚可以恢复升级前字节。
|
|
68
97
|
|
|
69
98
|
研发完成不会自动上线。用户需要发布时明确选择截止版本:
|
|
70
99
|
|
|
@@ -86,20 +115,20 @@ npx ai-delivery-workflow@latest inspect .
|
|
|
86
115
|
npx ai-delivery-workflow@latest bootstrap .
|
|
87
116
|
```
|
|
88
117
|
|
|
89
|
-
|
|
118
|
+
首次安装完成后,预览或升级受管文件:
|
|
90
119
|
|
|
91
120
|
```bash
|
|
92
|
-
npx ai-delivery-workflow@latest
|
|
93
|
-
npx ai-delivery-workflow@latest
|
|
121
|
+
npx ai-delivery-workflow@latest upgrade . --dry-run
|
|
122
|
+
npx ai-delivery-workflow@latest upgrade .
|
|
94
123
|
```
|
|
95
124
|
|
|
96
|
-
|
|
125
|
+
`init` 只允许首次安装;已有 `.workflow/config/install-manifest.json` 时必须使用 `upgrade`。升级 dry-run 输出 additions、replacements、preserved、preserved_summary、conflicts、backups 和 compatibility,且严格零写。`preserved` 中受管安装资产之外的明细最多报告 200 条,完整的总数、已报告数、省略数和排除的瞬态根见 `preserved_summary`;省略仅限制报告体积,不会删除文件。正式升级只替换安装清单声明的受管副本,保留业务物料、用户配置部分和嵌套代码仓库,并把收据和备份写入 `.workflow/delivery/runtime/upgrades/<upgrade-id>/`。在升级后尚未新增正式事务时,可执行 `upgrade . --rollback <upgrade-id>`;否则必须前向修复。初始化或升级完成后请新建 Codex 任务,使项目级 skills 和 Hook 信任状态重新加载。
|
|
97
126
|
|
|
98
127
|
旧项目如仍使用根目录 `delivery/` 和 `standards/`,需先迁移为 `.workflow/delivery/` 和 `.workflow/standards/`,同步更新产物引用与 checksum 后再执行 `init`。安装器不会在新旧两套状态之间自动选择权威来源。
|
|
99
128
|
|
|
100
129
|
## 仓库内容边界
|
|
101
130
|
|
|
102
|
-
本工作流维护仓库把长期资产分为源码、永久验证源码和审计物料。安装器、状态 CLI、Hook、Skill
|
|
131
|
+
本工作流维护仓库把长期资产分为源码、永久验证源码和审计物料。安装器、状态 CLI、Hook、Skill、Workflow Manager 等通用自动化验证统一位于 `verification/` 并纳入 Git;可重建的全流程交付证据与历史快照位于 `audit/` 并纳入 Git,但不会被 `init` 安装到业务项目。
|
|
103
132
|
|
|
104
133
|
所有测试工作区、缓存、日志、报告、临时 Git 仓库、npm cache、打包产物、认证辅助文件和绑定单次演练的脚本统一放入 `.tmp/`。根 `.gitignore` 整体忽略 `/.tmp/`,其中任何内容都不得作为权威源码或审计证据。`audit/` 候选包、部署副本和历史快照内嵌的应用测试属于审计物料,可保留原路径;执行这些校验的维护入口位于 `verification/`。
|
|
105
134
|
|
|
@@ -107,6 +136,8 @@ npx ai-delivery-workflow@latest init . --force
|
|
|
107
136
|
npm test
|
|
108
137
|
npm run skills:validate
|
|
109
138
|
npm run audit:verify
|
|
139
|
+
npm run benchmark:autonomy -- --iterations 5
|
|
140
|
+
npm run release:check -- prepare --version <version>
|
|
110
141
|
```
|
|
111
142
|
|
|
112
143
|
`npm run skills:validate` 使用项目已有的 Node.js `yaml` 依赖校验全部 25 个 Skill,无需 Python 或 `PyYAML`。它检查 `SKILL.md` frontmatter、目录名称、`agents/openai.yaml` 界面元数据,以及项目手册和文件参考中的 Skill 覆盖关系;任一错误都会返回非零退出码。该校验只属于本维护仓库,不会安装到业务项目。
|
package/bin/ai-delivery.mjs
CHANGED
|
@@ -4,10 +4,18 @@ import fs from "node:fs";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
7
|
+
import { runCodeGraphAction } from "../lib/codegraph.mjs";
|
|
8
|
+
import { runMockSystemAction } from "../lib/mock-system.mjs";
|
|
7
9
|
import { executeDeliveryStateCommand } from "../lib/delivery-state.mjs";
|
|
8
10
|
import { dispatchEvolutionHookEvent, executeEvolutionCommand } from "../lib/evolution.mjs";
|
|
9
|
-
import { doctorProject, initProject } from "../lib/project-installer.mjs";
|
|
11
|
+
import { doctorProject, initProject, upgradeProject } from "../lib/project-installer.mjs";
|
|
10
12
|
import { bootstrapProject, inspectProjectState } from "../lib/project-bootstrap.mjs";
|
|
13
|
+
import { migrateProject, repairProject } from "../lib/project-migration.mjs";
|
|
14
|
+
import { validateVisualStandard } from "../lib/visual-standard.mjs";
|
|
15
|
+
import { validatePrototypeRevision } from "../lib/prototype-revision.mjs";
|
|
16
|
+
import { runFrontendGuardCommand } from "../lib/frontend-guard.mjs";
|
|
17
|
+
import { runUiAcceptanceCommand } from "../lib/ui-acceptance.mjs";
|
|
18
|
+
import { WorkflowManagerError, renderWorkflowManagerCommandHelp, runWorkflowManagerCommand } from "../lib/workflow-manager.mjs";
|
|
11
19
|
|
|
12
20
|
const packageRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
13
21
|
const packageJson = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"));
|
|
@@ -17,30 +25,63 @@ function usage() {
|
|
|
17
25
|
|
|
18
26
|
Usage:
|
|
19
27
|
ai-delivery init [workspace-directory] [--workspace-id id] [--code-path code] [--code-id app] [--code-remote <url>] [--workflow-remote <url>] [--shared-remote <url>] [--dry-run] [--force]
|
|
28
|
+
ai-delivery upgrade [workspace-directory] [--dry-run] [--force]
|
|
29
|
+
ai-delivery upgrade [workspace-directory] --rollback <upgrade-id>
|
|
30
|
+
ai-delivery migrate [workspace-directory] [--decisions <file>] [--dry-run]
|
|
31
|
+
ai-delivery migrate [workspace-directory] --rollback <migration-id>
|
|
32
|
+
ai-delivery repair [workspace-directory] --invalidate-archive <iteration-id> --reason <text> --actor human:<identity> --evidence <ref> --evidence <ref> [--dry-run]
|
|
33
|
+
ai-delivery compact [workspace-directory] [--dry-run]
|
|
20
34
|
ai-delivery inspect [workspace-directory]
|
|
21
35
|
ai-delivery bootstrap [workspace-directory] [--dry-run] [--force]
|
|
22
36
|
ai-delivery doctor [workspace-directory]
|
|
37
|
+
ai-delivery codegraph <setup|sync> [workspace-directory] [--dry-run]
|
|
38
|
+
ai-delivery mock <setup|start|stop|status|sync> [workspace-directory] [--dry-run]
|
|
39
|
+
ai-delivery mock freeze [workspace-directory] --experience <relative-directory> --scenario-pack <relative-yaml> [--dry-run]
|
|
40
|
+
ai-delivery visual-standard validate [workspace-directory] --experience <relative-directory>
|
|
41
|
+
ai-delivery prototype-revision validate [workspace-directory] --experience <relative-directory> --revision <relative-yaml>
|
|
42
|
+
ai-delivery frontend-guard check-file [workspace-directory] --path <frontend-file> [--experience <relative-directory>] [--revision <relative-yaml>]
|
|
43
|
+
ai-delivery frontend-guard verify-diff [workspace-directory] --base <git-ref> [--head <git-ref>] [--experience <relative-directory>] [--revision <relative-yaml>]
|
|
44
|
+
ai-delivery ui-acceptance <plan|verify> [workspace-directory] --request <relative-yaml> [--results <relative-yaml>]
|
|
45
|
+
ai-delivery manager inspect [workspace-directory]
|
|
46
|
+
ai-delivery manager <list|show|export> [workspace-directory] --resource <manager|contracts|facts|prototypes|prototype-source-snapshots|attachments|systems|mock|settings> [--terminal-id all|<terminal-id>]
|
|
47
|
+
ai-delivery manager action <action-name> [workspace-directory] --input <json-file>
|
|
48
|
+
ai-delivery manager serve [workspace-directory] [--port <port>] [--no-open]
|
|
23
49
|
ai-delivery state <state-command> [options]
|
|
24
50
|
ai-delivery evolve <evolution-command> [options]
|
|
25
51
|
ai-delivery --version
|
|
26
52
|
|
|
27
53
|
Commands:
|
|
28
54
|
init Create a workflow repository and bind or create one nested code repository
|
|
55
|
+
upgrade Preview, apply, or roll back project-scoped managed installation assets
|
|
56
|
+
migrate Preview or apply structural compatibility migration without business-state repair
|
|
57
|
+
repair Append an explicit forward correction without rewriting historical evidence
|
|
58
|
+
compact Archive anchored legacy history and remove loose snapshots only after verified replay
|
|
29
59
|
inspect Detect workspace, code repository, workflow, and runtime state without writes
|
|
30
60
|
bootstrap Initialize missing workflow context or route recovery safely
|
|
31
61
|
doctor Validate the current project-scoped installation
|
|
62
|
+
codegraph Set up or synchronize the optional code repository index
|
|
63
|
+
mock Manage the local-only Microcks Mock System and tracked definitions
|
|
64
|
+
visual-standard Validate the exact UX-VS inputs and approval before Gate completion
|
|
65
|
+
prototype-revision Validate one immutable revision of the single project Prototype
|
|
66
|
+
frontend-guard Enforce approved Prototype Page coverage before production frontend edits
|
|
67
|
+
ui-acceptance Plan and verify Candidate Assurance UI evidence against immutable inputs
|
|
68
|
+
manager Inspect the shared Workflow Manager projection or start its loopback UI
|
|
32
69
|
state Inspect, verify, and mutate formal workflow state through the guarded CLI
|
|
33
70
|
evolve Record feedback and govern project-local workflow extensions
|
|
34
71
|
|
|
35
72
|
Options:
|
|
36
73
|
--dry-run Show planned changes without writing files
|
|
37
74
|
--force Back up and replace conflicting managed files
|
|
75
|
+
--rollback Restore one upgrade or migration before any later formal transaction
|
|
76
|
+
--decisions Apply checksum-bound human task-grouping decisions from a YAML or JSON file
|
|
38
77
|
--code-path Nested code repository directory (default: code)
|
|
39
78
|
--code-id Stable code repository identifier (default: app)
|
|
40
79
|
--code-remote Clone this remote when the code directory does not exist
|
|
41
80
|
--workflow-remote Configure the workflow repository origin
|
|
42
81
|
--shared-remote Configure both independent repositories with the same origin
|
|
43
82
|
--workspace-id Stable ID used by workflow/<workspace-id>
|
|
83
|
+
--port Loopback port for the selected local UI
|
|
84
|
+
--no-open Start the selected local UI without opening a browser
|
|
44
85
|
`;
|
|
45
86
|
}
|
|
46
87
|
|
|
@@ -48,10 +89,19 @@ function parseArgs(argv) {
|
|
|
48
89
|
const flags = new Set();
|
|
49
90
|
const options = new Map();
|
|
50
91
|
const positional = [];
|
|
51
|
-
const booleanOptions = new Set(["--dry-run", "--force", "--help", "--version"]);
|
|
92
|
+
const booleanOptions = new Set(["--dry-run", "--force", "--help", "--version", "--no-open"]);
|
|
52
93
|
const valueOptions = new Set([
|
|
53
94
|
"--code-path", "--code-id", "--code-remote", "--workflow-remote", "--shared-remote", "--workspace-id",
|
|
95
|
+
"--rollback", "--decisions",
|
|
96
|
+
"--invalidate-archive", "--reason", "--actor", "--evidence", "--experience", "--revision", "--port",
|
|
97
|
+
"--scenario-pack",
|
|
98
|
+
"--path",
|
|
99
|
+
"--base", "--head",
|
|
100
|
+
"--request", "--results",
|
|
101
|
+
"--resource", "--input", "--experience", "--branch", "--attachment-id", "--expected-checksum", "--terminal-id",
|
|
102
|
+
"--source-snapshot-id", "--source-ref", "--page-id", "--review-scene-id",
|
|
54
103
|
]);
|
|
104
|
+
const repeatableOptions = new Set(["--evidence"]);
|
|
55
105
|
for (let index = 0; index < argv.length; index += 1) {
|
|
56
106
|
const value = argv[index];
|
|
57
107
|
if (booleanOptions.has(value)) {
|
|
@@ -59,7 +109,12 @@ function parseArgs(argv) {
|
|
|
59
109
|
} else if (valueOptions.has(value)) {
|
|
60
110
|
const optionValue = argv[index + 1];
|
|
61
111
|
if (!optionValue || optionValue.startsWith("--")) throw new Error(`Missing value for ${value}`);
|
|
62
|
-
|
|
112
|
+
if (repeatableOptions.has(value)) {
|
|
113
|
+
const existing = options.get(value);
|
|
114
|
+
options.set(value, [...(Array.isArray(existing) ? existing : existing ? [existing] : []), optionValue]);
|
|
115
|
+
} else {
|
|
116
|
+
options.set(value, optionValue);
|
|
117
|
+
}
|
|
63
118
|
index += 1;
|
|
64
119
|
} else if (value.startsWith("--")) {
|
|
65
120
|
throw new Error(`Unknown option: ${value}`);
|
|
@@ -70,6 +125,8 @@ function parseArgs(argv) {
|
|
|
70
125
|
return { flags, options, positional };
|
|
71
126
|
}
|
|
72
127
|
|
|
128
|
+
let managerCommand = false;
|
|
129
|
+
|
|
73
130
|
try {
|
|
74
131
|
const rawArgs = process.argv.slice(2);
|
|
75
132
|
if (rawArgs[0] === "state" || rawArgs[0] === "evolve") {
|
|
@@ -89,13 +146,25 @@ try {
|
|
|
89
146
|
} else {
|
|
90
147
|
const { flags, options, positional } = parseArgs(rawArgs);
|
|
91
148
|
if (flags.has("--help") || positional[0] === "help") {
|
|
92
|
-
|
|
149
|
+
if (positional[0] === "manager") {
|
|
150
|
+
const actionName = positional[1] === "action" ? positional[2] : null;
|
|
151
|
+
process.stdout.write(`${renderWorkflowManagerCommandHelp(actionName, { command: "ai-delivery manager" })}\n`);
|
|
152
|
+
} else {
|
|
153
|
+
process.stdout.write(usage());
|
|
154
|
+
}
|
|
93
155
|
} else if (flags.has("--version")) {
|
|
94
156
|
process.stdout.write(`${packageJson.version}\n`);
|
|
95
157
|
} else {
|
|
96
158
|
const command = positional[0] || "init";
|
|
97
|
-
|
|
159
|
+
managerCommand = command === "manager";
|
|
160
|
+
const nestedTargetCommand = command === "codegraph" || command === "visual-standard"
|
|
161
|
+
|| command === "mock" || command === "prototype-revision"
|
|
162
|
+
|| command === "frontend-guard" || command === "ui-acceptance" || command === "manager";
|
|
163
|
+
const target = path.resolve(positional[nestedTargetCommand ? 2 : 1] || process.cwd());
|
|
98
164
|
if (command === "init") {
|
|
165
|
+
if (fs.existsSync(path.join(target, ".workflow", "config", "install-manifest.json"))) {
|
|
166
|
+
throw new Error("ai-delivery-workflow is already installed; use the upgrade command for managed installation changes.");
|
|
167
|
+
}
|
|
99
168
|
const report = initProject(packageRoot, target, {
|
|
100
169
|
dryRun: flags.has("--dry-run"),
|
|
101
170
|
force: flags.has("--force"),
|
|
@@ -109,9 +178,43 @@ try {
|
|
|
109
178
|
});
|
|
110
179
|
process.stdout.write(`${report.summary}\n`);
|
|
111
180
|
for (const item of report.actions) process.stdout.write(`- ${item}\n`);
|
|
181
|
+
} else if (command === "upgrade") {
|
|
182
|
+
const report = upgradeProject(packageRoot, target, {
|
|
183
|
+
dryRun: flags.has("--dry-run"),
|
|
184
|
+
force: flags.has("--force"),
|
|
185
|
+
packageVersion: packageJson.version,
|
|
186
|
+
rollback: options.get("--rollback") || null,
|
|
187
|
+
});
|
|
188
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
112
189
|
} else if (command === "inspect") {
|
|
113
190
|
const report = inspectProjectState(target);
|
|
114
191
|
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
192
|
+
} else if (command === "migrate") {
|
|
193
|
+
const report = migrateProject(target, {
|
|
194
|
+
dryRun: flags.has("--dry-run"),
|
|
195
|
+
rollback: options.get("--rollback") || null,
|
|
196
|
+
decisions: options.get("--decisions") || null,
|
|
197
|
+
});
|
|
198
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
199
|
+
} else if (command === "repair") {
|
|
200
|
+
const report = repairProject(target, {
|
|
201
|
+
dryRun: flags.has("--dry-run"),
|
|
202
|
+
invalidateArchive: options.get("--invalidate-archive"),
|
|
203
|
+
reason: options.get("--reason"),
|
|
204
|
+
actor: options.get("--actor"),
|
|
205
|
+
evidence: options.get("--evidence") || [],
|
|
206
|
+
});
|
|
207
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
208
|
+
} else if (command === "compact") {
|
|
209
|
+
const stateArgs = ["artifact", "compact", "--project", target];
|
|
210
|
+
if (!flags.has("--dry-run")) stateArgs.push("--apply");
|
|
211
|
+
const report = executeDeliveryStateCommand(stateArgs, {
|
|
212
|
+
yaml: {
|
|
213
|
+
parse: parseYaml,
|
|
214
|
+
stringify: (value) => stringifyYaml(value, { lineWidth: 0 }),
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
115
218
|
} else if (command === "bootstrap") {
|
|
116
219
|
const report = bootstrapProject(packageRoot, target, {
|
|
117
220
|
dryRun: flags.has("--dry-run"),
|
|
@@ -127,12 +230,84 @@ try {
|
|
|
127
230
|
process.stdout.write(`${outcome} ${check.message}\n`);
|
|
128
231
|
}
|
|
129
232
|
if (!report.ok) process.exitCode = 1;
|
|
233
|
+
} else if (command === "codegraph") {
|
|
234
|
+
const report = runCodeGraphAction(target, positional[1], {
|
|
235
|
+
dryRun: flags.has("--dry-run"),
|
|
236
|
+
});
|
|
237
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
238
|
+
} else if (command === "mock") {
|
|
239
|
+
const report = await runMockSystemAction(target, positional[1], {
|
|
240
|
+
dryRun: flags.has("--dry-run"),
|
|
241
|
+
experience: options.get("--experience"),
|
|
242
|
+
scenarioPack: options.get("--scenario-pack"),
|
|
243
|
+
});
|
|
244
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
245
|
+
} else if (command === "visual-standard" && positional[1] === "validate") {
|
|
246
|
+
const report = validateVisualStandard(target, {
|
|
247
|
+
experience: options.get("--experience"),
|
|
248
|
+
});
|
|
249
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
250
|
+
} else if (command === "prototype-revision" && positional[1] === "validate") {
|
|
251
|
+
const report = validatePrototypeRevision(target, {
|
|
252
|
+
experience: options.get("--experience"),
|
|
253
|
+
revision: options.get("--revision"),
|
|
254
|
+
});
|
|
255
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
256
|
+
} else if (command === "frontend-guard") {
|
|
257
|
+
const report = runFrontendGuardCommand(target, positional[1], {
|
|
258
|
+
path: options.get("--path"),
|
|
259
|
+
experience: options.get("--experience"),
|
|
260
|
+
revision: options.get("--revision"),
|
|
261
|
+
base: options.get("--base"),
|
|
262
|
+
head: options.get("--head"),
|
|
263
|
+
});
|
|
264
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
265
|
+
} else if (command === "ui-acceptance") {
|
|
266
|
+
const report = runUiAcceptanceCommand(target, positional[1], {
|
|
267
|
+
request: options.get("--request"),
|
|
268
|
+
results: options.get("--results"),
|
|
269
|
+
});
|
|
270
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
271
|
+
} else if (command === "manager") {
|
|
272
|
+
const managerAction = positional[1];
|
|
273
|
+
const actionName = managerAction === "action" ? positional[2] : null;
|
|
274
|
+
const managerTarget = managerAction === "action"
|
|
275
|
+
? path.resolve(positional[3] || process.cwd())
|
|
276
|
+
: target;
|
|
277
|
+
const inputFile = options.get("--input");
|
|
278
|
+
const input = inputFile ? JSON.parse(fs.readFileSync(path.resolve(inputFile), "utf8")) : undefined;
|
|
279
|
+
const result = await runWorkflowManagerCommand(packageRoot, managerTarget, managerAction, {
|
|
280
|
+
port: options.get("--port"),
|
|
281
|
+
open: !flags.has("--no-open"),
|
|
282
|
+
resource: options.get("--resource"),
|
|
283
|
+
experience: options.get("--experience"),
|
|
284
|
+
revision: options.get("--revision"),
|
|
285
|
+
branch: options.get("--branch"),
|
|
286
|
+
attachmentId: options.get("--attachment-id"),
|
|
287
|
+
expectedChecksum: options.get("--expected-checksum"),
|
|
288
|
+
terminalId: options.get("--terminal-id"),
|
|
289
|
+
sourceSnapshotId: options.get("--source-snapshot-id"),
|
|
290
|
+
sourceRef: options.get("--source-ref"),
|
|
291
|
+
pageId: options.get("--page-id"),
|
|
292
|
+
reviewSceneId: options.get("--review-scene-id"),
|
|
293
|
+
actionName,
|
|
294
|
+
input,
|
|
295
|
+
});
|
|
296
|
+
const report = result?.report || result;
|
|
297
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
130
298
|
} else {
|
|
131
299
|
throw new Error(`Unknown command: ${command}\n\n${usage()}`);
|
|
132
300
|
}
|
|
133
301
|
}
|
|
134
302
|
}
|
|
135
303
|
} catch (error) {
|
|
136
|
-
|
|
304
|
+
if (managerCommand) {
|
|
305
|
+
process.stderr.write(`${JSON.stringify({
|
|
306
|
+
error: {
|
|
307
|
+
code: error instanceof WorkflowManagerError ? error.code : "invalid-request",
|
|
308
|
+
message: error?.message || "Workflow Manager request failed",
|
|
309
|
+
},
|
|
310
|
+
})}\n`);
|
|
311
|
+
} else process.stderr.write(`ai-delivery: ${error.message}\n`);
|
|
137
312
|
process.exitCode = 1;
|
|
138
313
|
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import crypto from "node:crypto";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { performance } from "node:perf_hooks";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { bootstrapProject } from "../lib/project-bootstrap.mjs";
|
|
10
|
+
import { initProject } from "../lib/project-installer.mjs";
|
|
11
|
+
|
|
12
|
+
const packageRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
13
|
+
const temporaryRoot = path.join(packageRoot, ".tmp");
|
|
14
|
+
|
|
15
|
+
function parseArguments(argv) {
|
|
16
|
+
const options = { iterations: 5, output: null };
|
|
17
|
+
while (argv.length) {
|
|
18
|
+
const key = argv.shift();
|
|
19
|
+
if (!new Set(["--iterations", "--output"]).has(key)) throw new Error(`unknown option: ${key}`);
|
|
20
|
+
const value = argv.shift();
|
|
21
|
+
if (!value || value.startsWith("--")) throw new Error(`missing value for ${key}`);
|
|
22
|
+
options[key.slice(2)] = key === "--iterations" ? Number(value) : path.resolve(value);
|
|
23
|
+
}
|
|
24
|
+
if (!Number.isInteger(options.iterations) || options.iterations < 1 || options.iterations > 100) {
|
|
25
|
+
throw new Error("--iterations must be an integer from 1 to 100");
|
|
26
|
+
}
|
|
27
|
+
return options;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function sha256(value) {
|
|
31
|
+
return crypto.createHash("sha256").update(value).digest("hex");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function filesUnder(directory) {
|
|
35
|
+
if (!fs.existsSync(directory)) return [];
|
|
36
|
+
return fs.readdirSync(directory, { withFileTypes: true })
|
|
37
|
+
.flatMap((entry) => {
|
|
38
|
+
const absolute = path.join(directory, entry.name);
|
|
39
|
+
return entry.isDirectory() ? filesUnder(absolute) : [absolute];
|
|
40
|
+
})
|
|
41
|
+
.sort((left, right) => left.localeCompare(right));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function durableSnapshot(project) {
|
|
45
|
+
const workflowRoot = path.join(project, ".workflow");
|
|
46
|
+
const files = filesUnder(workflowRoot);
|
|
47
|
+
const hash = crypto.createHash("sha256");
|
|
48
|
+
let bytes = 0;
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
const relative = path.relative(workflowRoot, file).replaceAll("\\", "/");
|
|
51
|
+
const content = fs.readFileSync(file);
|
|
52
|
+
bytes += content.length;
|
|
53
|
+
hash.update(`${relative}\0${content.length}\0`);
|
|
54
|
+
hash.update(content);
|
|
55
|
+
}
|
|
56
|
+
return { checksum: hash.digest("hex"), file_count: files.length, bytes };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function withoutVolatileFields(value) {
|
|
60
|
+
if (Array.isArray(value)) return value.map(withoutVolatileFields);
|
|
61
|
+
if (!value || typeof value !== "object") return value;
|
|
62
|
+
return Object.fromEntries(Object.entries(value)
|
|
63
|
+
.filter(([key]) => key !== "detected_at")
|
|
64
|
+
.map(([key, child]) => [key, withoutVolatileFields(child)]));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function runChecked(program, args, cwd) {
|
|
68
|
+
const result = spawnSync(program, args, { cwd, encoding: "utf8", windowsHide: true });
|
|
69
|
+
if (result.status !== 0) {
|
|
70
|
+
throw new Error(`${path.basename(program)} ${args.join(" ")} failed: ${result.stderr || result.stdout}`);
|
|
71
|
+
}
|
|
72
|
+
return result.stdout.trim();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function prepareRecoveryCheckpoint(project) {
|
|
76
|
+
const codeRoot = path.join(project, "code");
|
|
77
|
+
runChecked("git", ["config", "user.email", "benchmark@example.invalid"], codeRoot);
|
|
78
|
+
runChecked("git", ["config", "user.name", "Autonomy Benchmark"], codeRoot);
|
|
79
|
+
fs.writeFileSync(path.join(codeRoot, "README.md"), "autonomy benchmark\n", "utf8");
|
|
80
|
+
runChecked("git", ["add", "README.md"], codeRoot);
|
|
81
|
+
runChecked("git", ["commit", "-m", "initialize benchmark code"], codeRoot);
|
|
82
|
+
const taskCli = path.join(
|
|
83
|
+
project, ".agents", "skills", "ai-delivery-checkpoint-task", "scripts", "task-state.mjs",
|
|
84
|
+
);
|
|
85
|
+
const stateRoot = ["--state-root", project];
|
|
86
|
+
const initializedTask = JSON.parse(runChecked(process.execPath, [
|
|
87
|
+
taskCli, "init",
|
|
88
|
+
"--task-id", "TASK-BENCHMARK-RECOVERY",
|
|
89
|
+
"--iteration-id", "BENCHMARK-001",
|
|
90
|
+
"--node", "01-product-shaping",
|
|
91
|
+
"--skill", "ai-delivery-define-product",
|
|
92
|
+
"--goal", "Resume the recorded product discovery question",
|
|
93
|
+
"--branch", "main",
|
|
94
|
+
"--worktree", codeRoot,
|
|
95
|
+
"--status", "queued",
|
|
96
|
+
"--next-action", "Ask the recorded business question",
|
|
97
|
+
"--next-action-owner", "agent",
|
|
98
|
+
...stateRoot,
|
|
99
|
+
], codeRoot));
|
|
100
|
+
runChecked(process.execPath, [
|
|
101
|
+
taskCli, "activate",
|
|
102
|
+
"--task-id", "TASK-BENCHMARK-RECOVERY",
|
|
103
|
+
...stateRoot,
|
|
104
|
+
], codeRoot);
|
|
105
|
+
runChecked(process.execPath, [
|
|
106
|
+
taskCli, "finish",
|
|
107
|
+
"--task-id", "TASK-BENCHMARK-RECOVERY",
|
|
108
|
+
"--status", "blocked",
|
|
109
|
+
"--blocker", "Waiting for a business answer",
|
|
110
|
+
"--next-action", "Confirm the primary business problem",
|
|
111
|
+
"--next-action-owner", "user",
|
|
112
|
+
...stateRoot,
|
|
113
|
+
], codeRoot);
|
|
114
|
+
return initializedTask.node;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function runAutonomyBenchmark(options) {
|
|
118
|
+
const packageVersion = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")).version;
|
|
119
|
+
fs.mkdirSync(temporaryRoot, { recursive: true });
|
|
120
|
+
const project = fs.mkdtempSync(path.join(temporaryRoot, "ai-delivery-autonomy-benchmark-"));
|
|
121
|
+
try {
|
|
122
|
+
const bootstrapStarted = performance.now();
|
|
123
|
+
const bootstrap = bootstrapProject(packageRoot, project, {
|
|
124
|
+
packageVersion,
|
|
125
|
+
initProject,
|
|
126
|
+
});
|
|
127
|
+
const bootstrapElapsed = performance.now() - bootstrapStarted;
|
|
128
|
+
const recoveryTaskNode = prepareRecoveryCheckpoint(project);
|
|
129
|
+
const before = durableSnapshot(project);
|
|
130
|
+
const samples = [];
|
|
131
|
+
for (let index = 0; index < options.iterations; index += 1) {
|
|
132
|
+
const started = performance.now();
|
|
133
|
+
const route = bootstrapProject(packageRoot, project, { packageVersion });
|
|
134
|
+
const elapsed = performance.now() - started;
|
|
135
|
+
const inspection = route.inspection;
|
|
136
|
+
const payload = Buffer.from(JSON.stringify(route), "utf8");
|
|
137
|
+
const semanticPayload = Buffer.from(JSON.stringify(withoutVolatileFields(route)), "utf8");
|
|
138
|
+
samples.push({
|
|
139
|
+
sequence: index + 1,
|
|
140
|
+
elapsed_ms: Number(elapsed.toFixed(3)),
|
|
141
|
+
state: inspection.state,
|
|
142
|
+
recommended_skill: inspection.recommendation?.skill || null,
|
|
143
|
+
recommended_task_id: inspection.runtime?.recommended_task_id || null,
|
|
144
|
+
next_action_owner: inspection.runtime?.next_action_owner || null,
|
|
145
|
+
deferred_to_user: route.deferred_to_user,
|
|
146
|
+
context_bytes: payload.length,
|
|
147
|
+
context_sha256: sha256(payload),
|
|
148
|
+
semantic_context_sha256: sha256(semanticPayload),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const after = durableSnapshot(project);
|
|
152
|
+
const semanticChecksums = new Set(samples.map((sample) => sample.semantic_context_sha256));
|
|
153
|
+
const invariants = {
|
|
154
|
+
durable_checksum_stable: before.checksum === after.checksum,
|
|
155
|
+
durable_file_count_stable: before.file_count === after.file_count,
|
|
156
|
+
semantic_context_checksum_stable: semanticChecksums.size === 1,
|
|
157
|
+
durable_growth_bytes: after.bytes - before.bytes,
|
|
158
|
+
};
|
|
159
|
+
const decision = Object.entries(invariants).every(([key, value]) =>
|
|
160
|
+
key === "durable_growth_bytes" ? value === 0 : value === true) ? "pass" : "fail";
|
|
161
|
+
return {
|
|
162
|
+
schema_version: 1,
|
|
163
|
+
benchmark: "autonomous-bootstrap-and-recovery-inspection",
|
|
164
|
+
generated_at: new Date().toISOString(),
|
|
165
|
+
workflow_version: packageVersion,
|
|
166
|
+
environment: { node: process.version, platform: process.platform, architecture: process.arch },
|
|
167
|
+
methodology: {
|
|
168
|
+
llm_token_usage: "unavailable",
|
|
169
|
+
context_cost_proxy: "UTF-8 byte length of bootstrapProject recovery-route JSON",
|
|
170
|
+
volatile_fields_excluded_from_semantic_checksum: ["detected_at"],
|
|
171
|
+
durable_scope: ".workflow/ after first Bootstrap and a user-owned checkpoint",
|
|
172
|
+
},
|
|
173
|
+
bootstrap: {
|
|
174
|
+
elapsed_ms: Number(bootstrapElapsed.toFixed(3)),
|
|
175
|
+
initial_state: bootstrap.initial_state,
|
|
176
|
+
resulting_state: bootstrap.resulting_state,
|
|
177
|
+
initialized: bootstrap.initialized,
|
|
178
|
+
artifacts_written: bootstrap.artifacts_written,
|
|
179
|
+
durable_after: before,
|
|
180
|
+
},
|
|
181
|
+
recovery: {
|
|
182
|
+
route: "bootstrapProject-user-owned-checkpoint",
|
|
183
|
+
task_node: recoveryTaskNode,
|
|
184
|
+
iterations: options.iterations,
|
|
185
|
+
elapsed_total_ms: Number(samples.reduce((total, sample) => total + sample.elapsed_ms, 0).toFixed(3)),
|
|
186
|
+
context_bytes_min: Math.min(...samples.map((sample) => sample.context_bytes)),
|
|
187
|
+
context_bytes_max: Math.max(...samples.map((sample) => sample.context_bytes)),
|
|
188
|
+
samples,
|
|
189
|
+
},
|
|
190
|
+
durable_before_recovery: before,
|
|
191
|
+
durable_after_recovery: after,
|
|
192
|
+
invariants,
|
|
193
|
+
decision,
|
|
194
|
+
limitations: [
|
|
195
|
+
"The Codex runtime does not expose per-subagent LLM token usage to this repository command.",
|
|
196
|
+
"Elapsed time is environment-dependent and is recorded as an observation, not a release threshold.",
|
|
197
|
+
],
|
|
198
|
+
};
|
|
199
|
+
} finally {
|
|
200
|
+
fs.rmSync(project, { recursive: true, force: true });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
try {
|
|
205
|
+
const options = parseArguments(process.argv.slice(2));
|
|
206
|
+
const report = runAutonomyBenchmark(options);
|
|
207
|
+
const text = `${JSON.stringify(report, null, 2)}\n`;
|
|
208
|
+
if (options.output) {
|
|
209
|
+
fs.mkdirSync(path.dirname(options.output), { recursive: true });
|
|
210
|
+
fs.writeFileSync(options.output, text, "utf8");
|
|
211
|
+
}
|
|
212
|
+
process.stdout.write(text);
|
|
213
|
+
if (report.decision !== "pass") process.exitCode = 1;
|
|
214
|
+
} catch (error) {
|
|
215
|
+
process.stderr.write(`${error.message}\n`);
|
|
216
|
+
process.exitCode = 2;
|
|
217
|
+
}
|