agentic-flow-kit 1.8.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -148
- package/bin/flow-kit.mjs +5 -2
- package/locales/en/installer.json +25 -0
- package/locales/en/overrides/.agents/commands/deploy.md +52 -0
- package/locales/en/overrides/.agents/commands/maintain.md +76 -0
- package/locales/en/overrides/.agents/commands/new-task.md +89 -0
- package/locales/en/overrides/.agents/commands/pipeline-run.md +56 -0
- package/locales/en/overrides/.agents/commands/pr-review.md +30 -0
- package/locales/en/overrides/.agents/commands/review.md +93 -0
- package/locales/en/overrides/.agents/commands/stages.md +256 -0
- package/locales/en/overrides/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/locales/en/overrides/.agents/notes/process-order-rule.md +21 -0
- package/locales/en/overrides/.agents/notes/runtime-env.local.example.md +21 -0
- package/locales/en/overrides/.agents/pipelines/_TEMPLATE.md +75 -0
- package/locales/en/overrides/.agents/pipelines/pipeline-closing.md +28 -0
- package/locales/en/overrides/.agents/roles/implementer.md +28 -0
- package/locales/en/overrides/.agents/roles/independent-reviewer.md +39 -0
- package/locales/en/overrides/.agents/roles/pr-adjudicator.md +27 -0
- package/locales/en/overrides/.agents/roles/pr-finder.md +51 -0
- package/locales/en/overrides/.agents/roles/pr-verifier.md +44 -0
- package/locales/en/overrides/.agents/roles/ui-verifier.md +22 -0
- package/locales/en/overrides/.agents/roles/wiki-compiler.md +47 -0
- package/locales/en/overrides/.agents/skills/arena/SKILL.md +50 -0
- package/locales/en/overrides/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/locales/en/overrides/.agents/skills/blast-radius/SKILL.md +53 -0
- package/locales/en/overrides/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/dev-tour/SKILL.md +98 -0
- package/locales/en/overrides/.agents/skills/dream/SKILL.md +63 -0
- package/locales/en/overrides/.agents/skills/eval/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/interrogate/SKILL.md +49 -0
- package/locales/en/overrides/.agents/skills/number-vetting/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/page-refactor/SKILL.md +192 -0
- package/locales/en/overrides/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/pause-safely/SKILL.md +31 -0
- package/locales/en/overrides/.agents/skills/perf/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/review-method/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/session-resume/SKILL.md +69 -0
- package/locales/en/overrides/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/locales/en/overrides/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/locales/en/overrides/.agents/skills/verify-ui/SKILL.md +116 -0
- package/locales/en/overrides/.agents/skills/visual-parity/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/why/SKILL.md +56 -0
- package/locales/en/overrides/.agents/skills/wiki/SKILL.md +53 -0
- package/locales/en/overrides/.claude/agents/implementer.md +9 -0
- package/locales/en/overrides/.claude/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.claude/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.cline/agents/implementer.yml +13 -0
- package/locales/en/overrides/.cline/agents/independent-reviewer.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-adjudicator.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-finder.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-verifier.yml +11 -0
- package/locales/en/overrides/.cline/agents/ui-verifier.yml +8 -0
- package/locales/en/overrides/.cline/agents/wiki-compiler.yml +14 -0
- package/locales/en/overrides/.cline/workflows/wf-deploy.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-maintain.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-new-task.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pr-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/CODEBUDDY.md +7 -0
- package/locales/en/overrides/.codebuddy/agents/implementer.md +9 -0
- package/locales/en/overrides/.codebuddy/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.codebuddy/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.codebuddy/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/locales/en/overrides/.commandcode/agents/implementer.md +10 -0
- package/locales/en/overrides/.commandcode/agents/independent-reviewer.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-adjudicator.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-finder.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-verifier.md +9 -0
- package/locales/en/overrides/.commandcode/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.commandcode/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.commandcode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.opencode/agents/implementer.md +51 -0
- package/locales/en/overrides/.opencode/agents/independent-reviewer.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-adjudicator.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-finder.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-verifier.md +18 -0
- package/locales/en/overrides/.opencode/agents/ui-verifier.md +45 -0
- package/locales/en/overrides/.opencode/agents/wiki-compiler.md +51 -0
- package/locales/en/overrides/.opencode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.pi/agents/implementer.md +11 -0
- package/locales/en/overrides/.pi/agents/independent-reviewer.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-adjudicator.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-finder.md +11 -0
- package/locales/en/overrides/.pi/agents/pr-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/wiki-compiler.md +11 -0
- package/locales/en/overrides/.qoder/agents/implementer.md +9 -0
- package/locales/en/overrides/.qoder/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.qoder/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.qwen/agents/implementer.md +10 -0
- package/locales/en/overrides/.qwen/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/wiki-compiler.md +13 -0
- package/locales/en/overrides/.qwen/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.trae/agents/implementer.md +9 -0
- package/locales/en/overrides/.trae/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.trae/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.trae/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.trae/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.zcode/agents/implementer.md +8 -0
- package/locales/en/overrides/.zcode/agents/independent-reviewer.md +8 -0
- package/locales/en/overrides/.zcode/agents/ui-verifier.md +8 -0
- package/locales/en/overrides/.zcode/agents/wiki-compiler.md +8 -0
- package/locales/en/overrides/AGENTS.md +52 -0
- package/locales/en/overrides/CLAUDE.md +20 -0
- package/locales/en/overrides/wiki/INDEX.md +33 -0
- package/locales/en/overrides/wiki/drafts-archive/README.md +6 -0
- package/locales/en/overrides/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/locales/en/overrides/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/locales/en/overrides/workflow/INDEX.md +13 -0
- package/locales/en/overrides/workflow/README.md +67 -0
- package/locales/en/overrides/workflow/archive/README.md +3 -0
- package/locales/en/overrides/workflow/delegations.md +4 -0
- package/locales/en/overrides/workflow/effective-policy.md +4 -0
- package/locales/en/overrides/workflow/gate-cost.md +4 -0
- package/locales/en/overrides/workflow/incidents/_TEMPLATE.md +49 -0
- package/locales/en/overrides/workflow/intents/_TEMPLATE.md +43 -0
- package/locales/en/overrides/workflow/metrics.md +4 -0
- package/locales/en/overrides/workflow/papercuts.md +3 -0
- package/locales/en/overrides/workflow/plans/_TEMPLATE.md +47 -0
- package/locales/en/overrides/workflow/regression-checklist.md +3 -0
- package/locales/en/overrides/workflow/specs/_TEMPLATE.md +86 -0
- package/locales/en/overrides/workflow/verify-evidence.md +4 -0
- package/locales/zh-CN/installer.json +25 -0
- package/package.json +23 -36
- package/schemas/install-manifest.schema.json +24 -0
- package/schemas/project-profile.schema.json +28 -0
- package/src/cli/args.mjs +41 -0
- package/src/cli/main.mjs +72 -0
- package/src/commands/add-host.mjs +29 -0
- package/src/commands/doctor.mjs +80 -0
- package/src/commands/install.mjs +149 -0
- package/src/commands/upgrade.mjs +30 -0
- package/src/git/config.mjs +61 -0
- package/src/hosts/registry.mjs +26 -0
- package/src/i18n.mjs +32 -0
- package/src/install/apply.mjs +124 -0
- package/src/install/manifest.mjs +40 -0
- package/src/install/plan.mjs +83 -0
- package/src/render/tokens.mjs +58 -0
- package/templates/engine/.agents/board/dev-tour.html +1940 -0
- package/templates/engine/.agents/board/index.html +835 -0
- package/templates/engine/.agents/commands/deploy.md +52 -0
- package/templates/engine/.agents/commands/maintain.md +76 -0
- package/templates/engine/.agents/commands/new-task.md +89 -0
- package/templates/engine/.agents/commands/pipeline-run.md +56 -0
- package/templates/engine/.agents/commands/pr-review.md +30 -0
- package/templates/engine/.agents/commands/review.md +93 -0
- package/templates/engine/.agents/commands/stages.md +256 -0
- package/templates/engine/.agents/config/commit-msg-rules.json +7 -0
- package/templates/engine/.agents/config/engine.json +11 -0
- package/templates/engine/.agents/config/gate-budgets.json +5 -0
- package/templates/engine/.agents/config/mechanism-registry.md +62 -0
- package/templates/engine/.agents/config/model-roles.json +26 -0
- package/templates/engine/.agents/config/model-roles.local.example.json +7 -0
- package/templates/engine/.agents/config/pr-review.json +67 -0
- package/templates/engine/.agents/config/principles.md +32 -0
- package/templates/engine/.agents/config/workflow-enums.txt +25 -0
- package/templates/engine/.agents/hooks/check-architecture.mjs +168 -0
- package/templates/engine/.agents/hooks/check-audit-fields.mjs +56 -0
- package/templates/engine/.agents/hooks/check-commit-plan-ref.mjs +84 -0
- package/templates/engine/.agents/hooks/check-confirm-order.mjs +281 -0
- package/templates/engine/.agents/hooks/check-delete-guard.mjs +63 -0
- package/templates/engine/.agents/hooks/check-notify-guard.mjs +55 -0
- package/templates/engine/.agents/hooks/commit-check.cjs +208 -0
- package/templates/engine/.agents/hooks/gates.json +33 -0
- package/templates/engine/.agents/hooks/local-pre-commit.mjs +27 -0
- package/templates/engine/.agents/hooks/pre-shell-check.cjs +361 -0
- package/templates/engine/.agents/hooks/pre-write-check.cjs +220 -0
- package/templates/engine/.agents/notes/gate-diet.md +75 -0
- package/templates/engine/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/templates/engine/.agents/notes/process-order-rule.md +21 -0
- package/templates/engine/.agents/notes/runtime-env.local.example.md +21 -0
- package/templates/engine/.agents/pipelines/_TEMPLATE.md +75 -0
- package/templates/engine/.agents/pipelines/pipeline-closing.md +28 -0
- package/templates/engine/.agents/pipelines//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
- package/templates/engine/.agents/roles/implementer.md +28 -0
- package/templates/engine/.agents/roles/independent-reviewer.md +39 -0
- package/templates/engine/.agents/roles/pr-adjudicator.md +27 -0
- package/templates/engine/.agents/roles/pr-finder.md +51 -0
- package/templates/engine/.agents/roles/pr-verifier.md +44 -0
- package/templates/engine/.agents/roles/ui-verifier.md +22 -0
- package/templates/engine/.agents/roles/wiki-compiler.md +47 -0
- package/templates/engine/.agents/scripts/agg-delegations.mjs +439 -0
- package/templates/engine/.agents/scripts/agg-judgments.mjs +301 -0
- package/templates/engine/.agents/scripts/agg-kb-usage.mjs +196 -0
- package/templates/engine/.agents/scripts/append-compensation.mjs +109 -0
- package/templates/engine/.agents/scripts/archive-sweep.mjs +229 -0
- package/templates/engine/.agents/scripts/auto-tour.mjs +77 -0
- package/templates/engine/.agents/scripts/board-port.mjs +17 -0
- package/templates/engine/.agents/scripts/check-doc-body-drift.mjs +102 -0
- package/templates/engine/.agents/scripts/check-engine-artifacts.mjs +54 -0
- package/templates/engine/.agents/scripts/check-hook-wiring.mjs +75 -0
- package/templates/engine/.agents/scripts/check-lane-surface.mjs +393 -0
- package/templates/engine/.agents/scripts/check-ledger-doc-presence.mjs +71 -0
- package/templates/engine/.agents/scripts/check-ledger-invariant.mjs +873 -0
- package/templates/engine/.agents/scripts/check-local-gate-config.mjs +95 -0
- package/templates/engine/.agents/scripts/check-local-gates.mjs +248 -0
- package/templates/engine/.agents/scripts/check-loop-kit.mjs +550 -0
- package/templates/engine/.agents/scripts/check-loop-rev-semantics.mjs +59 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s01-pairing.mjs +116 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s03x-regr-evidence.mjs +38 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s08-acceptance.mjs +130 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s15-fingerprint.mjs +152 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s23-convergence-audit.mjs +182 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s29-regr-enforcer.mjs +69 -0
- package/templates/engine/.agents/scripts/check-loop.mjs +131 -0
- package/templates/engine/.agents/scripts/check-regression-consistency.mjs +252 -0
- package/templates/engine/.agents/scripts/check-schema-residue.mjs +144 -0
- package/templates/engine/.agents/scripts/check-scope-range.mjs +156 -0
- package/templates/engine/.agents/scripts/check-scope.mjs +121 -0
- package/templates/engine/.agents/scripts/check-scripts-syntax.mjs +138 -0
- package/templates/engine/.agents/scripts/check-secrets-lite.mjs +239 -0
- package/templates/engine/.agents/scripts/check-secrets.mjs +104 -0
- package/templates/engine/.agents/scripts/check-test-impact-map.mjs +107 -0
- package/templates/engine/.agents/scripts/ci-assert-frontend-deps.mjs +42 -0
- package/templates/engine/.agents/scripts/ci-commit-hygiene.mjs +86 -0
- package/templates/engine/.agents/scripts/ci-install-gitleaks.mjs +75 -0
- package/templates/engine/.agents/scripts/ci-push-before.mjs +49 -0
- package/templates/engine/.agents/scripts/closeout.mjs +127 -0
- package/templates/engine/.agents/scripts/compact-ledgers.mjs +70 -0
- package/templates/engine/.agents/scripts/confirm-doc.mjs +737 -0
- package/templates/engine/.agents/scripts/delegation-presence.mjs +38 -0
- package/templates/engine/.agents/scripts/dev-tour-model.mjs +1398 -0
- package/templates/engine/.agents/scripts/dream-run.mjs +283 -0
- package/templates/engine/.agents/scripts/ensure-board.mjs +187 -0
- package/templates/engine/.agents/scripts/failure-attribution.mjs +11 -0
- package/templates/engine/.agents/scripts/fill-intent.mjs +60 -0
- package/templates/engine/.agents/scripts/fill-plan.mjs +105 -0
- package/templates/engine/.agents/scripts/fill-spec.mjs +72 -0
- package/templates/engine/.agents/scripts/gen-dev-tour.mjs +191 -0
- package/templates/engine/.agents/scripts/gen-effective-policy.mjs +113 -0
- package/templates/engine/.agents/scripts/gen-engine-map.mjs +292 -0
- package/templates/engine/.agents/scripts/gen-narrative-claims.mjs +275 -0
- package/templates/engine/.agents/scripts/gen-verify-evidence.mjs +115 -0
- package/templates/engine/.agents/scripts/gen-wiki-board.mjs +221 -0
- package/templates/engine/.agents/scripts/gen-workflow-index.mjs +201 -0
- package/templates/engine/.agents/scripts/gen-workflow-metrics.mjs +692 -0
- package/templates/engine/.agents/scripts/git-merge-jsonl.mjs +62 -0
- package/templates/engine/.agents/scripts/judgment-ledger.mjs +68 -0
- package/templates/engine/.agents/scripts/kb-cache-evict.mjs +50 -0
- package/templates/engine/.agents/scripts/kb-search.mjs +423 -0
- package/templates/engine/.agents/scripts/lane-surface-audit.mjs +145 -0
- package/templates/engine/.agents/scripts/ledger-loader.mjs +77 -0
- package/templates/engine/.agents/scripts/ledger-shards.mjs +346 -0
- package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
- package/templates/engine/.agents/scripts/pipeline-run.mjs +964 -0
- package/templates/engine/.agents/scripts/policy.mjs +250 -0
- package/templates/engine/.agents/scripts/pr-create.mjs +54 -0
- package/templates/engine/.agents/scripts/pr-review.mjs +1551 -0
- package/templates/engine/.agents/scripts/quote-grounding.mjs +233 -0
- package/templates/engine/.agents/scripts/regen-ledgers.mjs +59 -0
- package/templates/engine/.agents/scripts/rewrite-file.mjs +135 -0
- package/templates/engine/.agents/scripts/rule-budget.mjs +246 -0
- package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
- package/templates/engine/.agents/scripts/test-impact-lib.mjs +451 -0
- package/templates/engine/.agents/scripts/test-impact.mjs +105 -0
- package/templates/engine/.agents/scripts/trust-mode.mjs +130 -0
- package/templates/engine/.agents/scripts/verify-scope.mjs +163 -0
- package/templates/engine/.agents/scripts/verify-wiki-consistency.mjs +264 -0
- package/templates/engine/.agents/scripts/verify.mjs +847 -0
- package/templates/engine/.agents/scripts/warn-format.mjs +57 -0
- package/templates/engine/.agents/scripts/wf-journal.mjs +230 -0
- package/templates/engine/.agents/scripts/workflow-board-server.mjs +696 -0
- package/templates/engine/.agents/scripts/workflow-enums.mjs +70 -0
- package/templates/engine/.agents/scripts/workflows-check.mjs +260 -0
- package/templates/engine/.agents/settings.json +33 -0
- package/templates/engine/.agents/skills/arena/SKILL.md +50 -0
- package/templates/engine/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/templates/engine/.agents/skills/blast-radius/SKILL.md +53 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/scripts/quality-gates.mjs +430 -0
- package/templates/engine/.agents/skills/dev-tour/SKILL.md +98 -0
- package/templates/engine/.agents/skills/dream/SKILL.md +63 -0
- package/templates/engine/.agents/skills/eval/SKILL.md +42 -0
- package/templates/engine/.agents/skills/eval/scripts/eval-score.mjs +59 -0
- package/templates/engine/.agents/skills/interrogate/SKILL.md +49 -0
- package/templates/engine/.agents/skills/interrogate/scripts/interrogate-plan.mjs +72 -0
- package/templates/engine/.agents/skills/number-vetting/SKILL.md +35 -0
- package/templates/engine/.agents/skills/page-refactor/SKILL.md +192 -0
- package/templates/engine/.agents/skills/page-refactor/references/templates.md +989 -0
- package/templates/engine/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/templates/engine/.agents/skills/papercut-fix/references/response-template.md +81 -0
- package/templates/engine/.agents/skills/pause-safely/SKILL.md +31 -0
- package/templates/engine/.agents/skills/perf/SKILL.md +42 -0
- package/templates/engine/.agents/skills/review-method/SKILL.md +92 -0
- package/templates/engine/.agents/skills/review-method/golden-set.md +61 -0
- package/templates/engine/.agents/skills/session-resume/SKILL.md +69 -0
- package/templates/engine/.agents/skills/session-resume/scripts/worktree-audit.mjs +110 -0
- package/templates/engine/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/templates/engine/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/templates/engine/.agents/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/templates/engine/.agents/skills/show-me-your-work/scripts/decision-log.mjs +24 -0
- package/templates/engine/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/templates/engine/.agents/skills/tfs-pr/scripts/tfs-pr.mjs +947 -0
- package/templates/engine/.agents/skills/verify-ui/SKILL.md +116 -0
- package/templates/engine/.agents/skills/verify-ui/features/.gitkeep +0 -0
- package/templates/engine/.agents/skills/verify-ui/scripts/gen-verify-feature.mjs +114 -0
- package/templates/engine/.agents/skills/visual-parity/SKILL.md +35 -0
- package/templates/engine/.agents/skills/why/SKILL.md +56 -0
- package/templates/engine/.agents/skills/why/scripts/why-evidence.mjs +74 -0
- package/templates/engine/.agents/skills/wiki/SKILL.md +53 -0
- package/templates/engine/.agents/tests/auto-tour.test.mjs +82 -0
- package/templates/engine/.agents/tests/dev-tour-model.test.mjs +452 -0
- package/templates/engine/.agents/tests/fill-plan-lite.test.mjs +46 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.md +14 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.model.json +179 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.md +21 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.model.json +194 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.md +20 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.model.json +225 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.md +15 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.model.json +160 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.model.json +266 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.md +17 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.model.json +359 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.md +16 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.model.json +131 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.model.json +190 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.model.json +362 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.model.json +224 -0
- package/templates/engine/.agents/tests/tools/gen-synthetic-plan.mjs +108 -0
- package/templates/git/.gitattributes +22 -0
- package/templates/git/.githooks/commit-msg +72 -0
- package/templates/git/.githooks/post-commit +62 -0
- package/templates/git/.githooks/pre-commit +197 -0
- package/templates/git/.githooks/pre-merge-commit +28 -0
- package/templates/git/.githooks/pre-push +201 -0
- package/templates/git/.gitignore.engine +11 -0
- package/templates/hosts/claude/CLAUDE.md +55 -0
- package/templates/hosts/claude/agents/implementer.md +7 -0
- package/templates/hosts/claude/agents/independent-reviewer.md +8 -0
- package/templates/hosts/claude/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/claude/agents/pr-finder.md +8 -0
- package/templates/hosts/claude/agents/pr-verifier.md +8 -0
- package/templates/hosts/claude/agents/ui-verifier.md +8 -0
- package/templates/hosts/claude/agents/wiki-compiler.md +8 -0
- package/templates/hosts/claude/commands/wf-deploy.md +10 -0
- package/templates/hosts/claude/commands/wf-maintain.md +10 -0
- package/templates/hosts/claude/commands/wf-new-task.md +10 -0
- package/templates/hosts/claude/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/claude/commands/wf-pr-review.md +10 -0
- package/templates/hosts/claude/commands/wf-review.md +10 -0
- package/templates/hosts/claude/commands/wf-stages.md +10 -0
- package/templates/hosts/claude/settings.json +57 -0
- package/templates/hosts/cline/agents/implementer.yml +15 -0
- package/templates/hosts/cline/agents/independent-reviewer.yml +20 -0
- package/templates/hosts/cline/agents/pr-adjudicator.yml +18 -0
- package/templates/hosts/cline/agents/pr-finder.yml +19 -0
- package/templates/hosts/cline/agents/pr-verifier.yml +18 -0
- package/templates/hosts/cline/agents/ui-verifier.yml +17 -0
- package/templates/hosts/cline/agents/wiki-compiler.yml +20 -0
- package/templates/hosts/cline/hooks/PreToolUse.cjs +260 -0
- package/templates/hosts/cline/workflows/wf-deploy.md +8 -0
- package/templates/hosts/cline/workflows/wf-maintain.md +8 -0
- package/templates/hosts/cline/workflows/wf-new-task.md +8 -0
- package/templates/hosts/cline/workflows/wf-pipeline-run.md +8 -0
- package/templates/hosts/cline/workflows/wf-pr-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-stages.md +8 -0
- package/templates/hosts/codebuddy/CODEBUDDY.md +7 -0
- package/templates/hosts/codebuddy/agents/implementer.md +9 -0
- package/templates/hosts/codebuddy/agents/independent-reviewer.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-finder.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-verifier.md +10 -0
- package/templates/hosts/codebuddy/agents/ui-verifier.md +11 -0
- package/templates/hosts/codebuddy/agents/wiki-compiler.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-deploy.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-maintain.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-new-task.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pr-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-stages.md +10 -0
- package/templates/hosts/codebuddy/rules/backend-scope.md +5 -0
- package/templates/hosts/codebuddy/rules/frontend-scope.md +5 -0
- package/templates/hosts/codebuddy/settings.json +31 -0
- package/templates/hosts/codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/templates/hosts/commandcode/agents/implementer.md +10 -0
- package/templates/hosts/commandcode/agents/independent-reviewer.md +9 -0
- package/templates/hosts/commandcode/agents/pr-adjudicator.md +9 -0
- package/templates/hosts/commandcode/agents/pr-finder.md +9 -0
- package/templates/hosts/commandcode/agents/pr-verifier.md +9 -0
- package/templates/hosts/commandcode/agents/ui-verifier.md +11 -0
- package/templates/hosts/commandcode/agents/wiki-compiler.md +10 -0
- package/templates/hosts/commandcode/commands/wf-deploy.md +9 -0
- package/templates/hosts/commandcode/commands/wf-maintain.md +9 -0
- package/templates/hosts/commandcode/commands/wf-new-task.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pr-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-stages.md +9 -0
- package/templates/hosts/commandcode/settings.json +59 -0
- package/templates/hosts/opencode/agents/implementer.md +51 -0
- package/templates/hosts/opencode/agents/independent-reviewer.md +18 -0
- package/templates/hosts/opencode/agents/pr-adjudicator.md +18 -0
- package/templates/hosts/opencode/agents/pr-finder.md +18 -0
- package/templates/hosts/opencode/agents/pr-verifier.md +18 -0
- package/templates/hosts/opencode/agents/ui-verifier.md +45 -0
- package/templates/hosts/opencode/agents/wiki-compiler.md +51 -0
- package/templates/hosts/opencode/commands/wf-deploy.md +7 -0
- package/templates/hosts/opencode/commands/wf-maintain.md +7 -0
- package/templates/hosts/opencode/commands/wf-new-task.md +7 -0
- package/templates/hosts/opencode/commands/wf-pipeline-run.md +7 -0
- package/templates/hosts/opencode/commands/wf-pr-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-stages.md +7 -0
- package/templates/hosts/pi/agents/implementer.md +10 -0
- package/templates/hosts/pi/agents/independent-reviewer.md +11 -0
- package/templates/hosts/pi/agents/pr-adjudicator.md +11 -0
- package/templates/hosts/pi/agents/pr-finder.md +10 -0
- package/templates/hosts/pi/agents/pr-verifier.md +10 -0
- package/templates/hosts/pi/agents/ui-verifier.md +10 -0
- package/templates/hosts/pi/agents/wiki-compiler.md +10 -0
- package/templates/hosts/pi/extensions/lib/gates-core.cjs +196 -0
- package/templates/hosts/pi/extensions/shipyard-gates.ts +95 -0
- package/templates/hosts/pi/settings.json +5 -0
- package/templates/hosts/qoder/agents/implementer.md +9 -0
- package/templates/hosts/qoder/agents/independent-reviewer.md +10 -0
- package/templates/hosts/qoder/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/qoder/agents/pr-finder.md +10 -0
- package/templates/hosts/qoder/agents/pr-verifier.md +10 -0
- package/templates/hosts/qoder/agents/ui-verifier.md +10 -0
- package/templates/hosts/qoder/agents/wiki-compiler.md +10 -0
- package/templates/hosts/qoder/commands/wf-deploy.md +8 -0
- package/templates/hosts/qoder/commands/wf-maintain.md +8 -0
- package/templates/hosts/qoder/commands/wf-new-task.md +8 -0
- package/templates/hosts/qoder/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/qoder/commands/wf-pr-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-stages.md +8 -0
- package/templates/hosts/qoder/settings.json +63 -0
- package/templates/hosts/qwen/agents/implementer.md +8 -0
- package/templates/hosts/qwen/agents/independent-reviewer.md +8 -0
- package/templates/hosts/qwen/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/qwen/agents/pr-finder.md +8 -0
- package/templates/hosts/qwen/agents/pr-verifier.md +8 -0
- package/templates/hosts/qwen/agents/ui-verifier.md +8 -0
- package/templates/hosts/qwen/agents/wiki-compiler.md +11 -0
- package/templates/hosts/qwen/commands/wf-deploy.md +9 -0
- package/templates/hosts/qwen/commands/wf-maintain.md +9 -0
- package/templates/hosts/qwen/commands/wf-new-task.md +9 -0
- package/templates/hosts/qwen/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/qwen/commands/wf-pr-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-stages.md +9 -0
- package/templates/hosts/qwen/settings.json +59 -0
- package/templates/hosts/trae/agents/implementer.md +9 -0
- package/templates/hosts/trae/agents/independent-reviewer.md +10 -0
- package/templates/hosts/trae/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/trae/agents/pr-finder.md +10 -0
- package/templates/hosts/trae/agents/pr-verifier.md +10 -0
- package/templates/hosts/trae/agents/ui-verifier.md +10 -0
- package/templates/hosts/trae/agents/wiki-compiler.md +10 -0
- package/templates/hosts/trae/commands/wf-deploy.md +8 -0
- package/templates/hosts/trae/commands/wf-maintain.md +8 -0
- package/templates/hosts/trae/commands/wf-new-task.md +8 -0
- package/templates/hosts/trae/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/trae/commands/wf-pr-review.md +8 -0
- package/templates/hosts/trae/commands/wf-review.md +8 -0
- package/templates/hosts/trae/commands/wf-stages.md +8 -0
- package/templates/hosts/trae/hooks.json +17 -0
- package/templates/hosts/trae/rules/backend-scope.md +5 -0
- package/templates/hosts/trae/rules/frontend-scope.md +5 -0
- package/templates/hosts/zcode/agents/implementer.md +8 -0
- package/templates/hosts/zcode/agents/independent-reviewer.md +8 -0
- package/templates/hosts/zcode/agents/ui-verifier.md +8 -0
- package/templates/hosts/zcode/agents/wiki-compiler.md +8 -0
- package/templates/hosts/zcode/config.json +31 -0
- package/templates/hosts/zcode/workflows/code-review.dwf.ts +428 -0
- package/templates/hosts/zcode/workflows/fullchain-flow-test.dwf.ts +898 -0
- package/templates/profiles/dotnet/.agents/config/lane-surfaces.txt +33 -0
- package/templates/profiles/dotnet/.agents/config/rule-budgets.txt +84 -0
- package/templates/profiles/dotnet/.agents/config/test-impact-map.json +590 -0
- package/templates/profiles/dotnet/.agents/config/workflow-modules.txt +18 -0
- package/templates/profiles/dotnet/.agents/hooks/commit-check.config.json +18 -0
- package/templates/profiles/dotnet/.agents/hooks/delete-guard-allowlist.txt +28 -0
- package/templates/profiles/dotnet/.agents/notes/runtime-env.md +178 -0
- package/templates/profiles/dotnet/AGENTS.md +52 -0
- package/templates/profiles/empty/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/empty/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/empty/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/empty/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/empty/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/empty/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/empty/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/empty/AGENTS.md +52 -0
- package/templates/profiles/node/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/node/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/node/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/node/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/node/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/node/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/node/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/node/AGENTS.md +52 -0
- package/templates/scaffold/wiki/INDEX.md +33 -0
- package/templates/scaffold/wiki/drafts-archive/README.md +7 -0
- package/templates/scaffold/wiki//344/272/247/345/223/201/351/234/200/346/261/202/.gitkeep +0 -0
- package/templates/scaffold/wiki//345/274/200/345/217/221/346/226/271/346/241/210/.gitkeep +0 -0
- package/templates/scaffold/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/templates/scaffold/wiki//346/265/213/350/257/225/346/212/245/345/221/212/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/224/250/346/210/267/345/212/237/350/203/275/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/templates/scaffold/wiki//351/241/271/347/233/256/350/247/204/350/214/203/.gitkeep +0 -0
- package/templates/scaffold/workflow/INDEX.md +13 -0
- package/templates/scaffold/workflow/README.md +67 -0
- package/templates/scaffold/workflow/archive/README.md +3 -0
- package/templates/scaffold/workflow/delegations.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/delegations.md +4 -0
- package/templates/scaffold/workflow/effective-policy.md +4 -0
- package/templates/scaffold/workflow/evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/gate-cost.md +4 -0
- package/templates/scaffold/workflow/gate-metrics.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/incidents/_TEMPLATE.md +49 -0
- package/templates/scaffold/workflow/intents/_TEMPLATE.md +43 -0
- package/templates/scaffold/workflow/metrics.md +4 -0
- package/templates/scaffold/workflow/papercuts.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/papercuts.md +3 -0
- package/templates/scaffold/workflow/plans/_TEMPLATE.md +47 -0
- package/templates/scaffold/workflow/regression-checklist.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/regression-checklist.md +3 -0
- package/templates/scaffold/workflow/research/.gitkeep +0 -0
- package/templates/scaffold/workflow/reviews.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/specs/_TEMPLATE.md +87 -0
- package/templates/scaffold/workflow/verify-evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/verify-evidence.md +4 -0
- package/LICENSE +0 -21
- package/modules/gates/README.md +0 -25
- package/modules/gates/dotnet-ca/README.md +0 -24
- package/modules/gates/dotnet-ca/check-architecture.sh +0 -150
- package/modules/gates/dotnet-ca/local-pre-commit.line +0 -1
- package/modules/gates/generated-readonly/README.md +0 -13
- package/modules/gates/generated-readonly/check-generated.mjs +0 -61
- package/modules/gates/generated-readonly/local-pre-commit.line +0 -1
- package/modules/gates/node-layer/README.md +0 -9
- package/modules/gates/node-layer/check-node-layer.mjs +0 -29
- package/modules/gates/node-layer/local-pre-commit.line +0 -1
- package/modules/gates/py-import/README.md +0 -9
- package/modules/gates/py-import/check-py-import.mjs +0 -30
- package/modules/gates/py-import/local-pre-commit.line +0 -1
- package/modules/gates/test-protect/README.md +0 -23
- package/modules/gates/test-protect/check-test-protect.mjs +0 -64
- package/modules/gates/test-protect/local-pre-commit.line +0 -1
- package/modules/hosts/README.md +0 -57
- package/modules/hosts/claude/agents/implementer.md +0 -51
- package/modules/hosts/claude/agents/independent-reviewer.md +0 -49
- package/modules/hosts/claude/agents/ui-verifier.md +0 -48
- package/modules/hosts/claude/commands/wf-build.md +0 -69
- package/modules/hosts/claude/commands/wf-deploy.md +0 -58
- package/modules/hosts/claude/commands/wf-design.md +0 -49
- package/modules/hosts/claude/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/claude/commands/wf-maintain.md +0 -76
- package/modules/hosts/claude/commands/wf-new-task.md +0 -102
- package/modules/hosts/claude/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/claude/commands/wf-plan.md +0 -40
- package/modules/hosts/claude/commands/wf-review.md +0 -49
- package/modules/hosts/claude/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/claude/commands/wf-test.md +0 -68
- package/modules/hosts/codex/agents/implementer.md +0 -51
- package/modules/hosts/codex/agents/independent-reviewer.md +0 -49
- package/modules/hosts/codex/agents/ui-verifier.md +0 -48
- package/modules/hosts/codex/commands/wf-build.md +0 -69
- package/modules/hosts/codex/commands/wf-deploy.md +0 -58
- package/modules/hosts/codex/commands/wf-design.md +0 -49
- package/modules/hosts/codex/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/codex/commands/wf-maintain.md +0 -76
- package/modules/hosts/codex/commands/wf-new-task.md +0 -102
- package/modules/hosts/codex/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/codex/commands/wf-plan.md +0 -40
- package/modules/hosts/codex/commands/wf-review.md +0 -49
- package/modules/hosts/codex/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/codex/commands/wf-test.md +0 -68
- package/modules/hosts/codex/skills/flow-kit/SKILL.md +0 -14
- package/modules/hosts/cursor/agents/implementer.md +0 -51
- package/modules/hosts/cursor/agents/independent-reviewer.md +0 -49
- package/modules/hosts/cursor/agents/ui-verifier.md +0 -48
- package/modules/hosts/cursor/commands/wf-build.md +0 -69
- package/modules/hosts/cursor/commands/wf-deploy.md +0 -58
- package/modules/hosts/cursor/commands/wf-design.md +0 -49
- package/modules/hosts/cursor/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/cursor/commands/wf-maintain.md +0 -76
- package/modules/hosts/cursor/commands/wf-new-task.md +0 -102
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/cursor/commands/wf-plan.md +0 -40
- package/modules/hosts/cursor/commands/wf-review.md +0 -49
- package/modules/hosts/cursor/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/cursor/commands/wf-test.md +0 -68
- package/modules/hosts/omp/agents/implementer.md +0 -52
- package/modules/hosts/omp/agents/independent-reviewer.md +0 -50
- package/modules/hosts/omp/agents/ui-verifier.md +0 -49
- package/modules/hosts/opencode/agents/implementer.md +0 -59
- package/modules/hosts/opencode/agents/independent-reviewer.md +0 -53
- package/modules/hosts/opencode/agents/ui-verifier.md +0 -52
- package/modules/hosts/opencode/commands/wf-build.md +0 -69
- package/modules/hosts/opencode/commands/wf-deploy.md +0 -58
- package/modules/hosts/opencode/commands/wf-design.md +0 -49
- package/modules/hosts/opencode/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/opencode/commands/wf-maintain.md +0 -76
- package/modules/hosts/opencode/commands/wf-new-task.md +0 -102
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/opencode/commands/wf-plan.md +0 -40
- package/modules/hosts/opencode/commands/wf-review.md +0 -49
- package/modules/hosts/opencode/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/opencode/commands/wf-test.md +0 -68
- package/modules/hosts/trae/agents/implementer.md +0 -52
- package/modules/hosts/trae/agents/independent-reviewer.md +0 -51
- package/modules/hosts/trae/agents/ui-verifier.md +0 -50
- package/modules/hosts/trae/commands/wf-build.md +0 -70
- package/modules/hosts/trae/commands/wf-deploy.md +0 -59
- package/modules/hosts/trae/commands/wf-design.md +0 -50
- package/modules/hosts/trae/commands/wf-gate-checklist.md +0 -78
- package/modules/hosts/trae/commands/wf-maintain.md +0 -77
- package/modules/hosts/trae/commands/wf-new-task.md +0 -103
- package/modules/hosts/trae/commands/wf-pipeline-run.md +0 -36
- package/modules/hosts/trae/commands/wf-plan.md +0 -41
- package/modules/hosts/trae/commands/wf-review.md +0 -50
- package/modules/hosts/trae/commands/wf-sync-hosts.md +0 -65
- package/modules/hosts/trae/commands/wf-test.md +0 -69
- package/modules/hosts/trae/hooks/post-edit-check.cjs +0 -98
- package/modules/hosts/trae/hooks/pre-shell-check.cjs +0 -192
- package/modules/hosts/trae/hooks/resolve-shell.cjs +0 -30
- package/modules/hosts/trae/hooks.json +0 -29
- package/modules/hosts/trae/rules/beautify-input-chinese.md +0 -6
- package/modules/hosts/trae/rules/git-commit-message.md +0 -10
- package/modules/hosts/trae/rules/project-workflow.md +0 -14
- package/modules/hosts/zcode/agents/implementer.md +0 -51
- package/modules/hosts/zcode/agents/independent-reviewer.md +0 -49
- package/modules/hosts/zcode/agents/ui-verifier.md +0 -48
- package/src/add-gate.mjs +0 -116
- package/src/add-gate.test.mjs +0 -103
- package/src/add-host.mjs +0 -68
- package/src/cli.mjs +0 -169
- package/src/doctor.mjs +0 -629
- package/src/executor.mjs +0 -262
- package/src/executor.test.mjs +0 -295
- package/src/fresh-init.test.mjs +0 -64
- package/src/gate-dotnet-ca.test.mjs +0 -124
- package/src/gates.test.mjs +0 -143
- package/src/init.mjs +0 -382
- package/src/init.test.mjs +0 -163
- package/src/instance-ref.test.mjs +0 -62
- package/src/jscpd-drift.test.mjs +0 -145
- package/src/pack.test.mjs +0 -24
- package/src/profiles.mjs +0 -183
- package/src/render.mjs +0 -132
- package/src/rule-budget.test.mjs +0 -103
- package/src/run-tests.mjs +0 -56
- package/src/stack-profile.test.mjs +0 -95
- package/src/sync-hosts.mjs +0 -257
- package/src/sync-hosts.test.mjs +0 -291
- package/src/sync.mjs +0 -228
- package/src/sync.test.mjs +0 -452
- package/src/trae-hooks.test.mjs +0 -127
- package/src/validate.mjs +0 -77
- package/src/validate.test.mjs +0 -95
- package/templates/.gitattributes +0 -17
- package/templates/AGENTS.md +0 -58
- package/templates/_agents/board/index.html +0 -676
- package/templates/_agents/commands/build.md +0 -84
- package/templates/_agents/commands/deploy.md +0 -66
- package/templates/_agents/commands/design.md +0 -63
- package/templates/_agents/commands/gate-checklist.md +0 -91
- package/templates/_agents/commands/maintain.md +0 -90
- package/templates/_agents/commands/new-task.md +0 -110
- package/templates/_agents/commands/pipeline-run.md +0 -43
- package/templates/_agents/commands/plan.md +0 -48
- package/templates/_agents/commands/review.md +0 -62
- package/templates/_agents/commands/sync-hosts.md +0 -77
- package/templates/_agents/commands/test.md +0 -87
- package/templates/_agents/control-surfaces.txt +0 -53
- package/templates/_agents/engine-lock.json +0 -342
- package/templates/_agents/hooks/check-index-incremental.mjs +0 -48
- package/templates/_agents/hooks/check-pairing-incremental.mjs +0 -66
- package/templates/_agents/hooks/check-wiki-ledger.mjs +0 -30
- package/templates/_agents/hooks/commit-check.cjs +0 -193
- package/templates/_agents/hooks/local-pre-commit +0 -6
- package/templates/_agents/lane-surfaces.txt +0 -17
- package/templates/_agents/level-hints.txt +0 -30
- package/templates/_agents/loop/papercut-debt/DESIGN.md +0 -112
- package/templates/_agents/mechanism-registry.md +0 -35
- package/templates/_agents/metric-claims.txt +0 -81
- package/templates/_agents/notes/engine-internals.md +0 -17
- package/templates/_agents/notes/runtime-env.md +0 -18
- package/templates/_agents/roles/implementer.md +0 -47
- package/templates/_agents/roles/independent-reviewer.md +0 -45
- package/templates/_agents/roles/ui-verifier.md +0 -44
- package/templates/_agents/rule-budgets.txt +0 -20
- package/templates/_agents/scripts/agg-delegations.cjs +0 -302
- package/templates/_agents/scripts/agg-delegations.test.mjs +0 -282
- package/templates/_agents/scripts/agg-gate-stats.mjs +0 -113
- package/templates/_agents/scripts/agg-gate-stats.test.mjs +0 -95
- package/templates/_agents/scripts/agg-judgments.mjs +0 -156
- package/templates/_agents/scripts/agg-judgments.test.mjs +0 -93
- package/templates/_agents/scripts/archive-sweep.mjs +0 -235
- package/templates/_agents/scripts/archive-sweep.test.mjs +0 -129
- package/templates/_agents/scripts/check-attribution.mjs +0 -37
- package/templates/_agents/scripts/check-convergence.mjs +0 -124
- package/templates/_agents/scripts/check-engine-integrity.mjs +0 -220
- package/templates/_agents/scripts/check-engine-integrity.test.mjs +0 -215
- package/templates/_agents/scripts/check-funnel.mjs +0 -56
- package/templates/_agents/scripts/check-hygiene.mjs +0 -167
- package/templates/_agents/scripts/check-hygiene.test.mjs +0 -182
- package/templates/_agents/scripts/check-index-incremental.test.mjs +0 -73
- package/templates/_agents/scripts/check-lane-surface.mjs +0 -238
- package/templates/_agents/scripts/check-lane-surface.test.mjs +0 -302
- package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -586
- package/templates/_agents/scripts/check-ledger-invariant.test.mjs +0 -639
- package/templates/_agents/scripts/check-loop-rev.test.mjs +0 -336
- package/templates/_agents/scripts/check-loop-unit.test.mjs +0 -103
- package/templates/_agents/scripts/check-loop.mjs +0 -1987
- package/templates/_agents/scripts/check-loop.sh +0 -6
- package/templates/_agents/scripts/check-loop.test.mjs +0 -3912
- package/templates/_agents/scripts/check-metric-claims.mjs +0 -277
- package/templates/_agents/scripts/check-prejudgment.mjs +0 -64
- package/templates/_agents/scripts/check-registry.mjs +0 -45
- package/templates/_agents/scripts/check-scope.mjs +0 -96
- package/templates/_agents/scripts/check-scope.test.mjs +0 -99
- package/templates/_agents/scripts/check-scripts-syntax.mjs +0 -84
- package/templates/_agents/scripts/check-scripts-syntax.test.mjs +0 -72
- package/templates/_agents/scripts/check-spec-verif.mjs +0 -47
- package/templates/_agents/scripts/check-stage-index.mjs +0 -40
- package/templates/_agents/scripts/check-stage-index.test.mjs +0 -77
- package/templates/_agents/scripts/closeout-l1.mjs +0 -217
- package/templates/_agents/scripts/closeout-l1.test.mjs +0 -105
- package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -205
- package/templates/_agents/scripts/compact-ledgers.mjs +0 -97
- package/templates/_agents/scripts/compact-ledgers.test.mjs +0 -162
- package/templates/_agents/scripts/confirm-doc.mjs +0 -610
- package/templates/_agents/scripts/confirm-doc.test.mjs +0 -1119
- package/templates/_agents/scripts/doctor.test.mjs +0 -770
- package/templates/_agents/scripts/draft-sediment.mjs +0 -178
- package/templates/_agents/scripts/draft-sediment.test.mjs +0 -272
- package/templates/_agents/scripts/edit-face-check.mjs +0 -109
- package/templates/_agents/scripts/edit-face-check.test.mjs +0 -99
- package/templates/_agents/scripts/ensure-board.mjs +0 -185
- package/templates/_agents/scripts/fill-intent.mjs +0 -91
- package/templates/_agents/scripts/fill-intent.test.mjs +0 -113
- package/templates/_agents/scripts/fill-plan.mjs +0 -79
- package/templates/_agents/scripts/fill-plan.test.mjs +0 -224
- package/templates/_agents/scripts/fill-spec.mjs +0 -70
- package/templates/_agents/scripts/fill-spec.test.mjs +0 -266
- package/templates/_agents/scripts/fixture-scripts.mjs +0 -153
- package/templates/_agents/scripts/fixture-scripts.test.mjs +0 -112
- package/templates/_agents/scripts/gate-checklist.mjs +0 -209
- package/templates/_agents/scripts/gate-checklist.test.mjs +0 -201
- package/templates/_agents/scripts/gate-seg.mjs +0 -54
- package/templates/_agents/scripts/gate-seg.test.mjs +0 -112
- package/templates/_agents/scripts/gen-effective-policy.mjs +0 -107
- package/templates/_agents/scripts/gen-effective-policy.test.mjs +0 -100
- package/templates/_agents/scripts/gen-verify-evidence.mjs +0 -107
- package/templates/_agents/scripts/gen-verify-evidence.test.mjs +0 -84
- package/templates/_agents/scripts/gen-wiki-board.mjs +0 -276
- package/templates/_agents/scripts/gen-wiki-board.test.mjs +0 -249
- package/templates/_agents/scripts/gen-workflow-dashboard.mjs +0 -251
- package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +0 -188
- package/templates/_agents/scripts/gen-workflow-index.mjs +0 -201
- package/templates/_agents/scripts/gen-workflow-index.test.mjs +0 -152
- package/templates/_agents/scripts/gen-workflow-metrics.mjs +0 -466
- package/templates/_agents/scripts/gen-workflow-metrics.test.mjs +0 -343
- package/templates/_agents/scripts/git-merge-jsonl.mjs +0 -63
- package/templates/_agents/scripts/git-merge-jsonl.test.mjs +0 -125
- package/templates/_agents/scripts/judgment-ledger.mjs +0 -65
- package/templates/_agents/scripts/judgment-ledger.test.mjs +0 -129
- package/templates/_agents/scripts/kb-cache-evict.mjs +0 -50
- package/templates/_agents/scripts/kb-cache-evict.test.mjs +0 -104
- package/templates/_agents/scripts/kb-search.mjs +0 -413
- package/templates/_agents/scripts/kb-search.test.mjs +0 -299
- package/templates/_agents/scripts/lane-surface-audit.mjs +0 -143
- package/templates/_agents/scripts/lane-surface-audit.test.mjs +0 -93
- package/templates/_agents/scripts/ledger-doc-chain.test.mjs +0 -166
- package/templates/_agents/scripts/ledger-loader.mjs +0 -108
- package/templates/_agents/scripts/ledger-loader.test.mjs +0 -131
- package/templates/_agents/scripts/ledger-prune.mjs +0 -96
- package/templates/_agents/scripts/ledger-prune.test.mjs +0 -120
- package/templates/_agents/scripts/ledger-shards.mjs +0 -344
- package/templates/_agents/scripts/ledger-shards.test.mjs +0 -356
- package/templates/_agents/scripts/ledger-ts-monotonic.test.mjs +0 -135
- package/templates/_agents/scripts/level-criteria.mjs +0 -231
- package/templates/_agents/scripts/level-criteria.test.mjs +0 -281
- package/templates/_agents/scripts/mechanism-retire-watch.mjs +0 -183
- package/templates/_agents/scripts/mechanism-retire-watch.test.mjs +0 -114
- package/templates/_agents/scripts/papercut-debt-controller.mjs +0 -141
- package/templates/_agents/scripts/papercut-debt-controller.test.mjs +0 -127
- package/templates/_agents/scripts/papercut-debt-sensor.mjs +0 -170
- package/templates/_agents/scripts/papercut-debt-sensor.test.mjs +0 -146
- package/templates/_agents/scripts/pipeline-run-docs.mjs +0 -76
- package/templates/_agents/scripts/pipeline-run-run.mjs +0 -63
- package/templates/_agents/scripts/pipeline-run.mjs +0 -867
- package/templates/_agents/scripts/pipeline-run.test.mjs +0 -517
- package/templates/_agents/scripts/policy.mjs +0 -281
- package/templates/_agents/scripts/pre-push.test.mjs +0 -105
- package/templates/_agents/scripts/resolve-merge-conflicts.mjs +0 -110
- package/templates/_agents/scripts/resolve-merge-conflicts.test.mjs +0 -87
- package/templates/_agents/scripts/rewrite-file.mjs +0 -133
- package/templates/_agents/scripts/rewrite-file.test.mjs +0 -148
- package/templates/_agents/scripts/rule-budget.mjs +0 -96
- package/templates/_agents/scripts/rule-budget.test.mjs +0 -118
- package/templates/_agents/scripts/run-tests.mjs +0 -99
- package/templates/_agents/scripts/run-tests.test.mjs +0 -105
- package/templates/_agents/scripts/solidify-task.mjs +0 -109
- package/templates/_agents/scripts/solidify-task.test.mjs +0 -129
- package/templates/_agents/scripts/stage-gates.mjs +0 -343
- package/templates/_agents/scripts/stage-gates.test.mjs +0 -105
- package/templates/_agents/scripts/trust-mode.mjs +0 -67
- package/templates/_agents/scripts/trust-mode.test.mjs +0 -110
- package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -253
- package/templates/_agents/scripts/verify-wiki-consistency.test.mjs +0 -123
- package/templates/_agents/scripts/verify.mjs +0 -345
- package/templates/_agents/scripts/verify.test.mjs +0 -373
- package/templates/_agents/scripts/wf-journal.mjs +0 -231
- package/templates/_agents/scripts/wf-journal.test.mjs +0 -216
- package/templates/_agents/scripts/wiki-search.mjs +0 -19
- package/templates/_agents/scripts/wiki-search.test.mjs +0 -57
- package/templates/_agents/scripts/workflow-board-server.mjs +0 -393
- package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -201
- package/templates/_agents/scripts/workflow-enums.mjs +0 -70
- package/templates/_agents/scripts/workflow-enums.test.mjs +0 -118
- package/templates/_agents/scripts/workflows-check.mjs +0 -260
- package/templates/_agents/scripts/workflows-check.test.mjs +0 -278
- package/templates/_agents/scripts-test-exempt.txt +0 -16
- package/templates/_agents/skills/papercut-fix/SKILL.md +0 -60
- package/templates/_agents/skills/papercut-fix/references/response-template.md +0 -81
- package/templates/_agents/skills/review-method/SKILL.md +0 -58
- package/templates/_agents/skills/verify-ui/SKILL.md +0 -61
- package/templates/_agents/skills/wiki/SKILL.md +0 -106
- package/templates/_agents/workflow-enums.txt +0 -26
- package/templates/_agents/workflow-modules.txt +0 -11
- package/templates/_agents/workflows/_TEMPLATE.md +0 -75
- package/templates/_agents/workflows/pipeline-closing.md +0 -28
- package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +0 -16
- package/templates/_githooks/commit-msg +0 -17
- package/templates/_githooks/post-commit +0 -10
- package/templates/_githooks/pre-commit +0 -126
- package/templates/_githooks/pre-merge-commit +0 -29
- package/templates/_githooks/pre-push +0 -136
- package/templates/_github/workflows/kit-ci.yml +0 -49
- package/templates/wiki/INDEX.md +0 -73
- package/templates/wiki/drafts-archive/README.md +0 -3
- package/templates/wiki//344/272/247/345/223/201/351/234/200/346/261/202/README.md +0 -3
- package/templates/wiki//345/274/200/345/217/221/346/226/271/346/241/210/README.md +0 -3
- package/templates/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +0 -3
- package/templates/wiki//346/265/213/350/257/225/346/212/245/345/221/212/README.md +0 -3
- package/templates/wiki//347/224/250/346/210/267/345/212/237/350/203/275/README.md +0 -3
- package/templates/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +0 -77
- package/templates/wiki//351/241/271/347/233/256/350/247/204/350/214/203/README.md +0 -3
- package/templates/wiki//351/241/271/347/233/256/350/256/241/345/210/222/README.md +0 -3
- package/templates/workflow/README.md +0 -91
- package/templates/workflow/delegations.md +0 -29
- package/templates/workflow/incidents/_TEMPLATE.md +0 -51
- package/templates/workflow/intents/_TEMPLATE.md +0 -51
- package/templates/workflow/papercuts.md +0 -9
- package/templates/workflow/plans/_TEMPLATE.md +0 -47
- package/templates/workflow/regression-checklist.md +0 -23
- package/templates/workflow/specs/_TEMPLATE.md +0 -80
- /package/templates/{_agents → engine/.agents}/board/marked.min.js +0 -0
- /package/templates/{_agents/workflows → engine/.agents/pipelines}/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md" +0 -0
- /package/templates/{_agents → engine/.agents}/scripts/git-core.mjs +0 -0
package/src/render.mjs
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// 模板树渲染:目录名前缀 _ 映射为点目录(_agents→.agents);文本文件做 {{KEY}} 占位符替换
|
|
2
|
-
// 返回写入清单(rel + sha256),供 kit.json managed 台账与 doctor 校验
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import crypto from 'node:crypto';
|
|
6
|
-
|
|
7
|
-
const PH_RE = /\{\{([A-Z][A-Z0-9_]*)\}\}/g;
|
|
8
|
-
|
|
9
|
-
function sha256(buf) {
|
|
10
|
-
return crypto.createHash('sha256').update(buf).digest('hex');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// relOf:模板内相对路径 → 目标相对路径(仅顶层 _ 前缀目录转点目录)
|
|
14
|
-
function relOf(absFile, srcRoot) {
|
|
15
|
-
const parts = path.relative(srcRoot, absFile).split(path.sep);
|
|
16
|
-
if (parts.length > 1 && parts[0].startsWith('_')) parts[0] = '.' + parts[0].slice(1);
|
|
17
|
-
return parts.join('/');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// renderContent:单文件文本渲染({{KEY}} 替换,未知占位符原样保留)——renderTree 与 init 的 AGENTS.md 追加补齐共用
|
|
21
|
-
export function renderContent(text, vars) {
|
|
22
|
-
return String(text || '').replace(PH_RE, (m, key) => (Object.prototype.hasOwnProperty.call(vars, key) ? vars[key] : m));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// renderTree:模板树渲染。opts.protectOwned=true 时(init --force 路径,2026-09-27 p2-batch1),
|
|
26
|
-
// rel 命中 protectSet 且目标已存在 → 跳过覆盖并计入 protected 清单(owned「永不触碰」两态模型
|
|
27
|
-
// 在 --force 路径的对齐;此前 force 覆盖一切同名文件曾实测静默丢用户自定义内容)
|
|
28
|
-
export function renderTree(srcRoot, targetRoot, vars, { force = false, protectSet = null } = {}) {
|
|
29
|
-
const written = []; // { rel, sha256 }
|
|
30
|
-
const skipped = []; // rel(已存在,保守跳过)
|
|
31
|
-
const protectedSkipped = []; // rel(--force 下 owned 保护跳过)
|
|
32
|
-
const warnings = []; // 未知占位符等
|
|
33
|
-
const dirs = [];
|
|
34
|
-
|
|
35
|
-
(function walk(dir) {
|
|
36
|
-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
37
|
-
const abs = path.join(dir, entry.name);
|
|
38
|
-
if (entry.isDirectory()) {
|
|
39
|
-
// 运行时缓存不是模板(包源跑测试会在 templates/_agents/cache/ 落盘残留)——init/sync 一律跳过
|
|
40
|
-
if (relOf(abs, srcRoot) === '.agents/cache') continue;
|
|
41
|
-
dirs.push(relOf(abs, srcRoot));
|
|
42
|
-
walk(abs);
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const rel = relOf(abs, srcRoot);
|
|
46
|
-
// 引擎基线不是模板:键在 templates/_agents/…,下发成 .agents/engine-lock.json 会让装户
|
|
47
|
-
// 拿包源路径对账。排除该落点,包源基线留在模板目录。
|
|
48
|
-
if (rel === '.agents/engine-lock.json') continue;
|
|
49
|
-
const target = path.join(targetRoot, rel);
|
|
50
|
-
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
51
|
-
if (fs.existsSync(target) && !force) {
|
|
52
|
-
skipped.push(rel);
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (protectSet && protectSet.has(rel) && fs.existsSync(target)) {
|
|
56
|
-
protectedSkipped.push(rel);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
const raw = fs.readFileSync(abs);
|
|
60
|
-
let out = raw;
|
|
61
|
-
if (raw.length < 512 * 1024 && !raw.includes(0)) {
|
|
62
|
-
// 文本面 LF 归一(2026-09-27 closing-coverage):模板盘面 CRLF(autocrlf 检出 / 编辑器写入)与
|
|
63
|
-
// LF 克隆渲染出同一字节、同一 sha——fresh sha、装户落盘、kit.json 台账三方跨环境稳定;
|
|
64
|
-
// sync/doctor 的读取侧归一(shaText)与本处写盘归一同口径闭合
|
|
65
|
-
const replaced = renderContent(raw.toString('utf8').replace(/\r\n/g, '\n'), vars);
|
|
66
|
-
if (replaced.includes('{{')) {
|
|
67
|
-
for (const m of replaced.matchAll(/\{\{([A-Z][A-Z0-9_]*)\}\}/g)) {
|
|
68
|
-
if (!Object.prototype.hasOwnProperty.call(vars, m[1])) warnings.push(`${rel}: 未知占位符 {{${m[1]}}}(原样保留)`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
out = Buffer.from(replaced, 'utf8');
|
|
72
|
-
}
|
|
73
|
-
fs.writeFileSync(target, out, { mode: rel.startsWith('.githooks/') ? 0o755 : 0o644 }); // 钩子带执行位(init-p1-batch P1-1:POSIX 装户 git 对不可执行钩子静默跳过)
|
|
74
|
-
written.push({ rel: rel.split(path.sep).join('/'), sha256: sha256(out) });
|
|
75
|
-
}
|
|
76
|
-
})(srcRoot);
|
|
77
|
-
|
|
78
|
-
return { written, skipped, protectedSkipped, warnings, dirs };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// renderPkgText:目标侧脚本执行防线的比对基准(2026-09-27 init-p1-batch P1-3)——读包源模板
|
|
82
|
-
// (templates/_agents/<rel 去掉 .agents/ 前缀>)→ LF 归一 → {{VAR}} 渲染(脚本面无占位符时即原文)。
|
|
83
|
-
// 返回 null = 包源无该模板或非文本面(无从校验,调用方按不可信处理)。
|
|
84
|
-
export function renderPkgText(pkgRoot, rel, vars) {
|
|
85
|
-
if (!rel.startsWith('.agents/')) return null;
|
|
86
|
-
const tmpl = path.join(pkgRoot, 'templates', '_agents', rel.slice('.agents/'.length));
|
|
87
|
-
try {
|
|
88
|
-
const raw = fs.readFileSync(tmpl);
|
|
89
|
-
if (raw.length >= 512 * 1024 || raw.includes(0)) return null;
|
|
90
|
-
return renderContent(raw.toString('utf8').replace(/\r\n/g, '\n'), vars);
|
|
91
|
-
} catch {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// scriptTrusted:目标侧脚本是否与包源渲染值一致(LF 归一双侧 sha 比对,与 closing-coverage 六处口径同族)。
|
|
97
|
-
// 返回 {ok, note}——ok=false 时 note 给出原因(预置/被改动/包源无模板/不可读),调用方跳过执行并显式提示。
|
|
98
|
-
export function scriptTrusted({ pkgRoot, target, rel, vars }) {
|
|
99
|
-
const expected = renderPkgText(pkgRoot, rel, vars);
|
|
100
|
-
if (expected === null) return { ok: false, note: `包源无 ${rel} 模板,无法校验` };
|
|
101
|
-
const expSha = sha256(Buffer.from(expected, 'utf8'));
|
|
102
|
-
let actual;
|
|
103
|
-
try {
|
|
104
|
-
actual = fs.readFileSync(path.join(target, rel), 'utf8').replace(/\r\n/g, '\n');
|
|
105
|
-
} catch {
|
|
106
|
-
return { ok: false, note: `${rel} 不可读` };
|
|
107
|
-
}
|
|
108
|
-
if (sha256(Buffer.from(actual, 'utf8')) === expSha) return { ok: true, note: '' };
|
|
109
|
-
return { ok: false, note: `目标侧 ${rel} 与包源渲染值不符(预置或被改动)` };
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// listTree(srcRoot):只枚举模板树的目标相对路径(rel),不落盘、不算 sha——供 doctor 台账覆盖率检查复用。
|
|
113
|
-
// 与 renderTree 完全同一套 relOf 映射(顶层 _ 前缀目录转点目录)与 .agents/cache 排除,避免两处映射漂移。
|
|
114
|
-
export function listTree(srcRoot) {
|
|
115
|
-
const out = [];
|
|
116
|
-
(function walk(dir) {
|
|
117
|
-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
118
|
-
const abs = path.join(dir, entry.name);
|
|
119
|
-
if (entry.isDirectory()) {
|
|
120
|
-
if (relOf(abs, srcRoot) === '.agents/cache') continue;
|
|
121
|
-
walk(abs);
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
// 引擎基线不下发(命名空间错配会致装户全员误报——同 renderTree 排除,见 check-engine-integrity.mjs)
|
|
125
|
-
if (relOf(abs, srcRoot) === '.agents/engine-lock.json') continue;
|
|
126
|
-
out.push(relOf(abs, srcRoot).split(path.sep).join('/'));
|
|
127
|
-
}
|
|
128
|
-
})(srcRoot);
|
|
129
|
-
return out;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export { sha256 };
|
package/src/rule-budget.test.mjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// rule-budget.test.mjs — 纯包源预算自检门(2026-10-11 budget-self-check)——关闭「纯包源仓不跑装户预算门」盲区。
|
|
2
|
-
// 背景:常驻面预算单源 templates/_agents/rule-budgets.txt(装户命名空间),此前只在装户侧强制
|
|
3
|
-
// (pre-commit --staged 硬拦 / check-loop 13 --all warning);v1.7.1 起本仓纯包源(5ca9e8c 删装副本)、
|
|
4
|
-
// 两处都不跑——bb69e19/418960a 重构净增 78B 把 .agents/commands/ 推到 65581B > 65536B,包源侧零暴露,
|
|
5
|
-
// 装户首提被硬拦才发现(2026-10-11 S1 冒烟)。本套件把同一张预算表映射到包源路径核对,npm test / CI
|
|
6
|
-
// 直接拦超限——模板增长不再静默入包。run-tests 盘面 glob 自动挂载本套件。
|
|
7
|
-
// 口径(对照 templates/_agents/scripts/rule-budget.mjs 单源,勿两处漂移):
|
|
8
|
-
// 字节 = LF 归一(工作树读入去 \r\n——等价 fsize 的 git cat-file 口径,core.autocrlf 检出形态无关);
|
|
9
|
-
// 目录合计 = 扁平 glob(直接子文件,不入子目录);pat=首空格前 / lim=末空格后;lim 非纯数字行跳过;
|
|
10
|
-
// # 注释与空行跳过。
|
|
11
|
-
// 与装户门的口径差异(诚实声明):
|
|
12
|
-
// - AGENTS.md 是渲染模板:装户拿到的是占位符展开后的文件,渲染形态权威仍在装户门;本套件按全部
|
|
13
|
-
// STACKS 渲染取 max(BOARD_PORT 按最坏 5 位端口)做包源侧近似——单源复用 profiles/render,不复制命令表。
|
|
14
|
-
// - fail-loud 项(装户侧是 skip,包源侧是打包回归——表不随包或常驻面失踪 = 装户门整体变暗):
|
|
15
|
-
// 预算表缺失 / 解析 0 行 / 映射目标不存在 / 文件 glob 零命中。装户侧专属面(无包源对应)SKIP 并注记。
|
|
16
|
-
import fs from 'node:fs';
|
|
17
|
-
import path from 'node:path';
|
|
18
|
-
import { fileURLToPath } from 'node:url';
|
|
19
|
-
import { renderContent } from './render.mjs';
|
|
20
|
-
import { STACKS, pickStackVars } from './profiles.mjs';
|
|
21
|
-
|
|
22
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
23
|
-
const BUDGETS = path.join(ROOT, 'templates', '_agents', 'rule-budgets.txt');
|
|
24
|
-
|
|
25
|
-
let pass = 0, fail = 0;
|
|
26
|
-
function check(name, cond, detail = '') {
|
|
27
|
-
if (cond) { pass++; console.log(`PASS ${name}`); }
|
|
28
|
-
else { fail++; console.log(`FAIL ${name}${detail ? `——${detail}` : ''}`); }
|
|
29
|
-
}
|
|
30
|
-
const lfBytes = (abs) => Buffer.byteLength(fs.readFileSync(abs, 'utf8').replace(/\r\n/g, '\n'), 'utf8');
|
|
31
|
-
|
|
32
|
-
// ---- 预算表(缺失即 fail-loud:装户门会整体变暗)----
|
|
33
|
-
if (!fs.existsSync(BUDGETS)) {
|
|
34
|
-
console.log('FAIL R0 预算表缺失 templates/_agents/rule-budgets.txt——装户侧 pre-commit/检查13 将整体 skip');
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
const rows = [];
|
|
38
|
-
for (const line of fs.readFileSync(BUDGETS, 'utf8').split('\n')) {
|
|
39
|
-
const t = line.replace(/\r/g, ''); // 表文件检出即 CRLF——显式去 \r(rule-budget.mjs 读取同款容 \r)
|
|
40
|
-
if (!t || t.startsWith('#')) continue;
|
|
41
|
-
const i = t.indexOf(' ');
|
|
42
|
-
if (i < 0) continue;
|
|
43
|
-
const pat = t.slice(0, i);
|
|
44
|
-
const lim = t.slice(t.lastIndexOf(' ') + 1);
|
|
45
|
-
if (!/^\d+$/.test(lim)) continue; // 非纯数字 lim 跳过(sh case 同款)
|
|
46
|
-
rows.push({ pat, lim: Number(lim) });
|
|
47
|
-
}
|
|
48
|
-
check('R1 预算表解析非空', rows.length > 0, `仅 ${rows.length} 行——表被清空即盲区复活`);
|
|
49
|
-
|
|
50
|
-
// ---- 映射:装户命名空间 → 包源路径(新预算行若只属装户侧,在此登记映射或留 SKIP)----
|
|
51
|
-
function mapToPkg(pat) {
|
|
52
|
-
if (pat === 'AGENTS.md') return 'templates/AGENTS.md';
|
|
53
|
-
if (pat.startsWith('.agents/')) return 'templates/_agents/' + pat.slice('.agents/'.length);
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const REMEDY = '处置沿先例:压缩版本括号/措辞(71e0b0e、v1.7.10 三处),或在 rule-budgets.txt 注明理由调预算(512B 步进)';
|
|
58
|
-
|
|
59
|
-
for (const { pat, lim } of rows) {
|
|
60
|
-
const rel = mapToPkg(pat);
|
|
61
|
-
if (!rel) { console.log(`SKIP ${pat}——装户侧专属面,无包源对应`); continue; }
|
|
62
|
-
const abs = path.join(ROOT, rel);
|
|
63
|
-
if (pat.endsWith('/')) {
|
|
64
|
-
// 目录合计:扁平直接子文件,不入子目录(sh `for f in "$pat"*` + [ -f ] 同款)
|
|
65
|
-
if (!fs.existsSync(abs)) { check(`R-dir ${pat} 目标存在`, false, `${rel} 缺失`); continue; }
|
|
66
|
-
const files = fs.readdirSync(abs, { withFileTypes: true }).filter((e) => e.isFile()).map((e) => e.name);
|
|
67
|
-
const total = files.reduce((s, n) => s + lfBytes(path.join(abs, n)), 0);
|
|
68
|
-
check(`R-dir ${rel} 合计 ${total}B ≤ ${lim}B(${files.length} 文件)`, total <= lim, `超 ${total - lim}B。${REMEDY}`);
|
|
69
|
-
} else if (pat.includes('*')) {
|
|
70
|
-
// 文件 glob:仅支持 dir 内后缀形(*.md)——与 sh glob 展开同效
|
|
71
|
-
const dir = path.dirname(abs);
|
|
72
|
-
const base = path.basename(pat);
|
|
73
|
-
const suffix = base.slice(base.indexOf('*') + 1);
|
|
74
|
-
const files = fs.existsSync(dir) ? fs.readdirSync(dir).filter((n) => n.endsWith(suffix)) : [];
|
|
75
|
-
if (files.length === 0) { check(`R-glob ${pat} 有命中`, false, `${dir} 下无 *${suffix}——常驻面失踪或映射失效`); continue; }
|
|
76
|
-
const sizes = files.map((n) => ({ n, b: lfBytes(path.join(dir, n)) }));
|
|
77
|
-
const over = sizes.filter((s) => s.b > lim);
|
|
78
|
-
const maxS = sizes.slice().sort((a, b) => b.b - a.b)[0];
|
|
79
|
-
check(`R-glob ${path.dirname(rel)}/${base} ${sizes.length} 份,最大 ${maxS.n} ${maxS.b}B ≤ ${lim}B`, over.length === 0,
|
|
80
|
-
`${over.map((s) => `${s.n}=${s.b}B 超 ${s.b - lim}B`).join(';')}。${REMEDY}`);
|
|
81
|
-
} else {
|
|
82
|
-
if (!fs.existsSync(abs)) { check(`R-file ${pat} 目标存在`, false, `${rel} 缺失`); continue; }
|
|
83
|
-
const b = lfBytes(abs);
|
|
84
|
-
check(`R-file ${rel} = ${b}B ≤ ${lim}B`, b <= lim, `超 ${b - lim}B。${REMEDY}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// ---- AGENTS.md 渲染近似(装户渲染形态 = 占位符展开;包源侧按全部栈取 max)----
|
|
89
|
-
const agentsRow = rows.find((r) => r.pat === 'AGENTS.md');
|
|
90
|
-
if (agentsRow) {
|
|
91
|
-
const tpl = fs.readFileSync(path.join(ROOT, 'templates', 'AGENTS.md'), 'utf8');
|
|
92
|
-
let worst = { stack: '-', b: 0 };
|
|
93
|
-
for (const stack of Object.keys(STACKS)) {
|
|
94
|
-
const text = renderContent(tpl, { BOARD_PORT: '99999', ...pickStackVars(stack) });
|
|
95
|
-
const b = Buffer.byteLength(text.replace(/\r\n/g, '\n'), 'utf8');
|
|
96
|
-
if (b > worst.b) worst = { stack, b };
|
|
97
|
-
}
|
|
98
|
-
check(`R-render templates/AGENTS.md 渲染 max(${worst.stack}) ${worst.b}B ≤ ${agentsRow.lim}B`, worst.b <= agentsRow.lim,
|
|
99
|
-
`超 ${worst.b - agentsRow.lim}B——渲染形态超限装户门同样会拦,先压模板正文。${REMEDY}`);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
103
|
-
process.exit(fail ? 1 : 0);
|
package/src/run-tests.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// run-tests.mjs — 全套测试入口(npm test):lint 首步 + CLI 单测(sync/add-host/add-gate)+ 引擎 *.test.mjs 套件。
|
|
2
|
-
// 顺序执行、任一非零整体失败(exit 1)。check-loop 套件自 2026-09-26 check-loop-node 起为 node 实现
|
|
3
|
-
// (check-loop.test.mjs 由下方 glob 自动发现——旧 bash 特判与「无 sh 跳过」提示随迁移退役)。
|
|
4
|
-
// lint 首步(2026-10-08 engine-quality-batch):eslint 仅 devDependency(包源仓)——检测到未安装时
|
|
5
|
-
// 显式打印 skip 后继续(裸 checkout 未 npm install 场景的可诊断性;装户仓无本编排器不涉及),
|
|
6
|
-
// 已安装但报错则 fail-closed 计入失败。
|
|
7
|
-
import { spawnSync } from 'node:child_process';
|
|
8
|
-
import fs from 'node:fs';
|
|
9
|
-
import path from 'node:path';
|
|
10
|
-
import { fileURLToPath } from 'node:url';
|
|
11
|
-
|
|
12
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
13
|
-
|
|
14
|
-
// src/ 侧按盘面枚举,不硬编码清单(2026-10-09 审查 P0-1)——此前硬编码 8 项,`src/sync-hosts.test.mjs`
|
|
15
|
-
// 漏挂:npm test 不跑它,CI 也盖不住(ci.yml shipped 步骤只 glob `.agents/scripts/*.test.mjs`),
|
|
16
|
-
// 而 `templates/_agents/commands/sync-hosts.md:62`「npm test 含 sync-hosts.test.mjs 8 场景」随模板
|
|
17
|
-
// 下发 5 个装户宿主。检查 20 只扫 `templates/_agents/scripts/` 面,结构上抓不到 src/ 漏挂。
|
|
18
|
-
// 改 glob 后:新增 src 测试文件不可能再被静默漏跑(枚举漂移由盘面兜住,不靠人记得补)。
|
|
19
|
-
// 含宿主门禁模块回归(2026-09-27 host-gates-p1:dotnet-ca BRE 豁免/fail-closed + trae 强推 token 化)。
|
|
20
|
-
const nodeSuites = [
|
|
21
|
-
...fs.readdirSync(path.join(ROOT, 'src'))
|
|
22
|
-
.filter((f) => f.endsWith('.test.mjs'))
|
|
23
|
-
.sort()
|
|
24
|
-
.map((f) => `src/${f}`),
|
|
25
|
-
...fs.readdirSync(path.join(ROOT, 'templates/_agents/scripts'))
|
|
26
|
-
.filter((f) => f.endsWith('.test.mjs'))
|
|
27
|
-
.sort()
|
|
28
|
-
.map((f) => `templates/_agents/scripts/${f}`),
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
let failed = 0;
|
|
32
|
-
|
|
33
|
-
// lint 首步:eslint 可用性探测 = require.resolve 于包源仓 node_modules(裸 checkout 解析失败 → 显式跳过)
|
|
34
|
-
console.log('\n===== lint(eslint .)=====');
|
|
35
|
-
const eslintEntry = spawnSync(process.execPath, ['-e', "require.resolve('eslint')"], { cwd: ROOT, encoding: 'utf8' });
|
|
36
|
-
if (eslintEntry.status !== 0) {
|
|
37
|
-
console.log('[lint] skipped: eslint not installed(npm install 后启用;仅包源仓场景)');
|
|
38
|
-
} else {
|
|
39
|
-
const r = spawnSync(process.execPath, [path.join(ROOT, 'node_modules/eslint/bin/eslint.js'), '.'], { cwd: ROOT, stdio: 'inherit' });
|
|
40
|
-
if (r.status !== 0) failed++;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
for (const rel of nodeSuites) {
|
|
44
|
-
console.log(`\n===== ${rel} =====`);
|
|
45
|
-
const r = spawnSync(process.execPath, [path.join(ROOT, rel)], { cwd: ROOT, stdio: 'inherit' });
|
|
46
|
-
if (r.status !== 0) failed++;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
console.log(`\n${failed ? `❌ ${failed} 个套件失败` : '✅ 全部套件通过'}`);
|
|
50
|
-
// 机器可读汇总行(2026-10-09 审查 P0-2):verify.mjs 的凭证计数**只认这一行**。
|
|
51
|
-
// 此前它 pop 通配「合计: PASS n / FAIL n」,而 45+ 套件每个都打印自己那行同形文本——
|
|
52
|
-
// 取到的是字母序最后一个套件的场景数(本仓实况:workflows-check.test.mjs 的 15),
|
|
53
|
-
// 于是「一行机器事实」的 passed 字段落成了错的事实。独立前缀 + 套件口径,嵌套同形行不再被误取。
|
|
54
|
-
// 口径:SUITES = 本编排器实际执行的套件数(lint 不计入;lint 红照样 exit 1,凭证不落)。
|
|
55
|
-
console.log(`[run-tests] 合计: SUITES ${nodeSuites.length} / FAILED ${failed}`);
|
|
56
|
-
process.exit(failed ? 1 : 0);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// 栈提交门契约:node 的构建只在 package.json scripts.build 为非空字符串时跑;
|
|
3
|
-
// python 的提交门不再带 pytest;flow-kit --help 的门禁列表等于 modules/gates 目录。
|
|
4
|
-
// 集成段用临时 git 仓跑真实 init,再对装出的 commit-check.cjs 暂存一个源文件。
|
|
5
|
-
import { spawnSync } from 'node:child_process';
|
|
6
|
-
import fs from 'node:fs';
|
|
7
|
-
import os from 'node:os';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
import { fileURLToPath } from 'node:url';
|
|
10
|
-
import { HELP } from './cli.mjs';
|
|
11
|
-
import { routeKindList } from './executor.mjs';
|
|
12
|
-
import { commitCheckConfig, settingsJson } from './profiles.mjs';
|
|
13
|
-
|
|
14
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
-
const git = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
16
|
-
let pass = 0;
|
|
17
|
-
let fail = 0;
|
|
18
|
-
const check = (name, cond, detail = '') => {
|
|
19
|
-
if (cond) { pass++; console.log(`PASS ${name}`); }
|
|
20
|
-
else { fail++; console.log(`FAIL ${name}${detail ? `\n ${detail}` : ''}`); }
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const gates = fs.readdirSync(path.join(ROOT, 'modules', 'gates'), { withFileTypes: true })
|
|
24
|
-
.filter((d) => d.isDirectory())
|
|
25
|
-
.map((d) => d.name)
|
|
26
|
-
.sort();
|
|
27
|
-
const gateList = gates.join(' | ');
|
|
28
|
-
check('help 当前列表等于 modules/gates 目录', HELP.includes(`当前:${gateList}`), gateList);
|
|
29
|
-
check('help 含四套已发布门禁',
|
|
30
|
-
['dotnet-ca', 'generated-readonly', 'node-layer', 'py-import'].every((n) => HELP.includes(n)));
|
|
31
|
-
check('help 不再把当前门禁写成只有 dotnet-ca',
|
|
32
|
-
!HELP.includes('当前:dotnet-ca;') && !HELP.includes('当前:dotnet-ca)'));
|
|
33
|
-
|
|
34
|
-
// route 的 kind 值域与 GATE_LIST 同纪律:从权威面(new-task.md 的 route-kinds 机器单源)派生,
|
|
35
|
-
// 不手写第二份——否则装户改 kind 时 help 与 route 判定面双源漂移。
|
|
36
|
-
const kindList = routeKindList(ROOT).join('|');
|
|
37
|
-
check('help route kind 列表等于 new-task.md route-kinds 单源', HELP.includes(`--kind ${kindList}`), kindList);
|
|
38
|
-
|
|
39
|
-
const nodeCfg = JSON.parse(commitCheckConfig('node'));
|
|
40
|
-
check('node 构建命令带 pkg:scripts.build',
|
|
41
|
-
nodeCfg.builds.some((b) => b.command === 'npm run build' && Array.isArray(b.when) && b.when.includes('pkg:scripts.build')));
|
|
42
|
-
const pyText = commitCheckConfig('python');
|
|
43
|
-
const pyCfg = JSON.parse(pyText);
|
|
44
|
-
check('python builds 为空', Array.isArray(pyCfg.builds) && pyCfg.builds.length === 0, pyText);
|
|
45
|
-
check('python 提交门配置不含 pytest', !pyText.includes('pytest'), pyText);
|
|
46
|
-
check('python 质量检查仍是 ruff',
|
|
47
|
-
pyCfg.checks.some((c) => String(c.command).includes('ruff') && (c.when || []).includes('ruff.toml')));
|
|
48
|
-
check('python 的 test 阶段权限仍允许 pytest', settingsJson('python').includes('pytest'));
|
|
49
|
-
|
|
50
|
-
const dirs = [];
|
|
51
|
-
function initStack(stack, port) {
|
|
52
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), `fk-stack-${stack}-`));
|
|
53
|
-
dirs.push(dir);
|
|
54
|
-
spawnSync(git, ['init', '-q'], { cwd: dir });
|
|
55
|
-
const r = spawnSync(process.execPath, [
|
|
56
|
-
path.join(ROOT, 'bin', 'flow-kit.mjs'), 'init',
|
|
57
|
-
'--stack', stack, '--hosts', 'claude', '--board-port', String(port), '--dir', dir,
|
|
58
|
-
], { encoding: 'utf8', timeout: 180000 });
|
|
59
|
-
return { dir, status: r.status, out: `${r.stdout || ''}${r.stderr || ''}` };
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function runCommitCheck(dir, rel, content) {
|
|
63
|
-
fs.writeFileSync(path.join(dir, rel), content);
|
|
64
|
-
spawnSync(git, ['add', '--', rel], { cwd: dir });
|
|
65
|
-
const r = spawnSync(process.execPath, [path.join(dir, '.agents', 'hooks', 'commit-check.cjs')], {
|
|
66
|
-
cwd: dir, encoding: 'utf8', timeout: 60000,
|
|
67
|
-
});
|
|
68
|
-
return { status: r.status, out: `${r.stdout || ''}${r.stderr || ''}` };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const nodeInit = initStack('node', 8942);
|
|
72
|
-
check('init --stack node 退出 0', nodeInit.status === 0, `exit=${nodeInit.status}\n${nodeInit.out.split('\n').slice(-25).join('\n')}`);
|
|
73
|
-
if (nodeInit.status === 0) {
|
|
74
|
-
const installed = fs.readFileSync(path.join(nodeInit.dir, '.agents', 'hooks', 'commit-check.config.json'), 'utf8');
|
|
75
|
-
check('装出的 node 配置含 pkg:scripts.build', installed.includes('pkg:scripts.build'), installed);
|
|
76
|
-
const hook = runCommitCheck(nodeInit.dir, 'a.js', 'console.log(1)\n');
|
|
77
|
-
check('无 scripts.build 时暂存 js:SKIP 且退出 0',
|
|
78
|
-
hook.status === 0 && hook.out.includes('SKIP') && hook.out.includes('pkg:scripts.build') && !hook.out.includes('BLOCK:'),
|
|
79
|
-
hook.out);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const pyInit = initStack('python', 8943);
|
|
83
|
-
check('init --stack python 退出 0', pyInit.status === 0, `exit=${pyInit.status}\n${pyInit.out.split('\n').slice(-25).join('\n')}`);
|
|
84
|
-
if (pyInit.status === 0) {
|
|
85
|
-
const installed = fs.readFileSync(path.join(pyInit.dir, '.agents', 'hooks', 'commit-check.config.json'), 'utf8');
|
|
86
|
-
check('装出的 python 配置不含 pytest', !installed.includes('pytest'), installed);
|
|
87
|
-
const hook = runCommitCheck(pyInit.dir, 'a.py', 'x = 1\n');
|
|
88
|
-
check('暂存 py:不跑 pytest 且退出 0',
|
|
89
|
-
hook.status === 0 && !hook.out.includes('pytest') && hook.out.includes('COMMIT_CHECK_OK'),
|
|
90
|
-
hook.out);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
for (const dir of dirs) fs.rmSync(dir, { recursive: true, force: true });
|
|
94
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
95
|
-
process.exit(fail ? 1 : 0);
|
package/src/sync-hosts.mjs
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
// flow-kit sync-hosts:跨宿主适配层正文段漂移检查 + 单向同步(B-b 方案,2026-09-25)
|
|
2
|
-
// 目的:改权威源(templates/_agents/{commands,roles}/*.md)正文要同步到 N 份薄适配
|
|
3
|
-
// (modules/hosts/<h>/{agents,commands}/*.md)的对应正文段;薄适配 frontmatter 保留宿主特化字段
|
|
4
|
-
// (commands 层 trae 侧另有 name: wf-X,opencode/zcode/omp 各自原描述),不在同步范围。
|
|
5
|
-
// B-b 语义:sha 比对与 apply 只动正文段,frontmatter 双方各自维护。
|
|
6
|
-
// 映射单源在 profiles.mjs#HOSTS.commandPrefix(命令层薄适配文件名前缀;2026-09-28 opencode 对齐 trae 的 wf- 前缀)。
|
|
7
|
-
// 算法:diffHosts 抽为 pure function(authorityRoot + adaptersRoot 两个根);
|
|
8
|
-
// sync-hosts CLI 在 pkgRoot 跑(包源视角);doctor §7.x 在 target 跑(装户视角)——同源逻辑。
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
import path from 'node:path';
|
|
11
|
-
import { HOSTS } from './profiles.mjs';
|
|
12
|
-
import { sha256 } from './render.mjs';
|
|
13
|
-
|
|
14
|
-
function fail(msg) {
|
|
15
|
-
console.error(`❌ ${msg}`);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 剥离 frontmatter 返回 { fm, body };无 frontmatter 时 fm = '',body = 整文件
|
|
20
|
-
// frontmatter 形如 "---\n...\n---\n",位于文件首;其后(含分隔空行)为正文段。
|
|
21
|
-
function splitFm(text) {
|
|
22
|
-
const m = String(text || '').match(/^---\r?\n([\s\S]*?\r?\n)---\r?\n?([\s\S]*)$/);
|
|
23
|
-
if (!m) return { fm: '', body: String(text || '') };
|
|
24
|
-
// fm 还原为带分隔横线的形式;body 保留首部空行
|
|
25
|
-
return { fm: `---\n${m[1]}---\n`, body: m[2] };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// bodySha:剥离 frontmatter 后的正文段 sha256(缺失返 null);正文 LF 归一(2026-09-27 closing-coverage:
|
|
29
|
-
// CRLF/LF 盘面同值——权威源与薄适配行尾不一致不再误报漂移)。
|
|
30
|
-
// 单源 export(2026-10-11 bodysha-single-source):doctor §6.7 checkAdapterDrift 复用——此前 doctor
|
|
31
|
-
// 内联第二份实现靠注释约束同口径,收敛为单源 import 消灭漂移面。
|
|
32
|
-
export function bodySha(p) {
|
|
33
|
-
try {
|
|
34
|
-
const { body } = splitFm(fs.readFileSync(p, 'utf8'));
|
|
35
|
-
return sha256(Buffer.from(body.replace(/\r\n/g, '\n'), 'utf8'));
|
|
36
|
-
} catch {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// listMd:列目录下 .md 文件(同步当前层;不递归)
|
|
42
|
-
function listMd(dir) {
|
|
43
|
-
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) return [];
|
|
44
|
-
return fs.readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// pairsFor:权威源文件 → 薄适配 rel 列表(映射单源见 profiles.mjs#HOSTS.commandPrefix)
|
|
48
|
-
// commands 权威源 → 带 commandPrefix 的宿主各一份(<dir>/commands/<prefix><name>.md)
|
|
49
|
-
// roles 权威源 → 全部宿主 agents 各一份
|
|
50
|
-
// hostDirOf:宿主 → 适配目录名。包源调用传入 (h) => h,配对落在 modules/hosts/<宿主键>/。
|
|
51
|
-
// hostFilter:宿主级过滤。调用方只扫实际存在的宿主目录时传入。
|
|
52
|
-
function pairsFor(authRel, hostDirOf = (h) => h, hostFilter = null) {
|
|
53
|
-
const out = [];
|
|
54
|
-
const norm = authRel.split(path.sep).join('/');
|
|
55
|
-
// 条目带 h(宿主键)——faces 计数用「实际生成配对 > 0 的宿主数」(复核 P2-2:存在但空的宿主点
|
|
56
|
-
// 目录此前被计入「N 宿主」,对账面自描述轻微夸大)
|
|
57
|
-
if (norm.startsWith('commands/') && norm.endsWith('.md')) {
|
|
58
|
-
const name = norm.slice('commands/'.length, -'.md'.length);
|
|
59
|
-
for (const [h, v] of Object.entries(HOSTS)) {
|
|
60
|
-
if (hostFilter && !hostFilter(h)) continue;
|
|
61
|
-
if (v.commandPrefix) out.push({ h, adapterRel: `${hostDirOf(h)}/commands/${v.commandPrefix}${name}.md` });
|
|
62
|
-
}
|
|
63
|
-
} else if (norm.startsWith('roles/') && norm.endsWith('.md')) {
|
|
64
|
-
const name = norm.slice('roles/'.length, -'.md'.length);
|
|
65
|
-
for (const h of Object.keys(HOSTS)) {
|
|
66
|
-
if (hostFilter && !hostFilter(h)) continue;
|
|
67
|
-
out.push({ h, adapterRel: `${hostDirOf(h)}/agents/${name}.md` });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return out;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// diffHosts:权威源正文段 vs 薄适配正文段的漂移分析(B-b 语义;pure function)。
|
|
74
|
-
// authorityRoot:权威源根(含 commands/ + roles/)
|
|
75
|
-
// adapterRoots = [{root, hostDirOf, hostFilter?, label?}]。只扫 modules/hosts。
|
|
76
|
-
// 向后兼容:旧单根入参 adaptersRoot/hostDirOf 归一为单元素数组。
|
|
77
|
-
// hostDirOf:宿主 → 适配目录名(默认宿主键)
|
|
78
|
-
// 返回:{ drift, inSync, authorityMissing, adapterOrphans, faces }
|
|
79
|
-
// drift 条目自带 root(applyForward 按它定位适配文件);faces = 对账面自描述行(防不可解释的「N 对」)
|
|
80
|
-
export function diffHosts(opts) {
|
|
81
|
-
const authorityRoot = opts.authorityRoot;
|
|
82
|
-
const roots = opts.adapterRoots || [{ root: opts.adaptersRoot, hostDirOf: opts.hostDirOf || ((h) => h), label: null }];
|
|
83
|
-
if (!fs.existsSync(authorityRoot)) return { drift: [], inSync: 0, authorityMissing: [], adapterOrphans: [], faces: [], note: `权威源根不存在:${authorityRoot}` };
|
|
84
|
-
|
|
85
|
-
const drift = [];
|
|
86
|
-
const adapterOrphans = [];
|
|
87
|
-
let inSync = 0;
|
|
88
|
-
const adapterSeen = new Set();
|
|
89
|
-
const authorityMissing = [];
|
|
90
|
-
const faces = [];
|
|
91
|
-
|
|
92
|
-
for (const spec of roots) {
|
|
93
|
-
const { root, hostDirOf, hostFilter, label } = spec;
|
|
94
|
-
const rootHosts = new Set(); // 该根实际生成配对 > 0 的宿主(faces 计数口径,复核 P2-2)
|
|
95
|
-
// 扫权威源 commands/ + roles/
|
|
96
|
-
for (const sub of ['commands', 'roles']) {
|
|
97
|
-
const subAbs = path.join(authorityRoot, sub);
|
|
98
|
-
for (const f of listMd(subAbs)) {
|
|
99
|
-
const authRel = `${sub}/${f}`;
|
|
100
|
-
const authAbs = path.join(authorityRoot, authRel);
|
|
101
|
-
const authSha = bodySha(authAbs);
|
|
102
|
-
const pairs = pairsFor(authRel, hostDirOf, hostFilter);
|
|
103
|
-
if (pairs.length === 0) continue;
|
|
104
|
-
for (const { h, adapterRel } of pairs) {
|
|
105
|
-
rootHosts.add(h);
|
|
106
|
-
adapterSeen.add(adapterRel);
|
|
107
|
-
const adapterAbs = path.join(root, adapterRel);
|
|
108
|
-
const adapterSha = bodySha(adapterAbs);
|
|
109
|
-
if (adapterSha === null) {
|
|
110
|
-
// 未安装的宿主不算「缺失」——那是没装,不是漂移(2026-10-07:装户只装部分宿主时,
|
|
111
|
-
// 旧行为会把未装宿主的全部适配文件列成 authorityMissing,装户 --apply 恒 exit 1 且刷屏)
|
|
112
|
-
if (fs.existsSync(path.dirname(adapterAbs))) authorityMissing.push({ authRel, adapterRel });
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (authSha === adapterSha) { inSync++; continue; }
|
|
116
|
-
drift.push({ authRel, adapterRel, authSha, adapterSha, root });
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
faces.push(label ? `${label}(${rootHosts.size} 宿主)` : `${root}(${rootHosts.size} 宿主)`);
|
|
122
|
-
// 扫薄适配找孤儿(权威源无对应文件)
|
|
123
|
-
for (const h of Object.keys(HOSTS)) {
|
|
124
|
-
if (hostFilter && !hostFilter(h)) continue;
|
|
125
|
-
for (const sub of ['agents', 'commands']) {
|
|
126
|
-
const subAbs = path.join(root, hostDirOf(h), sub);
|
|
127
|
-
for (const f of listMd(subAbs)) {
|
|
128
|
-
const adapterRel = `${hostDirOf(h)}/${sub}/${f}`;
|
|
129
|
-
if (adapterSeen.has(adapterRel)) continue;
|
|
130
|
-
let authGuess;
|
|
131
|
-
const prefix = HOSTS[h] && HOSTS[h].commandPrefix;
|
|
132
|
-
if (sub === 'commands' && prefix && f.startsWith(prefix)) {
|
|
133
|
-
// 命令层薄适配带宿主 commandPrefix(2026-09-28:opencode 对齐 trae 后两宿主同口径)
|
|
134
|
-
authGuess = `commands/${f.slice(prefix.length)}`;
|
|
135
|
-
} else if (sub === 'agents') {
|
|
136
|
-
authGuess = `roles/${f}`;
|
|
137
|
-
} else {
|
|
138
|
-
authGuess = `commands/${f}`;
|
|
139
|
-
}
|
|
140
|
-
adapterOrphans.push({ adapterRel, authGuess });
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return { drift, inSync, authorityMissing, adapterOrphans, faces };
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// printDiff:人类可读 diff 报告(B-b 语义:正文段比对 + frontmatter 双方不动)
|
|
150
|
-
function printDiff(result) {
|
|
151
|
-
const { drift, inSync, authorityMissing, adapterOrphans, note, faces } = result;
|
|
152
|
-
if (note) console.log(`ℹ️ ${note}\n`);
|
|
153
|
-
if (faces && faces.length) console.log(` 对账面:${faces.join(' + ')}`);
|
|
154
|
-
console.log(` 正文对齐:${inSync} 对`);
|
|
155
|
-
if (authorityMissing.length) {
|
|
156
|
-
console.log(` 权威源声明但薄适配缺失(${authorityMissing.length},apply 不自动创建——薄适配须经 add-host 接管):`);
|
|
157
|
-
for (const { authRel, adapterRel } of authorityMissing) console.log(` - ${authRel} → ${adapterRel}`);
|
|
158
|
-
}
|
|
159
|
-
if (drift.length) {
|
|
160
|
-
console.log(` 正文段漂移(${drift.length},权威源与薄适配正文 sha 不一致——可能是权威源改了或薄适配正文手改了;run with --apply to sync 正文段,frontmatter 不动):`);
|
|
161
|
-
for (const { authRel, adapterRel } of drift) console.log(` - ${authRel} → ${adapterRel}`);
|
|
162
|
-
} else if (!authorityMissing.length) {
|
|
163
|
-
console.log(' 无漂移 ✅');
|
|
164
|
-
}
|
|
165
|
-
if (adapterOrphans.length) {
|
|
166
|
-
console.log(` ⚠️ 孤儿薄适配(${adapterOrphans.length},权威源无对应文件,可能是历史残留或宿主特化;apply 不删):`);
|
|
167
|
-
for (const { adapterRel, authGuess } of adapterOrphans) console.log(` - ${adapterRel}(推测权威源:${authGuess})`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// applyForward:把权威源正文段同步到薄适配(保留薄适配原 frontmatter)
|
|
172
|
-
// 漂移条目自带 root(多根对账,2026-10-09 sync-hosts-root-coverage)——按它定位适配文件。
|
|
173
|
-
// 返回:{ synced: [{adapterRel}] }
|
|
174
|
-
function applyForward({ authorityRoot }, drift) {
|
|
175
|
-
const synced = [];
|
|
176
|
-
for (const { authRel, adapterRel, root } of drift) {
|
|
177
|
-
const authAbs = path.join(authorityRoot, authRel);
|
|
178
|
-
const adapterAbs = path.join(root, adapterRel);
|
|
179
|
-
const authText = fs.readFileSync(authAbs, 'utf8');
|
|
180
|
-
const adapterText = fs.readFileSync(adapterAbs, 'utf8');
|
|
181
|
-
const { body } = splitFm(authText);
|
|
182
|
-
const { fm } = splitFm(adapterText);
|
|
183
|
-
// 拼接:薄适配 frontmatter + 权威源正文段
|
|
184
|
-
fs.mkdirSync(path.dirname(adapterAbs), { recursive: true });
|
|
185
|
-
fs.writeFileSync(adapterAbs, `${fm}${body}`);
|
|
186
|
-
synced.push(adapterRel);
|
|
187
|
-
}
|
|
188
|
-
return { synced };
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function syncHosts(args, pkgRoot) {
|
|
192
|
-
let apply = false;
|
|
193
|
-
let json = false;
|
|
194
|
-
let strict = false;
|
|
195
|
-
let dir = null;
|
|
196
|
-
for (let i = 0; i < args.length; i++) {
|
|
197
|
-
const a = args[i];
|
|
198
|
-
if (a === '--diff') apply = false;
|
|
199
|
-
else if (a === '--apply') apply = true;
|
|
200
|
-
else if (a === '--json') json = true;
|
|
201
|
-
else if (a === '--strict') strict = true;
|
|
202
|
-
else if (a === '--dir') { dir = args[++i]; if (!dir) fail('--dir 缺少参数(目标项目根)'); }
|
|
203
|
-
else fail(`未知选项:${a}(flow-kit sync-hosts --help)`);
|
|
204
|
-
}
|
|
205
|
-
if (!pkgRoot) fail('sync-hosts 缺少 pkgRoot(开发模式入口)');
|
|
206
|
-
|
|
207
|
-
// 目标根:--dir > cwd > pkgRoot。只认包源仓(templates/_agents + modules/hosts)。
|
|
208
|
-
// 装户仓的宿主文件由 init / add-host 写入,不在这里把 .agents 再当成第二份权威源。
|
|
209
|
-
const target = path.resolve(dir || process.cwd() || pkgRoot);
|
|
210
|
-
const authorityRoot = path.join(target, 'templates', '_agents');
|
|
211
|
-
const hostsRoot = path.join(target, 'modules', 'hosts');
|
|
212
|
-
if (!fs.existsSync(authorityRoot) || !fs.existsSync(hostsRoot)) {
|
|
213
|
-
fail(`sync-hosts 只在包源仓运行(需要 templates/_agents 与 modules/hosts)。目标根 ${target} 不是包源仓。装户的宿主文件由 init / add-host 写入。`);
|
|
214
|
-
}
|
|
215
|
-
const adapterRoots = [
|
|
216
|
-
{ root: hostsRoot, hostDirOf: (h) => h, label: 'modules/hosts' },
|
|
217
|
-
];
|
|
218
|
-
const result = diffHosts({ authorityRoot, adapterRoots });
|
|
219
|
-
|
|
220
|
-
if (apply && result.drift.length > 0) {
|
|
221
|
-
const { synced } = applyForward({ authorityRoot }, result.drift);
|
|
222
|
-
console.log(`▶ flow-kit sync-hosts --apply → ${target}(包源)`);
|
|
223
|
-
console.log(` 对账面:${result.faces.join(' + ')}`);
|
|
224
|
-
console.log(` 按权威源正文覆盖薄适配正文段 ${synced.length} 份(薄适配 frontmatter 不动):`);
|
|
225
|
-
for (const rel of synced) console.log(` - ${rel}`);
|
|
226
|
-
const after = diffHosts({ authorityRoot, adapterRoots });
|
|
227
|
-
console.log(` 同步后正文对齐:${after.inSync} 对;权威源缺失:${after.authorityMissing.length};正文漂移:${after.drift.length}`);
|
|
228
|
-
return after.drift.length === 0 && after.authorityMissing.length === 0 ? 0 : 1;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (json) {
|
|
232
|
-
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
233
|
-
} else {
|
|
234
|
-
console.log(`▶ flow-kit sync-hosts --diff → ${target}(包源)`);
|
|
235
|
-
printDiff(result);
|
|
236
|
-
}
|
|
237
|
-
// --strict(B4,2026-10-13):漂移**报告器**变机器门。
|
|
238
|
-
// 背景:source-sync-check 删除后,跨宿主正文漂移只剩人工跑一次 --diff,CI 里无任何调用点——
|
|
239
|
-
// 而改权威源要同步 N 份薄适配,人工 grep 易漏(本次评审前 10 份薄适配就带着漂移)。
|
|
240
|
-
// 默认仍返回 0(保持「报告器」语义,人工跑不因漂移而失败);CI 用 --strict 把漂移变成红。
|
|
241
|
-
// 口径:**只判「跑一次 --apply 就能归零」的两项**(正文漂移 + 权威源缺失)。
|
|
242
|
-
// 孤儿薄适配不判红——--apply 按设计不删它(可能是宿主特化/历史残留),
|
|
243
|
-
// 把它算红就是一条机器无法自愈的假红,按本仓「假阳性即噪声」纪律不能设成门(仍照常报告)。
|
|
244
|
-
if (strict) {
|
|
245
|
-
const fixable = result.drift.length + result.authorityMissing.length;
|
|
246
|
-
if (fixable > 0) {
|
|
247
|
-
console.error(`[跨宿主漂移 strict] 正文漂移 ${result.drift.length} · 权威源缺失 ${result.authorityMissing.length}`
|
|
248
|
-
+ `${result.adapterOrphans.length ? `(另有孤儿薄适配 ${result.adapterOrphans.length} 份,按设计不判红)` : ''}`
|
|
249
|
-
+ '——须先 flow-kit sync-hosts --apply 再提交');
|
|
250
|
-
return 1;
|
|
251
|
-
}
|
|
252
|
-
if (result.adapterOrphans.length) {
|
|
253
|
-
console.log(` ℹ️ 孤儿薄适配 ${result.adapterOrphans.length} 份(--apply 按设计不删,故 strict 不判红;确为残留请手工删)`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return 0;
|
|
257
|
-
}
|