create-yss-spec 3.5.6 → 3.5.9
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/bin/create-yss-spec.js +3 -1
- package/cli-core.lock.json +10 -6
- package/package.json +4 -1
- package/src/api/_sync-service.js +3 -1
- package/src/command-runner.mjs +44 -9
- package/src/commands/doctor.js +40 -0
- package/src/commands/skills.js +7 -2
- package/src/content-identity.js +111 -0
- package/src/runtime-store.mjs +650 -0
- package/src/template/asset-runtime.js +124 -22
- package/src/template/instance-runtime.js +23 -7
- package/src/validation/metadata.js +8 -0
- package/template/.agents/skills/.strategic-design-skills-manifest.json +3 -3
- package/template/.agents/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.agents/skills/archify/SKILL.md +2 -2
- package/template/.agents/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.agents/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.agents/skills/code-review/SKILL.md +19 -11
- package/template/.agents/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.agents/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.agents/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.agents/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.agents/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.agents/skills/file-export-download/SKILL.md +4 -73
- package/template/.agents/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.agents/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.agents/skills/formily-foundation/SKILL.md +6 -105
- package/template/.agents/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.agents/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.agents/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.agents/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.agents/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.agents/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.agents/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.agents/skills/handoff/SKILL.md +3 -1
- package/template/.agents/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.agents/skills/implement/SKILL.md +2 -2
- package/template/.agents/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.agents/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.agents/skills/lombok/SKILL.md +2 -0
- package/template/.agents/skills/mapstruct/SKILL.md +2 -0
- package/template/.agents/skills/tdd/SKILL.md +2 -2
- package/template/.agents/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.agents/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.agents/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.agents/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.agents/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.agents/skills/yss-application/SKILL.md +11 -5
- package/template/.agents/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.agents/skills/yss-audit-log/references/README.md +5 -5
- package/template/.agents/skills/yss-cache/SKILL.md +4 -4
- package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.agents/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.agents/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +2 -2
- package/template/.agents/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.agents/skills/yss-dto/SKILL.md +9 -9
- package/template/.agents/skills/yss-dto/references/README.md +4 -4
- package/template/.agents/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.agents/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.agents/skills/yss-exception/SKILL.md +42 -48
- package/template/.agents/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.agents/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
- package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.agents/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.agents/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.agents/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.agents/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.agents/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +32 -26
- package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +38 -13
- package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.agents/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
- package/template/.agents/skills/yss-repository/SKILL.md +2 -2
- package/template/.agents/skills/yss-research/SKILL.md +39 -48
- package/template/.agents/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.agents/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.agents/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.agents/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.agents/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.agents/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.agents/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.agents/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.agents/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.agents/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.agents/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- package/template/.agents/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -5
- package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
- package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
- package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
- package/template/.agents/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.agents/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.agents/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.agents/skills/yss-ui/SKILL.md +7 -1
- package/template/.agents/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.agents/skills/yss-ui/references/checklist.md +38 -96
- package/template/.agents/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.agents/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.agents/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.agents/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.agents/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.agents/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.agents/skills/yss-validation/SKILL.md +26 -32
- package/template/.agents/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.agents/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.agents/skills/ytable-usage/SKILL.md +2 -2
- package/template/.agents/skills/ytree-usage/SKILL.md +2 -80
- package/template/.agents/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.codex/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.codex/skills/archify/SKILL.md +2 -2
- package/template/.codex/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.codex/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.codex/skills/code-review/SKILL.md +19 -11
- package/template/.codex/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.codex/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.codex/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.codex/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.codex/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.codex/skills/file-export-download/SKILL.md +4 -73
- package/template/.codex/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.codex/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.codex/skills/formily-foundation/SKILL.md +6 -105
- package/template/.codex/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.codex/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.codex/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.codex/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.codex/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.codex/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.codex/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.codex/skills/handoff/SKILL.md +3 -1
- package/template/.codex/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.codex/skills/implement/SKILL.md +2 -2
- package/template/.codex/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.codex/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.codex/skills/lombok/SKILL.md +2 -0
- package/template/.codex/skills/mapstruct/SKILL.md +2 -0
- package/template/.codex/skills/product-design/references/communication-protocol.md +3 -3
- package/template/.codex/skills/product-design/references/critical-overrides.md +4 -5
- package/template/.codex/skills/product-design/skills/audit/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/get-context/SKILL.md +6 -8
- package/template/.codex/skills/product-design/skills/ideate/SKILL.md +3 -3
- package/template/.codex/skills/product-design/skills/image-to-code/SKILL.md +3 -5
- package/template/.codex/skills/product-design/skills/index/SKILL.md +1 -1
- package/template/.codex/skills/product-design/skills/prototype/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/research/SKILL.md +4 -6
- package/template/.codex/skills/product-design/skills/research/assets/research-brief-template.md +3 -3
- package/template/.codex/skills/product-design/skills/share/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/url-to-code/SKILL.md +2 -4
- package/template/.codex/skills/product-design/skills/user-context/SKILL.md +1 -1
- package/template/.codex/skills/tdd/SKILL.md +2 -2
- package/template/.codex/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.codex/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.codex/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.codex/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.codex/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.codex/skills/yss-application/SKILL.md +11 -5
- package/template/.codex/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.codex/skills/yss-audit-log/references/README.md +5 -5
- package/template/.codex/skills/yss-cache/SKILL.md +4 -4
- package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.codex/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.codex/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +2 -2
- package/template/.codex/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.codex/skills/yss-dto/SKILL.md +9 -9
- package/template/.codex/skills/yss-dto/references/README.md +4 -4
- package/template/.codex/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.codex/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.codex/skills/yss-exception/SKILL.md +42 -48
- package/template/.codex/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.codex/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
- package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.codex/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.codex/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.codex/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.codex/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.codex/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +32 -26
- package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +38 -13
- package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.codex/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
- package/template/.codex/skills/yss-repository/SKILL.md +2 -2
- package/template/.codex/skills/yss-research/SKILL.md +39 -48
- package/template/.codex/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.codex/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.codex/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.codex/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.codex/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.codex/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.codex/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.codex/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.codex/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.codex/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.codex/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- package/template/.codex/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -5
- package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
- package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
- package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
- package/template/.codex/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.codex/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.codex/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.codex/skills/yss-ui/SKILL.md +7 -1
- package/template/.codex/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.codex/skills/yss-ui/references/checklist.md +38 -96
- package/template/.codex/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.codex/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.codex/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.codex/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.codex/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.codex/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.codex/skills/yss-validation/SKILL.md +26 -32
- package/template/.codex/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.codex/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.codex/skills/ytable-usage/SKILL.md +2 -2
- package/template/.codex/skills/ytree-usage/SKILL.md +2 -80
- package/template/.codex/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.cursor/skills/archify/SKILL.md +2 -2
- package/template/.cursor/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.cursor/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.cursor/skills/code-review/SKILL.md +19 -11
- package/template/.cursor/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.cursor/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.cursor/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.cursor/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.cursor/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.cursor/skills/file-export-download/SKILL.md +4 -73
- package/template/.cursor/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.cursor/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.cursor/skills/formily-foundation/SKILL.md +6 -105
- package/template/.cursor/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.cursor/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.cursor/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.cursor/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.cursor/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.cursor/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.cursor/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.cursor/skills/handoff/SKILL.md +3 -1
- package/template/.cursor/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.cursor/skills/implement/SKILL.md +2 -2
- package/template/.cursor/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.cursor/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.cursor/skills/lombok/SKILL.md +2 -0
- package/template/.cursor/skills/mapstruct/SKILL.md +2 -0
- package/template/.cursor/skills/tdd/SKILL.md +2 -2
- package/template/.cursor/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.cursor/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.cursor/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.cursor/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.cursor/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.cursor/skills/yss-application/SKILL.md +11 -5
- package/template/.cursor/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.cursor/skills/yss-audit-log/references/README.md +5 -5
- package/template/.cursor/skills/yss-cache/SKILL.md +4 -4
- package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.cursor/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.cursor/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +2 -2
- package/template/.cursor/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.cursor/skills/yss-dto/SKILL.md +9 -9
- package/template/.cursor/skills/yss-dto/references/README.md +4 -4
- package/template/.cursor/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.cursor/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.cursor/skills/yss-exception/SKILL.md +42 -48
- package/template/.cursor/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.cursor/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.cursor/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.cursor/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.cursor/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.cursor/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.cursor/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +32 -26
- package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +38 -13
- package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.cursor/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
- package/template/.cursor/skills/yss-repository/SKILL.md +2 -2
- package/template/.cursor/skills/yss-research/SKILL.md +39 -48
- package/template/.cursor/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.cursor/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.cursor/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.cursor/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.cursor/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.cursor/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.cursor/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.cursor/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.cursor/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.cursor/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.cursor/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- package/template/.cursor/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -5
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
- package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
- package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.cursor/skills/yss-ui/SKILL.md +7 -1
- package/template/.cursor/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.cursor/skills/yss-ui/references/checklist.md +38 -96
- package/template/.cursor/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.cursor/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.cursor/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.cursor/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.cursor/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.cursor/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.cursor/skills/yss-validation/SKILL.md +26 -32
- package/template/.cursor/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.cursor/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.cursor/skills/ytable-usage/SKILL.md +2 -2
- package/template/.cursor/skills/ytree-usage/SKILL.md +2 -80
- package/template/.cursor/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.pi/skills/alibaba-java-code-style/SKILL.md +30 -36
- package/template/.pi/skills/archify/SKILL.md +2 -2
- package/template/.pi/skills/archify/scripts/yss-safe-deliver.mjs +10 -6
- package/template/.pi/skills/archify/test/yss-safe-deliver.test.mjs +9 -2
- package/template/.pi/skills/code-review/SKILL.md +19 -11
- package/template/.pi/skills/code-review/references/candidate-capture.md +1 -1
- package/template/.pi/skills/code-review/references/legacy-convergence.md +3 -1
- package/template/.pi/skills/code-review/references/review-axis-checklists.md +2 -0
- package/template/.pi/skills/code-review/references/yss-review-standards.md +4 -2
- package/template/.pi/skills/competitive-intelligence/SKILL.md +32 -74
- package/template/.pi/skills/file-export-download/SKILL.md +4 -73
- package/template/.pi/skills/file-export-download/references/binary-contract-example.md +26 -0
- package/template/.pi/skills/file-export-download/references/download-call-example.md +45 -0
- package/template/.pi/skills/formily-foundation/SKILL.md +6 -105
- package/template/.pi/skills/formily-foundation/references/async-save-example.md +57 -0
- package/template/.pi/skills/formily-foundation/references/query-layout.md +50 -0
- package/template/.pi/skills/formily-linkage-effects/SKILL.md +3 -116
- package/template/.pi/skills/formily-linkage-effects/references/linkage-example.md +116 -0
- package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +3 -81
- package/template/.pi/skills/formily-mode-slot-detail/references/mode-slot-example.md +81 -0
- package/template/.pi/skills/formily-step-flow/SKILL.md +3 -143
- package/template/.pi/skills/formily-step-flow/references/step-flow-example.md +143 -0
- package/template/.pi/skills/handoff/SKILL.md +3 -1
- package/template/.pi/skills/i-have-adhd/SKILL.md +2 -2
- package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +2 -2
- package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +7 -2
- package/template/.pi/skills/implement/SKILL.md +2 -2
- package/template/.pi/skills/llm-wiki/references/transactions.md +2 -2
- package/template/.pi/skills/llm-wiki/scripts/core.mjs +40 -2
- package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +30 -27
- package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +38 -2
- package/template/.pi/skills/lombok/SKILL.md +2 -0
- package/template/.pi/skills/mapstruct/SKILL.md +2 -0
- package/template/.pi/skills/tdd/SKILL.md +2 -2
- package/template/.pi/skills/theme-token-usage/SKILL.md +6 -5
- package/template/.pi/skills/wayfinder/references/chart-map.md +2 -2
- package/template/.pi/skills/wayfinder/references/ticket-types.md +1 -1
- package/template/.pi/skills/yss-api-integration/SKILL.md +13 -50
- package/template/.pi/skills/yss-api-integration/references/orval-list-example.md +38 -0
- package/template/.pi/skills/yss-application/SKILL.md +11 -5
- package/template/.pi/skills/yss-audit-log/SKILL.md +8 -6
- package/template/.pi/skills/yss-audit-log/references/README.md +5 -5
- package/template/.pi/skills/yss-cache/SKILL.md +4 -4
- package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +7 -8
- package/template/.pi/skills/yss-ddd-scaffold-generator/references/USAGE_EXAMPLES.md +13 -6
- package/template/.pi/skills/yss-ddd-scaffold-generator/references/command-examples.md +2 -0
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/scaffold-generator.test.mjs +28 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +2 -2
- package/template/.pi/skills/yss-distributed-id/SKILL.md +4 -4
- package/template/.pi/skills/yss-dto/SKILL.md +9 -9
- package/template/.pi/skills/yss-dto/references/README.md +4 -4
- package/template/.pi/skills/yss-dto/references/wire-validation-checklist.md +4 -4
- package/template/.pi/skills/yss-excel-mvc/SKILL.md +4 -4
- package/template/.pi/skills/yss-exception/SKILL.md +42 -48
- package/template/.pi/skills/yss-formily-schema-generator/SKILL.md +26 -170
- package/template/.pi/skills/yss-formily-schema-generator/references/workflow.md +49 -193
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +14 -10
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +4 -6
- package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +15 -1
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +1 -1
- package/template/.pi/skills/yss-mybatis/SKILL.md +4 -4
- package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +6 -4
- package/template/.pi/skills/yss-openapi-draft-review/references/review-output.md +2 -0
- package/template/.pi/skills/yss-openapi-draft-review/references/semantic-review.md +3 -3
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +5 -7
- package/template/.pi/skills/yss-openapi-governance/references/governance-output.md +2 -0
- package/template/.pi/skills/yss-openapi-governance/references/governance-workflow.md +3 -3
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +32 -26
- package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +1 -1
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +28 -6
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +143 -4
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +38 -13
- package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +7 -6
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +3 -1
- package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +3 -3
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +1 -5
- package/template/.pi/skills/yss-prototype-stage/scripts/verify-prototype-design.mjs +1 -0
- package/template/.pi/skills/yss-repository/SKILL.md +2 -2
- package/template/.pi/skills/yss-research/SKILL.md +39 -48
- package/template/.pi/skills/yss-research/assets/competitive-evidence-template.yaml +146 -0
- package/template/.pi/skills/yss-research/references/competitive-analysis.md +76 -0
- package/template/.pi/skills/yss-research/references/competitive-analysis.schema.json +324 -0
- package/template/.pi/skills/yss-research/references/evidence-contract.md +8 -0
- package/template/.pi/skills/yss-research/scripts/lib/competitive-analysis.mjs +185 -0
- package/template/.pi/skills/yss-research/scripts/render-competitive-outputs.mjs +16 -0
- package/template/.pi/skills/yss-research/scripts/validate-research-package.mjs +6 -2
- package/template/.pi/skills/yss-research/tests/competitive-scenarios.test.mjs +270 -0
- package/template/.pi/skills/yss-resilience4j/SKILL.md +25 -31
- package/template/.pi/skills/yss-security-algorithm/SKILL.md +37 -43
- package/template/.pi/skills/yss-skill-source-index-refresh/SKILL.md +29 -36
- package/template/.pi/skills/yss-skill-source-index-refresh/references/backend-component-platform-compatibility.md +1 -1
- package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -5
- package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -5
- package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -5
- package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +83 -13
- package/template/.pi/skills/yss-tactical-design/SKILL.md +1 -1
- package/template/.pi/skills/yss-tactical-design/references/output-template.md +3 -3
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.pi/skills/yss-technical-design/SKILL.md +6 -5
- package/template/.pi/skills/yss-ui/SKILL.md +7 -1
- package/template/.pi/skills/yss-ui/assets/docs/guide/gitlab-ci-integration.md +2 -2
- package/template/.pi/skills/yss-ui/references/checklist.md +38 -96
- package/template/.pi/skills/yss-ui/references/component-routing.md +3 -1
- package/template/.pi/skills/yss-ui/references/quick-recipes.md +17 -272
- package/template/.pi/skills/yss-ui/references/specialized-components.md +3 -3
- package/template/.pi/skills/yss-ui-business-page-generation/SKILL.md +1 -1
- package/template/.pi/skills/yss-up-springboot3/SKILL.md +19 -21
- package/template/.pi/skills/yss-userinfo/SKILL.md +27 -33
- package/template/.pi/skills/yss-validation/SKILL.md +26 -32
- package/template/.pi/skills/yss-web-controller/SKILL.md +11 -44
- package/template/.pi/skills/yss-web-controller/references/crud-generation.md +38 -0
- package/template/.pi/skills/ytable-usage/SKILL.md +2 -2
- package/template/.pi/skills/ytree-usage/SKILL.md +2 -80
- package/template/.pi/skills/ytree-usage/references/tree-and-confirmation-example.md +81 -0
- package/template/.template-spec/agents/backend-architecture-profiles.md +1 -1
- package/template/.template-spec/agents/digital-human-roles.md +5 -1
- package/template/.template-spec/agents/digital-human-roles.yaml +49 -1
- package/template/.template-spec/engineering/backend-platforms.json +1 -1
- package/template/.template-spec/plan/entry-review.md +2 -1
- package/template/.template-spec/plan/templates/competitive-analysis-template.md +38 -36
- package/template/.template-spec/plan/templates/competitive-matrix-template.md +37 -17
- package/template/.template-spec/plan/templates/plan-template.md +11 -5
- package/template/.template-spec/process/document-writing.md +22 -3
- package/template/.template-spec/process/harness-process-tailoring.md +5 -1
- package/template/.template-spec/process/implementation-repo-integration.md +26 -8
- package/template/.template-spec/process/research-completion.md +2 -0
- package/template/.template-spec/process/runtime-storage.md +78 -0
- package/template/.template-spec/process/schemas/approval-context.schema.json +67 -0
- package/template/.template-spec/process/schemas/approval-record.schema.json +179 -16
- package/template/.template-spec/process/schemas/backend-delivery.schema.json +16 -0
- package/template/.template-spec/process/schemas/delivery-preflight-input.schema.json +4 -0
- package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +236 -1
- package/template/.template-spec/process/schemas/implementation-repository-preparation-result.schema.json +335 -52
- package/template/.template-spec/process/schemas/lifecycle-checkpoint.schema.json +11 -0
- package/template/.template-spec/process/schemas/project-scaffold-contract.schema.json +3 -0
- package/template/.template-spec/process/schemas/review-bundle.schema.json +347 -35
- package/template/.template-spec/process/schemas/strategic-design-handoff-v3.schema.json +504 -0
- package/template/.template-spec/process/schemas/strategic-design-handoff-v4.schema.json +544 -8
- package/template/.template-spec/process/schemas/strategic-design-handoff-v5.schema.json +616 -0
- package/template/.template-spec/process/schemas/strategic-design-handoff.schema.json +616 -0
- package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +712 -109
- package/template/.template-spec/process/schemas/strategic-handoff-domain-strategy.schema.json +595 -90
- package/template/.template-spec/process/schemas/strategic-handoff-export-v2.schema.json +448 -0
- package/template/.template-spec/process/schemas/strategic-handoff-export.schema.json +392 -0
- package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +556 -83
- package/template/.template-spec/process/schemas/strategic-handoff-stage-decision-package.schema.json +418 -57
- package/template/.template-spec/process/script-execution.md +37 -0
- package/template/.template-spec/process/subagent-collaboration.md +7 -1
- package/template/.template-spec/templates/approval-record-template.json +7 -3
- package/template/.template-spec/templates/approval-record-template.yaml +8 -2
- package/template/.template-spec/templates/examples/lifecycle-writing-examples.md +92 -2
- package/template/.template-spec/templates/retro-report-template.md +10 -3
- package/template/.template-spec/templates/review-bundle-template.yaml +19 -10
- package/template/.template-spec/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
- package/template/AGENTS.md +4 -3
- package/template/CONTEXT.md +2 -2
- package/template/README.md +2 -2
- package/template/scripts/advance-maintenance-iteration +51 -0
- package/template/scripts/lib/approval-checkpoint-discovery.mjs +26 -0
- package/template/scripts/lib/approval-consumption.mjs +35 -0
- package/template/scripts/lib/approval-current.mjs +111 -0
- package/template/scripts/lib/approval-record-io.mjs +56 -0
- package/template/scripts/lib/approval-record.mjs +79 -184
- package/template/scripts/lib/approved-execution-context.mjs +8 -6
- package/template/scripts/lib/asset-transactions.mjs +5 -1
- package/template/scripts/lib/backend-delivery.mjs +1 -1
- package/template/scripts/lib/backend-review.mjs +2 -1
- package/template/scripts/lib/backend-scaffold-prerequisites.mjs +3 -2
- package/template/scripts/lib/business-ticket-lifecycle.mjs +2 -1
- package/template/scripts/lib/checkpoint-commit.mjs +50 -0
- package/template/scripts/lib/command-runner.mjs +44 -9
- package/template/scripts/lib/content-identity.mjs +273 -0
- package/template/scripts/lib/delivery-preflight.mjs +2 -1
- package/template/scripts/lib/digital-human-roles.mjs +12 -5
- package/template/scripts/lib/drift-report.mjs +110 -0
- package/template/scripts/lib/existing-backend-architecture.mjs +4 -1
- package/template/scripts/lib/lifecycle-context-query.mjs +172 -11
- package/template/scripts/lib/lifecycle-controls.mjs +9 -19
- package/template/scripts/lib/lifecycle-presentation.mjs +5 -0
- package/template/scripts/lib/lifecycle-status.mjs +63 -12
- package/template/scripts/lib/lifecycle-transition.mjs +2 -1
- package/template/scripts/lib/maintenance-candidate.mjs +24 -30
- package/template/scripts/lib/maintenance-research.mjs +52 -8
- package/template/scripts/lib/maintenance-storage.mjs +81 -0
- package/template/scripts/lib/plan-spec-entry.mjs +2 -1
- package/template/scripts/lib/project-governance.mjs +2 -1
- package/template/scripts/lib/read-only-intake.mjs +44 -9
- package/template/scripts/lib/review-capabilities.mjs +234 -0
- package/template/scripts/lib/review-package.mjs +100 -0
- package/template/scripts/lib/runtime-store.mjs +650 -0
- package/template/scripts/lib/skill-registry.mjs +4 -4
- package/template/scripts/lib/strategic-handoff.mjs +22 -9
- package/template/scripts/lib/task-package.mjs +47 -16
- package/template/scripts/lifecycle-status +26 -1
- package/template/scripts/maintenance-path +11 -0
- package/template/scripts/prepare-review-package +8 -0
- package/template/scripts/project-ci +13 -3
- package/template/scripts/query-lifecycle-context +8 -1
- package/template/scripts/run-read-only-intake +2 -2
- package/template/scripts/runtime-store +40 -0
- package/template/scripts/verify-approval-record +21 -13
- package/template/scripts/verify-lifecycle-checkpoint +7 -3
- package/template/scripts/verify-project-instance +21 -1
- package/template/skills-lock.json +64 -63
- package/template.snapshot.json +4 -4
- package/vendor/cli-core/cli.mjs +2 -0
- package/vendor/cli-core/command-runner.mjs +44 -9
- package/vendor/cli-core/package.json +1 -1
- package/vendor/cli-core/runtime-store.mjs +650 -0
- package/vendor/cli-core/scaffold.mjs +4 -2
|
@@ -254,12 +254,12 @@ function validateFindingDisposition(disposition) {
|
|
|
254
254
|
if (disposition.intensity["product-slice"] !== "slice-contract") fail("产品切片审查强度必须绑定 slice-contract");
|
|
255
255
|
if (disposition.intensity["template-maintenance"] !== "L1-L2-L3") fail("模板维护审查强度必须绑定 L1-L2-L3");
|
|
256
256
|
if (disposition.reviewer_write_implementation !== "forbidden") fail("审查者不得写实现");
|
|
257
|
-
const repair = disposition.
|
|
258
|
-
requireObject(repair, "finding_disposition.
|
|
259
|
-
requireStringSet(repair.kinds, ["violation", "machine_check_failure", "blank_applicable_row", "missing_evidence"], "finding_disposition.
|
|
257
|
+
const repair = disposition.repair_then_targeted_rereview;
|
|
258
|
+
requireObject(repair, "finding_disposition.repair_then_targeted_rereview");
|
|
259
|
+
requireStringSet(repair.kinds, ["violation", "machine_check_failure", "blank_applicable_row", "missing_evidence"], "finding_disposition.repair_then_targeted_rereview.kinds");
|
|
260
260
|
if (repair.actor !== "implementer") fail("violation 类 finding 必须由实现者修复");
|
|
261
261
|
if (repair.on_original_contract !== true) fail("violation 类 finding 必须在原合同允许路径内修复");
|
|
262
|
-
if (repair.then !== "
|
|
262
|
+
if (repair.then !== "compare_diff_map_affected_conclusions_behavior_dependencies_rereview_and_rebind") fail("修复后必须分析差异并定向复审受影响结论、行为及依赖,重绑当前候选");
|
|
263
263
|
const stale = disposition.stale_and_reroute;
|
|
264
264
|
requireObject(stale, "finding_disposition.stale_and_reroute");
|
|
265
265
|
requireStringSet(stale.kinds, ["drift", "new_impacts", "required_skills_mismatch"], "finding_disposition.stale_and_reroute.kinds");
|
|
@@ -8,6 +8,7 @@ import { ensure, canonical, digest, hash, json, parse, read, safe, relative, fil
|
|
|
8
8
|
import { parseContextSource, parseContextContract, resolveContextTermRefs } from './context-contract.mjs';
|
|
9
9
|
import { countersignRuleForGate } from './digital-human-roles.mjs';
|
|
10
10
|
import { validateApprovalRecord } from './approval-record.mjs';
|
|
11
|
+
import {approvalExpectationForBoundAsset} from './approval-consumption.mjs';
|
|
11
12
|
import { treeDigest } from './strategic-handoff-io.mjs';
|
|
12
13
|
import { uiBaselineKind, uiBaselineRef, uiBaselineCaseIds, hasConsumerRoutes, validateHandoffUiBaseline } from './ui-baseline.mjs';
|
|
13
14
|
import { extractTraceability, compareIndexes } from './strategic-handoff-rules.mjs';
|
|
@@ -84,8 +85,18 @@ function validateConsumerRoutes(handoff, stage) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
export async function sourceApproval(record, roles, root) {
|
|
88
|
-
const
|
|
88
|
+
export async function sourceApproval(record, roles, root, currentAssetBinding) {
|
|
89
|
+
const sourceGateIds = [...(roles.gate_policy.biological_human || []), ...(roles.gate_policy.product_digital_human_with_biological_veto || []), ...['dual_digital_human','digital_human_review','check_reviews'].flatMap(key => (roles.gate_policy[key] || []).map(row => row.gate))];
|
|
90
|
+
const options={rolesDoc:roles,registry:{gates:sourceGateIds.map(id=>({id})),id_policy:{deprecated_ids:[]}},requireApproved:true,root,read:ref=>readFileSync(safe(root,path.relative(root,ref).split(path.sep).join('/')))};
|
|
91
|
+
if(record.schema_version===2) {
|
|
92
|
+
// v2 tasks consume the unchanged source policies, never receiver normalization.
|
|
93
|
+
options.rolesDoc=read(safe(root,'.template-spec/agents/digital-human-roles.yaml'));
|
|
94
|
+
options.registry=read(safe(root,'.template-spec/process/lifecycle-registry.yaml'));
|
|
95
|
+
options.skillRegistry=read(safe(root,'.template-spec/agents/yss-skill-registry.yaml'));
|
|
96
|
+
const task=read(safe(root,record.review_task_ref));
|
|
97
|
+
for(const ref of ['.template-spec/process/lifecycle-registry.yaml','.template-spec/agents/yss-skill-registry.yaml']) ensure(task.review_context?.basis?.some(row=>row.ref===ref && row.digest===hash(readFileSync(safe(root,ref))).slice(7)), '源正式审查任务未冻结实际注册表: '+ref);
|
|
98
|
+
roles=options.rolesDoc;
|
|
99
|
+
}
|
|
89
100
|
if (roles.user_decision_policy.gates.includes(record.gate_id)) {
|
|
90
101
|
ensure(existsSync(path.join(ROOT,'scripts/lib/user-decision.mjs')), '接收工具不支持源用户决定策略,请升级工具后验包');
|
|
91
102
|
const { assertApprovalUserDecision } = await import('./user-decision-reuse.mjs');
|
|
@@ -93,7 +104,7 @@ export async function sourceApproval(record, roles, root) {
|
|
|
93
104
|
}
|
|
94
105
|
// Older dedicated receivers retain their own lifecycle policy. Normalize only
|
|
95
106
|
// this already-verified source approval, without granting local capabilities.
|
|
96
|
-
if (record.continuation_ref) {
|
|
107
|
+
if (record.continuation_ref && record.schema_version===1) {
|
|
97
108
|
ensure(roles.user_decision_policy.gates.includes(record.gate_id), '未登记的源延续批准边界');
|
|
98
109
|
const reviewers = roles.gate_policy.continuation_reviews?.[record.gate_id];
|
|
99
110
|
ensure(reviewers?.includes(record.role_id) && record.drafter_principal_ref && record.drafter_principal_ref !== record.principal_ref, '源授权延续缺少独立审查身份');
|
|
@@ -102,7 +113,8 @@ export async function sourceApproval(record, roles, root) {
|
|
|
102
113
|
policy.dual_digital_human = (policy.dual_digital_human || []).filter(x => x.gate !== record.gate_id);
|
|
103
114
|
policy.digital_human_review = [...(policy.digital_human_review || []).filter(x => x.gate !== record.gate_id), { gate: record.gate_id, countersigners: reviewers }];
|
|
104
115
|
}
|
|
105
|
-
|
|
116
|
+
if(!currentAssetBinding)throw new TypeError('APPROVAL_CONTEXT_REQUIRED: 源批准消费需要当前资产引用');
|
|
117
|
+
validateApprovalRecord(record,{...options,expected:approvalExpectationForBoundAsset(record.gate_id,currentAssetBinding,options)});
|
|
106
118
|
}
|
|
107
119
|
|
|
108
120
|
function snapshot(snapshot, source) {
|
|
@@ -188,7 +200,7 @@ export async function inspectSource(root, handoffRef) {
|
|
|
188
200
|
const sourceRoles=read(safe(root,'.template-spec/agents/digital-human-roles.yaml'));
|
|
189
201
|
const roles=sourceApprovalPolicy(sourceRoles);
|
|
190
202
|
for (const [artifact, version, gateId] of [[strategy,strategy.domain_version,'check.domain-strategy-approved'],[stage,stage.package_version,'check.stage-decision-package-approved']]) {
|
|
191
|
-
if(artifact.approval) { const record=sourceApprovalRecord(read(safe(root,artifact.approval.approval_ref)),gateId);await sourceApproval(record,roles,root);ensure(artifact.approval.current_version===version,'资产内置批准版本过期'); }
|
|
203
|
+
if(artifact.approval) { const record=sourceApprovalRecord(read(safe(root,artifact.approval.approval_ref)),gateId);await sourceApproval(record,roles,root,{ref:artifact.approval.persisted_ref,approval_context:artifact.approval.approval_context});ensure(artifact.approval.current_version===version,'资产内置批准版本过期'); }
|
|
192
204
|
}
|
|
193
205
|
// Source packages retain their published approval vocabulary. Never promote old approvals into current checkpoint gates.
|
|
194
206
|
const currentPlan = (roles.gate_policy.dual_digital_human || []).some(rule => rule.gate === 'gate.plan-approved');
|
|
@@ -207,7 +219,7 @@ export async function inspectSource(root, handoffRef) {
|
|
|
207
219
|
ensure(business.spec.ref===specBinding.persisted_ref&&business.spec.version===specBinding.version&&business.spec.digest===hash(readFileSync(safe(root,specBinding.persisted_ref))),'业务集合未绑定当前交接 Spec');
|
|
208
220
|
}
|
|
209
221
|
expectedGates.existing_ui_baseline_ref=expectedGates.prototype_ref;
|
|
210
|
-
const bindings={...handoff.source,handoff:{id:handoff.handoff_id,version:handoff.handoff_version,persisted_ref:handoffRef,status:'approved'}};
|
|
222
|
+
const bindings={...handoff.source,handoff:{id:handoff.handoff_id,version:handoff.handoff_version,persisted_ref:handoffRef,status:'approved',approval_context:config.approvals.handoff?.approval_context}};
|
|
211
223
|
const businessProofRefs=[];
|
|
212
224
|
for(const [key,ref] of Object.entries(bindings)) {
|
|
213
225
|
const approval=config.approvals[key];
|
|
@@ -224,8 +236,8 @@ export async function inspectSource(root, handoffRef) {
|
|
|
224
236
|
} else actual=bytesDigest(readFileSync(safe(root,ref.persisted_ref)),approval.digest_kind);
|
|
225
237
|
if(key!=='handoff')ensure(ref.digest===actual,`源资产摘要过期: ${key}`);
|
|
226
238
|
const record=sourceApprovalRecord(read(safe(root,approval.record_ref)),approval.gate_id);
|
|
227
|
-
if(key==='existing_ui_baseline_ref')ensure(record.subject_ref
|
|
228
|
-
await sourceApproval(record,roles,root);
|
|
239
|
+
if(key==='existing_ui_baseline_ref')ensure(record.subject_ref===(ref.approval_context?.subject_ref || `${ref.persisted_ref}/${ref.manifest_ref}`),'既有 UI 用户决定必须绑定当前 manifest 的独立批准上下文');
|
|
240
|
+
await sourceApproval(record,roles,root,{ref:['visual_baseline_ref','existing_ui_baseline_ref'].includes(key)?`${ref.persisted_ref}/${ref.manifest_ref}`:ref.persisted_ref,approval_context:ref.approval_context});
|
|
229
241
|
businessProofRefs.push(approval.record_ref,record.user_decision_ref,record.continuation_ref,record.decision_reuse_ref);
|
|
230
242
|
ensure(record.gate_id===approval.gate_id,`批准门禁不匹配: ${key}`);
|
|
231
243
|
ensure((record.artifact_bindings || []).some(x=>x.id===(ref.id||ref.baseline_id) && x.version===ref.version && x.digest===actual),`批准记录未绑定当前资产: ${key}`);
|
|
@@ -264,8 +276,9 @@ function collect(root, handoffRef, handoff, config) {
|
|
|
264
276
|
const symbolic=config.reference_map || {};
|
|
265
277
|
const enqueue=ref=> { if(symbolic[ref])queue.push(symbolic[ref]); else if(/^https?:\/\//i.test(ref))return; else if(ref.startsWith('evidence.'))throw new TypeError(`未解析 evidence ID: ${ref}`); else if(ref.includes('/') || /\.(?:md|yaml|json|html|png|txt|log)$/.test(ref))queue.push(ref); };
|
|
266
278
|
function refs(value,key='') {
|
|
279
|
+
if(value?.schema_version===2 && value.review_task_ref) queue.push('.template-spec/process/lifecycle-registry.yaml','.template-spec/agents/yss-skill-registry.yaml');
|
|
267
280
|
if(Array.isArray(value)) { if(key==='evidence_refs') value.forEach(enqueue); else value.forEach(v=>refs(v,key)); }
|
|
268
|
-
else if(value && typeof value==='object') for(const [k,v]of Object.entries(value)) { if(['approval_ref','persisted_ref','user_decision_ref','decision_reuse_ref','continuation_ref','plan_continuation_ref','scope_ref','subject_ref','delivery_ref','review_ref'].includes(k)&&typeof v==='string')enqueue(v); else if(k==='ref'&&typeof v==='string'&&!/^[a-z]+:\/\//i.test(v))enqueue(v); else refs(v,k); }
|
|
281
|
+
else if(value && typeof value==='object') for(const [k,v]of Object.entries(value)) { if(['review_task_ref','policy_ref','candidate_ref','registry_ref','approval_ref','persisted_ref','user_decision_ref','decision_reuse_ref','continuation_ref','plan_continuation_ref','scope_ref','subject_ref','delivery_ref','review_ref'].includes(k)&&typeof v==='string')enqueue(v); else if(k==='ref'&&typeof v==='string'&&!/^[a-z]+:\/\//i.test(v))enqueue(v); else refs(v,k); }
|
|
269
282
|
}
|
|
270
283
|
let totalBytes = 0;
|
|
271
284
|
while(queue.length) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { compileWorkUnitReviewCapabilities, compileReviewCapabilities, validateReviewTaskBinding } from './review-capabilities.mjs';
|
|
1
2
|
import { validateReadOnlyIntake } from './read-only-intake.mjs';
|
|
2
3
|
import { parseAsset } from './structured-assets.mjs';
|
|
3
4
|
import { assertAssetTransactionIdle } from './asset-transactions.mjs';
|
|
@@ -6,6 +7,7 @@ import { normalizeSliceContract } from './slice-contract.mjs';
|
|
|
6
7
|
import { assertSliceV3TaskPackage } from './slice-task-package.mjs';
|
|
7
8
|
export { compileSliceTaskPackage, assertSliceV3TaskPackage } from './slice-task-package.mjs';
|
|
8
9
|
import { existsSync, readFileSync } from "node:fs";
|
|
10
|
+
import { resolveMaintenanceOutput, resolveMaintenanceReference } from "./maintenance-storage.mjs";
|
|
9
11
|
import path from "node:path";
|
|
10
12
|
import { parseDocument } from "../vendor/yaml.mjs";
|
|
11
13
|
import { loadDigitalHumanRoles, taskPackageDefaults } from "./digital-human-roles.mjs";
|
|
@@ -39,8 +41,12 @@ function parseYaml(source, label) {
|
|
|
39
41
|
return document.toJS({ maxAliasCount: 0 });
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
function assertSafeRelativePath(value, field) {
|
|
44
|
+
function assertSafeRelativePath(value, field, { maintenance = false } = {}) {
|
|
43
45
|
requireString(value, field);
|
|
46
|
+
if (value.startsWith("maintenance:")) {
|
|
47
|
+
if (!maintenance) fail("maintenance 引用仅适用于 template-maintenance 合同");
|
|
48
|
+
return resolveMaintenanceOutput(value, { root: ROOT });
|
|
49
|
+
}
|
|
44
50
|
if (path.isAbsolute(value)) fail(`${field} 必须是仓库相对路径`);
|
|
45
51
|
const resolved = path.resolve(ROOT, value);
|
|
46
52
|
const relative = path.relative(ROOT, resolved);
|
|
@@ -48,8 +54,13 @@ function assertSafeRelativePath(value, field) {
|
|
|
48
54
|
return resolved;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
|
-
function assertReadableEvidenceRef(value, field) {
|
|
57
|
+
function assertReadableEvidenceRef(value, field, { maintenance = false, digest } = {}) {
|
|
52
58
|
requireString(value, field);
|
|
59
|
+
if (value.startsWith("maintenance:")) {
|
|
60
|
+
if (!maintenance) fail("maintenance 引用仅适用于 template-maintenance 合同");
|
|
61
|
+
resolveMaintenanceReference(value, { root: ROOT, digest });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
53
64
|
if (/^https?:\/\//.test(value)) return;
|
|
54
65
|
const evidencePath = assertSafeRelativePath(value, field);
|
|
55
66
|
if (!existsSync(evidencePath)) fail(`${field} 不可读: ${value}`);
|
|
@@ -69,9 +80,18 @@ function validateSkillSource(value, registry) {
|
|
|
69
80
|
if (value.skill_source.defaults_ref !== `taskPackageDefaults(${value.role_id})`) fail(`skill_source.defaults_ref 必须为 taskPackageDefaults(${value.role_id})`);
|
|
70
81
|
if (!equalArrays(value.skill_source.core_skills, defaults.core_skills)) fail("skill_source.core_skills 必须与角色注册表完全一致");
|
|
71
82
|
if (!equalArrays(value.skill_source.forbidden_skills, defaults.forbidden_skills)) fail("skill_source.forbidden_skills 必须与角色注册表完全一致");
|
|
83
|
+
if (value.skill_source.review_skills !== undefined || value.review_context?.capability_ids) {
|
|
84
|
+
const compiled = value.review_context?.capability_ids
|
|
85
|
+
? compileReviewCapabilities({ checkIds:value.review_context.check_ids,roleId:value.role_id,executionState:value.execution_state,rolesDoc:registry })
|
|
86
|
+
: compileWorkUnitReviewCapabilities({workUnitId:value.work_unit_id,roleId:value.role_id,executionState:value.execution_state,rolesDoc:registry});
|
|
87
|
+
if (!equalArrays(value.skill_source.review_skills, compiled.review_skills)) fail("skill_source.review_skills 必须由权威能力政策编译");
|
|
88
|
+
}
|
|
72
89
|
}
|
|
73
90
|
|
|
74
91
|
function validateCommon(value, registry, lifecycle) {
|
|
92
|
+
const maintenance = value.contract.kind === "template-maintenance";
|
|
93
|
+
const safe = (ref, field) => assertSafeRelativePath(ref, field, { maintenance });
|
|
94
|
+
const readable = (ref, field, digest) => assertReadableEvidenceRef(ref, field, { maintenance, digest });
|
|
75
95
|
if (value.allowed_write_paths?.length && value.contract.kind === "lifecycle-work-unit") assertTrackingEntry(value.work_unit_id, value, { root: ROOT });
|
|
76
96
|
if (value.work_unit_id === 'work-unit.spec-synthesis') assertPlanSpecEntry(value);
|
|
77
97
|
const workUnit = lifecycle.work_units.find((item) => item.id === value.work_unit_id);
|
|
@@ -83,15 +103,20 @@ function validateCommon(value, registry, lifecycle) {
|
|
|
83
103
|
if (!WORKFLOW_STATUSES.has(value.workflow_status)) fail(`workflow_status 无效: ${value.workflow_status}`);
|
|
84
104
|
if (value.stage_id) {
|
|
85
105
|
if (!lifecycle.stages.some((stage) => stage.id === value.stage_id)) fail(`未知 stage_id: ${value.stage_id}`);
|
|
86
|
-
|
|
106
|
+
const reviewStages = value.review_context?.capability_ids
|
|
107
|
+
? compileReviewCapabilities({ checkIds: value.review_context.check_ids, roleId: value.role_id, executionState: value.execution_state, rolesDoc: registry, registry: lifecycle }).review_stages
|
|
108
|
+
: roleDefaults.stages;
|
|
109
|
+
if (!reviewStages.includes(value.stage_id)) fail(`role_id 未覆盖 stage_id: ${value.role_id} -> ${value.stage_id}`);
|
|
87
110
|
}
|
|
88
111
|
validateSkillSource(value, registry);
|
|
89
|
-
|
|
112
|
+
if (value.review_context?.capability_ids) validateReviewTaskBinding(value, { rolesDoc: registry, registry: lifecycle, root: ROOT });
|
|
113
|
+
for (const allowed of value.allowed_write_paths) safe(allowed, "allowed_write_paths 条目");
|
|
90
114
|
if (value.execution_state === "Reviewer" && value.review_context.implementation_actor_id === value.actor_id) fail("Reviewer 必须与实现者使用不同 actor_id");
|
|
91
115
|
const commands = new Set(value.verification_commands);
|
|
92
116
|
for (const result of value.verification_results) {
|
|
93
117
|
if (!commands.has(result.command)) fail(`verification_results 命令未声明: ${result.command}`);
|
|
94
|
-
|
|
118
|
+
if (result.evidence_ref.startsWith('maintenance:') && !result.evidence_digest) fail('仓外维护证据必须绑定 evidence_digest');
|
|
119
|
+
readable(result.evidence_ref, "verification_results.evidence_ref", result.evidence_digest);
|
|
95
120
|
}
|
|
96
121
|
const completed = value.workflow_status === "resolved" || value.result?.result === "completed";
|
|
97
122
|
if (completed) {
|
|
@@ -105,12 +130,12 @@ function validateCommon(value, registry, lifecycle) {
|
|
|
105
130
|
const reconciliation = value.result.context_reconciliation;
|
|
106
131
|
const expectedReconciliationStatus = value.contract.kind === "template-maintenance" ? "not-applicable" : "reconciled";
|
|
107
132
|
if (reconciliation?.status !== expectedReconciliationStatus) fail(`result=completed 时 context_reconciliation.status 必须为 ${expectedReconciliationStatus}`);
|
|
108
|
-
|
|
133
|
+
readable(reconciliation.ref, "context_reconciliation.ref");
|
|
109
134
|
if (!value.result.evidence_refs.includes(reconciliation.ref)) fail("context_reconciliation.ref 必须包含在 result.evidence_refs 中");
|
|
110
135
|
if (expectedReconciliationStatus === "not-applicable" && !reconciliation.reason) fail("template-maintenance 的 context_reconciliation 必须说明 reason");
|
|
111
136
|
const routeResult = validateNextRoute(value.result.work_unit, value.result.next_route, value.result);
|
|
112
137
|
if (routeResult.result !== "allowed") fail(`Workflow Execution Result next_route 非法: ${routeResult.blocking_signals.join(", ")}`);
|
|
113
|
-
value.expected_evidence_files.forEach((ref) =>
|
|
138
|
+
value.expected_evidence_files.forEach((ref) => readable(ref, "expected_evidence_files"));
|
|
114
139
|
if (value.verification_results.length === 0) fail("已完成任务必须包含 verification_results");
|
|
115
140
|
if (value.verification_results.some((result) => result.exit_code !== 0)) fail("已完成任务的验证命令必须全部成功");
|
|
116
141
|
const resultCommands = new Set(value.verification_results.map((result) => result.command));
|
|
@@ -122,13 +147,13 @@ function validateCommon(value, registry, lifecycle) {
|
|
|
122
147
|
}
|
|
123
148
|
if (value.result.result === "completed") {
|
|
124
149
|
if (!Array.isArray(value.result.evidence_refs) || value.result.evidence_refs.length === 0) fail("result=completed 时 evidence_refs 不能为空");
|
|
125
|
-
value.result.evidence_refs.forEach((ref) =>
|
|
150
|
+
value.result.evidence_refs.forEach((ref) => readable(ref, "result.evidence_refs"));
|
|
126
151
|
}
|
|
127
152
|
if (Array.isArray(value.result.changed_files)) {
|
|
128
153
|
for (const changed of value.result.changed_files) {
|
|
129
|
-
const changedPath =
|
|
154
|
+
const changedPath = safe(changed, "changed_files 条目");
|
|
130
155
|
if (!value.allowed_write_paths.some((allowed) => {
|
|
131
|
-
const allowedPath =
|
|
156
|
+
const allowedPath = safe(allowed, "allowed_write_paths 条目");
|
|
132
157
|
const relative = path.relative(allowedPath, changedPath);
|
|
133
158
|
return relative === "" || (relative !== ".." && !relative.startsWith(`..${path.sep}`));
|
|
134
159
|
})) fail(`changed_files 超出 allowed_write_paths: ${changed}`);
|
|
@@ -145,7 +170,7 @@ function validateContract(value, registry, lifecycle, { history = false } = {})
|
|
|
145
170
|
if (!CONTRACT_KINDS.has(contract.kind)) fail(`未知 contract.kind: ${contract.kind}`);
|
|
146
171
|
if (!new Set(["issued", "stale", "blocked"]).has(contract.status)) fail(`contract.status 无效: ${contract.status}`);
|
|
147
172
|
if (contract.status === "stale" && value.workflow_status !== "paused") fail("stale 任务包必须暂停,待主控重新路由");
|
|
148
|
-
assertReadableEvidenceRef(contract.contract_ref, "contract.contract_ref");
|
|
173
|
+
assertReadableEvidenceRef(contract.contract_ref, "contract.contract_ref", { maintenance: contract.kind === "template-maintenance" });
|
|
149
174
|
if (contract.kind === "lifecycle-work-unit") {
|
|
150
175
|
if (value.work_unit_id === implementationWorkUnit || value.convergence.parent_work_unit === implementationWorkUnit) {
|
|
151
176
|
fail("lifecycle-work-unit 不得冒充垂直切片实现任务;实现任务必须使用 slice-implementation");
|
|
@@ -158,9 +183,9 @@ function validateContract(value, registry, lifecycle, { history = false } = {})
|
|
|
158
183
|
if (contract.kind === "template-maintenance") {
|
|
159
184
|
if (!maintenanceValidators) fail("project-instance 不支持 template-maintenance 任务包");
|
|
160
185
|
if (contract.slice_contract_ref || contract.lifecycle_ref) fail("template-maintenance 不得携带其他合同引用");
|
|
161
|
-
const checkpointPath = assertSafeRelativePath(contract.maintenance_ref, "contract.maintenance_ref");
|
|
186
|
+
const checkpointPath = assertSafeRelativePath(contract.maintenance_ref, "contract.maintenance_ref", { maintenance: true });
|
|
162
187
|
if (!existsSync(checkpointPath)) fail(`维护 checkpoint 不存在: ${contract.maintenance_ref}`);
|
|
163
|
-
const checkpoint = maintenanceValidators.loadMaintenanceCheckpoint(
|
|
188
|
+
const checkpoint = maintenanceValidators.loadMaintenanceCheckpoint(checkpointPath);
|
|
164
189
|
maintenanceValidators.validateMaintenanceCheckpoint(checkpoint, {
|
|
165
190
|
history,
|
|
166
191
|
allowPendingReview: value.execution_state === "Reviewer" && value.workflow_status !== "resolved"
|
|
@@ -174,7 +199,7 @@ function validateContract(value, registry, lifecycle, { history = false } = {})
|
|
|
174
199
|
if (contract.candidate_digest !== checkpoint.candidate_digest) fail("Reviewer 任务包 candidate_digest 与 checkpoint 不一致");
|
|
175
200
|
if (contract.review_round !== checkpoint.review_round) fail("Reviewer 任务包 review_round 与 checkpoint 不一致");
|
|
176
201
|
if (!value.allowed_read_paths.includes(contract.maintenance_ref)) fail("allowed_read_paths 必须包含 maintenance_ref");
|
|
177
|
-
value.allowed_read_paths.forEach((ref) => assertReadableEvidenceRef(ref, "allowed_read_paths 条目"));
|
|
202
|
+
value.allowed_read_paths.forEach((ref) => assertReadableEvidenceRef(ref, "allowed_read_paths 条目", { maintenance: true }));
|
|
178
203
|
contract.applicable_rule_refs.forEach((ref) => assertReadableEvidenceRef(ref, "applicable_rule_refs 条目"));
|
|
179
204
|
}
|
|
180
205
|
if (lifecycle.work_units.find((item) => item.id === value.work_unit_id)?.scope !== "template-source") fail("template-maintenance 必须绑定 template-source work unit");
|
|
@@ -239,7 +264,12 @@ export function validateHistoricalMaintenanceTaskPackage(value) {
|
|
|
239
264
|
}
|
|
240
265
|
|
|
241
266
|
export function generateTaskPackageDefaults(roleId, overrides = {}, { rolesDoc } = {}) {
|
|
242
|
-
const
|
|
267
|
+
const registry = rolesDoc || loadDigitalHumanRoles();
|
|
268
|
+
const defaults = taskPackageDefaults(roleId, registry);
|
|
269
|
+
const review = overrides.review_context?.capability_ids
|
|
270
|
+
? compileReviewCapabilities({ checkIds: overrides.review_context.check_ids, roleId, executionState: overrides.execution_state, rolesDoc: registry })
|
|
271
|
+
: ["Reviewer","Verifier"].includes(overrides.execution_state) && registry.gate_policy.digital_human_review_work_units?.some(row=>row.work_unit===overrides.work_unit_id)
|
|
272
|
+
? compileWorkUnitReviewCapabilities({workUnitId:overrides.work_unit_id,roleId,executionState:overrides.execution_state,rolesDoc:registry}) : null;
|
|
243
273
|
return {
|
|
244
274
|
schema_version: 1,
|
|
245
275
|
role_id: defaults.role_id,
|
|
@@ -247,7 +277,8 @@ export function generateTaskPackageDefaults(roleId, overrides = {}, { rolesDoc }
|
|
|
247
277
|
registry_ref: TASK_PACKAGE_REGISTRY_REF,
|
|
248
278
|
defaults_ref: `taskPackageDefaults(${roleId})`,
|
|
249
279
|
core_skills: defaults.core_skills,
|
|
250
|
-
forbidden_skills: defaults.forbidden_skills
|
|
280
|
+
forbidden_skills: defaults.forbidden_skills,
|
|
281
|
+
...(review ? { review_skills: review.review_skills } : {})
|
|
251
282
|
},
|
|
252
283
|
...overrides
|
|
253
284
|
};
|
|
@@ -5,8 +5,10 @@ import { checkProjectGovernance } from './lib/project-governance.mjs';
|
|
|
5
5
|
import { lifecycleStatus } from './lib/lifecycle-status.mjs';
|
|
6
6
|
import { renderLifecycleStatus } from './lib/lifecycle-presentation.mjs';
|
|
7
7
|
|
|
8
|
+
let parsedValues;
|
|
8
9
|
try {
|
|
9
10
|
const { values } = parseArgs({ strict: true, options: { root: { type: 'string' }, checkpoint: { type: 'string' }, task: {type: 'string'}, preflight: {type:'boolean'}, help:{type:'boolean'}, format: {type:'string', default:'json'} } });
|
|
11
|
+
parsedValues = values;
|
|
10
12
|
if (!['json', 'text'].includes(values.format)) throw Error('--format 仅支持 json 或 text');
|
|
11
13
|
if (values.preflight && values.format === 'text') throw Error('--preflight 使用 JSON 诊断;中文状态阅读请单独调用 --format text');
|
|
12
14
|
if(values.help)process.stdout.write('用法: scripts/lifecycle-status --root <项目> [--checkpoint <根相对路径>] [--task <任务包>] [--preflight] [--format json|text]\n普通查询不执行预检;--preflight 复验当前证据,仅提供恢复动作,不批准或派发。普通查询退出码保持 0/1;预检 0=通过、1=失败、2=输入或能力异常。\n');
|
|
@@ -20,7 +22,30 @@ try {
|
|
|
20
22
|
if (result.blockers.length) process.exitCode = 1;
|
|
21
23
|
}
|
|
22
24
|
} catch (error) {
|
|
23
|
-
|
|
25
|
+
const failure = { schema_version: 1, read_only: true, blockers: [error.message], owner: '未登记', next_action: `核查状态输入:${error.message}`, execution_authorization: 'not-evaluated', verification_scope: [{ id: 'status-input', status: 'failed', refs: [], reason: error.message }], diagnostics: [{ code: 'status-input-invalid', severity: 'error', message: error.message, source_ref: null, owner: '未登记', recovery: '修复输入后重新读取状态' }], next_step: { action_type: 'repair', command: null, input_refs: [], prerequisites: ['提供有效项目根和 checkpoint 引用'] } };
|
|
26
|
+
if (parsedValues?.format === 'text' && !parsedValues.preflight) {
|
|
27
|
+
const sourceRef = error.lifecycle_input_ref ?? parsedValues.checkpoint ?? null;
|
|
28
|
+
const templateSource = error.lifecycle_input_kind === 'template-source';
|
|
29
|
+
const manifestFailure = error.lifecycle_input_kind === 'manifest' || sourceRef === 'yss-project.yaml';
|
|
30
|
+
const missingInput = error.message === 'root and checkpoint are required';
|
|
31
|
+
const problem = templateSource ? '当前为 template-source 模板源仓库,产品生命周期状态查询不适用'
|
|
32
|
+
: manifestFailure ? `仓库身份输入无法核验:${error.message}`
|
|
33
|
+
: missingInput ? '缺少项目根或 checkpoint 引用,当前阶段无法核验'
|
|
34
|
+
: `状态输入无法核验:${error.message}`;
|
|
35
|
+
const recovery = templateSource ? '按 maintaining-skills 和维护强度合同走模板维护路由;不得更改真实仓库身份以绕过限制'
|
|
36
|
+
: manifestFailure ? '先核对 yss-project.yaml 的真实内容、schema 和 repository_mode;文件缺失、损坏或不支持时进入迁移检查,不猜测或伪造身份'
|
|
37
|
+
: missingInput ? '提供真实项目根及根相对 checkpoint 引用;核对来源后重新查询'
|
|
38
|
+
: '核对已标明的状态来源、路径和原始内容,恢复可读的真实输入并执行适用预检,再重新查询';
|
|
39
|
+
process.stdout.write(renderLifecycleStatus({presentation: {
|
|
40
|
+
stage: '待核验', checkpoint_status: '查询失败', next_stage: '待核验', next_stage_reason: '当前输入不可核验,不推断下一阶段、已完成或可进入',
|
|
41
|
+
blockers: [problem], owner: '未登记', work_unit: '待核验', expected_output: null, next_action: recovery, warnings: [],
|
|
42
|
+
issues: [{severity: 'error', message: problem, source_ref: sourceRef, owner: '未登记', owner_scope: 'not-recorded', recovery}],
|
|
43
|
+
pending_verification: [{reason: '仓库身份、当前阶段、来源和问题责任方尚未核验'}],
|
|
44
|
+
continue_conditions: ['真实身份与状态输入可读,并通过适用预检后,由主控重新核验范围与授权并决定路由'],
|
|
45
|
+
}}));
|
|
46
|
+
} else {
|
|
47
|
+
process.stdout.write(`${JSON.stringify(failure, null, 2)}\n`);
|
|
48
|
+
}
|
|
24
49
|
process.exitCode = process.argv.includes('--preflight') ? 2 : 1;
|
|
25
50
|
}
|
|
26
51
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolveMaintenanceOutput } from './lib/maintenance-storage.mjs';
|
|
3
|
+
import { ROOT } from './lib/template-verification.mjs';
|
|
4
|
+
try {
|
|
5
|
+
const [relative] = process.argv.slice(2);
|
|
6
|
+
if (!relative) throw new TypeError('用法: scripts/maintenance-path <类别/运行ID/文件>');
|
|
7
|
+
process.stdout.write(resolveMaintenanceOutput(`maintenance:${relative}`, { root: ROOT }) + '\n');
|
|
8
|
+
} catch (error) {
|
|
9
|
+
process.stderr.write(`维护路径错误: ${error.message}\n`);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { prepareReviewPackage } from './lib/review-package.mjs';
|
|
4
|
+
try {
|
|
5
|
+
const { values } = parseArgs({ options: { root: { type: 'string' }, checkpoint: { type: 'string' }, check: { type: 'string', multiple: true }, role: { type: 'string' }, runtime: { type: 'string', default: 'runtime.generic' }, actor: { type: 'string' }, 'reviewer-principal': { type: 'string' }, 'drafter-principal': { type: 'string' }, 'implementation-actor': { type: 'string' }, 'task-id': { type: 'string' }, 'review-session': { type: 'string' }, 'work-unit': { type: 'string' }, 'output-dir': { type: 'string' }, 'previous-subject': { type: 'string' } }, strict: true });
|
|
6
|
+
const result = prepareReviewPackage({ root: values.root, checkpointRef: values.checkpoint, checkIds: values.check, roleId: values.role, runtimeId: values.runtime, actorId: values.actor, reviewerPrincipalRef: values['reviewer-principal'], drafterPrincipalRef: values['drafter-principal'], implementationActorId: values['implementation-actor'], taskId: values['task-id'], reviewSessionId: values['review-session'], workUnitId: values['work-unit'], outputDir: values['output-dir'], previousSubjectRef: values['previous-subject'] });
|
|
7
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
8
|
+
} catch (error) { process.stderr.write(`审阅包草案生成失败: ${error.message}\n`); process.exitCode = 1; }
|
|
@@ -4,16 +4,26 @@ import path from 'node:path';
|
|
|
4
4
|
import { parseArgs } from 'node:util';
|
|
5
5
|
import { planProjectCi, applyProjectCi } from './lib/project-ci-install.mjs';
|
|
6
6
|
import { checkProjectGovernance } from './lib/project-governance.mjs';
|
|
7
|
+
import { assertNodeVersion, beginRuntimeRun } from './lib/runtime-store.mjs';
|
|
7
8
|
|
|
8
9
|
try {
|
|
9
|
-
const {values,positionals}=parseArgs({allowPositionals:true,options:{root:{type:'string',default:'.'},provider:{type:'string',default:'github'},branch:{type:'string'},plan:{type:'string'},'additional-path':{type:'string',multiple:true},base:{type:'string'},recover:{type:'boolean'},json:{type:'boolean'},help:{type:'boolean'}}});
|
|
10
|
-
if(values.help){process.stdout.write('用法: scripts/project-ci plan --provider github --root <项目> [--branch main] [--additional-path <根相对路径>]\n scripts/project-ci apply --root <项目> --plan <plan.json>\n scripts/project-ci apply --root <项目> --recover\n scripts/project-ci check --root <项目> [--base <40位commit>] --json\nplan/check 只读,apply 仅显式管理自身工作流;不改远端或批准。退出码 0=通过/计划完成,1=检查失败/冲突,2=输入/能力/执行异常。\n');}
|
|
10
|
+
const {values,positionals}=parseArgs({allowPositionals:true,options:{root:{type:'string',default:'.'},provider:{type:'string',default:'github'},branch:{type:'string'},plan:{type:'string'},'additional-path':{type:'string',multiple:true},base:{type:'string'},recover:{type:'boolean'},json:{type:'boolean'},help:{type:'boolean'},'runtime-store':{type:'string',default:'off'}}});
|
|
11
|
+
if(values.help){process.stdout.write('用法: scripts/project-ci plan --provider github --root <项目> [--branch main] [--additional-path <根相对路径>]\n scripts/project-ci apply --root <项目> --plan <plan.json>\n scripts/project-ci apply --root <项目> --recover\n scripts/project-ci check --root <项目> [--base <40位commit>] [--runtime-store sqlite|off] --json\nplan/check 只读,apply 仅显式管理自身工作流;不改远端或批准。退出码 0=通过/计划完成,1=检查失败/冲突,2=输入/能力/执行异常。\n');}
|
|
11
12
|
else {
|
|
12
13
|
if(positionals.length!==1||!['plan','apply','check'].includes(positionals[0]))throw new Error('需要 plan、apply 或 check;参见 --help');
|
|
14
|
+
assertNodeVersion();
|
|
15
|
+
if(!['sqlite','off'].includes(values['runtime-store']))throw new Error('runtime-store 必须为 sqlite 或 off');
|
|
13
16
|
const root=path.resolve(values.root);let result;
|
|
14
17
|
if(positionals[0]==='plan'){result=planProjectCi({root,provider:values.provider,branch:values.branch,additionalPaths:values['additional-path']});if(result.conflicts.length)process.exitCode=1;}
|
|
15
18
|
if(positionals[0]==='apply'){if(!values.recover&&!values.plan)throw new Error('apply 需要 --plan');result=applyProjectCi({root,recover:values.recover,plan:values.plan?JSON.parse(fs.readFileSync(values.plan,'utf8')):undefined});}
|
|
16
|
-
if(positionals[0]==='check'){
|
|
19
|
+
if(positionals[0]==='check'){
|
|
20
|
+
const session=beginRuntimeRun({root,kind:'project-ci-check',mode:values['runtime-store'],input:{base:values.base||null}});
|
|
21
|
+
try {
|
|
22
|
+
const started=performance.now(),check=checkProjectGovernance({root,base:values.base});result=check.report;process.exitCode=check.exitCode;
|
|
23
|
+
if(session)try { session.recordCommand({command:'project-ci check',exit_code:check.exitCode,duration_ms:Math.round(performance.now()-started)});session.finish({status:check.exitCode===0?'passed':'failed',exitCode:check.exitCode,report:result}); }
|
|
24
|
+
catch(error){process.stderr.write(`运行存储异常,原检查退出码=${check.exitCode}: ${error.message}\n`);}
|
|
25
|
+
}finally{session?.close();}
|
|
26
|
+
}
|
|
17
27
|
process.stdout.write(JSON.stringify(result,null,2)+'\n');
|
|
18
28
|
}
|
|
19
29
|
}catch(error){process.stdout.write(JSON.stringify({schema_version:1,status:'error',read_only:process.argv[2]!=='apply',error:error.message})+'\n');process.stderr.write(error.message+'\n');process.exitCode=error.exitCode||2;}
|
|
@@ -10,18 +10,25 @@ try {
|
|
|
10
10
|
stage: { type: "string" },
|
|
11
11
|
"work-unit": { type: "string" },
|
|
12
12
|
include: { type: "string", multiple: true },
|
|
13
|
+
"check-skills": { type: "boolean" },
|
|
14
|
+
"agent-runtime": { type: "string" },
|
|
15
|
+
when: { type: "string", multiple: true },
|
|
13
16
|
},
|
|
14
17
|
strict: true,
|
|
15
18
|
});
|
|
16
|
-
if(values.help)process.stdout.write('用法: scripts/query-lifecycle-context [--mode route] [--stage stage.plan] [--work-unit work-unit.plan-opportunity] [--include <资产>]\n只读查询,不证明批准;退出码 0
|
|
19
|
+
if(values.help)process.stdout.write('用法: scripts/query-lifecycle-context [--mode route] [--stage stage.plan] [--work-unit work-unit.plan-opportunity] [--include <资产>] [--check-skills [--agent-runtime codex|cursor|pi] [--when <条件>]]\n只读查询,不证明批准;退出码 0=查询完成(启用技能预检时表示技能可用)、1=输入或执行失败、2=启用预检且技能未就绪。\n');
|
|
17
20
|
else {
|
|
18
21
|
const result = queryLifecycleContext({
|
|
19
22
|
mode: values.mode,
|
|
20
23
|
stageId: values.stage,
|
|
21
24
|
workUnitId: values["work-unit"],
|
|
22
25
|
include: values.include ?? [],
|
|
26
|
+
checkSkills: values["check-skills"] ?? false,
|
|
27
|
+
agentRuntime: values["agent-runtime"],
|
|
28
|
+
when: values.when ?? [],
|
|
23
29
|
});
|
|
24
30
|
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
31
|
+
if (result.skill_readiness && result.skill_readiness.status !== 'ready') process.exitCode = 2;
|
|
25
32
|
}
|
|
26
33
|
} catch (error) {
|
|
27
34
|
process.stderr.write(`${error.message}\n`);
|
|
@@ -4,11 +4,11 @@ import { ROOT } from './lib/lifecycle-registry.mjs';
|
|
|
4
4
|
import { loadTaskPackage, validateTaskPackage } from './lib/task-package.mjs';
|
|
5
5
|
import { observeReadOnlyIntake } from './lib/read-only-intake.mjs';
|
|
6
6
|
try {
|
|
7
|
-
const {values,positionals} = parseArgs({options:{task:{type:'string'},'run-dir':{type:'string'},'timeout-ms':{type:'string',default:'0'}},allowPositionals:true});
|
|
7
|
+
const {values,positionals} = parseArgs({options:{task:{type:'string'},'run-dir':{type:'string'},'timeout-ms':{type:'string',default:'0'},'runtime-store':{type:'string',default:'off'}},allowPositionals:true});
|
|
8
8
|
if(!values.task||!values['run-dir'])throw Error('需要 --task 和仓库外新目录 --run-dir;命令放在 -- 之后');
|
|
9
9
|
const {value}=loadTaskPackage(values.task);validateTaskPackage(value);
|
|
10
10
|
if(value.schema_version!==2||value.workflow_status!=='active')throw Error('只接受 active 的只读 v2 任务');
|
|
11
|
-
const result=await observeReadOnlyIntake(value,{root:ROOT,runDir:values['run-dir'],command:positionals[0],args:positionals.slice(1),timeoutMs:Number(values['timeout-ms'])});
|
|
11
|
+
const result=await observeReadOnlyIntake(value,{root:ROOT,runDir:values['run-dir'],command:positionals[0],args:positionals.slice(1),timeoutMs:Number(values['timeout-ms']),runtimeStore:values['runtime-store']});
|
|
12
12
|
validateTaskPackage(result,{runDir:values['run-dir']});
|
|
13
13
|
process.stdout.write(JSON.stringify(result,null,2)+'\n');if(result.workflow_status!=='resolved')process.exitCode=1;
|
|
14
14
|
}catch(error){process.stderr.write(error.message+'\n');process.exitCode=1;}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { parseArgs } from 'node:util';
|
|
5
|
+
import { RuntimeStore, assertNodeVersion, inspectRuntimeBundle } from './lib/runtime-store.mjs';
|
|
6
|
+
|
|
7
|
+
let store;
|
|
8
|
+
try {
|
|
9
|
+
const { values, positionals } = parseArgs({ allowPositionals: true, options: {
|
|
10
|
+
root: { type: 'string', default: '.' }, home: { type: 'string' }, run: { type: 'string' },
|
|
11
|
+
output: { type: 'string' }, source: { type: 'string' }, plan: { type: 'string' },
|
|
12
|
+
now: { type: 'string' }, json: { type: 'boolean' }, help: { type: 'boolean' },
|
|
13
|
+
'protected-root': { type: 'string', multiple: true },
|
|
14
|
+
} });
|
|
15
|
+
assertNodeVersion();
|
|
16
|
+
if (values.help) process.stdout.write('用法: scripts/runtime-store <inspect|inventory|export|plan-gc|apply-gc|backup|restore> --root <项目> [--home <仓外绝对目录>]\nexport --run <id> --output <新目录>\nplan-gc [--now <ISO时间>] > <仓外plan.json>\napply-gc --plan <plan.json>\nbackup --output <新目录>\nrestore --source <备份目录>\n查询只读;清理仅执行显式计划;正式文件仍为权威。\n');
|
|
17
|
+
else {
|
|
18
|
+
const action = positionals[0];
|
|
19
|
+
if (positionals.length !== 1 || !['inspect', 'inventory', 'export', 'plan-gc', 'apply-gc', 'backup', 'restore'].includes(action)) throw new Error('需要有效管理动作;参见--help');
|
|
20
|
+
const options = { root: path.resolve(values.root), home: values.home, protectedRoots: values['protected-root'] };
|
|
21
|
+
let result;
|
|
22
|
+
if (action === 'inspect' && values.source) result = inspectRuntimeBundle(values.source);
|
|
23
|
+
else if (action === 'restore') {
|
|
24
|
+
if (!values.source) throw new Error('restore需要--source');
|
|
25
|
+
result = RuntimeStore.restore({ ...options, source: path.resolve(values.source) });
|
|
26
|
+
} else {
|
|
27
|
+
store = new RuntimeStore({ ...options, readOnly: ['inspect', 'inventory', 'plan-gc', 'backup'].includes(action), existingOnly: ['export', 'apply-gc'].includes(action) });
|
|
28
|
+
const now = values.now === undefined ? Date.now() : Date.parse(values.now);
|
|
29
|
+
if (!Number.isFinite(now)) throw new Error('--now时间非法');
|
|
30
|
+
if (action === 'inspect') result = store.inspect({ now });
|
|
31
|
+
if (action === 'inventory') result = store.inventory();
|
|
32
|
+
if (action === 'plan-gc') result = store.planGc({ now });
|
|
33
|
+
if (action === 'apply-gc') { if (!values.plan) throw new Error('apply-gc需要--plan'); result = store.applyGc(JSON.parse(fs.readFileSync(values.plan, 'utf8'))); }
|
|
34
|
+
if (action === 'export') { if (!values.run || !values.output) throw new Error('export需要--run和--output'); result = store.exportRun(values.run, values.output); }
|
|
35
|
+
if (action === 'backup') { if (!values.output) throw new Error('backup需要--output'); result = store.backup(values.output); }
|
|
36
|
+
}
|
|
37
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
38
|
+
}
|
|
39
|
+
} catch (error) { process.stderr.write(error.message + '\n'); process.exitCode = 2; }
|
|
40
|
+
finally { store?.close(); }
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import {parseArgs} from 'node:util';
|
|
4
|
+
import {ROOT} from './lib/lifecycle-registry.mjs';
|
|
5
|
+
import {withValidationPhase} from './lib/validation-phase.mjs';
|
|
6
|
+
import {approvalIO} from './lib/approval-record-io.mjs';
|
|
7
|
+
import {validateAssetStructure} from './lib/structured-assets.mjs';
|
|
8
|
+
import {validateApprovalRecordFile} from './lib/approval-record.mjs';
|
|
5
9
|
try {
|
|
6
|
-
const {
|
|
7
|
-
if(values.help)process.stdout.write(
|
|
10
|
+
const {positionals,values}=parseArgs({allowPositionals:true,strict:true,options:{help:{type:'boolean'},'require-approved':{type:'boolean'},history:{type:'boolean'},checkpoint:{type:'string'},root:{type:'string'}}});
|
|
11
|
+
if(values.help) process.stdout.write('用法: scripts/verify-approval-record [--require-approved] [--root <project>] [--checkpoint <current checkpoint>] <record.yaml|json>\n--history 仅检查历史结构,不放行;不能与当前上下文选项组合。v1当前批准须有checkpoint;v2可使用正式任务的独立当前绑定。0=相应检查通过,1=失败。\n');
|
|
8
12
|
else {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
if(positionals.length!==1) throw new TypeError('需要一个批准记录路径');
|
|
14
|
+
if(values.history&&(values['require-approved']||values.checkpoint)) throw new TypeError('--history 不能用于当前批准校验');
|
|
15
|
+
const root=path.resolve(values.root || ROOT), file=path.resolve(positionals[0]);
|
|
16
|
+
const verify=()=>{
|
|
17
|
+
let checkpoint;
|
|
18
|
+
if(values.checkpoint) {checkpoint=approvalIO({root}).document(path.resolve(values.checkpoint));validateAssetStructure(checkpoint,'checkpoint');}
|
|
19
|
+
validateApprovalRecordFile(file,{root,checkpoint,history:values.history===true,requireApproved:!values.history});
|
|
20
|
+
};
|
|
21
|
+
if(values.history) verify();
|
|
22
|
+
else withValidationPhase({root,purpose:'approval-cli-current',readOnly:true},verify);
|
|
23
|
+
process.stdout.write(values.history?'历史兼容结构检查完成;execution_authorization=not-evaluated\n':'会签当前绑定及适用用户决定校验通过;不授予执行或发布\n');
|
|
13
24
|
}
|
|
14
|
-
} catch
|
|
15
|
-
process.stderr.write(`会签记录校验失败: ${error.message}\n`);
|
|
16
|
-
process.exitCode = 1;
|
|
17
|
-
}
|
|
25
|
+
} catch(error) {process.stderr.write(`会签记录校验失败: ${error.message}\n`);process.exitCode=1;}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { assertBusinessApprovalBasis } from './lib/business-ticket-lifecycle.mjs';
|
|
3
3
|
import { assertBusinessCheckpoint } from './lib/business-tickets.mjs';
|
|
4
4
|
import { assertStageTracking } from './lib/stage-tracking.mjs';
|
|
5
|
-
import { readFileSync } from "
|
|
5
|
+
import { readFileSync, withValidationPhase } from "./lib/validation-phase.mjs";
|
|
6
6
|
import { spawnSync } from "node:child_process";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { parseArgs } from "node:util";
|
|
@@ -38,6 +38,7 @@ try {
|
|
|
38
38
|
if(values.help){process.stdout.write('用法: scripts/verify-lifecycle-checkpoint [--history] <checkpoint.yaml|json>\n默认核验当前记录;--history 仅检查历史结构,不证明当前批准或流转。退出码 0=检查完成,1=失败。\n');}
|
|
39
39
|
else {
|
|
40
40
|
if (positionals.length !== 1) throw new TypeError("用法: scripts/verify-lifecycle-checkpoint <checkpoint.yaml|checkpoint.json>");
|
|
41
|
+
const verify = () => {
|
|
41
42
|
const sourcePath = path.resolve(positionals[0]);
|
|
42
43
|
if(!values.history)assertCurrentAssetReference(root,path.relative(root,sourcePath));
|
|
43
44
|
const value = parseAsset(readFileSync(sourcePath), sourcePath);
|
|
@@ -58,9 +59,9 @@ try {
|
|
|
58
59
|
else if(value.mode==='resume'||value.mode==='orchestrate') assertScopeWorkUnit('work-unit.entry-triage',{root});
|
|
59
60
|
}
|
|
60
61
|
assertStageTracking(value, { root, checkpointRef: path.relative(root, sourcePath), nextWorkUnit: value.next_work_unit, entering: value.mode === 'resume' || value.mode === 'orchestrate' });
|
|
61
|
-
assertCheckpointApprovals(value, sourcePath);
|
|
62
|
+
assertCheckpointApprovals(value, sourcePath, {root});
|
|
62
63
|
assertPlanCheckpoint(value);
|
|
63
|
-
assertCheckpointUserDecisions(value);
|
|
64
|
+
assertCheckpointUserDecisions(value,{root});
|
|
64
65
|
if (value.repository_mode === "project-instance" && ["paused-human-gate", "completed"].includes(value.status)) {
|
|
65
66
|
if (value.context_reconciliation?.status !== "reconciled" || !value.context_reconciliation?.ref) throw new TypeError("project-instance 在会签或完成前必须具有 reconciled context_reconciliation");
|
|
66
67
|
const reconciliation = path.resolve(root, value.context_reconciliation.ref);
|
|
@@ -70,6 +71,9 @@ try {
|
|
|
70
71
|
if (value.repository_mode === "template-source" && value.context_reconciliation?.status !== "not-applicable") throw new TypeError("template-source context_reconciliation 必须为 not-applicable");
|
|
71
72
|
process.stdout.write("生命周期 checkpoint 验证通过\n");
|
|
72
73
|
}
|
|
74
|
+
};
|
|
75
|
+
if(values.history) verify();
|
|
76
|
+
else withValidationPhase({root,purpose:'lifecycle-checkpoint-current',readOnly:true},verify);
|
|
73
77
|
}
|
|
74
78
|
} catch (error) {
|
|
75
79
|
process.stderr.write(`生命周期 checkpoint 验证失败: ${error.message}\n`);
|
|
@@ -7,6 +7,7 @@ import { parseDocument } from "./vendor/yaml.mjs";
|
|
|
7
7
|
import { loadRegistry, validateRegistry } from "./lib/lifecycle-registry.mjs";
|
|
8
8
|
import { syncSkills, updateSkillLock } from "./lib/skill-supply-chain.mjs";
|
|
9
9
|
import { verifyGovernanceLayout } from "./lib/governance-layout.mjs";
|
|
10
|
+
import { DRIFT_EXIT, buildDriftReport, driftReportExit, expectedFromDistribution, formatDriftReport } from "./lib/drift-report.mjs";
|
|
10
11
|
|
|
11
12
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
12
13
|
const identityPath = path.join(root, "yss-project.yaml");
|
|
@@ -33,4 +34,23 @@ if (result.status !== 0) {
|
|
|
33
34
|
}
|
|
34
35
|
validateRegistry(loadRegistry());
|
|
35
36
|
verifyGovernanceLayout(root, "project-instance");
|
|
36
|
-
|
|
37
|
+
const metadataPath = path.join(root, ".yss-template.json");
|
|
38
|
+
if (existsSync(metadataPath)) {
|
|
39
|
+
const metadata = JSON.parse(readFileSync(metadataPath, "utf8"));
|
|
40
|
+
const report = buildDriftReport({
|
|
41
|
+
scope: "project-instance",
|
|
42
|
+
root,
|
|
43
|
+
// skills-lock.json is a rendered asset with its own update-skill-lock --check;
|
|
44
|
+
// Permitted customizations remain required readable files. Managed/generated
|
|
45
|
+
// assets — including other rendered files — remain hash-gated.
|
|
46
|
+
managedFiles: Object.fromEntries(Object.entries(metadata.managedFiles ?? {}).filter(([ref, record]) => ref !== "skills-lock.json" && record.mergeStrategy !== "manual")),
|
|
47
|
+
allowCustomizations: true,
|
|
48
|
+
expected: expectedFromDistribution(metadata),
|
|
49
|
+
});
|
|
50
|
+
if (process.argv.includes("--json")) process.stdout.write(JSON.stringify(report, null, 2) + "\n");
|
|
51
|
+
else process.stdout.write(formatDriftReport(report) + "\n");
|
|
52
|
+
if (driftReportExit(report) !== DRIFT_EXIT.clean) {
|
|
53
|
+
throw new TypeError("实例受管资产漂移或缺失:先运行 create-yss-spec sync 或补装后再校验");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
process[process.argv.includes("--json") ? "stderr" : "stdout"].write("项目实例校验通过\n");
|