agentic-flow-kit 1.8.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -148
- package/bin/flow-kit.mjs +5 -2
- package/locales/en/installer.json +25 -0
- package/locales/en/overrides/.agents/commands/deploy.md +52 -0
- package/locales/en/overrides/.agents/commands/maintain.md +76 -0
- package/locales/en/overrides/.agents/commands/new-task.md +89 -0
- package/locales/en/overrides/.agents/commands/pipeline-run.md +56 -0
- package/locales/en/overrides/.agents/commands/pr-review.md +30 -0
- package/locales/en/overrides/.agents/commands/review.md +93 -0
- package/locales/en/overrides/.agents/commands/stages.md +256 -0
- package/locales/en/overrides/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/locales/en/overrides/.agents/notes/process-order-rule.md +21 -0
- package/locales/en/overrides/.agents/notes/runtime-env.local.example.md +21 -0
- package/locales/en/overrides/.agents/pipelines/_TEMPLATE.md +75 -0
- package/locales/en/overrides/.agents/pipelines/pipeline-closing.md +28 -0
- package/locales/en/overrides/.agents/roles/implementer.md +28 -0
- package/locales/en/overrides/.agents/roles/independent-reviewer.md +39 -0
- package/locales/en/overrides/.agents/roles/pr-adjudicator.md +27 -0
- package/locales/en/overrides/.agents/roles/pr-finder.md +51 -0
- package/locales/en/overrides/.agents/roles/pr-verifier.md +44 -0
- package/locales/en/overrides/.agents/roles/ui-verifier.md +22 -0
- package/locales/en/overrides/.agents/roles/wiki-compiler.md +47 -0
- package/locales/en/overrides/.agents/skills/arena/SKILL.md +50 -0
- package/locales/en/overrides/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/locales/en/overrides/.agents/skills/blast-radius/SKILL.md +53 -0
- package/locales/en/overrides/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/dev-tour/SKILL.md +98 -0
- package/locales/en/overrides/.agents/skills/dream/SKILL.md +63 -0
- package/locales/en/overrides/.agents/skills/eval/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/interrogate/SKILL.md +49 -0
- package/locales/en/overrides/.agents/skills/number-vetting/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/page-refactor/SKILL.md +192 -0
- package/locales/en/overrides/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/pause-safely/SKILL.md +31 -0
- package/locales/en/overrides/.agents/skills/perf/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/review-method/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/session-resume/SKILL.md +69 -0
- package/locales/en/overrides/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/locales/en/overrides/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/locales/en/overrides/.agents/skills/verify-ui/SKILL.md +116 -0
- package/locales/en/overrides/.agents/skills/visual-parity/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/why/SKILL.md +56 -0
- package/locales/en/overrides/.agents/skills/wiki/SKILL.md +53 -0
- package/locales/en/overrides/.claude/agents/implementer.md +9 -0
- package/locales/en/overrides/.claude/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.claude/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.cline/agents/implementer.yml +13 -0
- package/locales/en/overrides/.cline/agents/independent-reviewer.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-adjudicator.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-finder.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-verifier.yml +11 -0
- package/locales/en/overrides/.cline/agents/ui-verifier.yml +8 -0
- package/locales/en/overrides/.cline/agents/wiki-compiler.yml +14 -0
- package/locales/en/overrides/.cline/workflows/wf-deploy.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-maintain.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-new-task.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pr-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/CODEBUDDY.md +7 -0
- package/locales/en/overrides/.codebuddy/agents/implementer.md +9 -0
- package/locales/en/overrides/.codebuddy/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.codebuddy/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.codebuddy/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/locales/en/overrides/.commandcode/agents/implementer.md +10 -0
- package/locales/en/overrides/.commandcode/agents/independent-reviewer.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-adjudicator.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-finder.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-verifier.md +9 -0
- package/locales/en/overrides/.commandcode/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.commandcode/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.commandcode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.opencode/agents/implementer.md +51 -0
- package/locales/en/overrides/.opencode/agents/independent-reviewer.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-adjudicator.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-finder.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-verifier.md +18 -0
- package/locales/en/overrides/.opencode/agents/ui-verifier.md +45 -0
- package/locales/en/overrides/.opencode/agents/wiki-compiler.md +51 -0
- package/locales/en/overrides/.opencode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.pi/agents/implementer.md +11 -0
- package/locales/en/overrides/.pi/agents/independent-reviewer.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-adjudicator.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-finder.md +11 -0
- package/locales/en/overrides/.pi/agents/pr-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/wiki-compiler.md +11 -0
- package/locales/en/overrides/.qoder/agents/implementer.md +9 -0
- package/locales/en/overrides/.qoder/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.qoder/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.qwen/agents/implementer.md +10 -0
- package/locales/en/overrides/.qwen/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/wiki-compiler.md +13 -0
- package/locales/en/overrides/.qwen/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.trae/agents/implementer.md +9 -0
- package/locales/en/overrides/.trae/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.trae/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.trae/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.trae/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.zcode/agents/implementer.md +8 -0
- package/locales/en/overrides/.zcode/agents/independent-reviewer.md +8 -0
- package/locales/en/overrides/.zcode/agents/ui-verifier.md +8 -0
- package/locales/en/overrides/.zcode/agents/wiki-compiler.md +8 -0
- package/locales/en/overrides/AGENTS.md +52 -0
- package/locales/en/overrides/CLAUDE.md +20 -0
- package/locales/en/overrides/wiki/INDEX.md +33 -0
- package/locales/en/overrides/wiki/drafts-archive/README.md +6 -0
- package/locales/en/overrides/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/locales/en/overrides/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/locales/en/overrides/workflow/INDEX.md +13 -0
- package/locales/en/overrides/workflow/README.md +67 -0
- package/locales/en/overrides/workflow/archive/README.md +3 -0
- package/locales/en/overrides/workflow/delegations.md +4 -0
- package/locales/en/overrides/workflow/effective-policy.md +4 -0
- package/locales/en/overrides/workflow/gate-cost.md +4 -0
- package/locales/en/overrides/workflow/incidents/_TEMPLATE.md +49 -0
- package/locales/en/overrides/workflow/intents/_TEMPLATE.md +43 -0
- package/locales/en/overrides/workflow/metrics.md +4 -0
- package/locales/en/overrides/workflow/papercuts.md +3 -0
- package/locales/en/overrides/workflow/plans/_TEMPLATE.md +47 -0
- package/locales/en/overrides/workflow/regression-checklist.md +3 -0
- package/locales/en/overrides/workflow/specs/_TEMPLATE.md +86 -0
- package/locales/en/overrides/workflow/verify-evidence.md +4 -0
- package/locales/zh-CN/installer.json +25 -0
- package/package.json +23 -36
- package/schemas/install-manifest.schema.json +24 -0
- package/schemas/project-profile.schema.json +28 -0
- package/src/cli/args.mjs +41 -0
- package/src/cli/main.mjs +72 -0
- package/src/commands/add-host.mjs +29 -0
- package/src/commands/doctor.mjs +80 -0
- package/src/commands/install.mjs +149 -0
- package/src/commands/upgrade.mjs +30 -0
- package/src/git/config.mjs +61 -0
- package/src/hosts/registry.mjs +26 -0
- package/src/i18n.mjs +32 -0
- package/src/install/apply.mjs +124 -0
- package/src/install/manifest.mjs +40 -0
- package/src/install/plan.mjs +83 -0
- package/src/render/tokens.mjs +58 -0
- package/templates/engine/.agents/board/dev-tour.html +1940 -0
- package/templates/engine/.agents/board/index.html +835 -0
- package/templates/engine/.agents/commands/deploy.md +52 -0
- package/templates/engine/.agents/commands/maintain.md +76 -0
- package/templates/engine/.agents/commands/new-task.md +89 -0
- package/templates/engine/.agents/commands/pipeline-run.md +56 -0
- package/templates/engine/.agents/commands/pr-review.md +30 -0
- package/templates/engine/.agents/commands/review.md +93 -0
- package/templates/engine/.agents/commands/stages.md +256 -0
- package/templates/engine/.agents/config/commit-msg-rules.json +7 -0
- package/templates/engine/.agents/config/engine.json +11 -0
- package/templates/engine/.agents/config/gate-budgets.json +5 -0
- package/templates/engine/.agents/config/mechanism-registry.md +62 -0
- package/templates/engine/.agents/config/model-roles.json +26 -0
- package/templates/engine/.agents/config/model-roles.local.example.json +7 -0
- package/templates/engine/.agents/config/pr-review.json +67 -0
- package/templates/engine/.agents/config/principles.md +32 -0
- package/templates/engine/.agents/config/workflow-enums.txt +25 -0
- package/templates/engine/.agents/hooks/check-architecture.mjs +168 -0
- package/templates/engine/.agents/hooks/check-audit-fields.mjs +56 -0
- package/templates/engine/.agents/hooks/check-commit-plan-ref.mjs +84 -0
- package/templates/engine/.agents/hooks/check-confirm-order.mjs +281 -0
- package/templates/engine/.agents/hooks/check-delete-guard.mjs +63 -0
- package/templates/engine/.agents/hooks/check-notify-guard.mjs +55 -0
- package/templates/engine/.agents/hooks/commit-check.cjs +208 -0
- package/templates/engine/.agents/hooks/gates.json +33 -0
- package/templates/engine/.agents/hooks/local-pre-commit.mjs +27 -0
- package/templates/engine/.agents/hooks/pre-shell-check.cjs +361 -0
- package/templates/engine/.agents/hooks/pre-write-check.cjs +220 -0
- package/templates/engine/.agents/notes/gate-diet.md +75 -0
- package/templates/engine/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/templates/engine/.agents/notes/process-order-rule.md +21 -0
- package/templates/engine/.agents/notes/runtime-env.local.example.md +21 -0
- package/templates/engine/.agents/pipelines/_TEMPLATE.md +75 -0
- package/templates/engine/.agents/pipelines/pipeline-closing.md +28 -0
- package/templates/engine/.agents/pipelines//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
- package/templates/engine/.agents/roles/implementer.md +28 -0
- package/templates/engine/.agents/roles/independent-reviewer.md +39 -0
- package/templates/engine/.agents/roles/pr-adjudicator.md +27 -0
- package/templates/engine/.agents/roles/pr-finder.md +51 -0
- package/templates/engine/.agents/roles/pr-verifier.md +44 -0
- package/templates/engine/.agents/roles/ui-verifier.md +22 -0
- package/templates/engine/.agents/roles/wiki-compiler.md +47 -0
- package/templates/engine/.agents/scripts/agg-delegations.mjs +439 -0
- package/templates/engine/.agents/scripts/agg-judgments.mjs +301 -0
- package/templates/engine/.agents/scripts/agg-kb-usage.mjs +196 -0
- package/templates/engine/.agents/scripts/append-compensation.mjs +109 -0
- package/templates/engine/.agents/scripts/archive-sweep.mjs +229 -0
- package/templates/engine/.agents/scripts/auto-tour.mjs +77 -0
- package/templates/engine/.agents/scripts/board-port.mjs +17 -0
- package/templates/engine/.agents/scripts/check-doc-body-drift.mjs +102 -0
- package/templates/engine/.agents/scripts/check-engine-artifacts.mjs +54 -0
- package/templates/engine/.agents/scripts/check-hook-wiring.mjs +75 -0
- package/templates/engine/.agents/scripts/check-lane-surface.mjs +393 -0
- package/templates/engine/.agents/scripts/check-ledger-doc-presence.mjs +71 -0
- package/templates/engine/.agents/scripts/check-ledger-invariant.mjs +873 -0
- package/templates/engine/.agents/scripts/check-local-gate-config.mjs +95 -0
- package/templates/engine/.agents/scripts/check-local-gates.mjs +248 -0
- package/templates/engine/.agents/scripts/check-loop-kit.mjs +550 -0
- package/templates/engine/.agents/scripts/check-loop-rev-semantics.mjs +59 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s01-pairing.mjs +116 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s03x-regr-evidence.mjs +38 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s08-acceptance.mjs +130 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s15-fingerprint.mjs +152 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s23-convergence-audit.mjs +182 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s29-regr-enforcer.mjs +69 -0
- package/templates/engine/.agents/scripts/check-loop.mjs +131 -0
- package/templates/engine/.agents/scripts/check-regression-consistency.mjs +252 -0
- package/templates/engine/.agents/scripts/check-schema-residue.mjs +144 -0
- package/templates/engine/.agents/scripts/check-scope-range.mjs +156 -0
- package/templates/engine/.agents/scripts/check-scope.mjs +121 -0
- package/templates/engine/.agents/scripts/check-scripts-syntax.mjs +138 -0
- package/templates/engine/.agents/scripts/check-secrets-lite.mjs +239 -0
- package/templates/engine/.agents/scripts/check-secrets.mjs +104 -0
- package/templates/engine/.agents/scripts/check-test-impact-map.mjs +107 -0
- package/templates/engine/.agents/scripts/ci-assert-frontend-deps.mjs +42 -0
- package/templates/engine/.agents/scripts/ci-commit-hygiene.mjs +86 -0
- package/templates/engine/.agents/scripts/ci-install-gitleaks.mjs +75 -0
- package/templates/engine/.agents/scripts/ci-push-before.mjs +49 -0
- package/templates/engine/.agents/scripts/closeout.mjs +127 -0
- package/templates/engine/.agents/scripts/compact-ledgers.mjs +70 -0
- package/templates/engine/.agents/scripts/confirm-doc.mjs +737 -0
- package/templates/engine/.agents/scripts/delegation-presence.mjs +38 -0
- package/templates/engine/.agents/scripts/dev-tour-model.mjs +1398 -0
- package/templates/engine/.agents/scripts/dream-run.mjs +283 -0
- package/templates/engine/.agents/scripts/ensure-board.mjs +187 -0
- package/templates/engine/.agents/scripts/failure-attribution.mjs +11 -0
- package/templates/engine/.agents/scripts/fill-intent.mjs +60 -0
- package/templates/engine/.agents/scripts/fill-plan.mjs +105 -0
- package/templates/engine/.agents/scripts/fill-spec.mjs +72 -0
- package/templates/engine/.agents/scripts/gen-dev-tour.mjs +191 -0
- package/templates/engine/.agents/scripts/gen-effective-policy.mjs +113 -0
- package/templates/engine/.agents/scripts/gen-engine-map.mjs +292 -0
- package/templates/engine/.agents/scripts/gen-narrative-claims.mjs +275 -0
- package/templates/engine/.agents/scripts/gen-verify-evidence.mjs +115 -0
- package/templates/engine/.agents/scripts/gen-wiki-board.mjs +221 -0
- package/templates/engine/.agents/scripts/gen-workflow-index.mjs +201 -0
- package/templates/engine/.agents/scripts/gen-workflow-metrics.mjs +692 -0
- package/templates/engine/.agents/scripts/git-merge-jsonl.mjs +62 -0
- package/templates/engine/.agents/scripts/judgment-ledger.mjs +68 -0
- package/templates/engine/.agents/scripts/kb-cache-evict.mjs +50 -0
- package/templates/engine/.agents/scripts/kb-search.mjs +423 -0
- package/templates/engine/.agents/scripts/lane-surface-audit.mjs +145 -0
- package/templates/engine/.agents/scripts/ledger-loader.mjs +77 -0
- package/templates/engine/.agents/scripts/ledger-shards.mjs +346 -0
- package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
- package/templates/engine/.agents/scripts/pipeline-run.mjs +964 -0
- package/templates/engine/.agents/scripts/policy.mjs +250 -0
- package/templates/engine/.agents/scripts/pr-create.mjs +54 -0
- package/templates/engine/.agents/scripts/pr-review.mjs +1551 -0
- package/templates/engine/.agents/scripts/quote-grounding.mjs +233 -0
- package/templates/engine/.agents/scripts/regen-ledgers.mjs +59 -0
- package/templates/engine/.agents/scripts/rewrite-file.mjs +135 -0
- package/templates/engine/.agents/scripts/rule-budget.mjs +246 -0
- package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
- package/templates/engine/.agents/scripts/test-impact-lib.mjs +451 -0
- package/templates/engine/.agents/scripts/test-impact.mjs +105 -0
- package/templates/engine/.agents/scripts/trust-mode.mjs +130 -0
- package/templates/engine/.agents/scripts/verify-scope.mjs +163 -0
- package/templates/engine/.agents/scripts/verify-wiki-consistency.mjs +264 -0
- package/templates/engine/.agents/scripts/verify.mjs +847 -0
- package/templates/engine/.agents/scripts/warn-format.mjs +57 -0
- package/templates/engine/.agents/scripts/wf-journal.mjs +230 -0
- package/templates/engine/.agents/scripts/workflow-board-server.mjs +696 -0
- package/templates/engine/.agents/scripts/workflow-enums.mjs +70 -0
- package/templates/engine/.agents/scripts/workflows-check.mjs +260 -0
- package/templates/engine/.agents/settings.json +33 -0
- package/templates/engine/.agents/skills/arena/SKILL.md +50 -0
- package/templates/engine/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/templates/engine/.agents/skills/blast-radius/SKILL.md +53 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/scripts/quality-gates.mjs +430 -0
- package/templates/engine/.agents/skills/dev-tour/SKILL.md +98 -0
- package/templates/engine/.agents/skills/dream/SKILL.md +63 -0
- package/templates/engine/.agents/skills/eval/SKILL.md +42 -0
- package/templates/engine/.agents/skills/eval/scripts/eval-score.mjs +59 -0
- package/templates/engine/.agents/skills/interrogate/SKILL.md +49 -0
- package/templates/engine/.agents/skills/interrogate/scripts/interrogate-plan.mjs +72 -0
- package/templates/engine/.agents/skills/number-vetting/SKILL.md +35 -0
- package/templates/engine/.agents/skills/page-refactor/SKILL.md +192 -0
- package/templates/engine/.agents/skills/page-refactor/references/templates.md +989 -0
- package/templates/engine/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/templates/engine/.agents/skills/papercut-fix/references/response-template.md +81 -0
- package/templates/engine/.agents/skills/pause-safely/SKILL.md +31 -0
- package/templates/engine/.agents/skills/perf/SKILL.md +42 -0
- package/templates/engine/.agents/skills/review-method/SKILL.md +92 -0
- package/templates/engine/.agents/skills/review-method/golden-set.md +61 -0
- package/templates/engine/.agents/skills/session-resume/SKILL.md +69 -0
- package/templates/engine/.agents/skills/session-resume/scripts/worktree-audit.mjs +110 -0
- package/templates/engine/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/templates/engine/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/templates/engine/.agents/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/templates/engine/.agents/skills/show-me-your-work/scripts/decision-log.mjs +24 -0
- package/templates/engine/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/templates/engine/.agents/skills/tfs-pr/scripts/tfs-pr.mjs +947 -0
- package/templates/engine/.agents/skills/verify-ui/SKILL.md +116 -0
- package/templates/engine/.agents/skills/verify-ui/features/.gitkeep +0 -0
- package/templates/engine/.agents/skills/verify-ui/scripts/gen-verify-feature.mjs +114 -0
- package/templates/engine/.agents/skills/visual-parity/SKILL.md +35 -0
- package/templates/engine/.agents/skills/why/SKILL.md +56 -0
- package/templates/engine/.agents/skills/why/scripts/why-evidence.mjs +74 -0
- package/templates/engine/.agents/skills/wiki/SKILL.md +53 -0
- package/templates/engine/.agents/tests/auto-tour.test.mjs +82 -0
- package/templates/engine/.agents/tests/dev-tour-model.test.mjs +452 -0
- package/templates/engine/.agents/tests/fill-plan-lite.test.mjs +46 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.md +14 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.model.json +179 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.md +21 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.model.json +194 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.md +20 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.model.json +225 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.md +15 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.model.json +160 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.model.json +266 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.md +17 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.model.json +359 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.md +16 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.model.json +131 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.model.json +190 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.model.json +362 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.model.json +224 -0
- package/templates/engine/.agents/tests/tools/gen-synthetic-plan.mjs +108 -0
- package/templates/git/.gitattributes +22 -0
- package/templates/git/.githooks/commit-msg +72 -0
- package/templates/git/.githooks/post-commit +62 -0
- package/templates/git/.githooks/pre-commit +197 -0
- package/templates/git/.githooks/pre-merge-commit +28 -0
- package/templates/git/.githooks/pre-push +201 -0
- package/templates/git/.gitignore.engine +11 -0
- package/templates/hosts/claude/CLAUDE.md +55 -0
- package/templates/hosts/claude/agents/implementer.md +7 -0
- package/templates/hosts/claude/agents/independent-reviewer.md +8 -0
- package/templates/hosts/claude/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/claude/agents/pr-finder.md +8 -0
- package/templates/hosts/claude/agents/pr-verifier.md +8 -0
- package/templates/hosts/claude/agents/ui-verifier.md +8 -0
- package/templates/hosts/claude/agents/wiki-compiler.md +8 -0
- package/templates/hosts/claude/commands/wf-deploy.md +10 -0
- package/templates/hosts/claude/commands/wf-maintain.md +10 -0
- package/templates/hosts/claude/commands/wf-new-task.md +10 -0
- package/templates/hosts/claude/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/claude/commands/wf-pr-review.md +10 -0
- package/templates/hosts/claude/commands/wf-review.md +10 -0
- package/templates/hosts/claude/commands/wf-stages.md +10 -0
- package/templates/hosts/claude/settings.json +57 -0
- package/templates/hosts/cline/agents/implementer.yml +15 -0
- package/templates/hosts/cline/agents/independent-reviewer.yml +20 -0
- package/templates/hosts/cline/agents/pr-adjudicator.yml +18 -0
- package/templates/hosts/cline/agents/pr-finder.yml +19 -0
- package/templates/hosts/cline/agents/pr-verifier.yml +18 -0
- package/templates/hosts/cline/agents/ui-verifier.yml +17 -0
- package/templates/hosts/cline/agents/wiki-compiler.yml +20 -0
- package/templates/hosts/cline/hooks/PreToolUse.cjs +260 -0
- package/templates/hosts/cline/workflows/wf-deploy.md +8 -0
- package/templates/hosts/cline/workflows/wf-maintain.md +8 -0
- package/templates/hosts/cline/workflows/wf-new-task.md +8 -0
- package/templates/hosts/cline/workflows/wf-pipeline-run.md +8 -0
- package/templates/hosts/cline/workflows/wf-pr-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-stages.md +8 -0
- package/templates/hosts/codebuddy/CODEBUDDY.md +7 -0
- package/templates/hosts/codebuddy/agents/implementer.md +9 -0
- package/templates/hosts/codebuddy/agents/independent-reviewer.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-finder.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-verifier.md +10 -0
- package/templates/hosts/codebuddy/agents/ui-verifier.md +11 -0
- package/templates/hosts/codebuddy/agents/wiki-compiler.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-deploy.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-maintain.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-new-task.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pr-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-stages.md +10 -0
- package/templates/hosts/codebuddy/rules/backend-scope.md +5 -0
- package/templates/hosts/codebuddy/rules/frontend-scope.md +5 -0
- package/templates/hosts/codebuddy/settings.json +31 -0
- package/templates/hosts/codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/templates/hosts/commandcode/agents/implementer.md +10 -0
- package/templates/hosts/commandcode/agents/independent-reviewer.md +9 -0
- package/templates/hosts/commandcode/agents/pr-adjudicator.md +9 -0
- package/templates/hosts/commandcode/agents/pr-finder.md +9 -0
- package/templates/hosts/commandcode/agents/pr-verifier.md +9 -0
- package/templates/hosts/commandcode/agents/ui-verifier.md +11 -0
- package/templates/hosts/commandcode/agents/wiki-compiler.md +10 -0
- package/templates/hosts/commandcode/commands/wf-deploy.md +9 -0
- package/templates/hosts/commandcode/commands/wf-maintain.md +9 -0
- package/templates/hosts/commandcode/commands/wf-new-task.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pr-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-stages.md +9 -0
- package/templates/hosts/commandcode/settings.json +59 -0
- package/templates/hosts/opencode/agents/implementer.md +51 -0
- package/templates/hosts/opencode/agents/independent-reviewer.md +18 -0
- package/templates/hosts/opencode/agents/pr-adjudicator.md +18 -0
- package/templates/hosts/opencode/agents/pr-finder.md +18 -0
- package/templates/hosts/opencode/agents/pr-verifier.md +18 -0
- package/templates/hosts/opencode/agents/ui-verifier.md +45 -0
- package/templates/hosts/opencode/agents/wiki-compiler.md +51 -0
- package/templates/hosts/opencode/commands/wf-deploy.md +7 -0
- package/templates/hosts/opencode/commands/wf-maintain.md +7 -0
- package/templates/hosts/opencode/commands/wf-new-task.md +7 -0
- package/templates/hosts/opencode/commands/wf-pipeline-run.md +7 -0
- package/templates/hosts/opencode/commands/wf-pr-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-stages.md +7 -0
- package/templates/hosts/pi/agents/implementer.md +10 -0
- package/templates/hosts/pi/agents/independent-reviewer.md +11 -0
- package/templates/hosts/pi/agents/pr-adjudicator.md +11 -0
- package/templates/hosts/pi/agents/pr-finder.md +10 -0
- package/templates/hosts/pi/agents/pr-verifier.md +10 -0
- package/templates/hosts/pi/agents/ui-verifier.md +10 -0
- package/templates/hosts/pi/agents/wiki-compiler.md +10 -0
- package/templates/hosts/pi/extensions/lib/gates-core.cjs +196 -0
- package/templates/hosts/pi/extensions/shipyard-gates.ts +95 -0
- package/templates/hosts/pi/settings.json +5 -0
- package/templates/hosts/qoder/agents/implementer.md +9 -0
- package/templates/hosts/qoder/agents/independent-reviewer.md +10 -0
- package/templates/hosts/qoder/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/qoder/agents/pr-finder.md +10 -0
- package/templates/hosts/qoder/agents/pr-verifier.md +10 -0
- package/templates/hosts/qoder/agents/ui-verifier.md +10 -0
- package/templates/hosts/qoder/agents/wiki-compiler.md +10 -0
- package/templates/hosts/qoder/commands/wf-deploy.md +8 -0
- package/templates/hosts/qoder/commands/wf-maintain.md +8 -0
- package/templates/hosts/qoder/commands/wf-new-task.md +8 -0
- package/templates/hosts/qoder/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/qoder/commands/wf-pr-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-stages.md +8 -0
- package/templates/hosts/qoder/settings.json +63 -0
- package/templates/hosts/qwen/agents/implementer.md +8 -0
- package/templates/hosts/qwen/agents/independent-reviewer.md +8 -0
- package/templates/hosts/qwen/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/qwen/agents/pr-finder.md +8 -0
- package/templates/hosts/qwen/agents/pr-verifier.md +8 -0
- package/templates/hosts/qwen/agents/ui-verifier.md +8 -0
- package/templates/hosts/qwen/agents/wiki-compiler.md +11 -0
- package/templates/hosts/qwen/commands/wf-deploy.md +9 -0
- package/templates/hosts/qwen/commands/wf-maintain.md +9 -0
- package/templates/hosts/qwen/commands/wf-new-task.md +9 -0
- package/templates/hosts/qwen/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/qwen/commands/wf-pr-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-stages.md +9 -0
- package/templates/hosts/qwen/settings.json +59 -0
- package/templates/hosts/trae/agents/implementer.md +9 -0
- package/templates/hosts/trae/agents/independent-reviewer.md +10 -0
- package/templates/hosts/trae/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/trae/agents/pr-finder.md +10 -0
- package/templates/hosts/trae/agents/pr-verifier.md +10 -0
- package/templates/hosts/trae/agents/ui-verifier.md +10 -0
- package/templates/hosts/trae/agents/wiki-compiler.md +10 -0
- package/templates/hosts/trae/commands/wf-deploy.md +8 -0
- package/templates/hosts/trae/commands/wf-maintain.md +8 -0
- package/templates/hosts/trae/commands/wf-new-task.md +8 -0
- package/templates/hosts/trae/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/trae/commands/wf-pr-review.md +8 -0
- package/templates/hosts/trae/commands/wf-review.md +8 -0
- package/templates/hosts/trae/commands/wf-stages.md +8 -0
- package/templates/hosts/trae/hooks.json +17 -0
- package/templates/hosts/trae/rules/backend-scope.md +5 -0
- package/templates/hosts/trae/rules/frontend-scope.md +5 -0
- package/templates/hosts/zcode/agents/implementer.md +8 -0
- package/templates/hosts/zcode/agents/independent-reviewer.md +8 -0
- package/templates/hosts/zcode/agents/ui-verifier.md +8 -0
- package/templates/hosts/zcode/agents/wiki-compiler.md +8 -0
- package/templates/hosts/zcode/config.json +31 -0
- package/templates/hosts/zcode/workflows/code-review.dwf.ts +428 -0
- package/templates/hosts/zcode/workflows/fullchain-flow-test.dwf.ts +898 -0
- package/templates/profiles/dotnet/.agents/config/lane-surfaces.txt +33 -0
- package/templates/profiles/dotnet/.agents/config/rule-budgets.txt +84 -0
- package/templates/profiles/dotnet/.agents/config/test-impact-map.json +590 -0
- package/templates/profiles/dotnet/.agents/config/workflow-modules.txt +18 -0
- package/templates/profiles/dotnet/.agents/hooks/commit-check.config.json +18 -0
- package/templates/profiles/dotnet/.agents/hooks/delete-guard-allowlist.txt +28 -0
- package/templates/profiles/dotnet/.agents/notes/runtime-env.md +178 -0
- package/templates/profiles/dotnet/AGENTS.md +52 -0
- package/templates/profiles/empty/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/empty/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/empty/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/empty/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/empty/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/empty/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/empty/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/empty/AGENTS.md +52 -0
- package/templates/profiles/node/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/node/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/node/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/node/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/node/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/node/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/node/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/node/AGENTS.md +52 -0
- package/templates/scaffold/wiki/INDEX.md +33 -0
- package/templates/scaffold/wiki/drafts-archive/README.md +7 -0
- package/templates/scaffold/wiki//344/272/247/345/223/201/351/234/200/346/261/202/.gitkeep +0 -0
- package/templates/scaffold/wiki//345/274/200/345/217/221/346/226/271/346/241/210/.gitkeep +0 -0
- package/templates/scaffold/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/templates/scaffold/wiki//346/265/213/350/257/225/346/212/245/345/221/212/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/224/250/346/210/267/345/212/237/350/203/275/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/templates/scaffold/wiki//351/241/271/347/233/256/350/247/204/350/214/203/.gitkeep +0 -0
- package/templates/scaffold/workflow/INDEX.md +13 -0
- package/templates/scaffold/workflow/README.md +67 -0
- package/templates/scaffold/workflow/archive/README.md +3 -0
- package/templates/scaffold/workflow/delegations.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/delegations.md +4 -0
- package/templates/scaffold/workflow/effective-policy.md +4 -0
- package/templates/scaffold/workflow/evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/gate-cost.md +4 -0
- package/templates/scaffold/workflow/gate-metrics.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/incidents/_TEMPLATE.md +49 -0
- package/templates/scaffold/workflow/intents/_TEMPLATE.md +43 -0
- package/templates/scaffold/workflow/metrics.md +4 -0
- package/templates/scaffold/workflow/papercuts.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/papercuts.md +3 -0
- package/templates/scaffold/workflow/plans/_TEMPLATE.md +47 -0
- package/templates/scaffold/workflow/regression-checklist.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/regression-checklist.md +3 -0
- package/templates/scaffold/workflow/research/.gitkeep +0 -0
- package/templates/scaffold/workflow/reviews.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/specs/_TEMPLATE.md +87 -0
- package/templates/scaffold/workflow/verify-evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/verify-evidence.md +4 -0
- package/LICENSE +0 -21
- package/modules/gates/README.md +0 -25
- package/modules/gates/dotnet-ca/README.md +0 -24
- package/modules/gates/dotnet-ca/check-architecture.sh +0 -150
- package/modules/gates/dotnet-ca/local-pre-commit.line +0 -1
- package/modules/gates/generated-readonly/README.md +0 -13
- package/modules/gates/generated-readonly/check-generated.mjs +0 -61
- package/modules/gates/generated-readonly/local-pre-commit.line +0 -1
- package/modules/gates/node-layer/README.md +0 -9
- package/modules/gates/node-layer/check-node-layer.mjs +0 -29
- package/modules/gates/node-layer/local-pre-commit.line +0 -1
- package/modules/gates/py-import/README.md +0 -9
- package/modules/gates/py-import/check-py-import.mjs +0 -30
- package/modules/gates/py-import/local-pre-commit.line +0 -1
- package/modules/gates/test-protect/README.md +0 -23
- package/modules/gates/test-protect/check-test-protect.mjs +0 -64
- package/modules/gates/test-protect/local-pre-commit.line +0 -1
- package/modules/hosts/README.md +0 -57
- package/modules/hosts/claude/agents/implementer.md +0 -51
- package/modules/hosts/claude/agents/independent-reviewer.md +0 -49
- package/modules/hosts/claude/agents/ui-verifier.md +0 -48
- package/modules/hosts/claude/commands/wf-build.md +0 -69
- package/modules/hosts/claude/commands/wf-deploy.md +0 -58
- package/modules/hosts/claude/commands/wf-design.md +0 -49
- package/modules/hosts/claude/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/claude/commands/wf-maintain.md +0 -76
- package/modules/hosts/claude/commands/wf-new-task.md +0 -102
- package/modules/hosts/claude/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/claude/commands/wf-plan.md +0 -40
- package/modules/hosts/claude/commands/wf-review.md +0 -49
- package/modules/hosts/claude/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/claude/commands/wf-test.md +0 -68
- package/modules/hosts/codex/agents/implementer.md +0 -51
- package/modules/hosts/codex/agents/independent-reviewer.md +0 -49
- package/modules/hosts/codex/agents/ui-verifier.md +0 -48
- package/modules/hosts/codex/commands/wf-build.md +0 -69
- package/modules/hosts/codex/commands/wf-deploy.md +0 -58
- package/modules/hosts/codex/commands/wf-design.md +0 -49
- package/modules/hosts/codex/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/codex/commands/wf-maintain.md +0 -76
- package/modules/hosts/codex/commands/wf-new-task.md +0 -102
- package/modules/hosts/codex/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/codex/commands/wf-plan.md +0 -40
- package/modules/hosts/codex/commands/wf-review.md +0 -49
- package/modules/hosts/codex/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/codex/commands/wf-test.md +0 -68
- package/modules/hosts/codex/skills/flow-kit/SKILL.md +0 -14
- package/modules/hosts/cursor/agents/implementer.md +0 -51
- package/modules/hosts/cursor/agents/independent-reviewer.md +0 -49
- package/modules/hosts/cursor/agents/ui-verifier.md +0 -48
- package/modules/hosts/cursor/commands/wf-build.md +0 -69
- package/modules/hosts/cursor/commands/wf-deploy.md +0 -58
- package/modules/hosts/cursor/commands/wf-design.md +0 -49
- package/modules/hosts/cursor/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/cursor/commands/wf-maintain.md +0 -76
- package/modules/hosts/cursor/commands/wf-new-task.md +0 -102
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/cursor/commands/wf-plan.md +0 -40
- package/modules/hosts/cursor/commands/wf-review.md +0 -49
- package/modules/hosts/cursor/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/cursor/commands/wf-test.md +0 -68
- package/modules/hosts/omp/agents/implementer.md +0 -52
- package/modules/hosts/omp/agents/independent-reviewer.md +0 -50
- package/modules/hosts/omp/agents/ui-verifier.md +0 -49
- package/modules/hosts/opencode/agents/implementer.md +0 -59
- package/modules/hosts/opencode/agents/independent-reviewer.md +0 -53
- package/modules/hosts/opencode/agents/ui-verifier.md +0 -52
- package/modules/hosts/opencode/commands/wf-build.md +0 -69
- package/modules/hosts/opencode/commands/wf-deploy.md +0 -58
- package/modules/hosts/opencode/commands/wf-design.md +0 -49
- package/modules/hosts/opencode/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/opencode/commands/wf-maintain.md +0 -76
- package/modules/hosts/opencode/commands/wf-new-task.md +0 -102
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/opencode/commands/wf-plan.md +0 -40
- package/modules/hosts/opencode/commands/wf-review.md +0 -49
- package/modules/hosts/opencode/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/opencode/commands/wf-test.md +0 -68
- package/modules/hosts/trae/agents/implementer.md +0 -52
- package/modules/hosts/trae/agents/independent-reviewer.md +0 -51
- package/modules/hosts/trae/agents/ui-verifier.md +0 -50
- package/modules/hosts/trae/commands/wf-build.md +0 -70
- package/modules/hosts/trae/commands/wf-deploy.md +0 -59
- package/modules/hosts/trae/commands/wf-design.md +0 -50
- package/modules/hosts/trae/commands/wf-gate-checklist.md +0 -78
- package/modules/hosts/trae/commands/wf-maintain.md +0 -77
- package/modules/hosts/trae/commands/wf-new-task.md +0 -103
- package/modules/hosts/trae/commands/wf-pipeline-run.md +0 -36
- package/modules/hosts/trae/commands/wf-plan.md +0 -41
- package/modules/hosts/trae/commands/wf-review.md +0 -50
- package/modules/hosts/trae/commands/wf-sync-hosts.md +0 -65
- package/modules/hosts/trae/commands/wf-test.md +0 -69
- package/modules/hosts/trae/hooks/post-edit-check.cjs +0 -98
- package/modules/hosts/trae/hooks/pre-shell-check.cjs +0 -192
- package/modules/hosts/trae/hooks/resolve-shell.cjs +0 -30
- package/modules/hosts/trae/hooks.json +0 -29
- package/modules/hosts/trae/rules/beautify-input-chinese.md +0 -6
- package/modules/hosts/trae/rules/git-commit-message.md +0 -10
- package/modules/hosts/trae/rules/project-workflow.md +0 -14
- package/modules/hosts/zcode/agents/implementer.md +0 -51
- package/modules/hosts/zcode/agents/independent-reviewer.md +0 -49
- package/modules/hosts/zcode/agents/ui-verifier.md +0 -48
- package/src/add-gate.mjs +0 -116
- package/src/add-gate.test.mjs +0 -103
- package/src/add-host.mjs +0 -68
- package/src/cli.mjs +0 -169
- package/src/doctor.mjs +0 -629
- package/src/executor.mjs +0 -262
- package/src/executor.test.mjs +0 -295
- package/src/fresh-init.test.mjs +0 -64
- package/src/gate-dotnet-ca.test.mjs +0 -124
- package/src/gates.test.mjs +0 -143
- package/src/init.mjs +0 -382
- package/src/init.test.mjs +0 -163
- package/src/instance-ref.test.mjs +0 -62
- package/src/jscpd-drift.test.mjs +0 -145
- package/src/pack.test.mjs +0 -24
- package/src/profiles.mjs +0 -183
- package/src/render.mjs +0 -132
- package/src/rule-budget.test.mjs +0 -103
- package/src/run-tests.mjs +0 -56
- package/src/stack-profile.test.mjs +0 -95
- package/src/sync-hosts.mjs +0 -257
- package/src/sync-hosts.test.mjs +0 -291
- package/src/sync.mjs +0 -228
- package/src/sync.test.mjs +0 -452
- package/src/trae-hooks.test.mjs +0 -127
- package/src/validate.mjs +0 -77
- package/src/validate.test.mjs +0 -95
- package/templates/.gitattributes +0 -17
- package/templates/AGENTS.md +0 -58
- package/templates/_agents/board/index.html +0 -676
- package/templates/_agents/commands/build.md +0 -84
- package/templates/_agents/commands/deploy.md +0 -66
- package/templates/_agents/commands/design.md +0 -63
- package/templates/_agents/commands/gate-checklist.md +0 -91
- package/templates/_agents/commands/maintain.md +0 -90
- package/templates/_agents/commands/new-task.md +0 -110
- package/templates/_agents/commands/pipeline-run.md +0 -43
- package/templates/_agents/commands/plan.md +0 -48
- package/templates/_agents/commands/review.md +0 -62
- package/templates/_agents/commands/sync-hosts.md +0 -77
- package/templates/_agents/commands/test.md +0 -87
- package/templates/_agents/control-surfaces.txt +0 -53
- package/templates/_agents/engine-lock.json +0 -342
- package/templates/_agents/hooks/check-index-incremental.mjs +0 -48
- package/templates/_agents/hooks/check-pairing-incremental.mjs +0 -66
- package/templates/_agents/hooks/check-wiki-ledger.mjs +0 -30
- package/templates/_agents/hooks/commit-check.cjs +0 -193
- package/templates/_agents/hooks/local-pre-commit +0 -6
- package/templates/_agents/lane-surfaces.txt +0 -17
- package/templates/_agents/level-hints.txt +0 -30
- package/templates/_agents/loop/papercut-debt/DESIGN.md +0 -112
- package/templates/_agents/mechanism-registry.md +0 -35
- package/templates/_agents/metric-claims.txt +0 -81
- package/templates/_agents/notes/engine-internals.md +0 -17
- package/templates/_agents/notes/runtime-env.md +0 -18
- package/templates/_agents/roles/implementer.md +0 -47
- package/templates/_agents/roles/independent-reviewer.md +0 -45
- package/templates/_agents/roles/ui-verifier.md +0 -44
- package/templates/_agents/rule-budgets.txt +0 -20
- package/templates/_agents/scripts/agg-delegations.cjs +0 -302
- package/templates/_agents/scripts/agg-delegations.test.mjs +0 -282
- package/templates/_agents/scripts/agg-gate-stats.mjs +0 -113
- package/templates/_agents/scripts/agg-gate-stats.test.mjs +0 -95
- package/templates/_agents/scripts/agg-judgments.mjs +0 -156
- package/templates/_agents/scripts/agg-judgments.test.mjs +0 -93
- package/templates/_agents/scripts/archive-sweep.mjs +0 -235
- package/templates/_agents/scripts/archive-sweep.test.mjs +0 -129
- package/templates/_agents/scripts/check-attribution.mjs +0 -37
- package/templates/_agents/scripts/check-convergence.mjs +0 -124
- package/templates/_agents/scripts/check-engine-integrity.mjs +0 -220
- package/templates/_agents/scripts/check-engine-integrity.test.mjs +0 -215
- package/templates/_agents/scripts/check-funnel.mjs +0 -56
- package/templates/_agents/scripts/check-hygiene.mjs +0 -167
- package/templates/_agents/scripts/check-hygiene.test.mjs +0 -182
- package/templates/_agents/scripts/check-index-incremental.test.mjs +0 -73
- package/templates/_agents/scripts/check-lane-surface.mjs +0 -238
- package/templates/_agents/scripts/check-lane-surface.test.mjs +0 -302
- package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -586
- package/templates/_agents/scripts/check-ledger-invariant.test.mjs +0 -639
- package/templates/_agents/scripts/check-loop-rev.test.mjs +0 -336
- package/templates/_agents/scripts/check-loop-unit.test.mjs +0 -103
- package/templates/_agents/scripts/check-loop.mjs +0 -1987
- package/templates/_agents/scripts/check-loop.sh +0 -6
- package/templates/_agents/scripts/check-loop.test.mjs +0 -3912
- package/templates/_agents/scripts/check-metric-claims.mjs +0 -277
- package/templates/_agents/scripts/check-prejudgment.mjs +0 -64
- package/templates/_agents/scripts/check-registry.mjs +0 -45
- package/templates/_agents/scripts/check-scope.mjs +0 -96
- package/templates/_agents/scripts/check-scope.test.mjs +0 -99
- package/templates/_agents/scripts/check-scripts-syntax.mjs +0 -84
- package/templates/_agents/scripts/check-scripts-syntax.test.mjs +0 -72
- package/templates/_agents/scripts/check-spec-verif.mjs +0 -47
- package/templates/_agents/scripts/check-stage-index.mjs +0 -40
- package/templates/_agents/scripts/check-stage-index.test.mjs +0 -77
- package/templates/_agents/scripts/closeout-l1.mjs +0 -217
- package/templates/_agents/scripts/closeout-l1.test.mjs +0 -105
- package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -205
- package/templates/_agents/scripts/compact-ledgers.mjs +0 -97
- package/templates/_agents/scripts/compact-ledgers.test.mjs +0 -162
- package/templates/_agents/scripts/confirm-doc.mjs +0 -610
- package/templates/_agents/scripts/confirm-doc.test.mjs +0 -1119
- package/templates/_agents/scripts/doctor.test.mjs +0 -770
- package/templates/_agents/scripts/draft-sediment.mjs +0 -178
- package/templates/_agents/scripts/draft-sediment.test.mjs +0 -272
- package/templates/_agents/scripts/edit-face-check.mjs +0 -109
- package/templates/_agents/scripts/edit-face-check.test.mjs +0 -99
- package/templates/_agents/scripts/ensure-board.mjs +0 -185
- package/templates/_agents/scripts/fill-intent.mjs +0 -91
- package/templates/_agents/scripts/fill-intent.test.mjs +0 -113
- package/templates/_agents/scripts/fill-plan.mjs +0 -79
- package/templates/_agents/scripts/fill-plan.test.mjs +0 -224
- package/templates/_agents/scripts/fill-spec.mjs +0 -70
- package/templates/_agents/scripts/fill-spec.test.mjs +0 -266
- package/templates/_agents/scripts/fixture-scripts.mjs +0 -153
- package/templates/_agents/scripts/fixture-scripts.test.mjs +0 -112
- package/templates/_agents/scripts/gate-checklist.mjs +0 -209
- package/templates/_agents/scripts/gate-checklist.test.mjs +0 -201
- package/templates/_agents/scripts/gate-seg.mjs +0 -54
- package/templates/_agents/scripts/gate-seg.test.mjs +0 -112
- package/templates/_agents/scripts/gen-effective-policy.mjs +0 -107
- package/templates/_agents/scripts/gen-effective-policy.test.mjs +0 -100
- package/templates/_agents/scripts/gen-verify-evidence.mjs +0 -107
- package/templates/_agents/scripts/gen-verify-evidence.test.mjs +0 -84
- package/templates/_agents/scripts/gen-wiki-board.mjs +0 -276
- package/templates/_agents/scripts/gen-wiki-board.test.mjs +0 -249
- package/templates/_agents/scripts/gen-workflow-dashboard.mjs +0 -251
- package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +0 -188
- package/templates/_agents/scripts/gen-workflow-index.mjs +0 -201
- package/templates/_agents/scripts/gen-workflow-index.test.mjs +0 -152
- package/templates/_agents/scripts/gen-workflow-metrics.mjs +0 -466
- package/templates/_agents/scripts/gen-workflow-metrics.test.mjs +0 -343
- package/templates/_agents/scripts/git-merge-jsonl.mjs +0 -63
- package/templates/_agents/scripts/git-merge-jsonl.test.mjs +0 -125
- package/templates/_agents/scripts/judgment-ledger.mjs +0 -65
- package/templates/_agents/scripts/judgment-ledger.test.mjs +0 -129
- package/templates/_agents/scripts/kb-cache-evict.mjs +0 -50
- package/templates/_agents/scripts/kb-cache-evict.test.mjs +0 -104
- package/templates/_agents/scripts/kb-search.mjs +0 -413
- package/templates/_agents/scripts/kb-search.test.mjs +0 -299
- package/templates/_agents/scripts/lane-surface-audit.mjs +0 -143
- package/templates/_agents/scripts/lane-surface-audit.test.mjs +0 -93
- package/templates/_agents/scripts/ledger-doc-chain.test.mjs +0 -166
- package/templates/_agents/scripts/ledger-loader.mjs +0 -108
- package/templates/_agents/scripts/ledger-loader.test.mjs +0 -131
- package/templates/_agents/scripts/ledger-prune.mjs +0 -96
- package/templates/_agents/scripts/ledger-prune.test.mjs +0 -120
- package/templates/_agents/scripts/ledger-shards.mjs +0 -344
- package/templates/_agents/scripts/ledger-shards.test.mjs +0 -356
- package/templates/_agents/scripts/ledger-ts-monotonic.test.mjs +0 -135
- package/templates/_agents/scripts/level-criteria.mjs +0 -231
- package/templates/_agents/scripts/level-criteria.test.mjs +0 -281
- package/templates/_agents/scripts/mechanism-retire-watch.mjs +0 -183
- package/templates/_agents/scripts/mechanism-retire-watch.test.mjs +0 -114
- package/templates/_agents/scripts/papercut-debt-controller.mjs +0 -141
- package/templates/_agents/scripts/papercut-debt-controller.test.mjs +0 -127
- package/templates/_agents/scripts/papercut-debt-sensor.mjs +0 -170
- package/templates/_agents/scripts/papercut-debt-sensor.test.mjs +0 -146
- package/templates/_agents/scripts/pipeline-run-docs.mjs +0 -76
- package/templates/_agents/scripts/pipeline-run-run.mjs +0 -63
- package/templates/_agents/scripts/pipeline-run.mjs +0 -867
- package/templates/_agents/scripts/pipeline-run.test.mjs +0 -517
- package/templates/_agents/scripts/policy.mjs +0 -281
- package/templates/_agents/scripts/pre-push.test.mjs +0 -105
- package/templates/_agents/scripts/resolve-merge-conflicts.mjs +0 -110
- package/templates/_agents/scripts/resolve-merge-conflicts.test.mjs +0 -87
- package/templates/_agents/scripts/rewrite-file.mjs +0 -133
- package/templates/_agents/scripts/rewrite-file.test.mjs +0 -148
- package/templates/_agents/scripts/rule-budget.mjs +0 -96
- package/templates/_agents/scripts/rule-budget.test.mjs +0 -118
- package/templates/_agents/scripts/run-tests.mjs +0 -99
- package/templates/_agents/scripts/run-tests.test.mjs +0 -105
- package/templates/_agents/scripts/solidify-task.mjs +0 -109
- package/templates/_agents/scripts/solidify-task.test.mjs +0 -129
- package/templates/_agents/scripts/stage-gates.mjs +0 -343
- package/templates/_agents/scripts/stage-gates.test.mjs +0 -105
- package/templates/_agents/scripts/trust-mode.mjs +0 -67
- package/templates/_agents/scripts/trust-mode.test.mjs +0 -110
- package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -253
- package/templates/_agents/scripts/verify-wiki-consistency.test.mjs +0 -123
- package/templates/_agents/scripts/verify.mjs +0 -345
- package/templates/_agents/scripts/verify.test.mjs +0 -373
- package/templates/_agents/scripts/wf-journal.mjs +0 -231
- package/templates/_agents/scripts/wf-journal.test.mjs +0 -216
- package/templates/_agents/scripts/wiki-search.mjs +0 -19
- package/templates/_agents/scripts/wiki-search.test.mjs +0 -57
- package/templates/_agents/scripts/workflow-board-server.mjs +0 -393
- package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -201
- package/templates/_agents/scripts/workflow-enums.mjs +0 -70
- package/templates/_agents/scripts/workflow-enums.test.mjs +0 -118
- package/templates/_agents/scripts/workflows-check.mjs +0 -260
- package/templates/_agents/scripts/workflows-check.test.mjs +0 -278
- package/templates/_agents/scripts-test-exempt.txt +0 -16
- package/templates/_agents/skills/papercut-fix/SKILL.md +0 -60
- package/templates/_agents/skills/papercut-fix/references/response-template.md +0 -81
- package/templates/_agents/skills/review-method/SKILL.md +0 -58
- package/templates/_agents/skills/verify-ui/SKILL.md +0 -61
- package/templates/_agents/skills/wiki/SKILL.md +0 -106
- package/templates/_agents/workflow-enums.txt +0 -26
- package/templates/_agents/workflow-modules.txt +0 -11
- package/templates/_agents/workflows/_TEMPLATE.md +0 -75
- package/templates/_agents/workflows/pipeline-closing.md +0 -28
- package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +0 -16
- package/templates/_githooks/commit-msg +0 -17
- package/templates/_githooks/post-commit +0 -10
- package/templates/_githooks/pre-commit +0 -126
- package/templates/_githooks/pre-merge-commit +0 -29
- package/templates/_githooks/pre-push +0 -136
- package/templates/_github/workflows/kit-ci.yml +0 -49
- package/templates/wiki/INDEX.md +0 -73
- package/templates/wiki/drafts-archive/README.md +0 -3
- package/templates/wiki//344/272/247/345/223/201/351/234/200/346/261/202/README.md +0 -3
- package/templates/wiki//345/274/200/345/217/221/346/226/271/346/241/210/README.md +0 -3
- package/templates/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +0 -3
- package/templates/wiki//346/265/213/350/257/225/346/212/245/345/221/212/README.md +0 -3
- package/templates/wiki//347/224/250/346/210/267/345/212/237/350/203/275/README.md +0 -3
- package/templates/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +0 -77
- package/templates/wiki//351/241/271/347/233/256/350/247/204/350/214/203/README.md +0 -3
- package/templates/wiki//351/241/271/347/233/256/350/256/241/345/210/222/README.md +0 -3
- package/templates/workflow/README.md +0 -91
- package/templates/workflow/delegations.md +0 -29
- package/templates/workflow/incidents/_TEMPLATE.md +0 -51
- package/templates/workflow/intents/_TEMPLATE.md +0 -51
- package/templates/workflow/papercuts.md +0 -9
- package/templates/workflow/plans/_TEMPLATE.md +0 -47
- package/templates/workflow/regression-checklist.md +0 -23
- package/templates/workflow/specs/_TEMPLATE.md +0 -80
- /package/templates/{_agents → engine/.agents}/board/marked.min.js +0 -0
- /package/templates/{_agents/workflows → engine/.agents/pipelines}/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md" +0 -0
- /package/templates/{_agents → engine/.agents}/scripts/git-core.mjs +0 -0
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
// stage-gates.mjs — 逐阶段前置判定的单源(fill-spec / fill-plan / confirm-doc 共享;2026-09-30 stage-gate-machine)
|
|
2
|
-
// 口径(与 check-loop 检查 19 内联实现互引——改一处须跟另一处):
|
|
3
|
-
// 入口「已确认」= 文件存在且 frontmatter 状态 ∈ {approved, done},且【机器事实源】满足其一:
|
|
4
|
-
// ① confirmations.jsonl 台账存在该 doc 的 stage ∈ {approved, done} 行(经 confirm-doc 才产生,防手改状态冒充);
|
|
5
|
-
// ② 存量口径:文档日期早于 policy.confirmDocsEffective,或行首含「流程: legacy」。
|
|
6
|
-
// incident 入口 = 文件存在 + 「时间线」小节内、行首列表条目含「用户确认」(原 maintain.md §3 约定;
|
|
7
|
-
// 2026-09-30 复核 P2-1 收窄为小节内行首条目;第三轮复核 P1-1 起接受日期前缀形态,与模板样例一致);
|
|
8
|
-
// 状态 ∈ {open, fixed, closed}(spec/plan 须先于 fixed 起草,故 open 即为有效态)。
|
|
9
|
-
// 入口「级别」须 ∈ L1-L3(2026-10-13 L0 退役,自源仓收敛系列 1 回灌;L0 → suspect 走 fail-closed);
|
|
10
|
-
// 缺失即拒(fail-closed)——**但库存量形态短路**(`流程: legacy` 或 日期早于
|
|
11
|
-
// 确认门生效日):跳过级别校验与 spec 档(2026-09-30 增量复核 N1——存量最可能缺级别,硬拒会锁死
|
|
12
|
-
// spec 起草与确认)。
|
|
13
|
-
// 注意:**库存量信号本身即等于「入口已确认」**(judgeDoc:`台账行 || 存量口径`,与检查 15 / 检查 1 /
|
|
14
|
-
// 配对门的既有口径一致——早于确认门生效日的自报日期即存量豁免,不要求另有台账行);此处「短路」
|
|
15
|
-
// 只额外豁免**级别前置与 spec 档**,不是对台账要求的二次豁免(P2-1:原注释把二者写反,已订正)。
|
|
16
|
-
// plan 门追加:入口级别(取入口 frontmatter 级别,不取工具 --level)为 L2/L3 时,同名 spec 须已确认(同口径)。
|
|
17
|
-
// L1 即入口例外(2026-10-13 自 Shipyard 回灌):同名 intent/incident 均无时,级别 L1 的 plan 自身即入口,
|
|
18
|
-
// 起草/确认门放行(文件已在则级别以文件 frontmatter 为准,禁用 --level L1 放行存量 L2 plan)。
|
|
19
|
-
// 探索泳道豁免(2026-09-30 hybrid-governance-explore-hardening):同名 intent 仍为 draft 且风险泳道为
|
|
20
|
-
// L1(级别优先;级别缺失或非法时回落 risk_level——fill-intent 双写同值)→「先起草后确认」是协作道
|
|
21
|
-
// 语义(check-loop 检查 19 同款豁免口径),放行 spec/plan 起草与确认;L2/L3 防御道维持入口确认前置。
|
|
22
|
-
// incident 入口不豁免(过目留痕本就轻量)。收口由 check-loop --hardening 加固门兜底(入 main 前须
|
|
23
|
-
// intent approved/done + spec/plan 在场)。
|
|
24
|
-
// 信任边界声明(沿 2026-09-28 audit-gate-hardening 口径):本地可写台账 / 手改状态仍可伪造——本模块只把
|
|
25
|
-
// 「顺手绕过」抬到「主动伪造」,不宣称通道关闭;事后对质靠 git 历史与台账。
|
|
26
|
-
// 设计先例:fill-* 已 import 同目录 workflow-enums.mjs;check-loop 检查 19 内联同口径(门禁脚本自包含、防兄弟依赖)。
|
|
27
|
-
import fs from 'node:fs';
|
|
28
|
-
import path from 'node:path';
|
|
29
|
-
import { spawnSync } from 'node:child_process';
|
|
30
|
-
import { loadKitPolicy } from './policy.mjs';
|
|
31
|
-
import { readLedgerRows } from './ledger-loader.mjs';
|
|
32
|
-
|
|
33
|
-
export const ENTRY_STATUSES = ['approved', 'done'];
|
|
34
|
-
export const INCIDENT_STATUSES = ['open', 'fixed', 'closed'];
|
|
35
|
-
|
|
36
|
-
// readFm:frontmatter 区(首 --- 至闭合 ---)取单字段值;无 frontmatter / 无该键 → ''
|
|
37
|
-
export function readFm(abs, key) {
|
|
38
|
-
let text;
|
|
39
|
-
try { text = fs.readFileSync(abs, 'utf8'); } catch { return ''; }
|
|
40
|
-
const lines = text.replace(/\r\n/g, '\n').split('\n');
|
|
41
|
-
if (!/^---\s*$/.test(lines[0] || '')) return '';
|
|
42
|
-
for (let i = 1; i < lines.length; i++) {
|
|
43
|
-
if (/^---\s*$/.test(lines[i])) break;
|
|
44
|
-
const m = lines[i].match(new RegExp(`^${key}:\\s*(.*)$`));
|
|
45
|
-
if (m) return m[1].trim();
|
|
46
|
-
}
|
|
47
|
-
return '';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function readBody(abs) {
|
|
51
|
-
try { return fs.readFileSync(abs, 'utf8'); } catch { return ''; }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// readLedger:confirmations.jsonl 追加式台账(坏行容忍跳过;与 check-loop 检查 15 同容错口径)
|
|
55
|
-
// 读法收敛到 ledger-loader 单源(2026-10-12 ledger-loader-p1):本函数此前自持 readFileSync+parse
|
|
56
|
-
// 复刻,与其余 5 处各写各的——分片台账落地时逐处加分支必然漏改。签名与返回值不变。
|
|
57
|
-
export function readLedger(root) {
|
|
58
|
-
return readLedgerRows(root);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// judgeDoc:状态枚举 + 机器事实源判定(供入口 / spec 复用)
|
|
62
|
-
// legacy:库存量信号(`流程: legacy` 标记 或 日期 < confirmDocsEffective)——所有调用方与门禁其余部分
|
|
63
|
-
// 同口径(配对门 / 检查 1 / 检查 15 / 检查 19);2026-09-30 复核 N1:存量入口须先短路,不得被
|
|
64
|
-
// 「缺级别」fail-closed 硬拒(存量最可能缺级别,硬拒会锁死 spec 起草/确认,违反「存量零新增」契约)。
|
|
65
|
-
function judgeDoc(root, abs, rel, statuses) {
|
|
66
|
-
const st = readFm(abs, '状态');
|
|
67
|
-
if (!statuses.includes(st)) {
|
|
68
|
-
return { ok: false, status: st, legacy: false, reason: `状态「${st || '缺失'}」不在 ${statuses.join(' / ')}` };
|
|
69
|
-
}
|
|
70
|
-
const policy = loadKitPolicy(root);
|
|
71
|
-
const body = readBody(abs);
|
|
72
|
-
const legacyByMarker = body.split(/\r?\n/).some((l) => /^流程: legacy/.test(l));
|
|
73
|
-
const d = readFm(abs, '日期') || readFm(abs, '发现');
|
|
74
|
-
const legacyByDate = /^\d{4}-\d{2}-\d{2}$/.test(d) && d < policy.confirmDocsEffective;
|
|
75
|
-
const legacy = legacyByMarker || legacyByDate;
|
|
76
|
-
const hasRow = readLedger(root).some((e) => e && e.doc === rel && (e.stage === 'approved' || e.stage === 'done'));
|
|
77
|
-
if (hasRow || legacy) return { ok: true, status: st, legacy };
|
|
78
|
-
return { ok: false, status: st, legacy: false, reason: `无确认台账行(门禁后的入口须经 confirm-doc,且台账无 ${rel} 的 approved / done 行)` };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// entryStorageLegacy:入口是否属「库存量」形态(`流程: legacy` 标记 或 日期早于确认门生效日)——
|
|
82
|
-
// 与 judgeDoc 的存量信号同口径,供门在**级别校验**处短路(2026-09-30 增量复核 N1)。注意:本短路
|
|
83
|
-
// **只豁免 level 前置**(存量多为门禁前建档、无级别字段),**不豁免台账要求**——`judgeDoc` 的
|
|
84
|
-
// hasRow||legacy 仍照常判定(门禁后无台账行即拒,不因日期早于生效日而放行)。
|
|
85
|
-
export function entryStorageLegacy(root, abs) {
|
|
86
|
-
const body = readBody(abs);
|
|
87
|
-
if (body.split(/\r?\n/).some((l) => /^流程: legacy/.test(l))) return true;
|
|
88
|
-
const d = readFm(abs, '日期') || readFm(abs, '发现');
|
|
89
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(d) && d < loadKitPolicy(root).confirmDocsEffective;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// incidentMarked:「## 时间线」小节内、行首列表条目形态的「用户确认」(维持口径;正文叙述句不算——
|
|
93
|
-
// 2026-09-30 复核 P2-1 实证:全仓唯一历史命中为叙述句,非过目留痕)。
|
|
94
|
-
// 行首可选日期前缀(`- 2026-09-30 用户确认:…`)与可选加粗(`- **用户确认**:…`)均接受——
|
|
95
|
-
// 与 _TEMPLATE.md 时间线样例形态保持一致(2026-09-30 第三轮复核 P1-1:样例若不可解析即误导)。
|
|
96
|
-
export function incidentMarked(body) {
|
|
97
|
-
let inTimeline = false;
|
|
98
|
-
for (const l of String(body).replace(/\r\n/g, '\n').split('\n')) {
|
|
99
|
-
if (/^##\s/.test(l)) { inTimeline = /^##\s*时间线/.test(l); continue; }
|
|
100
|
-
if (inTimeline && MARK_RE.test(l)) return true;
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// MARK_RE:行首列表条目 + 可选日期前缀(YYYY-MM-DD 或 <日期> 占位)+ 可选加粗围栏(词前 / 词后均可)
|
|
106
|
-
// + 「用户确认」+ **须紧跟冒号或行尾**(词边界)。
|
|
107
|
-
// 形态矩阵(2026-09-30 四/五轮复核收敛,8 正例 / 5 负例由 fill-spec.test S19/S20 钉死):
|
|
108
|
-
// 命中:`- 用户确认:…` / `- **用户确认**:…` / `- 2026-09-30 用户确认:…` / `- <日期> **用户确认**:…` / 行尾无冒号
|
|
109
|
-
// 拒绝:`- 2026-09-30 用户确认了方案` / `- 用户确认书已归档` / `- 用户确认。` / `- 待用户确认:…`
|
|
110
|
-
// 注:词前的 `\**` 与词后的 `\**` 必须都允许——只开一侧即产生结构性假阴性(第五轮复核 P1 实证:
|
|
111
|
-
// 加粗围栏形态被拒,与 _TEMPLATE.md 自述契约冲突)。
|
|
112
|
-
export const MARK_RE = /^\s*[-*]\s*(?:\d{4}-\d{2}-\d{2}|<日期>)?\s*\**用户确认\**(?=\s*[::]|\s*$)/;
|
|
113
|
-
|
|
114
|
-
// entryConfirmed:同主题入口判定(intent 优先;否则 incidents)——返回 {ok, kind, rel, level, status, reason?}
|
|
115
|
-
export function entryConfirmed(root, base) {
|
|
116
|
-
const intentRel = `workflow/intents/${base}.md`;
|
|
117
|
-
const intentAbs = path.join(root, intentRel);
|
|
118
|
-
if (fs.existsSync(intentAbs)) {
|
|
119
|
-
const r = judgeDoc(root, intentAbs, intentRel, ENTRY_STATUSES);
|
|
120
|
-
return { ...r, kind: 'intent', rel: intentRel, level: readFm(intentAbs, '级别'), risk: readFm(intentAbs, 'risk_level'), date: readFm(intentAbs, '日期'), storageLegacy: entryStorageLegacy(root, intentAbs) };
|
|
121
|
-
}
|
|
122
|
-
const incRel = `workflow/incidents/${base}.md`;
|
|
123
|
-
const incAbs = path.join(root, incRel);
|
|
124
|
-
if (fs.existsSync(incAbs)) {
|
|
125
|
-
const st = readFm(incAbs, '状态');
|
|
126
|
-
const level = readFm(incAbs, '级别');
|
|
127
|
-
if (INCIDENT_STATUSES.includes(st) && incidentMarked(readBody(incAbs))) {
|
|
128
|
-
return { ok: true, kind: 'incident', rel: incRel, level, status: st, legacy: false };
|
|
129
|
-
}
|
|
130
|
-
const why = !INCIDENT_STATUSES.includes(st) ? `状态「${st || '缺失'}」非法` : '「时间线」小节缺「用户确认」条目(maintain.md §3)';
|
|
131
|
-
return { ok: false, kind: 'incident', rel: incRel, level, status: st, legacy: false, reason: `同名 incident 未过目确认——${why}` };
|
|
132
|
-
}
|
|
133
|
-
return { ok: false, kind: null, rel: null, level: '', status: '', reason: `未找到同名入口(workflow/intents 与 workflow/incidents 均无 ${base}.md)` };
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// specConfirmed:plan 门的 L2/L3 追加要求
|
|
137
|
-
export function specConfirmed(root, base) {
|
|
138
|
-
const rel = `workflow/specs/${base}.md`;
|
|
139
|
-
const abs = path.join(root, rel);
|
|
140
|
-
if (!fs.existsSync(abs)) return { ok: false, reason: `缺同名 spec(${rel})` };
|
|
141
|
-
return judgeDoc(root, abs, rel, ENTRY_STATUSES);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// laneOfEntry / laneOfDoc:泳道单源取法(2026-10-02 caliber-convergence 方案 C「分歧双严」)
|
|
145
|
-
// risk_level 为 intent 专属协议字段(fill-intent 双写),生效锚 policy.riskLevelSince:
|
|
146
|
-
// 级别非法/缺失 → suspect(fail-closed 就严);
|
|
147
|
-
// 日期 ≥ 锚(双字段协议期):risk 合法且与级别一致 → 按值判 low/high,否则(缺失/非法/分歧)→ suspect;
|
|
148
|
-
// 日期 < 锚(协议前存量):两值俱在且分歧 → suspect,否则按级别单字段判(risk 缺席不惩罚——字段协议尚不存在)。
|
|
149
|
-
// suspect 消费规则(双严):红线类检查按 low 执行(拦红线);豁免类门(起草豁免/--batch/--auto/加固门
|
|
150
|
-
// lane/泳道豁免/逐阶段深度)按 high 执行(不豁免)。取代原三处并存语义(任一低即低 / 级别优先回落 / 仅级别)。
|
|
151
|
-
export function laneOfEntry(level, risk, riskLevelSince, date) {
|
|
152
|
-
const L = /^L[1-3]$/.test(level || '') ? level : '';
|
|
153
|
-
if (!L) return 'suspect';
|
|
154
|
-
const R = /^L[1-3]$/.test(risk || '') ? risk : '';
|
|
155
|
-
const dualProtocol = !!riskLevelSince && /^\d{4}-\d{2}-\d{2}$/.test(date || '') && date >= riskLevelSince;
|
|
156
|
-
if (dualProtocol) return (R && R === L) ? (L === 'L1' ? 'low' : 'high') : 'suspect';
|
|
157
|
-
if (R && R !== L) return 'suspect';
|
|
158
|
-
return L === 'L1' ? 'low' : 'high';
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// laneOfDoc:非 intent 件(spec/plan/incident——级别单字段协议):合法按值判,非法 → suspect。
|
|
162
|
-
export function laneOfDoc(level) {
|
|
163
|
-
if (!/^L[1-3]$/.test(level || '')) return 'suspect';
|
|
164
|
-
return level === 'L1' ? 'low' : 'high';
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// draftGateFor:起草门总判(kind = 'spec' | 'plan',fill 工具与 confirm-doc 逐阶段门共用)
|
|
168
|
-
// opts.level(可选,2026-10-13 自 Shipyard 回灌):仅供 plan「L1 即入口」例外取级别——文件未落盘时认
|
|
169
|
-
// fill 工具传入的 --level;confirm-doc 调用(confirmGateFor)不传,落盘后级别一律以文件 frontmatter 为准。
|
|
170
|
-
export function draftGateFor(kind, root, base, opts = {}) {
|
|
171
|
-
const entry = entryConfirmed(root, base);
|
|
172
|
-
if (!entry.ok) {
|
|
173
|
-
// 探索泳道豁免(2026-09-30 hybrid-governance-explore-hardening):L1 draft intent 放行起草
|
|
174
|
-
// ——「先动手后确认」;泳道取法自 2026-10-02 caliber-convergence 起单源 laneOfEntry(方案 C 分歧
|
|
175
|
-
// 双严:suspect 不豁免——级别/risk_level 缺失、非法或分歧均按防御道走入口确认)。
|
|
176
|
-
const lane = laneOfEntry(entry.level, entry.risk, loadKitPolicy(root).riskLevelSince, entry.date);
|
|
177
|
-
if (entry.kind === 'intent' && entry.status === 'draft' && lane === 'low') {
|
|
178
|
-
return { ok: true, entry, laneBypass: true };
|
|
179
|
-
}
|
|
180
|
-
// L1 plan 即入口(2026-10-13 自 Shipyard 回灌):没有 intent/incident 时,这份 plan 自己就是入口。
|
|
181
|
-
// 文件已在则级别以文件为准(禁止用 --level L1 把已有 L2 plan 放行);尚未落盘才认 opts.level。
|
|
182
|
-
if (kind === 'plan' && entry.kind === null) {
|
|
183
|
-
const planAbs = path.join(root, 'workflow', 'plans', `${base}.md`);
|
|
184
|
-
const declared = fs.existsSync(planAbs) ? readFm(planAbs, '级别') : (opts.level || '');
|
|
185
|
-
if (declared === 'L1') {
|
|
186
|
-
return {
|
|
187
|
-
ok: true,
|
|
188
|
-
entry: {
|
|
189
|
-
ok: true, kind: 'plan', rel: `workflow/plans/${base}.md`, level: 'L1',
|
|
190
|
-
status: fs.existsSync(planAbs) ? (readFm(planAbs, '状态') || 'draft') : 'draft',
|
|
191
|
-
selfEntry: true, legacy: false,
|
|
192
|
-
},
|
|
193
|
-
laneBypass: true,
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
ok: false,
|
|
199
|
-
reason: `同主题入口未确认——${entry.reason}`,
|
|
200
|
-
hint: '先走 plan.md 完成入口确认(修复类走 maintain.md,incident 草稿过目后在时间线留「用户确认」条目)',
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
// 库存量形态短路(2026-09-30 增量复核 N1):**只额外豁免「级别前置」与「spec 档」**——
|
|
204
|
-
// 库存量入口(`流程: legacy` / 日期早于确认门生效日)多为门禁前建档、常缺「级别」字段,硬拒会锁死
|
|
205
|
-
// spec 起草与确认。注意:库存量信号**本身即等于入口已确认**(judgeDoc 的 `台账行 || 存量口径`,
|
|
206
|
-
// 与检查 1 / 15 / 配对门同口径)——台账豁免发生在 judgeDoc,不在本处;本处不做二次豁免
|
|
207
|
-
// (第三轮复核 P2-1:原句「台账要求不豁免」把两件事写反,已订正)。
|
|
208
|
-
if (!entry.storageLegacy && !/^L[1-3]$/.test(entry.level)) {
|
|
209
|
-
return {
|
|
210
|
-
ok: false,
|
|
211
|
-
reason: `入口缺合法「级别」字段(现「${entry.level || '缺失'}」,无法判定前置深度)`,
|
|
212
|
-
hint: '先给入口补「级别: L1-L3」字段,再继续',
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
if (kind === 'plan' && !entry.storageLegacy && (entry.level === 'L2' || entry.level === 'L3')) {
|
|
216
|
-
const sp = specConfirmed(root, base);
|
|
217
|
-
if (!sp.ok) {
|
|
218
|
-
return { ok: false, reason: `入口级别 ${entry.level},前置 spec 未确认——${sp.reason}`, hint: '先走 design.md 完成 spec 确认' };
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return { ok: true, entry };
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// ---- 待澄清标记(2026-10-12 needs-clarification,spec-kit NEEDS CLARIFICATION 对应物)----
|
|
225
|
-
// 动机:本项目的歧义处理此前只有一种形态——**停下来问**(确认门停机)。那是「事后阻塞」:AI 停住等
|
|
226
|
-
// 人,而人在上下文里未必答得上(他刚提的需求,细节是你算出来的)。spec-kit 的做法是**起草期把
|
|
227
|
-
// 歧义显式写下来**(`[NEEDS CLARIFICATION]`),不阻塞起草但禁臆测——「我不知道」是负责,「猜一个」
|
|
228
|
-
// 是失职。本件补这个表达:**零阻塞 + 不许糊过去**。
|
|
229
|
-
// 形态:正文行 `- 待澄清:<问题>`(行首可选列表符;半角冒号兼容)。行首 `- 已澄清:<问题>` **不算**
|
|
230
|
-
// (同一行改前缀即声明解决,不删行——保留「曾经不清楚过」的痕迹,供事后对质)。
|
|
231
|
-
// ⚠️ 与检查 2(模板占位符)刻意区分:占位符 = 「忘了填」(失职),本标记 = 「这里我不知道」
|
|
232
|
-
// (负责)。两者都要求作者动作,但语义相反,故不复用同一正则——复用即把负责判成失职。
|
|
233
|
-
// 边界(诚实声明):**起草门不阻断**(这才是零阻塞的意义),仅在 draft→approved 确认门点名——
|
|
234
|
-
// 确认即「我认可这份文档」,文档里还挂着未澄清项则确认本身失去含义,故此处拒绝落账。
|
|
235
|
-
// 例外:<日期>/YYYY-MM-DD 等占位由检查 2 管,本件不重复拦。
|
|
236
|
-
const CLARIFY_RE = /^\s*[-*]\s*(待澄清|需澄清|待确认细节)\s*[::]\s*(\S.*)$/;
|
|
237
|
-
|
|
238
|
-
// openClarifications:抽出正文里未澄清的行(pure,供直测)。返回 [{ lineNo, text }]
|
|
239
|
-
// HTML 注释行不计入——模板自带说明写在注释里,不该被判成作者留下的未澄清项。
|
|
240
|
-
export function openClarifications(body) {
|
|
241
|
-
const out = [];
|
|
242
|
-
const lines = String(body || '').replace(/\r\n/g, '\n').split('\n');
|
|
243
|
-
for (let i = 0; i < lines.length; i++) {
|
|
244
|
-
const l = lines[i];
|
|
245
|
-
if (/^\s*<!--/.test(l) || /-->\s*$/.test(l)) continue; // 整行注释
|
|
246
|
-
const m = l.match(CLARIFY_RE);
|
|
247
|
-
if (m) out.push({ lineNo: i + 1, text: m[2].trim(), kind: m[1] });
|
|
248
|
-
}
|
|
249
|
-
return out;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// clarifyGateFor:确认门「待澄清项已解决」前置判(confirm-doc draft→approved 用)
|
|
253
|
-
// 返回 { ok, items?, reason?, hint? }。ok=false 时 items 供逐条点名(不只说「有未澄清项」——
|
|
254
|
-
// 说清是哪几行哪几句,作者才不用回去逐行找)。
|
|
255
|
-
export function clarifyGateFor(abs) {
|
|
256
|
-
let body = '';
|
|
257
|
-
try { body = fs.readFileSync(abs, 'utf8'); } catch { return { ok: true, skipped: 'unreadable' }; }
|
|
258
|
-
const items = openClarifications(body);
|
|
259
|
-
if (!items.length) return { ok: true, items };
|
|
260
|
-
const list = items.map((i) => `第${i.lineNo}行「${i.text}」`).join(';');
|
|
261
|
-
return {
|
|
262
|
-
ok: false,
|
|
263
|
-
items,
|
|
264
|
-
reason: `文档含 ${items.length} 处未澄清项——${list}`,
|
|
265
|
-
hint: '逐条解决后把行首「待澄清」改为「已澄清」(保留行,便于事后对质曾不清楚过),或直接删行;确认门不接受挂着未澄清项的文档',
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// confirmGateFor:确认门总判(confirm-doc 用;docRel = workflow/specs/... 或 workflow/plans/...)
|
|
270
|
-
// ⚠️ 只判**前置深度**(入口/spec 是否已确认)。待澄清项判定是**同一确认门上的另一条独立判据**,
|
|
271
|
-
// 由 clarifyGateFor 单独承担——两者不合并:合并后拒绝原因会指向「前置」,作者找错地方。
|
|
272
|
-
export function confirmGateFor(root, docRel) {
|
|
273
|
-
const base = path.basename(docRel).replace(/\.md$/, '');
|
|
274
|
-
const kind = docRel.startsWith('workflow/specs/') ? 'spec' : 'plan';
|
|
275
|
-
return draftGateFor(kind, root, base);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// ---- done 前置门族(2026-09-30 confirm-gate-approved-history)----
|
|
279
|
-
// 背景:stage-gate-machine 关单后检查 14 报「确认态缺失」×2——approved→done 期间从未提交、首次提交即
|
|
280
|
-
// done 态(先 done 后提交),git 历史无 approved 中间态;检查 14 是事后审计(发现即定局),本族把
|
|
281
|
-
// 校验收口到 confirm-doc 的「→done」跳转——「approved 态还在工作区」的最后一刻,即唯一可拦截窗口。
|
|
282
|
-
// 命中判据单源:approvedTraceHit 命令行与 check-loop 检查 14 逐字一致(-G '^状态:[[:space:]]*approved'),
|
|
283
|
-
// 本模块为唯一实现、两调用方共享(2026-09-30 复核 N3 教训:双份字面量靠注释同步必漂移)。
|
|
284
|
-
// 注(2026-09-30 复核 P2-2 登记):gitRun 的 GIT 解析 / maxBuffer / 失败语义与 check-loop.mjs 的
|
|
285
|
-
// gitOut、gitReady 与检查 14 段级两条 rev-parse 为**同口径的两份实现**(未合并——检查 14 段结构不动
|
|
286
|
-
// 属本单非目标)——任一侧调整(如加 --no-pager)须同步另一侧,防段级门与文档级判据分叉。
|
|
287
|
-
const GIT = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
288
|
-
|
|
289
|
-
function gitRun(root, args) {
|
|
290
|
-
const r = spawnSync(GIT, args, { cwd: root, encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 });
|
|
291
|
-
if (r.error || r.status !== 0) return null;
|
|
292
|
-
return r.stdout || '';
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// gitReady:git 环境可用(在仓库内且已有 HEAD)——与检查 14 段级两条 rev-parse 同口径
|
|
296
|
-
export function gitReady(root) {
|
|
297
|
-
return gitRun(root, ['rev-parse', '--git-dir']) !== null
|
|
298
|
-
&& gitRun(root, ['rev-parse', '-q', '--verify', 'HEAD']) !== null;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// approvedTraceHit:命中判定单源——git 历史是否出现过行首「状态: approved」(经提交进入历史才算,
|
|
302
|
-
// 当前工作区未提交的 approved 不算——这正是「留痕」语义)。rel = 仓库根相对路径。
|
|
303
|
-
// 返回:'' = 从未出现;<sha> = 命中;null = git 调用失败(调用方按各自容错口径处理——检查 14 不报、
|
|
304
|
-
// done 门跳过,均沿 fail-open 边界;诚实边界声明见 spec)。
|
|
305
|
-
export function approvedTraceHit(root, rel) {
|
|
306
|
-
const r = gitRun(root, ['log', '-1', '--format=%H', '-G', '^状态:[[:space:]]*approved', '--', rel]);
|
|
307
|
-
return r === null ? null : r.trim();
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// doneGateFor:confirm-doc「→done」前置门(三件套 intent/spec/plan 均适用;incidents 的 fixed/closed 不在本门)。
|
|
311
|
-
// 豁免与顺序:① 行首 `流程: legacy` ② 行含「存量确认态豁免(」声明(与检查 14 同标记,显式逃生口)
|
|
312
|
-
// ③ 非 git 环境 ④ git 调用失败 → 均跳过(不误拦)。未豁免且未命中 → 拒绝(调用方负责非零退出 +
|
|
313
|
-
// 零落账 + 零写盘 + 回退指引)。
|
|
314
|
-
export function doneGateFor(root, abs, rel) {
|
|
315
|
-
const body = readBody(abs);
|
|
316
|
-
if (body.split(/\r?\n/).some((l) => /^流程: legacy/.test(l))) return { ok: true, skipped: 'legacy' };
|
|
317
|
-
if (body.split(/\r?\n/).some((l) => l.includes('存量确认态豁免('))) return { ok: true, skipped: 'declared' };
|
|
318
|
-
if (!gitReady(root)) return { ok: true, skipped: 'no-git' };
|
|
319
|
-
const hit = approvedTraceHit(root, rel);
|
|
320
|
-
if (hit === null) return { ok: true, skipped: 'git-error' };
|
|
321
|
-
if (hit === '') {
|
|
322
|
-
return {
|
|
323
|
-
ok: false,
|
|
324
|
-
reason: 'git 历史中从未出现行首「状态: approved」——确认态未留痕(先 done 后提交 / 两跳同批提交)',
|
|
325
|
-
hint: '先把该文档的 approved 态提交(git add 该文件并 commit)后再重试关单',
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
return { ok: true, hit };
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// resolveWorkspace:从输出路径推导工作区根与主题名;output 路径不含 workflow 段 → null(仓外草稿,不校验)
|
|
332
|
-
export function resolveWorkspace(outputPath, rootOverride) {
|
|
333
|
-
const abs = path.resolve(outputPath);
|
|
334
|
-
const base = path.basename(abs).replace(/\.md$/, '');
|
|
335
|
-
if (rootOverride) return { root: path.resolve(rootOverride), base };
|
|
336
|
-
const parts = abs.split(path.sep);
|
|
337
|
-
for (let i = parts.length - 2; i >= 0; i--) {
|
|
338
|
-
if (parts[i].toLowerCase() === 'workflow') return { root: parts.slice(0, i).join(path.sep) || path.sep, base };
|
|
339
|
-
}
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export default { entryConfirmed, specConfirmed, draftGateFor, confirmGateFor, clarifyGateFor, openClarifications, doneGateFor, gitReady, approvedTraceHit, resolveWorkspace, readFm, readLedger };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// stage-gates.test.mjs — 逐阶段前置门 + 待澄清门的纯函数直测(2026-10-12 needs-clarification)
|
|
3
|
-
// 为什么单建本套件(stage-gates.mjs 此前登记 scripts-test-exempt,靠 check-loop.test 间接覆盖):
|
|
4
|
-
// 本批给该模块加了两条**此前不存在的判据族**(clarifyGateFor / openClarifications),
|
|
5
|
-
// 而这两条**没有 check-loop 侧的对应检查**——check-loop 不消费它们。间接覆盖天然盖不到
|
|
6
|
-
// 「确认门拒绝未澄清项」这条行为,纯函数直测是唯一能钉住它的位置(check 20 的豁免登记
|
|
7
|
-
// 在此更新为「同名直测 + 间接覆盖并有」)。
|
|
8
|
-
// 覆盖:CLARIFY_RE 形态矩阵(正例 5 / 负例 7)+ HTML 注释不计 + 已澄清前缀不计
|
|
9
|
-
// + clarifyGateFor 三态(无 / 有 / 不可读)+ 行号点名。
|
|
10
|
-
// 用法:node templates/_agents/scripts/stage-gates.test.mjs(npm test 随跑)
|
|
11
|
-
import fs from 'node:fs';
|
|
12
|
-
import os from 'node:os';
|
|
13
|
-
import path from 'node:path';
|
|
14
|
-
import { openClarifications, clarifyGateFor } from './stage-gates.mjs';
|
|
15
|
-
|
|
16
|
-
let pass = 0;
|
|
17
|
-
let fail = 0;
|
|
18
|
-
const check = (desc, cond, detail = '') => {
|
|
19
|
-
if (cond) { pass++; console.log(`PASS ${desc}`); }
|
|
20
|
-
else { fail++; console.log(`FAIL ${desc}${detail ? `\n${detail}` : ''}`); }
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// ---- T1 正例形态矩阵(5 个写法都应抽出,行号正确)----
|
|
24
|
-
{
|
|
25
|
-
const body = [
|
|
26
|
-
'# S', // 1
|
|
27
|
-
'', // 2
|
|
28
|
-
'- 待澄清:错误率判据?', // 3 ← 行首列表符 + 全角冒号
|
|
29
|
-
'* 需澄清: 依赖版本未定', // 4 ← 星号 + 半角冒号 + 同义前缀
|
|
30
|
-
' - 待确认细节:用户没说要不要兼容旧数据', // 5 ← 前导空格 + 第三同义前缀
|
|
31
|
-
'正文里提到「待澄清」二字不算(不是行首列表条目)', // 6 ← 负例
|
|
32
|
-
'', // 7
|
|
33
|
-
'- 待澄清了:已解决的说法不该被抽', // 8 ← 负例(词后跟了别的字符)
|
|
34
|
-
'待澄清:无列表符的行不算', // 9 ← 负例
|
|
35
|
-
'- 已澄清:这是已解决的', // 10 ← 负例(前缀已澄清)
|
|
36
|
-
].join('\n');
|
|
37
|
-
const items = openClarifications(body);
|
|
38
|
-
check('T1 三个同义前缀 + 列表符变体 + 全/半角冒号全命中(5 个写法)', items.length === 3, JSON.stringify(items));
|
|
39
|
-
check('T1 行号正确(3 / 4 / 5)',
|
|
40
|
-
items.map((i) => i.lineNo).join(',') === '3,4,5', JSON.stringify(items.map((i) => i.lineNo)));
|
|
41
|
-
check('T1 抽出的是标记后的正文(不含前缀与冒号)',
|
|
42
|
-
items[0].text === '错误率判据?' && items[1].text === '依赖版本未定' && items[2].text === '用户没说要不要兼容旧数据',
|
|
43
|
-
JSON.stringify(items.map((i) => i.text)));
|
|
44
|
-
check('T1 负例四类全不误抽(正文提及 / 前缀粘连 / 无列表符 / 已澄清)',
|
|
45
|
-
!items.some((i) => /待澄清了|无列表符|已解决/.test(i.text)), JSON.stringify(items));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ---- T2 HTML 注释行不计(模板自带说明写在注释里,不该被判成作者的未澄清项)----
|
|
49
|
-
{
|
|
50
|
-
const body = [
|
|
51
|
-
'# S',
|
|
52
|
-
'<!-- 起草时照实写一行 - 待澄清:<你卡在哪>,不要猜 -->', // 整行注释
|
|
53
|
-
'- 待澄清:真问题',
|
|
54
|
-
'<!-- - 待澄清:注释里的第二处 -->', // 整行注释
|
|
55
|
-
'行尾注释不算:- 待澄清:真的吗 <!-- 附注 -->', // 行尾注释
|
|
56
|
-
].join('\n');
|
|
57
|
-
const items = openClarifications(body);
|
|
58
|
-
check('T2 整行 HTML 注释里的标记不计(只 1 处命中)', items.length === 1 && items[0].lineNo === 3, JSON.stringify(items));
|
|
59
|
-
check('T2 行尾注释形态不计(模板说明常这么写)', !items.some((i) => /真的吗/.test(i.text)), JSON.stringify(items));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ---- T2b 已知边界(跨行 HTML 注释块)——如实钉住,不假装覆盖 ----
|
|
63
|
-
// 逐行过滤只认「整行注释」与「行尾注释」;跨行注释块 <!--\n - 待澄清:x\n--> 的中间行会被抽出。
|
|
64
|
-
// 为何不修:跨行注释在 workflow 文档里零先例(模板说明一律单行注释),为不存在的形态加状态机
|
|
65
|
-
// 是过度工程。**方向是保守的**(多抽一处 → 确认门拒一次,作者看到就改),不会漏放。
|
|
66
|
-
{
|
|
67
|
-
const items = openClarifications('<!--\n- 待澄清:跨行注释块中间行\n-->');
|
|
68
|
-
check('T2b 已知边界:跨行注释块中间行会被抽出(保守方向——多拒不漏放)',
|
|
69
|
-
items.length === 1 && items[0].lineNo === 2, JSON.stringify(items));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// ---- T3 CRLF 与空输入 ----
|
|
73
|
-
{
|
|
74
|
-
check('T3 CRLF 归一后形态不变(行号按 \\n 计)',
|
|
75
|
-
openClarifications('- a\r\n\r\n- 待澄清:x\r\n').length === 1);
|
|
76
|
-
check('T3 空 / undefined 输入 → 空数组(不抛)',
|
|
77
|
-
openClarifications('').length === 0 && openClarifications(undefined).length === 0 && openClarifications(null).length === 0);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ---- T4 clarifyGateFor 三态 ----
|
|
81
|
-
{
|
|
82
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'stage-gates-test-'));
|
|
83
|
-
const p = path.join(tmp, 'doc.md');
|
|
84
|
-
fs.writeFileSync(p, '---\n状态: draft\n---\n# S\n- 待澄清:甲\n- 待澄清:乙\n');
|
|
85
|
-
const g = clarifyGateFor(p);
|
|
86
|
-
check('T4 挂未澄清项 → ok=false 且 items 含两处', !g.ok && g.items.length === 2, JSON.stringify(g));
|
|
87
|
-
check('T4 reason 逐条点名行号与内容(作者不必回去逐行找)',
|
|
88
|
-
/第5行「甲」/.test(g.reason) && /第6行「乙」/.test(g.reason), g.reason);
|
|
89
|
-
check('T4 reason 给出条数 + hint 给两条解决路径(改前缀 / 删行)',
|
|
90
|
-
/2 处未澄清项/.test(g.reason) && /已澄清/.test(g.hint) && /删行/.test(g.hint), JSON.stringify(g));
|
|
91
|
-
check('T4 ok=false 时必然带 reason 与 hint(出账完整,勿半截)', !!g.reason && !!g.hint);
|
|
92
|
-
|
|
93
|
-
fs.writeFileSync(p, '---\n状态: draft\n---\n# S\n- 已澄清:都解决了\n');
|
|
94
|
-
const g2 = clarifyGateFor(p);
|
|
95
|
-
check('T4 全部已澄清 → ok=true', g2.ok && g2.items.length === 0, JSON.stringify(g2));
|
|
96
|
-
|
|
97
|
-
const missing = clarifyGateFor(path.join(tmp, 'nope.md'));
|
|
98
|
-
check('T4 文件不可读 → ok=true + skipped=unreadable(fail-open,不因读不到而拒确认)',
|
|
99
|
-
missing.ok && missing.skipped === 'unreadable', JSON.stringify(missing));
|
|
100
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
104
|
-
if (fail) { console.log('\n用法:node templates/_agents/scripts/stage-gates.test.mjs'); process.exit(1); }
|
|
105
|
-
process.exit(0);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// trust-mode: AI 自治信任等级管理(2026-09-30 ai-autonomy-trust;同日 hybrid-governance-risk-lanes 加名称双轨)
|
|
3
|
-
// 管理 .agents/trust-mode.json,授权 AI 对 L1 文档进行自治放行(--auto)。
|
|
4
|
-
// 等级语义(名称 ↔ 数值双轨:confirm-doc.mjs 读数值 enabled/level,人机接口名称与数值皆收):
|
|
5
|
-
// Strict (level 0, enabled=false): AI 自治关闭(默认)——confirm-doc --auto 一律拒绝
|
|
6
|
-
// Standard (level 1): AI 可自批 L1 draft -> approved
|
|
7
|
-
// Trusted (level 2): AI 可自批 L1 draft -> approved 及 approved -> done(全闭环)
|
|
8
|
-
// 安全默认值:未开启(enabled: false)时,confirm-doc.mjs --auto 一律拒绝。
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
import path from 'node:path';
|
|
11
|
-
|
|
12
|
-
const CONFIG_PATH = path.join(process.cwd(), '.agents', 'trust-mode.json');
|
|
13
|
-
const NAME_BY_LEVEL = { 0: 'Strict', 1: 'Standard', 2: 'Trusted' };
|
|
14
|
-
const LEVEL_BY_NAME = { Strict: 0, Standard: 1, Trusted: 2 };
|
|
15
|
-
|
|
16
|
-
function readConfig() {
|
|
17
|
-
try {
|
|
18
|
-
return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8'));
|
|
19
|
-
} catch {
|
|
20
|
-
return { enabled: false, level: 0, name: 'Strict', enabledAt: null };
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function writeConfig(config) {
|
|
25
|
-
fs.mkdirSync(path.dirname(CONFIG_PATH), { recursive: true });
|
|
26
|
-
fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function main() {
|
|
30
|
-
const args = process.argv.slice(2);
|
|
31
|
-
const config = readConfig();
|
|
32
|
-
|
|
33
|
-
if (args.includes('--enable')) {
|
|
34
|
-
const levelIdx = args.indexOf('--level');
|
|
35
|
-
const raw = levelIdx !== -1 ? String(args[levelIdx + 1] ?? '') : '1';
|
|
36
|
-
const level = LEVEL_BY_NAME[raw] ?? (['0', '1', '2'].includes(raw) ? Number(raw) : NaN);
|
|
37
|
-
if (![0, 1, 2].includes(level)) {
|
|
38
|
-
console.error('❌ --level 必须为 Strict|Standard|Trusted(或 0|1|2)');
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
if (level === 0) {
|
|
42
|
-
writeConfig({ enabled: false, level: 0, name: 'Strict', enabledAt: null });
|
|
43
|
-
console.log('🔒 AI 自治模式已关闭(Strict)');
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
writeConfig({ enabled: true, level, name: NAME_BY_LEVEL[level], enabledAt: new Date().toISOString() });
|
|
47
|
-
console.log(`✅ AI 自治模式已开启 (${NAME_BY_LEVEL[level]} / Level ${level})`);
|
|
48
|
-
console.log(level === 1 ? ' 授权范围:L1 文档 draft -> approved' : ' 授权范围:L1 文档全闭环 (approved + done)');
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (args.includes('--disable')) {
|
|
53
|
-
writeConfig({ enabled: false, level: 0, name: 'Strict', enabledAt: null });
|
|
54
|
-
console.log('🔒 AI 自治模式已关闭 (Strict)');
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (args.includes('--status')) {
|
|
59
|
-
console.log(JSON.stringify({ name: NAME_BY_LEVEL[config.level] || 'Strict', ...config }, null, 2));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
console.log('用法: node .agents/scripts/trust-mode.mjs [--enable --level <Strict|Standard|Trusted|1|2> | --disable | --status]');
|
|
64
|
-
process.exit(config.enabled ? 0 : 1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
main();
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// trust-mode.test.mjs — AI 自治信任等级 fixture 套件(2026-10-01 gate-script-test-coverage)
|
|
3
|
-
// 覆盖:三级语义(Strict/Standard/Trusted 名称↔数值双轨)、缺文件 fail-closed 回落 Strict、
|
|
4
|
-
// --enable/--disable/--status CLI 行为、非法 --level 拒绝、与 confirm-doc --auto 的端到端
|
|
5
|
-
// (Strict 缺文件拒绝不落账 / Trusted 放行 source=ai-auto-trust-L2)。
|
|
6
|
-
import fs from 'node:fs';
|
|
7
|
-
import os from 'node:os';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
import { spawnSync } from 'node:child_process';
|
|
10
|
-
import { fileURLToPath } from 'node:url';
|
|
11
|
-
|
|
12
|
-
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const TRUST = path.join(SCRIPT_DIR, 'trust-mode.mjs');
|
|
14
|
-
const CONFIRM = path.join(SCRIPT_DIR, 'confirm-doc.mjs');
|
|
15
|
-
|
|
16
|
-
let pass = 0;
|
|
17
|
-
let fail = 0;
|
|
18
|
-
const check = (desc, cond, detail = '') => {
|
|
19
|
-
if (cond) { pass++; console.log(`PASS ${desc}`); }
|
|
20
|
-
else { fail++; console.log(`FAIL ${desc}${detail ? '\n ' + detail : ''}`); }
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const mkfix = () => {
|
|
24
|
-
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'trust-test-'));
|
|
25
|
-
for (const s of ['intents', 'plans', 'specs', 'incidents']) {
|
|
26
|
-
fs.mkdirSync(path.join(d, 'workflow', s), { recursive: true });
|
|
27
|
-
}
|
|
28
|
-
fs.mkdirSync(path.join(d, '.agents'), { recursive: true });
|
|
29
|
-
fs.mkdirSync(path.join(d, '.zcode'), { recursive: true });
|
|
30
|
-
fs.writeFileSync(path.join(d, '.agents', 'workflow-enums.txt'),
|
|
31
|
-
['doc.status.all=draft approved done superseded cancelled', 'doc.status.confirmed=approved done superseded cancelled',
|
|
32
|
-
'doc.status.active=draft approved', 'doc.status.terminal=done superseded cancelled', 'doc.status.abandoned=superseded cancelled',
|
|
33
|
-
'incident.status.all=open fixed closed', 'incident.status.active=open', 'level.all=L1 L2 L3'].join('\n') + '\n');
|
|
34
|
-
fs.writeFileSync(path.join(d, '.agents', 'workflow-modules.txt'), '# modules\npipeline\nui\n');
|
|
35
|
-
return d;
|
|
36
|
-
};
|
|
37
|
-
const runTrust = (root, args) => {
|
|
38
|
-
const r = spawnSync(process.execPath, [TRUST, ...args], { cwd: root, encoding: 'utf8' });
|
|
39
|
-
return { code: r.status, out: `${r.stdout || ''}${r.stderr || ''}` };
|
|
40
|
-
};
|
|
41
|
-
const cfg = (root) => {
|
|
42
|
-
const p = path.join(root, '.agents', 'trust-mode.json');
|
|
43
|
-
return fs.existsSync(p) ? JSON.parse(fs.readFileSync(p, 'utf8')) : null;
|
|
44
|
-
};
|
|
45
|
-
const ledgerLines = (root) => {
|
|
46
|
-
const p = path.join(root, '.agents', 'confirmations.jsonl');
|
|
47
|
-
return fs.existsSync(p) ? fs.readFileSync(p, 'utf8').split(/\n/).filter(Boolean) : [];
|
|
48
|
-
};
|
|
49
|
-
const DRAFT = (level = 'L1') => `---\n状态: draft\n级别: ${level}\nrisk_level: ${level}\n日期: 2026-10-01\n模块: pipeline\n---\n# INTENT — demo\n`;
|
|
50
|
-
|
|
51
|
-
// T1:缺文件 → fail-closed Strict 默认
|
|
52
|
-
{
|
|
53
|
-
const d = mkfix();
|
|
54
|
-
const r = runTrust(d, ['--status']);
|
|
55
|
-
check('T1 缺文件 --status 输出 Strict/level0/enabled false', r.code === 0 && r.out.includes('"name": "Strict"') && r.out.includes('"level": 0') && r.out.includes('"enabled": false'), r.out);
|
|
56
|
-
}
|
|
57
|
-
// T2:三级语义映射正确
|
|
58
|
-
{
|
|
59
|
-
check('T2 名称↔数值双轨(NAME_BY_LEVEL 内容)',
|
|
60
|
-
fs.readFileSync(TRUST, 'utf8').includes("NAME_BY_LEVEL = { 0: 'Strict', 1: 'Standard', 2: 'Trusted' }"), '');
|
|
61
|
-
}
|
|
62
|
-
// T3:--enable --level Trusted → 落盘 enabled true/level 2/name Trusted
|
|
63
|
-
{
|
|
64
|
-
const d = mkfix();
|
|
65
|
-
const r = runTrust(d, ['--enable', '--level', 'Trusted']);
|
|
66
|
-
const c = cfg(d);
|
|
67
|
-
check('T3 --level Trusted 落盘正确', r.code === 0 && c && c.enabled === true && c.level === 2 && c.name === 'Trusted', JSON.stringify(c));
|
|
68
|
-
}
|
|
69
|
-
// T4:--enable --level 0(Strict 数字)→ 关闭
|
|
70
|
-
{
|
|
71
|
-
const d = mkfix();
|
|
72
|
-
const r = runTrust(d, ['--enable', '--level', '0']);
|
|
73
|
-
const c = cfg(d);
|
|
74
|
-
check('T4 --level 0 → 关闭 Strict', r.code === 0 && c && c.enabled === false && c.level === 0 && c.name === 'Strict', JSON.stringify(c));
|
|
75
|
-
}
|
|
76
|
-
// T5:非法 --level → 拒绝 exit 1
|
|
77
|
-
{
|
|
78
|
-
const d = mkfix();
|
|
79
|
-
const r = runTrust(d, ['--enable', '--level', 'Bogus']);
|
|
80
|
-
check('T5 非法 --level 拒绝 exit 1', r.code === 1 && r.out.includes('必须为'), r.out);
|
|
81
|
-
}
|
|
82
|
-
// T6:--disable → 关闭 Strict
|
|
83
|
-
{
|
|
84
|
-
const d = mkfix();
|
|
85
|
-
runTrust(d, ['--enable', '--level', 'Trusted']);
|
|
86
|
-
const r = runTrust(d, ['--disable']);
|
|
87
|
-
const c = cfg(d);
|
|
88
|
-
check('T6 --disable 复位 Strict', r.code === 0 && c && c.enabled === false && c.level === 0 && c.name === 'Strict', JSON.stringify(c));
|
|
89
|
-
}
|
|
90
|
-
// T7 e2e:Strict(缺文件)下 confirm-doc --auto 拒绝不落账
|
|
91
|
-
{
|
|
92
|
-
const d = mkfix();
|
|
93
|
-
fs.writeFileSync(path.join(d, 'workflow', 'intents', '2026-10-01-demo.md'), DRAFT('L1'));
|
|
94
|
-
const r = spawnSync(process.execPath, [CONFIRM, 'workflow/intents/2026-10-01-demo.md', '--root', d, '--auto'], { cwd: d, encoding: 'utf8' });
|
|
95
|
-
check('T7 Strict 下 --auto 拒绝且零台账', r.status !== 0 && ledgerLines(d).length === 0, `${r.stdout}${r.stderr}\n${ledgerLines(d).join('|')}`);
|
|
96
|
-
}
|
|
97
|
-
// T8 e2e:Trusted 下 confirm-doc --auto 放行 L1,台账 source=ai-auto-trust-L2
|
|
98
|
-
{
|
|
99
|
-
const d = mkfix();
|
|
100
|
-
fs.writeFileSync(path.join(d, 'workflow', 'intents', '2026-10-01-demo.md'), DRAFT('L1'));
|
|
101
|
-
runTrust(d, ['--enable', '--level', 'Trusted']);
|
|
102
|
-
const r = spawnSync(process.execPath, [CONFIRM, 'workflow/intents/2026-10-01-demo.md', '--root', d, '--auto'], { cwd: d, encoding: 'utf8' });
|
|
103
|
-
const lines = ledgerLines(d);
|
|
104
|
-
check('T8 Trusted 下 --auto 放行并记 ai-auto-trust-L2',
|
|
105
|
-
r.status === 0 && lines.length === 1 && lines[0].includes('ai-auto-trust-L2') && lines[0].includes('"stage":"approved"'),
|
|
106
|
-
`${r.stdout}${r.stderr}\n${lines.join('|')}`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
110
|
-
process.exit(fail ? 1 : 0);
|