agentic-flow-kit 1.8.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -148
- package/bin/flow-kit.mjs +5 -2
- package/locales/en/installer.json +25 -0
- package/locales/en/overrides/.agents/commands/deploy.md +52 -0
- package/locales/en/overrides/.agents/commands/maintain.md +76 -0
- package/locales/en/overrides/.agents/commands/new-task.md +89 -0
- package/locales/en/overrides/.agents/commands/pipeline-run.md +56 -0
- package/locales/en/overrides/.agents/commands/pr-review.md +30 -0
- package/locales/en/overrides/.agents/commands/review.md +93 -0
- package/locales/en/overrides/.agents/commands/stages.md +256 -0
- package/locales/en/overrides/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/locales/en/overrides/.agents/notes/process-order-rule.md +21 -0
- package/locales/en/overrides/.agents/notes/runtime-env.local.example.md +21 -0
- package/locales/en/overrides/.agents/pipelines/_TEMPLATE.md +75 -0
- package/locales/en/overrides/.agents/pipelines/pipeline-closing.md +28 -0
- package/locales/en/overrides/.agents/roles/implementer.md +28 -0
- package/locales/en/overrides/.agents/roles/independent-reviewer.md +39 -0
- package/locales/en/overrides/.agents/roles/pr-adjudicator.md +27 -0
- package/locales/en/overrides/.agents/roles/pr-finder.md +51 -0
- package/locales/en/overrides/.agents/roles/pr-verifier.md +44 -0
- package/locales/en/overrides/.agents/roles/ui-verifier.md +22 -0
- package/locales/en/overrides/.agents/roles/wiki-compiler.md +47 -0
- package/locales/en/overrides/.agents/skills/arena/SKILL.md +50 -0
- package/locales/en/overrides/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/locales/en/overrides/.agents/skills/blast-radius/SKILL.md +53 -0
- package/locales/en/overrides/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/dev-tour/SKILL.md +98 -0
- package/locales/en/overrides/.agents/skills/dream/SKILL.md +63 -0
- package/locales/en/overrides/.agents/skills/eval/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/interrogate/SKILL.md +49 -0
- package/locales/en/overrides/.agents/skills/number-vetting/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/page-refactor/SKILL.md +192 -0
- package/locales/en/overrides/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/pause-safely/SKILL.md +31 -0
- package/locales/en/overrides/.agents/skills/perf/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/review-method/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/session-resume/SKILL.md +69 -0
- package/locales/en/overrides/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/locales/en/overrides/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/locales/en/overrides/.agents/skills/verify-ui/SKILL.md +116 -0
- package/locales/en/overrides/.agents/skills/visual-parity/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/why/SKILL.md +56 -0
- package/locales/en/overrides/.agents/skills/wiki/SKILL.md +53 -0
- package/locales/en/overrides/.claude/agents/implementer.md +9 -0
- package/locales/en/overrides/.claude/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.claude/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.cline/agents/implementer.yml +13 -0
- package/locales/en/overrides/.cline/agents/independent-reviewer.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-adjudicator.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-finder.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-verifier.yml +11 -0
- package/locales/en/overrides/.cline/agents/ui-verifier.yml +8 -0
- package/locales/en/overrides/.cline/agents/wiki-compiler.yml +14 -0
- package/locales/en/overrides/.cline/workflows/wf-deploy.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-maintain.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-new-task.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pr-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/CODEBUDDY.md +7 -0
- package/locales/en/overrides/.codebuddy/agents/implementer.md +9 -0
- package/locales/en/overrides/.codebuddy/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.codebuddy/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.codebuddy/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/locales/en/overrides/.commandcode/agents/implementer.md +10 -0
- package/locales/en/overrides/.commandcode/agents/independent-reviewer.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-adjudicator.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-finder.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-verifier.md +9 -0
- package/locales/en/overrides/.commandcode/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.commandcode/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.commandcode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.opencode/agents/implementer.md +51 -0
- package/locales/en/overrides/.opencode/agents/independent-reviewer.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-adjudicator.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-finder.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-verifier.md +18 -0
- package/locales/en/overrides/.opencode/agents/ui-verifier.md +45 -0
- package/locales/en/overrides/.opencode/agents/wiki-compiler.md +51 -0
- package/locales/en/overrides/.opencode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.pi/agents/implementer.md +11 -0
- package/locales/en/overrides/.pi/agents/independent-reviewer.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-adjudicator.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-finder.md +11 -0
- package/locales/en/overrides/.pi/agents/pr-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/wiki-compiler.md +11 -0
- package/locales/en/overrides/.qoder/agents/implementer.md +9 -0
- package/locales/en/overrides/.qoder/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.qoder/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.qwen/agents/implementer.md +10 -0
- package/locales/en/overrides/.qwen/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/wiki-compiler.md +13 -0
- package/locales/en/overrides/.qwen/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.trae/agents/implementer.md +9 -0
- package/locales/en/overrides/.trae/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.trae/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.trae/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.trae/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.zcode/agents/implementer.md +8 -0
- package/locales/en/overrides/.zcode/agents/independent-reviewer.md +8 -0
- package/locales/en/overrides/.zcode/agents/ui-verifier.md +8 -0
- package/locales/en/overrides/.zcode/agents/wiki-compiler.md +8 -0
- package/locales/en/overrides/AGENTS.md +52 -0
- package/locales/en/overrides/CLAUDE.md +20 -0
- package/locales/en/overrides/wiki/INDEX.md +33 -0
- package/locales/en/overrides/wiki/drafts-archive/README.md +6 -0
- package/locales/en/overrides/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/locales/en/overrides/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/locales/en/overrides/workflow/INDEX.md +13 -0
- package/locales/en/overrides/workflow/README.md +67 -0
- package/locales/en/overrides/workflow/archive/README.md +3 -0
- package/locales/en/overrides/workflow/delegations.md +4 -0
- package/locales/en/overrides/workflow/effective-policy.md +4 -0
- package/locales/en/overrides/workflow/gate-cost.md +4 -0
- package/locales/en/overrides/workflow/incidents/_TEMPLATE.md +49 -0
- package/locales/en/overrides/workflow/intents/_TEMPLATE.md +43 -0
- package/locales/en/overrides/workflow/metrics.md +4 -0
- package/locales/en/overrides/workflow/papercuts.md +3 -0
- package/locales/en/overrides/workflow/plans/_TEMPLATE.md +47 -0
- package/locales/en/overrides/workflow/regression-checklist.md +3 -0
- package/locales/en/overrides/workflow/specs/_TEMPLATE.md +86 -0
- package/locales/en/overrides/workflow/verify-evidence.md +4 -0
- package/locales/zh-CN/installer.json +25 -0
- package/package.json +23 -36
- package/schemas/install-manifest.schema.json +24 -0
- package/schemas/project-profile.schema.json +28 -0
- package/src/cli/args.mjs +41 -0
- package/src/cli/main.mjs +72 -0
- package/src/commands/add-host.mjs +29 -0
- package/src/commands/doctor.mjs +80 -0
- package/src/commands/install.mjs +149 -0
- package/src/commands/upgrade.mjs +30 -0
- package/src/git/config.mjs +61 -0
- package/src/hosts/registry.mjs +26 -0
- package/src/i18n.mjs +32 -0
- package/src/install/apply.mjs +124 -0
- package/src/install/manifest.mjs +40 -0
- package/src/install/plan.mjs +83 -0
- package/src/render/tokens.mjs +58 -0
- package/templates/engine/.agents/board/dev-tour.html +1940 -0
- package/templates/engine/.agents/board/index.html +835 -0
- package/templates/engine/.agents/commands/deploy.md +52 -0
- package/templates/engine/.agents/commands/maintain.md +76 -0
- package/templates/engine/.agents/commands/new-task.md +89 -0
- package/templates/engine/.agents/commands/pipeline-run.md +56 -0
- package/templates/engine/.agents/commands/pr-review.md +30 -0
- package/templates/engine/.agents/commands/review.md +93 -0
- package/templates/engine/.agents/commands/stages.md +256 -0
- package/templates/engine/.agents/config/commit-msg-rules.json +7 -0
- package/templates/engine/.agents/config/engine.json +11 -0
- package/templates/engine/.agents/config/gate-budgets.json +5 -0
- package/templates/engine/.agents/config/mechanism-registry.md +62 -0
- package/templates/engine/.agents/config/model-roles.json +26 -0
- package/templates/engine/.agents/config/model-roles.local.example.json +7 -0
- package/templates/engine/.agents/config/pr-review.json +67 -0
- package/templates/engine/.agents/config/principles.md +32 -0
- package/templates/engine/.agents/config/workflow-enums.txt +25 -0
- package/templates/engine/.agents/hooks/check-architecture.mjs +168 -0
- package/templates/engine/.agents/hooks/check-audit-fields.mjs +56 -0
- package/templates/engine/.agents/hooks/check-commit-plan-ref.mjs +84 -0
- package/templates/engine/.agents/hooks/check-confirm-order.mjs +281 -0
- package/templates/engine/.agents/hooks/check-delete-guard.mjs +63 -0
- package/templates/engine/.agents/hooks/check-notify-guard.mjs +55 -0
- package/templates/engine/.agents/hooks/commit-check.cjs +208 -0
- package/templates/engine/.agents/hooks/gates.json +33 -0
- package/templates/engine/.agents/hooks/local-pre-commit.mjs +27 -0
- package/templates/engine/.agents/hooks/pre-shell-check.cjs +361 -0
- package/templates/engine/.agents/hooks/pre-write-check.cjs +220 -0
- package/templates/engine/.agents/notes/gate-diet.md +75 -0
- package/templates/engine/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/templates/engine/.agents/notes/process-order-rule.md +21 -0
- package/templates/engine/.agents/notes/runtime-env.local.example.md +21 -0
- package/templates/engine/.agents/pipelines/_TEMPLATE.md +75 -0
- package/templates/engine/.agents/pipelines/pipeline-closing.md +28 -0
- package/templates/engine/.agents/pipelines//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
- package/templates/engine/.agents/roles/implementer.md +28 -0
- package/templates/engine/.agents/roles/independent-reviewer.md +39 -0
- package/templates/engine/.agents/roles/pr-adjudicator.md +27 -0
- package/templates/engine/.agents/roles/pr-finder.md +51 -0
- package/templates/engine/.agents/roles/pr-verifier.md +44 -0
- package/templates/engine/.agents/roles/ui-verifier.md +22 -0
- package/templates/engine/.agents/roles/wiki-compiler.md +47 -0
- package/templates/engine/.agents/scripts/agg-delegations.mjs +439 -0
- package/templates/engine/.agents/scripts/agg-judgments.mjs +301 -0
- package/templates/engine/.agents/scripts/agg-kb-usage.mjs +196 -0
- package/templates/engine/.agents/scripts/append-compensation.mjs +109 -0
- package/templates/engine/.agents/scripts/archive-sweep.mjs +229 -0
- package/templates/engine/.agents/scripts/auto-tour.mjs +77 -0
- package/templates/engine/.agents/scripts/board-port.mjs +17 -0
- package/templates/engine/.agents/scripts/check-doc-body-drift.mjs +102 -0
- package/templates/engine/.agents/scripts/check-engine-artifacts.mjs +54 -0
- package/templates/engine/.agents/scripts/check-hook-wiring.mjs +75 -0
- package/templates/engine/.agents/scripts/check-lane-surface.mjs +393 -0
- package/templates/engine/.agents/scripts/check-ledger-doc-presence.mjs +71 -0
- package/templates/engine/.agents/scripts/check-ledger-invariant.mjs +873 -0
- package/templates/engine/.agents/scripts/check-local-gate-config.mjs +95 -0
- package/templates/engine/.agents/scripts/check-local-gates.mjs +248 -0
- package/templates/engine/.agents/scripts/check-loop-kit.mjs +550 -0
- package/templates/engine/.agents/scripts/check-loop-rev-semantics.mjs +59 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s01-pairing.mjs +116 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s03x-regr-evidence.mjs +38 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s08-acceptance.mjs +130 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s15-fingerprint.mjs +152 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s23-convergence-audit.mjs +182 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s29-regr-enforcer.mjs +69 -0
- package/templates/engine/.agents/scripts/check-loop.mjs +131 -0
- package/templates/engine/.agents/scripts/check-regression-consistency.mjs +252 -0
- package/templates/engine/.agents/scripts/check-schema-residue.mjs +144 -0
- package/templates/engine/.agents/scripts/check-scope-range.mjs +156 -0
- package/templates/engine/.agents/scripts/check-scope.mjs +121 -0
- package/templates/engine/.agents/scripts/check-scripts-syntax.mjs +138 -0
- package/templates/engine/.agents/scripts/check-secrets-lite.mjs +239 -0
- package/templates/engine/.agents/scripts/check-secrets.mjs +104 -0
- package/templates/engine/.agents/scripts/check-test-impact-map.mjs +107 -0
- package/templates/engine/.agents/scripts/ci-assert-frontend-deps.mjs +42 -0
- package/templates/engine/.agents/scripts/ci-commit-hygiene.mjs +86 -0
- package/templates/engine/.agents/scripts/ci-install-gitleaks.mjs +75 -0
- package/templates/engine/.agents/scripts/ci-push-before.mjs +49 -0
- package/templates/engine/.agents/scripts/closeout.mjs +127 -0
- package/templates/engine/.agents/scripts/compact-ledgers.mjs +70 -0
- package/templates/engine/.agents/scripts/confirm-doc.mjs +737 -0
- package/templates/engine/.agents/scripts/delegation-presence.mjs +38 -0
- package/templates/engine/.agents/scripts/dev-tour-model.mjs +1398 -0
- package/templates/engine/.agents/scripts/dream-run.mjs +283 -0
- package/templates/engine/.agents/scripts/ensure-board.mjs +187 -0
- package/templates/engine/.agents/scripts/failure-attribution.mjs +11 -0
- package/templates/engine/.agents/scripts/fill-intent.mjs +60 -0
- package/templates/engine/.agents/scripts/fill-plan.mjs +105 -0
- package/templates/engine/.agents/scripts/fill-spec.mjs +72 -0
- package/templates/engine/.agents/scripts/gen-dev-tour.mjs +191 -0
- package/templates/engine/.agents/scripts/gen-effective-policy.mjs +113 -0
- package/templates/engine/.agents/scripts/gen-engine-map.mjs +292 -0
- package/templates/engine/.agents/scripts/gen-narrative-claims.mjs +275 -0
- package/templates/engine/.agents/scripts/gen-verify-evidence.mjs +115 -0
- package/templates/engine/.agents/scripts/gen-wiki-board.mjs +221 -0
- package/templates/engine/.agents/scripts/gen-workflow-index.mjs +201 -0
- package/templates/engine/.agents/scripts/gen-workflow-metrics.mjs +692 -0
- package/templates/engine/.agents/scripts/git-merge-jsonl.mjs +62 -0
- package/templates/engine/.agents/scripts/judgment-ledger.mjs +68 -0
- package/templates/engine/.agents/scripts/kb-cache-evict.mjs +50 -0
- package/templates/engine/.agents/scripts/kb-search.mjs +423 -0
- package/templates/engine/.agents/scripts/lane-surface-audit.mjs +145 -0
- package/templates/engine/.agents/scripts/ledger-loader.mjs +77 -0
- package/templates/engine/.agents/scripts/ledger-shards.mjs +346 -0
- package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
- package/templates/engine/.agents/scripts/pipeline-run.mjs +964 -0
- package/templates/engine/.agents/scripts/policy.mjs +250 -0
- package/templates/engine/.agents/scripts/pr-create.mjs +54 -0
- package/templates/engine/.agents/scripts/pr-review.mjs +1551 -0
- package/templates/engine/.agents/scripts/quote-grounding.mjs +233 -0
- package/templates/engine/.agents/scripts/regen-ledgers.mjs +59 -0
- package/templates/engine/.agents/scripts/rewrite-file.mjs +135 -0
- package/templates/engine/.agents/scripts/rule-budget.mjs +246 -0
- package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
- package/templates/engine/.agents/scripts/test-impact-lib.mjs +451 -0
- package/templates/engine/.agents/scripts/test-impact.mjs +105 -0
- package/templates/engine/.agents/scripts/trust-mode.mjs +130 -0
- package/templates/engine/.agents/scripts/verify-scope.mjs +163 -0
- package/templates/engine/.agents/scripts/verify-wiki-consistency.mjs +264 -0
- package/templates/engine/.agents/scripts/verify.mjs +847 -0
- package/templates/engine/.agents/scripts/warn-format.mjs +57 -0
- package/templates/engine/.agents/scripts/wf-journal.mjs +230 -0
- package/templates/engine/.agents/scripts/workflow-board-server.mjs +696 -0
- package/templates/engine/.agents/scripts/workflow-enums.mjs +70 -0
- package/templates/engine/.agents/scripts/workflows-check.mjs +260 -0
- package/templates/engine/.agents/settings.json +33 -0
- package/templates/engine/.agents/skills/arena/SKILL.md +50 -0
- package/templates/engine/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/templates/engine/.agents/skills/blast-radius/SKILL.md +53 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/scripts/quality-gates.mjs +430 -0
- package/templates/engine/.agents/skills/dev-tour/SKILL.md +98 -0
- package/templates/engine/.agents/skills/dream/SKILL.md +63 -0
- package/templates/engine/.agents/skills/eval/SKILL.md +42 -0
- package/templates/engine/.agents/skills/eval/scripts/eval-score.mjs +59 -0
- package/templates/engine/.agents/skills/interrogate/SKILL.md +49 -0
- package/templates/engine/.agents/skills/interrogate/scripts/interrogate-plan.mjs +72 -0
- package/templates/engine/.agents/skills/number-vetting/SKILL.md +35 -0
- package/templates/engine/.agents/skills/page-refactor/SKILL.md +192 -0
- package/templates/engine/.agents/skills/page-refactor/references/templates.md +989 -0
- package/templates/engine/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/templates/engine/.agents/skills/papercut-fix/references/response-template.md +81 -0
- package/templates/engine/.agents/skills/pause-safely/SKILL.md +31 -0
- package/templates/engine/.agents/skills/perf/SKILL.md +42 -0
- package/templates/engine/.agents/skills/review-method/SKILL.md +92 -0
- package/templates/engine/.agents/skills/review-method/golden-set.md +61 -0
- package/templates/engine/.agents/skills/session-resume/SKILL.md +69 -0
- package/templates/engine/.agents/skills/session-resume/scripts/worktree-audit.mjs +110 -0
- package/templates/engine/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/templates/engine/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/templates/engine/.agents/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/templates/engine/.agents/skills/show-me-your-work/scripts/decision-log.mjs +24 -0
- package/templates/engine/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/templates/engine/.agents/skills/tfs-pr/scripts/tfs-pr.mjs +947 -0
- package/templates/engine/.agents/skills/verify-ui/SKILL.md +116 -0
- package/templates/engine/.agents/skills/verify-ui/features/.gitkeep +0 -0
- package/templates/engine/.agents/skills/verify-ui/scripts/gen-verify-feature.mjs +114 -0
- package/templates/engine/.agents/skills/visual-parity/SKILL.md +35 -0
- package/templates/engine/.agents/skills/why/SKILL.md +56 -0
- package/templates/engine/.agents/skills/why/scripts/why-evidence.mjs +74 -0
- package/templates/engine/.agents/skills/wiki/SKILL.md +53 -0
- package/templates/engine/.agents/tests/auto-tour.test.mjs +82 -0
- package/templates/engine/.agents/tests/dev-tour-model.test.mjs +452 -0
- package/templates/engine/.agents/tests/fill-plan-lite.test.mjs +46 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.md +14 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.model.json +179 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.md +21 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.model.json +194 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.md +20 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.model.json +225 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.md +15 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.model.json +160 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.model.json +266 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.md +17 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.model.json +359 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.md +16 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.model.json +131 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.model.json +190 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.model.json +362 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.model.json +224 -0
- package/templates/engine/.agents/tests/tools/gen-synthetic-plan.mjs +108 -0
- package/templates/git/.gitattributes +22 -0
- package/templates/git/.githooks/commit-msg +72 -0
- package/templates/git/.githooks/post-commit +62 -0
- package/templates/git/.githooks/pre-commit +197 -0
- package/templates/git/.githooks/pre-merge-commit +28 -0
- package/templates/git/.githooks/pre-push +201 -0
- package/templates/git/.gitignore.engine +11 -0
- package/templates/hosts/claude/CLAUDE.md +55 -0
- package/templates/hosts/claude/agents/implementer.md +7 -0
- package/templates/hosts/claude/agents/independent-reviewer.md +8 -0
- package/templates/hosts/claude/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/claude/agents/pr-finder.md +8 -0
- package/templates/hosts/claude/agents/pr-verifier.md +8 -0
- package/templates/hosts/claude/agents/ui-verifier.md +8 -0
- package/templates/hosts/claude/agents/wiki-compiler.md +8 -0
- package/templates/hosts/claude/commands/wf-deploy.md +10 -0
- package/templates/hosts/claude/commands/wf-maintain.md +10 -0
- package/templates/hosts/claude/commands/wf-new-task.md +10 -0
- package/templates/hosts/claude/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/claude/commands/wf-pr-review.md +10 -0
- package/templates/hosts/claude/commands/wf-review.md +10 -0
- package/templates/hosts/claude/commands/wf-stages.md +10 -0
- package/templates/hosts/claude/settings.json +57 -0
- package/templates/hosts/cline/agents/implementer.yml +15 -0
- package/templates/hosts/cline/agents/independent-reviewer.yml +20 -0
- package/templates/hosts/cline/agents/pr-adjudicator.yml +18 -0
- package/templates/hosts/cline/agents/pr-finder.yml +19 -0
- package/templates/hosts/cline/agents/pr-verifier.yml +18 -0
- package/templates/hosts/cline/agents/ui-verifier.yml +17 -0
- package/templates/hosts/cline/agents/wiki-compiler.yml +20 -0
- package/templates/hosts/cline/hooks/PreToolUse.cjs +260 -0
- package/templates/hosts/cline/workflows/wf-deploy.md +8 -0
- package/templates/hosts/cline/workflows/wf-maintain.md +8 -0
- package/templates/hosts/cline/workflows/wf-new-task.md +8 -0
- package/templates/hosts/cline/workflows/wf-pipeline-run.md +8 -0
- package/templates/hosts/cline/workflows/wf-pr-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-stages.md +8 -0
- package/templates/hosts/codebuddy/CODEBUDDY.md +7 -0
- package/templates/hosts/codebuddy/agents/implementer.md +9 -0
- package/templates/hosts/codebuddy/agents/independent-reviewer.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-finder.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-verifier.md +10 -0
- package/templates/hosts/codebuddy/agents/ui-verifier.md +11 -0
- package/templates/hosts/codebuddy/agents/wiki-compiler.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-deploy.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-maintain.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-new-task.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pr-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-stages.md +10 -0
- package/templates/hosts/codebuddy/rules/backend-scope.md +5 -0
- package/templates/hosts/codebuddy/rules/frontend-scope.md +5 -0
- package/templates/hosts/codebuddy/settings.json +31 -0
- package/templates/hosts/codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/templates/hosts/commandcode/agents/implementer.md +10 -0
- package/templates/hosts/commandcode/agents/independent-reviewer.md +9 -0
- package/templates/hosts/commandcode/agents/pr-adjudicator.md +9 -0
- package/templates/hosts/commandcode/agents/pr-finder.md +9 -0
- package/templates/hosts/commandcode/agents/pr-verifier.md +9 -0
- package/templates/hosts/commandcode/agents/ui-verifier.md +11 -0
- package/templates/hosts/commandcode/agents/wiki-compiler.md +10 -0
- package/templates/hosts/commandcode/commands/wf-deploy.md +9 -0
- package/templates/hosts/commandcode/commands/wf-maintain.md +9 -0
- package/templates/hosts/commandcode/commands/wf-new-task.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pr-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-stages.md +9 -0
- package/templates/hosts/commandcode/settings.json +59 -0
- package/templates/hosts/opencode/agents/implementer.md +51 -0
- package/templates/hosts/opencode/agents/independent-reviewer.md +18 -0
- package/templates/hosts/opencode/agents/pr-adjudicator.md +18 -0
- package/templates/hosts/opencode/agents/pr-finder.md +18 -0
- package/templates/hosts/opencode/agents/pr-verifier.md +18 -0
- package/templates/hosts/opencode/agents/ui-verifier.md +45 -0
- package/templates/hosts/opencode/agents/wiki-compiler.md +51 -0
- package/templates/hosts/opencode/commands/wf-deploy.md +7 -0
- package/templates/hosts/opencode/commands/wf-maintain.md +7 -0
- package/templates/hosts/opencode/commands/wf-new-task.md +7 -0
- package/templates/hosts/opencode/commands/wf-pipeline-run.md +7 -0
- package/templates/hosts/opencode/commands/wf-pr-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-stages.md +7 -0
- package/templates/hosts/pi/agents/implementer.md +10 -0
- package/templates/hosts/pi/agents/independent-reviewer.md +11 -0
- package/templates/hosts/pi/agents/pr-adjudicator.md +11 -0
- package/templates/hosts/pi/agents/pr-finder.md +10 -0
- package/templates/hosts/pi/agents/pr-verifier.md +10 -0
- package/templates/hosts/pi/agents/ui-verifier.md +10 -0
- package/templates/hosts/pi/agents/wiki-compiler.md +10 -0
- package/templates/hosts/pi/extensions/lib/gates-core.cjs +196 -0
- package/templates/hosts/pi/extensions/shipyard-gates.ts +95 -0
- package/templates/hosts/pi/settings.json +5 -0
- package/templates/hosts/qoder/agents/implementer.md +9 -0
- package/templates/hosts/qoder/agents/independent-reviewer.md +10 -0
- package/templates/hosts/qoder/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/qoder/agents/pr-finder.md +10 -0
- package/templates/hosts/qoder/agents/pr-verifier.md +10 -0
- package/templates/hosts/qoder/agents/ui-verifier.md +10 -0
- package/templates/hosts/qoder/agents/wiki-compiler.md +10 -0
- package/templates/hosts/qoder/commands/wf-deploy.md +8 -0
- package/templates/hosts/qoder/commands/wf-maintain.md +8 -0
- package/templates/hosts/qoder/commands/wf-new-task.md +8 -0
- package/templates/hosts/qoder/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/qoder/commands/wf-pr-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-stages.md +8 -0
- package/templates/hosts/qoder/settings.json +63 -0
- package/templates/hosts/qwen/agents/implementer.md +8 -0
- package/templates/hosts/qwen/agents/independent-reviewer.md +8 -0
- package/templates/hosts/qwen/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/qwen/agents/pr-finder.md +8 -0
- package/templates/hosts/qwen/agents/pr-verifier.md +8 -0
- package/templates/hosts/qwen/agents/ui-verifier.md +8 -0
- package/templates/hosts/qwen/agents/wiki-compiler.md +11 -0
- package/templates/hosts/qwen/commands/wf-deploy.md +9 -0
- package/templates/hosts/qwen/commands/wf-maintain.md +9 -0
- package/templates/hosts/qwen/commands/wf-new-task.md +9 -0
- package/templates/hosts/qwen/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/qwen/commands/wf-pr-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-stages.md +9 -0
- package/templates/hosts/qwen/settings.json +59 -0
- package/templates/hosts/trae/agents/implementer.md +9 -0
- package/templates/hosts/trae/agents/independent-reviewer.md +10 -0
- package/templates/hosts/trae/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/trae/agents/pr-finder.md +10 -0
- package/templates/hosts/trae/agents/pr-verifier.md +10 -0
- package/templates/hosts/trae/agents/ui-verifier.md +10 -0
- package/templates/hosts/trae/agents/wiki-compiler.md +10 -0
- package/templates/hosts/trae/commands/wf-deploy.md +8 -0
- package/templates/hosts/trae/commands/wf-maintain.md +8 -0
- package/templates/hosts/trae/commands/wf-new-task.md +8 -0
- package/templates/hosts/trae/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/trae/commands/wf-pr-review.md +8 -0
- package/templates/hosts/trae/commands/wf-review.md +8 -0
- package/templates/hosts/trae/commands/wf-stages.md +8 -0
- package/templates/hosts/trae/hooks.json +17 -0
- package/templates/hosts/trae/rules/backend-scope.md +5 -0
- package/templates/hosts/trae/rules/frontend-scope.md +5 -0
- package/templates/hosts/zcode/agents/implementer.md +8 -0
- package/templates/hosts/zcode/agents/independent-reviewer.md +8 -0
- package/templates/hosts/zcode/agents/ui-verifier.md +8 -0
- package/templates/hosts/zcode/agents/wiki-compiler.md +8 -0
- package/templates/hosts/zcode/config.json +31 -0
- package/templates/hosts/zcode/workflows/code-review.dwf.ts +428 -0
- package/templates/hosts/zcode/workflows/fullchain-flow-test.dwf.ts +898 -0
- package/templates/profiles/dotnet/.agents/config/lane-surfaces.txt +33 -0
- package/templates/profiles/dotnet/.agents/config/rule-budgets.txt +84 -0
- package/templates/profiles/dotnet/.agents/config/test-impact-map.json +590 -0
- package/templates/profiles/dotnet/.agents/config/workflow-modules.txt +18 -0
- package/templates/profiles/dotnet/.agents/hooks/commit-check.config.json +18 -0
- package/templates/profiles/dotnet/.agents/hooks/delete-guard-allowlist.txt +28 -0
- package/templates/profiles/dotnet/.agents/notes/runtime-env.md +178 -0
- package/templates/profiles/dotnet/AGENTS.md +52 -0
- package/templates/profiles/empty/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/empty/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/empty/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/empty/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/empty/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/empty/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/empty/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/empty/AGENTS.md +52 -0
- package/templates/profiles/node/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/node/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/node/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/node/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/node/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/node/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/node/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/node/AGENTS.md +52 -0
- package/templates/scaffold/wiki/INDEX.md +33 -0
- package/templates/scaffold/wiki/drafts-archive/README.md +7 -0
- package/templates/scaffold/wiki//344/272/247/345/223/201/351/234/200/346/261/202/.gitkeep +0 -0
- package/templates/scaffold/wiki//345/274/200/345/217/221/346/226/271/346/241/210/.gitkeep +0 -0
- package/templates/scaffold/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/templates/scaffold/wiki//346/265/213/350/257/225/346/212/245/345/221/212/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/224/250/346/210/267/345/212/237/350/203/275/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/templates/scaffold/wiki//351/241/271/347/233/256/350/247/204/350/214/203/.gitkeep +0 -0
- package/templates/scaffold/workflow/INDEX.md +13 -0
- package/templates/scaffold/workflow/README.md +67 -0
- package/templates/scaffold/workflow/archive/README.md +3 -0
- package/templates/scaffold/workflow/delegations.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/delegations.md +4 -0
- package/templates/scaffold/workflow/effective-policy.md +4 -0
- package/templates/scaffold/workflow/evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/gate-cost.md +4 -0
- package/templates/scaffold/workflow/gate-metrics.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/incidents/_TEMPLATE.md +49 -0
- package/templates/scaffold/workflow/intents/_TEMPLATE.md +43 -0
- package/templates/scaffold/workflow/metrics.md +4 -0
- package/templates/scaffold/workflow/papercuts.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/papercuts.md +3 -0
- package/templates/scaffold/workflow/plans/_TEMPLATE.md +47 -0
- package/templates/scaffold/workflow/regression-checklist.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/regression-checklist.md +3 -0
- package/templates/scaffold/workflow/research/.gitkeep +0 -0
- package/templates/scaffold/workflow/reviews.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/specs/_TEMPLATE.md +87 -0
- package/templates/scaffold/workflow/verify-evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/verify-evidence.md +4 -0
- package/LICENSE +0 -21
- package/modules/gates/README.md +0 -25
- package/modules/gates/dotnet-ca/README.md +0 -24
- package/modules/gates/dotnet-ca/check-architecture.sh +0 -150
- package/modules/gates/dotnet-ca/local-pre-commit.line +0 -1
- package/modules/gates/generated-readonly/README.md +0 -13
- package/modules/gates/generated-readonly/check-generated.mjs +0 -61
- package/modules/gates/generated-readonly/local-pre-commit.line +0 -1
- package/modules/gates/node-layer/README.md +0 -9
- package/modules/gates/node-layer/check-node-layer.mjs +0 -29
- package/modules/gates/node-layer/local-pre-commit.line +0 -1
- package/modules/gates/py-import/README.md +0 -9
- package/modules/gates/py-import/check-py-import.mjs +0 -30
- package/modules/gates/py-import/local-pre-commit.line +0 -1
- package/modules/gates/test-protect/README.md +0 -23
- package/modules/gates/test-protect/check-test-protect.mjs +0 -64
- package/modules/gates/test-protect/local-pre-commit.line +0 -1
- package/modules/hosts/README.md +0 -57
- package/modules/hosts/claude/agents/implementer.md +0 -51
- package/modules/hosts/claude/agents/independent-reviewer.md +0 -49
- package/modules/hosts/claude/agents/ui-verifier.md +0 -48
- package/modules/hosts/claude/commands/wf-build.md +0 -69
- package/modules/hosts/claude/commands/wf-deploy.md +0 -58
- package/modules/hosts/claude/commands/wf-design.md +0 -49
- package/modules/hosts/claude/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/claude/commands/wf-maintain.md +0 -76
- package/modules/hosts/claude/commands/wf-new-task.md +0 -102
- package/modules/hosts/claude/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/claude/commands/wf-plan.md +0 -40
- package/modules/hosts/claude/commands/wf-review.md +0 -49
- package/modules/hosts/claude/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/claude/commands/wf-test.md +0 -68
- package/modules/hosts/codex/agents/implementer.md +0 -51
- package/modules/hosts/codex/agents/independent-reviewer.md +0 -49
- package/modules/hosts/codex/agents/ui-verifier.md +0 -48
- package/modules/hosts/codex/commands/wf-build.md +0 -69
- package/modules/hosts/codex/commands/wf-deploy.md +0 -58
- package/modules/hosts/codex/commands/wf-design.md +0 -49
- package/modules/hosts/codex/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/codex/commands/wf-maintain.md +0 -76
- package/modules/hosts/codex/commands/wf-new-task.md +0 -102
- package/modules/hosts/codex/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/codex/commands/wf-plan.md +0 -40
- package/modules/hosts/codex/commands/wf-review.md +0 -49
- package/modules/hosts/codex/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/codex/commands/wf-test.md +0 -68
- package/modules/hosts/codex/skills/flow-kit/SKILL.md +0 -14
- package/modules/hosts/cursor/agents/implementer.md +0 -51
- package/modules/hosts/cursor/agents/independent-reviewer.md +0 -49
- package/modules/hosts/cursor/agents/ui-verifier.md +0 -48
- package/modules/hosts/cursor/commands/wf-build.md +0 -69
- package/modules/hosts/cursor/commands/wf-deploy.md +0 -58
- package/modules/hosts/cursor/commands/wf-design.md +0 -49
- package/modules/hosts/cursor/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/cursor/commands/wf-maintain.md +0 -76
- package/modules/hosts/cursor/commands/wf-new-task.md +0 -102
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/cursor/commands/wf-plan.md +0 -40
- package/modules/hosts/cursor/commands/wf-review.md +0 -49
- package/modules/hosts/cursor/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/cursor/commands/wf-test.md +0 -68
- package/modules/hosts/omp/agents/implementer.md +0 -52
- package/modules/hosts/omp/agents/independent-reviewer.md +0 -50
- package/modules/hosts/omp/agents/ui-verifier.md +0 -49
- package/modules/hosts/opencode/agents/implementer.md +0 -59
- package/modules/hosts/opencode/agents/independent-reviewer.md +0 -53
- package/modules/hosts/opencode/agents/ui-verifier.md +0 -52
- package/modules/hosts/opencode/commands/wf-build.md +0 -69
- package/modules/hosts/opencode/commands/wf-deploy.md +0 -58
- package/modules/hosts/opencode/commands/wf-design.md +0 -49
- package/modules/hosts/opencode/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/opencode/commands/wf-maintain.md +0 -76
- package/modules/hosts/opencode/commands/wf-new-task.md +0 -102
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/opencode/commands/wf-plan.md +0 -40
- package/modules/hosts/opencode/commands/wf-review.md +0 -49
- package/modules/hosts/opencode/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/opencode/commands/wf-test.md +0 -68
- package/modules/hosts/trae/agents/implementer.md +0 -52
- package/modules/hosts/trae/agents/independent-reviewer.md +0 -51
- package/modules/hosts/trae/agents/ui-verifier.md +0 -50
- package/modules/hosts/trae/commands/wf-build.md +0 -70
- package/modules/hosts/trae/commands/wf-deploy.md +0 -59
- package/modules/hosts/trae/commands/wf-design.md +0 -50
- package/modules/hosts/trae/commands/wf-gate-checklist.md +0 -78
- package/modules/hosts/trae/commands/wf-maintain.md +0 -77
- package/modules/hosts/trae/commands/wf-new-task.md +0 -103
- package/modules/hosts/trae/commands/wf-pipeline-run.md +0 -36
- package/modules/hosts/trae/commands/wf-plan.md +0 -41
- package/modules/hosts/trae/commands/wf-review.md +0 -50
- package/modules/hosts/trae/commands/wf-sync-hosts.md +0 -65
- package/modules/hosts/trae/commands/wf-test.md +0 -69
- package/modules/hosts/trae/hooks/post-edit-check.cjs +0 -98
- package/modules/hosts/trae/hooks/pre-shell-check.cjs +0 -192
- package/modules/hosts/trae/hooks/resolve-shell.cjs +0 -30
- package/modules/hosts/trae/hooks.json +0 -29
- package/modules/hosts/trae/rules/beautify-input-chinese.md +0 -6
- package/modules/hosts/trae/rules/git-commit-message.md +0 -10
- package/modules/hosts/trae/rules/project-workflow.md +0 -14
- package/modules/hosts/zcode/agents/implementer.md +0 -51
- package/modules/hosts/zcode/agents/independent-reviewer.md +0 -49
- package/modules/hosts/zcode/agents/ui-verifier.md +0 -48
- package/src/add-gate.mjs +0 -116
- package/src/add-gate.test.mjs +0 -103
- package/src/add-host.mjs +0 -68
- package/src/cli.mjs +0 -169
- package/src/doctor.mjs +0 -629
- package/src/executor.mjs +0 -262
- package/src/executor.test.mjs +0 -295
- package/src/fresh-init.test.mjs +0 -64
- package/src/gate-dotnet-ca.test.mjs +0 -124
- package/src/gates.test.mjs +0 -143
- package/src/init.mjs +0 -382
- package/src/init.test.mjs +0 -163
- package/src/instance-ref.test.mjs +0 -62
- package/src/jscpd-drift.test.mjs +0 -145
- package/src/pack.test.mjs +0 -24
- package/src/profiles.mjs +0 -183
- package/src/render.mjs +0 -132
- package/src/rule-budget.test.mjs +0 -103
- package/src/run-tests.mjs +0 -56
- package/src/stack-profile.test.mjs +0 -95
- package/src/sync-hosts.mjs +0 -257
- package/src/sync-hosts.test.mjs +0 -291
- package/src/sync.mjs +0 -228
- package/src/sync.test.mjs +0 -452
- package/src/trae-hooks.test.mjs +0 -127
- package/src/validate.mjs +0 -77
- package/src/validate.test.mjs +0 -95
- package/templates/.gitattributes +0 -17
- package/templates/AGENTS.md +0 -58
- package/templates/_agents/board/index.html +0 -676
- package/templates/_agents/commands/build.md +0 -84
- package/templates/_agents/commands/deploy.md +0 -66
- package/templates/_agents/commands/design.md +0 -63
- package/templates/_agents/commands/gate-checklist.md +0 -91
- package/templates/_agents/commands/maintain.md +0 -90
- package/templates/_agents/commands/new-task.md +0 -110
- package/templates/_agents/commands/pipeline-run.md +0 -43
- package/templates/_agents/commands/plan.md +0 -48
- package/templates/_agents/commands/review.md +0 -62
- package/templates/_agents/commands/sync-hosts.md +0 -77
- package/templates/_agents/commands/test.md +0 -87
- package/templates/_agents/control-surfaces.txt +0 -53
- package/templates/_agents/engine-lock.json +0 -342
- package/templates/_agents/hooks/check-index-incremental.mjs +0 -48
- package/templates/_agents/hooks/check-pairing-incremental.mjs +0 -66
- package/templates/_agents/hooks/check-wiki-ledger.mjs +0 -30
- package/templates/_agents/hooks/commit-check.cjs +0 -193
- package/templates/_agents/hooks/local-pre-commit +0 -6
- package/templates/_agents/lane-surfaces.txt +0 -17
- package/templates/_agents/level-hints.txt +0 -30
- package/templates/_agents/loop/papercut-debt/DESIGN.md +0 -112
- package/templates/_agents/mechanism-registry.md +0 -35
- package/templates/_agents/metric-claims.txt +0 -81
- package/templates/_agents/notes/engine-internals.md +0 -17
- package/templates/_agents/notes/runtime-env.md +0 -18
- package/templates/_agents/roles/implementer.md +0 -47
- package/templates/_agents/roles/independent-reviewer.md +0 -45
- package/templates/_agents/roles/ui-verifier.md +0 -44
- package/templates/_agents/rule-budgets.txt +0 -20
- package/templates/_agents/scripts/agg-delegations.cjs +0 -302
- package/templates/_agents/scripts/agg-delegations.test.mjs +0 -282
- package/templates/_agents/scripts/agg-gate-stats.mjs +0 -113
- package/templates/_agents/scripts/agg-gate-stats.test.mjs +0 -95
- package/templates/_agents/scripts/agg-judgments.mjs +0 -156
- package/templates/_agents/scripts/agg-judgments.test.mjs +0 -93
- package/templates/_agents/scripts/archive-sweep.mjs +0 -235
- package/templates/_agents/scripts/archive-sweep.test.mjs +0 -129
- package/templates/_agents/scripts/check-attribution.mjs +0 -37
- package/templates/_agents/scripts/check-convergence.mjs +0 -124
- package/templates/_agents/scripts/check-engine-integrity.mjs +0 -220
- package/templates/_agents/scripts/check-engine-integrity.test.mjs +0 -215
- package/templates/_agents/scripts/check-funnel.mjs +0 -56
- package/templates/_agents/scripts/check-hygiene.mjs +0 -167
- package/templates/_agents/scripts/check-hygiene.test.mjs +0 -182
- package/templates/_agents/scripts/check-index-incremental.test.mjs +0 -73
- package/templates/_agents/scripts/check-lane-surface.mjs +0 -238
- package/templates/_agents/scripts/check-lane-surface.test.mjs +0 -302
- package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -586
- package/templates/_agents/scripts/check-ledger-invariant.test.mjs +0 -639
- package/templates/_agents/scripts/check-loop-rev.test.mjs +0 -336
- package/templates/_agents/scripts/check-loop-unit.test.mjs +0 -103
- package/templates/_agents/scripts/check-loop.mjs +0 -1987
- package/templates/_agents/scripts/check-loop.sh +0 -6
- package/templates/_agents/scripts/check-loop.test.mjs +0 -3912
- package/templates/_agents/scripts/check-metric-claims.mjs +0 -277
- package/templates/_agents/scripts/check-prejudgment.mjs +0 -64
- package/templates/_agents/scripts/check-registry.mjs +0 -45
- package/templates/_agents/scripts/check-scope.mjs +0 -96
- package/templates/_agents/scripts/check-scope.test.mjs +0 -99
- package/templates/_agents/scripts/check-scripts-syntax.mjs +0 -84
- package/templates/_agents/scripts/check-scripts-syntax.test.mjs +0 -72
- package/templates/_agents/scripts/check-spec-verif.mjs +0 -47
- package/templates/_agents/scripts/check-stage-index.mjs +0 -40
- package/templates/_agents/scripts/check-stage-index.test.mjs +0 -77
- package/templates/_agents/scripts/closeout-l1.mjs +0 -217
- package/templates/_agents/scripts/closeout-l1.test.mjs +0 -105
- package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -205
- package/templates/_agents/scripts/compact-ledgers.mjs +0 -97
- package/templates/_agents/scripts/compact-ledgers.test.mjs +0 -162
- package/templates/_agents/scripts/confirm-doc.mjs +0 -610
- package/templates/_agents/scripts/confirm-doc.test.mjs +0 -1119
- package/templates/_agents/scripts/doctor.test.mjs +0 -770
- package/templates/_agents/scripts/draft-sediment.mjs +0 -178
- package/templates/_agents/scripts/draft-sediment.test.mjs +0 -272
- package/templates/_agents/scripts/edit-face-check.mjs +0 -109
- package/templates/_agents/scripts/edit-face-check.test.mjs +0 -99
- package/templates/_agents/scripts/ensure-board.mjs +0 -185
- package/templates/_agents/scripts/fill-intent.mjs +0 -91
- package/templates/_agents/scripts/fill-intent.test.mjs +0 -113
- package/templates/_agents/scripts/fill-plan.mjs +0 -79
- package/templates/_agents/scripts/fill-plan.test.mjs +0 -224
- package/templates/_agents/scripts/fill-spec.mjs +0 -70
- package/templates/_agents/scripts/fill-spec.test.mjs +0 -266
- package/templates/_agents/scripts/fixture-scripts.mjs +0 -153
- package/templates/_agents/scripts/fixture-scripts.test.mjs +0 -112
- package/templates/_agents/scripts/gate-checklist.mjs +0 -209
- package/templates/_agents/scripts/gate-checklist.test.mjs +0 -201
- package/templates/_agents/scripts/gate-seg.mjs +0 -54
- package/templates/_agents/scripts/gate-seg.test.mjs +0 -112
- package/templates/_agents/scripts/gen-effective-policy.mjs +0 -107
- package/templates/_agents/scripts/gen-effective-policy.test.mjs +0 -100
- package/templates/_agents/scripts/gen-verify-evidence.mjs +0 -107
- package/templates/_agents/scripts/gen-verify-evidence.test.mjs +0 -84
- package/templates/_agents/scripts/gen-wiki-board.mjs +0 -276
- package/templates/_agents/scripts/gen-wiki-board.test.mjs +0 -249
- package/templates/_agents/scripts/gen-workflow-dashboard.mjs +0 -251
- package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +0 -188
- package/templates/_agents/scripts/gen-workflow-index.mjs +0 -201
- package/templates/_agents/scripts/gen-workflow-index.test.mjs +0 -152
- package/templates/_agents/scripts/gen-workflow-metrics.mjs +0 -466
- package/templates/_agents/scripts/gen-workflow-metrics.test.mjs +0 -343
- package/templates/_agents/scripts/git-merge-jsonl.mjs +0 -63
- package/templates/_agents/scripts/git-merge-jsonl.test.mjs +0 -125
- package/templates/_agents/scripts/judgment-ledger.mjs +0 -65
- package/templates/_agents/scripts/judgment-ledger.test.mjs +0 -129
- package/templates/_agents/scripts/kb-cache-evict.mjs +0 -50
- package/templates/_agents/scripts/kb-cache-evict.test.mjs +0 -104
- package/templates/_agents/scripts/kb-search.mjs +0 -413
- package/templates/_agents/scripts/kb-search.test.mjs +0 -299
- package/templates/_agents/scripts/lane-surface-audit.mjs +0 -143
- package/templates/_agents/scripts/lane-surface-audit.test.mjs +0 -93
- package/templates/_agents/scripts/ledger-doc-chain.test.mjs +0 -166
- package/templates/_agents/scripts/ledger-loader.mjs +0 -108
- package/templates/_agents/scripts/ledger-loader.test.mjs +0 -131
- package/templates/_agents/scripts/ledger-prune.mjs +0 -96
- package/templates/_agents/scripts/ledger-prune.test.mjs +0 -120
- package/templates/_agents/scripts/ledger-shards.mjs +0 -344
- package/templates/_agents/scripts/ledger-shards.test.mjs +0 -356
- package/templates/_agents/scripts/ledger-ts-monotonic.test.mjs +0 -135
- package/templates/_agents/scripts/level-criteria.mjs +0 -231
- package/templates/_agents/scripts/level-criteria.test.mjs +0 -281
- package/templates/_agents/scripts/mechanism-retire-watch.mjs +0 -183
- package/templates/_agents/scripts/mechanism-retire-watch.test.mjs +0 -114
- package/templates/_agents/scripts/papercut-debt-controller.mjs +0 -141
- package/templates/_agents/scripts/papercut-debt-controller.test.mjs +0 -127
- package/templates/_agents/scripts/papercut-debt-sensor.mjs +0 -170
- package/templates/_agents/scripts/papercut-debt-sensor.test.mjs +0 -146
- package/templates/_agents/scripts/pipeline-run-docs.mjs +0 -76
- package/templates/_agents/scripts/pipeline-run-run.mjs +0 -63
- package/templates/_agents/scripts/pipeline-run.mjs +0 -867
- package/templates/_agents/scripts/pipeline-run.test.mjs +0 -517
- package/templates/_agents/scripts/policy.mjs +0 -281
- package/templates/_agents/scripts/pre-push.test.mjs +0 -105
- package/templates/_agents/scripts/resolve-merge-conflicts.mjs +0 -110
- package/templates/_agents/scripts/resolve-merge-conflicts.test.mjs +0 -87
- package/templates/_agents/scripts/rewrite-file.mjs +0 -133
- package/templates/_agents/scripts/rewrite-file.test.mjs +0 -148
- package/templates/_agents/scripts/rule-budget.mjs +0 -96
- package/templates/_agents/scripts/rule-budget.test.mjs +0 -118
- package/templates/_agents/scripts/run-tests.mjs +0 -99
- package/templates/_agents/scripts/run-tests.test.mjs +0 -105
- package/templates/_agents/scripts/solidify-task.mjs +0 -109
- package/templates/_agents/scripts/solidify-task.test.mjs +0 -129
- package/templates/_agents/scripts/stage-gates.mjs +0 -343
- package/templates/_agents/scripts/stage-gates.test.mjs +0 -105
- package/templates/_agents/scripts/trust-mode.mjs +0 -67
- package/templates/_agents/scripts/trust-mode.test.mjs +0 -110
- package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -253
- package/templates/_agents/scripts/verify-wiki-consistency.test.mjs +0 -123
- package/templates/_agents/scripts/verify.mjs +0 -345
- package/templates/_agents/scripts/verify.test.mjs +0 -373
- package/templates/_agents/scripts/wf-journal.mjs +0 -231
- package/templates/_agents/scripts/wf-journal.test.mjs +0 -216
- package/templates/_agents/scripts/wiki-search.mjs +0 -19
- package/templates/_agents/scripts/wiki-search.test.mjs +0 -57
- package/templates/_agents/scripts/workflow-board-server.mjs +0 -393
- package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -201
- package/templates/_agents/scripts/workflow-enums.mjs +0 -70
- package/templates/_agents/scripts/workflow-enums.test.mjs +0 -118
- package/templates/_agents/scripts/workflows-check.mjs +0 -260
- package/templates/_agents/scripts/workflows-check.test.mjs +0 -278
- package/templates/_agents/scripts-test-exempt.txt +0 -16
- package/templates/_agents/skills/papercut-fix/SKILL.md +0 -60
- package/templates/_agents/skills/papercut-fix/references/response-template.md +0 -81
- package/templates/_agents/skills/review-method/SKILL.md +0 -58
- package/templates/_agents/skills/verify-ui/SKILL.md +0 -61
- package/templates/_agents/skills/wiki/SKILL.md +0 -106
- package/templates/_agents/workflow-enums.txt +0 -26
- package/templates/_agents/workflow-modules.txt +0 -11
- package/templates/_agents/workflows/_TEMPLATE.md +0 -75
- package/templates/_agents/workflows/pipeline-closing.md +0 -28
- package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +0 -16
- package/templates/_githooks/commit-msg +0 -17
- package/templates/_githooks/post-commit +0 -10
- package/templates/_githooks/pre-commit +0 -126
- package/templates/_githooks/pre-merge-commit +0 -29
- package/templates/_githooks/pre-push +0 -136
- package/templates/_github/workflows/kit-ci.yml +0 -49
- package/templates/wiki/INDEX.md +0 -73
- package/templates/wiki/drafts-archive/README.md +0 -3
- package/templates/wiki//344/272/247/345/223/201/351/234/200/346/261/202/README.md +0 -3
- package/templates/wiki//345/274/200/345/217/221/346/226/271/346/241/210/README.md +0 -3
- package/templates/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +0 -3
- package/templates/wiki//346/265/213/350/257/225/346/212/245/345/221/212/README.md +0 -3
- package/templates/wiki//347/224/250/346/210/267/345/212/237/350/203/275/README.md +0 -3
- package/templates/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +0 -77
- package/templates/wiki//351/241/271/347/233/256/350/247/204/350/214/203/README.md +0 -3
- package/templates/wiki//351/241/271/347/233/256/350/256/241/345/210/222/README.md +0 -3
- package/templates/workflow/README.md +0 -91
- package/templates/workflow/delegations.md +0 -29
- package/templates/workflow/incidents/_TEMPLATE.md +0 -51
- package/templates/workflow/intents/_TEMPLATE.md +0 -51
- package/templates/workflow/papercuts.md +0 -9
- package/templates/workflow/plans/_TEMPLATE.md +0 -47
- package/templates/workflow/regression-checklist.md +0 -23
- package/templates/workflow/specs/_TEMPLATE.md +0 -80
- /package/templates/{_agents → engine/.agents}/board/marked.min.js +0 -0
- /package/templates/{_agents/workflows → engine/.agents/pipelines}/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md" +0 -0
- /package/templates/{_agents → engine/.agents}/scripts/git-core.mjs +0 -0
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// workflow 实时看板服务:本地只读 http + SSE 文件监听,可视化 AI 执行流程(intents/incidents/plans/specs)。
|
|
3
|
-
// 用法:node .agents/scripts/workflow-board-server.mjs [--port 8933];多项目并行请用 ensure-board.mjs 拉起(自动上探可用端口)
|
|
4
|
-
// 零依赖(node:http/node:fs/node:path/node:url/node:child_process);只读 workflow/ 与 git,仅绑 127.0.0.1。
|
|
5
|
-
// API:GET /(看板页) /marked.min.js(vendor) /api/board /api/doc?file=<相对路径> /api/history?file=<相对路径> /api/events(SSE)
|
|
6
|
-
// /api/runs(pipeline-run 执行器 run 卡片列表) /api/run?file=<runId>.json(单 run 事件流)
|
|
7
|
-
// 实时边界:文档内容与状态随落盘实时(fs.watch→SSE 推送);git 历史仅含已提交记录(git 语义)。
|
|
8
|
-
// 执行器面板(2026-10-04 board-run-panel):只读 .agents/cache/pipeline-runs/*.json(脚本亲写的机器事实),
|
|
9
|
-
// 不读 orchestration-runs.jsonl(宿主 AI 自报态,非验证态);纯只读观测层,不启动/推进/中止 run。
|
|
10
|
-
import http from 'node:http';
|
|
11
|
-
import fs from 'node:fs';
|
|
12
|
-
import path from 'node:path';
|
|
13
|
-
import { fileURLToPath } from 'node:url';
|
|
14
|
-
import { execFile, spawnSync } from 'node:child_process';
|
|
15
|
-
import { ENUMS } from './workflow-enums.mjs';
|
|
16
|
-
import { stageBar } from './pipeline-run.mjs';
|
|
17
|
-
|
|
18
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
|
19
|
-
const WORKFLOW = path.join(ROOT, 'workflow');
|
|
20
|
-
const BOARD_DIR = path.join(ROOT, '.agents', 'board');
|
|
21
|
-
const DOC_TYPES = ['intents', 'incidents', 'plans', 'specs'];
|
|
22
|
-
const PIPELINE_RUNS = path.join(ROOT, '.agents', 'cache', 'pipeline-runs');
|
|
23
|
-
|
|
24
|
-
const portArg = process.argv.indexOf('--port');
|
|
25
|
-
const PORT = portArg > 0 ? Number(process.argv[portArg + 1]) || 8933 : 8933;
|
|
26
|
-
const STARTED_AT = Date.now(); // 随 /api/board 自报(startedAt),供 ensure-board.mjs 判定旧代码重启,不碰进程启动时间 API
|
|
27
|
-
|
|
28
|
-
// ---- front matter + 标题解析(对照 _TEMPLATE.md 受限子集:每行 `键: 值`)----
|
|
29
|
-
function parseDoc(text) {
|
|
30
|
-
const meta = {};
|
|
31
|
-
const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
32
|
-
if (m) {
|
|
33
|
-
for (const line of m[1].split(/\r?\n/)) {
|
|
34
|
-
const kv = line.match(/^(\S+):\s*(.*)$/);
|
|
35
|
-
if (kv) meta[kv[1].trim()] = kv[2].trim();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const h1 = text.match(/^# (.+)$/m);
|
|
39
|
-
let title = h1 ? h1[1] : '';
|
|
40
|
-
// 去掉 "# INTENT — " 前缀留主题:em/en dash(任意间距)或带空格连字符——裸连字符属 kebab-case,不截断(2026-09-24)
|
|
41
|
-
const dash = title.match(/\S+\s*(?:[—–]+|\s-\s)\s*(.+)$/);
|
|
42
|
-
if (dash) title = dash[1];
|
|
43
|
-
return { meta, title };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ---- 验收标准 checkbox 统计:仅「验收标准」节内(至下一个 ## 标题),无该节返回 null ----
|
|
47
|
-
// 节匹配对齐 check-loop 检查 8 口径(^\s*##\s[^#]*验收标准,2026-09-27 board-kb-p1——「## 三、验收标准」类标题此前识别不到)
|
|
48
|
-
function parseAcceptance(text) {
|
|
49
|
-
const h = text.match(/^\s*##\s[^#]*验收标准.*$/m);
|
|
50
|
-
if (!h) return null;
|
|
51
|
-
const rest = text.slice(h.index + h[0].length);
|
|
52
|
-
const next = rest.match(/^## /m);
|
|
53
|
-
const section = next ? rest.slice(0, next.index) : rest;
|
|
54
|
-
const total = (section.match(/^\s*[-*] \[[ xX]\]/gm) || []).length;
|
|
55
|
-
if (!total) return null;
|
|
56
|
-
const done = (section.match(/^\s*[-*] \[[xX]\]/gm) || []).length;
|
|
57
|
-
return { done, total };
|
|
58
|
-
}
|
|
59
|
-
export { parseAcceptance };
|
|
60
|
-
|
|
61
|
-
// ---- 执行器 run 文件解析(2026-10-04 board-run-panel)----
|
|
62
|
-
// 只读 pipeline-runs/ 下的 run JSON(脚本亲写的机器事实,含 gate 真实退出码)。坏 JSON / 缺字段容错返回 null,
|
|
63
|
-
// 由调用方跳过——run 文件写入原子化(临时文件+rename),读瞬间可能撞上 rename 前状态,不 500。
|
|
64
|
-
export function parseRunFile(text) {
|
|
65
|
-
let j;
|
|
66
|
-
try {
|
|
67
|
-
j = JSON.parse(text);
|
|
68
|
-
} catch {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
if (!j || typeof j !== 'object' || typeof j.runId !== 'string' || !j.runId) return null;
|
|
72
|
-
return j;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// 单 run 卡片(/api/runs 载荷元素):runId / requirement / stage / stopType / updatedAt / triage / 事件数 / 阶段条
|
|
76
|
-
export function runCard(run) {
|
|
77
|
-
const events = Array.isArray(run.events) ? run.events : [];
|
|
78
|
-
return {
|
|
79
|
-
runId: run.runId,
|
|
80
|
-
requirement: run.requirement || '',
|
|
81
|
-
stage: run.stage || '',
|
|
82
|
-
stopType: run.stopType || '',
|
|
83
|
-
updatedAt: run.updatedAt || run.createdAt || '',
|
|
84
|
-
triage: run.triage || null,
|
|
85
|
-
eventCount: events.length,
|
|
86
|
-
stageBar: stageBar(run),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// 扫 pipeline-runs/ 全部 run → 卡片数组,按 updatedAt 倒序(无目录/空目录 → [])
|
|
91
|
-
export function scanRuns() {
|
|
92
|
-
if (!fs.existsSync(PIPELINE_RUNS) || !fs.statSync(PIPELINE_RUNS).isDirectory()) return [];
|
|
93
|
-
const cards = [];
|
|
94
|
-
for (const f of fs.readdirSync(PIPELINE_RUNS)) {
|
|
95
|
-
if (!f.endsWith('.json')) continue;
|
|
96
|
-
try {
|
|
97
|
-
const run = parseRunFile(fs.readFileSync(path.join(PIPELINE_RUNS, f), 'utf8'));
|
|
98
|
-
if (run) cards.push(runCard(run));
|
|
99
|
-
} catch {
|
|
100
|
-
// 读失败(瞬时占用等)跳过,等下次推送
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return cards.sort((a, b) => String(b.updatedAt).localeCompare(String(a.updatedAt)));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// 路径白名单:resolve 后必须仍在 pipeline-runs/ 内且 .json 后缀(export 供测试直测白名单面)
|
|
107
|
-
export function safeRunPath(rel) {
|
|
108
|
-
const abs = path.resolve(PIPELINE_RUNS, rel);
|
|
109
|
-
if (!abs.startsWith(PIPELINE_RUNS + path.sep) || !abs.endsWith('.json')) return null;
|
|
110
|
-
return abs;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// ---- 配对断裂检测:按完整文件名(含日期)聚合同族,异常卡附 alerts ----
|
|
114
|
-
// 与 check-loop 检查 1 的 basename 同一口径。slug(去掉日期)只给界面分组,不参与配对。
|
|
115
|
-
// 规则(看板为预警层、不阻断;枚举读单源 workflow-enums.txt):
|
|
116
|
-
// 孤儿 spec / 孤儿 plan(无同名 intent·incident 入口);入口 done 但 plan 未终态(看板启发式);
|
|
117
|
-
// 入口缺 plan(intent 一律要求;incident 需非 legacy 且级别 L1/L2/L3);L2/L3 入口缺同名 spec;
|
|
118
|
-
// spec L3 确认三件缺失(确认结果 / 确认时间 / 正文独立复核行);
|
|
119
|
-
// 状态不在全量枚举内或缺失;draft 是合法起点,提示「尚未确认」
|
|
120
|
-
const PLAN_TERMINAL = ENUMS['doc.status.terminal'];
|
|
121
|
-
const STATUS_ALL = {
|
|
122
|
-
intents: ENUMS['doc.status.all'],
|
|
123
|
-
specs: ENUMS['doc.status.all'],
|
|
124
|
-
plans: ENUMS['doc.status.all'],
|
|
125
|
-
incidents: ENUMS['incident.status.all'],
|
|
126
|
-
};
|
|
127
|
-
const NO_STATUS = '(未填)';
|
|
128
|
-
const L3_REVIEW = /^- 独立复核:[ \t]*[^<\s]/m; // 正文独立复核行须有实质内容(对照 check-loop 锚定)
|
|
129
|
-
|
|
130
|
-
export function detectAlerts(cards) {
|
|
131
|
-
const byName = new Map();
|
|
132
|
-
for (const c of cards) {
|
|
133
|
-
if (!byName.has(c.name)) byName.set(c.name, []);
|
|
134
|
-
byName.get(c.name).push(c);
|
|
135
|
-
}
|
|
136
|
-
for (const c of cards) {
|
|
137
|
-
const fam = byName.get(c.name) || [];
|
|
138
|
-
const types = new Set(fam.map((x) => x.type));
|
|
139
|
-
const alerts = [];
|
|
140
|
-
const isEntry = c.type === 'intents' || c.type === 'incidents';
|
|
141
|
-
// legacy 复盘件免配对类告警(口径同 check-loop);孤儿 spec / 孤儿 plan 两条仍按 spec·plan 自身判定
|
|
142
|
-
const legacyIncident = c.type === 'incidents' && c.flow === 'legacy';
|
|
143
|
-
if (!STATUS_ALL[c.type].includes(c.status))
|
|
144
|
-
alerts.push(`状态不在枚举内:须为 ${STATUS_ALL[c.type].join('/')}(现 ${c.status === NO_STATUS ? '缺失' : c.status})`);
|
|
145
|
-
else if (c.status === 'draft')
|
|
146
|
-
alerts.push('尚未确认');
|
|
147
|
-
if (c.type === 'specs' && !types.has('intents') && !types.has('incidents'))
|
|
148
|
-
alerts.push('孤儿 spec:无同名 intent/incident 入口');
|
|
149
|
-
if (c.type === 'plans' && !types.has('intents') && !types.has('incidents'))
|
|
150
|
-
alerts.push('孤儿 plan:无同名 intent/incident 入口');
|
|
151
|
-
if (c.type === 'plans') {
|
|
152
|
-
const entry = fam.find((x) => x.type === 'intents' || x.type === 'incidents');
|
|
153
|
-
if (entry && entry.status === 'done' && !PLAN_TERMINAL.includes(c.status))
|
|
154
|
-
alerts.push(`入口已 done,本 plan 未终态(现 ${c.status})`);
|
|
155
|
-
}
|
|
156
|
-
if (isEntry && !legacyIncident && !types.has('plans') && (c.type === 'intents' || ['L1', 'L2', 'L3'].includes(c.level)))
|
|
157
|
-
alerts.push('入口缺 plan:无同名 plan');
|
|
158
|
-
if (isEntry && !legacyIncident && ['L2', 'L3'].includes(c.level) && !types.has('specs'))
|
|
159
|
-
alerts.push(`${c.level} 入口缺同名 spec`);
|
|
160
|
-
if (c.type === 'specs' && c.level === 'L3' && c.status !== 'draft' && !ENUMS['doc.status.abandoned'].includes(c.status)) {
|
|
161
|
-
if (c.confirm !== 'approved') alerts.push(`L3 确认缺失:确认结果须为 approved(现 ${c.confirm || '缺失'})`);
|
|
162
|
-
if (!c.confirmTime) alerts.push('L3 确认缺失:须记录确认时间');
|
|
163
|
-
if (!c.hasReview) alerts.push('L3 复核缺失:须记录新会话独立复核结论');
|
|
164
|
-
}
|
|
165
|
-
if (alerts.length) c.alerts = alerts;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// ---- 文档作者:单次 git log 批量取「文件 → 最早提交者」(--reverse 首次出现即创建者)----
|
|
170
|
-
function gitAuthors() {
|
|
171
|
-
return new Promise((resolve) => {
|
|
172
|
-
const GIT = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
173
|
-
execFile(GIT, ['-c', 'core.quotepath=off', 'log', '--reverse', '--pretty=format:%x00%an', '--name-only', '--', 'workflow'], { cwd: ROOT, maxBuffer: 8 * 1024 * 1024 }, (err, stdout) => {
|
|
174
|
-
if (err) { console.error('git log 取作者失败(卡片 author 置空):', err.message); return resolve(new Map()); }
|
|
175
|
-
const map = new Map();
|
|
176
|
-
let author = '';
|
|
177
|
-
for (const line of stdout.toString('utf8').split(/\r?\n/)) {
|
|
178
|
-
if (line.startsWith('\0')) author = line.slice(1);
|
|
179
|
-
else if (line.trim() && !map.has(line.trim())) map.set(line.trim(), author);
|
|
180
|
-
}
|
|
181
|
-
resolve(map);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ---- 看板全量数据:每次请求现扫磁盘(数据量小,无缓存即无失效 bug)----
|
|
187
|
-
async function scanBoard() {
|
|
188
|
-
const authors = await gitAuthors();
|
|
189
|
-
const cards = [];
|
|
190
|
-
const counts = {};
|
|
191
|
-
for (const type of DOC_TYPES) {
|
|
192
|
-
const dir = path.join(WORKFLOW, type);
|
|
193
|
-
const files = fs.readdirSync(dir).filter((f) => f.endsWith('.md') && !f.startsWith('_TEMPLATE'));
|
|
194
|
-
counts[type] = files.length;
|
|
195
|
-
for (const f of files) {
|
|
196
|
-
let text = '';
|
|
197
|
-
try { text = fs.readFileSync(path.join(dir, f), 'utf8'); } catch { continue; } // watch 触发瞬间可能正被写,跳过等下次推送
|
|
198
|
-
const { meta, title } = parseDoc(text);
|
|
199
|
-
const accept = parseAcceptance(text);
|
|
200
|
-
const name = f.slice(0, -3);
|
|
201
|
-
cards.push({
|
|
202
|
-
type,
|
|
203
|
-
file: `${type}/${f}`,
|
|
204
|
-
name,
|
|
205
|
-
slug: name.replace(/^\d{4}-\d{2}-\d{2}-/, ''),
|
|
206
|
-
date: meta['日期'] || name.slice(0, 10),
|
|
207
|
-
status: meta['状态'] || NO_STATUS,
|
|
208
|
-
level: meta['级别'] || '',
|
|
209
|
-
title: title || name,
|
|
210
|
-
author: authors.get(`workflow/${type}/${f}`) || '',
|
|
211
|
-
...(accept ? { accept } : {}),
|
|
212
|
-
// 告警规则用到的 frontmatter / 正文锚点(对照 check-loop:legacy 豁免、L3 确认三件)
|
|
213
|
-
...(meta['流程'] ? { flow: meta['流程'] } : {}),
|
|
214
|
-
...(meta['确认结果'] ? { confirm: meta['确认结果'] } : {}),
|
|
215
|
-
...(meta['确认时间'] ? { confirmTime: meta['确认时间'] } : {}),
|
|
216
|
-
...(L3_REVIEW.test(text) ? { hasReview: true } : {}),
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
detectAlerts(cards);
|
|
221
|
-
cards.sort((a, b) => b.date.localeCompare(a.date) || a.type.localeCompare(b.type));
|
|
222
|
-
const loop = loopHardBlocks(); // hard-block 全局告警(单源 check-loop;null = 校验不可用)
|
|
223
|
-
return {
|
|
224
|
-
root: ROOT, pid: process.pid, startedAt: STARTED_AT, counts, cards,
|
|
225
|
-
loopHardBlocks: loop.blocks, loopNote: loop.note || undefined,
|
|
226
|
-
activeStatuses: [...ENUMS['doc.status.active'], ...ENUMS['incident.status.active']], // 枚举单源贯通前端(p2-batch2)
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// ---- 路径白名单:resolve 后必须仍在 workflow/ 内 ----
|
|
231
|
-
function safeDocPath(rel) {
|
|
232
|
-
const abs = path.resolve(WORKFLOW, rel);
|
|
233
|
-
if (!abs.startsWith(WORKFLOW + path.sep) || !abs.endsWith('.md')) return null;
|
|
234
|
-
return abs;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function gitLog(rel) {
|
|
238
|
-
return new Promise((resolve) => {
|
|
239
|
-
const GIT = process.platform === 'win32' ? 'git.exe' : 'git'; // Windows spawn 不补 .exe 扩展名
|
|
240
|
-
execFile(GIT, ['log', '--follow', '--date=short', '--pretty=%H|%ad|%s', '--', rel.split('/').join(path.sep)], { cwd: WORKFLOW, maxBuffer: 4 * 1024 * 1024 }, (err, stdout) => {
|
|
241
|
-
if (err) { console.error('git log 失败:', rel, err.message); return resolve([]); }
|
|
242
|
-
resolve(stdout.toString('utf8').split(/\r?\n/).filter(Boolean).map((l) => {
|
|
243
|
-
const [hash, date, ...rest] = l.split('|');
|
|
244
|
-
return { hash, date, subject: rest.join('|') };
|
|
245
|
-
}));
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// ---- SSE 广播:fs.watch 防抖 500ms(AI 写盘常连发多事件,合并为一次推送)----
|
|
251
|
-
const sseClients = new Set();
|
|
252
|
-
let debounceTimer = null;
|
|
253
|
-
function broadcast(event) {
|
|
254
|
-
for (const res of sseClients) { if (!res.destroyed) res.write(`event: ${event}\ndata: {}\n\n`); }
|
|
255
|
-
}
|
|
256
|
-
// 统一监听回调:workflow/ 文档 + pipeline-runs/ 执行器 run 文件任一变化 → 500ms 防抖广播 changed
|
|
257
|
-
function onWatchChange() {
|
|
258
|
-
clearTimeout(debounceTimer);
|
|
259
|
-
debounceTimer = setTimeout(() => broadcast('changed'), 500);
|
|
260
|
-
}
|
|
261
|
-
function watchDir(dir) {
|
|
262
|
-
try {
|
|
263
|
-
const watcher = fs.watch(dir, { recursive: true }, onWatchChange);
|
|
264
|
-
watcher.on('error', (e) => { console.error(`fs.watch 失效(${dir}),已通知前端降级轮询:`, e.message); broadcast('watchdead'); });
|
|
265
|
-
} catch (e) {
|
|
266
|
-
// 同步失败(典型:目录不存在 ENOENT)与异步 error 同口径广播 watchdead——否则前端徽标滞留「实时」而推送已死
|
|
267
|
-
console.error(`fs.watch 初始化失败(${dir},前端将走 60s 兜底轮询):`, e.message);
|
|
268
|
-
broadcast('watchdead');
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
watchDir(WORKFLOW);
|
|
272
|
-
// 25s 心跳:防半开连接;顺带清理已断开的 client
|
|
273
|
-
setInterval(() => { for (const res of sseClients) { if (res.destroyed) sseClients.delete(res); else res.write(': ping\n\n'); } }, 25000).unref();
|
|
274
|
-
|
|
275
|
-
const MIME = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8' };
|
|
276
|
-
|
|
277
|
-
function sendJson(res, code, obj) {
|
|
278
|
-
// X-Frame-Options(p2-batch2):本地只读服务拒绝被外站 iframe 嵌套(配合 Host 校验收敛攻击面)
|
|
279
|
-
res.writeHead(code, { 'Content-Type': 'application/json; charset=utf-8', 'X-Frame-Options': 'DENY' });
|
|
280
|
-
res.end(JSON.stringify(obj));
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// ---- hard-block 告警单源(2026-09-27 board-kb-p1)----
|
|
284
|
-
// 看板不再自建与 check-loop 平行的 hard 规则(此前四类缺失:回路断档/验收未对账/确认未对账/确认内容漂移,
|
|
285
|
-
// test.md「双跑断言」曾必失败)——scanBoard 时 spawn check-loop.mjs,解析其 stderr hard-block 段为全局告警数组:
|
|
286
|
-
// check-loop 未来新增 hard 项看板自动跟随,口径永不分叉。输出 banner 为稳定契约(check-loop 头注释明示
|
|
287
|
-
// doctor/pre-push 按输出消费),本解析由双跑断言测试兜底格式漂移。
|
|
288
|
-
export function parseLoopHardBlocks(stderrText) {
|
|
289
|
-
const text = String(stderrText || '');
|
|
290
|
-
const start = text.indexOf('HARD-BLOCK:');
|
|
291
|
-
if (start === -1) return [];
|
|
292
|
-
let seg = text.slice(start);
|
|
293
|
-
const warnIdx = seg.indexOf('WARN');
|
|
294
|
-
if (warnIdx > 0) seg = seg.slice(0, warnIdx);
|
|
295
|
-
return seg.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.startsWith('- ['));
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
function loopHardBlocks() {
|
|
299
|
-
// TTL 缓存(复核 P2-2 rider):check-loop 独跑实测 ~10.5s 且 spawnSync 阻塞事件循环——搜索击键/SSE
|
|
300
|
-
// 连发场景下每请求全跑不可用。60s 内复用上次结果(loopHardBlocks 是预警层非门禁,陈旧 60s 可接受;
|
|
301
|
-
// 前端 loopNote 均如实展示)。进程级缓存,无失效盲区风险(比照 kb 两元组口径弱化声明:预警层容忍)。
|
|
302
|
-
const NOW = Date.now();
|
|
303
|
-
if (loopCache.at && NOW - loopCache.at < 60_000) return loopCache.v;
|
|
304
|
-
const v = (() => {
|
|
305
|
-
try {
|
|
306
|
-
const r = spawnSync(process.execPath, [path.join(ROOT, '.agents', 'scripts', 'check-loop.mjs')], { cwd: ROOT, encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 });
|
|
307
|
-
if (r.error) return { blocks: null, note: `check-loop 不可执行:${r.error.message}` };
|
|
308
|
-
return { blocks: parseLoopHardBlocks(r.stderr || ''), note: '' };
|
|
309
|
-
} catch (e) {
|
|
310
|
-
return { blocks: null, note: e.message };
|
|
311
|
-
}
|
|
312
|
-
})();
|
|
313
|
-
loopCache.at = NOW; loopCache.v = v;
|
|
314
|
-
return v;
|
|
315
|
-
}
|
|
316
|
-
const loopCache = { at: 0, v: null };
|
|
317
|
-
|
|
318
|
-
const server = http.createServer(async (req, res) => {
|
|
319
|
-
try {
|
|
320
|
-
// Host 校验(DNS rebinding 缓解,2026-09-27 board-kb-p1):本地只读服务只认本机 Host
|
|
321
|
-
const host = String(req.headers.host || '');
|
|
322
|
-
if (host !== `127.0.0.1:${PORT}` && host !== `localhost:${PORT}`) {
|
|
323
|
-
return sendJson(res, 403, { error: `Host 不受信任(仅接受 127.0.0.1:${PORT} / localhost:${PORT})` });
|
|
324
|
-
}
|
|
325
|
-
const url = new URL(req.url, `http://127.0.0.1:${PORT}`); // 畸形请求行抛错 → 400(P1-3:原在 try 外,单包可杀进程)
|
|
326
|
-
if (url.pathname === '/api/events') {
|
|
327
|
-
res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', Connection: 'keep-alive' });
|
|
328
|
-
res.write('retry: 3000\n\n');
|
|
329
|
-
sseClients.add(res);
|
|
330
|
-
req.on('close', () => sseClients.delete(res));
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
if (url.pathname === '/api/board') return sendJson(res, 200, await scanBoard());
|
|
334
|
-
|
|
335
|
-
// 执行器面板(2026-10-04 board-run-panel):run 卡片列表 + 单 run 事件流
|
|
336
|
-
if (url.pathname === '/api/runs') return sendJson(res, 200, { cards: scanRuns() }); // 键名 cards 对齐 intent 2026-10-04-board-run-panel 验收#1
|
|
337
|
-
if (url.pathname === '/api/run') {
|
|
338
|
-
const rel = url.searchParams.get('file') || '';
|
|
339
|
-
const abs = safeRunPath(rel);
|
|
340
|
-
if (!abs) return sendJson(res, 403, { error: '路径不在 pipeline-runs/ 白名单内' });
|
|
341
|
-
try {
|
|
342
|
-
return sendJson(res, 200, { run: parseRunFile(fs.readFileSync(abs, 'utf8')) });
|
|
343
|
-
} catch (e) {
|
|
344
|
-
if (e && e.code === 'ENOENT') return sendJson(res, 404, { error: 'run 文件不存在' });
|
|
345
|
-
console.error(`读 run 失败(${rel}):`, e.message); // 权限/占用等如实 500 留痕,不并成 404
|
|
346
|
-
return sendJson(res, 500, { error: `读 run 失败:${e.message}` });
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
if (url.pathname === '/api/doc' || url.pathname === '/api/history') {
|
|
351
|
-
const rel = url.searchParams.get('file') || '';
|
|
352
|
-
const abs = safeDocPath(rel);
|
|
353
|
-
if (!abs) return sendJson(res, 403, { error: '路径不在 workflow/ 白名单内' });
|
|
354
|
-
if (url.pathname === '/api/doc') {
|
|
355
|
-
try { return sendJson(res, 200, { text: fs.readFileSync(abs, 'utf8') }); }
|
|
356
|
-
catch { return sendJson(res, 404, { error: '文件不存在' }); }
|
|
357
|
-
}
|
|
358
|
-
return sendJson(res, 200, { commits: await gitLog(rel) });
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// 静态文件:/ 与 /marked.min.js,同样防穿越
|
|
362
|
-
const rel = url.pathname === '/' ? 'index.html' : url.pathname.slice(1);
|
|
363
|
-
const abs = path.resolve(BOARD_DIR, rel);
|
|
364
|
-
if (!abs.startsWith(BOARD_DIR + path.sep) || !fs.existsSync(abs) || !fs.statSync(abs).isFile()) {
|
|
365
|
-
res.writeHead(404); return res.end('not found');
|
|
366
|
-
}
|
|
367
|
-
res.writeHead(200, { 'Content-Type': MIME[path.extname(abs)] || 'application/octet-stream' });
|
|
368
|
-
fs.createReadStream(abs).pipe(res);
|
|
369
|
-
} catch (e) {
|
|
370
|
-
if (e && e.code === 'ERR_INVALID_URL') {
|
|
371
|
-
return sendJson(res, 400, { error: `请求行/URL 非法:${e.message}` }); // 畸形请求不杀进程(P1-3);只认 URL 错误码——其余 TypeError 是服务端缺陷,如实 500(复核 P2-1)
|
|
372
|
-
}
|
|
373
|
-
sendJson(res, 500, { error: e.message });
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
// 绑定失败明确退出(EADDRINUSE 常见于直跑撞端口;ensure-board 会先探活选端口,这里兜底可读报错)
|
|
378
|
-
server.on('error', (e) => {
|
|
379
|
-
console.error(`workflow 看板启动失败(端口 ${PORT}${e.code === 'EADDRINUSE' ? ' 已被占用' : ''}):${e.code || e.message}`);
|
|
380
|
-
process.exit(1);
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
// isMain 守卫(board-kb-p1):parseLoopHardBlocks 可被测试 import(import 不 listen)
|
|
384
|
-
const isMain = process.argv[1] && process.argv[1].endsWith('workflow-board-server.mjs');
|
|
385
|
-
if (isMain) {
|
|
386
|
-
// run 目录缺失(.agents/cache/ 被 gitignore,全新装机无此目录)时 fs.watch 同步抛 ENOENT 且无重试——
|
|
387
|
-
// 补建空目录启用监听(pipeline-run 首跑本会建;失败不阻启动,由 watchDir catch 兜底广播 watchdead)
|
|
388
|
-
try { fs.mkdirSync(PIPELINE_RUNS, { recursive: true }); } catch { /* 竞态/权限等交给 watchDir 降级 */ }
|
|
389
|
-
watchDir(PIPELINE_RUNS); // 执行器 run 文件监听仅在作为服务运行时启动(import 不监听,避免测试进程挂起)
|
|
390
|
-
server.listen(PORT, '127.0.0.1', () => {
|
|
391
|
-
console.log(`workflow 看板: http://127.0.0.1:${PORT} (Ctrl+C 停止;只读 workflow/ 与 pipeline-runs/,不写任何文件;run 目录缺失时补建空目录以启用监听)`);
|
|
392
|
-
});
|
|
393
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// workflow-board-server 的纯函数测试(2026-09-27 board-kb-p1)
|
|
3
|
-
// 核心 = 「双跑断言」的机器化:test.md 要求「涉及看板告警规则时,用同批 workflow fixture 双跑 check-loop
|
|
4
|
-
// 与看板 /api/board,断言 hard-block 集合被看板告警覆盖(防口径分叉)」——此前是纯手工步骤且必失败
|
|
5
|
-
// (四类 hard-block 看板无对应项)。告警单源化后看板直接消费 check-loop 输出,本测试把双跑断言固化为:
|
|
6
|
-
// check-loop fixture 输出 → parseLoopHardBlocks → 断言四类 hard-block 全覆盖。
|
|
7
|
-
// 断言:①parseLoopHardBlocks 合成样本四类齐;②真 fixture spawn check-loop → 解析覆盖四类(双跑断言);
|
|
8
|
-
// ③空/无 hard-block → 空数组;④parseAcceptance 节匹配与 check-loop 检查 8 同口径。
|
|
9
|
-
// 用法:node .agents/scripts/workflow-board-server.test.mjs(import 不 listen——server 有 isMain 守卫)
|
|
10
|
-
import fs from 'node:fs';
|
|
11
|
-
import os from 'node:os';
|
|
12
|
-
import path from 'node:path';
|
|
13
|
-
import { spawnSync } from 'node:child_process';
|
|
14
|
-
import { fileURLToPath } from 'node:url';
|
|
15
|
-
import { parseLoopHardBlocks, parseAcceptance, detectAlerts, parseRunFile, runCard, safeRunPath } from './workflow-board-server.mjs';
|
|
16
|
-
import { computeFingerprint } from './confirm-doc.mjs';
|
|
17
|
-
|
|
18
|
-
let pass = 0;
|
|
19
|
-
let fail = 0;
|
|
20
|
-
const check = (desc, cond, detail = '') => {
|
|
21
|
-
if (cond) { pass++; console.log(`PASS ${desc}`); }
|
|
22
|
-
else { fail++; console.log(`FAIL ${desc}${detail ? `\n${detail}` : ''}`); }
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
26
|
-
const CHECK_LOOP = path.join(SCRIPT_DIR, 'check-loop.mjs');
|
|
27
|
-
|
|
28
|
-
// ---- ①合成样本:四类 hard-block 各一 → 全解析 ----
|
|
29
|
-
{
|
|
30
|
-
const sample = [
|
|
31
|
-
'闭环骨架断档(check-loop.sh)— HARD-BLOCK:',
|
|
32
|
-
'',
|
|
33
|
-
'- [配对断裂] intent 缺 plan:x.md',
|
|
34
|
-
'- [回路断档] inc 选「是」但未指明 intent 文件路径',
|
|
35
|
-
'- [验收未对账] done intent 缺「## 验收标准」节(勾验无从核对):x.md',
|
|
36
|
-
'- [确认未对账] x.md 状态 done 无用户确认记录',
|
|
37
|
-
'- [确认内容漂移] x.md done 后内容与确认台账不符',
|
|
38
|
-
'',
|
|
39
|
-
'WARN(advisory,不阻断):',
|
|
40
|
-
'',
|
|
41
|
-
'- [WARN 状态未确认] plan 必须...',
|
|
42
|
-
].join('\n');
|
|
43
|
-
const parsed = parseLoopHardBlocks(sample);
|
|
44
|
-
check('①合成样本解析 5 行 hard-block(WARN 段不混入)', parsed.length === 5, JSON.stringify(parsed));
|
|
45
|
-
check('①四类目标 hard-block 全覆盖(回路断档/验收未对账/确认未对账/确认内容漂移)',
|
|
46
|
-
['回路断档', '验收未对账', '确认未对账', '确认内容漂移'].every((k) => parsed.some((l) => l.includes(k))),
|
|
47
|
-
JSON.stringify(parsed));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// ---- ②双跑(真 fixture):spawn check-loop → parseLoopHardBlocks 覆盖四类 ----
|
|
51
|
-
// **检查 8 换锚后的前置条件(2026-09-28 check8-git-anchor)**:检查 8 的生效日锚已从文件名前缀
|
|
52
|
-
// 改为「文件首次加入 git 的日期」,故「验收未对账」这条 hard 的产出**需要 git 首次加入日期可判定**;
|
|
53
|
-
// 非 git 仓会走存量口径、不再产出该 hard(有意语义,见 spec)。因此本场景需为**真 git 仓**——
|
|
54
|
-
// 这不是放宽断言,而是补上使原断言(四类 hard-block 全覆盖)成立的前置;**断言强度与文案均未变**。
|
|
55
|
-
{
|
|
56
|
-
const T = fs.mkdtempSync(path.join(os.tmpdir(), 'board-loop-test-'));
|
|
57
|
-
for (const s of ['intents', 'specs', 'plans', 'incidents']) fs.mkdirSync(path.join(T, 'workflow', s), { recursive: true });
|
|
58
|
-
fs.mkdirSync(path.join(T, '.agents'), { recursive: true });
|
|
59
|
-
fs.writeFileSync(path.join(T, '.agents', 'workflow-enums.txt'), [
|
|
60
|
-
'doc.status.all=draft approved done superseded cancelled',
|
|
61
|
-
'doc.status.confirmed=approved done superseded cancelled',
|
|
62
|
-
'doc.status.active=draft approved',
|
|
63
|
-
'doc.status.terminal=done superseded cancelled',
|
|
64
|
-
'doc.status.abandoned=superseded cancelled',
|
|
65
|
-
'incident.status.all=open fixed closed',
|
|
66
|
-
'incident.status.active=open',
|
|
67
|
-
'level.all=L1 L2 L3',
|
|
68
|
-
].join('\n') + '\n');
|
|
69
|
-
const w = (rel, c) => fs.writeFileSync(path.join(T, rel), c);
|
|
70
|
-
// 回路断档:incident 三件套选「是」但引用 intent 不存在
|
|
71
|
-
w('workflow/incidents/2026-09-27-loop.md', '---\n状态: open\n级别: L1\n发现: 2026-09-27\n模块: pipeline\n---\n# INCIDENT — loop\n\n## 复盘三件套\n\n1. 结构性修复\n - 是否需要新 intent:\n - 是 → ../intents/2026-09-12-ghost.md\n2. 防复发验证\n3. 规范条目\n');
|
|
72
|
-
// 验收未对账:done intent 无验收标准节(锚 = git 首次加入日期 → 见上)
|
|
73
|
-
w('workflow/intents/2026-09-27-acc.md', '---\n状态: done\n级别: L1\n日期: 2026-09-27\n模块: pipeline\n---\n# INTENT — acc\n');
|
|
74
|
-
// 确认未对账:done 无指纹无台账
|
|
75
|
-
w('workflow/plans/2026-09-27-cg.md', '---\n状态: done\n级别: L1\n日期: 2026-09-27\n---\n# PLAN — cg\n');
|
|
76
|
-
// 确认内容漂移:done + 台账 prev + 落盘后篡改
|
|
77
|
-
{
|
|
78
|
-
const body = '\n## 验收标准(可测试)\n- [x] 用例通过(证据:fixture)\n';
|
|
79
|
-
const pre = `---\n状态: approved\n级别: L1\n日期: 2026-09-28\n确认指纹: ${'a'.repeat(16)}\n---\n# INTENT — drift\n${body}`;
|
|
80
|
-
const fp = computeFingerprint(pre);
|
|
81
|
-
w('workflow/intents/2026-09-28-drift.md', `---\n状态: done\n级别: L1\n日期: 2026-09-28\n确认指纹: ${fp.slice(0, 16)}\n---\n# INTENT — drift\n${body}确认后篡改行\n`);
|
|
82
|
-
fs.writeFileSync(path.join(T, '.agents', 'confirmations.jsonl'),
|
|
83
|
-
JSON.stringify({ ts: '2026-09-28T02:00:00.000Z', doc: 'workflow/intents/2026-09-28-drift.md', stage: 'done', fingerprint: fp, prev: 'approved', source: 'tty' }) + '\n');
|
|
84
|
-
}
|
|
85
|
-
// 配对齐 plan(避免无关阻断干扰可读性——配对断裂也会在 hard 段,不影响四类断言)
|
|
86
|
-
w('workflow/plans/2026-09-27-loop.md', '---\n状态: draft\n级别: L1\n---\n# PLAN — loop\n');
|
|
87
|
-
w('workflow/plans/2026-09-27-acc.md', '---\n状态: draft\n级别: L1\n---\n# PLAN — acc\n');
|
|
88
|
-
|
|
89
|
-
// 真 git 仓(使检查 8 的 git 锚可判定)——本地提交,不入任何远端
|
|
90
|
-
const G = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
91
|
-
spawnSync(G, ['init', '-q'], { cwd: T });
|
|
92
|
-
spawnSync(G, ['add', '-A'], { cwd: T });
|
|
93
|
-
spawnSync(G, ['-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'fixture'], { cwd: T });
|
|
94
|
-
|
|
95
|
-
const r = spawnSync(process.execPath, [CHECK_LOOP], { cwd: T, encoding: 'utf8', env: { ...process.env, CHECK_LOOP_ROOT: T } });
|
|
96
|
-
const parsed = parseLoopHardBlocks(r.stderr || '');
|
|
97
|
-
check('②双跑:check-loop fixture exit 1(确有 hard-block)', r.status === 1, `exit=${r.status}\n${r.stderr}`);
|
|
98
|
-
check('②双跑断言:四类 hard-block 均被看板告警解析覆盖',
|
|
99
|
-
['回路断档', '验收未对账', '确认未对账', '确认内容漂移'].every((k) => parsed.some((l) => l.includes(k))),
|
|
100
|
-
JSON.stringify(parsed));
|
|
101
|
-
fs.rmSync(T, { recursive: true, force: true });
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// ---- ③空/无 hard-block → 空数组 ----
|
|
105
|
-
{
|
|
106
|
-
check('③纯 WARN 输出 → 空数组', parseLoopHardBlocks('check-loop.sh WARN(advisory,不阻断):\n\n- [WARN x]\n').length === 0);
|
|
107
|
-
check('③空输入 → 空数组', parseLoopHardBlocks('').length === 0);
|
|
108
|
-
check('③exit 0 场景(仅 WARN banner)→ 空数组', parseLoopHardBlocks('check-loop.sh WARN(advisory,不阻断):\n\n- [WARN 引用断档] x\n').length === 0);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// ---- ④parseAcceptance 与 check-loop 检查 8 节匹配同口径 ----
|
|
112
|
-
{
|
|
113
|
-
const std = '---\n状态: done\n---\n# I\n\n## 验收标准(可测试)\n- [x] 甲(证据:e)\n- [ ] 乙\n';
|
|
114
|
-
const numbered = '---\n状态: done\n---\n# I\n\n## 三、验收标准\n- [x] 甲(证据:e)\n- [ ] 乙\n';
|
|
115
|
-
check('④标准标题解析 1/2', parseAcceptance(std)?.done === 1 && parseAcceptance(std)?.total === 2, JSON.stringify(parseAcceptance(std)));
|
|
116
|
-
check('④带序号标题(## 三、验收标准)此前识别不到、现在同口径', parseAcceptance(numbered)?.total === 2, JSON.stringify(parseAcceptance(numbered)));
|
|
117
|
-
check('④无验收节 → null', parseAcceptance('---\n状态: done\n---\n# I\n') === null);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ---- ⑤XSS 剥离口径(p2-batch2;复核 P2-3 备注)----
|
|
121
|
-
// 注意:strip 与 board/index.html loadDoc 的剥离正则是【同款拷贝、非同源】——改 loadDoc 正则时本场景
|
|
122
|
-
// 须同步(防回归能力受限为已知取舍:抽共享模块需前端打包链路,暂不做)。
|
|
123
|
-
// activeStatuses 载荷断言未入本套件(server 侧 scanBoard 非纯函数不可直调)——
|
|
124
|
-
// 以 /api/board 手工探活留证(复核已实测枚举贯通 + X-Frame-Options DENY)。
|
|
125
|
-
{
|
|
126
|
-
const strip = (s) => s.replace(/<[^>]*>/g, '');
|
|
127
|
-
const evil = '正常文字 <img src=x onerror=alert(1)> 更多 <script>alert(2)</script> 结束';
|
|
128
|
-
check('⑤剥标签:img/script 标签清零,正文文字保留',
|
|
129
|
-
!/<(img|script)/.test(strip(evil)) && strip(evil).includes('正常文字') && strip(evil).includes('结束'),
|
|
130
|
-
strip(evil));
|
|
131
|
-
const md = '## 标题\n\n- 列表 **粗体** `code`\n\n[链接](intents/x.md)';
|
|
132
|
-
check('⑤markdown 语法不受剥标签影响', strip(md) === md);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// ---- ⑥按完整文件名配对;draft 是合法起点 ----
|
|
136
|
-
{
|
|
137
|
-
const has = (card, text) => (card.alerts || []).some((a) => a.includes(text));
|
|
138
|
-
const card = (over) => ({
|
|
139
|
-
type: 'intents', name: '2026-09-01-topic', slug: 'topic', status: 'approved', level: 'L1',
|
|
140
|
-
...over,
|
|
141
|
-
});
|
|
142
|
-
const paired = card();
|
|
143
|
-
const plan = card({ type: 'plans', status: 'approved' });
|
|
144
|
-
const other = card({ name: '2026-09-02-topic', status: 'draft' });
|
|
145
|
-
detectAlerts([paired, plan, other]);
|
|
146
|
-
check('⑥同 slug 不同日期:有同名 plan 的 intent 不报缺 plan', !has(paired, '入口缺 plan'));
|
|
147
|
-
check('⑥同 slug 不同日期:没有同名 plan 的 intent 报缺 plan', has(other, '入口缺 plan'), JSON.stringify(other.alerts));
|
|
148
|
-
check('⑥draft 提示尚未确认,不报非法枚举', has(other, '尚未确认') && !has(other, '状态不在枚举内'), JSON.stringify(other.alerts));
|
|
149
|
-
const okIntent = card({ name: '2026-09-03-keep', status: 'approved' });
|
|
150
|
-
const okPlan = card({ type: 'plans', name: '2026-09-03-keep', status: 'approved' });
|
|
151
|
-
detectAlerts([okIntent, okPlan]);
|
|
152
|
-
check('⑥approved 同名配对:无非法枚举、无尚未确认、无缺 plan',
|
|
153
|
-
!has(okIntent, '状态不在枚举内') && !has(okIntent, '尚未确认') && !has(okIntent, '入口缺 plan'),
|
|
154
|
-
JSON.stringify(okIntent.alerts));
|
|
155
|
-
const doneIntent = card({ name: '2026-09-04-done', status: 'done' });
|
|
156
|
-
const draftPlan = card({ type: 'plans', name: '2026-09-04-done', status: 'draft' });
|
|
157
|
-
detectAlerts([doneIntent, draftPlan]);
|
|
158
|
-
check('⑥入口 done 而同名 plan 仍是 draft:plan 报未终态', has(draftPlan, '未终态'), JSON.stringify(draftPlan.alerts));
|
|
159
|
-
const bogus = card({ name: '2026-09-05-bad', status: 'nope' });
|
|
160
|
-
detectAlerts([bogus]);
|
|
161
|
-
check('⑥未知状态仍报不在枚举内', has(bogus, '状态不在枚举内'), JSON.stringify(bogus.alerts));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// ---- ⑦执行器面板纯函数(2026-10-04 board-run-panel)----
|
|
165
|
-
{
|
|
166
|
-
// 真实 run 文件形态(对齐 .agents/cache/pipeline-runs/20261002-1819-runtime-env-md-c2ju.json)
|
|
167
|
-
const real = {
|
|
168
|
-
runId: '20261002-1819-runtime-env-md-c2ju',
|
|
169
|
-
requirement: '在 runtime-env.md 补记 pipeline-run 运行态',
|
|
170
|
-
stage: 'done',
|
|
171
|
-
stopType: 'done',
|
|
172
|
-
triage: { kind: 'require', level: 'L1', module: 'pipeline', topic: 'runtime-note', decidedBy: 'ai' },
|
|
173
|
-
updatedAt: '2026-10-02T10:19:22.566Z',
|
|
174
|
-
events: [
|
|
175
|
-
{ t: '2026-10-02T10:19:02.680Z', type: 'run-created', requirement: 'x' },
|
|
176
|
-
{ t: '2026-10-02T10:19:02.682Z', type: 'work-order', id: 1, kind: 'triage' },
|
|
177
|
-
{ t: '2026-10-02T10:19:19.512Z', type: 'gate', cmd: 'git status --porcelain', exit: 0, ms: 58 },
|
|
178
|
-
{ t: '2026-10-02T10:19:22.566Z', type: 'commit', sha: '37b552a', subject: 'docs(pipeline): x' },
|
|
179
|
-
{ t: '2026-10-02T10:19:22.566Z', type: 'done' },
|
|
180
|
-
],
|
|
181
|
-
};
|
|
182
|
-
check('⑦parseRunFile:真实 run JSON 解析成功', parseRunFile(JSON.stringify(real))?.runId === real.runId);
|
|
183
|
-
check('⑦parseRunFile:坏 JSON → null', parseRunFile('{oops') === null);
|
|
184
|
-
check('⑦parseRunFile:非对象/缺 runId → null', parseRunFile('"str"') === null && parseRunFile('{}') === null && parseRunFile('{"a":1}') === null);
|
|
185
|
-
const card = runCard(real);
|
|
186
|
-
check('⑦runCard:字段映射齐全', card.runId === real.runId && card.stage === 'done' && card.stopType === 'done' && card.eventCount === 5 && card.requirement === real.requirement);
|
|
187
|
-
check('⑦runCard:updatedAt 取 updatedAt', card.updatedAt === real.updatedAt);
|
|
188
|
-
// 阶段条复用 pipeline-run stageBar(done → Plan/Design/Build 全 [✓],Test 为当前 [●])
|
|
189
|
-
check('⑦stageBar:done run 前三个阶段 [✓] 且 Test 为当前', card.stageBar.includes('[✓Plan]') && card.stageBar.includes('[✓Design]') && card.stageBar.includes('[✓Build]') && card.stageBar.includes('[●Test]'));
|
|
190
|
-
// 空事件容错
|
|
191
|
-
const empty = runCard({ runId: 'r1', requirement: '', stage: 'triage', stopType: 'work-order', events: null });
|
|
192
|
-
check('⑦runCard:events 非数组容错为 0', empty.eventCount === 0);
|
|
193
|
-
// safeRunPath 路径穿越白名单(2026-10-04 review-fix-batch:安全相关函数此前无测试;用例只用平台无关的正向斜杠相对路径)
|
|
194
|
-
check('⑦safeRunPath:合法 runId.json 通过', typeof safeRunPath('20261002-1819-x-abcd.json') === 'string' && safeRunPath('20261002-1819-x-abcd.json').endsWith('.json'));
|
|
195
|
-
check('⑦safeRunPath:.. 穿越拒绝', safeRunPath('../../package.json') === null && safeRunPath('a/../../package.json') === null);
|
|
196
|
-
check('⑦safeRunPath:根相对路径拒绝', safeRunPath('/etc/passwd') === null);
|
|
197
|
-
check('⑦safeRunPath:非 .json 拒绝', safeRunPath('20261002-1819-x-abcd.md') === null && safeRunPath('20261002-1819-x-abcd') === null);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
|
|
201
|
-
process.exit(fail ? 1 : 0);
|