create-yss-spec 3.5.0 → 3.5.3
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 +6 -2
- package/package.json +1 -1
- package/src/api/_sync-service.js +31 -6
- package/src/cli/args.js +2 -0
- package/src/cli/help.js +4 -1
- package/src/commands/attach.js +9 -3
- package/src/commands/diff.js +1 -0
- package/src/commands/doctor.js +1 -0
- package/src/commands/init.js +2 -1
- package/src/commands/sync.js +1 -0
- package/src/family-identity.js +1 -1
- package/src/template/asset-runtime.js +59 -49
- package/src/template/attach-planner.js +1 -1
- package/src/template/distribution-runtime.js +9 -9
- package/src/template/instance-runtime.js +9 -9
- package/src/template/layout-migration.js +160 -0
- package/src/template/migration-runtime.js +2 -2
- package/src/template/sync-planner.js +1 -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/codebase-design/SKILL.md +4 -0
- package/template/{.codex/skills/improve-codebase-architecture/SKILL.md → .agents/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.agents/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.agents/skills/frontend-commit/SKILL.md +4 -93
- package/template/.agents/skills/git-commit-core/SKILL.md +18 -0
- 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/java-backend-commit/SKILL.md +4 -96
- package/template/.agents/skills/llm-wiki/SKILL.md +12 -13
- package/template/.agents/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.agents/skills/llm-wiki/references/compile.md +21 -114
- package/template/.agents/skills/llm-wiki/references/discover.md +3 -3
- package/template/.agents/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.agents/skills/llm-wiki/references/lint.md +9 -46
- package/template/.agents/skills/llm-wiki/references/query.md +9 -18
- package/template/.agents/skills/llm-wiki/references/schema.md +56 -29
- package/template/.agents/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.agents/skills/llm-wiki/references/writing.md +4 -4
- package/template/.agents/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.agents/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.agents/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.agents/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.agents/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.agents/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.agents/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.agents/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.agents/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.agents/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.agents/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.agents/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.agents/skills/prototype/LOGIC.md +1 -1
- package/template/.agents/skills/prototype/SKILL.md +5 -19
- package/template/.agents/skills/prototype-review/SKILL.md +4 -4
- package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +11 -11
- 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-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-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 +11 -9
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
- 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-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- 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-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 +17 -17
- package/template/.agents/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +24 -16
- package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.agents/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +4 -4
- package/template/.agents/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +7 -7
- 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 +2 -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 +6 -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/codebase-design/SKILL.md +4 -0
- package/template/{.pi/skills/improve-codebase-architecture/SKILL.md → .codex/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.codex/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.codex/skills/frontend-commit/SKILL.md +4 -93
- package/template/.codex/skills/git-commit-core/SKILL.md +18 -0
- 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/java-backend-commit/SKILL.md +4 -96
- package/template/.codex/skills/llm-wiki/SKILL.md +12 -13
- package/template/.codex/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.codex/skills/llm-wiki/references/compile.md +21 -114
- package/template/.codex/skills/llm-wiki/references/discover.md +3 -3
- package/template/.codex/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.codex/skills/llm-wiki/references/lint.md +9 -46
- package/template/.codex/skills/llm-wiki/references/query.md +9 -18
- package/template/.codex/skills/llm-wiki/references/schema.md +56 -29
- package/template/.codex/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.codex/skills/llm-wiki/references/writing.md +4 -4
- package/template/.codex/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.codex/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.codex/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.codex/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.codex/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.codex/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.codex/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.codex/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.codex/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.codex/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.codex/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.codex/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.codex/skills/prototype/LOGIC.md +1 -1
- package/template/.codex/skills/prototype/SKILL.md +5 -19
- package/template/.codex/skills/prototype-review/SKILL.md +4 -4
- package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +11 -11
- 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-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-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 +11 -9
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
- 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-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- 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-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 +17 -17
- package/template/.codex/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +24 -16
- package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.codex/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +4 -4
- package/template/.codex/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +7 -7
- 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 +2 -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 +6 -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/codebase-design/SKILL.md +4 -0
- package/template/.cursor/skills/{improve-codebase-architecture/SKILL.md → codebase-design/references/architecture-audit.md} +3 -9
- package/template/.cursor/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.cursor/skills/frontend-commit/SKILL.md +4 -93
- package/template/.cursor/skills/git-commit-core/SKILL.md +18 -0
- 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/java-backend-commit/SKILL.md +4 -96
- package/template/.cursor/skills/llm-wiki/SKILL.md +12 -13
- package/template/.cursor/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.cursor/skills/llm-wiki/references/compile.md +21 -114
- package/template/.cursor/skills/llm-wiki/references/discover.md +3 -3
- package/template/.cursor/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.cursor/skills/llm-wiki/references/lint.md +9 -46
- package/template/.cursor/skills/llm-wiki/references/query.md +9 -18
- package/template/.cursor/skills/llm-wiki/references/schema.md +56 -29
- package/template/.cursor/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.cursor/skills/llm-wiki/references/writing.md +4 -4
- package/template/.cursor/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.cursor/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.cursor/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.cursor/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.cursor/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.cursor/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.cursor/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.cursor/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.cursor/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.cursor/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.cursor/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.cursor/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.cursor/skills/prototype/LOGIC.md +1 -1
- package/template/.cursor/skills/prototype/SKILL.md +5 -19
- package/template/.cursor/skills/prototype-review/SKILL.md +4 -4
- package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +11 -11
- 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-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-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 +11 -9
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
- 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-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- 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-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 +17 -17
- package/template/.cursor/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +24 -16
- package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +4 -4
- package/template/.cursor/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +7 -7
- 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 +2 -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 +6 -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/codebase-design/SKILL.md +4 -0
- package/template/{.agents/skills/improve-codebase-architecture/SKILL.md → .pi/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.pi/skills/cross-repo-implementation-routing/SKILL.md +2 -2
- package/template/.pi/skills/frontend-commit/SKILL.md +4 -93
- package/template/.pi/skills/git-commit-core/SKILL.md +18 -0
- 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/java-backend-commit/SKILL.md +4 -96
- package/template/.pi/skills/llm-wiki/SKILL.md +12 -13
- package/template/.pi/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.pi/skills/llm-wiki/references/compile.md +21 -114
- package/template/.pi/skills/llm-wiki/references/discover.md +3 -3
- package/template/.pi/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.pi/skills/llm-wiki/references/lint.md +9 -46
- package/template/.pi/skills/llm-wiki/references/query.md +9 -18
- package/template/.pi/skills/llm-wiki/references/schema.md +56 -29
- package/template/.pi/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.pi/skills/llm-wiki/references/writing.md +4 -4
- package/template/.pi/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.pi/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.pi/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.pi/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.pi/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.pi/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.pi/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.pi/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.pi/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.pi/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.pi/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.pi/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.pi/skills/prototype/LOGIC.md +1 -1
- package/template/.pi/skills/prototype/SKILL.md +5 -19
- package/template/.pi/skills/prototype-review/SKILL.md +4 -4
- package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +11 -11
- 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-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-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 +11 -9
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +3 -4
- 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-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- 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-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 +17 -17
- package/template/.pi/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +10 -10
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +85 -47
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +24 -16
- package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.pi/skills/yss-product-lifecycle/references/request-triage.md +2 -0
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +4 -4
- package/template/.pi/skills/yss-product-lifecycle/references/user-decisions.md +2 -2
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +7 -7
- 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 +2 -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 +6 -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 +2 -2
- 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 +6 -6
- 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 +17 -2
- package/template/{docs → .template-spec}/agents/triage-labels.md +1 -1
- package/template/{docs → .template-spec}/agents/yss-skill-registry.yaml +12 -31
- package/template/{docs → .template-spec}/architecture/README.md +5 -36
- package/template/{docs → .template-spec}/architecture/templates/tech-design-template.md +3 -1
- package/template/{docs → .template-spec}/design/README.md +12 -11
- package/template/{docs → .template-spec}/design/design.md +19 -19
- package/template/{docs/design/templates/interaction-spec-template.md → .template-spec/design/templates/examples/model-publishing-interaction.example.md} +5 -3
- 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/competitive-analysis-template.md +2 -2
- package/template/{docs → .template-spec}/plan/templates/plan-template.md +1 -1
- package/template/{docs → .template-spec}/process/contract-reading.md +25 -1
- package/template/{docs → .template-spec}/process/lifecycle-artifact-map.md +5 -5
- package/template/.template-spec/process/lifecycle-registry-baseline.json +255 -0
- package/template/{docs → .template-spec}/process/lifecycle-registry.yaml +25 -12
- package/template/{docs → .template-spec}/process/plan-migration.md +1 -1
- package/template/.template-spec/process/research-completion.md +23 -0
- package/template/{docs → .template-spec}/process/schemas/digital-human-task-package.schema.json +209 -6
- package/template/{docs → .template-spec}/process/schemas/frontend-implementation-evidence.schema.json +7 -15
- 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/.template-spec/process/subagent-collaboration.md +21 -0
- package/template/{docs → .template-spec}/process/templates/frontend-implementation-verification-template.yaml +15 -1
- 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 +13 -13
- package/template/CONTEXT.md +8 -4
- package/template/README.md +33 -45
- package/template/scripts/backend-delivery +1 -1
- package/template/scripts/contract +5 -5
- 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 +66 -11
- package/template/scripts/lib/delivery-preflight.mjs +6 -6
- package/template/scripts/lib/design-md.mjs +2 -2
- package/template/scripts/lib/digital-human-roles.mjs +2 -2
- package/template/scripts/lib/execution-evidence.mjs +51 -0
- 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 +3 -3
- package/template/scripts/lib/implementation-contract-compiler.mjs +2 -0
- package/template/scripts/lib/lifecycle-context-query.mjs +26 -6
- package/template/scripts/lib/lifecycle-registry.mjs +46 -7
- package/template/scripts/lib/lifecycle-status.mjs +137 -0
- package/template/scripts/lib/lifecycle-transition.mjs +90 -11
- package/template/scripts/lib/maintenance-research.mjs +63 -0
- 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/read-only-intake.mjs +132 -0
- package/template/scripts/lib/skill-registry.mjs +10 -9
- package/template/scripts/lib/skill-supply-chain.mjs +5 -1
- 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 +4 -4
- 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 +10 -3
- 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/prepare-read-only-intake +16 -0
- package/template/scripts/run-read-only-intake +14 -0
- package/template/scripts/strategic-consumer-entry +1 -1
- package/template/scripts/strategic-handoff +1 -1
- package/template/scripts/verify-digital-human-task-package +2 -2
- package/template/scripts/verify-frontend-implementation-evidence +25 -2
- package/template/scripts/verify-governance-layout +15 -0
- package/template/scripts/verify-lifecycle-checkpoint +1 -1
- package/template/scripts/verify-maintenance-research +13 -0
- package/template/scripts/verify-project-instance +2 -0
- package/template/scripts/verify-scaffold-architecture-decisions +1 -1
- package/template/scripts/verify-strategic-context-import +3 -3
- package/template/skills-lock.json +82 -139
- package/template.manifest.json +135 -46
- package/template.snapshot.json +5 -6
- package/template/.agents/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.agents/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.agents/skills/prototype/UI.md +0 -112
- package/template/.agents/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.agents/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.agents/skills/wait-what/SKILL.md +0 -7
- package/template/.agents/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.codex/skills/data-analytics/.app.json +0 -84
- package/template/.codex/skills/data-analytics/.codex-plugin/plugin.json +0 -66
- package/template/.codex/skills/data-analytics/.mcp.json +0 -30
- package/template/.codex/skills/data-analytics/AGENTS.md +0 -20
- package/template/.codex/skills/data-analytics/DEPENDENCIES.MD +0 -27
- package/template/.codex/skills/data-analytics/README.md +0 -60
- package/template/.codex/skills/data-analytics/__yss_dotfile__.gitignore +0 -2
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part005 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part006 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part005 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part006 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part007 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-small.svg +0 -5
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience.png +0 -0
- package/template/.codex/skills/data-analytics/assets/datascience.svg +0 -10
- package/template/.codex/skills/data-analytics/mcp/server.cjs +0 -2964
- package/template/.codex/skills/data-analytics/package-lock.json +0 -3048
- package/template/.codex/skills/data-analytics/package.json +0 -43
- package/template/.codex/skills/data-analytics/scripts/normalize-widget-assets.mjs +0 -75
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +0 -137
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/references/quality-checks.md +0 -29
- package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +0 -148
- package/template/.codex/skills/data-analytics/skills/build-dashboard/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/bi-platform-dashboard.md +0 -18
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/html-dashboard.md +0 -24
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/mcp-artifact-dashboard.md +0 -71
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/streamlit-dashboard.md +0 -85
- package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +0 -207
- package/template/.codex/skills/data-analytics/skills/build-report/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/assets/executive-report-shell.html +0 -70
- package/template/.codex/skills/data-analytics/skills/build-report/assets/technical-report-shell.html +0 -66
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +0 -108
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/__init__.py +0 -1
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +0 -52
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/constants.py +0 -61
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/docx_writer.py +0 -362
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/html_parser.py +0 -829
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/model.py +0 -30
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +0 -127
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/quality.py +0 -374
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/rendering.py +0 -613
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/table_utils.py +0 -54
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/utils.py +0 -16
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc_plan.py +0 -9
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/tests/test_delivery_plan.py +0 -45
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +0 -77
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/scripts/report_to_google_slides.py +0 -2379
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +0 -88
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/executive-report.md +0 -97
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +0 -59
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/technical-report.md +0 -75
- package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +0 -103
- package/template/.codex/skills/data-analytics/skills/design-kpis/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +0 -68
- package/template/.codex/skills/data-analytics/skills/gather-business-context/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/index/SKILL.md +0 -251
- package/template/.codex/skills/data-analytics/skills/index/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +0 -131
- package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +0 -141
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/references/report-templates.md +0 -32
- package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +0 -106
- package/template/.codex/skills/data-analytics/skills/market-sizing/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +0 -130
- package/template/.codex/skills/data-analytics/skills/metric-diagnostics/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +0 -141
- package/template/.codex/skills/data-analytics/skills/product-business-analysis/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +0 -178
- package/template/.codex/skills/data-analytics/skills/spreadsheets/agents/openai.yaml +0 -9
- package/template/.codex/skills/data-analytics/skills/spreadsheets/assets/file-spreadsheet.png +0 -0
- package/template/.codex/skills/data-analytics/skills/spreadsheets/charts.md +0 -31
- package/template/.codex/skills/data-analytics/skills/spreadsheets/references/artifact_tool_api.md +0 -466
- package/template/.codex/skills/data-analytics/skills/spreadsheets/style_guidelines.md +0 -99
- package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +0 -197
- package/template/.codex/skills/data-analytics/skills/user-context/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +0 -26
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/source-category-config.json +0 -51
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/user-context-config.md +0 -66
- package/template/.codex/skills/data-analytics/skills/user-context/references/automation.md +0 -69
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +0 -204
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-state-template.json +0 -87
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +0 -497
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/connector-playbook.md +0 -74
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/setup.md +0 -65
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/skill-template.md +0 -160
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/source-intake.md +0 -75
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/weekly-polling-automation.md +0 -96
- package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +0 -263
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +0 -1462
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/init_user_context_state.py +0 -128
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/reset_user_context_state.py +0 -101
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +0 -499
- package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +0 -978
- package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +0 -126
- package/template/.codex/skills/data-analytics/skills/validate-data/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/validate-data/references/validation-methods.md +0 -70
- package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +0 -157
- package/template/.codex/skills/data-analytics/skills/visualize-data/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/visualize-data/references/seaborn-templates.md +0 -774
- package/template/.codex/skills/data-analytics/src/DESIGN.md +0 -222
- package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +0 -3666
- package/template/.codex/skills/data-analytics/src/analytics-app/analytics-layout.test.mjs +0 -136
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartFrame.tsx +0 -54
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartLegend.tsx +0 -96
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartRenderer.tsx +0 -1647
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartTooltip.tsx +0 -245
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-app-helpers.tsx +0 -462
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-capabilities.ts +0 -107
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-compatibility.ts +0 -164
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-contract.ts +0 -192
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-theme.ts +0 -203
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-tokens.css +0 -619
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-transforms.ts +0 -402
- package/template/.codex/skills/data-analytics/src/analytics-app/fonts/SystemSansVariableVF.woff2 +0 -0
- package/template/.codex/skills/data-analytics/src/analytics-app/imageExport.ts +0 -370
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/AnalyticsLayoutCanvas.tsx +0 -536
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/RichMarkdown.tsx +0 -681
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/analyticsLayoutCore.ts +0 -164
- package/template/.codex/skills/data-analytics/src/analytics-app/main.tsx +0 -21
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/chart_contract.py +0 -472
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/check_analytics_app_runtime_links.py +0 -75
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/design_contract.py +0 -142
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/package_utils.py +0 -142
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/tests/test_package_utils.py +0 -377
- package/template/.codex/skills/data-analytics/src/analytics-app/styles.css +0 -3468
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.d.ts +0 -44
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.jsx +0 -639
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/data-table.css +0 -327
- package/template/.codex/skills/data-analytics/src/analytics-app/tokens.css +0 -225
- package/template/.codex/skills/data-analytics/src/analytics-app/types.ts +0 -204
- package/template/.codex/skills/data-analytics/src/analytics-app-core.md +0 -85
- package/template/.codex/skills/data-analytics/src/codex-style-contract.md +0 -30
- package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.html +0 -12
- package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.jsx +0 -1008
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.css +0 -2117
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.html +0 -122
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.js +0 -3588
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.css +0 -483
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.html +0 -32
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.js +0 -333
- package/template/.codex/skills/data-analytics/src/mcp-host.js +0 -153
- package/template/.codex/skills/data-analytics/src/recharts-config.js +0 -315
- package/template/.codex/skills/data-analytics/src/recharts-renderer.jsx +0 -294
- package/template/.codex/skills/data-analytics/src/sql-source-view.css +0 -33
- package/template/.codex/skills/data-analytics/src/sql-source-view.js +0 -157
- package/template/.codex/skills/data-analytics/src/styles/codex-theme.css +0 -121
- package/template/.codex/skills/data-analytics/src/table-renderer.jsx +0 -28
- package/template/.codex/skills/data-analytics/tests/chart-transforms.test.mjs +0 -87
- package/template/.codex/skills/data-analytics/tests/funnel-smoke.html +0 -105
- package/template/.codex/skills/data-analytics/tests/inline-widget-compare.html +0 -233
- package/template/.codex/skills/data-analytics/tests/mcp-server.test.mjs +0 -1500
- package/template/.codex/skills/data-analytics/tests/native-style-contract.test.mjs +0 -219
- package/template/.codex/skills/data-analytics/tests/recharts-config.test.mjs +0 -144
- package/template/.codex/skills/data-analytics/tests/recharts-renderer.test.mjs +0 -11
- package/template/.codex/skills/data-analytics/tests/rich-markdown.test.mjs +0 -54
- package/template/.codex/skills/data-analytics/tests/widget-render-harness.html +0 -321
- package/template/.codex/skills/data-analytics/tsconfig.json +0 -19
- package/template/.codex/skills/data-analytics/vite.config.ts +0 -46
- package/template/.codex/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.codex/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.codex/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.codex/skills/prototype/UI.md +0 -112
- package/template/.codex/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.codex/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.codex/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.codex/skills/wait-what/SKILL.md +0 -7
- package/template/.codex/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.cursor/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.cursor/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.cursor/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.cursor/skills/prototype/UI.md +0 -112
- package/template/.cursor/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.cursor/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.cursor/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.cursor/skills/wait-what/SKILL.md +0 -7
- package/template/.cursor/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.pi/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.pi/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.pi/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.pi/skills/prototype/UI.md +0 -112
- package/template/.pi/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.pi/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.pi/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.pi/skills/wait-what/SKILL.md +0 -7
- package/template/.pi/skills/wait-what/agents/openai.yaml +0 -5
- package/template/docs/agents/archify-integration.md +0 -19
- package/template/docs/agents/domain.md +0 -31
- package/template/docs/design/design-system-sync.yaml +0 -13
- 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/tokens/.design-md-projection.json +0 -13
- package/template/docs/engineering/evidence/aliyun-artifact-resolution.json +0 -446
- package/template/docs/process/MATT-POCOCK-ENGINEERING-SKILLS.md +0 -13
- package/template/docs/process/github-workflows.md +0 -52
- package/template/docs/process/subagent-collaboration.md +0 -13
- package/template/docs/templates/release-note-template.md +0 -14
- package/template/docs/templates/retro-report-template.md +0 -16
- package/template/docs/templates/verification-record-template.md +0 -53
- /package/template/.agents/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.codex/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.cursor/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.pi/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.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-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-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/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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 写入事务
|
|
2
|
+
|
|
3
|
+
init / refresh / rebuild / ingest 使用同一 `plan → apply → verify → finalize` 流程。migrate、feedback 也走此流程。计划和候选草稿放在已授权的工作目录;尚未确认 ingest 时只展示候选,不写 wiki 或 raw。不要把授权字段当作向用户索取重复确认的理由:已确认的一组来源与页面范围可复用。新增页面、冲突处置、人工正文改变超出既有范围时先展示差异,取得真实决定。脚本验证写清单,不能证明字段背后的人类授权。
|
|
4
|
+
|
|
5
|
+
## 计划请求
|
|
6
|
+
|
|
7
|
+
Agent 先读 live 输入,准备候选文章、raw、索引和 manifest 元数据,逐条检查关键断言。原文件保持不动。传入 request JSON:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"operation": "refresh",
|
|
12
|
+
"authorization": {"confirmed": true, "paths": ["raw/guide.md", "wiki/术语.md", ".wiki-manifest.json", "wiki/log.md"]},
|
|
13
|
+
"writes": [{"path": "raw/guide.md", "content": "完整候选内容"}, {"path": "wiki/术语.md", "content": "完整候选文章"}],
|
|
14
|
+
"compilations": [{
|
|
15
|
+
"articleId": "术语",
|
|
16
|
+
"consumed": {"guide": {"effectiveDigest": "实际读取版本的 SHA256", "rawDigest": "候选 raw 的 SHA256", "extractorVersion": "identity-v1"}},
|
|
17
|
+
"evidence": [{"sourceId": "guide", "inputPath": "docs/guide.md", "startLine": 1, "endLine": 3, "excerptDigest": "选中行的 SHA256", "claim": "文章中的实际断言", "risk": "general"}]
|
|
18
|
+
}]
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
示例中的摘要占位符必须替换。`manifest` 可选:init 必须给 [schema](schema.md) v2 草稿;其他模式仅为添加已确认来源、文章或调整导航依赖等元数据提供。已有 articleDigest/compiledFrom/verification 不可手工推进,只由 compilations 更新。原来未核验的外源可摄取但须保留 unverified,不能编造本地 livePath 或 online 核验证据。
|
|
23
|
+
|
|
24
|
+
source 的 document/code-surface extractorVersion 为 identity-v1;derived 为 `kind:version:`,prose-note 最后再拼 rules 和 inputDigests JSON 的 SHA256。可用 inventory hash observations.version 取得当前版本;新增 raw 尚未落盘时计算候选 raw 摘要。consumed 必须绑定实际读过的输入;计划重算观察值并检查二者一致,不能“随手 hash”充当阅读或语义核验。
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node <skill-root>/scripts/transaction.mjs plan --wiki <root> --repo <repo> --request <request.json> > <plan.json>
|
|
28
|
+
node <skill-root>/scripts/transaction.mjs apply --wiki <root> --repo <repo> --plan <plan.json>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
plan 不写 wiki;返回 sources/articles/protected/conflicts、完整 writes `{path,before,after,content,original}`、inputs 摘要和计划 digest。检查准确范围后应用。source 删除只留 tombstone 与快照,不能删 source 或 article 记录。未被编译的文章保持旧 watermark;更新 raw 不会清除它们的 stale。human-owned 自动正文修改拒绝;已显式授权链接修复时传 `linkRepairs: [articleId]`,脚本严格比较 wikilink 外所有字节,不能夹带正文变更。
|
|
32
|
+
|
|
33
|
+
apply 先核验全部输入摘要,变化即 PLAN_STALE,必须重新计划。只写计划内文件;内部 `.wiki-staging/<id>/` 保存候选与完成收据,`.wiki-transaction.json` 是恢复记录,`.wiki-lock` 是事务锁,`.wiki-runner-lock` 防止并发恢复。内部文件位于同一 wiki-root,纳入写操作授权;不分发或公开其中的来源原文/备份。共享 index/log/manifest 由主控生成。manifest、日志最后发布;未完成期间查询拒绝读取混合版本。
|
|
34
|
+
|
|
35
|
+
## 恢复和取消
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node <skill-root>/scripts/transaction.mjs resume --wiki <root> --repo <repo>
|
|
39
|
+
node <skill-root>/scripts/transaction.mjs abort --wiki <root> --repo <repo>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
resume 只补未完成步骤、验证 staging、检查来源是否仍为原计划版本。abort 先检查全部目标,再仅恢复该事务改动;目标被人工修改时停止,绝不覆盖。真实进程崩溃若留下 runner lock,禁止自动抢占:先核实原进程已停止,展示锁和 journal,由用户明确选择清除该残留执行锁后再 resume/abort。事务锁本身由恢复流程管理,不手删以绕过冲突。
|
|
43
|
+
|
|
44
|
+
相同计划重放复用完成收据,不重复追加日志。aborted 计划是终态,重新执行用新计划 ID。保留内部 journal/staging/收据用于追溯;本轮不自动清理。最终做结构 lint + status + advise,明确剩余 freshness,结构维护完成不等于所有知识 current。
|
|
45
|
+
|
|
46
|
+
## 人工反馈
|
|
47
|
+
|
|
48
|
+
`feedback.mjs --wiki <root> --request <feedback.json>` 预览,`--apply` 应用。request 需要 confirmed:true、id、articleId、targetDigest、locator.quote、issue,可加 status。accepted/partial resolution 需要 transactionId/beforeDigest/afterDigest/note,对应实际文章修改且已核验;rejected/deferred 用 resolution.note 记录理由。反馈的重新定位与修复分开,反馈自身不修改文章。
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- `# H1` immediately followed by a summary paragraph.
|
|
6
6
|
- `[[ArticleId]]` only; no relative `[[../other-wiki]]` inside a Karpathy wiki (cross-wiki use markdown links).
|
|
7
|
-
- Close with `## 来源` listing raw
|
|
7
|
+
- Close with nonempty `## 来源` listing raw/live paths and line ranges actually read. Record factual article dependencies in dependsOnArticles; ordinary links are navigation.
|
|
8
8
|
- Optional `## Status` only when cited sources conflict or live disagrees with old raw. See [schema.md](schema.md). Missing Status is not a defect.
|
|
9
9
|
- Do not invent enum values, table names, or endpoints. If unread, write「见源码」.
|
|
10
10
|
|
|
@@ -25,11 +25,11 @@ Core pages: deep (state machines, HTTP semantics, transactions). Extension pages
|
|
|
25
25
|
When 2+ article groups have no shared files:
|
|
26
26
|
|
|
27
27
|
- Each prompt lists exact write paths. Those agents must not touch `index.md`, `log.md`, `.wiki-manifest.json`, or `CLAUDE.md`.
|
|
28
|
-
- Return
|
|
29
|
-
- Orchestrator
|
|
28
|
+
- Return candidate contents + paths + consumed source versions + claim evidence. Write only isolated staging, never published articles.
|
|
29
|
+
- Orchestrator checks evidence and uses the unified transaction to publish index, articles, manifest and log.
|
|
30
30
|
|
|
31
31
|
When article groups share no files, dispatch parallel subagents with disjoint write scopes.
|
|
32
32
|
|
|
33
33
|
## Human-owned
|
|
34
34
|
|
|
35
|
-
Frontmatter `human-owned: true` or manifest `humanOwned: true`. Refresh/rebuild leave the body;
|
|
35
|
+
Frontmatter `human-owned: true` or manifest `humanOwned: true`. Refresh/rebuild leave the body; only explicitly authorized link repairs may change `[[wikilink]]` targets. Conflicting flags are reported; neither side overrides a true flag. Do not add or rewrite `## Status` on these pages.
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import { readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { exists } from "./
|
|
5
|
+
import { exists, safePath, loadManifest, frontmatter, assertReadable, cliError } from "./core.mjs";
|
|
6
6
|
import { articlesDir, extractLinks, INFRA } from "./lint-wikilinks.mjs";
|
|
7
|
-
|
|
8
7
|
const SOURCE_HEADING_RE = /^##\s+来源\s*$/m;
|
|
9
8
|
const H1_RE = /^#\s+(.+?)\s*$/m;
|
|
10
9
|
const NUMBER_RE = /\b\d+(?:\.\d+)?[A-Za-z%]+\b/g;
|
|
@@ -13,68 +12,62 @@ const LONG_QUOTE_RE = /[“"]([^”"]{12,})[”"]/g;
|
|
|
13
12
|
const BACKTICK_RE = /`([^`\n]{2,64})`/g;
|
|
14
13
|
const BOLD_RE = /\*\*([^*]{2,32})\*\*/g;
|
|
15
14
|
const HEADING_RE = /^#{2,6}\s+(.+)$/gm;
|
|
16
|
-
|
|
17
|
-
export function sourceSection(text) {
|
|
15
|
+
function sourceSection(text) {
|
|
18
16
|
const match = text.match(SOURCE_HEADING_RE);
|
|
19
17
|
if (!match) return "";
|
|
20
18
|
return text.slice(match.index + match[0].length);
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
export function firstParagraph(text) {
|
|
20
|
+
function firstParagraph(text) {
|
|
24
21
|
const afterH1 = text.replace(/^---[\s\S]*?---\s*/, "").replace(H1_RE, "").trimStart();
|
|
25
22
|
const block = afterH1.split(/\n\s*\n/)[0] || "";
|
|
26
23
|
return block.trim();
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
export function articleBody(text) {
|
|
25
|
+
function articleBody(text) {
|
|
30
26
|
const source = text.search(SOURCE_HEADING_RE);
|
|
31
27
|
const head = source === -1 ? text : text.slice(0, source);
|
|
32
28
|
return head.replace(/^---[\s\S]*?---\s*/, "");
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const found = new Set();
|
|
30
|
+
function highSignalLiterals(text) {
|
|
31
|
+
const found = /* @__PURE__ */ new Set();
|
|
37
32
|
for (const match of text.matchAll(NUMBER_RE)) found.add(match[0]);
|
|
38
33
|
for (const match of text.matchAll(ISO_DATE_RE)) found.add(match[0]);
|
|
39
34
|
for (const match of text.matchAll(LONG_QUOTE_RE)) found.add(match[1]);
|
|
40
35
|
return [...found];
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
function addTerm(counter, term) {
|
|
44
38
|
const value = term.trim();
|
|
45
39
|
if (!value) return;
|
|
46
40
|
counter.set(value, (counter.get(value) || 0) + 1);
|
|
47
41
|
}
|
|
48
|
-
|
|
49
|
-
export function collectTerms(text) {
|
|
42
|
+
function collectTerms(text) {
|
|
50
43
|
const body = articleBody(text);
|
|
51
|
-
const counter = new Map();
|
|
44
|
+
const counter = /* @__PURE__ */ new Map();
|
|
52
45
|
for (const match of body.matchAll(BACKTICK_RE)) addTerm(counter, match[1]);
|
|
53
46
|
for (const match of body.matchAll(BOLD_RE)) addTerm(counter, match[1]);
|
|
54
47
|
for (const match of body.matchAll(HEADING_RE)) addTerm(counter, match[1]);
|
|
55
48
|
return counter;
|
|
56
49
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const dir =
|
|
50
|
+
async function loadArticles(wikiRoot) {
|
|
51
|
+
await assertReadable(wikiRoot);
|
|
52
|
+
const dir = await safePath(wikiRoot, "wiki");
|
|
60
53
|
const names = (await readdir(dir)).filter((name) => name.endsWith(".md"));
|
|
61
54
|
const files = names.filter((name) => !INFRA.has(name.toLowerCase()));
|
|
62
55
|
const articles = [];
|
|
63
56
|
for (const file of files) {
|
|
64
|
-
const text = await readFile(
|
|
57
|
+
const text = await readFile(await safePath(wikiRoot, `wiki/${file}`), "utf8");
|
|
58
|
+
frontmatter(text);
|
|
65
59
|
articles.push({
|
|
66
60
|
id: file.slice(0, -3),
|
|
67
61
|
file,
|
|
68
62
|
text,
|
|
69
|
-
links: extractLinks(text).ids
|
|
63
|
+
links: extractLinks(text).ids
|
|
70
64
|
});
|
|
71
65
|
}
|
|
72
66
|
return articles;
|
|
73
67
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const inbound
|
|
77
|
-
for (const article of articles) inbound.set(article.id, new Set());
|
|
68
|
+
function oneWayLinks(articles) {
|
|
69
|
+
const inbound = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const article of articles) inbound.set(article.id, /* @__PURE__ */ new Set());
|
|
78
71
|
for (const article of articles) {
|
|
79
72
|
for (const target of article.links) {
|
|
80
73
|
if (!inbound.has(target)) continue;
|
|
@@ -92,10 +85,9 @@ export function oneWayLinks(articles) {
|
|
|
92
85
|
}
|
|
93
86
|
return findings;
|
|
94
87
|
}
|
|
95
|
-
|
|
96
|
-
export function missingTermPages(articles) {
|
|
88
|
+
function missingTermPages(articles) {
|
|
97
89
|
const ids = new Set(articles.map((article) => article.id));
|
|
98
|
-
const counts = new Map();
|
|
90
|
+
const counts = /* @__PURE__ */ new Map();
|
|
99
91
|
for (const article of articles) {
|
|
100
92
|
const local = collectTerms(article.text);
|
|
101
93
|
for (const [term, count] of local) {
|
|
@@ -103,13 +95,9 @@ export function missingTermPages(articles) {
|
|
|
103
95
|
counts.set(term, (counts.get(term) || 0) + count);
|
|
104
96
|
}
|
|
105
97
|
}
|
|
106
|
-
return [...counts.entries()]
|
|
107
|
-
.filter(([, count]) => count >= 2)
|
|
108
|
-
.map(([term, count]) => ({ term, count }))
|
|
109
|
-
.sort((a, b) => b.count - a.count || a.term.localeCompare(b.term));
|
|
98
|
+
return [...counts.entries()].filter(([, count]) => count >= 2).map(([term, count]) => ({ term, count })).sort((a, b) => b.count - a.count || a.term.localeCompare(b.term));
|
|
110
99
|
}
|
|
111
|
-
|
|
112
|
-
export function unreferencedRaws(manifest, articles) {
|
|
100
|
+
function unreferencedRaws(manifest, articles) {
|
|
113
101
|
const cited = articles.map((article) => sourceSection(article.text)).join("\n");
|
|
114
102
|
const findings = [];
|
|
115
103
|
for (const source of manifest.sources || []) {
|
|
@@ -119,29 +107,24 @@ export function unreferencedRaws(manifest, articles) {
|
|
|
119
107
|
}
|
|
120
108
|
return findings;
|
|
121
109
|
}
|
|
122
|
-
|
|
123
110
|
async function citedCorpus({ wikiRoot, repoRoot, article, manifest }) {
|
|
124
111
|
const cited = sourceSection(article.text);
|
|
125
112
|
const chunks = [cited];
|
|
126
113
|
for (const source of manifest.sources || []) {
|
|
127
|
-
const mentioned =
|
|
128
|
-
(source.rawPath && cited.includes(source.rawPath)) ||
|
|
129
|
-
(source.id && cited.includes(source.id)) ||
|
|
130
|
-
(source.livePath && cited.includes(source.livePath));
|
|
114
|
+
const mentioned = source.rawPath && cited.includes(source.rawPath) || source.id && cited.includes(source.id) || source.livePath && cited.includes(source.livePath);
|
|
131
115
|
if (!mentioned) continue;
|
|
132
116
|
if (source.rawPath) {
|
|
133
|
-
const raw =
|
|
117
|
+
const raw = await safePath(wikiRoot, source.rawPath);
|
|
134
118
|
if (await exists(raw)) chunks.push(await readFile(raw, "utf8"));
|
|
135
119
|
}
|
|
136
120
|
if (source.livePath) {
|
|
137
|
-
const live =
|
|
121
|
+
const live = await safePath(repoRoot, source.livePath);
|
|
138
122
|
if (await exists(live)) chunks.push(await readFile(live, "utf8"));
|
|
139
123
|
}
|
|
140
124
|
}
|
|
141
125
|
return chunks.join("\n");
|
|
142
126
|
}
|
|
143
|
-
|
|
144
|
-
export async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest }) {
|
|
127
|
+
async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest }) {
|
|
145
128
|
const findings = [];
|
|
146
129
|
for (const article of articles) {
|
|
147
130
|
const literals = highSignalLiterals(articleBody(article.text));
|
|
@@ -155,21 +138,17 @@ export async function evidenceSuspects({ wikiRoot, repoRoot, articles, manifest
|
|
|
155
138
|
}
|
|
156
139
|
return findings;
|
|
157
140
|
}
|
|
158
|
-
|
|
159
|
-
export async function adviseWiki(wikiRoot, { repoRoot = process.cwd() } = {}) {
|
|
141
|
+
async function adviseWiki(wikiRoot, { repoRoot = process.cwd() } = {}) {
|
|
160
142
|
const articles = await loadArticles(wikiRoot);
|
|
161
|
-
const manifestFile =
|
|
162
|
-
const manifest =
|
|
163
|
-
? JSON.parse(await readFile(manifestFile, "utf8"))
|
|
164
|
-
: { sources: [] };
|
|
143
|
+
const manifestFile = await safePath(wikiRoot, ".wiki-manifest.json");
|
|
144
|
+
const manifest = await exists(manifestFile) ? await loadManifest(wikiRoot, { repoRoot }) : { sources: [] };
|
|
165
145
|
return {
|
|
166
146
|
oneWayLinks: oneWayLinks(articles),
|
|
167
147
|
missingTermPages: missingTermPages(articles),
|
|
168
148
|
unreferencedRaws: unreferencedRaws(manifest, articles),
|
|
169
|
-
suspects: await evidenceSuspects({ wikiRoot, repoRoot, articles, manifest })
|
|
149
|
+
suspects: await evidenceSuspects({ wikiRoot, repoRoot, articles, manifest })
|
|
170
150
|
};
|
|
171
151
|
}
|
|
172
|
-
|
|
173
152
|
function parseArgs(argv) {
|
|
174
153
|
const args = { wiki: null, repo: process.cwd() };
|
|
175
154
|
for (let i = 0; i < argv.length; i += 1) {
|
|
@@ -179,18 +158,27 @@ function parseArgs(argv) {
|
|
|
179
158
|
}
|
|
180
159
|
return args;
|
|
181
160
|
}
|
|
182
|
-
|
|
183
161
|
async function main(argv = process.argv.slice(2)) {
|
|
184
162
|
const args = parseArgs(argv);
|
|
185
163
|
if (!args.wiki) throw new Error("usage: advise.mjs <wiki-root> [--repo <repo-root>]");
|
|
186
164
|
const wikiRoot = path.resolve(args.repo, args.wiki);
|
|
187
165
|
const report = await adviseWiki(wikiRoot, { repoRoot: path.resolve(args.repo) });
|
|
188
|
-
process.stdout.write(`${JSON.stringify(report, null, 2)}
|
|
166
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}
|
|
167
|
+
`);
|
|
189
168
|
}
|
|
190
|
-
|
|
191
169
|
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
192
|
-
main().catch(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
170
|
+
main().catch(cliError);
|
|
171
|
+
}
|
|
172
|
+
export {
|
|
173
|
+
adviseWiki,
|
|
174
|
+
articleBody,
|
|
175
|
+
collectTerms,
|
|
176
|
+
evidenceSuspects,
|
|
177
|
+
firstParagraph,
|
|
178
|
+
highSignalLiterals,
|
|
179
|
+
loadArticles,
|
|
180
|
+
missingTermPages,
|
|
181
|
+
oneWayLinks,
|
|
182
|
+
sourceSection,
|
|
183
|
+
unreferencedRaws
|
|
184
|
+
};
|
|
@@ -8,9 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
import { sha256 } from "./inventory.mjs";
|
|
9
9
|
import { adviseWiki } from "./advise.mjs";
|
|
10
10
|
import { lintWiki } from "./lint-wikilinks.mjs";
|
|
11
|
-
|
|
12
11
|
const adviseCli = fileURLToPath(new URL("./advise.mjs", import.meta.url));
|
|
13
|
-
|
|
14
12
|
async function seedAdvise() {
|
|
15
13
|
const repo = await mkdtemp(path.join(tmpdir(), "llm-wiki-advise-"));
|
|
16
14
|
const wikiRoot = path.join(repo, "wiki-root");
|
|
@@ -25,12 +23,12 @@ async function seedAdvise() {
|
|
|
25
23
|
await writeFile(
|
|
26
24
|
path.join(wiki, "Alpha.md"),
|
|
27
25
|
"# Alpha\n\nSee [[Beta]] and **孤立术语**. The figure is 42K.\n\n## 来源\n\n- raw/api.md\n",
|
|
28
|
-
"utf8"
|
|
26
|
+
"utf8"
|
|
29
27
|
);
|
|
30
28
|
await writeFile(
|
|
31
29
|
path.join(wiki, "Beta.md"),
|
|
32
30
|
"# Beta\n\nMentions **孤立术语** again.\n\n## 来源\n\n- raw/api.md\n",
|
|
33
|
-
"utf8"
|
|
31
|
+
"utf8"
|
|
34
32
|
);
|
|
35
33
|
await writeFile(path.join(wiki, "concept-table.md"), "# concepts\n", "utf8");
|
|
36
34
|
await writeFile(
|
|
@@ -44,37 +42,35 @@ async function seedAdvise() {
|
|
|
44
42
|
kind: "document",
|
|
45
43
|
livePath: "docs/api.md",
|
|
46
44
|
rawPath: "raw/api.md",
|
|
47
|
-
sha256: sha256(Buffer.from("version one\n"))
|
|
45
|
+
sha256: sha256(Buffer.from("version one\n"))
|
|
48
46
|
},
|
|
49
47
|
{
|
|
50
48
|
id: "orphan-raw.md",
|
|
51
49
|
kind: "document",
|
|
52
50
|
livePath: "docs/api.md",
|
|
53
51
|
rawPath: "raw/orphan-raw.md",
|
|
54
|
-
sha256: sha256(Buffer.from("version one\n"))
|
|
55
|
-
}
|
|
52
|
+
sha256: sha256(Buffer.from("version one\n"))
|
|
53
|
+
}
|
|
56
54
|
],
|
|
57
55
|
articles: [
|
|
58
56
|
{ id: "Alpha", file: "wiki/Alpha.md", sourceIds: ["api.md"] },
|
|
59
|
-
{ id: "Beta", file: "wiki/Beta.md", sourceIds: ["api.md"] }
|
|
60
|
-
]
|
|
57
|
+
{ id: "Beta", file: "wiki/Beta.md", sourceIds: ["api.md"] }
|
|
58
|
+
]
|
|
61
59
|
}),
|
|
62
|
-
"utf8"
|
|
60
|
+
"utf8"
|
|
63
61
|
);
|
|
64
62
|
return { repo, wikiRoot };
|
|
65
63
|
}
|
|
66
|
-
|
|
67
64
|
test("advise reports one-way links, missing terms, unreferenced raw, and suspects without failing lint", async () => {
|
|
68
65
|
const { repo, wikiRoot } = await seedAdvise();
|
|
69
|
-
const lint = await lintWiki(wikiRoot, { repoRoot: repo });
|
|
66
|
+
const lint = await lintWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
|
|
70
67
|
assert.equal(lint.ok, true, lint.errors.join("\n"));
|
|
71
|
-
const report = await adviseWiki(wikiRoot, { repoRoot: repo });
|
|
68
|
+
const report = await adviseWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
|
|
72
69
|
assert.ok(report.oneWayLinks.some((item) => item.from === "Alpha" && item.to === "Beta"));
|
|
73
70
|
assert.ok(report.missingTermPages.some((item) => item.term === "孤立术语" && item.count >= 2));
|
|
74
71
|
assert.ok(report.unreferencedRaws.some((item) => item.rawPath === "raw/orphan-raw.md"));
|
|
75
72
|
assert.ok(report.suspects.some((item) => item.article === "Alpha" && item.value === "42K"));
|
|
76
73
|
});
|
|
77
|
-
|
|
78
74
|
test("advise CLI exits 0 and prints JSON", async () => {
|
|
79
75
|
const { repo, wikiRoot } = await seedAdvise();
|
|
80
76
|
const ran = spawnSync(process.execPath, [adviseCli, wikiRoot, "--repo", repo], { encoding: "utf8" });
|
|
@@ -82,10 +78,9 @@ test("advise CLI exits 0 and prints JSON", async () => {
|
|
|
82
78
|
const report = JSON.parse(ran.stdout);
|
|
83
79
|
assert.ok(Array.isArray(report.suspects));
|
|
84
80
|
});
|
|
85
|
-
|
|
86
81
|
test("concept-table.md is infrastructure and does not fail lint as an orphan", async () => {
|
|
87
82
|
const { repo, wikiRoot } = await seedAdvise();
|
|
88
|
-
const lint = await lintWiki(wikiRoot, { repoRoot: repo });
|
|
83
|
+
const lint = await lintWiki(wikiRoot, { repoRoot: repo, structureOnly: true });
|
|
89
84
|
assert.equal(lint.ok, true, lint.errors.join("\n"));
|
|
90
85
|
assert.equal(lint.counts.articles, 2);
|
|
91
86
|
});
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { readFile, writeFile, rename, lstat, realpath, mkdir, access } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const STATES = ["current", "stale", "missing", "unverified", "archived"];
|
|
5
|
+
const INFRA = /* @__PURE__ */ new Set(["index.md", "log.md", "claude.md", "agents.md", "soul.md", "concept-table.md"]);
|
|
6
|
+
const sha256 = (value) => createHash("sha256").update(value).digest("hex");
|
|
7
|
+
const json = (value) => `${JSON.stringify(value, null, 2)}
|
|
8
|
+
`;
|
|
9
|
+
class WikiError extends Error {
|
|
10
|
+
constructor(code, message) {
|
|
11
|
+
super(`${code}: ${message}`);
|
|
12
|
+
this.code = code;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function fail(code, message) {
|
|
16
|
+
throw new WikiError(code, message);
|
|
17
|
+
}
|
|
18
|
+
async function exists(file) {
|
|
19
|
+
try {
|
|
20
|
+
await access(file);
|
|
21
|
+
return true;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (e.code === "ENOENT") return false;
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function digestFile(file) {
|
|
28
|
+
try {
|
|
29
|
+
return sha256(await readFile(file));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
if (e.code === "ENOENT") return null;
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function inside(root, target) {
|
|
36
|
+
const r = path.relative(root, target);
|
|
37
|
+
return r === "" || !r.startsWith(`..${path.sep}`) && r !== ".." && !path.isAbsolute(r);
|
|
38
|
+
}
|
|
39
|
+
async function safePath(root, ref, { write = false } = {}) {
|
|
40
|
+
if (typeof ref !== "string" || !ref || ref.includes("\\") || ref.includes("\0") || path.isAbsolute(ref) || ref.split("/").some((x) => ["..", ".", ""].includes(x))) fail("PATH_INVALID", String(ref));
|
|
41
|
+
const base = path.resolve(root), target = path.resolve(base, ref);
|
|
42
|
+
if (!inside(base, target) || target === base) fail("PATH_ESCAPE", ref);
|
|
43
|
+
let baseReal;
|
|
44
|
+
try {
|
|
45
|
+
baseReal = await realpath(base);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
if (e.code !== "ENOENT") throw e;
|
|
48
|
+
const parent = path.dirname(base);
|
|
49
|
+
baseReal = path.join(await realpath(parent), path.basename(base));
|
|
50
|
+
}
|
|
51
|
+
let current = base;
|
|
52
|
+
for (const part of ref.split("/")) {
|
|
53
|
+
current = path.join(current, part);
|
|
54
|
+
let st;
|
|
55
|
+
try {
|
|
56
|
+
st = await lstat(current);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
if (e.code === "ENOENT") continue;
|
|
59
|
+
throw e;
|
|
60
|
+
}
|
|
61
|
+
if (st.isSymbolicLink() && write) fail("SYMLINK_WRITE", ref);
|
|
62
|
+
let resolved;
|
|
63
|
+
try {
|
|
64
|
+
resolved = await realpath(current);
|
|
65
|
+
} catch {
|
|
66
|
+
fail("PATH_ESCAPE", `unresolved symlink ${ref}`);
|
|
67
|
+
}
|
|
68
|
+
if (!inside(baseReal, resolved)) fail("PATH_ESCAPE", ref);
|
|
69
|
+
}
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
async function atomicWrite(file, content) {
|
|
73
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
74
|
+
const temp = `${file}.${randomUUID()}.tmp`;
|
|
75
|
+
await writeFile(temp, content, { flag: "wx" });
|
|
76
|
+
await rename(temp, file);
|
|
77
|
+
}
|
|
78
|
+
function frontmatter(text) {
|
|
79
|
+
if (!text.startsWith("---\n") && !text.startsWith("---\r\n")) return { humanOwned: false, body: text, fields: {} };
|
|
80
|
+
const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
81
|
+
if (!m) fail("FRONTMATTER_INVALID", "unterminated header");
|
|
82
|
+
const fields = {};
|
|
83
|
+
for (const line of m[1].split(/\r?\n/)) {
|
|
84
|
+
if (!line.trim() || line.trim().startsWith("#")) continue;
|
|
85
|
+
const pair = line.match(/^([\w-]+):\s*(.*?)\s*$/);
|
|
86
|
+
if (!pair) fail("FRONTMATTER_INVALID", "use flat scalar fields");
|
|
87
|
+
if (Object.hasOwn(fields, pair[1])) fail("FRONTMATTER_INVALID", `duplicate ${pair[1]}`);
|
|
88
|
+
fields[pair[1]] = pair[2];
|
|
89
|
+
}
|
|
90
|
+
if (fields["human-owned"] !== void 0 && !["true", "false"].includes(fields["human-owned"])) fail("FRONTMATTER_INVALID", "human-owned must be a boolean");
|
|
91
|
+
return { humanOwned: fields["human-owned"] === "true", fields, body: text.slice(m[0].length) };
|
|
92
|
+
}
|
|
93
|
+
function sourceSection(text) {
|
|
94
|
+
return text.match(/^##\s+来源\s*\r?\n([\s\S]*)/m)?.[1]?.trim() || "";
|
|
95
|
+
}
|
|
96
|
+
function ownership(article, text) {
|
|
97
|
+
const fm = frontmatter(text);
|
|
98
|
+
return { protected: article.humanOwned === true || fm.humanOwned, conflict: article.humanOwned !== void 0 && fm.fields["human-owned"] !== void 0 && article.humanOwned !== fm.humanOwned };
|
|
99
|
+
}
|
|
100
|
+
const array = (v) => Array.isArray(v);
|
|
101
|
+
const unique = (v) => new Set(v).size === v.length;
|
|
102
|
+
const digest = (v) => v === null || /^[a-f0-9]{64}$/.test(v);
|
|
103
|
+
function validateManifest(m) {
|
|
104
|
+
const errors = [];
|
|
105
|
+
const check = (ok, code, detail) => {
|
|
106
|
+
if (!ok) errors.push(`${code}: ${detail}`);
|
|
107
|
+
};
|
|
108
|
+
if (!m || typeof m !== "object" || array(m)) return ["MANIFEST_INVALID: expected object"];
|
|
109
|
+
check([1, 2].includes(m.schemaVersion), "SCHEMA_UNSUPPORTED", m.schemaVersion);
|
|
110
|
+
check(m.profile === void 0 && m.schemaVersion === 1 || ["mixed", "documents", "code"].includes(m.profile), "PROFILE_INVALID", m.profile);
|
|
111
|
+
if (!array(m.sources) || !array(m.articles)) return [...errors, "MANIFEST_INVALID: sources and articles must be arrays"];
|
|
112
|
+
for (const [group, rows] of [["source", m.sources], ["article", m.articles]]) {
|
|
113
|
+
check(rows.every((x) => x && typeof x.id === "string" && x.id.trim() && (group === "source" || !/[\[\]#|/\\]/.test(x.id))), "ID_INVALID", group);
|
|
114
|
+
check(unique(rows.map((x) => x?.id)), "DUPLICATE_ID", group);
|
|
115
|
+
}
|
|
116
|
+
const sources = new Set(m.sources.map((x) => x?.id)), articles = new Set(m.articles.map((x) => x?.id));
|
|
117
|
+
check(unique(m.articles.map((x) => x?.file)), "DUPLICATE_FILE", "articles");
|
|
118
|
+
for (const s of m.sources) {
|
|
119
|
+
if (!s || typeof s !== "object") continue;
|
|
120
|
+
check(["document", "derived", "code-surface"].includes(s.kind), "SOURCE_KIND", s.id);
|
|
121
|
+
if (s.kind === "code-surface") check(typeof s.livePath === "string" && s.livePath.length > 0, "LIVE_PATH_REQUIRED", s.id);
|
|
122
|
+
check(!(m.profile === "documents" && s.kind === "code-surface"), "PROFILE KIND", s.id + " code-surface");
|
|
123
|
+
check(s.kind === "code-surface" ? s.rawPath == null : typeof s.rawPath === "string" && s.rawPath.length > 0, s.kind === "code-surface" ? "RAW PATH FORBIDDEN" : "RAW PATH REQUIRED", s.id);
|
|
124
|
+
if (s.kind === "derived") {
|
|
125
|
+
if (m.schemaVersion === 2 && s.extract?.kind === "prose-note") check(typeof s.extract.rules === "string" && s.extract.rules.length > 0 && s.extract.inputDigests && typeof s.extract.inputDigests === "object", "EXTRACT_RULES", s.id);
|
|
126
|
+
check(!!s.extract?.kind, "EXTRACT REQUIRED", s.id);
|
|
127
|
+
if (s.extract?.kind) check(["skill-names", "heading-list", "prose-note"].includes(s.extract.kind), "EXTRACT KIND", `${s.id} ${s.extract.kind}`);
|
|
128
|
+
if (m.schemaVersion === 2) {
|
|
129
|
+
check(typeof s.extract?.version === "string" && !!s.extract.version, "EXTRACT_VERSION", s.id);
|
|
130
|
+
check(array(s.extract?.inputs) && s.extract.inputs.length > 0 && unique(s.extract.inputs), "EXTRACT_INPUTS", s.id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (s.status !== void 0) check(STATES.includes(s.status), "STATUS_INVALID", s.id);
|
|
134
|
+
if (m.schemaVersion === 2) {
|
|
135
|
+
for (const k of ["originalDigest", "effectiveDigest", "rawDigest"]) check(Object.hasOwn(s, k) && digest(s[k]), "DIGEST_INVALID", `${s.id}.${k}`);
|
|
136
|
+
check(typeof s.location === "string" && s.location.length > 0, "LOCATION_REQUIRED", s.id);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
for (const a of m.articles) {
|
|
140
|
+
if (!a || typeof a !== "object") continue;
|
|
141
|
+
check(a.file === `wiki/${a.id}.md` && !INFRA.has(`${a.id}.md`.toLowerCase()), "MANIFEST ID MISMATCH", a.id);
|
|
142
|
+
check(array(a.sourceIds) && unique(a.sourceIds), "SOURCE_REFS_INVALID", a.id);
|
|
143
|
+
check(array(a.sourceIds) && (a.sourceIds.length > 0 || array(a.dependsOnArticles) && a.dependsOnArticles.length > 0), "EMPTY_SOURCE_REFS", a.id);
|
|
144
|
+
for (const id of array(a.sourceIds) ? a.sourceIds : []) check(sources.has(id), "UNKNOWN SOURCE ID", `${a.id} -> ${id}`);
|
|
145
|
+
if (a.dependsOnArticles !== void 0) check(array(a.dependsOnArticles) && unique(a.dependsOnArticles), "DEPENDENCIES_INVALID", a.id);
|
|
146
|
+
for (const id of array(a.dependsOnArticles) ? a.dependsOnArticles : []) check(articles.has(id), "UNKNOWN_ARTICLE_ID", `${a.id} -> ${id}`);
|
|
147
|
+
if (a.aliases !== void 0) check(array(a.aliases) && a.aliases.every((x) => typeof x === "string" && x.trim()), "ALIASES_INVALID", a.id);
|
|
148
|
+
if (a.humanOwned !== void 0) check(typeof a.humanOwned === "boolean", "OWNERSHIP_INVALID", a.id);
|
|
149
|
+
if (a.verification !== void 0 && a.verification !== null) check(a.verification && typeof a.verification === "object" && array(a.verification.evidence) && a.verification.evidence.every((e) => e && typeof e === "object" && sources.has(e.sourceId) && ["general", "critical"].includes(e.risk) && typeof e.claim === "string" && e.claim.length > 0 && digest(e.excerptDigest) && e.excerptDigest !== null && typeof e.inputPath === "string" && Number.isInteger(e.startLine) && e.startLine > 0 && Number.isInteger(e.endLine) && e.endLine >= e.startLine) && digest(a.verification.articleDigest) && a.verification.articleDigest !== null, "EVIDENCE_INVALID", a.id);
|
|
150
|
+
if (a.status !== void 0) check(STATES.includes(a.status), "STATUS_INVALID", a.id);
|
|
151
|
+
if (m.schemaVersion === 2) {
|
|
152
|
+
check(digest(a.articleDigest) && Object.hasOwn(a, "articleDigest"), "DIGEST_INVALID", a.id);
|
|
153
|
+
check(a.compiledFrom && typeof a.compiledFrom === "object" && !array(a.compiledFrom), "COMPILED_FROM_INVALID", a.id);
|
|
154
|
+
for (const [id, binding] of Object.entries(a.compiledFrom || {})) {
|
|
155
|
+
check(sources.has(id) && binding && digest(binding.effectiveDigest) && binding.effectiveDigest !== null, "COMPILED_FROM_INVALID", `${a.id}:${id}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (errors.length === 0) {
|
|
160
|
+
try {
|
|
161
|
+
for (const a of m.articles) sourceClosure(m, a.id);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
errors.push(e.message);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (m.feedback !== void 0) {
|
|
167
|
+
check(array(m.feedback), "FEEDBACK_INVALID", "expected array");
|
|
168
|
+
if (array(m.feedback)) {
|
|
169
|
+
check(unique(m.feedback.map((f) => f?.id)), "DUPLICATE_ID", "feedback");
|
|
170
|
+
for (const f of m.feedback) {
|
|
171
|
+
if (!f || typeof f !== "object") {
|
|
172
|
+
errors.push("FEEDBACK_INVALID: expected object");
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
check(typeof f.id === "string" && f.id.length > 0 && articles.has(f.articleId) && digest(f.targetDigest) && f.targetDigest !== null && typeof f.issue === "string" && f.issue.trim() && f.locator && typeof f.locator.quote === "string" && f.locator.quote.length > 0, "FEEDBACK_INVALID", f.id);
|
|
176
|
+
check(["open", "accepted", "partial", "rejected", "deferred"].includes(f.status), "FEEDBACK_STATUS", f.id);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return errors;
|
|
181
|
+
}
|
|
182
|
+
function sourceClosure(m, id, trail = []) {
|
|
183
|
+
if (trail.includes(id)) fail("DEPENDENCY_CYCLE", [...trail, id].join(" -> "));
|
|
184
|
+
const a = m.articles.find((x) => x.id === id);
|
|
185
|
+
if (!a) fail("UNKNOWN_ARTICLE_ID", id);
|
|
186
|
+
return [.../* @__PURE__ */ new Set([...a.sourceIds || [], ...(a.dependsOnArticles || []).flatMap((dep) => sourceClosure(m, dep, [...trail, id]))])].sort();
|
|
187
|
+
}
|
|
188
|
+
async function checkPaths(m, { wikiRoot, repoRoot }) {
|
|
189
|
+
for (const s of m.sources) {
|
|
190
|
+
for (const ref of [s.livePath, ...s.extract?.inputs || []].filter(Boolean)) await safePath(repoRoot, ref);
|
|
191
|
+
if (s.rawPath) await safePath(wikiRoot, s.rawPath);
|
|
192
|
+
}
|
|
193
|
+
for (const a of m.articles) await safePath(wikiRoot, a.file);
|
|
194
|
+
}
|
|
195
|
+
async function loadManifest(wikiRoot, { repoRoot = process.cwd(), validate = true } = {}) {
|
|
196
|
+
const m = JSON.parse(await readFile(await safePath(wikiRoot, ".wiki-manifest.json"), "utf8"));
|
|
197
|
+
if (validate) {
|
|
198
|
+
const errors = validateManifest(m);
|
|
199
|
+
if (errors.length) fail("MANIFEST_INVALID", errors.join("\n"));
|
|
200
|
+
await checkPaths(m, { wikiRoot, repoRoot });
|
|
201
|
+
}
|
|
202
|
+
return m;
|
|
203
|
+
}
|
|
204
|
+
async function transactionState(wikiRoot, { reader } = {}) {
|
|
205
|
+
// A writer claims the lock before replacing an earlier finalized journal.
|
|
206
|
+
// That interval must also block readers.
|
|
207
|
+
if (await exists(await safePath(wikiRoot, ".wiki-lock"))) return { state: "locked", incomplete: true };
|
|
208
|
+
const file = await safePath(wikiRoot, ".wiki-transaction.json");
|
|
209
|
+
if (!await exists(file)) return { state: "none" };
|
|
210
|
+
const j = JSON.parse(reader ? (await reader(file)).toString() : await readFile(file, "utf8"));
|
|
211
|
+
return { id: j.id, state: j.phase, incomplete: !["finalized", "aborted"].includes(j.phase) };
|
|
212
|
+
}
|
|
213
|
+
async function assertReadable(wikiRoot, reader) {
|
|
214
|
+
const tx = await transactionState(wikiRoot, { reader });
|
|
215
|
+
if (tx.incomplete || tx.state === "locked") fail("TRANSACTION_INCOMPLETE", "explicit resume or abort required; query never recovers");
|
|
216
|
+
return tx;
|
|
217
|
+
}
|
|
218
|
+
function cliError(e) {
|
|
219
|
+
process.stderr.write(`${JSON.stringify({ ok: false, code: e.code || "EXECUTION_ERROR", message: e.message })}
|
|
220
|
+
`);
|
|
221
|
+
process.exitCode = 2;
|
|
222
|
+
}
|
|
223
|
+
function args(argv, commands = []) {
|
|
224
|
+
const result = { command: commands.length ? argv.shift() : void 0, repo: process.cwd() };
|
|
225
|
+
if (commands.length && !commands.includes(result.command)) fail("USAGE", commands.join("|"));
|
|
226
|
+
while (argv.length) {
|
|
227
|
+
const a = argv.shift();
|
|
228
|
+
if (a === "--apply" || a === "--structure-only") {
|
|
229
|
+
result[a.slice(2)] = true;
|
|
230
|
+
} else if (a.startsWith("--")) {
|
|
231
|
+
if (!argv.length || argv[0].startsWith("--")) fail("USAGE", `value required ${a}`);
|
|
232
|
+
const key = a.slice(2);
|
|
233
|
+
if (key === "candidate") (result.candidates ??= []).push(argv.shift());
|
|
234
|
+
else result[key] = argv.shift();
|
|
235
|
+
} else if (!result.wiki) result.wiki = a;
|
|
236
|
+
else fail("USAGE", a);
|
|
237
|
+
}
|
|
238
|
+
return result;
|
|
239
|
+
}
|
|
240
|
+
export {
|
|
241
|
+
INFRA,
|
|
242
|
+
STATES,
|
|
243
|
+
WikiError,
|
|
244
|
+
args,
|
|
245
|
+
assertReadable,
|
|
246
|
+
atomicWrite,
|
|
247
|
+
checkPaths,
|
|
248
|
+
cliError,
|
|
249
|
+
digestFile,
|
|
250
|
+
exists,
|
|
251
|
+
fail,
|
|
252
|
+
frontmatter,
|
|
253
|
+
json,
|
|
254
|
+
loadManifest,
|
|
255
|
+
ownership,
|
|
256
|
+
safePath,
|
|
257
|
+
sha256,
|
|
258
|
+
sourceClosure,
|
|
259
|
+
sourceSection,
|
|
260
|
+
transactionState,
|
|
261
|
+
validateManifest
|
|
262
|
+
};
|