create-yss-spec 3.4.10 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/package.json +1 -1
- package/src/api/_sync-service.js +141 -23
- package/src/cli/args.js +3 -0
- package/src/cli/help.js +14 -2
- package/src/cli/index.js +3 -0
- package/src/cli/prompts.js +5 -1
- package/src/cli/router.js +2 -0
- package/src/commands/attach.js +21 -5
- package/src/commands/diff.js +1 -0
- package/src/commands/doctor.js +1 -0
- package/src/commands/init.js +4 -1
- package/src/commands/skills.js +253 -0
- package/src/commands/sync.js +4 -0
- package/src/family-identity.js +2 -2
- package/src/template/asset-runtime.js +228 -0
- package/src/template/attach-planner.js +1 -1
- package/src/template/distribution-runtime.js +165 -0
- package/src/template/instance-runtime.js +76 -29
- package/src/template/layout-migration.js +160 -0
- package/src/template/migration-runtime.js +2 -2
- package/src/template/ownership-policy.js +17 -1
- package/src/template/prune-planner.js +6 -1
- package/src/template/sync-planner.js +4 -1
- package/src/template/verification-runtime.js +56 -1
- package/src/validation/metadata.js +24 -1
- package/template/.agents/rules/yss-ai-skills.md +1 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +7 -8
- package/template/.agents/skills/.yss-skills-manifest.json +2 -2
- package/template/.agents/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.agents/skills/code-review/SKILL.md +6 -6
- package/template/.agents/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.agents/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.agents/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.agents/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.agents/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
- package/template/.agents/skills/prototype-review/SKILL.md +4 -4
- package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.agents/skills/triage/SKILL.md +1 -1
- package/template/.agents/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.agents/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.agents/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.agents/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.agents/skills/yss-cache/SKILL.md +6 -5
- package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
- package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
- package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
- package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.agents/skills/yss-cache/references/verification.md +10 -4
- package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.agents/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +10 -10
- package/template/.agents/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.agents/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.agents/skills/yss-exception/SKILL.md +1 -1
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.agents/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.agents/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.agents/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.agents/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.agents/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.agents/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.agents/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.agents/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.agents/skills/yss-repository/SKILL.md +3 -2
- package/template/.agents/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.agents/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.agents/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.agents/skills/yss-research/SKILL.md +2 -2
- 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 +5 -5
- package/template/.agents/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.agents/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.agents/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.agents/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.agents/skills/yss-ui/SKILL.md +1 -1
- package/template/.agents/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.agents/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.agents/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.codex/skills/code-review/SKILL.md +6 -6
- package/template/.codex/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.codex/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.codex/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.codex/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.codex/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
- package/template/.codex/skills/prototype-review/SKILL.md +4 -4
- package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.codex/skills/triage/SKILL.md +1 -1
- package/template/.codex/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.codex/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.codex/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.codex/skills/yss-cache/SKILL.md +6 -5
- package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
- package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
- package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
- package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.codex/skills/yss-cache/references/verification.md +10 -4
- package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.codex/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +10 -10
- package/template/.codex/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.codex/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.codex/skills/yss-exception/SKILL.md +1 -1
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.codex/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.codex/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.codex/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.codex/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.codex/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.codex/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.codex/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.codex/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.codex/skills/yss-repository/SKILL.md +3 -2
- package/template/.codex/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.codex/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.codex/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.codex/skills/yss-research/SKILL.md +2 -2
- 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 +5 -5
- package/template/.codex/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.codex/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.codex/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.codex/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.codex/skills/yss-ui/SKILL.md +1 -1
- package/template/.codex/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.codex/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.codex/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.cursor/skills/code-review/SKILL.md +6 -6
- package/template/.cursor/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.cursor/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.cursor/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.cursor/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.cursor/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
- package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
- package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.cursor/skills/triage/SKILL.md +1 -1
- package/template/.cursor/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.cursor/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.cursor/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
- package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
- package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
- package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
- package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
- package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.cursor/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +10 -10
- package/template/.cursor/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.cursor/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.cursor/skills/yss-exception/SKILL.md +1 -1
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.cursor/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.cursor/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.cursor/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.cursor/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.cursor/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.cursor/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.cursor/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.cursor/skills/yss-repository/SKILL.md +3 -2
- package/template/.cursor/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursor/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.cursor/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.cursor/skills/yss-research/SKILL.md +2 -2
- 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 +5 -5
- package/template/.cursor/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.cursor/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.cursor/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
- package/template/.cursor/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.cursor/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.cursor/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/.cursorrules +1 -1
- package/template/.pi/skills/alibaba-java-code-style/SKILL.md +1 -1
- package/template/.pi/skills/code-review/SKILL.md +6 -6
- package/template/.pi/skills/code-review/references/yss-review-standards.md +1 -1
- package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.pi/skills/i-have-adhd/SKILL.md +1 -1
- package/template/.pi/skills/i-have-adhd/references/yss-adaptation.md +1 -1
- package/template/.pi/skills/i-have-adhd/tests/verify-integration.mjs +2 -2
- package/template/.pi/skills/implementation-repo-onboarding/SKILL.md +2 -2
- package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
- package/template/.pi/skills/prototype-review/SKILL.md +4 -4
- package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +10 -10
- package/template/.pi/skills/triage/SKILL.md +1 -1
- package/template/.pi/skills/yss-application/references/profiles/layered-mvc-service.md +1 -1
- package/template/.pi/skills/yss-application/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.pi/skills/yss-backend-spec-review/SKILL.md +1 -1
- package/template/.pi/skills/yss-backend-spec-review/references/check-inputs.md +1 -1
- package/template/.pi/skills/yss-cache/SKILL.md +6 -5
- package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
- package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
- package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
- package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.pi/skills/yss-cache/references/verification.md +10 -4
- package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.pi/skills/yss-ddd-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-ddd-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +10 -10
- package/template/.pi/skills/yss-design-system/references/design-qa-theme.md +3 -3
- package/template/.pi/skills/yss-design-system/references/design-system.md +3 -3
- package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.pi/skills/yss-exception/SKILL.md +1 -1
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/generate_scaffold.mjs +1 -1
- package/template/.pi/skills/yss-frontend-scaffold-generator/scripts/refresh_baseline.mjs +2 -2
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +9 -9
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -1
- package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +9 -9
- package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract-v2.md +3 -3
- package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +1 -1
- package/template/.pi/skills/yss-implementation-contract-compiler/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/SKILL.md +2 -2
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/data-analysis-profile.mjs +5 -5
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/generate_scaffold.mjs +2 -2
- package/template/.pi/skills/yss-layered-mvc-scaffold-generator/scripts/scaffold-generator.test.mjs +42 -0
- package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -2
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +7 -7
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -11
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +70 -47
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +22 -14
- package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +11 -11
- package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +9 -9
- package/template/.pi/skills/yss-prototype-stage/references/existing-ui-entry.md +1 -1
- package/template/.pi/skills/yss-prototype-stage/scripts/build-antd-prototype.mjs +1 -1
- package/template/.pi/skills/yss-prototype-stage/scripts/offline-html.mjs +3 -3
- package/template/.pi/skills/yss-prototype-stage/tests/browser-smoke.mjs +2 -2
- package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +4 -4
- package/template/.pi/skills/yss-prototype-stage/tests/workbench-smoke.mjs +1 -1
- package/template/.pi/skills/yss-repository/SKILL.md +3 -2
- package/template/.pi/skills/yss-repository/references/profiles/layered-mvc-service.md +1 -1
- package/template/.pi/skills/yss-repository/references/profiles/mvc-data-analysis-v1.md +1 -1
- package/template/.pi/skills/yss-repository/tests/profile-routing.test.mjs +2 -2
- package/template/.pi/skills/yss-research/SKILL.md +2 -2
- 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 +5 -5
- package/template/.pi/skills/yss-stage-decision/references/domain-strategy-contract.md +1 -1
- package/template/.pi/skills/yss-stage-decision/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.pi/skills/yss-tactical-design/references/strategic-handoff-routing.md +1 -1
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +1 -1
- package/template/.pi/skills/yss-technical-design/SKILL.md +6 -6
- package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +1 -1
- package/template/.pi/skills/yss-ui/SKILL.md +1 -1
- package/template/.pi/skills/yss-up-springboot3/SKILL.md +1 -1
- package/template/.pi/skills/yss-web-controller/SKILL.md +1 -1
- package/template/.pi/skills/yss-web-controller/references/profiles/layered-mvc-service.md +1 -1
- package/template/{docs → .template-spec}/adr/README.md +1 -1
- package/template/{docs → .template-spec}/agents/README.md +1 -1
- package/template/{docs → .template-spec}/agents/backend-architecture-profiles.md +2 -2
- package/template/{docs → .template-spec}/agents/digital-human-roles.md +6 -6
- package/template/{docs → .template-spec}/agents/digital-human-roles.yaml +5 -5
- package/template/{docs → .template-spec}/agents/gitlab-workflow-skills.md +2 -2
- package/template/{docs → .template-spec}/agents/issue-tracker.md +1 -1
- package/template/{docs → .template-spec}/agents/skill-migrations.md +6 -2
- package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
- package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +9 -8
- package/template/{docs → .template-spec}/architecture/README.md +3 -3
- package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
- package/template/{docs → .template-spec}/design/README.md +12 -12
- package/template/{docs → .template-spec}/design/design.md +20 -20
- package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +6 -4
- package/template/{docs/design/templates/state-matrix-template.md → .template-spec/design/templates/examples/model-publishing-state-matrix.example.md} +3 -1
- package/template/.template-spec/design/templates/interaction-spec-template.md +61 -0
- package/template/{docs → .template-spec}/design/templates/product-overview-design-template.md +11 -11
- package/template/{docs → .template-spec}/design/templates/prototype-evidence-template.yaml +4 -4
- package/template/{docs → .template-spec}/design/templates/prototype-review-checklist.md +1 -1
- package/template/.template-spec/design/templates/state-matrix-template.md +29 -0
- package/template/.template-spec/design/tokens/.design-md-projection.json +13 -0
- package/template/{docs → .template-spec}/engineering/backend-platforms.md +1 -1
- package/template/{docs → .template-spec}/plan/entry-review.md +8 -4
- package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
- package/template/{docs → .template-spec}/process/contract-reading.md +1 -1
- package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
- package/template/.template-spec/process/lifecycle-registry-baseline.json +253 -0
- package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +19 -12
- package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
- package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +14 -1
- package/template/{docs → .template-spec}/process/schemas/lifecycle-checkpoint.schema.json +15 -0
- package/template/{docs → .template-spec}/process/schemas/lifecycle-registry.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v3.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v4.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff-v5.schema.json +1 -1
- package/template/{docs → .template-spec}/process/schemas/strategic-design-handoff.schema.json +1 -1
- package/template/{docs → .template-spec}/process/stage-tracking.md +1 -1
- package/template/{docs → .template-spec}/process/subagent-collaboration.md +2 -2
- package/template/{docs → .template-spec}/templates/build-architecture-checklist-template.md +2 -2
- package/template/{docs → .template-spec}/templates/digital-human-runtime-profile-template.md +2 -2
- package/template/{docs → .template-spec}/templates/grok-bot-profile-template.md +1 -1
- package/template/{docs → .template-spec}/templates/local-parent-ticket-template.md +1 -1
- package/template/.template-spec/templates/release-note-template.md +29 -0
- package/template/.template-spec/templates/retro-report-template.md +24 -0
- package/template/{docs → .template-spec}/templates/subagent-task-package-template.md +3 -3
- package/template/.template-spec/templates/verification-record-template.md +64 -0
- package/template/{docs → .template-spec}/templates/vertical-slice-ticket-template.md +5 -10
- package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
- package/template/{docs → .template-spec}/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +4 -4
- package/template/AGENTS.md +12 -12
- package/template/CONTEXT.md +3 -3
- package/template/README.md +22 -25
- package/template/scripts/backend-delivery +1 -1
- package/template/scripts/design-md +2 -0
- package/template/scripts/lib/api-contract-decision.mjs +1 -1
- package/template/scripts/lib/approved-execution-context.mjs +5 -5
- package/template/scripts/lib/backend-delivery.mjs +4 -4
- package/template/scripts/lib/backend-platform.mjs +1 -1
- package/template/scripts/lib/backend-review.mjs +1 -1
- package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
- package/template/scripts/lib/backend-standards-coverage.mjs +2 -2
- package/template/scripts/lib/context-reconciliation.mjs +1 -1
- package/template/scripts/lib/contract-views.mjs +9 -9
- package/template/scripts/lib/delivery-preflight.mjs +6 -6
- package/template/scripts/lib/design-md.mjs +230 -0
- package/template/scripts/lib/digital-human-roles.mjs +2 -2
- package/template/scripts/lib/existing-backend-architecture.mjs +1 -1
- package/template/scripts/lib/existing-ui-baseline.mjs +1 -1
- package/template/scripts/lib/frontend-delivery.mjs +2 -2
- package/template/scripts/lib/governance-layout.mjs +74 -0
- package/template/scripts/lib/harness-execution-scope.mjs +2 -2
- package/template/scripts/lib/lifecycle-context-query.mjs +11 -3
- package/template/scripts/lib/lifecycle-registry.mjs +46 -7
- package/template/scripts/lib/lifecycle-status.mjs +111 -0
- package/template/scripts/lib/lifecycle-transition.mjs +71 -10
- package/template/scripts/lib/openapi-draft-validation.mjs +1 -1
- package/template/scripts/lib/plan-spec-entry-view.mjs +48 -0
- package/template/scripts/lib/plan-spec-entry.mjs +3 -3
- package/template/scripts/lib/skill-registry.mjs +16 -9
- package/template/scripts/lib/skill-supply-chain.mjs +34 -15
- package/template/scripts/lib/slice-contract-preparation.mjs +3 -3
- package/template/scripts/lib/slice-contract.mjs +1 -1
- package/template/scripts/lib/slice-repositories.mjs +1 -1
- package/template/scripts/lib/slice-task-package.mjs +3 -3
- package/template/scripts/lib/stage-tracking-migration.mjs +2 -2
- package/template/scripts/lib/stage-tracking.mjs +5 -5
- package/template/scripts/lib/strategic-feedback.mjs +2 -2
- package/template/scripts/lib/strategic-handoff-routing.mjs +2 -2
- package/template/scripts/lib/strategic-handoff.mjs +15 -15
- package/template/scripts/lib/task-package-schema.mjs +2 -2
- package/template/scripts/lib/task-package.mjs +1 -1
- package/template/scripts/lib/technical-design-boundary.mjs +1 -1
- package/template/scripts/lib/user-decision.mjs +2 -1
- package/template/scripts/lifecycle-status +14 -0
- package/template/scripts/plan-spec-entry +21 -0
- package/template/scripts/strategic-consumer-entry +1 -1
- package/template/scripts/strategic-handoff +1 -1
- package/template/scripts/verify-frontend-implementation-evidence +1 -1
- package/template/scripts/verify-governance-layout +15 -0
- package/template/scripts/verify-lifecycle-checkpoint +1 -1
- package/template/scripts/verify-project-instance +13 -10
- package/template/scripts/verify-scaffold-architecture-decisions +1 -1
- package/template/scripts/verify-strategic-context-import +3 -3
- package/template/skills-lock.json +80 -95
- package/template.manifest.json +30 -15
- package/template.snapshot.json +5 -5
- package/template/.agents/skills/grill-me/SKILL.md +0 -7
- package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.codex/skills/grill-me/SKILL.md +0 -7
- package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.cursor/skills/grill-me/SKILL.md +0 -7
- package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.pi/skills/grill-me/SKILL.md +0 -7
- package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/docs/agents/archify-integration.md +0 -19
- package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
- package/template/docs/api/.gitkeep +0 -0
- package/template/docs/api/specs/.gitkeep +0 -0
- package/template/docs/architecture/.gitkeep +0 -0
- package/template/docs/design/design-system-sync.yaml +0 -13
- package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
- package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
- package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
- package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
- package/template/docs/design/preview-dark.html +0 -178
- package/template/docs/design/preview.css +0 -730
- package/template/docs/design/preview.html +0 -178
- package/template/docs/design/preview.js +0 -71
- package/template/docs/design/prototypes/.gitkeep +0 -1
- package/template/docs/design/tokens/.design-md-projection.json +0 -13
- package/template/docs/implementation/.gitkeep +0 -1
- package/template/docs/plan/IDEATION.md +0 -96
- package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
- package/template/docs/process/PDCA-SCRUM.md +0 -10
- package/template/docs/process/github-workflows.md +0 -52
- package/template/docs/process/harness-executive-blueprint.md +0 -10
- package/template/docs/releases/.gitkeep +0 -1
- package/template/docs/requirements/README.md +0 -85
- package/template/docs/requirements/tickets/.gitkeep +0 -1
- package/template/docs/templates/agent-brief-template.md +0 -46
- package/template/docs/templates/architecture-proposal-template.md +0 -18
- package/template/docs/templates/implementation-plan-template.md +0 -16
- package/template/docs/templates/implementation-routing-template.md +0 -350
- package/template/docs/templates/release-note-template.md +0 -14
- package/template/docs/templates/requirement-freeze-template.md +0 -63
- package/template/docs/templates/retro-report-template.md +0 -16
- package/template/docs/templates/risk-register-template.md +0 -11
- package/template/docs/templates/user-story-template.md +0 -20
- package/template/docs/templates/verification-record-template.md +0 -53
- package/template/docs/testing/README.md +0 -110
- /package/template/{docs → .template-spec}/agents/domain.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-draft-review-checklist.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-draft-validation-record-template.yaml +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-freeze-record-template.md +0 -0
- /package/template/{docs → .template-spec}/api/templates/openapi-json-export-record-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/architecture-deepening-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/architecture-review-checklist.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/business-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/data-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/engineering-baseline-review-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/functional-architecture-template.md +0 -0
- /package/template/{docs → .template-spec}/architecture/templates/system-overview-design-template.md +0 -0
- /package/template/{docs → .template-spec}/design/diagrams/README.md +0 -0
- /package/template/{docs → .template-spec}/design/schemas/visual-baseline.schema.json +0 -0
- /package/template/{docs → .template-spec}/design/templates/prototype-confirmation-template.md +0 -0
- /package/template/{docs → .template-spec}/design/templates/visual-baseline-template.yaml +0 -0
- /package/template/{docs → .template-spec}/design/tokens/theme.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.compact.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.dark.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/tokens.default.json +0 -0
- /package/template/{docs → .template-spec}/design/tokens/variables.css +0 -0
- /package/template/{docs → .template-spec}/design/tokens/variables.dark.css +0 -0
- /package/template/{docs → .template-spec}/engineering/backend-platforms.json +0 -0
- /package/template/{docs → .template-spec}/plan/README.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/competitive-analysis-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/competitive-matrix-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/market-analysis-template.md +0 -0
- /package/template/{docs → .template-spec}/plan/templates/user-pain-points-template.md +0 -0
- /package/template/{docs → .template-spec}/process/delivery-preflight.md +0 -0
- /package/template/{docs → .template-spec}/process/document-writing.md +0 -0
- /package/template/{docs → .template-spec}/process/existing-backend-architecture.md +0 -0
- /package/template/{docs → .template-spec}/process/existing-ui-baseline.md +0 -0
- /package/template/{docs → .template-spec}/process/frontend-backend-delivery.md +0 -0
- /package/template/{docs → .template-spec}/process/harness-process-tailoring.md +0 -0
- /package/template/{docs → .template-spec}/process/implementation-repo-integration.md +0 -0
- /package/template/{docs/process/lifecycle-registry-baseline.json → .template-spec/process/lifecycle-registry-baseline-v1.json} +0 -0
- /package/template/{docs → .template-spec}/process/schemas/api-contract-decision-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/api-contract-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-architecture-identity.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-delivery-verification.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/backend-delivery.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/context-reconciliation.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/data-architecture-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-input.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/delivery-preflight-result.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/existing-ui-baseline.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v1.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-delivery-acceptance.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/frontend-strategic-preflight.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/implementation-repository-preparation-result.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/openapi-draft-validation-record.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/project-scaffold-contract.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/review-bundle.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/scaffold-architecture-decisions.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/slice-implementation-contract-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/stage-tracking.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-consumer-feedback.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-feedback-adjudication.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery-verification.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-delivery.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-domain-strategy.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export-v2.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-export.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-import-receipt.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package-v3.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/strategic-handoff-stage-decision-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/subagent-task-package.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/schemas/user-decision.schema.json +0 -0
- /package/template/{docs → .template-spec}/process/strategic-handoff-package.md +0 -0
- /package/template/{docs → .template-spec}/process/templates/context-reconciliation-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/frontend-implementation-plan-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/lifecycle-checkpoint-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/scaffold-architecture-decisions-template.yaml +0 -0
- /package/template/{docs → .template-spec}/process/templates/stage-checkpoint-template.md +0 -0
- /package/template/{docs → .template-spec}/process/templates/user-decision-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/adr-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/approval-record-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/cross-repo-slice-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/examples/lifecycle-writing-examples.md +0 -0
- /package/template/{docs → .template-spec}/templates/implementation-repo-registry-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/openapi-spec-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/review-bundle-template.yaml +0 -0
- /package/template/{docs → .template-spec}/templates/review-report-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/spec-delta-template.md +0 -0
- /package/template/{docs → .template-spec}/templates/spec-template.md +0 -0
- /package/template/{docs → .template-spec}/user-guide/yss-ui-mcp.md +0 -0
- /package/template/{docs → .template-spec}/user-guide//346/212/200/346/234/257/350/256/276/350/256/241/347/224/250/346/210/267/346/214/207/345/215/227.md" +0 -0
- /package/template/{docs → .template-spec}/user-guide//350/256/276/345/244/207/345/200/237/347/224/250/350/264/257/347/251/277/346/241/210/344/276/213.md" +0 -0
- /package/template/{docs → .template-spec}/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md" +0 -0
|
@@ -7,7 +7,7 @@ import { openBundle } from './strategic-handoff.mjs';
|
|
|
7
7
|
import { verifyConsumption } from './strategic-handoff-consumption.mjs';
|
|
8
8
|
import { read, safe, ensure, hash, schema, project, ROOT } from './strategic-handoff-io.mjs';
|
|
9
9
|
|
|
10
|
-
const ACCEPTANCE_SCHEMAS=new Map([[1,'
|
|
10
|
+
const ACCEPTANCE_SCHEMAS=new Map([[1,'.template-spec/process/schemas/frontend-delivery-acceptance-v1.schema.json'],[2,'.template-spec/process/schemas/frontend-delivery-acceptance.schema.json'],[3,'.template-spec/process/schemas/frontend-delivery-acceptance-v3.schema.json']]);
|
|
11
11
|
|
|
12
12
|
function acceptanceSchema(version) {
|
|
13
13
|
ensure(ACCEPTANCE_SCHEMAS.has(version),`Frontend Delivery Acceptance 未知 schema_version: ${String(version)};支持版本: 1, 2, 3;既有 UI 接收请使用 3`);
|
|
@@ -18,7 +18,7 @@ export async function verifyFrontendStrategicPreflight({root=process.cwd(),prefl
|
|
|
18
18
|
project(root);
|
|
19
19
|
const file=safe(root,preflightRef),preflight=read(file);
|
|
20
20
|
ensure([1,2].includes(preflight.schema_version),'Frontend Strategic Preflight 未知 schema_version');
|
|
21
|
-
schema(preflight,preflight.schema_version===2?'
|
|
21
|
+
schema(preflight,preflight.schema_version===2?'.template-spec/process/schemas/frontend-strategic-preflight-v2.schema.json':'.template-spec/process/schemas/frontend-strategic-preflight.schema.json');
|
|
22
22
|
const preflightDigest=hash(readFileSync(file));
|
|
23
23
|
if(expectedDigest)ensure(expectedDigest===preflightDigest,'前端战略预检摘要已变化,需重编译合同');
|
|
24
24
|
ensure(preflight.status==='verified','前端战略预检尚未 verified');
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
const requiredShared = [
|
|
6
|
+
".template-spec/agents/yss-skill-registry.yaml",
|
|
7
|
+
".template-spec/agents/digital-human-roles.yaml",
|
|
8
|
+
".template-spec/agents/issue-tracker.md",
|
|
9
|
+
".template-spec/process/lifecycle-registry.yaml",
|
|
10
|
+
".template-spec/process/lifecycle-artifact-map.md",
|
|
11
|
+
];
|
|
12
|
+
const oldStaticDirs = [
|
|
13
|
+
"docs/agents", "docs/process", "docs/templates", "docs/user-guide",
|
|
14
|
+
"docs/plan/templates", "docs/api/templates", "docs/architecture/templates",
|
|
15
|
+
"docs/design/templates", "docs/design/tokens", "docs/design/schemas",
|
|
16
|
+
"docs/design/diagrams", "docs/discovery/templates",
|
|
17
|
+
];
|
|
18
|
+
const oldStaticFiles = new Set([
|
|
19
|
+
"docs/adr/README.md", "docs/architecture/README.md",
|
|
20
|
+
"docs/plan/README.md", "docs/plan/entry-review.md",
|
|
21
|
+
"docs/discovery/README.md", "docs/discovery/IDEATION.md",
|
|
22
|
+
"docs/design/README.md", "docs/design/design.md",
|
|
23
|
+
"docs/design/design-system-sync.yaml", "docs/design/preview.html",
|
|
24
|
+
"docs/design/preview-dark.html", "docs/design/preview.css",
|
|
25
|
+
"docs/design/preview.js", "docs/engineering/backend-platforms.json",
|
|
26
|
+
"docs/engineering/backend-platforms.md",
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
function staticPath(ref) {
|
|
30
|
+
return oldStaticFiles.has(ref) || oldStaticDirs.some((directory) => ref.startsWith(`${directory}/`));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function filesBelow(root, relativePath) {
|
|
34
|
+
const full = path.join(root, relativePath);
|
|
35
|
+
if (!existsSync(full)) return [];
|
|
36
|
+
const entry = lstatSync(full);
|
|
37
|
+
if (!entry.isDirectory()) return [relativePath];
|
|
38
|
+
return readdirSync(full).filter((name) => name !== ".DS_Store")
|
|
39
|
+
.flatMap((name) => filesBelow(root, `${relativePath}/${name}`));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function verifyGovernanceLayout(root, mode) {
|
|
43
|
+
if (!["template-source", "project-instance"].includes(mode)) {
|
|
44
|
+
throw new TypeError(`不支持的仓库身份: ${mode}`);
|
|
45
|
+
}
|
|
46
|
+
for (const ref of requiredShared) {
|
|
47
|
+
if (!existsSync(path.join(root, ref))) throw new TypeError(`缺少共享治理资产: ${ref}`);
|
|
48
|
+
}
|
|
49
|
+
let oldFiles;
|
|
50
|
+
if (mode === "template-source") {
|
|
51
|
+
const result = spawnSync("git", ["ls-files", "-z", "--", "docs"], { cwd: root, encoding: "utf8" });
|
|
52
|
+
if (result.status !== 0) throw new TypeError(result.stderr || "无法读取模板源受控文件清单");
|
|
53
|
+
oldFiles = result.stdout.split("\0").filter(Boolean).filter(staticPath);
|
|
54
|
+
for (const ref of [
|
|
55
|
+
".template-source/process/maintenance-intensity.yaml",
|
|
56
|
+
".template-source/process/template-verification-profiles.yaml",
|
|
57
|
+
".template-source/agents/skills-maintenance.md",
|
|
58
|
+
]) {
|
|
59
|
+
if (!existsSync(path.join(root, ref))) throw new TypeError(`缺少模板维护资产: ${ref}`);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
oldFiles = [...new Set([
|
|
63
|
+
...oldStaticDirs.flatMap((ref) => filesBelow(root, ref)),
|
|
64
|
+
...[...oldStaticFiles].filter((ref) => existsSync(path.join(root, ref))),
|
|
65
|
+
])];
|
|
66
|
+
if (existsSync(path.join(root, ".template-source"))) {
|
|
67
|
+
throw new TypeError("项目实例不得包含 .template-source");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (oldFiles.length) {
|
|
71
|
+
throw new TypeError(`旧治理文件仍位于 docs/,需显式迁移: ${oldFiles.sort().join(", ")}`);
|
|
72
|
+
}
|
|
73
|
+
return { mode, shared: requiredShared.length, legacy: 0 };
|
|
74
|
+
}
|
|
@@ -6,9 +6,9 @@ import { ROOT, read, safe, ensure } from './strategic-handoff-io.mjs';
|
|
|
6
6
|
export function loadDeliveryProfile(root=ROOT) {
|
|
7
7
|
const metadata=['backend','frontend'].filter(side=>existsSync(path.join(root,`.yss-harness-${side}.json`)));
|
|
8
8
|
ensure(metadata.length<=1,'专职 Harness metadata 身份冲突');
|
|
9
|
-
const profilePath=path.join(root,'
|
|
9
|
+
const profilePath=path.join(root,'.template-spec/process/harness-profile.yaml');
|
|
10
10
|
ensure(!metadata.length||existsSync(profilePath),'专职 Harness 缺少 profile,不得绕过执行门禁');
|
|
11
|
-
const profile=existsSync(profilePath)?read(safe(root,'
|
|
11
|
+
const profile=existsSync(profilePath)?read(safe(root,'.template-spec/process/harness-profile.yaml')):null;
|
|
12
12
|
if(metadata.length) {
|
|
13
13
|
const expected=`harness.${metadata[0]}-delivery`;
|
|
14
14
|
const record=read(safe(root,`.yss-harness-${metadata[0]}.json`));
|
|
@@ -6,9 +6,9 @@ import { parseDocument } from "../vendor/yaml.mjs";
|
|
|
6
6
|
import { ROOT, loadRegistry, semanticDigest, validateRegistry } from "./lifecycle-registry.mjs";
|
|
7
7
|
import { loadSkillRegistry } from "./skill-registry.mjs";
|
|
8
8
|
|
|
9
|
-
const LIFECYCLE_REGISTRY_REF = "
|
|
9
|
+
const LIFECYCLE_REGISTRY_REF = ".template-spec/process/lifecycle-registry.yaml";
|
|
10
10
|
const ORCHESTRATION_CONTRACT_REF = ".agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml";
|
|
11
|
-
const SKILL_REGISTRY_REF = "
|
|
11
|
+
const SKILL_REGISTRY_REF = ".template-spec/agents/yss-skill-registry.yaml";
|
|
12
12
|
|
|
13
13
|
function read(relativePath) {
|
|
14
14
|
return readFileSync(path.join(ROOT, relativePath), "utf8");
|
|
@@ -88,6 +88,12 @@ export function queryLifecycleContext({ mode, stageId, workUnitId, include = []
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const route = workUnitId ? orchestration.work_unit_routes?.[workUnitId] ?? null : null;
|
|
91
|
+
if (workUnit?.scope === "project-instance" && workUnit.id !== "work-unit.entry-triage" && !route) {
|
|
92
|
+
throw new TypeError(`项目工作单元缺少执行路由: ${workUnit.id}`);
|
|
93
|
+
}
|
|
94
|
+
if (workUnit?.scope === "project-instance" && workUnit.id !== "work-unit.entry-triage" && !Object.hasOwn(orchestration.transition_graph?.routes ?? {}, workUnit.id)) {
|
|
95
|
+
throw new TypeError(`项目工作单元缺少流转路由: ${workUnit.id}`);
|
|
96
|
+
}
|
|
91
97
|
const gates = lifecycle.gates.filter((gate) => gate.stage === stageId || (loadPlan && gate.stage === 'stage.plan'));
|
|
92
98
|
const checks = lifecycle.checks.filter(check => check.stage === stageId || gates.some(gate => gate.requires_checks?.includes(check.id)));
|
|
93
99
|
const artifacts = lifecycle.artifacts.filter((artifact) => artifact.stage === stageId || (loadPlan && artifact.stage === 'stage.plan'));
|
|
@@ -125,7 +131,9 @@ export function queryLifecycleContext({ mode, stageId, workUnitId, include = []
|
|
|
125
131
|
},
|
|
126
132
|
lifecycle: {
|
|
127
133
|
artifacts,
|
|
128
|
-
evidence: lifecycle.evidence.filter((item) => evidenceIds.has(item.id)),
|
|
134
|
+
evidence: lifecycle.evidence.filter((item) => evidenceIds.has(item.id)).map(({ public_description, ...item }) => ({
|
|
135
|
+
...item, description: public_description ?? item.description
|
|
136
|
+
})),
|
|
129
137
|
gates,
|
|
130
138
|
checks,
|
|
131
139
|
stage,
|
|
@@ -6,8 +6,8 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { parseDocument } from "../vendor/yaml.mjs";
|
|
7
7
|
|
|
8
8
|
export const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
|
9
|
-
export const DEFAULT_REGISTRY = path.join(ROOT, "
|
|
10
|
-
export const DEFAULT_BASELINE = path.join(ROOT, "
|
|
9
|
+
export const DEFAULT_REGISTRY = path.join(ROOT, ".template-spec/process/lifecycle-registry.yaml");
|
|
10
|
+
export const DEFAULT_BASELINE = path.join(ROOT, ".template-spec/process/lifecycle-registry-baseline.json");
|
|
11
11
|
const ID_PATTERN = /^(stage|gate|check|artifact|work-unit|evidence)\.[a-z0-9][a-z0-9-]*$/;
|
|
12
12
|
const COLLECTIONS = ["stages", "gates", "checks", "artifacts", "work_units", "evidence"];
|
|
13
13
|
|
|
@@ -63,6 +63,12 @@ export function semanticDigest(registry) {
|
|
|
63
63
|
return createHash("sha256").update(JSON.stringify(semanticProjection(registry))).digest("hex");
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
export function semanticHashesById(registry) {
|
|
67
|
+
return Object.fromEntries(semanticProjection(registry).map(({ record }) => [
|
|
68
|
+
record.id, createHash("sha256").update(JSON.stringify(record)).digest("hex")
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
|
|
66
72
|
function validateBaseline(registry, ids, baselinePath) {
|
|
67
73
|
let baseline;
|
|
68
74
|
try {
|
|
@@ -72,7 +78,7 @@ function validateBaseline(registry, ids, baselinePath) {
|
|
|
72
78
|
if (error instanceof SyntaxError) fail(`无法解析生命周期已发布基线: ${error.message}`);
|
|
73
79
|
throw error;
|
|
74
80
|
}
|
|
75
|
-
if (baseline.schema_version
|
|
81
|
+
if (![1, 2].includes(baseline.schema_version) || baseline.registry_id !== registry.registry_id) {
|
|
76
82
|
fail("生命周期已发布基线版本或 registry_id 不匹配");
|
|
77
83
|
}
|
|
78
84
|
const publishedIds = baseline.published_ids;
|
|
@@ -91,7 +97,26 @@ function validateBaseline(registry, ids, baselinePath) {
|
|
|
91
97
|
if (JSON.stringify(activeIds) !== JSON.stringify(expected)) {
|
|
92
98
|
fail("生命周期活跃 ID 与已发布基线不一致;新增、移除或弃用必须先更新发布基线");
|
|
93
99
|
}
|
|
94
|
-
if (baseline.
|
|
100
|
+
if (baseline.schema_version === 1) {
|
|
101
|
+
if (baseline.semantic_sha256 !== semanticDigest(registry)) fail("生命周期稳定 ID 的语义快照已变化;不得复用已发布 ID");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const archivedPath = path.resolve(ROOT, baseline.historical_baseline ?? "");
|
|
105
|
+
if (baseline.historical_baseline !== ".template-spec/process/lifecycle-registry-baseline-v1.json") fail("生命周期历史基线路径无效");
|
|
106
|
+
const archivedBytes = readFileSync(archivedPath);
|
|
107
|
+
if (createHash("sha256").update(archivedBytes).digest("hex") !== baseline.historical_sha256) fail("生命周期历史基线摘要不匹配");
|
|
108
|
+
const archived = JSON.parse(archivedBytes.toString("utf8"));
|
|
109
|
+
if (archived.schema_version !== 1 || archived.registry_id !== registry.registry_id || !archived.published_ids.every((id) => publishedIds.includes(id))) fail("生命周期历史基线与当前发布 ID 不兼容");
|
|
110
|
+
const migrations = baseline.migrations;
|
|
111
|
+
if (!migrations || typeof migrations !== "object" || Array.isArray(migrations)) fail("生命周期迁移映射无效");
|
|
112
|
+
for (const [oldId, newId] of Object.entries(migrations)) {
|
|
113
|
+
if (!archived.published_ids.includes(oldId) || !deprecated.includes(oldId) || !activeIds.includes(newId) || oldId.split(".")[0] !== newId.split(".")[0]) fail(`生命周期迁移映射无效: ${oldId} -> ${newId}`);
|
|
114
|
+
}
|
|
115
|
+
const hashes = semanticHashesById(registry);
|
|
116
|
+
if (!baseline.semantic_sha256_by_id || JSON.stringify(Object.keys(baseline.semantic_sha256_by_id).sort()) !== JSON.stringify(activeIds)) fail("生命周期逐 ID 语义基线与活跃 ID 不一致");
|
|
117
|
+
for (const [id, digest] of Object.entries(hashes)) {
|
|
118
|
+
if (baseline.semantic_sha256_by_id[id] !== digest) fail(`生命周期稳定 ID 的语义快照已变化: ${id}`);
|
|
119
|
+
}
|
|
95
120
|
}
|
|
96
121
|
|
|
97
122
|
export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {}) {
|
|
@@ -108,7 +133,7 @@ export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {})
|
|
|
108
133
|
}
|
|
109
134
|
if (policy.published_ids_immutable !== true) fail("published_ids_immutable 必须为 true");
|
|
110
135
|
if (policy.pattern !== "^(stage|gate|check|artifact|work-unit|evidence)\\.[a-z0-9][a-z0-9-]*$") fail("id_policy.pattern 不符合固定命名空间");
|
|
111
|
-
if (policy.baseline !== "
|
|
136
|
+
if (policy.baseline !== ".template-spec/process/lifecycle-registry-baseline.json") fail("id_policy.baseline 必须指向发布基线");
|
|
112
137
|
if (!Array.isArray(policy.deprecated_ids)) fail("deprecated_ids 必须是数组");
|
|
113
138
|
const ids = new Map();
|
|
114
139
|
for (const collection of COLLECTIONS) {
|
|
@@ -159,6 +184,20 @@ export function validateRegistry(registry, { baseline = DEFAULT_BASELINE } = {})
|
|
|
159
184
|
for (const artifact of registry.artifacts) {
|
|
160
185
|
requireReference(ids, artifact.stage, `${artifact.id}.stage`);
|
|
161
186
|
if (ids.get(artifact.stage) !== "stages") fail(`${artifact.id}.stage 必须引用 stage.*`);
|
|
187
|
+
for (const reference of artifact.trigger.match(/\b(?:stage|gate|check|artifact|work-unit|evidence)\.[a-z0-9][a-z0-9-]*\b/g) ?? []) {
|
|
188
|
+
requireReference(ids, reference, `${artifact.id}.trigger`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Human-readable rules are execution instructions too. A retired control ID
|
|
192
|
+
// must never survive in an active trigger or completion sentence.
|
|
193
|
+
for (const collection of COLLECTIONS) for (const record of registry[collection]) {
|
|
194
|
+
for (const [field, value] of Object.entries(record)) {
|
|
195
|
+
if (field === "id" || typeof value !== "string") continue;
|
|
196
|
+
for (const reference of value.match(/\b(?:gate|check)\.[a-z0-9][a-z0-9-]*\b/g) ?? []) {
|
|
197
|
+
requireReference(ids, reference, `${record.id}.${field}`);
|
|
198
|
+
if (ids.get(reference) !== `${reference.split(".")[0]}s`) fail(`${record.id}.${field} 引用类型不匹配: ${reference}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
162
201
|
}
|
|
163
202
|
if (baseline) validateBaseline(registry, ids, baseline);
|
|
164
203
|
return registry;
|
|
@@ -168,7 +207,7 @@ export function renderLifecycleStructure(registry) {
|
|
|
168
207
|
const display = (record, field) => record[`public_${field}`] ?? record[field];
|
|
169
208
|
const lines = [
|
|
170
209
|
"<!-- lifecycle-registry:structure:start -->",
|
|
171
|
-
`> 此结构区由
|
|
210
|
+
`> 此结构区由 \`.template-spec/process/lifecycle-registry.yaml\` 生成。当前为 \`${registry.status}\` 模式:正式门禁、内部检查和派生文档共同消费此事实源。`, "",
|
|
172
211
|
"## 1. 主阶段", "", "| 稳定 ID | 阶段 | 目标 | 退出标准 |", "|---|---|---|---|"
|
|
173
212
|
];
|
|
174
213
|
for (const stage of registry.stages) lines.push(`| \`${stage.id}\` | ${display(stage, "name")} | ${display(stage, "goal")} | ${display(stage, "exit_criteria")} |`);
|
|
@@ -186,7 +225,7 @@ export function renderLifecycleStructure(registry) {
|
|
|
186
225
|
|
|
187
226
|
export function renderWorkUnits(registry) {
|
|
188
227
|
const display = (record, field) => record[`public_${field}`] ?? record[field];
|
|
189
|
-
const lines = ["<!-- lifecycle-registry:work-units:start -->", "> 此表由
|
|
228
|
+
const lines = ["<!-- lifecycle-registry:work-units:start -->", "> 此表由 `.template-spec/process/lifecycle-registry.yaml` 生成;工作单元按 `scope` 区分模板维护与项目实例流程。", "", "| 稳定 ID | 范围 | 工作单元 | 输入 | 输出 | 完成条件 |", "|---|---|---|---|---|---|"];
|
|
190
229
|
for (const unit of registry.work_units) lines.push(`| \`${unit.id}\` | ${unit.scope} | ${display(unit, "name")} | ${display(unit, "input")} | ${display(unit, "output")} | ${display(unit, "completion")} |`);
|
|
191
230
|
lines.push("<!-- lifecycle-registry:work-units:end -->");
|
|
192
231
|
return `${lines.join("\n")}\n`;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { parseDocument } from '../vendor/yaml.mjs';
|
|
5
|
+
import { safeTrackingPath, trackingDrift } from './stage-tracking.mjs';
|
|
6
|
+
|
|
7
|
+
const sha = bytes => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
|
|
8
|
+
function parse(bytes) {
|
|
9
|
+
const document = parseDocument(String(bytes), { uniqueKeys: true, maxAliasCount: 0 });
|
|
10
|
+
if (document.errors.length) throw new TypeError(document.errors[0].message);
|
|
11
|
+
return document.toJS({ maxAliasCount: 0 });
|
|
12
|
+
}
|
|
13
|
+
function source(root, ref) {
|
|
14
|
+
const bytes = readFileSync(safeTrackingPath(root, ref));
|
|
15
|
+
return { value: parse(bytes), digest: sha(bytes) };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Read-only projection; checkpoint, registry and orchestration remain authoritative. */
|
|
19
|
+
export function lifecycleStatus({ root, checkpointRef }) {
|
|
20
|
+
if (!root || !checkpointRef) throw new TypeError('root and checkpoint are required');
|
|
21
|
+
root = path.resolve(root);
|
|
22
|
+
const identity = source(root, 'yss-project.yaml').value;
|
|
23
|
+
if (identity.schema_version !== 1 || identity.repository_mode !== 'project-instance') throw new TypeError('生命周期状态仅适用于 project-instance');
|
|
24
|
+
const registryRef = '.template-spec/process/lifecycle-registry.yaml';
|
|
25
|
+
const contractRef = '.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml';
|
|
26
|
+
const checkpoint = source(root, checkpointRef), registry = source(root, registryRef), contract = source(root, contractRef);
|
|
27
|
+
const value = checkpoint.value;
|
|
28
|
+
if (value.schema_version !== 1 || value.repository_mode !== 'project-instance') throw new TypeError('checkpoint 身份或版本无效');
|
|
29
|
+
const items = value.stage_tracking?.items ?? [];
|
|
30
|
+
if (!Array.isArray(items)) throw new TypeError('阶段追踪 items 必须为数组');
|
|
31
|
+
const activeItems = items.filter(item => item.work_unit === value.next_work_unit && item.progress !== 'cancelled');
|
|
32
|
+
const owner = value.pause?.owner_or_authority ?? activeItems.find(item => item.progress !== 'completed')?.owner ?? '未登记';
|
|
33
|
+
const diagnostics = [], verification_scope = [];
|
|
34
|
+
const check = (id, status, refs, reason) => verification_scope.push({ id, status, refs, reason });
|
|
35
|
+
const issue = (code, message, source_ref, recovery, severity = 'error') => diagnostics.push({ code, message, source_ref, owner, recovery, severity });
|
|
36
|
+
if (!Object.hasOwn(value, 'blockers')) {
|
|
37
|
+
issue('registered-blockers-missing', 'checkpoint 缺少 blockers;不能据此判定无已登记阻塞', checkpointRef, '核对原始状态并补齐真实阻塞记录后重验');
|
|
38
|
+
} else if (!Array.isArray(value.blockers)) {
|
|
39
|
+
issue('registered-blockers-invalid', 'checkpoint.blockers 必须为数组;当前登记不可核验', checkpointRef, '修复阻塞记录类型,保留原有阻塞内容后重验');
|
|
40
|
+
} else {
|
|
41
|
+
for (const item of value.blockers) {
|
|
42
|
+
issue('registered-blocker', typeof item === 'string' ? item : JSON.stringify(item), checkpointRef, '按原阻塞证据处理并复验');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
check('registered-blockers', diagnostics.length ? 'failed' : 'passed', [checkpointRef], '仅读取已登记阻塞,不代表完整就绪');
|
|
46
|
+
const stage = registry.value.stages?.find(item => item.id === value.stage);
|
|
47
|
+
const workUnit = registry.value.work_units?.find(item => item.id === value.next_work_unit);
|
|
48
|
+
if (!stage) issue('unknown-stage', `未知阶段: ${value.stage}`, registryRef, '按注册表核对当前阶段');
|
|
49
|
+
if (value.next_work_unit && !workUnit) issue('unknown-work-unit', `未知下一工作单元: ${value.next_work_unit}`, registryRef, '按注册表核对下一工作单元');
|
|
50
|
+
if (workUnit && workUnit.id !== 'work-unit.entry-triage' && !contract.value.work_unit_routes?.[workUnit.id]) issue('missing-route', `缺少执行路由: ${workUnit.id}`, contractRef, '修复当前合同路由后重验');
|
|
51
|
+
check('stage-and-route', diagnostics.some(x => ['unknown-stage', 'unknown-work-unit', 'missing-route'].includes(x.code)) ? 'failed' : 'passed', [registryRef, contractRef], '仅检查身份与路由存在,不计算完整 frontier');
|
|
52
|
+
if (value.context_reconciliation?.status === 'blocked') issue('context-blocked', 'Context reconciliation blocked', checkpointRef, '修复词汇对账并执行适用校验');
|
|
53
|
+
check('context-reconciliation', value.context_reconciliation?.status === 'blocked' ? 'failed' : 'not-checked', [value.context_reconciliation?.ref].filter(Boolean), '读取登记状态;当前对账内容和摘要仍须由原验证器核验');
|
|
54
|
+
for (const [id, gate] of Object.entries(value.gates ?? {})) {
|
|
55
|
+
if (['blocked', 'stale'].includes(gate?.status)) issue('gate-blocked', `${id}: ${gate.status}`, checkpointRef, '核对受影响依据和当前批准');
|
|
56
|
+
}
|
|
57
|
+
check('registered-gates', diagnostics.some(x => x.code === 'gate-blocked') ? 'failed' : 'passed', [checkpointRef], '仅检查登记的 blocked/stale 标志');
|
|
58
|
+
const evidenceRefs = [value.context_reconciliation?.ref, ...Object.values(value.artifacts ?? {}).filter(item => item?.status === 'approved').map(item => item.ref)].filter(Boolean);
|
|
59
|
+
for (const ref of evidenceRefs) {
|
|
60
|
+
try { readFileSync(safeTrackingPath(root, ref)); }
|
|
61
|
+
catch { issue('evidence-unreadable', `证据不可读: ${ref}`, ref, '恢复正确来源或重新取得证据,不伪造历史批准'); }
|
|
62
|
+
}
|
|
63
|
+
check('evidence-readable', diagnostics.some(x => x.code === 'evidence-unreadable') ? 'failed' : 'passed', evidenceRefs, '仅检查已引用证据可读,不证明证据完整或当前有效');
|
|
64
|
+
check('artifact-digests', 'not-checked', evidenceRefs, '未核验批准资产原字节摘要;恢复时运行资产所有者的适用预检');
|
|
65
|
+
check('approval-validity', 'not-checked', [checkpointRef], '未核验真实决定、延续、外部审批及完整执行授权');
|
|
66
|
+
if (value.stage_tracking?.items) {
|
|
67
|
+
try {
|
|
68
|
+
const drift = trackingDrift(root, value.stage_tracking);
|
|
69
|
+
for (const id of drift) issue('tracking-drift', `阶段工作项来源漂移: ${id}`, checkpointRef, '按依赖重验受影响项,保留未受影响记录');
|
|
70
|
+
check('stage-tracking', drift.length ? 'failed' : 'passed', [checkpointRef], '只核对已登记工作项来源及完成证据摘要;结构与流转仍须原预检');
|
|
71
|
+
} catch (error) {
|
|
72
|
+
issue('tracking-unverifiable', `阶段追踪不可核验: ${error.message}`, checkpointRef, '修复追踪输入后重新检查');
|
|
73
|
+
check('stage-tracking', 'failed', [checkpointRef], error.message);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
check('stage-tracking', 'not-checked', [checkpointRef], '未登记追踪;按实例既有兼容或显式迁移入口处理,不自动补建');
|
|
77
|
+
}
|
|
78
|
+
if (value.status === 'blocked' && !diagnostics.some(x => x.severity === 'error')) issue('reason-missing', 'checkpoint 已标 blocked,原因未登记', checkpointRef, '补齐真实阻塞原因');
|
|
79
|
+
const blockers = [...new Set(diagnostics.filter(x => x.severity === 'error').map(x => x.message))];
|
|
80
|
+
const next_step = {
|
|
81
|
+
action_type: 'verify', work_unit: value.next_work_unit ?? null, cwd: root,
|
|
82
|
+
command: null, input_refs: [checkpointRef],
|
|
83
|
+
prerequisites: ['核验当前来源、Context、适用门禁与决定或延续', '核对当前范围、任务结果和允许写路径;输入变化时重验'],
|
|
84
|
+
};
|
|
85
|
+
let next_action;
|
|
86
|
+
if (blockers.length) {
|
|
87
|
+
next_step.action_type = 'repair';
|
|
88
|
+
next_action = `处理当前阻塞:${blockers[0]}`;
|
|
89
|
+
} else if (value.status === 'paused-human-gate') {
|
|
90
|
+
next_step.action_type = 'wait';
|
|
91
|
+
next_action = '核对当前会签责任方、资产与决定范围;满足已登记恢复条件后复验';
|
|
92
|
+
} else if (activeItems.some(item => item.progress === 'running')) {
|
|
93
|
+
next_step.action_type = 'inspect';
|
|
94
|
+
next_action = '核对运行中任务身份与实际结果;状态未知时不得重复派发';
|
|
95
|
+
} else if (activeItems.length && activeItems.every(item => item.progress === 'completed')) {
|
|
96
|
+
next_step.action_type = 'inspect';
|
|
97
|
+
next_action = '核验已有完成证据并重算下一工作单元,不直接重做';
|
|
98
|
+
} else {
|
|
99
|
+
next_action = value.next_work_unit ? `先核验当前输入及适用门禁,再由主控恢复 ${value.next_work_unit}` : '复核当前阶段验收与下一动作';
|
|
100
|
+
// Commands are argv arrays. They are recommendations, never executed by this view.
|
|
101
|
+
const script = value.next_work_unit === 'work-unit.spec-synthesis' ? 'scripts/verify-plan-spec-entry' : 'scripts/verify-lifecycle-checkpoint';
|
|
102
|
+
try { readFileSync(safeTrackingPath(root, script)); next_step.command = ['node', script, checkpointRef]; }
|
|
103
|
+
catch { issue('precheck-unavailable', `预检入口不可读: ${script}`, script, '补齐当前实例工具后执行预检', 'warning'); }
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
schema_version: 1, read_only: true, stage: value.stage, checkpoint_status: value.status,
|
|
107
|
+
work_unit: value.next_work_unit ?? null, owner, blockers, next_action,
|
|
108
|
+
execution_authorization: 'not-evaluated', verification_scope, diagnostics, next_step,
|
|
109
|
+
source_digests: { checkpoint: { ref: checkpointRef, digest: checkpoint.digest }, registry: { ref: registryRef, digest: registry.digest }, orchestration: { ref: contractRef, digest: contract.digest } },
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -12,11 +12,13 @@ import path from "node:path";
|
|
|
12
12
|
import { validateApiContractDecision } from "./api-contract-decision.mjs";
|
|
13
13
|
import { loadApprovalRecord, validateApprovalRecord } from "./approval-record.mjs";
|
|
14
14
|
import { validateBackendReview } from "./backend-review.mjs";
|
|
15
|
+
import { validateJsonSchema } from "./json-schema.mjs";
|
|
15
16
|
import { ROOT } from "./lifecycle-registry.mjs";
|
|
16
17
|
|
|
17
18
|
const IMPLEMENTATION_WORK_UNIT = "work-unit.slice-implementation";
|
|
18
19
|
const TICKET_DECOMPOSITION_WORK_UNIT = "work-unit.ticket-decomposition";
|
|
19
20
|
const REPOSITORY_PREPARATION_WORK_UNIT = "work-unit.implementation-repository-preparation";
|
|
21
|
+
const SERVICE_INITIALIZATION_WORK_UNIT = "work-unit.service-project-initialization";
|
|
20
22
|
|
|
21
23
|
function deepFreeze(value) {
|
|
22
24
|
if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
@@ -27,21 +29,22 @@ function deepFreeze(value) {
|
|
|
27
29
|
|
|
28
30
|
const NEXT_ROUTES = deepFreeze({
|
|
29
31
|
"work-unit.entry-triage": ["work-unit.plan-opportunity", "work-unit.plan-requirements"],
|
|
30
|
-
"work-unit.ssot-update": ["work-unit.skill-projection-sync", "work-unit.intensity-aware-verification"],
|
|
31
|
-
"work-unit.skill-projection-sync": ["work-unit.template-snapshot-build", "work-unit.intensity-aware-verification"],
|
|
32
|
-
"work-unit.template-snapshot-build": ["work-unit.attach-sync-integration", "work-unit.intensity-aware-verification"],
|
|
33
|
-
"work-unit.attach-sync-integration": ["work-unit.intensity-aware-verification"],
|
|
34
|
-
"work-unit.intensity-aware-verification": ["work-unit.intensity-aware-review"],
|
|
35
|
-
"work-unit.intensity-aware-review": ["work-unit.release-and-rollback"],
|
|
32
|
+
"work-unit.ssot-update": ["work-unit.skill-projection-sync", "work-unit.intensity-aware-verification-v2"],
|
|
33
|
+
"work-unit.skill-projection-sync": ["work-unit.template-snapshot-build", "work-unit.intensity-aware-verification-v2"],
|
|
34
|
+
"work-unit.template-snapshot-build": ["work-unit.attach-sync-integration", "work-unit.intensity-aware-verification-v2"],
|
|
35
|
+
"work-unit.attach-sync-integration": ["work-unit.intensity-aware-verification-v2"],
|
|
36
|
+
"work-unit.intensity-aware-verification-v2": ["work-unit.intensity-aware-review-v2"],
|
|
37
|
+
"work-unit.intensity-aware-review-v2": ["work-unit.release-and-rollback"],
|
|
36
38
|
"work-unit.release-and-rollback": [],
|
|
37
39
|
"work-unit.plan-opportunity": ["work-unit.plan-requirements", "work-unit.domain-strategy-design", "work-unit.stage-decision", "work-unit.spec-synthesis"],
|
|
38
40
|
"work-unit.plan-requirements": ["work-unit.domain-strategy-design", "work-unit.stage-decision", "work-unit.spec-synthesis"],
|
|
39
41
|
"work-unit.domain-strategy-design": ["work-unit.stage-decision", "work-unit.spec-synthesis"],
|
|
40
42
|
"work-unit.stage-decision": ["work-unit.spec-synthesis"],
|
|
41
|
-
"work-unit.spec-synthesis": ["work-unit.prototype-design", "work-unit.technical-analysis"],
|
|
42
|
-
"work-unit.prototype-design": ["work-unit.technical-analysis"],
|
|
43
|
+
"work-unit.spec-synthesis": ["work-unit.prototype-design-v2", "work-unit.technical-analysis"],
|
|
44
|
+
"work-unit.prototype-design-v2": ["work-unit.technical-analysis"],
|
|
43
45
|
"work-unit.technical-analysis": [REPOSITORY_PREPARATION_WORK_UNIT],
|
|
44
|
-
[REPOSITORY_PREPARATION_WORK_UNIT]: [TICKET_DECOMPOSITION_WORK_UNIT],
|
|
46
|
+
[REPOSITORY_PREPARATION_WORK_UNIT]: [SERVICE_INITIALIZATION_WORK_UNIT, TICKET_DECOMPOSITION_WORK_UNIT],
|
|
47
|
+
[SERVICE_INITIALIZATION_WORK_UNIT]: [REPOSITORY_PREPARATION_WORK_UNIT],
|
|
45
48
|
[TICKET_DECOMPOSITION_WORK_UNIT]: [IMPLEMENTATION_WORK_UNIT],
|
|
46
49
|
[IMPLEMENTATION_WORK_UNIT]: ["work-unit.frontend-implementation-verification", "work-unit.code-review"],
|
|
47
50
|
"work-unit.frontend-implementation-verification": ["work-unit.code-review"],
|
|
@@ -83,6 +86,8 @@ const BLOCKING_SIGNALS = Object.freeze({
|
|
|
83
86
|
backendDesignPrerequisitesMissing: "backend-design-prerequisites-missing",
|
|
84
87
|
legacyScaffoldReconciliationRequired: "legacy-scaffold-reconciliation-required",
|
|
85
88
|
prematureImplementationDetected: "premature-implementation-detected",
|
|
89
|
+
serviceInitializationInvalid: "service-project-initialization-invalid",
|
|
90
|
+
serviceInitializationIncomplete: "service-project-initialization-incomplete",
|
|
86
91
|
});
|
|
87
92
|
|
|
88
93
|
const allowedResult = (evidenceRefs = []) => ({
|
|
@@ -121,6 +126,52 @@ function readDecompositionResult(ref, read) {
|
|
|
121
126
|
}
|
|
122
127
|
}
|
|
123
128
|
|
|
129
|
+
/** The service branch reuses the approved v4 scaffold contract and its real verification. */
|
|
130
|
+
export function validateServiceProjectInitialization(state, { root = ROOT, exists = existsSync, read = (ref) => readFileSync(ref, "utf8"), completed = false } = {}) {
|
|
131
|
+
const request = state?.service_project_initialization;
|
|
132
|
+
const resolved = ref => path.isAbsolute(ref) ? ref : path.resolve(root, ref);
|
|
133
|
+
const present = ref => hasText(ref) && exists(resolved(ref));
|
|
134
|
+
const contents = ref => read(resolved(ref));
|
|
135
|
+
const document = ref => readDecompositionResult(resolved(ref), contents);
|
|
136
|
+
const blocked = (detail, incomplete = false) => blockedResult(
|
|
137
|
+
[incomplete ? BLOCKING_SIGNALS.serviceInitializationIncomplete : BLOCKING_SIGNALS.serviceInitializationInvalid], [detail]);
|
|
138
|
+
if (!request || !hasText(request.project_id) || !hasText(request.contract_ref) || !hasText(request.contract_digest) || !hasText(request.project_root)) return blocked("project_id, contract_ref, contract_digest and project_root required");
|
|
139
|
+
const contractFile = resolved(request.contract_ref);
|
|
140
|
+
if (!present(contractFile)) return blocked("approved v4 scaffold contract must be readable");
|
|
141
|
+
let contractBytes;
|
|
142
|
+
try { contractBytes = contents(contractFile); } catch { return blocked("approved v4 scaffold contract must be readable"); }
|
|
143
|
+
const contract = document(contractFile);
|
|
144
|
+
if (!contract || request.contract_digest !== `sha256:${createHash("sha256").update(contractBytes).digest("hex")}`) return blocked("current scaffold contract digest mismatch");
|
|
145
|
+
try { validateJsonSchema(contract, path.join(ROOT, ".template-spec/process/schemas/project-scaffold-contract.schema.json")); }
|
|
146
|
+
catch (error) { return blocked(`scaffold contract schema: ${error.message}`); }
|
|
147
|
+
if (contract.schema_version !== 4 || contract.status !== "approved" || contract.current_version !== true || !hasText(contract.persisted_ref) || contract.architecture_profile !== "mvc-data-analysis-v1" || contract.scaffold_kind !== "backend-mvc-data-analysis" || contract.generator_skill !== "yss-layered-mvc-scaffold-generator" || contract.init_git !== true || contract.project_name !== request.project_id || path.resolve(contract.target_output_dir, contract.project_name) !== path.resolve(request.project_root)) return blocked("current approved mvc-data-analysis-v1 initialization contract required");
|
|
148
|
+
const contractRoot = path.dirname(contractFile);
|
|
149
|
+
const contractExists = ref => exists(path.isAbsolute(ref) ? ref : path.resolve(contractRoot, ref));
|
|
150
|
+
if (!backendDesignPrerequisitesReady(contract.design_prerequisites, contractExists, contractRoot, request.project_id)) return blocked("current technical, data, API and engineering approval bindings required");
|
|
151
|
+
const handoff = path.resolve(path.dirname(contractFile), contract.context_handoff_ref ?? "");
|
|
152
|
+
if (!handoff.startsWith(`${path.dirname(contractFile)}${path.sep}`) || !present(handoff)) return blocked("CONTEXT handoff must be inside the contract directory");
|
|
153
|
+
let handoffBytes;
|
|
154
|
+
try { handoffBytes = contents(handoff); } catch { return blocked("CONTEXT handoff must be readable"); }
|
|
155
|
+
const handoffDigest = `sha256:${createHash("sha256").update(handoffBytes).digest("hex")}`;
|
|
156
|
+
if (contract.context_handoff_digest !== handoffDigest || request.context_handoff_digest !== handoffDigest) return blocked("CONTEXT handoff digest mismatch");
|
|
157
|
+
if (!completed) {
|
|
158
|
+
if (present(request.project_root)) return blocked("service project already exists; initialization is not repeatable");
|
|
159
|
+
return allowedResult([request.contract_ref, contract.context_handoff_ref]);
|
|
160
|
+
}
|
|
161
|
+
for (const field of ["manifest_ref", "verification_ref", "result_ref"]) if (!present(request[field])) return blocked(`${field} must be readable`, true);
|
|
162
|
+
const manifest = document(request.manifest_ref);
|
|
163
|
+
const verification = document(request.verification_ref);
|
|
164
|
+
const result = document(request.result_ref);
|
|
165
|
+
if (result?.result_schema !== "workflow-execution-result-v1" || result.work_unit !== SERVICE_INITIALIZATION_WORK_UNIT || result.result !== "completed" || ![request.manifest_ref, request.verification_ref].every(ref => result.evidence_refs?.includes(ref))) return blocked("completed Workflow Execution Result with manifest and verification evidence required", true);
|
|
166
|
+
if (manifest?.schema_version !== 4 || manifest.kind !== "service-project-initialization" || manifest.architecture_profile !== "mvc-data-analysis-v1" || manifest.project_name !== request.project_id || manifest.contract_digest !== request.contract_digest || manifest.completion_level !== "empty-scaffold-verified") return blocked("current v4 service Manifest required", true);
|
|
167
|
+
const phases = ["validate", "test", "package"];
|
|
168
|
+
if (verification?.status !== "passed" || verification.completion_level !== "empty-scaffold-verified" || path.resolve(verification.project_root ?? "") !== path.resolve(request.project_root) || !Array.isArray(verification.commands) || phases.some(phase => !verification.commands.some(item => item.phase === phase && item.exit_code === 0 && item.command?.startsWith(`./mvnw ${phase}`) && present(item.stdout_ref) && present(item.stderr_ref)))) return blocked("real Maven Wrapper validate/test/package evidence required", true);
|
|
169
|
+
const childContext = path.join(request.project_root, "CONTEXT.md");
|
|
170
|
+
const initialization = document(path.join(request.project_root, ".template-spec/process/service-initialization.json"));
|
|
171
|
+
if (!present(childContext) || !present(path.join(request.project_root, ".git")) || !present(path.join(path.dirname(request.project_root), "skillUtils/skills-lock.json")) || contents(childContext) !== handoffBytes || initialization?.contract_id !== contract.contract_id || initialization.context_handoff_digest !== handoffDigest) return blocked("child project identity, CONTEXT and skillUtils must match the contract", true);
|
|
172
|
+
return allowedResult([request.result_ref, request.manifest_ref, request.verification_ref]);
|
|
173
|
+
}
|
|
174
|
+
|
|
124
175
|
function artifactBindingReady(binding, exists) {
|
|
125
176
|
return hasText(binding?.ref) && /^v[1-9][0-9]*$/.test(binding?.version ?? "") && /^sha256:[a-f0-9]{64}$/.test(binding?.digest ?? "") && isReadable(binding.ref, exists);
|
|
126
177
|
}
|
|
@@ -271,7 +322,7 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
|
|
|
271
322
|
}
|
|
272
323
|
const routes = NEXT_ROUTES[currentWorkUnit] && scopedNextRoutes(currentWorkUnit, NEXT_ROUTES[currentWorkUnit], options);
|
|
273
324
|
if (!routes) return blockedResult([BLOCKING_SIGNALS.invalidRoute], ["known_current_work_unit"]);
|
|
274
|
-
if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT &&
|
|
325
|
+
if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT && !["work-unit.technical-analysis", SERVICE_INITIALIZATION_WORK_UNIT].includes(currentWorkUnit)) {
|
|
275
326
|
return blockedResult([BLOCKING_SIGNALS.technicalAnalysisRequired], ["work-unit.technical-analysis predecessor"]);
|
|
276
327
|
}
|
|
277
328
|
if (nextRoute === null && routes.length === 0) {
|
|
@@ -285,6 +336,12 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
|
|
|
285
336
|
}
|
|
286
337
|
return blockedResult(signals, ["allowed_next_route"]);
|
|
287
338
|
}
|
|
339
|
+
if (nextRoute === SERVICE_INITIALIZATION_WORK_UNIT) {
|
|
340
|
+
return validateServiceProjectInitialization(decisionState, { ...options, completed: false });
|
|
341
|
+
}
|
|
342
|
+
if (currentWorkUnit === SERVICE_INITIALIZATION_WORK_UNIT && nextRoute === REPOSITORY_PREPARATION_WORK_UNIT) {
|
|
343
|
+
return validateServiceProjectInitialization(decisionState, { ...options, completed: true });
|
|
344
|
+
}
|
|
288
345
|
if (nextRoute === REPOSITORY_PREPARATION_WORK_UNIT) {
|
|
289
346
|
const analysis = validateTechnicalAnalysisCompletion(decisionState, options);
|
|
290
347
|
if (analysis.result === "blocked") return analysis;
|
|
@@ -294,6 +351,10 @@ export function validateNextRoute(currentWorkUnit, nextRoute, decisionState, opt
|
|
|
294
351
|
if (entry.result === 'blocked' || nextRoute === 'work-unit.spec-synthesis') return entry;
|
|
295
352
|
}
|
|
296
353
|
if (nextRoute === TICKET_DECOMPOSITION_WORK_UNIT) {
|
|
354
|
+
if (decisionState?.service_project_initialization) {
|
|
355
|
+
const service = validateServiceProjectInitialization(decisionState, { ...options, completed: true });
|
|
356
|
+
if (service.result === "blocked") return service;
|
|
357
|
+
}
|
|
297
358
|
const readiness = validateImplementationRepositoriesReady(decisionState, options);
|
|
298
359
|
if (readiness.result === "blocked") return readiness;
|
|
299
360
|
}
|
|
@@ -83,7 +83,7 @@ function verifyOperations(document, resolveReference) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export function validateOpenApiDraftValidationRecord(recordFile, { root = TEMPLATE_ROOT, allowTemplate = false, schemaPath = path.join(TEMPLATE_ROOT, "
|
|
86
|
+
export function validateOpenApiDraftValidationRecord(recordFile, { root = TEMPLATE_ROOT, allowTemplate = false, schemaPath = path.join(TEMPLATE_ROOT, ".template-spec/process/schemas/openapi-draft-validation-record.schema.json") } = {}) {
|
|
87
87
|
const projectRoot = path.resolve(root);
|
|
88
88
|
const recordDocument = parseDocument(readFileSync(recordFile, "utf8"), { uniqueKeys: true, maxAliasCount: 0 });
|
|
89
89
|
ensure(!recordDocument.errors.length, `validation record YAML 无效: ${recordDocument.errors[0]?.message}`);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { parseDocument } from '../vendor/yaml.mjs';
|
|
5
|
+
import { safeTrackingPath } from './stage-tracking.mjs';
|
|
6
|
+
|
|
7
|
+
const digest = bytes => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
|
|
8
|
+
const read = (root, ref) => readFileSync(safeTrackingPath(root, ref));
|
|
9
|
+
const parse = bytes => {
|
|
10
|
+
const document = parseDocument(String(bytes), { uniqueKeys: true, maxAliasCount: 0 });
|
|
11
|
+
if (document.errors.length) throw new TypeError(document.errors[0].message);
|
|
12
|
+
return document.toJS({ maxAliasCount: 0 });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Draft data only: no checks, impacts, approvals or user decisions are inferred. */
|
|
16
|
+
export function preparePlanSpecEntry({ root, featureId, planRef, contextRef }) {
|
|
17
|
+
if (![root, featureId, planRef, contextRef].every(value => typeof value === 'string' && value.trim())) throw new TypeError('root, feature, plan and context-reconciliation are required');
|
|
18
|
+
const identity = parse(read(root, 'yss-project.yaml'));
|
|
19
|
+
if (identity.schema_version !== 1 || identity.repository_mode !== 'project-instance') throw new TypeError('Plan 入口仅适用于 project-instance');
|
|
20
|
+
const registryRef = '.template-spec/process/lifecycle-registry.yaml';
|
|
21
|
+
const registry = parse(read(root, registryRef));
|
|
22
|
+
const policy = registry.stages?.find(stage => stage.id === 'stage.plan')?.spec_entry;
|
|
23
|
+
if (!policy?.required_checks?.length) throw new TypeError('Plan 入口检查合同缺失');
|
|
24
|
+
const refs = [...new Set([planRef, 'CONTEXT.md', registryRef, contextRef])];
|
|
25
|
+
const basis = refs.map(ref => ({ ref, digest: digest(read(root, ref)) }));
|
|
26
|
+
const review_candidate = {
|
|
27
|
+
schema_version: 1, kind: 'plan-entry-review', gate_id: 'gate.plan-approved', feature_id: featureId,
|
|
28
|
+
plan_ref: planRef, context_reconciliation_ref: contextRef, basis,
|
|
29
|
+
checks: Object.fromEntries(policy.required_checks.map(id => [id, { status: 'pending', evidence_refs: [] }])),
|
|
30
|
+
open_items: [],
|
|
31
|
+
impacts: Object.fromEntries(Object.values(policy.check_impacts ?? {}).map(impact => [impact, null])),
|
|
32
|
+
internal_checks: Object.fromEntries(Object.keys(policy.check_impacts ?? {}).map(id => [id, { status: 'pending', evidence_refs: [] }])),
|
|
33
|
+
};
|
|
34
|
+
return { schema_version: 1, status: 'draft', review_candidate, missing_requirements: ['补齐检查证据与影响判断', '展示当前审阅包并提供真实用户决定,或按用户决定协议核验绑定当前范围的 plan_continuation_ref;未知或实质变化须重新决定'], approval_created: false };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function diffPlanSpecEntry({ root, reviewRef }) {
|
|
38
|
+
if (!root || !reviewRef) throw new TypeError('root and review are required');
|
|
39
|
+
const review = parse(read(root, reviewRef));
|
|
40
|
+
if (review.kind !== 'plan-entry-review' || review.schema_version !== 1 || !Array.isArray(review.basis)) throw new TypeError('不是 Plan 入口审阅包');
|
|
41
|
+
const changed_refs = [], missing_refs = [];
|
|
42
|
+
for (const item of review.basis) {
|
|
43
|
+
if (!item?.ref || !item?.digest) throw new TypeError('basis 缺少 ref 或 digest');
|
|
44
|
+
try { if (digest(read(root, item.ref)) !== item.digest) changed_refs.push(item.ref); }
|
|
45
|
+
catch { missing_refs.push(item.ref); }
|
|
46
|
+
}
|
|
47
|
+
return { schema_version: 1, review_ref: reviewRef, status: changed_refs.length || missing_refs.length ? 'stale' : 'current', changed_refs, missing_refs, approval_created: false };
|
|
48
|
+
}
|
|
@@ -7,7 +7,7 @@ const fail = message => { throw new TypeError(`plan-spec-entry-blocked: ${messag
|
|
|
7
7
|
const text = value => typeof value === 'string' && value.trim().length > 0;
|
|
8
8
|
|
|
9
9
|
export function planEntryPolicy(options = {}) {
|
|
10
|
-
const registry = decisionIO(options).document('
|
|
10
|
+
const registry = decisionIO(options).document('.template-spec/process/lifecycle-registry.yaml');
|
|
11
11
|
const policy = registry.stages.find(stage => stage.id === 'stage.plan')?.spec_entry;
|
|
12
12
|
if (!policy?.required_checks?.length || !policy?.gate_impacts) fail('缺少 Plan 入口策略');
|
|
13
13
|
const gateIds = registry.gates.filter(gate => gate.stage === 'stage.plan').map(gate => gate.id).sort();
|
|
@@ -33,7 +33,7 @@ export function assertPlanSpecEntry(state, options = {}) {
|
|
|
33
33
|
const evidence = refs => {
|
|
34
34
|
if (!Array.isArray(refs) || !refs.length || refs.some(ref => !basis.has(ref))) fail('检查项缺少当前依据');
|
|
35
35
|
};
|
|
36
|
-
for (const ref of [review.plan_ref, 'CONTEXT.md', '
|
|
36
|
+
for (const ref of [review.plan_ref, 'CONTEXT.md', '.template-spec/process/lifecycle-registry.yaml', review.context_reconciliation_ref]) {
|
|
37
37
|
if (!basis.has(ref)) fail(`必需依据未绑定: ${ref}`);
|
|
38
38
|
}
|
|
39
39
|
if (Object.keys(review.checks || {}).length !== policy.required_checks.length) fail('检查项缺失或存在未知项');
|
|
@@ -62,7 +62,7 @@ export function assertPlanSpecEntry(state, options = {}) {
|
|
|
62
62
|
} else if (gate.status !== 'not-applicable' || !text(gate.reason)) fail(`未命中门禁须有原因和依据: ${gateId}`);
|
|
63
63
|
}
|
|
64
64
|
// 门禁依赖不能通过将上游标成 N/A 来跳过。
|
|
65
|
-
const registry = io.document('
|
|
65
|
+
const registry = io.document('.template-spec/process/lifecycle-registry.yaml');
|
|
66
66
|
for (const gate of registry.checks.filter(gate => gate.stage === 'stage.plan')) {
|
|
67
67
|
if (review.internal_checks[gate.id]?.status === 'approved') {
|
|
68
68
|
for (const dependency of gate.requires_checks || []) if (review.internal_checks[dependency]?.status !== 'approved') fail(`门禁依赖未批准: ${dependency}`);
|