agentic-flow-kit 1.8.7 → 2.1.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/LICENSE +2 -2
- package/README.md +172 -138
- package/bin/flow-kit.mjs +7 -2
- package/locales/en/installer.json +110 -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 +69 -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 +110 -0
- package/package.json +23 -36
- package/schemas/install-manifest.schema.json +26 -0
- package/schemas/project-profile.schema.json +28 -0
- package/src/cli/args.mjs +43 -0
- package/src/cli/main.mjs +79 -0
- package/src/commands/add-host.mjs +29 -0
- package/src/commands/doctor.mjs +126 -0
- package/src/commands/install.mjs +296 -0
- package/src/commands/upgrade.mjs +30 -0
- package/src/git/config.mjs +61 -0
- package/src/hosts/registry.mjs +170 -0
- package/src/i18n.mjs +35 -0
- package/src/install/apply.mjs +138 -0
- package/src/install/frontmatter.mjs +84 -0
- package/src/install/manifest.mjs +40 -0
- package/src/install/plan.mjs +241 -0
- package/src/models/known.mjs +13 -0
- package/src/models/probe.mjs +163 -0
- package/src/models/resolve.mjs +312 -0
- package/src/render/tokens.mjs +105 -0
- package/src/tui/ansi.mjs +55 -0
- package/src/tui/flows.mjs +306 -0
- package/src/tui/prompts.mjs +139 -0
- package/src/tui/screen.mjs +217 -0
- package/src/tui/widgets.mjs +111 -0
- package/src/tui/wizard.mjs +68 -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 +60 -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 +257 -0
- package/templates/engine/.agents/config/agent-eval.json +17 -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 +63 -0
- package/templates/engine/.agents/config/memory-tiers.json +13 -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/pipeline.json +36 -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/steering.json +28 -0
- package/templates/engine/.agents/config/workflow-enums.txt +25 -0
- package/templates/engine/.agents/evals/README.md +49 -0
- package/templates/engine/.agents/evals/tasks.tsv +6 -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 +247 -0
- package/templates/engine/.agents/notes/gate-diet.md +75 -0
- package/templates/engine/.agents/notes/injected-memory.md +14 -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/notes/steering-tiers.md +28 -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/agent-eval.mjs +268 -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-pipeline-state.mjs +85 -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/claims.mjs +166 -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 +358 -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/fix-task.mjs +77 -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/memory-tier.mjs +196 -0
- package/templates/engine/.agents/scripts/memory-wiki.mjs +296 -0
- package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
- package/templates/engine/.agents/scripts/outcome-metrics.mjs +195 -0
- package/templates/engine/.agents/scripts/path-lease.mjs +177 -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/session-log.mjs +157 -0
- package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
- package/templates/engine/.agents/scripts/steering.mjs +75 -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 +858 -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 +54 -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 +82 -0
- package/templates/engine/.agents/skills/eval/SKILL.md +58 -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/model-upgrade/SKILL.md +41 -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 +76 -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 +71 -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 +56 -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 +23 -0
- package/templates/git/.githooks/commit-msg +72 -0
- package/templates/git/.githooks/package.json +3 -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/.github/workflows/ci.yml +32 -0
- package/templates/git/.gitignore.engine +11 -0
- package/templates/git/azure-pipelines.yml +46 -0
- package/templates/host-meta/SKILLS.md +3 -0
- package/templates/host-meta/claude/skill-pointer.md +6 -0
- package/templates/host-meta/cline/skill-index.md +6 -0
- package/templates/host-meta/codebuddy/skill-pointer.md +6 -0
- package/templates/host-meta/commandcode/skill-index.md +5 -0
- package/templates/host-meta/opencode/skill-pointer.md +6 -0
- package/templates/host-meta/qoder/skill-index.md +5 -0
- package/templates/host-meta/qwen/skill-index.md +5 -0
- package/templates/host-meta/trae/skill-index.md +6 -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.hardened.json +94 -0
- package/templates/hosts/claude/settings.json +55 -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 +57 -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 +61 -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 +57 -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/go/AGENTS.md +52 -0
- package/templates/profiles/java/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/profiles/rust/AGENTS.md +52 -0
- package/templates/profiles/typescript/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 +29 -0
- package/templates/scaffold/workflow/README.md +69 -0
- package/templates/scaffold/workflow/archive/README.md +3 -0
- package/templates/scaffold/workflow/artifact-sources.md +25 -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/non-engineer-intent.md +51 -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/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
package/src/sync.test.mjs
DELETED
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
// sync.test.mjs — flow-kit sync 三态升级 + add-host / add-gate 行为验证。
|
|
2
|
-
// 方法:迷你 fixture 包根(小模板树 + 假宿主 zcode + 假门禁 fakeg)+ 手工模拟 v1 安装态(kit.json 台账 + 盘面),
|
|
3
|
-
// 子进程 driver 调真实 sync/add-host/add-gact(隔离 process.exit 与 doctor 尾部退出),断言盘面 + 台账 + stdout 标记。
|
|
4
|
-
// 场景 14:台账外文件收养(2026-09-26 managed-ledger-adopt)——内容==新版才登记,本地真改动仍跳过。
|
|
5
|
-
import fs from 'node:fs';
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import os from 'node:os';
|
|
8
|
-
import { spawnSync } from 'node:child_process';
|
|
9
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
10
|
-
import { sha256 } from './render.mjs';
|
|
11
|
-
|
|
12
|
-
const SRC_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
|
|
13
|
-
|
|
14
|
-
let pass = 0, failCount = 0;
|
|
15
|
-
function check(name, cond, detail = '') {
|
|
16
|
-
if (cond) { pass++; console.log(`PASS ${name}`); }
|
|
17
|
-
else { failCount++; console.log(`FAIL ${name}${detail ? `——${detail}` : ''}`); }
|
|
18
|
-
}
|
|
19
|
-
const W = (p, content) => { fs.mkdirSync(path.dirname(p), { recursive: true }); fs.writeFileSync(p, content); };
|
|
20
|
-
const R = (p) => fs.readFileSync(p, 'utf8');
|
|
21
|
-
// 可选读:装户端在无 localOnly 宿主时不再创建 .gitignore,断言「不追加」须容忍文件不存在
|
|
22
|
-
const ROpt = (p) => (fs.existsSync(p) ? fs.readFileSync(p, 'utf8') : '');
|
|
23
|
-
|
|
24
|
-
// ---- fixture 包根(v2 形态:chg/host 变更、new 新增、gone 已删)----
|
|
25
|
-
function mkFixture() {
|
|
26
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-fixture-'));
|
|
27
|
-
W(path.join(root, 'package.json'), JSON.stringify({ name: 'fixture', version: '9.9.9', type: 'module' }));
|
|
28
|
-
W(path.join(root, 'templates/_agents/scripts/keep.txt'), 'keep v2\n');
|
|
29
|
-
W(path.join(root, 'templates/_agents/scripts/chg.txt'), 'chg v2 port {{BOARD_PORT}}\n');
|
|
30
|
-
W(path.join(root, 'templates/_agents/scripts/loc.txt'), 'loc v2\n');
|
|
31
|
-
W(path.join(root, 'templates/_agents/scripts/var.txt'), 'same {{BUILD_CMD}}\n');
|
|
32
|
-
W(path.join(root, 'templates/_agents/commands/new.txt'), 'new in v2\n');
|
|
33
|
-
W(path.join(root, 'templates/AGENTS.md'), 'owned skeleton v2\n');
|
|
34
|
-
W(path.join(root, 'modules/hosts/zcode/h.txt'), 'host v2 {{BOARD_PORT}}\n');
|
|
35
|
-
W(path.join(root, 'modules/gates/fakeg/gate.sh'), 'echo gate\n');
|
|
36
|
-
W(path.join(root, 'modules/gates/fakeg/README.md'), 'docs only\n');
|
|
37
|
-
W(path.join(root, 'modules/gates/fakeg/local-pre-commit.line'), 'sh .agents/hooks/gate.sh\n');
|
|
38
|
-
return root;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ---- v1 安装态(managed 台账与盘面对应 v1 渲染产物)----
|
|
42
|
-
function mkTarget(_fixtureRoot) {
|
|
43
|
-
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-target-'));
|
|
44
|
-
const files = {
|
|
45
|
-
'.agents/scripts/keep.txt': 'keep v2\n',
|
|
46
|
-
'.agents/scripts/chg.txt': 'chg v1 port 777\n',
|
|
47
|
-
'.agents/scripts/loc.txt': 'loc v1\n',
|
|
48
|
-
'.agents/scripts/var.txt': 'same <填写>\n',
|
|
49
|
-
'.agents/scripts/gone.txt': 'gone v1\n',
|
|
50
|
-
'.zcode/h.txt': 'host v1 777\n',
|
|
51
|
-
'AGENTS.md': 'owned skeleton v2\n',
|
|
52
|
-
};
|
|
53
|
-
for (const [rel, c] of Object.entries(files)) W(path.join(t, rel), c);
|
|
54
|
-
const managed = Object.entries(files)
|
|
55
|
-
.filter(([rel]) => rel !== 'AGENTS.md')
|
|
56
|
-
.map(([rel, c]) => ({ rel, sha256: sha256(Buffer.from(c, 'utf8')) }));
|
|
57
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify({
|
|
58
|
-
kit: 'agentic-flow-kit', version: '1.0.0', createdAt: '2026-09-23T00:00:00Z',
|
|
59
|
-
options: { hosts: ['zcode'], stack: 'none', boardPort: '777' },
|
|
60
|
-
managed, owned: [{ rel: 'AGENTS.md', sha256: sha256(Buffer.from('owned skeleton v2\n', 'utf8')) }],
|
|
61
|
-
}, null, 2)}\n`);
|
|
62
|
-
return t;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ---- 子进程 driver:调真实实现,pkgRoot 指向 fixture ----
|
|
66
|
-
function runCmd(cmd, fixtureRoot, target, extra = []) {
|
|
67
|
-
const driver = path.join(fixtureRoot, 'driver.mjs');
|
|
68
|
-
W(driver, `import { sync } from ${JSON.stringify(pathToFileURL(path.join(SRC_ROOT, 'sync.mjs')).href)};
|
|
69
|
-
import { addHost } from ${JSON.stringify(pathToFileURL(path.join(SRC_ROOT, 'add-host.mjs')).href)};
|
|
70
|
-
import { addGate } from ${JSON.stringify(pathToFileURL(path.join(SRC_ROOT, 'add-gate.mjs')).href)};
|
|
71
|
-
const root = ${JSON.stringify(fixtureRoot)};
|
|
72
|
-
const [cmd, ...rest] = process.argv.slice(2);
|
|
73
|
-
if (cmd === 'sync') sync(rest, root);
|
|
74
|
-
else if (cmd === 'add-host') addHost(rest, root);
|
|
75
|
-
else if (cmd === 'add-gate') addGate(rest, root);
|
|
76
|
-
`);
|
|
77
|
-
return spawnSync(process.execPath, [driver, cmd, ...extra, '--dir', target], { encoding: 'utf8' });
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ============ 场景 1:sync 默认(无 --force)三态分派 ============
|
|
81
|
-
{
|
|
82
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
83
|
-
W(path.join(t, '.agents/scripts/loc.txt'), 'loc USER\n'); // 用户本地改动
|
|
84
|
-
const r = runCmd('sync', fx, t);
|
|
85
|
-
const out = r.stdout + r.stderr;
|
|
86
|
-
// fixture 非完整安装:doctor 尾部按设计 FAIL 退出(status 1),此处只断言 sync 主流程走完且有分派报告
|
|
87
|
-
check('S1 sync 主流程走完(三态分派报告齐)', out.includes('覆盖更新') && out.includes('新增安装') && out.includes('doctor'), `status=${r.status} out=${out.slice(0, 200)}`);
|
|
88
|
-
check('S1 未改动+模板变更 → 覆盖(chg.txt → v2 且渲染端口)', R(path.join(t, '.agents/scripts/chg.txt')) === 'chg v2 port 777\n');
|
|
89
|
-
check('S1 宿主层同样覆盖(.zcode/h.txt → v2)', R(path.join(t, '.zcode/h.txt')) === 'host v2 777\n');
|
|
90
|
-
check('S1 本地改动 → 跳过(loc.txt 保持用户版)', R(path.join(t, '.agents/scripts/loc.txt')) === 'loc USER\n');
|
|
91
|
-
check('S1 跳过有报告标记', out.includes('本地已改,跳过') && out.includes('loc.txt'), out);
|
|
92
|
-
check('S1 无变化文件不动(keep/var)', R(path.join(t, '.agents/scripts/keep.txt')) === 'keep v2\n' && R(path.join(t, '.agents/scripts/var.txt')) === 'same <填写>\n');
|
|
93
|
-
check('S1 新增 managed 文件被安装', R(path.join(t, '.agents/commands/new.txt')) === 'new in v2\n');
|
|
94
|
-
check('S1 包内已删:文件留盘', fs.existsSync(path.join(t, '.agents/scripts/gone.txt')));
|
|
95
|
-
check('S1 包内已删有报告标记', out.includes('包内已移除'));
|
|
96
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
97
|
-
const rels = kit.managed.map((f) => f.rel);
|
|
98
|
-
check('S1 台账:版本对齐包版本', kit.version === '9.9.9');
|
|
99
|
-
check('S1 台账:gone 出册、new 入册', !rels.includes('.agents/scripts/gone.txt') && rels.includes('.agents/commands/new.txt'));
|
|
100
|
-
check('S1 台账:跳过文件保持包侧基线 sha(持续报告,不随盘面基线化)', kit.managed.find((f) => f.rel === '.agents/scripts/loc.txt').sha256 === sha256(Buffer.from('loc v1\n')));
|
|
101
|
-
check('S1 台账:覆盖文件 sha 为新版', kit.managed.find((f) => f.rel === '.agents/scripts/chg.txt').sha256 === sha256(Buffer.from('chg v2 port 777\n')));
|
|
102
|
-
check('S1 owned 不触碰(AGENTS.md 原样)', R(path.join(t, 'AGENTS.md')) === 'owned skeleton v2\n');
|
|
103
|
-
check('S1 已装 owned 不误报新增', !out.includes('新增 owned 起步文档'), out);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ============ 场景 2:sync --force 覆盖本地改动 ============
|
|
107
|
-
{
|
|
108
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
109
|
-
W(path.join(t, '.agents/scripts/loc.txt'), 'loc USER\n');
|
|
110
|
-
const r = runCmd('sync', fx, t, ['--force']);
|
|
111
|
-
check('S2 --force 覆盖本地改动(loc.txt → v2)', R(path.join(t, '.agents/scripts/loc.txt')) === 'loc v2\n', r.stdout + r.stderr);
|
|
112
|
-
check('S2 --force 有覆盖标记', (r.stdout + r.stderr).includes('--force 覆盖本地改动'));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// ============ 场景 3:managed 缺失 → 恢复 ============
|
|
116
|
-
{
|
|
117
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
118
|
-
fs.rmSync(path.join(t, '.agents/scripts/keep.txt'));
|
|
119
|
-
const r = runCmd('sync', fx, t);
|
|
120
|
-
check('S3 缺失 managed 被恢复', fs.existsSync(path.join(t, '.agents/scripts/keep.txt')) && R(path.join(t, '.agents/scripts/keep.txt')) === 'keep v2\n', r.stdout + r.stderr);
|
|
121
|
-
check('S3 恢复有报告标记', (r.stdout + r.stderr).includes('恢复缺失'));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// ============ 场景 4:本地改动恰好等于新版 → 视为无变化 ============
|
|
125
|
-
{
|
|
126
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
127
|
-
W(path.join(t, '.agents/scripts/chg.txt'), 'chg v2 port 777\n'); // == 新版渲染,但台账还是 v1 sha
|
|
128
|
-
const r = runCmd('sync', fx, t);
|
|
129
|
-
const out = r.stdout + r.stderr;
|
|
130
|
-
check('S4 恰好等于新版不报跳过', !out.includes('本地已改,跳过'), out);
|
|
131
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
132
|
-
check('S4 台账 sha 更新为新版', kit.managed.find((f) => f.rel === '.agents/scripts/chg.txt').sha256 === sha256(Buffer.from('chg v2 port 777\n')));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// ============ 场景 5:无 kit.json → 明确报错引导 init ============
|
|
136
|
-
{
|
|
137
|
-
const fx = mkFixture();
|
|
138
|
-
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-empty-'));
|
|
139
|
-
const r = runCmd('sync', fx, t);
|
|
140
|
-
check('S5 无台账退出码 1', r.status === 1);
|
|
141
|
-
check('S5 报错引导 init', (r.stderr || '').includes('flow-kit init'), r.stderr);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// ============ 场景 6:全新 v2 包(台账空基线)→ 全量安装 + 未装 owned 起步文档报告 ============
|
|
145
|
-
{
|
|
146
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
147
|
-
fs.rmSync(path.join(t, 'AGENTS.md'), { force: true }); // 未装 owned 起步文档
|
|
148
|
-
const r = runCmd('sync', fx, t);
|
|
149
|
-
const out = r.stdout + r.stderr;
|
|
150
|
-
check('S6 未装 owned 起步文档有报告且未自动安装', out.includes('新增 owned 起步文档') && !fs.existsSync(path.join(t, 'AGENTS.md')), out);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// ============ 场景 7:add-host 后补宿主 ============
|
|
154
|
-
{
|
|
155
|
-
const fx = mkFixture();
|
|
156
|
-
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-host-'));
|
|
157
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify({
|
|
158
|
-
kit: 'agentic-flow-kit', version: '1.0.0',
|
|
159
|
-
options: { hosts: [], stack: 'none', boardPort: '777' }, managed: [], owned: [],
|
|
160
|
-
}, null, 2)}\n`);
|
|
161
|
-
const r = runCmd('add-host', fx, t, ['zcode']);
|
|
162
|
-
const out = r.stdout + r.stderr;
|
|
163
|
-
check('S7 宿主文件就位(.zcode/h.txt 渲染)', R(path.join(t, '.zcode/h.txt')) === 'host v2 777\n', out);
|
|
164
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
165
|
-
check('S7 managed 台账补记(项目根相对路径)', kit.managed.some((f) => f.rel === '.zcode/h.txt'), JSON.stringify(kit.managed));
|
|
166
|
-
check('S7 options.hosts 补记', Array.isArray(kit.options.hosts) && kit.options.hosts.includes('zcode'));
|
|
167
|
-
check('S7 宿主目录不再进 .gitignore(localOnly 已撤销,zcode 与其余宿主同策)', !ROpt(path.join(t, '.gitignore')).includes('.zcode/'), ROpt(path.join(t, '.gitignore')));
|
|
168
|
-
const r2 = runCmd('add-host', fx, t, ['zcode']);
|
|
169
|
-
check('S7 重复装未 --force → 报错退出', r2.status === 1 && (r2.stderr || '').includes('--force'), r2.stderr);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// ============ 场景 8:add-gate 装门禁 + 幂等接线 ============
|
|
173
|
-
{
|
|
174
|
-
const fx = mkFixture();
|
|
175
|
-
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-gate-'));
|
|
176
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify({
|
|
177
|
-
kit: 'agentic-flow-kit', version: '1.0.0',
|
|
178
|
-
options: { hosts: [], stack: 'none', boardPort: '777' }, managed: [], owned: [],
|
|
179
|
-
}, null, 2)}\n`);
|
|
180
|
-
const r = runCmd('add-gate', fx, t, ['fakeg']);
|
|
181
|
-
const out = r.stdout + r.stderr;
|
|
182
|
-
check('S8 门禁文件落 .agents/hooks/', R(path.join(t, '.agents/hooks/gate.sh')) === 'echo gate\n', out);
|
|
183
|
-
check('S8 包内 README 不拷', !fs.existsSync(path.join(t, '.agents/hooks/README.md')));
|
|
184
|
-
check('S8 接线元数据不拷', !fs.existsSync(path.join(t, '.agents/hooks/local-pre-commit.line')));
|
|
185
|
-
check('S8 local-pre-commit 接线(缺失则建 set -e 头)', R(path.join(t, '.agents/hooks/local-pre-commit')) === '#!/bin/sh\nset -e\nsh .agents/hooks/gate.sh\n', out);
|
|
186
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
187
|
-
check('S8 owned 台账补记(归项目所有)', kit.owned.some((f) => f.rel === '.agents/hooks/gate.sh'));
|
|
188
|
-
check('S8 接线后 local-pre-commit 进 owned 且哈希=盘面(Shipyard 回流根因,2026-09-24)', (() => {
|
|
189
|
-
const e = kit.owned.find((f) => f.rel === '.agents/hooks/local-pre-commit');
|
|
190
|
-
return e && e.sha256 === sha256(Buffer.from(R(path.join(t, '.agents/hooks/local-pre-commit')), 'utf8'));
|
|
191
|
-
})(), JSON.stringify(kit.owned));
|
|
192
|
-
runCmd('add-gate', fx, t, ['fakeg']); // 再跑一遍
|
|
193
|
-
check('S8 幂等:接线行不重复', R(path.join(t, '.agents/hooks/local-pre-commit')) === '#!/bin/sh\nset -e\nsh .agents/hooks/gate.sh\n');
|
|
194
|
-
const r3 = runCmd('add-gate', fx, t, ['nope']);
|
|
195
|
-
check('S8 未知门禁报错并列出可选', r3.status === 1 && (r3.stderr || '').includes('fakeg'), r3.stderr);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// ============ 场景 9:旧装态 local-pre-commit(尾部 exit 0)→ 归一化剥掉再接线 ============
|
|
199
|
-
{
|
|
200
|
-
const fx = mkFixture();
|
|
201
|
-
const t = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-gate2-'));
|
|
202
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify({
|
|
203
|
-
kit: 'agentic-flow-kit', version: '1.0.0',
|
|
204
|
-
options: { hosts: [], stack: 'none', boardPort: '777' }, managed: [], owned: [],
|
|
205
|
-
}, null, 2)}\n`);
|
|
206
|
-
W(path.join(t, '.agents/hooks/local-pre-commit'), '#!/bin/sh\n# 旧装态注释\nexit 0\n');
|
|
207
|
-
const r = runCmd('add-gate', fx, t, ['fakeg']);
|
|
208
|
-
const out = r.stdout + r.stderr;
|
|
209
|
-
check('S9 旧装态归一化:剥掉尾部 exit 0', out.includes('归一化'), out);
|
|
210
|
-
check('S9 挂载行在 exit 0 原位之前追加', R(path.join(t, '.agents/hooks/local-pre-commit')) === '#!/bin/sh\n# 旧装态注释\nsh .agents/hooks/gate.sh\n', R(path.join(t, '.agents/hooks/local-pre-commit')));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// ============ 场景 10:模板树内的运行时缓存不进安装与台账 ============
|
|
214
|
-
{
|
|
215
|
-
const fx = mkFixture();
|
|
216
|
-
W(path.join(fx, 'templates/_agents/cache/kb-index.json'), '{"stale":"test-residue"}');
|
|
217
|
-
const t = mkTarget(fx); // v1 安装态无 cache 文件
|
|
218
|
-
const r = runCmd('sync', fx, t);
|
|
219
|
-
check('S10 cache 残留不被安装', !fs.existsSync(path.join(t, '.agents/cache/kb-index.json')), r.stdout + r.stderr);
|
|
220
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
221
|
-
check('S10 cache 不入 managed 台账', !kit.managed.some((f) => f.rel.startsWith('.agents/cache/')), JSON.stringify(kit.managed.filter((f) => f.rel.includes('cache'))));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// ============ 场景 11:跳过件不被下次升级静默覆盖(台账保持包侧基线,2026-09-24 语义修正回归) ============
|
|
225
|
-
{
|
|
226
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
227
|
-
W(path.join(t, '.agents/scripts/loc.txt'), 'loc USER\n');
|
|
228
|
-
runCmd('sync', fx, t); // 第一次:本地已改 → 跳过
|
|
229
|
-
W(path.join(fx, 'templates/_agents/scripts/loc.txt'), 'loc v3\n'); // 包再出新版
|
|
230
|
-
const r = runCmd('sync', fx, t);
|
|
231
|
-
const out = r.stdout + r.stderr;
|
|
232
|
-
check('S11 二次 sync 不覆盖本地改动(loc.txt 仍为用户版)', R(path.join(t, '.agents/scripts/loc.txt')) === 'loc USER\n', out);
|
|
233
|
-
check('S11 仍按「本地已改,跳过」报告', out.includes('本地已改,跳过') && out.includes('loc.txt'), out);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// ============ 场景 12:owned 台账哈希按盘面自愈(Shipyard 回流策略,2026-09-24) ============
|
|
237
|
-
{
|
|
238
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
239
|
-
W(path.join(t, 'AGENTS.md'), 'owned skeleton v2 EDITED BY USER\n'); // owned 件手改 → 台账停旧值
|
|
240
|
-
const r = runCmd('sync', fx, t);
|
|
241
|
-
const out = r.stdout + r.stderr;
|
|
242
|
-
check('S12 owned 文件不被触碰(AGENTS.md 保持用户版)', R(path.join(t, 'AGENTS.md')) === 'owned skeleton v2 EDITED BY USER\n', out);
|
|
243
|
-
const kit = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
244
|
-
check('S12 owned 台账哈希自愈为盘面值', kit.owned.find((f) => f.rel === 'AGENTS.md').sha256 === sha256(Buffer.from('owned skeleton v2 EDITED BY USER\n')), JSON.stringify(kit.owned));
|
|
245
|
-
check('S12 有刷新报告', out.includes('owned 台账哈希按盘面刷新 1 份'), out);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// ============ 场景 13:managed 连同父目录整目录缺失 → 恢复并重建父目录(恢复分支 mkdir,2026-09-25) ============
|
|
249
|
-
{
|
|
250
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
251
|
-
fs.rmSync(path.join(t, '.zcode'), { recursive: true, force: true });
|
|
252
|
-
const r = runCmd('sync', fx, t);
|
|
253
|
-
const out = r.stdout + r.stderr;
|
|
254
|
-
check('S13 整目录缺失的 managed 被恢复(父目录重建)', R(path.join(t, '.zcode/h.txt')) === 'host v2 777\n', out);
|
|
255
|
-
check('S13 恢复有报告标记', out.includes('恢复缺失'), out);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// ============ 场景 14:台账外文件收养(2026-09-26 managed-ledger-adopt) ============
|
|
259
|
-
// 盘上有 managed 类文件但台账无该条目(旧版手动双写绕过 init/sync 登记)。收养判据与台账内
|
|
260
|
-
// 「改动恰好等于新版」同源:diskSha === 新版渲染 sha 才登记;内容不等(本地真改动)仍保守跳过。
|
|
261
|
-
{
|
|
262
|
-
// ①盘上有、台账无、内容 == 新版 → 收养登记
|
|
263
|
-
const fx = mkFixture(), t = mkTarget(fx);
|
|
264
|
-
W(path.join(t, '.agents/scripts/chg.txt'), 'chg v2 port 777\n'); // == 新版渲染
|
|
265
|
-
// 把它从台账里剔除,伪造「盘上有但未登记」
|
|
266
|
-
const k0 = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
267
|
-
k0.managed = k0.managed.filter((f) => f.rel !== '.agents/scripts/chg.txt');
|
|
268
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify(k0, null, 2)}\n`);
|
|
269
|
-
const r = runCmd('sync', fx, t);
|
|
270
|
-
const out = r.stdout + r.stderr;
|
|
271
|
-
check('S14① 内容==新版 → 收养登记(报告标记)', out.includes('收养登记') && out.includes('chg.txt'), out);
|
|
272
|
-
const kit1 = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
273
|
-
check('S14① 收养后入台账且 sha=盘面', (() => {
|
|
274
|
-
const e = kit1.managed.find((f) => f.rel === '.agents/scripts/chg.txt');
|
|
275
|
-
return e && e.sha256 === sha256(Buffer.from('chg v2 port 777\n'));
|
|
276
|
-
})(), JSON.stringify(kit1.managed));
|
|
277
|
-
check('S14① 收养不改盘面(内容原样)', R(path.join(t, '.agents/scripts/chg.txt')) === 'chg v2 port 777\n');
|
|
278
|
-
|
|
279
|
-
// ②盘上有、台账无、内容 != 新版 → 不收养、不覆盖、台账不登记
|
|
280
|
-
const fx2 = mkFixture(), t2 = mkTarget(fx2);
|
|
281
|
-
W(path.join(t2, '.agents/scripts/chg.txt'), 'chg LOCAL EDIT\n'); // 本地真改动
|
|
282
|
-
const k1 = JSON.parse(R(path.join(t2, '.agents/kit.json')));
|
|
283
|
-
k1.managed = k1.managed.filter((f) => f.rel !== '.agents/scripts/chg.txt');
|
|
284
|
-
W(path.join(t2, '.agents/kit.json'), `${JSON.stringify(k1, null, 2)}\n`);
|
|
285
|
-
const r2 = runCmd('sync', fx2, t2);
|
|
286
|
-
const out2 = r2.stdout + r2.stderr;
|
|
287
|
-
check('S14② 内容!=新版 → 不收养(不报收养登记)', !out2.includes('收养登记'), out2);
|
|
288
|
-
check('S14② 本地改动幸存未被覆盖', R(path.join(t2, '.agents/scripts/chg.txt')) === 'chg LOCAL EDIT\n', out2);
|
|
289
|
-
const kit2 = JSON.parse(R(path.join(t2, '.agents/kit.json')));
|
|
290
|
-
check('S14② 台账不登记(持续报告,防下次静默覆盖)', !kit2.managed.some((f) => f.rel === '.agents/scripts/chg.txt'));
|
|
291
|
-
check('S14② 报「已存在未入台账」跳过', out2.includes('已存在未入台账'), out2);
|
|
292
|
-
|
|
293
|
-
// ③盘上无、台账无 → 新增安装(既有行为不回归)
|
|
294
|
-
const fx3 = mkFixture(), t3 = mkTarget(fx3);
|
|
295
|
-
const r3 = runCmd('sync', fx3, t3);
|
|
296
|
-
check('S14③ 盘上无 → 新增安装(既有行为不回归)', (r3.stdout + r3.stderr).includes('新增安装') && R(path.join(t3, '.agents/commands/new.txt')) === 'new in v2\n');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// ============ 场景 15:模板下发感知三态(2026-10-06 template-downstream)============
|
|
300
|
-
// fixture 包源 templates/AGENTS.md = 'owned skeleton v2\n';盘面定制 'owned CUSTOM\n'(≠ 包源)
|
|
301
|
-
{
|
|
302
|
-
const sha = (s) => sha256(Buffer.from(s, 'utf8'));
|
|
303
|
-
const SRC_TPL = 'owned skeleton v2\n';
|
|
304
|
-
const kitOf = (t) => JSON.parse(R(path.join(t, '.agents', 'kit.json')));
|
|
305
|
-
const mkStale = (fx, t, owned) => W(path.join(t, '.agents', 'kit.json'), `${JSON.stringify({
|
|
306
|
-
kit: 'agentic-flow-kit', version: '1.0.0', createdAt: '2026-09-23T00:00:00Z',
|
|
307
|
-
options: { hosts: ['zcode'], stack: 'none', boardPort: '777' },
|
|
308
|
-
managed: [{ rel: '.agents/scripts/keep.txt', sha256: sha('keep v2\n') }], owned,
|
|
309
|
-
}, null, 2)}\n`);
|
|
310
|
-
|
|
311
|
-
// ① 源演进未拉取 → advisory 出账(唯一出账形态)+ 锚刷新 + 再跑静默(单周期出账)
|
|
312
|
-
const fx1 = mkFixture(), t1 = mkTarget(fx1);
|
|
313
|
-
W(path.join(t1, 'AGENTS.md'), 'owned CUSTOM\n');
|
|
314
|
-
mkStale(fx1, t1, [{ rel: 'AGENTS.md', sha256: sha('owned CUSTOM\n'), srcSha256: sha('owned skeleton v1\n') }]);
|
|
315
|
-
let r1 = runCmd('sync', fx1, t1);
|
|
316
|
-
const out1 = r1.stdout + r1.stderr;
|
|
317
|
-
// 断言锚定出账特征串「有演进且盘面未跟随」——doctor §6.9 的 PASS 回显也含「模板感知」四字,不可作判据
|
|
318
|
-
check('S15① 源演进未拉取 → 出账「模板感知」含文件名', out1.includes('有演进且盘面未跟随') && out1.includes('AGENTS.md'), out1.slice(0, 300));
|
|
319
|
-
check('S15① 锚刷新为当前包源 sha', kitOf(t1).owned[0].srcSha256 === sha(SRC_TPL));
|
|
320
|
-
r1 = runCmd('sync', fx1, t1);
|
|
321
|
-
check('S15① 锚已刷 → 再跑静默(单周期出账)', !(r1.stdout + r1.stderr).includes('有演进且盘面未跟随'));
|
|
322
|
-
|
|
323
|
-
// ② 定制跟源(srcSha256 == 当前包源)→ custom-synced 静默
|
|
324
|
-
const fx2 = mkFixture(), t2 = mkTarget(fx2);
|
|
325
|
-
W(path.join(t2, 'AGENTS.md'), 'owned CUSTOM\n');
|
|
326
|
-
mkStale(fx2, t2, [{ rel: 'AGENTS.md', sha256: sha('owned CUSTOM\n'), srcSha256: sha(SRC_TPL) }]);
|
|
327
|
-
const r2 = runCmd('sync', fx2, t2);
|
|
328
|
-
check('S15② 定制跟源 → 静默(owned 语义正常态永不告警)', !(r2.stdout + r2.stderr).includes('有演进且盘面未跟随'));
|
|
329
|
-
|
|
330
|
-
// ③ 旧 schema 无锚(mkTarget 原生)→ 静默写锚不追溯
|
|
331
|
-
const fx3b = mkFixture(), t3b = mkTarget(fx3b);
|
|
332
|
-
const r3b = runCmd('sync', fx3b, t3b);
|
|
333
|
-
check('S15③ 旧 schema 无锚 → 静默(写锚不出账,不追溯)', !(r3b.stdout + r3b.stderr).includes('有演进且盘面未跟随'));
|
|
334
|
-
check('S15③ 无锚首跑写入锚(下次 sync 起生效)', kitOf(t3b).owned.find((f) => f.rel === 'AGENTS.md').srcSha256 === sha(SRC_TPL));
|
|
335
|
-
|
|
336
|
-
// ④ 手工拉取(盘面 == 包源)→ synced 静默(可消退出账的路径)
|
|
337
|
-
const fx4 = mkFixture(), t4 = mkTarget(fx4);
|
|
338
|
-
mkStale(fx4, t4, [{ rel: 'AGENTS.md', sha256: sha(SRC_TPL), srcSha256: sha('owned skeleton v1\n') }]);
|
|
339
|
-
const r4 = runCmd('sync', fx4, t4);
|
|
340
|
-
check('S15④ 盘面已跟随(手工拉取)→ 静默', !(r4.stdout + r4.stderr).includes('有演进且盘面未跟随'));
|
|
341
|
-
|
|
342
|
-
// ⑤ doctor 只读回显:同判据出 stale 清单、且运行后 kit.json 字节不变;旧账无锚 skipped
|
|
343
|
-
// (no-anchor 须用未跑过 sync 的独立 fixture——sync 会写锚)
|
|
344
|
-
const { checkTemplateDrift } = await import(pathToFileURL(path.join(SRC_ROOT, 'doctor.mjs')).href);
|
|
345
|
-
const fx5 = mkFixture(), t5 = mkTarget(fx5);
|
|
346
|
-
W(path.join(t5, 'AGENTS.md'), 'owned CUSTOM\n');
|
|
347
|
-
mkStale(fx5, t5, [{ rel: 'AGENTS.md', sha256: sha('owned CUSTOM\n'), srcSha256: sha('owned skeleton v1\n') }]);
|
|
348
|
-
const before = R(path.join(t5, '.agents', 'kit.json'));
|
|
349
|
-
const resStale = checkTemplateDrift(t5, fx5);
|
|
350
|
-
check('S15⑤ doctor 判据同源:stale 出清单', resStale.skipped === false && resStale.stale.includes('AGENTS.md'), JSON.stringify(resStale));
|
|
351
|
-
check('S15⑤ doctor 只读:kit.json 字节不变', R(path.join(t5, '.agents', 'kit.json')) === before);
|
|
352
|
-
const fx6 = mkFixture(), t6 = mkTarget(fx6);
|
|
353
|
-
const resNoAnchor = checkTemplateDrift(t6, fx6);
|
|
354
|
-
check('S15⑤ doctor 旧账无锚 → skipped 静默', resNoAnchor.skipped === true, JSON.stringify(resNoAnchor));
|
|
355
|
-
|
|
356
|
-
// ⑥ 点目录前缀翻译(复核 P2-1):owned rel `.agents/x` ↔ 包源 `templates/_agents/x`——
|
|
357
|
-
// 有包源起步模板的 .agents/ owned 件同样参与感知(rule-budgets.txt 等 5 类)
|
|
358
|
-
const fx7 = mkFixture(), t7 = mkTarget(fx7);
|
|
359
|
-
W(path.join(fx7, 'templates/_agents/rule-budgets.txt'), 'budgets v2\n');
|
|
360
|
-
W(path.join(t7, '.agents/rule-budgets.txt'), 'budgets CUSTOM\n');
|
|
361
|
-
mkStale(fx7, t7, [
|
|
362
|
-
{ rel: 'AGENTS.md', sha256: sha('owned skeleton v2\n'), srcSha256: sha(SRC_TPL) },
|
|
363
|
-
{ rel: '.agents/rule-budgets.txt', sha256: sha('budgets CUSTOM\n'), srcSha256: sha('budgets v1\n') },
|
|
364
|
-
]);
|
|
365
|
-
const r7 = runCmd('sync', fx7, t7);
|
|
366
|
-
check('S15⑥ .agents/ 前缀翻译 → _agents 模板参与感知出账', (r7.stdout + r7.stderr).includes('有演进且盘面未跟随') && (r7.stdout + r7.stderr).includes('.agents/rule-budgets.txt'));
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// ============ 场景 16:装户 GitHub CI 远端门模板(2026-10-07 adopter-ci-github)============
|
|
370
|
-
// 包源 templates/_github/workflows/kit-ci.yml → 装户 .github/workflows/kit-ci.yml(owned):
|
|
371
|
-
// ① isOwned / srcTemplatePath 契约(含 .agents 存量不回归、无模板反例);
|
|
372
|
-
// ② 存量装户盘上无该件 → newOwned 提示且不自动落盘;③ 已装 + 源演进 → 感知出账 + 锚刷新 + 再跑静默
|
|
373
|
-
{
|
|
374
|
-
const sha = (s) => sha256(Buffer.from(s, 'utf8'));
|
|
375
|
-
const CI_REL = '.github/workflows/kit-ci.yml';
|
|
376
|
-
const CI_TPL = 'ci v2\n';
|
|
377
|
-
const { isOwned, srcTemplatePath } = await import(pathToFileURL(path.join(SRC_ROOT, 'profiles.mjs')).href);
|
|
378
|
-
|
|
379
|
-
// ① 契约断言:.github/ 归 owned;点前缀翻译 .github ↔ _github 命中、.agents 严格不回归、无模板 null
|
|
380
|
-
check('S16① isOwned:.github/ 前缀归 owned + 存量正例不回归(spec 验收 1)',
|
|
381
|
-
isOwned(CI_REL) === true && isOwned('.github/other.yml') === true
|
|
382
|
-
&& isOwned('AGENTS.md') === true && isOwned('.agents/notes/x.md') === true && isOwned('workflow/plans/a.md') === true
|
|
383
|
-
&& isOwned('.agents/scripts/check-loop.mjs') === false);
|
|
384
|
-
const fxC = mkFixture();
|
|
385
|
-
W(path.join(fxC, 'templates/_github/workflows/kit-ci.yml'), CI_TPL);
|
|
386
|
-
const norm = (p) => p.split(path.sep).join('/');
|
|
387
|
-
check('S16① srcTemplatePath 通用点前缀翻译:.github → _github 命中 / .agents 严格不回归',
|
|
388
|
-
norm(srcTemplatePath(fxC, CI_REL)).endsWith('templates/_github/workflows/kit-ci.yml')
|
|
389
|
-
&& norm(srcTemplatePath(fxC, '.agents/scripts/keep.txt')).endsWith('templates/_agents/scripts/keep.txt'),
|
|
390
|
-
JSON.stringify({ ci: srcTemplatePath(fxC, CI_REL), agents: srcTemplatePath(fxC, '.agents/scripts/keep.txt') }));
|
|
391
|
-
check('S16① srcTemplatePath 无对应模板 → null(.gitattributes 反例,与旧实现等价)',
|
|
392
|
-
srcTemplatePath(fxC, '.gitattributes') === null);
|
|
393
|
-
|
|
394
|
-
// ② 存量装户(盘上无该件)→ newOwned 提示且不自动落盘
|
|
395
|
-
const fx1 = mkFixture();
|
|
396
|
-
W(path.join(fx1, 'templates/_github/workflows/kit-ci.yml'), CI_TPL);
|
|
397
|
-
const t1 = mkTarget(fx1);
|
|
398
|
-
const r1 = runCmd('sync', fx1, t1);
|
|
399
|
-
const out1 = r1.stdout + r1.stderr;
|
|
400
|
-
check('S16② 存量装户无该件 → newOwned 提示含文件名且不自动落盘',
|
|
401
|
-
out1.includes('新增 owned 起步文档') && out1.includes(CI_REL) && !fs.existsSync(path.join(t1, CI_REL)), out1);
|
|
402
|
-
|
|
403
|
-
// ③ 装户已装(带旧锚)+ 源演进 → 感知出账;锚刷新后(custom-synced)再跑静默
|
|
404
|
-
const fx2 = mkFixture();
|
|
405
|
-
W(path.join(fx2, 'templates/_github/workflows/kit-ci.yml'), CI_TPL);
|
|
406
|
-
const t2 = mkTarget(fx2);
|
|
407
|
-
W(path.join(t2, CI_REL), 'ci CUSTOM\n');
|
|
408
|
-
W(path.join(t2, '.agents/kit.json'), `${JSON.stringify({
|
|
409
|
-
kit: 'agentic-flow-kit', version: '1.0.0', createdAt: '2026-09-23T00:00:00Z',
|
|
410
|
-
options: { hosts: ['zcode'], stack: 'none', boardPort: '777' },
|
|
411
|
-
managed: [{ rel: '.agents/scripts/keep.txt', sha256: sha('keep v2\n') }],
|
|
412
|
-
owned: [{ rel: CI_REL, sha256: sha('ci CUSTOM\n'), srcSha256: sha('ci v1\n') }],
|
|
413
|
-
}, null, 2)}\n`);
|
|
414
|
-
const r2 = runCmd('sync', fx2, t2);
|
|
415
|
-
const out2 = r2.stdout + r2.stderr;
|
|
416
|
-
check('S16③ 源演进未跟随 → 感知出账含 .github rel', out2.includes('有演进且盘面未跟随') && out2.includes(CI_REL), out2.slice(0, 300));
|
|
417
|
-
check('S16③ 装户定制不被覆盖(盘面仍 CUSTOM)', R(path.join(t2, CI_REL)) === 'ci CUSTOM\n', out2);
|
|
418
|
-
const kit2 = JSON.parse(R(path.join(t2, '.agents/kit.json')));
|
|
419
|
-
check('S16③ 锚刷新为当前包源 sha', kit2.owned.find((f) => f.rel === CI_REL).srcSha256 === sha(CI_TPL), JSON.stringify(kit2.owned));
|
|
420
|
-
const r2b = runCmd('sync', fx2, t2);
|
|
421
|
-
check('S16③ 锚已刷(custom-synced)→ 再跑静默', !(r2b.stdout + r2b.stderr).includes('有演进且盘面未跟随'));
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// ============ 场景 17:sync 一次自洽——生成器重写 owned 目标后按终态记账(2026-10-08 papercuts-cleanup-batch 修 1)============
|
|
425
|
-
// 修前:记账段(owned 自愈/感知/台账重写)先于生成器执行 → 生成器重写 wiki 类 owned 目标后台账停旧值
|
|
426
|
-
// → doctor §6.6 owned 漂移 FAIL 一次,需二次 sync 自愈。修后:生成器先跑,记账按生成后盘面收口。
|
|
427
|
-
{
|
|
428
|
-
const sha = (s) => sha256(Buffer.from(s, 'utf8'));
|
|
429
|
-
const GEN = "import fs from 'node:fs';\nfs.writeFileSync('wiki/INDEX.md', 'generated v2\\n');\n";
|
|
430
|
-
const fx = mkFixture();
|
|
431
|
-
W(path.join(fx, 'templates/_agents/scripts/gen-wiki-board.mjs'), GEN);
|
|
432
|
-
const t = mkTarget(fx);
|
|
433
|
-
W(path.join(t, '.agents/scripts/gen-wiki-board.mjs'), GEN); // 目标侧与包源渲染一致(genGuard/scriptTrusted 放行)
|
|
434
|
-
W(path.join(t, 'wiki/INDEX.md'), 'generated v1\n'); // 盘面停旧版——生成器将重写它
|
|
435
|
-
const k0 = JSON.parse(R(path.join(t, '.agents/kit.json')));
|
|
436
|
-
k0.managed.push({ rel: '.agents/scripts/gen-wiki-board.mjs', sha256: sha(GEN) });
|
|
437
|
-
k0.owned.push({ rel: 'wiki/INDEX.md', sha256: sha('generated v1\n') });
|
|
438
|
-
W(path.join(t, '.agents/kit.json'), `${JSON.stringify(k0, null, 2)}\n`);
|
|
439
|
-
const r = runCmd('sync', fx, t);
|
|
440
|
-
const out = r.stdout + r.stderr;
|
|
441
|
-
check('S17 一次 sync:生成器重写后 owned 台账按终态记账(wiki/INDEX.md → v2 sha)',
|
|
442
|
-
JSON.parse(R(path.join(t, '.agents/kit.json'))).owned.find((f) => f.rel === 'wiki/INDEX.md').sha256 === sha('generated v2\n'),
|
|
443
|
-
JSON.stringify(JSON.parse(R(path.join(t, '.agents/kit.json'))).owned) + out.slice(0, 300));
|
|
444
|
-
const { checkOwnedDrift } = await import(pathToFileURL(path.join(SRC_ROOT, 'doctor.mjs')).href);
|
|
445
|
-
const d = checkOwnedDrift(t);
|
|
446
|
-
check('S17 一次 sync 后 doctor owned 零漂移(修前必漂移需二次 sync)', d.drift === 0 && d.gone.length === 0, JSON.stringify(d));
|
|
447
|
-
const r2 = runCmd('sync', fx, t);
|
|
448
|
-
check('S17 二次 sync 幂等(无 owned 刷新报告)', !(r2.stdout + r2.stderr).includes('owned 台账哈希按盘面刷新'), r2.stdout + r2.stderr);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${failCount}`);
|
|
452
|
-
process.exit(failCount ? 1 : 0);
|
package/src/trae-hooks.test.mjs
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// trae-hooks.test.mjs — trae 宿主 hook 判定回归(2026-09-27 host-gates-p1,incident 三件套「防复发验证」落点)
|
|
3
|
-
// 方法:stdin JSON 注入 spawn pre-shell-check.cjs(RunCommand 形态),断言 permissionDecision。
|
|
4
|
-
// 场景对位:P1-B2 强推 token 化(换序 / +refspec / --force-with-lease 放行 / -f)+ 既有 deny/ask 回归 +
|
|
5
|
-
// 非 push 命令带 --force 不误拦(如 dotnet build --force)。
|
|
6
|
-
// 注:127 未装分支(P2-B4)需 .githooks 脚本缺失形态,经 isCommit 路径覆盖——单独场景构造 cwd 指向
|
|
7
|
-
// 无 .githooks 的临时目录跑 git commit,断言「门禁未执行」而非「未通过」。
|
|
8
|
-
// 用法:node src/trae-hooks.test.mjs(npm test 随跑)
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
import os from 'node:os';
|
|
11
|
-
import path from 'node:path';
|
|
12
|
-
import { spawnSync } from 'node:child_process';
|
|
13
|
-
import { fileURLToPath } from 'node:url';
|
|
14
|
-
|
|
15
|
-
let pass = 0;
|
|
16
|
-
let fail = 0;
|
|
17
|
-
const check = (desc, cond, detail = '') => {
|
|
18
|
-
if (cond) { pass++; console.log(`PASS ${desc}`); }
|
|
19
|
-
else { fail++; console.log(`FAIL ${desc}${detail ? `\n${detail}` : ''}`); }
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
23
|
-
const HOOK = path.join(PKG_ROOT, 'modules', 'hosts', 'trae', 'hooks', 'pre-shell-check.cjs');
|
|
24
|
-
|
|
25
|
-
const runHook = (command, cwd) => {
|
|
26
|
-
const payload = JSON.stringify({
|
|
27
|
-
tool_name: 'RunCommand',
|
|
28
|
-
tool_input: { command },
|
|
29
|
-
cwd: cwd || process.cwd(),
|
|
30
|
-
});
|
|
31
|
-
const r = spawnSync(process.execPath, [HOOK], { input: payload, encoding: 'utf8', timeout: 30000 });
|
|
32
|
-
let decision = 'none';
|
|
33
|
-
let reason = '';
|
|
34
|
-
try {
|
|
35
|
-
const j = JSON.parse((r.stdout || '').trim().split('\n').pop() || '{}');
|
|
36
|
-
decision = j?.hookSpecificOutput?.permissionDecision || 'none';
|
|
37
|
-
reason = j?.hookSpecificOutput?.permissionDecisionReason || '';
|
|
38
|
-
} catch { /* 无输出 = 放行 */ }
|
|
39
|
-
return { decision, reason, raw: r.stdout || '', status: r.status };
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// 门禁在位桩(2026-10-09 装户端内容清理后):纯包源仓无 .githooks/——hook 第二道关卡
|
|
43
|
-
// (commit/push 前置 .githooks/*)在仓内必判「门禁未执行」。①/②/②附 的 token 边界断言
|
|
44
|
-
// 需要「门禁通过」语境:造临时目录放通过型桩门禁当 cwd;③ 另用空目录保留「缺失 → 门禁未执行」deny。
|
|
45
|
-
const GATE_FIXTURE = fs.mkdtempSync(path.join(os.tmpdir(), 'trae-hook-gates-'));
|
|
46
|
-
fs.mkdirSync(path.join(GATE_FIXTURE, '.githooks'));
|
|
47
|
-
for (const name of ['pre-commit', 'pre-push']) {
|
|
48
|
-
const stub = path.join(GATE_FIXTURE, '.githooks', name);
|
|
49
|
-
fs.writeFileSync(stub, '#!/usr/bin/env bash\nexit 0\n');
|
|
50
|
-
fs.chmodSync(stub, 0o755);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ---- ① 强推 token 化(P1-B2)----
|
|
54
|
-
{
|
|
55
|
-
const cases = [
|
|
56
|
-
['git push --force', 'deny', '标准序'],
|
|
57
|
-
['git push origin main --force', 'deny', '换序(旧代码漏拦形态)'],
|
|
58
|
-
['git push origin +main', 'deny', '+refspec 变体'],
|
|
59
|
-
['git push -f', 'deny', '短旗标'],
|
|
60
|
-
['git -c x=y push origin main --force', 'deny', '全局参前缀'],
|
|
61
|
-
['git push -vf origin main', 'deny', '组合短旗标 -vf(复核 P2-1)'],
|
|
62
|
-
['git push origin main && dotnet build --force', 'none', '跨 && 的 --force 属他命令不误并(复核 P2-3)'],
|
|
63
|
-
['git push origin main --force-with-lease', 'none', '--force-with-lease 精确 token 不误拦'],
|
|
64
|
-
['git push origin main', 'none', '普通 push 放行'],
|
|
65
|
-
['dotnet build --force', 'none', '非 push 命令带 --force 不误拦'],
|
|
66
|
-
];
|
|
67
|
-
for (const [cmd, expect, label] of cases) {
|
|
68
|
-
const r = runHook(cmd, GATE_FIXTURE);
|
|
69
|
-
check(`①${label}(${cmd})→ ${expect === 'none' ? '放行' : expect}`,
|
|
70
|
-
r.decision === expect,
|
|
71
|
-
`decision=${r.decision} reason=${r.reason}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// ①附:换序强推的 deny 理由点名红线
|
|
75
|
-
{
|
|
76
|
-
const r = runHook('git push origin main --force');
|
|
77
|
-
check('①换序强推 deny 理由点名禁强制推送', r.decision === 'deny' && /强制推送/.test(r.reason), r.reason);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ---- ② 既有 deny/ask 回归(token 边界口径不动)----
|
|
81
|
-
{
|
|
82
|
-
const cases = [
|
|
83
|
-
['git reset --hard HEAD~1', 'deny'],
|
|
84
|
-
['drop database MyDb', 'deny'],
|
|
85
|
-
// 'dotnet ef' 已从 deny 清单移除(p2-batch2:对齐 settings.json 权威清单——settings.json 无此项)
|
|
86
|
-
['dotnet ef database update', 'none'],
|
|
87
|
-
['git checkout main', 'ask'],
|
|
88
|
-
['rm -rf tmp/', 'ask'],
|
|
89
|
-
['git status', 'none'],
|
|
90
|
-
['git commit -m "fix: 修复"', 'none'], // commit 走 .githooks 链(本仓有钩子且全绿);deny 门本身不应拦 commit
|
|
91
|
-
];
|
|
92
|
-
for (const [cmd, expect] of cases) {
|
|
93
|
-
const r = runHook(cmd, GATE_FIXTURE); // cwd=桩门禁目录:git commit 能通过第二道关卡,只测 deny/ask 门
|
|
94
|
-
check(`②${cmd} → ${expect === 'none' ? '不因 deny/ask 门拦' : expect}`,
|
|
95
|
-
r.decision === expect,
|
|
96
|
-
`decision=${r.decision} reason=${r.reason}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ---- ②附 消息字样误触(p2-batch2):带引号多词消息内含禁词 → 剥引号整段后不再误 deny/ask ----
|
|
101
|
-
{
|
|
102
|
-
const cases = [
|
|
103
|
-
['git commit -m "fix: 修 git push --force 误拦"', 'none', 'deny 词在引号消息内'],
|
|
104
|
-
['git commit -m "docs: 补 git clean 说明"', 'none', 'ask 词在引号消息内'],
|
|
105
|
-
['git commit -m "真正要拦的消息"', 'none', '普通消息照常'],
|
|
106
|
-
];
|
|
107
|
-
for (const [cmd, expect, label] of cases) {
|
|
108
|
-
const r = runHook(cmd, GATE_FIXTURE);
|
|
109
|
-
check(`②附 ${label} → ${expect === 'none' ? '不误拦' : expect}`,
|
|
110
|
-
r.decision === expect,
|
|
111
|
-
`decision=${r.decision} reason=${r.reason}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// ---- ③ 127 未装区分(P2-B4):无 .githooks 的 cwd 跑 git commit → 「门禁未执行」----
|
|
116
|
-
{
|
|
117
|
-
const empty = fs.mkdtempSync(path.join(os.tmpdir(), 'trae-hook-test-'));
|
|
118
|
-
const r = runHook('git commit -m "x"', empty);
|
|
119
|
-
check('③.githooks 缺失 → deny 且理由为「门禁未执行/不可达」(非违例误报)',
|
|
120
|
-
r.decision === 'deny' && /门禁未执行|不可达/.test(r.reason),
|
|
121
|
-
`decision=${r.decision} reason=${r.reason}`);
|
|
122
|
-
fs.rmSync(empty, { recursive: true, force: true });
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
126
|
-
fs.rmSync(GATE_FIXTURE, { recursive: true, force: true });
|
|
127
|
-
process.exit(fail ? 1 : 0);
|