agentic-flow-kit 1.8.7 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +172 -138
- package/bin/flow-kit.mjs +7 -2
- package/locales/en/installer.json +110 -0
- package/locales/en/overrides/.agents/commands/deploy.md +52 -0
- package/locales/en/overrides/.agents/commands/maintain.md +76 -0
- package/locales/en/overrides/.agents/commands/new-task.md +89 -0
- package/locales/en/overrides/.agents/commands/pipeline-run.md +56 -0
- package/locales/en/overrides/.agents/commands/pr-review.md +30 -0
- package/locales/en/overrides/.agents/commands/review.md +93 -0
- package/locales/en/overrides/.agents/commands/stages.md +256 -0
- package/locales/en/overrides/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/locales/en/overrides/.agents/notes/process-order-rule.md +21 -0
- package/locales/en/overrides/.agents/notes/runtime-env.local.example.md +21 -0
- package/locales/en/overrides/.agents/pipelines/_TEMPLATE.md +75 -0
- package/locales/en/overrides/.agents/pipelines/pipeline-closing.md +28 -0
- package/locales/en/overrides/.agents/roles/implementer.md +28 -0
- package/locales/en/overrides/.agents/roles/independent-reviewer.md +39 -0
- package/locales/en/overrides/.agents/roles/pr-adjudicator.md +27 -0
- package/locales/en/overrides/.agents/roles/pr-finder.md +51 -0
- package/locales/en/overrides/.agents/roles/pr-verifier.md +44 -0
- package/locales/en/overrides/.agents/roles/ui-verifier.md +22 -0
- package/locales/en/overrides/.agents/roles/wiki-compiler.md +47 -0
- package/locales/en/overrides/.agents/skills/arena/SKILL.md +50 -0
- package/locales/en/overrides/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/locales/en/overrides/.agents/skills/blast-radius/SKILL.md +53 -0
- package/locales/en/overrides/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/dev-tour/SKILL.md +98 -0
- package/locales/en/overrides/.agents/skills/dream/SKILL.md +63 -0
- package/locales/en/overrides/.agents/skills/eval/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/interrogate/SKILL.md +49 -0
- package/locales/en/overrides/.agents/skills/number-vetting/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/page-refactor/SKILL.md +192 -0
- package/locales/en/overrides/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/pause-safely/SKILL.md +31 -0
- package/locales/en/overrides/.agents/skills/perf/SKILL.md +42 -0
- package/locales/en/overrides/.agents/skills/review-method/SKILL.md +92 -0
- package/locales/en/overrides/.agents/skills/session-resume/SKILL.md +69 -0
- package/locales/en/overrides/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/locales/en/overrides/.agents/skills/show-me-your-work/SKILL.md +57 -0
- package/locales/en/overrides/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/locales/en/overrides/.agents/skills/verify-ui/SKILL.md +116 -0
- package/locales/en/overrides/.agents/skills/visual-parity/SKILL.md +35 -0
- package/locales/en/overrides/.agents/skills/why/SKILL.md +56 -0
- package/locales/en/overrides/.agents/skills/wiki/SKILL.md +53 -0
- package/locales/en/overrides/.claude/agents/implementer.md +9 -0
- package/locales/en/overrides/.claude/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.claude/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.claude/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.claude/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-review.md +8 -0
- package/locales/en/overrides/.claude/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.cline/agents/implementer.yml +13 -0
- package/locales/en/overrides/.cline/agents/independent-reviewer.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-adjudicator.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-finder.yml +11 -0
- package/locales/en/overrides/.cline/agents/pr-verifier.yml +11 -0
- package/locales/en/overrides/.cline/agents/ui-verifier.yml +8 -0
- package/locales/en/overrides/.cline/agents/wiki-compiler.yml +14 -0
- package/locales/en/overrides/.cline/workflows/wf-deploy.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-maintain.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-new-task.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-pr-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-review.md +8 -0
- package/locales/en/overrides/.cline/workflows/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/CODEBUDDY.md +7 -0
- package/locales/en/overrides/.codebuddy/agents/implementer.md +9 -0
- package/locales/en/overrides/.codebuddy/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.codebuddy/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.codebuddy/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.codebuddy/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-review.md +8 -0
- package/locales/en/overrides/.codebuddy/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.codebuddy/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/locales/en/overrides/.commandcode/agents/implementer.md +10 -0
- package/locales/en/overrides/.commandcode/agents/independent-reviewer.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-adjudicator.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-finder.md +9 -0
- package/locales/en/overrides/.commandcode/agents/pr-verifier.md +9 -0
- package/locales/en/overrides/.commandcode/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.commandcode/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.commandcode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.commandcode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.opencode/agents/implementer.md +51 -0
- package/locales/en/overrides/.opencode/agents/independent-reviewer.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-adjudicator.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-finder.md +18 -0
- package/locales/en/overrides/.opencode/agents/pr-verifier.md +18 -0
- package/locales/en/overrides/.opencode/agents/ui-verifier.md +45 -0
- package/locales/en/overrides/.opencode/agents/wiki-compiler.md +51 -0
- package/locales/en/overrides/.opencode/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-review.md +7 -0
- package/locales/en/overrides/.opencode/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.pi/agents/implementer.md +11 -0
- package/locales/en/overrides/.pi/agents/independent-reviewer.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-adjudicator.md +12 -0
- package/locales/en/overrides/.pi/agents/pr-finder.md +11 -0
- package/locales/en/overrides/.pi/agents/pr-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/ui-verifier.md +11 -0
- package/locales/en/overrides/.pi/agents/wiki-compiler.md +11 -0
- package/locales/en/overrides/.qoder/agents/implementer.md +9 -0
- package/locales/en/overrides/.qoder/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qoder/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qoder/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.qoder/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-review.md +8 -0
- package/locales/en/overrides/.qoder/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.qwen/agents/implementer.md +10 -0
- package/locales/en/overrides/.qwen/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.qwen/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.qwen/agents/wiki-compiler.md +13 -0
- package/locales/en/overrides/.qwen/commands/wf-deploy.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-maintain.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-new-task.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pipeline-run.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-pr-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-review.md +7 -0
- package/locales/en/overrides/.qwen/commands/wf-stages.md +7 -0
- package/locales/en/overrides/.trae/agents/implementer.md +9 -0
- package/locales/en/overrides/.trae/agents/independent-reviewer.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-adjudicator.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-finder.md +10 -0
- package/locales/en/overrides/.trae/agents/pr-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/ui-verifier.md +10 -0
- package/locales/en/overrides/.trae/agents/wiki-compiler.md +10 -0
- package/locales/en/overrides/.trae/commands/wf-deploy.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-maintain.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-new-task.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pipeline-run.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-pr-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-review.md +8 -0
- package/locales/en/overrides/.trae/commands/wf-stages.md +8 -0
- package/locales/en/overrides/.trae/rules/backend-scope.md +5 -0
- package/locales/en/overrides/.trae/rules/frontend-scope.md +5 -0
- package/locales/en/overrides/.zcode/agents/implementer.md +8 -0
- package/locales/en/overrides/.zcode/agents/independent-reviewer.md +8 -0
- package/locales/en/overrides/.zcode/agents/ui-verifier.md +8 -0
- package/locales/en/overrides/.zcode/agents/wiki-compiler.md +8 -0
- package/locales/en/overrides/AGENTS.md +52 -0
- package/locales/en/overrides/CLAUDE.md +20 -0
- package/locales/en/overrides/wiki/INDEX.md +33 -0
- package/locales/en/overrides/wiki/drafts-archive/README.md +6 -0
- package/locales/en/overrides/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/locales/en/overrides/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/locales/en/overrides/workflow/INDEX.md +13 -0
- package/locales/en/overrides/workflow/README.md +69 -0
- package/locales/en/overrides/workflow/archive/README.md +3 -0
- package/locales/en/overrides/workflow/delegations.md +4 -0
- package/locales/en/overrides/workflow/effective-policy.md +4 -0
- package/locales/en/overrides/workflow/gate-cost.md +4 -0
- package/locales/en/overrides/workflow/incidents/_TEMPLATE.md +49 -0
- package/locales/en/overrides/workflow/intents/_TEMPLATE.md +43 -0
- package/locales/en/overrides/workflow/metrics.md +4 -0
- package/locales/en/overrides/workflow/papercuts.md +3 -0
- package/locales/en/overrides/workflow/plans/_TEMPLATE.md +47 -0
- package/locales/en/overrides/workflow/regression-checklist.md +3 -0
- package/locales/en/overrides/workflow/specs/_TEMPLATE.md +86 -0
- package/locales/en/overrides/workflow/verify-evidence.md +4 -0
- package/locales/zh-CN/installer.json +110 -0
- package/package.json +23 -36
- package/schemas/install-manifest.schema.json +26 -0
- package/schemas/project-profile.schema.json +28 -0
- package/src/cli/args.mjs +43 -0
- package/src/cli/main.mjs +79 -0
- package/src/commands/add-host.mjs +29 -0
- package/src/commands/doctor.mjs +126 -0
- package/src/commands/install.mjs +296 -0
- package/src/commands/upgrade.mjs +30 -0
- package/src/git/config.mjs +61 -0
- package/src/hosts/registry.mjs +170 -0
- package/src/i18n.mjs +35 -0
- package/src/install/apply.mjs +138 -0
- package/src/install/frontmatter.mjs +84 -0
- package/src/install/manifest.mjs +40 -0
- package/src/install/plan.mjs +241 -0
- package/src/models/known.mjs +13 -0
- package/src/models/probe.mjs +163 -0
- package/src/models/resolve.mjs +312 -0
- package/src/render/tokens.mjs +105 -0
- package/src/tui/ansi.mjs +55 -0
- package/src/tui/flows.mjs +306 -0
- package/src/tui/prompts.mjs +139 -0
- package/src/tui/screen.mjs +217 -0
- package/src/tui/widgets.mjs +111 -0
- package/src/tui/wizard.mjs +68 -0
- package/templates/engine/.agents/board/dev-tour.html +1940 -0
- package/templates/engine/.agents/board/index.html +835 -0
- package/templates/engine/.agents/commands/deploy.md +52 -0
- package/templates/engine/.agents/commands/maintain.md +76 -0
- package/templates/engine/.agents/commands/new-task.md +89 -0
- package/templates/engine/.agents/commands/pipeline-run.md +60 -0
- package/templates/engine/.agents/commands/pr-review.md +30 -0
- package/templates/engine/.agents/commands/review.md +93 -0
- package/templates/engine/.agents/commands/stages.md +257 -0
- package/templates/engine/.agents/config/agent-eval.json +17 -0
- package/templates/engine/.agents/config/commit-msg-rules.json +7 -0
- package/templates/engine/.agents/config/engine.json +11 -0
- package/templates/engine/.agents/config/gate-budgets.json +5 -0
- package/templates/engine/.agents/config/mechanism-registry.md +63 -0
- package/templates/engine/.agents/config/memory-tiers.json +13 -0
- package/templates/engine/.agents/config/model-roles.json +26 -0
- package/templates/engine/.agents/config/model-roles.local.example.json +7 -0
- package/templates/engine/.agents/config/pipeline.json +36 -0
- package/templates/engine/.agents/config/pr-review.json +67 -0
- package/templates/engine/.agents/config/principles.md +32 -0
- package/templates/engine/.agents/config/steering.json +28 -0
- package/templates/engine/.agents/config/workflow-enums.txt +25 -0
- package/templates/engine/.agents/evals/README.md +49 -0
- package/templates/engine/.agents/evals/tasks.tsv +6 -0
- package/templates/engine/.agents/hooks/check-architecture.mjs +168 -0
- package/templates/engine/.agents/hooks/check-audit-fields.mjs +56 -0
- package/templates/engine/.agents/hooks/check-commit-plan-ref.mjs +84 -0
- package/templates/engine/.agents/hooks/check-confirm-order.mjs +281 -0
- package/templates/engine/.agents/hooks/check-delete-guard.mjs +63 -0
- package/templates/engine/.agents/hooks/check-notify-guard.mjs +55 -0
- package/templates/engine/.agents/hooks/commit-check.cjs +208 -0
- package/templates/engine/.agents/hooks/gates.json +33 -0
- package/templates/engine/.agents/hooks/local-pre-commit.mjs +27 -0
- package/templates/engine/.agents/hooks/pre-shell-check.cjs +361 -0
- package/templates/engine/.agents/hooks/pre-write-check.cjs +247 -0
- package/templates/engine/.agents/notes/gate-diet.md +75 -0
- package/templates/engine/.agents/notes/injected-memory.md +14 -0
- package/templates/engine/.agents/notes/pr-review-cost-discipline.md +48 -0
- package/templates/engine/.agents/notes/process-order-rule.md +21 -0
- package/templates/engine/.agents/notes/runtime-env.local.example.md +21 -0
- package/templates/engine/.agents/notes/steering-tiers.md +28 -0
- package/templates/engine/.agents/pipelines/_TEMPLATE.md +75 -0
- package/templates/engine/.agents/pipelines/pipeline-closing.md +28 -0
- package/templates/engine/.agents/pipelines//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
- package/templates/engine/.agents/roles/implementer.md +28 -0
- package/templates/engine/.agents/roles/independent-reviewer.md +39 -0
- package/templates/engine/.agents/roles/pr-adjudicator.md +27 -0
- package/templates/engine/.agents/roles/pr-finder.md +51 -0
- package/templates/engine/.agents/roles/pr-verifier.md +44 -0
- package/templates/engine/.agents/roles/ui-verifier.md +22 -0
- package/templates/engine/.agents/roles/wiki-compiler.md +47 -0
- package/templates/engine/.agents/scripts/agent-eval.mjs +268 -0
- package/templates/engine/.agents/scripts/agg-delegations.mjs +439 -0
- package/templates/engine/.agents/scripts/agg-judgments.mjs +301 -0
- package/templates/engine/.agents/scripts/agg-kb-usage.mjs +196 -0
- package/templates/engine/.agents/scripts/append-compensation.mjs +109 -0
- package/templates/engine/.agents/scripts/archive-sweep.mjs +229 -0
- package/templates/engine/.agents/scripts/auto-tour.mjs +77 -0
- package/templates/engine/.agents/scripts/board-port.mjs +17 -0
- package/templates/engine/.agents/scripts/check-doc-body-drift.mjs +102 -0
- package/templates/engine/.agents/scripts/check-engine-artifacts.mjs +54 -0
- package/templates/engine/.agents/scripts/check-hook-wiring.mjs +75 -0
- package/templates/engine/.agents/scripts/check-lane-surface.mjs +393 -0
- package/templates/engine/.agents/scripts/check-ledger-doc-presence.mjs +71 -0
- package/templates/engine/.agents/scripts/check-ledger-invariant.mjs +873 -0
- package/templates/engine/.agents/scripts/check-local-gate-config.mjs +95 -0
- package/templates/engine/.agents/scripts/check-local-gates.mjs +248 -0
- package/templates/engine/.agents/scripts/check-loop-kit.mjs +550 -0
- package/templates/engine/.agents/scripts/check-loop-rev-semantics.mjs +59 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s01-pairing.mjs +116 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s03x-regr-evidence.mjs +38 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s08-acceptance.mjs +130 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s15-fingerprint.mjs +152 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s23-convergence-audit.mjs +182 -0
- package/templates/engine/.agents/scripts/check-loop-sections/s29-regr-enforcer.mjs +69 -0
- package/templates/engine/.agents/scripts/check-loop.mjs +131 -0
- package/templates/engine/.agents/scripts/check-pipeline-state.mjs +85 -0
- package/templates/engine/.agents/scripts/check-regression-consistency.mjs +252 -0
- package/templates/engine/.agents/scripts/check-schema-residue.mjs +144 -0
- package/templates/engine/.agents/scripts/check-scope-range.mjs +156 -0
- package/templates/engine/.agents/scripts/check-scope.mjs +121 -0
- package/templates/engine/.agents/scripts/check-scripts-syntax.mjs +138 -0
- package/templates/engine/.agents/scripts/check-secrets-lite.mjs +239 -0
- package/templates/engine/.agents/scripts/check-secrets.mjs +104 -0
- package/templates/engine/.agents/scripts/check-test-impact-map.mjs +107 -0
- package/templates/engine/.agents/scripts/ci-assert-frontend-deps.mjs +42 -0
- package/templates/engine/.agents/scripts/ci-commit-hygiene.mjs +86 -0
- package/templates/engine/.agents/scripts/ci-install-gitleaks.mjs +75 -0
- package/templates/engine/.agents/scripts/ci-push-before.mjs +49 -0
- package/templates/engine/.agents/scripts/claims.mjs +166 -0
- package/templates/engine/.agents/scripts/closeout.mjs +127 -0
- package/templates/engine/.agents/scripts/compact-ledgers.mjs +70 -0
- package/templates/engine/.agents/scripts/confirm-doc.mjs +737 -0
- package/templates/engine/.agents/scripts/delegation-presence.mjs +38 -0
- package/templates/engine/.agents/scripts/dev-tour-model.mjs +1398 -0
- package/templates/engine/.agents/scripts/dream-run.mjs +358 -0
- package/templates/engine/.agents/scripts/ensure-board.mjs +187 -0
- package/templates/engine/.agents/scripts/failure-attribution.mjs +11 -0
- package/templates/engine/.agents/scripts/fill-intent.mjs +60 -0
- package/templates/engine/.agents/scripts/fill-plan.mjs +105 -0
- package/templates/engine/.agents/scripts/fill-spec.mjs +72 -0
- package/templates/engine/.agents/scripts/fix-task.mjs +77 -0
- package/templates/engine/.agents/scripts/gen-dev-tour.mjs +191 -0
- package/templates/engine/.agents/scripts/gen-effective-policy.mjs +113 -0
- package/templates/engine/.agents/scripts/gen-engine-map.mjs +292 -0
- package/templates/engine/.agents/scripts/gen-narrative-claims.mjs +275 -0
- package/templates/engine/.agents/scripts/gen-verify-evidence.mjs +115 -0
- package/templates/engine/.agents/scripts/gen-wiki-board.mjs +221 -0
- package/templates/engine/.agents/scripts/gen-workflow-index.mjs +201 -0
- package/templates/engine/.agents/scripts/gen-workflow-metrics.mjs +692 -0
- package/templates/engine/.agents/scripts/git-merge-jsonl.mjs +62 -0
- package/templates/engine/.agents/scripts/judgment-ledger.mjs +68 -0
- package/templates/engine/.agents/scripts/kb-cache-evict.mjs +50 -0
- package/templates/engine/.agents/scripts/kb-search.mjs +423 -0
- package/templates/engine/.agents/scripts/lane-surface-audit.mjs +145 -0
- package/templates/engine/.agents/scripts/ledger-loader.mjs +77 -0
- package/templates/engine/.agents/scripts/ledger-shards.mjs +346 -0
- package/templates/engine/.agents/scripts/memory-tier.mjs +196 -0
- package/templates/engine/.agents/scripts/memory-wiki.mjs +296 -0
- package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
- package/templates/engine/.agents/scripts/outcome-metrics.mjs +195 -0
- package/templates/engine/.agents/scripts/path-lease.mjs +177 -0
- package/templates/engine/.agents/scripts/pipeline-run.mjs +964 -0
- package/templates/engine/.agents/scripts/policy.mjs +250 -0
- package/templates/engine/.agents/scripts/pr-create.mjs +54 -0
- package/templates/engine/.agents/scripts/pr-review.mjs +1551 -0
- package/templates/engine/.agents/scripts/quote-grounding.mjs +233 -0
- package/templates/engine/.agents/scripts/regen-ledgers.mjs +59 -0
- package/templates/engine/.agents/scripts/rewrite-file.mjs +135 -0
- package/templates/engine/.agents/scripts/rule-budget.mjs +246 -0
- package/templates/engine/.agents/scripts/session-log.mjs +157 -0
- package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
- package/templates/engine/.agents/scripts/steering.mjs +75 -0
- package/templates/engine/.agents/scripts/test-impact-lib.mjs +451 -0
- package/templates/engine/.agents/scripts/test-impact.mjs +105 -0
- package/templates/engine/.agents/scripts/trust-mode.mjs +130 -0
- package/templates/engine/.agents/scripts/verify-scope.mjs +163 -0
- package/templates/engine/.agents/scripts/verify-wiki-consistency.mjs +264 -0
- package/templates/engine/.agents/scripts/verify.mjs +858 -0
- package/templates/engine/.agents/scripts/warn-format.mjs +57 -0
- package/templates/engine/.agents/scripts/wf-journal.mjs +230 -0
- package/templates/engine/.agents/scripts/workflow-board-server.mjs +696 -0
- package/templates/engine/.agents/scripts/workflow-enums.mjs +70 -0
- package/templates/engine/.agents/scripts/workflows-check.mjs +260 -0
- package/templates/engine/.agents/settings.json +33 -0
- package/templates/engine/.agents/skills/arena/SKILL.md +54 -0
- package/templates/engine/.agents/skills/autonomous-run/SKILL.md +45 -0
- package/templates/engine/.agents/skills/blast-radius/SKILL.md +53 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
- package/templates/engine/.agents/skills/csharp-quality-gates/scripts/quality-gates.mjs +430 -0
- package/templates/engine/.agents/skills/dev-tour/SKILL.md +98 -0
- package/templates/engine/.agents/skills/dream/SKILL.md +82 -0
- package/templates/engine/.agents/skills/eval/SKILL.md +58 -0
- package/templates/engine/.agents/skills/eval/scripts/eval-score.mjs +59 -0
- package/templates/engine/.agents/skills/interrogate/SKILL.md +49 -0
- package/templates/engine/.agents/skills/interrogate/scripts/interrogate-plan.mjs +72 -0
- package/templates/engine/.agents/skills/model-upgrade/SKILL.md +41 -0
- package/templates/engine/.agents/skills/number-vetting/SKILL.md +35 -0
- package/templates/engine/.agents/skills/page-refactor/SKILL.md +192 -0
- package/templates/engine/.agents/skills/page-refactor/references/templates.md +989 -0
- package/templates/engine/.agents/skills/papercut-fix/SKILL.md +92 -0
- package/templates/engine/.agents/skills/papercut-fix/references/response-template.md +81 -0
- package/templates/engine/.agents/skills/pause-safely/SKILL.md +31 -0
- package/templates/engine/.agents/skills/perf/SKILL.md +42 -0
- package/templates/engine/.agents/skills/review-method/SKILL.md +92 -0
- package/templates/engine/.agents/skills/review-method/golden-set.md +61 -0
- package/templates/engine/.agents/skills/session-resume/SKILL.md +76 -0
- package/templates/engine/.agents/skills/session-resume/scripts/worktree-audit.mjs +110 -0
- package/templates/engine/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
- package/templates/engine/.agents/skills/show-me-your-work/SKILL.md +71 -0
- package/templates/engine/.agents/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/templates/engine/.agents/skills/show-me-your-work/scripts/decision-log.mjs +24 -0
- package/templates/engine/.agents/skills/tfs-pr/SKILL.md +95 -0
- package/templates/engine/.agents/skills/tfs-pr/scripts/tfs-pr.mjs +947 -0
- package/templates/engine/.agents/skills/verify-ui/SKILL.md +116 -0
- package/templates/engine/.agents/skills/verify-ui/features/.gitkeep +0 -0
- package/templates/engine/.agents/skills/verify-ui/scripts/gen-verify-feature.mjs +114 -0
- package/templates/engine/.agents/skills/visual-parity/SKILL.md +35 -0
- package/templates/engine/.agents/skills/why/SKILL.md +56 -0
- package/templates/engine/.agents/skills/why/scripts/why-evidence.mjs +74 -0
- package/templates/engine/.agents/skills/wiki/SKILL.md +56 -0
- package/templates/engine/.agents/tests/auto-tour.test.mjs +82 -0
- package/templates/engine/.agents/tests/dev-tour-model.test.mjs +452 -0
- package/templates/engine/.agents/tests/fill-plan-lite.test.mjs +46 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.md +14 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.model.json +179 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.md +21 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.model.json +194 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.md +20 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.model.json +225 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.md +15 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.model.json +160 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.model.json +266 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.md +17 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.model.json +207 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.model.json +359 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.md +16 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.model.json +131 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.md +29 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.model.json +190 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.md +39 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.model.json +362 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.md +24 -0
- package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.model.json +224 -0
- package/templates/engine/.agents/tests/tools/gen-synthetic-plan.mjs +108 -0
- package/templates/git/.gitattributes +23 -0
- package/templates/git/.githooks/commit-msg +72 -0
- package/templates/git/.githooks/package.json +3 -0
- package/templates/git/.githooks/post-commit +62 -0
- package/templates/git/.githooks/pre-commit +197 -0
- package/templates/git/.githooks/pre-merge-commit +28 -0
- package/templates/git/.githooks/pre-push +201 -0
- package/templates/git/.github/workflows/ci.yml +32 -0
- package/templates/git/.gitignore.engine +11 -0
- package/templates/git/azure-pipelines.yml +46 -0
- package/templates/host-meta/SKILLS.md +3 -0
- package/templates/host-meta/claude/skill-pointer.md +6 -0
- package/templates/host-meta/cline/skill-index.md +6 -0
- package/templates/host-meta/codebuddy/skill-pointer.md +6 -0
- package/templates/host-meta/commandcode/skill-index.md +5 -0
- package/templates/host-meta/opencode/skill-pointer.md +6 -0
- package/templates/host-meta/qoder/skill-index.md +5 -0
- package/templates/host-meta/qwen/skill-index.md +5 -0
- package/templates/host-meta/trae/skill-index.md +6 -0
- package/templates/hosts/claude/CLAUDE.md +55 -0
- package/templates/hosts/claude/agents/implementer.md +7 -0
- package/templates/hosts/claude/agents/independent-reviewer.md +8 -0
- package/templates/hosts/claude/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/claude/agents/pr-finder.md +8 -0
- package/templates/hosts/claude/agents/pr-verifier.md +8 -0
- package/templates/hosts/claude/agents/ui-verifier.md +8 -0
- package/templates/hosts/claude/agents/wiki-compiler.md +8 -0
- package/templates/hosts/claude/commands/wf-deploy.md +10 -0
- package/templates/hosts/claude/commands/wf-maintain.md +10 -0
- package/templates/hosts/claude/commands/wf-new-task.md +10 -0
- package/templates/hosts/claude/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/claude/commands/wf-pr-review.md +10 -0
- package/templates/hosts/claude/commands/wf-review.md +10 -0
- package/templates/hosts/claude/commands/wf-stages.md +10 -0
- package/templates/hosts/claude/settings.hardened.json +94 -0
- package/templates/hosts/claude/settings.json +55 -0
- package/templates/hosts/cline/agents/implementer.yml +15 -0
- package/templates/hosts/cline/agents/independent-reviewer.yml +20 -0
- package/templates/hosts/cline/agents/pr-adjudicator.yml +18 -0
- package/templates/hosts/cline/agents/pr-finder.yml +19 -0
- package/templates/hosts/cline/agents/pr-verifier.yml +18 -0
- package/templates/hosts/cline/agents/ui-verifier.yml +17 -0
- package/templates/hosts/cline/agents/wiki-compiler.yml +20 -0
- package/templates/hosts/cline/hooks/PreToolUse.cjs +260 -0
- package/templates/hosts/cline/workflows/wf-deploy.md +8 -0
- package/templates/hosts/cline/workflows/wf-maintain.md +8 -0
- package/templates/hosts/cline/workflows/wf-new-task.md +8 -0
- package/templates/hosts/cline/workflows/wf-pipeline-run.md +8 -0
- package/templates/hosts/cline/workflows/wf-pr-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-review.md +8 -0
- package/templates/hosts/cline/workflows/wf-stages.md +8 -0
- package/templates/hosts/codebuddy/CODEBUDDY.md +7 -0
- package/templates/hosts/codebuddy/agents/implementer.md +9 -0
- package/templates/hosts/codebuddy/agents/independent-reviewer.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-finder.md +10 -0
- package/templates/hosts/codebuddy/agents/pr-verifier.md +10 -0
- package/templates/hosts/codebuddy/agents/ui-verifier.md +11 -0
- package/templates/hosts/codebuddy/agents/wiki-compiler.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-deploy.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-maintain.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-new-task.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pipeline-run.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-pr-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-review.md +10 -0
- package/templates/hosts/codebuddy/commands/wf-stages.md +10 -0
- package/templates/hosts/codebuddy/rules/backend-scope.md +5 -0
- package/templates/hosts/codebuddy/rules/frontend-scope.md +5 -0
- package/templates/hosts/codebuddy/settings.json +31 -0
- package/templates/hosts/codebuddy/skills/tfs-pr/SKILL.md +6 -0
- package/templates/hosts/commandcode/agents/implementer.md +10 -0
- package/templates/hosts/commandcode/agents/independent-reviewer.md +9 -0
- package/templates/hosts/commandcode/agents/pr-adjudicator.md +9 -0
- package/templates/hosts/commandcode/agents/pr-finder.md +9 -0
- package/templates/hosts/commandcode/agents/pr-verifier.md +9 -0
- package/templates/hosts/commandcode/agents/ui-verifier.md +11 -0
- package/templates/hosts/commandcode/agents/wiki-compiler.md +10 -0
- package/templates/hosts/commandcode/commands/wf-deploy.md +9 -0
- package/templates/hosts/commandcode/commands/wf-maintain.md +9 -0
- package/templates/hosts/commandcode/commands/wf-new-task.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/commandcode/commands/wf-pr-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-review.md +9 -0
- package/templates/hosts/commandcode/commands/wf-stages.md +9 -0
- package/templates/hosts/commandcode/settings.json +57 -0
- package/templates/hosts/opencode/agents/implementer.md +51 -0
- package/templates/hosts/opencode/agents/independent-reviewer.md +18 -0
- package/templates/hosts/opencode/agents/pr-adjudicator.md +18 -0
- package/templates/hosts/opencode/agents/pr-finder.md +18 -0
- package/templates/hosts/opencode/agents/pr-verifier.md +18 -0
- package/templates/hosts/opencode/agents/ui-verifier.md +45 -0
- package/templates/hosts/opencode/agents/wiki-compiler.md +51 -0
- package/templates/hosts/opencode/commands/wf-deploy.md +7 -0
- package/templates/hosts/opencode/commands/wf-maintain.md +7 -0
- package/templates/hosts/opencode/commands/wf-new-task.md +7 -0
- package/templates/hosts/opencode/commands/wf-pipeline-run.md +7 -0
- package/templates/hosts/opencode/commands/wf-pr-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-review.md +7 -0
- package/templates/hosts/opencode/commands/wf-stages.md +7 -0
- package/templates/hosts/pi/agents/implementer.md +10 -0
- package/templates/hosts/pi/agents/independent-reviewer.md +11 -0
- package/templates/hosts/pi/agents/pr-adjudicator.md +11 -0
- package/templates/hosts/pi/agents/pr-finder.md +10 -0
- package/templates/hosts/pi/agents/pr-verifier.md +10 -0
- package/templates/hosts/pi/agents/ui-verifier.md +10 -0
- package/templates/hosts/pi/agents/wiki-compiler.md +10 -0
- package/templates/hosts/pi/extensions/lib/gates-core.cjs +196 -0
- package/templates/hosts/pi/extensions/shipyard-gates.ts +95 -0
- package/templates/hosts/pi/settings.json +5 -0
- package/templates/hosts/qoder/agents/implementer.md +9 -0
- package/templates/hosts/qoder/agents/independent-reviewer.md +10 -0
- package/templates/hosts/qoder/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/qoder/agents/pr-finder.md +10 -0
- package/templates/hosts/qoder/agents/pr-verifier.md +10 -0
- package/templates/hosts/qoder/agents/ui-verifier.md +10 -0
- package/templates/hosts/qoder/agents/wiki-compiler.md +10 -0
- package/templates/hosts/qoder/commands/wf-deploy.md +8 -0
- package/templates/hosts/qoder/commands/wf-maintain.md +8 -0
- package/templates/hosts/qoder/commands/wf-new-task.md +8 -0
- package/templates/hosts/qoder/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/qoder/commands/wf-pr-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-review.md +8 -0
- package/templates/hosts/qoder/commands/wf-stages.md +8 -0
- package/templates/hosts/qoder/settings.json +61 -0
- package/templates/hosts/qwen/agents/implementer.md +8 -0
- package/templates/hosts/qwen/agents/independent-reviewer.md +8 -0
- package/templates/hosts/qwen/agents/pr-adjudicator.md +8 -0
- package/templates/hosts/qwen/agents/pr-finder.md +8 -0
- package/templates/hosts/qwen/agents/pr-verifier.md +8 -0
- package/templates/hosts/qwen/agents/ui-verifier.md +8 -0
- package/templates/hosts/qwen/agents/wiki-compiler.md +11 -0
- package/templates/hosts/qwen/commands/wf-deploy.md +9 -0
- package/templates/hosts/qwen/commands/wf-maintain.md +9 -0
- package/templates/hosts/qwen/commands/wf-new-task.md +9 -0
- package/templates/hosts/qwen/commands/wf-pipeline-run.md +9 -0
- package/templates/hosts/qwen/commands/wf-pr-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-review.md +9 -0
- package/templates/hosts/qwen/commands/wf-stages.md +9 -0
- package/templates/hosts/qwen/settings.json +57 -0
- package/templates/hosts/trae/agents/implementer.md +9 -0
- package/templates/hosts/trae/agents/independent-reviewer.md +10 -0
- package/templates/hosts/trae/agents/pr-adjudicator.md +10 -0
- package/templates/hosts/trae/agents/pr-finder.md +10 -0
- package/templates/hosts/trae/agents/pr-verifier.md +10 -0
- package/templates/hosts/trae/agents/ui-verifier.md +10 -0
- package/templates/hosts/trae/agents/wiki-compiler.md +10 -0
- package/templates/hosts/trae/commands/wf-deploy.md +8 -0
- package/templates/hosts/trae/commands/wf-maintain.md +8 -0
- package/templates/hosts/trae/commands/wf-new-task.md +8 -0
- package/templates/hosts/trae/commands/wf-pipeline-run.md +8 -0
- package/templates/hosts/trae/commands/wf-pr-review.md +8 -0
- package/templates/hosts/trae/commands/wf-review.md +8 -0
- package/templates/hosts/trae/commands/wf-stages.md +8 -0
- package/templates/hosts/trae/hooks.json +17 -0
- package/templates/hosts/trae/rules/backend-scope.md +5 -0
- package/templates/hosts/trae/rules/frontend-scope.md +5 -0
- package/templates/hosts/zcode/agents/implementer.md +8 -0
- package/templates/hosts/zcode/agents/independent-reviewer.md +8 -0
- package/templates/hosts/zcode/agents/ui-verifier.md +8 -0
- package/templates/hosts/zcode/agents/wiki-compiler.md +8 -0
- package/templates/hosts/zcode/config.json +31 -0
- package/templates/hosts/zcode/workflows/code-review.dwf.ts +428 -0
- package/templates/hosts/zcode/workflows/fullchain-flow-test.dwf.ts +898 -0
- package/templates/profiles/dotnet/.agents/config/lane-surfaces.txt +33 -0
- package/templates/profiles/dotnet/.agents/config/rule-budgets.txt +84 -0
- package/templates/profiles/dotnet/.agents/config/test-impact-map.json +590 -0
- package/templates/profiles/dotnet/.agents/config/workflow-modules.txt +18 -0
- package/templates/profiles/dotnet/.agents/hooks/commit-check.config.json +18 -0
- package/templates/profiles/dotnet/.agents/hooks/delete-guard-allowlist.txt +28 -0
- package/templates/profiles/dotnet/.agents/notes/runtime-env.md +178 -0
- package/templates/profiles/dotnet/AGENTS.md +52 -0
- package/templates/profiles/empty/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/empty/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/empty/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/empty/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/empty/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/empty/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/empty/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/empty/AGENTS.md +52 -0
- package/templates/profiles/go/AGENTS.md +52 -0
- package/templates/profiles/java/AGENTS.md +52 -0
- package/templates/profiles/node/.agents/config/lane-surfaces.txt +12 -0
- package/templates/profiles/node/.agents/config/rule-budgets.txt +3 -0
- package/templates/profiles/node/.agents/config/test-impact-map.json +8 -0
- package/templates/profiles/node/.agents/config/workflow-modules.txt +2 -0
- package/templates/profiles/node/.agents/hooks/commit-check.config.json +5 -0
- package/templates/profiles/node/.agents/hooks/delete-guard-allowlist.txt +2 -0
- package/templates/profiles/node/.agents/notes/runtime-env.md +44 -0
- package/templates/profiles/node/AGENTS.md +52 -0
- package/templates/profiles/rust/AGENTS.md +52 -0
- package/templates/profiles/typescript/AGENTS.md +52 -0
- package/templates/scaffold/wiki/INDEX.md +33 -0
- package/templates/scaffold/wiki/drafts-archive/README.md +7 -0
- package/templates/scaffold/wiki//344/272/247/345/223/201/351/234/200/346/261/202/.gitkeep +0 -0
- package/templates/scaffold/wiki//345/274/200/345/217/221/346/226/271/346/241/210/.gitkeep +0 -0
- package/templates/scaffold/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
- package/templates/scaffold/wiki//346/265/213/350/257/225/346/212/245/345/221/212/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/224/250/346/210/267/345/212/237/350/203/275/.gitkeep +0 -0
- package/templates/scaffold/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
- package/templates/scaffold/wiki//351/241/271/347/233/256/350/247/204/350/214/203/.gitkeep +0 -0
- package/templates/scaffold/workflow/INDEX.md +29 -0
- package/templates/scaffold/workflow/README.md +69 -0
- package/templates/scaffold/workflow/archive/README.md +3 -0
- package/templates/scaffold/workflow/artifact-sources.md +25 -0
- package/templates/scaffold/workflow/delegations.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/delegations.md +4 -0
- package/templates/scaffold/workflow/effective-policy.md +4 -0
- package/templates/scaffold/workflow/evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/gate-cost.md +4 -0
- package/templates/scaffold/workflow/gate-metrics.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/incidents/_TEMPLATE.md +49 -0
- package/templates/scaffold/workflow/intents/_TEMPLATE.md +43 -0
- package/templates/scaffold/workflow/metrics.md +4 -0
- package/templates/scaffold/workflow/non-engineer-intent.md +51 -0
- package/templates/scaffold/workflow/papercuts.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/papercuts.md +3 -0
- package/templates/scaffold/workflow/plans/_TEMPLATE.md +47 -0
- package/templates/scaffold/workflow/regression-checklist.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/regression-checklist.md +3 -0
- package/templates/scaffold/workflow/research/.gitkeep +0 -0
- package/templates/scaffold/workflow/reviews.d/.gitkeep +0 -0
- package/templates/scaffold/workflow/specs/_TEMPLATE.md +87 -0
- package/templates/scaffold/workflow/verify-evidence/.gitkeep +0 -0
- package/templates/scaffold/workflow/verify-evidence.md +4 -0
- package/modules/gates/README.md +0 -25
- package/modules/gates/dotnet-ca/README.md +0 -24
- package/modules/gates/dotnet-ca/check-architecture.sh +0 -150
- package/modules/gates/dotnet-ca/local-pre-commit.line +0 -1
- package/modules/gates/generated-readonly/README.md +0 -13
- package/modules/gates/generated-readonly/check-generated.mjs +0 -61
- package/modules/gates/generated-readonly/local-pre-commit.line +0 -1
- package/modules/gates/node-layer/README.md +0 -9
- package/modules/gates/node-layer/check-node-layer.mjs +0 -29
- package/modules/gates/node-layer/local-pre-commit.line +0 -1
- package/modules/gates/py-import/README.md +0 -9
- package/modules/gates/py-import/check-py-import.mjs +0 -30
- package/modules/gates/py-import/local-pre-commit.line +0 -1
- package/modules/gates/test-protect/README.md +0 -23
- package/modules/gates/test-protect/check-test-protect.mjs +0 -64
- package/modules/gates/test-protect/local-pre-commit.line +0 -1
- package/modules/hosts/README.md +0 -57
- package/modules/hosts/claude/agents/implementer.md +0 -51
- package/modules/hosts/claude/agents/independent-reviewer.md +0 -49
- package/modules/hosts/claude/agents/ui-verifier.md +0 -48
- package/modules/hosts/claude/commands/wf-build.md +0 -69
- package/modules/hosts/claude/commands/wf-deploy.md +0 -58
- package/modules/hosts/claude/commands/wf-design.md +0 -49
- package/modules/hosts/claude/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/claude/commands/wf-maintain.md +0 -76
- package/modules/hosts/claude/commands/wf-new-task.md +0 -102
- package/modules/hosts/claude/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/claude/commands/wf-plan.md +0 -40
- package/modules/hosts/claude/commands/wf-review.md +0 -49
- package/modules/hosts/claude/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/claude/commands/wf-test.md +0 -68
- package/modules/hosts/codex/agents/implementer.md +0 -51
- package/modules/hosts/codex/agents/independent-reviewer.md +0 -49
- package/modules/hosts/codex/agents/ui-verifier.md +0 -48
- package/modules/hosts/codex/commands/wf-build.md +0 -69
- package/modules/hosts/codex/commands/wf-deploy.md +0 -58
- package/modules/hosts/codex/commands/wf-design.md +0 -49
- package/modules/hosts/codex/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/codex/commands/wf-maintain.md +0 -76
- package/modules/hosts/codex/commands/wf-new-task.md +0 -102
- package/modules/hosts/codex/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/codex/commands/wf-plan.md +0 -40
- package/modules/hosts/codex/commands/wf-review.md +0 -49
- package/modules/hosts/codex/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/codex/commands/wf-test.md +0 -68
- package/modules/hosts/codex/skills/flow-kit/SKILL.md +0 -14
- package/modules/hosts/cursor/agents/implementer.md +0 -51
- package/modules/hosts/cursor/agents/independent-reviewer.md +0 -49
- package/modules/hosts/cursor/agents/ui-verifier.md +0 -48
- package/modules/hosts/cursor/commands/wf-build.md +0 -69
- package/modules/hosts/cursor/commands/wf-deploy.md +0 -58
- package/modules/hosts/cursor/commands/wf-design.md +0 -49
- package/modules/hosts/cursor/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/cursor/commands/wf-maintain.md +0 -76
- package/modules/hosts/cursor/commands/wf-new-task.md +0 -102
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/cursor/commands/wf-plan.md +0 -40
- package/modules/hosts/cursor/commands/wf-review.md +0 -49
- package/modules/hosts/cursor/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/cursor/commands/wf-test.md +0 -68
- package/modules/hosts/omp/agents/implementer.md +0 -52
- package/modules/hosts/omp/agents/independent-reviewer.md +0 -50
- package/modules/hosts/omp/agents/ui-verifier.md +0 -49
- package/modules/hosts/opencode/agents/implementer.md +0 -59
- package/modules/hosts/opencode/agents/independent-reviewer.md +0 -53
- package/modules/hosts/opencode/agents/ui-verifier.md +0 -52
- package/modules/hosts/opencode/commands/wf-build.md +0 -69
- package/modules/hosts/opencode/commands/wf-deploy.md +0 -58
- package/modules/hosts/opencode/commands/wf-design.md +0 -49
- package/modules/hosts/opencode/commands/wf-gate-checklist.md +0 -77
- package/modules/hosts/opencode/commands/wf-maintain.md +0 -76
- package/modules/hosts/opencode/commands/wf-new-task.md +0 -102
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +0 -35
- package/modules/hosts/opencode/commands/wf-plan.md +0 -40
- package/modules/hosts/opencode/commands/wf-review.md +0 -49
- package/modules/hosts/opencode/commands/wf-sync-hosts.md +0 -64
- package/modules/hosts/opencode/commands/wf-test.md +0 -68
- package/modules/hosts/trae/agents/implementer.md +0 -52
- package/modules/hosts/trae/agents/independent-reviewer.md +0 -51
- package/modules/hosts/trae/agents/ui-verifier.md +0 -50
- package/modules/hosts/trae/commands/wf-build.md +0 -70
- package/modules/hosts/trae/commands/wf-deploy.md +0 -59
- package/modules/hosts/trae/commands/wf-design.md +0 -50
- package/modules/hosts/trae/commands/wf-gate-checklist.md +0 -78
- package/modules/hosts/trae/commands/wf-maintain.md +0 -77
- package/modules/hosts/trae/commands/wf-new-task.md +0 -103
- package/modules/hosts/trae/commands/wf-pipeline-run.md +0 -36
- package/modules/hosts/trae/commands/wf-plan.md +0 -41
- package/modules/hosts/trae/commands/wf-review.md +0 -50
- package/modules/hosts/trae/commands/wf-sync-hosts.md +0 -65
- package/modules/hosts/trae/commands/wf-test.md +0 -69
- package/modules/hosts/trae/hooks/post-edit-check.cjs +0 -98
- package/modules/hosts/trae/hooks/pre-shell-check.cjs +0 -192
- package/modules/hosts/trae/hooks/resolve-shell.cjs +0 -30
- package/modules/hosts/trae/hooks.json +0 -29
- package/modules/hosts/trae/rules/beautify-input-chinese.md +0 -6
- package/modules/hosts/trae/rules/git-commit-message.md +0 -10
- package/modules/hosts/trae/rules/project-workflow.md +0 -14
- package/modules/hosts/zcode/agents/implementer.md +0 -51
- package/modules/hosts/zcode/agents/independent-reviewer.md +0 -49
- package/modules/hosts/zcode/agents/ui-verifier.md +0 -48
- package/src/add-gate.mjs +0 -116
- package/src/add-gate.test.mjs +0 -103
- package/src/add-host.mjs +0 -68
- package/src/cli.mjs +0 -169
- package/src/doctor.mjs +0 -629
- package/src/executor.mjs +0 -262
- package/src/executor.test.mjs +0 -295
- package/src/fresh-init.test.mjs +0 -64
- package/src/gate-dotnet-ca.test.mjs +0 -124
- package/src/gates.test.mjs +0 -143
- package/src/init.mjs +0 -382
- package/src/init.test.mjs +0 -163
- package/src/instance-ref.test.mjs +0 -62
- package/src/jscpd-drift.test.mjs +0 -145
- package/src/pack.test.mjs +0 -24
- package/src/profiles.mjs +0 -183
- package/src/render.mjs +0 -132
- package/src/rule-budget.test.mjs +0 -103
- package/src/run-tests.mjs +0 -56
- package/src/stack-profile.test.mjs +0 -95
- package/src/sync-hosts.mjs +0 -257
- package/src/sync-hosts.test.mjs +0 -291
- package/src/sync.mjs +0 -228
- package/src/sync.test.mjs +0 -452
- package/src/trae-hooks.test.mjs +0 -127
- package/src/validate.mjs +0 -77
- package/src/validate.test.mjs +0 -95
- package/templates/.gitattributes +0 -17
- package/templates/AGENTS.md +0 -58
- package/templates/_agents/board/index.html +0 -676
- package/templates/_agents/commands/build.md +0 -84
- package/templates/_agents/commands/deploy.md +0 -66
- package/templates/_agents/commands/design.md +0 -63
- package/templates/_agents/commands/gate-checklist.md +0 -91
- package/templates/_agents/commands/maintain.md +0 -90
- package/templates/_agents/commands/new-task.md +0 -110
- package/templates/_agents/commands/pipeline-run.md +0 -43
- package/templates/_agents/commands/plan.md +0 -48
- package/templates/_agents/commands/review.md +0 -62
- package/templates/_agents/commands/sync-hosts.md +0 -77
- package/templates/_agents/commands/test.md +0 -87
- package/templates/_agents/control-surfaces.txt +0 -53
- package/templates/_agents/engine-lock.json +0 -342
- package/templates/_agents/hooks/check-index-incremental.mjs +0 -48
- package/templates/_agents/hooks/check-pairing-incremental.mjs +0 -66
- package/templates/_agents/hooks/check-wiki-ledger.mjs +0 -30
- package/templates/_agents/hooks/commit-check.cjs +0 -193
- package/templates/_agents/hooks/local-pre-commit +0 -6
- package/templates/_agents/lane-surfaces.txt +0 -17
- package/templates/_agents/level-hints.txt +0 -30
- package/templates/_agents/loop/papercut-debt/DESIGN.md +0 -112
- package/templates/_agents/mechanism-registry.md +0 -35
- package/templates/_agents/metric-claims.txt +0 -81
- package/templates/_agents/notes/engine-internals.md +0 -17
- package/templates/_agents/notes/runtime-env.md +0 -18
- package/templates/_agents/roles/implementer.md +0 -47
- package/templates/_agents/roles/independent-reviewer.md +0 -45
- package/templates/_agents/roles/ui-verifier.md +0 -44
- package/templates/_agents/rule-budgets.txt +0 -20
- package/templates/_agents/scripts/agg-delegations.cjs +0 -302
- package/templates/_agents/scripts/agg-delegations.test.mjs +0 -282
- package/templates/_agents/scripts/agg-gate-stats.mjs +0 -113
- package/templates/_agents/scripts/agg-gate-stats.test.mjs +0 -95
- package/templates/_agents/scripts/agg-judgments.mjs +0 -156
- package/templates/_agents/scripts/agg-judgments.test.mjs +0 -93
- package/templates/_agents/scripts/archive-sweep.mjs +0 -235
- package/templates/_agents/scripts/archive-sweep.test.mjs +0 -129
- package/templates/_agents/scripts/check-attribution.mjs +0 -37
- package/templates/_agents/scripts/check-convergence.mjs +0 -124
- package/templates/_agents/scripts/check-engine-integrity.mjs +0 -220
- package/templates/_agents/scripts/check-engine-integrity.test.mjs +0 -215
- package/templates/_agents/scripts/check-funnel.mjs +0 -56
- package/templates/_agents/scripts/check-hygiene.mjs +0 -167
- package/templates/_agents/scripts/check-hygiene.test.mjs +0 -182
- package/templates/_agents/scripts/check-index-incremental.test.mjs +0 -73
- package/templates/_agents/scripts/check-lane-surface.mjs +0 -238
- package/templates/_agents/scripts/check-lane-surface.test.mjs +0 -302
- package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -586
- package/templates/_agents/scripts/check-ledger-invariant.test.mjs +0 -639
- package/templates/_agents/scripts/check-loop-rev.test.mjs +0 -336
- package/templates/_agents/scripts/check-loop-unit.test.mjs +0 -103
- package/templates/_agents/scripts/check-loop.mjs +0 -1987
- package/templates/_agents/scripts/check-loop.sh +0 -6
- package/templates/_agents/scripts/check-loop.test.mjs +0 -3912
- package/templates/_agents/scripts/check-metric-claims.mjs +0 -277
- package/templates/_agents/scripts/check-prejudgment.mjs +0 -64
- package/templates/_agents/scripts/check-registry.mjs +0 -45
- package/templates/_agents/scripts/check-scope.mjs +0 -96
- package/templates/_agents/scripts/check-scope.test.mjs +0 -99
- package/templates/_agents/scripts/check-scripts-syntax.mjs +0 -84
- package/templates/_agents/scripts/check-scripts-syntax.test.mjs +0 -72
- package/templates/_agents/scripts/check-spec-verif.mjs +0 -47
- package/templates/_agents/scripts/check-stage-index.mjs +0 -40
- package/templates/_agents/scripts/check-stage-index.test.mjs +0 -77
- package/templates/_agents/scripts/closeout-l1.mjs +0 -217
- package/templates/_agents/scripts/closeout-l1.test.mjs +0 -105
- package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -205
- package/templates/_agents/scripts/compact-ledgers.mjs +0 -97
- package/templates/_agents/scripts/compact-ledgers.test.mjs +0 -162
- package/templates/_agents/scripts/confirm-doc.mjs +0 -610
- package/templates/_agents/scripts/confirm-doc.test.mjs +0 -1119
- package/templates/_agents/scripts/doctor.test.mjs +0 -770
- package/templates/_agents/scripts/draft-sediment.mjs +0 -178
- package/templates/_agents/scripts/draft-sediment.test.mjs +0 -272
- package/templates/_agents/scripts/edit-face-check.mjs +0 -109
- package/templates/_agents/scripts/edit-face-check.test.mjs +0 -99
- package/templates/_agents/scripts/ensure-board.mjs +0 -185
- package/templates/_agents/scripts/fill-intent.mjs +0 -91
- package/templates/_agents/scripts/fill-intent.test.mjs +0 -113
- package/templates/_agents/scripts/fill-plan.mjs +0 -79
- package/templates/_agents/scripts/fill-plan.test.mjs +0 -224
- package/templates/_agents/scripts/fill-spec.mjs +0 -70
- package/templates/_agents/scripts/fill-spec.test.mjs +0 -266
- package/templates/_agents/scripts/fixture-scripts.mjs +0 -153
- package/templates/_agents/scripts/fixture-scripts.test.mjs +0 -112
- package/templates/_agents/scripts/gate-checklist.mjs +0 -209
- package/templates/_agents/scripts/gate-checklist.test.mjs +0 -201
- package/templates/_agents/scripts/gate-seg.mjs +0 -54
- package/templates/_agents/scripts/gate-seg.test.mjs +0 -112
- package/templates/_agents/scripts/gen-effective-policy.mjs +0 -107
- package/templates/_agents/scripts/gen-effective-policy.test.mjs +0 -100
- package/templates/_agents/scripts/gen-verify-evidence.mjs +0 -107
- package/templates/_agents/scripts/gen-verify-evidence.test.mjs +0 -84
- package/templates/_agents/scripts/gen-wiki-board.mjs +0 -276
- package/templates/_agents/scripts/gen-wiki-board.test.mjs +0 -249
- package/templates/_agents/scripts/gen-workflow-dashboard.mjs +0 -251
- package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +0 -188
- package/templates/_agents/scripts/gen-workflow-index.mjs +0 -201
- package/templates/_agents/scripts/gen-workflow-index.test.mjs +0 -152
- package/templates/_agents/scripts/gen-workflow-metrics.mjs +0 -466
- package/templates/_agents/scripts/gen-workflow-metrics.test.mjs +0 -343
- package/templates/_agents/scripts/git-merge-jsonl.mjs +0 -63
- package/templates/_agents/scripts/git-merge-jsonl.test.mjs +0 -125
- package/templates/_agents/scripts/judgment-ledger.mjs +0 -65
- package/templates/_agents/scripts/judgment-ledger.test.mjs +0 -129
- package/templates/_agents/scripts/kb-cache-evict.mjs +0 -50
- package/templates/_agents/scripts/kb-cache-evict.test.mjs +0 -104
- package/templates/_agents/scripts/kb-search.mjs +0 -413
- package/templates/_agents/scripts/kb-search.test.mjs +0 -299
- package/templates/_agents/scripts/lane-surface-audit.mjs +0 -143
- package/templates/_agents/scripts/lane-surface-audit.test.mjs +0 -93
- package/templates/_agents/scripts/ledger-doc-chain.test.mjs +0 -166
- package/templates/_agents/scripts/ledger-loader.mjs +0 -108
- package/templates/_agents/scripts/ledger-loader.test.mjs +0 -131
- package/templates/_agents/scripts/ledger-prune.mjs +0 -96
- package/templates/_agents/scripts/ledger-prune.test.mjs +0 -120
- package/templates/_agents/scripts/ledger-shards.mjs +0 -344
- package/templates/_agents/scripts/ledger-shards.test.mjs +0 -356
- package/templates/_agents/scripts/ledger-ts-monotonic.test.mjs +0 -135
- package/templates/_agents/scripts/level-criteria.mjs +0 -231
- package/templates/_agents/scripts/level-criteria.test.mjs +0 -281
- package/templates/_agents/scripts/mechanism-retire-watch.mjs +0 -183
- package/templates/_agents/scripts/mechanism-retire-watch.test.mjs +0 -114
- package/templates/_agents/scripts/papercut-debt-controller.mjs +0 -141
- package/templates/_agents/scripts/papercut-debt-controller.test.mjs +0 -127
- package/templates/_agents/scripts/papercut-debt-sensor.mjs +0 -170
- package/templates/_agents/scripts/papercut-debt-sensor.test.mjs +0 -146
- package/templates/_agents/scripts/pipeline-run-docs.mjs +0 -76
- package/templates/_agents/scripts/pipeline-run-run.mjs +0 -63
- package/templates/_agents/scripts/pipeline-run.mjs +0 -867
- package/templates/_agents/scripts/pipeline-run.test.mjs +0 -517
- package/templates/_agents/scripts/policy.mjs +0 -281
- package/templates/_agents/scripts/pre-push.test.mjs +0 -105
- package/templates/_agents/scripts/resolve-merge-conflicts.mjs +0 -110
- package/templates/_agents/scripts/resolve-merge-conflicts.test.mjs +0 -87
- package/templates/_agents/scripts/rewrite-file.mjs +0 -133
- package/templates/_agents/scripts/rewrite-file.test.mjs +0 -148
- package/templates/_agents/scripts/rule-budget.mjs +0 -96
- package/templates/_agents/scripts/rule-budget.test.mjs +0 -118
- package/templates/_agents/scripts/run-tests.mjs +0 -99
- package/templates/_agents/scripts/run-tests.test.mjs +0 -105
- package/templates/_agents/scripts/solidify-task.mjs +0 -109
- package/templates/_agents/scripts/solidify-task.test.mjs +0 -129
- package/templates/_agents/scripts/stage-gates.mjs +0 -343
- package/templates/_agents/scripts/stage-gates.test.mjs +0 -105
- package/templates/_agents/scripts/trust-mode.mjs +0 -67
- package/templates/_agents/scripts/trust-mode.test.mjs +0 -110
- package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -253
- package/templates/_agents/scripts/verify-wiki-consistency.test.mjs +0 -123
- package/templates/_agents/scripts/verify.mjs +0 -345
- package/templates/_agents/scripts/verify.test.mjs +0 -373
- package/templates/_agents/scripts/wf-journal.mjs +0 -231
- package/templates/_agents/scripts/wf-journal.test.mjs +0 -216
- package/templates/_agents/scripts/wiki-search.mjs +0 -19
- package/templates/_agents/scripts/wiki-search.test.mjs +0 -57
- package/templates/_agents/scripts/workflow-board-server.mjs +0 -393
- package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -201
- package/templates/_agents/scripts/workflow-enums.mjs +0 -70
- package/templates/_agents/scripts/workflow-enums.test.mjs +0 -118
- package/templates/_agents/scripts/workflows-check.mjs +0 -260
- package/templates/_agents/scripts/workflows-check.test.mjs +0 -278
- package/templates/_agents/scripts-test-exempt.txt +0 -16
- package/templates/_agents/skills/papercut-fix/SKILL.md +0 -60
- package/templates/_agents/skills/papercut-fix/references/response-template.md +0 -81
- package/templates/_agents/skills/review-method/SKILL.md +0 -58
- package/templates/_agents/skills/verify-ui/SKILL.md +0 -61
- package/templates/_agents/skills/wiki/SKILL.md +0 -106
- package/templates/_agents/workflow-enums.txt +0 -26
- package/templates/_agents/workflow-modules.txt +0 -11
- package/templates/_agents/workflows/_TEMPLATE.md +0 -75
- package/templates/_agents/workflows/pipeline-closing.md +0 -28
- package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +0 -16
- package/templates/_githooks/commit-msg +0 -17
- package/templates/_githooks/post-commit +0 -10
- package/templates/_githooks/pre-commit +0 -126
- package/templates/_githooks/pre-merge-commit +0 -29
- package/templates/_githooks/pre-push +0 -136
- package/templates/_github/workflows/kit-ci.yml +0 -49
- package/templates/wiki/INDEX.md +0 -73
- package/templates/wiki/drafts-archive/README.md +0 -3
- package/templates/wiki//344/272/247/345/223/201/351/234/200/346/261/202/README.md +0 -3
- package/templates/wiki//345/274/200/345/217/221/346/226/271/346/241/210/README.md +0 -3
- package/templates/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +0 -3
- package/templates/wiki//346/265/213/350/257/225/346/212/245/345/221/212/README.md +0 -3
- package/templates/wiki//347/224/250/346/210/267/345/212/237/350/203/275/README.md +0 -3
- package/templates/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +0 -77
- package/templates/wiki//351/241/271/347/233/256/350/247/204/350/214/203/README.md +0 -3
- package/templates/wiki//351/241/271/347/233/256/350/256/241/345/210/222/README.md +0 -3
- package/templates/workflow/README.md +0 -91
- package/templates/workflow/delegations.md +0 -29
- package/templates/workflow/incidents/_TEMPLATE.md +0 -51
- package/templates/workflow/intents/_TEMPLATE.md +0 -51
- package/templates/workflow/papercuts.md +0 -9
- package/templates/workflow/plans/_TEMPLATE.md +0 -47
- package/templates/workflow/regression-checklist.md +0 -23
- package/templates/workflow/specs/_TEMPLATE.md +0 -80
- /package/templates/{_agents → engine/.agents}/board/marked.min.js +0 -0
- /package/templates/{_agents/workflows → engine/.agents/pipelines}/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md" +0 -0
- /package/templates/{_agents → engine/.agents}/scripts/git-core.mjs +0 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// check-secrets-lite:纯 Node 密钥兜底扫描(2026-10-29,CI 装不上 gitleaks 时的退路)
|
|
3
|
+
// 动机:CI agent 无外网 / 二进制落不了盘时,secrets-scan 原为 loud-skip——门表看着绿、实际没扫。
|
|
4
|
+
// 本脚本零二进制、零网络;check-secrets.mjs 在 gitleaks 不可用时自动接续(GITLEAKS_BIN/PATH/
|
|
5
|
+
// .agents/tools 三级全空),也可 SECRETS_SCAN_LITE=1 或 --lite 强制。
|
|
6
|
+
// 规则分两档:
|
|
7
|
+
// ① 强特征(前缀/私钥块/JWT/连接串口令):所有文件执法,误报极低。
|
|
8
|
+
// ② 宽泛 key=value(generic-api-key 同类)与连接串口令:只对「基线豁免清单之外」的文件执法,
|
|
9
|
+
// 且要求值含数字/符号、熵达标、非代码表达式续写——实测本树 2811 文件命中 0 处。
|
|
10
|
+
// 豁免口径(与 gitleaks 基线同源):.gitleaks-baseline.json 出现过的 22 个文件按**文件级**豁免
|
|
11
|
+
// (owner 拍板的 1231 处存量,值在基线内已 redact,无法按值匹配);另加 appsettings*.json 白名单
|
|
12
|
+
// (owner 2026-10-27 判定开发库凭据 / JWT Secret 非风险,gitleaks 亦不命中)。
|
|
13
|
+
// 代价(明示):上述文件内**新增**的弱特征密钥会漏,由可装机环境的 gitleaks 全量补。
|
|
14
|
+
// 基线缺失 = exit 2(无豁免清单则全树必爆红,与 gitleaks detect 同口径 fail-closed)。
|
|
15
|
+
// 行内豁免:同行含 `gitleaks:allow` 或 `secrets-lite:allow` 即跳过(与 gitleaks 同形)。
|
|
16
|
+
// 用法:node .agents/scripts/check-secrets-lite.mjs [--staged | --range <a>..<b>] [--json]
|
|
17
|
+
// --staged 只扫暂存区新增行;--range 只扫给定范围新增行;缺省 = 全部 git 跟踪文件
|
|
18
|
+
// 退出码:0 无泄漏;1 发现泄漏;2 配置/参数失守
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import { spawnSync } from 'node:child_process';
|
|
22
|
+
import { fileURLToPath } from 'node:url';
|
|
23
|
+
|
|
24
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
const DEFAULT_ROOT = path.resolve(SCRIPT_DIR, '..', '..');
|
|
26
|
+
|
|
27
|
+
const STRONG_RULES = [
|
|
28
|
+
{ id: 'private-key', re: /-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/ },
|
|
29
|
+
{ id: 'aws-access-key-id', re: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/ },
|
|
30
|
+
{ id: 'github-token', re: /\bgh[pousr]_[A-Za-z0-9]{36,}\b/ },
|
|
31
|
+
{ id: 'github-pat-fine-grained', re: /\bgithub_pat_[A-Za-z0-9_]{50,}\b/ },
|
|
32
|
+
{ id: 'slack-token', re: /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/ },
|
|
33
|
+
{ id: 'stripe-live-key', re: /\b(?:sk|rk)_live_[A-Za-z0-9]{20,}\b/ },
|
|
34
|
+
{ id: 'google-api-key', re: /\bAIza[0-9A-Za-z_-]{35}\b/ },
|
|
35
|
+
{ id: 'square-access-token', re: /\bsq0atp-[0-9A-Za-z_-]{22}\b/ },
|
|
36
|
+
{ id: 'jwt', re: /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/ },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const GENERIC_RULE = {
|
|
40
|
+
id: 'generic-api-key',
|
|
41
|
+
re: /(?:api[_-]?key|apikey|access[_-]?key|secret|token|passwd|password|pwd|_auth|authorization)["']?\s*[:=]\s*["']?([A-Za-z0-9+/=_-]{16,})["']?/i,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// 连接串口令:值与形态都强(`Password=xxx`),但 appsettings 属 owner 判定的非风险载体,
|
|
45
|
+
// 故与 generic 同档——只对豁免清单外的文件执法。
|
|
46
|
+
const CRED_RULE = {
|
|
47
|
+
id: 'connection-string-password',
|
|
48
|
+
// 值限定为「无空白/分号/引号、不含点号与括号」的字面量——含 `.`/`(` 的必是代码表达式(process.env.X 等)
|
|
49
|
+
re: /\b(?:password|pwd)\s*=\s*(?!\*|\$|<|\{)[A-Za-z0-9_\-+/=]{12,}(?![A-Za-z0-9_.])/i,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const PLACEHOLDER = /^(?:x{4,}|0{4,}|your|my|example|sample|changeme|placeholder|dummy|fake|redacted|todo|none|null|undefined|test)/i;
|
|
53
|
+
const ALLOW_MARK = /(?:gitleaks|secrets-lite):allow/;
|
|
54
|
+
// appsettings*.json:owner 2026-10-27 判定开发库凭据 / JWT Secret 非风险(详见本文件头注)
|
|
55
|
+
const ACCEPTED_FILE = [/(?:^|\/)appsettings(?:\.[\w-]+)?\.json$/i];
|
|
56
|
+
const SKIP_PATH = [
|
|
57
|
+
/^\.git\//, /(?:^|\/)node_modules\//, /^tmp\//, /(?:^|\/)dist\//, /^\.agents\/tools\//, /(?:^|\/)bin\//, /(?:^|\/)obj\//,
|
|
58
|
+
// pdf.js 发行版 worker(仅这两个具体文件):内部把密码形参原样透传给 utf8StringToString(),
|
|
59
|
+
// 被 connection-string-password 规则误报(此处不复述原文字面量,否则本文件自身即命中);
|
|
60
|
+
// `.map` 的 sourcesContent 为单行 JSON 无法加同行豁免标记
|
|
61
|
+
// (2026-11-03,commit 546eda16 引入 vendor 时起误报;不跳过整个目录,避免放过未来新增内容)
|
|
62
|
+
/(?:^|\/)frontend\/public\/pdfview\/build\/pdf\.worker\.mjs(?:\.map)?$/,
|
|
63
|
+
];
|
|
64
|
+
const MAX_BYTES = 2 * 1024 * 1024;
|
|
65
|
+
|
|
66
|
+
const entropy = (s) => {
|
|
67
|
+
const m = new Map();
|
|
68
|
+
for (const ch of s) m.set(ch, (m.get(ch) || 0) + 1);
|
|
69
|
+
let h = 0;
|
|
70
|
+
for (const n of m.values()) h -= (n / s.length) * Math.log2(n / s.length);
|
|
71
|
+
return h;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const redact = (s) => (s.length <= 8 ? '***' : `${s.slice(0, 4)}***${s.slice(-2)}`);
|
|
75
|
+
|
|
76
|
+
// 宽泛规则的残余误报过滤(实测口径见头注)
|
|
77
|
+
const weakNoise = (line, m) => {
|
|
78
|
+
const v = m[1];
|
|
79
|
+
if (PLACEHOLDER.test(v)) return true;
|
|
80
|
+
if (entropy(v) < 3.5) return true;
|
|
81
|
+
if (!/\d/.test(v)) return true; // 纯字母 = 标识符 / 常量名
|
|
82
|
+
if (/^[0-9a-f]{8,20}$/i.test(v)) return true; // 短 hex = assembly token / GUID 片段
|
|
83
|
+
if ((v.match(/-/g) || []).length >= 3) return true; // 多连字符 = 描述性短语(如 integration-test-jwt-secret-2026-...)
|
|
84
|
+
if (/^[A-Za-z0-9_$]/.test(line.slice(m.index + m[0].length))) return true; // 值后续写 = 代码表达式
|
|
85
|
+
return false;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// 单行判定 → { rule, secret } 或 null
|
|
89
|
+
export const matchLine = (line, { generic }) => {
|
|
90
|
+
if (ALLOW_MARK.test(line)) return null;
|
|
91
|
+
for (const r of STRONG_RULES) {
|
|
92
|
+
const m = r.re.exec(line);
|
|
93
|
+
if (m) return { rule: r.id, secret: redact(m[0]) };
|
|
94
|
+
}
|
|
95
|
+
if (!generic) return null;
|
|
96
|
+
const m = GENERIC_RULE.re.exec(line);
|
|
97
|
+
if (m && !weakNoise(line, m)) return { rule: GENERIC_RULE.id, secret: redact(m[1]) };
|
|
98
|
+
const c = CRED_RULE.re.exec(line);
|
|
99
|
+
if (c) {
|
|
100
|
+
const v = c[0].replace(/^[^=]*=/, '').trim();
|
|
101
|
+
// 口令须含数字或符号(纯大写/驼峰标识符如 process.env.SMOKE_ADMIN_PASSWORD 不算)
|
|
102
|
+
if ((/\d/.test(v) || /[^A-Za-z0-9_]/.test(v)) && !PLACEHOLDER.test(v)) {
|
|
103
|
+
return { rule: CRED_RULE.id, secret: redact(v) };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const loadBaselineFiles = (file) => {
|
|
110
|
+
const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
111
|
+
const set = new Set();
|
|
112
|
+
for (const e of Array.isArray(raw) ? raw : []) {
|
|
113
|
+
if (e && typeof e.File === 'string') set.add(e.File.replace(/\\/g, '/'));
|
|
114
|
+
}
|
|
115
|
+
return set;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const isExempt = (file, baselineFiles) => baselineFiles.has(file) || ACCEPTED_FILE.some((re) => re.test(file));
|
|
119
|
+
const skipped = (p) => SKIP_PATH.some((re) => re.test(p));
|
|
120
|
+
|
|
121
|
+
const readIfText = (abs) => {
|
|
122
|
+
try {
|
|
123
|
+
const st = fs.statSync(abs);
|
|
124
|
+
if (!st.isFile() || st.size > MAX_BYTES) return null;
|
|
125
|
+
const buf = fs.readFileSync(abs);
|
|
126
|
+
if (buf.subarray(0, 8000).includes(0)) return null; // 二进制
|
|
127
|
+
return buf.toString('utf8');
|
|
128
|
+
} catch { return null; }
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const scanText = (file, text, baselineFiles, hits) => {
|
|
132
|
+
const generic = !isExempt(file, baselineFiles);
|
|
133
|
+
let ln = 0;
|
|
134
|
+
for (const line of text.split(/\r?\n/)) {
|
|
135
|
+
ln += 1;
|
|
136
|
+
const hit = matchLine(line, { generic });
|
|
137
|
+
if (hit) hits.push({ file, line: ln, rule: hit.rule, secret: hit.secret });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const scanWorkingTree = (root, baselineFiles) => {
|
|
142
|
+
// 根必须就是 git 顶层:CHECK_SECRETS_ROOT 指到子目录时 git 会回上层仓库,路径全 stat 失败 →
|
|
143
|
+
// scanned=0 的假绿。此处 fail-loud(下面对 scanned=0 也再兜一层)。
|
|
144
|
+
const top = spawnSync('git', ['rev-parse', '--show-toplevel'], { cwd: root, encoding: 'utf8' });
|
|
145
|
+
if (top.status !== 0) throw new Error(`git rev-parse --show-toplevel 失败(${root} 不是 git 工作区?):${top.stderr || top.status}`);
|
|
146
|
+
const topPath = path.resolve(String(top.stdout || '').trim());
|
|
147
|
+
if (topPath !== path.resolve(root)) throw new Error(`扫描根 ${root} 不是 git 顶层(顶层为 ${topPath})——拒跑,避免扫空目录假绿`);
|
|
148
|
+
const r = spawnSync('git', ['ls-files', '-z'], { cwd: root, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
149
|
+
if (r.status !== 0) throw new Error(`git ls-files 失败:${r.stderr || r.status}`);
|
|
150
|
+
const files = String(r.stdout || '').split('\0').map((s) => s.replace(/\\/g, '/')).filter(Boolean);
|
|
151
|
+
const hits = [];
|
|
152
|
+
let scanned = 0;
|
|
153
|
+
for (const f of files) {
|
|
154
|
+
if (skipped(f)) continue;
|
|
155
|
+
const text = readIfText(path.join(root, f));
|
|
156
|
+
if (text === null) continue;
|
|
157
|
+
scanned += 1;
|
|
158
|
+
scanText(f, text, baselineFiles, hits);
|
|
159
|
+
}
|
|
160
|
+
return { hits, scanned, unit: '文件' };
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// 增量:只判 git diff 的新增行(-U0 下无上下文行,行号取新侧)
|
|
164
|
+
const scanDiff = (root, range, baselineFiles) => {
|
|
165
|
+
const args = range === 'staged' ? ['diff', '--cached', '-U0', '--no-color'] : ['diff', '-U0', '--no-color', range];
|
|
166
|
+
const r = spawnSync('git', args, { cwd: root, encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
167
|
+
if (r.status !== 0) throw new Error(`git ${args.join(' ')} 失败:${r.stderr || r.status}`);
|
|
168
|
+
const hits = [];
|
|
169
|
+
let file = null;
|
|
170
|
+
let ln = 0;
|
|
171
|
+
let scanned = 0;
|
|
172
|
+
for (const raw of String(r.stdout || '').split(/\r?\n/)) {
|
|
173
|
+
if (raw.startsWith('+++ ')) {
|
|
174
|
+
const p = raw.slice(4).trim();
|
|
175
|
+
file = p === '/dev/null' ? null : p.replace(/^b\//, '');
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
const hunk = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(raw);
|
|
179
|
+
if (hunk) { ln = Number(hunk[1]); continue; }
|
|
180
|
+
if (!file || !raw.startsWith('+')) continue;
|
|
181
|
+
const line = raw.slice(1);
|
|
182
|
+
if (!skipped(file)) {
|
|
183
|
+
scanned += 1;
|
|
184
|
+
const hit = matchLine(line, { generic: !isExempt(file, baselineFiles) });
|
|
185
|
+
if (hit) hits.push({ file, line: ln, rule: hit.rule, secret: hit.secret });
|
|
186
|
+
}
|
|
187
|
+
ln += 1;
|
|
188
|
+
}
|
|
189
|
+
return { hits, scanned, unit: '新增行' };
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const scan = ({ root = DEFAULT_ROOT, mode = 'all', range = null, baseline } = {}) => {
|
|
193
|
+
const baselinePath = baseline || path.join(root, '.gitleaks-baseline.json');
|
|
194
|
+
if (!fs.existsSync(baselinePath)) {
|
|
195
|
+
const err = new Error(`基线缺失 ${baselinePath}——无豁免清单则全树必爆红,拒跑(重建口径见 .agents/notes/runtime-env.md §6.3)`);
|
|
196
|
+
err.code = 'NO_BASELINE';
|
|
197
|
+
throw err;
|
|
198
|
+
}
|
|
199
|
+
const baselineFiles = loadBaselineFiles(baselinePath);
|
|
200
|
+
const res = mode === 'staged' ? scanDiff(root, 'staged', baselineFiles)
|
|
201
|
+
: mode === 'range' ? scanDiff(root, range, baselineFiles)
|
|
202
|
+
: scanWorkingTree(root, baselineFiles);
|
|
203
|
+
return { ...res, baselineFiles: baselineFiles.size };
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const main = (argv = process.argv.slice(2), root = process.env.CHECK_SECRETS_ROOT || DEFAULT_ROOT) => {
|
|
207
|
+
const rangeIdx = argv.indexOf('--range');
|
|
208
|
+
const range = rangeIdx >= 0 ? argv[rangeIdx + 1] : null;
|
|
209
|
+
const mode = argv.includes('--staged') ? 'staged' : range ? 'range' : 'all';
|
|
210
|
+
if (mode === 'range' && (!range || range.startsWith('-'))) {
|
|
211
|
+
console.error('[secrets-lite] ❌ --range 需要一个范围参数(<a>..<b>)');
|
|
212
|
+
return 2;
|
|
213
|
+
}
|
|
214
|
+
let res;
|
|
215
|
+
try {
|
|
216
|
+
res = scan({ root, mode, range });
|
|
217
|
+
} catch (e) {
|
|
218
|
+
console.error(`[secrets-lite] ❌ ${e.message}`);
|
|
219
|
+
return 2;
|
|
220
|
+
}
|
|
221
|
+
if (argv.includes('--json')) console.log(JSON.stringify(res.hits, null, 1));
|
|
222
|
+
const scopeNote = mode === 'all' ? '工作树全量' : mode === 'staged' ? '暂存增量' : `增量 ${range}`;
|
|
223
|
+
if (mode === 'all' && res.scanned === 0) {
|
|
224
|
+
console.error(`[secrets-lite] ❌ 扫描面为 0 ${res.unit}(根 ${root})——空扫不算通过,按配置失守拒跑`);
|
|
225
|
+
return 2;
|
|
226
|
+
}
|
|
227
|
+
if (res.hits.length) {
|
|
228
|
+
for (const h of res.hits.slice(0, 50)) console.error(`[secrets-lite] ❌ ${h.file}:${h.line} ${h.rule} ${h.secret}`);
|
|
229
|
+
if (res.hits.length > 50) console.error(`[secrets-lite] …共 ${res.hits.length} 处,仅列前 50`);
|
|
230
|
+
console.error(`[secrets-lite] ❌ 发现 ${res.hits.length} 处疑似密钥(${scopeNote}|${res.scanned} ${res.unit})——删除该密钥或作废轮换;确属误报则同行加 secrets-lite:allow`);
|
|
231
|
+
return 1;
|
|
232
|
+
}
|
|
233
|
+
console.log(`[secrets-lite] ✅ 无泄漏(${scopeNote}|${res.scanned} ${res.unit}|基线豁免文件 ${res.baselineFiles})`);
|
|
234
|
+
return 0;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url))) {
|
|
238
|
+
process.exit(main());
|
|
239
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// check-secrets:密钥扫描门(2026-10-14 决定 4 / G5 安全插队;机制台账已登记)
|
|
3
|
+
// 用法:node .agents/scripts/check-secrets.mjs [--staged] [--lite]
|
|
4
|
+
// 默认 = 全量历史:gitleaks detect --baseline-path .gitleaks-baseline.json(基线外新泄漏 exit 1)
|
|
5
|
+
// --staged = 提交增量:gitleaks protect --staged(只看暂存内容,历史存量不触;原 pre-commit 消费——
|
|
6
|
+
// 2026-10-21 owner 指令「密钥本地不扫」退役该腿,旗标保留供手动/测试)
|
|
7
|
+
// SECRETS_SCAN_BASE=<sha>(2026-10-29 secrets-incr,verify 默认档注入)= 范围增量:只扫 <sha>..HEAD
|
|
8
|
+
// 新提交(锚点 = 最近绿行头,经 verify 的祖先校验——历史被 rebase 改写则锚失效回落全量);
|
|
9
|
+
// 覆盖链 = 每次绿行扫过锚..当刻,逐次滚动;全量兜底仍由 --full 本地档与 CI main 重档承担。
|
|
10
|
+
// 基线(存量豁免)在两种模式下同样适用。sha 解析不出 → loud WARN + 回退全量(fail-safe)。
|
|
11
|
+
// 二进制解析序(机理登记 = .agents/notes/runtime-env.md §6.3 gitleaks 条):
|
|
12
|
+
// GITLEAKS_BIN 环境变量(.mjs/.js 结尾经本进程 node 直跑——测试注缝)→ PATH 上 gitleaks
|
|
13
|
+
// → .agents/tools/gitleaks(.exe)(git-ignore,机器本地)。
|
|
14
|
+
// **2026-10-29 兜底(owner 口径「装不上也要扫」)**:三处皆缺(典型 = CI agent 无外网/无法落二进制),
|
|
15
|
+
// 改走纯 Node 轻量扫描 check-secrets-lite.mjs(零二进制零网络,复用同一份基线做文件级豁免)——
|
|
16
|
+
// **不再 loud-skip**:密钥门从此恒执法,只是执法者按环境降级(gitleaks → lite)。
|
|
17
|
+
// 强制指定:SECRETS_SCAN_LITE=1 或 --lite 跳过 gitleaks;SECRETS_SCAN_REQUIRE_GITLEAKS=1 则缺二进制即
|
|
18
|
+
// fail-closed(exit 2,供需要强执法面的场合)。降级事实在输出首行标明「执法者=lite」,绿行 envSkips 不再登记。
|
|
19
|
+
// 基线:.gitleaks-baseline.json = 2026-10-14 历史全量 1221 处存量豁免(--redact 生成;用户拍板
|
|
20
|
+
// 「豁免清单」,真实有效密钥的作废轮换另行处置,不因基线豁免)。2026-10-15 同口径重生成扩至 1227 处:
|
|
21
|
+
// 追加 7bd06ebb(新大洋-物资需求提报原始动作脚本)6 处「权限Key」uuid——用户确认系旧系统权限条目
|
|
22
|
+
// 标识符非凭证,与既有 wiki 产品需求采集物同类同处置。2026-10-24 再生成扩至 1230 处:追加
|
|
23
|
+
// e6f33915/919e7084 私有 npm 源 _auth 3 处(frontend/.npmrc ×2 + 文档抄录 ×1,同凭据家族)——
|
|
24
|
+
// 用户拍板「公司私有 npm 源(101.101.118.58:8089)Basic 认证凭据豁免,不作废轮换,下次不再扫」。
|
|
25
|
+
// 2026-10-31 再扩至 1236 处:追加 9ce8649e 的 5 处「rowKey」GUID(workflow/evidence/2026-10-31-username-caliber/probe.json
|
|
26
|
+
// ——前后端 UI 实测证据里人员表格的行 key = BasicConfig_Staff.ID)——**用户拍板「追加基线豁免 5 条(与 2026-10-15 先例同口径)」**,
|
|
27
|
+
// 确认系人员标识符非凭证(同文件另有 177 个 GUID 因字段名不含 key 未被判,属规则按字段名启发式命中)。
|
|
28
|
+
// 前向已把该字段值掩码为 <uuid> 并补 rowKeyKind 声明(5ace48f1);本次豁免用于让范围基线 9b8bc5cd..HEAD 内的历史提交 9ce8649e 不再命中。
|
|
29
|
+
// detect 模式基线缺失 = exit 2
|
|
30
|
+
// (配置失守 fail-closed——静默无基线会让存量全量爆红,与拍板相反)。
|
|
31
|
+
// 测试面已随引擎减重退役(2026-10-28,owner 决策),本脚本现无测试兜底
|
|
32
|
+
import fs from 'node:fs';
|
|
33
|
+
import path from 'node:path';
|
|
34
|
+
import { spawnSync } from 'node:child_process';
|
|
35
|
+
import { fileURLToPath } from 'node:url';
|
|
36
|
+
import { main as liteMain } from './check-secrets-lite.mjs';
|
|
37
|
+
|
|
38
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
39
|
+
const ROOT = process.env.CHECK_SECRETS_ROOT || path.resolve(SCRIPT_DIR, '..', '..');
|
|
40
|
+
const STAGED = process.argv.includes('--staged');
|
|
41
|
+
const FORCE_LITE = process.argv.includes('--lite') || process.env.SECRETS_SCAN_LITE === '1';
|
|
42
|
+
const BASELINE = path.join(ROOT, '.gitleaks-baseline.json');
|
|
43
|
+
|
|
44
|
+
function resolveBin() {
|
|
45
|
+
if (FORCE_LITE) return null;
|
|
46
|
+
const envBin = process.env.GITLEAKS_BIN;
|
|
47
|
+
if (envBin) {
|
|
48
|
+
if (!fs.existsSync(envBin)) return null;
|
|
49
|
+
return /\.(mjs|js)$/i.test(envBin) ? { node: envBin } : { raw: envBin };
|
|
50
|
+
}
|
|
51
|
+
const probe = spawnSync('gitleaks', ['version'], { encoding: 'utf8' });
|
|
52
|
+
if (probe.status === 0) return { raw: 'gitleaks' };
|
|
53
|
+
const local = path.join(ROOT, '.agents', 'tools', process.platform === 'win32' ? 'gitleaks.exe' : 'gitleaks');
|
|
54
|
+
if (fs.existsSync(local)) return { raw: local };
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 扫描范围(2026-10-29 secrets-incr):SECRETS_SCAN_BASE 给定且可解析 → 只扫 base..HEAD;
|
|
59
|
+
// 未给定 / 解析不出 → 全量(后者加 loud WARN,fail-safe 不静默)。
|
|
60
|
+
let range = null;
|
|
61
|
+
if (!STAGED && process.env.SECRETS_SCAN_BASE) {
|
|
62
|
+
const base = process.env.SECRETS_SCAN_BASE;
|
|
63
|
+
const probe = spawnSync('git', ['rev-parse', '--verify', '--quiet', `${base}^{commit}`], { cwd: ROOT, encoding: 'utf8' });
|
|
64
|
+
if (probe.status === 0) {
|
|
65
|
+
range = `${base.trim()}..HEAD`;
|
|
66
|
+
} else {
|
|
67
|
+
console.error(`[check-secrets] ⚠️ SECRETS_SCAN_BASE="${base}" 解析不出(非本仓提交/被改写?)——回退全量历史扫描`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const scanRangeNote = STAGED ? '暂存增量' : range ? `增量范围 ${range}` : '全量';
|
|
72
|
+
|
|
73
|
+
const bin = resolveBin();
|
|
74
|
+
if (!bin) {
|
|
75
|
+
if (process.env.SECRETS_SCAN_REQUIRE_GITLEAKS === '1' && !FORCE_LITE) {
|
|
76
|
+
console.error('[check-secrets] ❌ SECRETS_SCAN_REQUIRE_GITLEAKS=1 但 gitleaks 三处解析皆缺——按配置 fail-closed 拦下(装机见 .agents/notes/runtime-env.md §6.3)');
|
|
77
|
+
process.exit(2);
|
|
78
|
+
}
|
|
79
|
+
if (!STAGED && !fs.existsSync(BASELINE)) {
|
|
80
|
+
console.error(`[check-secrets] ❌ 基线缺失 ${BASELINE}——轻量扫描同样依赖豁免清单,拒跑。重建:gitleaks detect --redact 全量报告存为该文件(口径见 runtime-env §6.3)`);
|
|
81
|
+
process.exit(2);
|
|
82
|
+
}
|
|
83
|
+
console.error(`[check-secrets] ℹ️ 执法者=lite(gitleaks 不可用${FORCE_LITE ? '/已强制 --lite' : '——未装或 CI 无外网'}):纯 Node 轻量规则 + 同一基线文件级豁免;强执法面(全史逐行模式匹配)请装 gitleaks(runtime-env.md §6.3)`);
|
|
84
|
+
const liteArgs = STAGED ? ['--staged'] : range ? ['--range', range] : [];
|
|
85
|
+
process.exit(liteMain(liteArgs, ROOT));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!STAGED && !fs.existsSync(BASELINE)) {
|
|
89
|
+
console.error(`[check-secrets] ❌ 基线缺失 ${BASELINE}——detect 无基线 = 存量豁免失效全量爆红,拒跑。重建:gitleaks detect --redact 全量报告存为该文件(口径见 runtime-env §6.3)`);
|
|
90
|
+
process.exit(2);
|
|
91
|
+
}
|
|
92
|
+
console.log(`[check-secrets] 执法者=gitleaks(${bin.raw || bin.node})`);
|
|
93
|
+
const args = STAGED
|
|
94
|
+
? ['protect', '--staged', '--redact', '--no-banner']
|
|
95
|
+
: ['detect', '--source', '.', '--baseline-path', BASELINE, '--redact', '--no-banner',
|
|
96
|
+
...(range ? ['--log-opts', range] : [])];
|
|
97
|
+
const r = bin.node
|
|
98
|
+
? spawnSync(process.execPath, [bin.node, ...args], { stdio: 'inherit' })
|
|
99
|
+
: spawnSync(bin.raw, args, { stdio: 'inherit' });
|
|
100
|
+
if (r.status !== 0) {
|
|
101
|
+
console.error(`[check-secrets] ❌ ${STAGED ? '暂存内容' : range ? `增量范围(${range},基线外)` : '历史(基线外)'}发现密钥泄漏(gitleaks exit ${r.status})——上方为 redacted 明细;新泄漏修法:删除该密钥或作废轮换,禁改基线豁免`);
|
|
102
|
+
process.exit(r.status ?? 1);
|
|
103
|
+
}
|
|
104
|
+
console.log(`[check-secrets] ✅ 执法者=gitleaks|${scanRangeNote}(基线外)无泄漏`);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* check-test-impact-map: 影响面映射完整性机检
|
|
3
|
+
*
|
|
4
|
+
* 目的:防止「新增测试类未登记 → 推送时被静默跳过」。
|
|
5
|
+
* 口径:tests/Shipyard.Material.IntegrationTests 下所有含 [Fact]/[Theory] 的文件,
|
|
6
|
+
* 其 public *Tests 类必须与 .agents/config/test-impact-map.json 的 areas 完全一致。
|
|
7
|
+
* FullChain/ 默认不编译(#if FCLocal),不纳入。
|
|
8
|
+
*
|
|
9
|
+
* 何时硬红:run-backend-tests.mjs --full(CI 重档)先跑本检查,失败即退出 1。
|
|
10
|
+
* 何时软兜底:pre-push 选测时若发现未登记类,selector 自动回退全量(见 test-impact-lib.mjs)。
|
|
11
|
+
*
|
|
12
|
+
* 退出码:0 = 一致;1 = 缺失/陈旧/重复/测试类命名无法识别。
|
|
13
|
+
*/
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import { ROOT, loadMap } from './test-impact-lib.mjs';
|
|
19
|
+
|
|
20
|
+
const TEST_DIR = path.join(ROOT, 'tests', 'Shipyard.Material.IntegrationTests');
|
|
21
|
+
const SKIP_DIRS = new Set(['bin', 'obj', 'FullChain']);
|
|
22
|
+
const CLASS_RE = /^public\s+(?:sealed\s+|abstract\s+|partial\s+)*class\s+([A-Za-z_][A-Za-z0-9_]*)/gm;
|
|
23
|
+
|
|
24
|
+
const walk = (dir) => {
|
|
25
|
+
const out = [];
|
|
26
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
27
|
+
if (entry.isDirectory()) {
|
|
28
|
+
if (SKIP_DIRS.has(entry.name)) continue;
|
|
29
|
+
out.push(...walk(path.join(dir, entry.name)));
|
|
30
|
+
} else if (entry.isFile() && entry.name.endsWith('.cs')) {
|
|
31
|
+
out.push(path.join(dir, entry.name));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
let map;
|
|
38
|
+
try {
|
|
39
|
+
const mapIdx = process.argv.indexOf('--map');
|
|
40
|
+
const mapPath = mapIdx >= 0 ? process.argv[mapIdx + 1] : undefined;
|
|
41
|
+
if (mapIdx >= 0 && !mapPath) throw new Error('--map 缺少路径');
|
|
42
|
+
map = loadMap(mapPath);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.error(`check-test-impact-map: ${e.message}`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const mapped = new Map();
|
|
49
|
+
for (const [area, classes] of Object.entries(map.areas)) {
|
|
50
|
+
for (const cls of classes) {
|
|
51
|
+
if (!mapped.has(cls)) mapped.set(cls, new Set());
|
|
52
|
+
mapped.get(cls).add(area);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const source = new Map();
|
|
57
|
+
const errors = [];
|
|
58
|
+
for (const file of walk(TEST_DIR)) {
|
|
59
|
+
const src = fs.readFileSync(file, 'utf8');
|
|
60
|
+
const classes = [];
|
|
61
|
+
for (const m of src.matchAll(CLASS_RE)) {
|
|
62
|
+
if (m[1].endsWith('Tests')) classes.push(m[1]);
|
|
63
|
+
}
|
|
64
|
+
if (classes.length > 0) {
|
|
65
|
+
const ns = (src.match(/^namespace\s+([A-Za-z0-9_.]+)/m) || [])[1];
|
|
66
|
+
if (ns && ns !== map.namespace) {
|
|
67
|
+
errors.push(`测试命名空间与 manifest 不一致:${path.relative(ROOT, file)} → ${ns}(期望 ${map.namespace})`);
|
|
68
|
+
}
|
|
69
|
+
for (const cls of classes) {
|
|
70
|
+
if (source.has(cls)) {
|
|
71
|
+
errors.push(`测试类重复声明:${cls}(${path.relative(ROOT, source.get(cls))} 与 ${path.relative(ROOT, file)})`);
|
|
72
|
+
} else {
|
|
73
|
+
source.set(cls, file);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (/\[(Fact|Theory)\b/.test(src)) {
|
|
79
|
+
errors.push(`无法识别的测试类(文件含 [Fact]/[Theory] 但没有 public *Tests 类):${path.relative(ROOT, file)}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const missing = [...source.keys()].filter((cls) => !mapped.has(cls)).sort();
|
|
84
|
+
const stale = [...mapped.keys()].filter((cls) => !source.has(cls)).sort();
|
|
85
|
+
|
|
86
|
+
if (missing.length) {
|
|
87
|
+
errors.push(`未登记的测试类(${missing.length}):\n - ${missing.join('\n - ')}`);
|
|
88
|
+
}
|
|
89
|
+
if (stale.length) {
|
|
90
|
+
errors.push(`manifest 中已不存在的测试类(${stale.length}):\n - ${stale.join('\n - ')}`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (errors.length) {
|
|
94
|
+
console.error('check-test-impact-map: FAIL');
|
|
95
|
+
for (const err of errors) console.error(`- ${err}`);
|
|
96
|
+
console.error('修复:更新 .agents/config/test-impact-map.json 后重跑。');
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const areaCounts = Object.entries(map.areas)
|
|
101
|
+
.map(([area, classes]) => `${area}=${classes.length}`)
|
|
102
|
+
.join(' ');
|
|
103
|
+
console.log('check-test-impact-map: OK');
|
|
104
|
+
console.log(` classes: ${source.size}(source=${source.size}, mapped=${mapped.size})`);
|
|
105
|
+
console.log(` areas: ${Object.keys(map.areas).length}(${areaCounts})`);
|
|
106
|
+
console.log(` always: ${map.always.length}`);
|
|
107
|
+
console.log(` paths: ${map.paths.length}`);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ci-assert-frontend-deps — CI「npm install 后 devDependencies 是否真落地」的前置断言(2026-10-29)
|
|
3
|
+
// 动机:CI build 实跑红在三条门(frontend-lint / frontend-unit-test)都报
|
|
4
|
+
// `'vitest' is not recognized as an internal or external command` / `'eslint' is not ...`——
|
|
5
|
+
// npm install 退出码 0 却少装 devDependencies(agent 侧 NODE_ENV=production 或 omit=dev 常见)。
|
|
6
|
+
// 让它在安装后一步当场失败,错误信息直指原因,而不是三条门各自重复报「命令不存在」。
|
|
7
|
+
// 判据:frontend/node_modules/.bin 下 vitest 与 eslint 的可执行入口存在(跨平台判据看包目录)。
|
|
8
|
+
// 退出码:0 齐全;1 缺失(打印可操作的修法)。
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import { execFileSync } from 'node:child_process';
|
|
12
|
+
|
|
13
|
+
const ROOT = execFileSync('git', ['rev-parse', '--show-toplevel'], { encoding: 'utf8' }).trim();
|
|
14
|
+
const FE = path.join(ROOT, 'frontend');
|
|
15
|
+
const REQUIRED = [
|
|
16
|
+
{ pkg: 'vitest', cmd: 'vitest', why: 'frontend-unit-test(vitest run)' },
|
|
17
|
+
{ pkg: 'eslint', cmd: 'eslint', why: 'frontend-lint(eslint .)' },
|
|
18
|
+
{ pkg: 'vue-tsc', cmd: 'vue-tsc', why: 'frontend-build(vue-tsc -b)' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const binDir = path.join(FE, 'node_modules', '.bin');
|
|
22
|
+
if (!fs.existsSync(path.join(FE, 'node_modules'))) {
|
|
23
|
+
console.error(`[ci-assert-frontend-deps] ❌ frontend/node_modules 不存在——npm install 未执行或工作目录不对(${FE})`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const missing = [];
|
|
28
|
+
for (const r of REQUIRED) {
|
|
29
|
+
const pkgJson = path.join(FE, 'node_modules', r.pkg, 'package.json');
|
|
30
|
+
const bin = path.join(binDir, process.platform === 'win32' ? `${r.cmd}.cmd` : r.cmd);
|
|
31
|
+
if (!fs.existsSync(pkgJson) || !fs.existsSync(bin)) missing.push(r);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (missing.length) {
|
|
35
|
+
console.error('[ci-assert-frontend-deps] ❌ devDependencies 未落地(npm install 退出码 0 也可能少装):');
|
|
36
|
+
for (const m of missing) console.error(` · ${m.pkg}(${m.why}):缺 node_modules/${m.pkg} 或 node_modules/.bin/${m.cmd}`);
|
|
37
|
+
console.error('[ci-assert-frontend-deps] 常见原因:agent 侧 NODE_ENV=production / npm config omit=dev / 私有源 .npmrc 认证失败导致整包跳过。');
|
|
38
|
+
console.error('[ci-assert-frontend-deps] 修法:npm install --legacy-peer-deps --include=dev(并确认 NODE_ENV=development、npm_config_omit 为空)。');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log(`[ci-assert-frontend-deps] ✅ devDependencies 齐全:${REQUIRED.map((r) => r.pkg).join(' / ')}(${path.relative(ROOT, binDir)})`);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// CI 提交信息卫生检出(2026-11-05 复盘 P0 机器执法):把「commit-msg 钩子未挂 / 被 --no-verify 跳过」
|
|
3
|
+
// 变成 CI 可见失败——对推送区间内每个新提交(--no-merges,TFS PR 合并提交不校验)的 message 按
|
|
4
|
+
// .githooks/commit-msg 同一份规则校验(枚举/正则单源 .agents/config/commit-msg-rules.json,禁双源)。
|
|
5
|
+
// 检出边界:覆盖「钩子未挂 / --no-verify 且消息违规」;不覆盖「--no-verify 但消息恰好合法」(合法即无可报违规)。
|
|
6
|
+
// 区间传递:三层基准
|
|
7
|
+
// ① --base 显式指定(本地复跑);
|
|
8
|
+
// ② PR 构建(SYSTEM_PULLREQUEST_TARGETBRANCH 在场且 HEAD 是合并提交):取合并提交的第一父(= 目标分支尖端)
|
|
9
|
+
// 作基准,只判本 PR 引入的提交。原因(2026-11-05 实测 build 29054 假红):PR 构建的 CI_PUSH_BEFORE 来自
|
|
10
|
+
// changes API「最老一笔的第一父」,该区间会拉入目标分支侧历史(main 上的「还原…」存量提交),
|
|
11
|
+
// 把规则生效前的旧提交判红——规则只约束新提交,存量不该拦发布 PR。
|
|
12
|
+
// ③ 推送构建:CI_PUSH_BEFORE;取不到 advisory 退回 HEAD~1(同泳道门退回口径)。
|
|
13
|
+
// 本地测试可 --base <revision> 显式指定。违规 exit 1 并逐条列出(hash + message + 违规原因)。
|
|
14
|
+
import fs from 'node:fs';
|
|
15
|
+
import path from 'node:path';
|
|
16
|
+
import { spawnSync } from 'node:child_process';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
|
|
19
|
+
const RULES = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'config', 'commit-msg-rules.json');
|
|
20
|
+
|
|
21
|
+
const fail = (msg) => { console.error(`ci-commit-hygiene: ${msg}`); process.exit(1); };
|
|
22
|
+
|
|
23
|
+
let types = [];
|
|
24
|
+
let exemptRe = null;
|
|
25
|
+
let typeRe = null;
|
|
26
|
+
try {
|
|
27
|
+
const rules = JSON.parse(fs.readFileSync(RULES, 'utf8'));
|
|
28
|
+
types = rules.types;
|
|
29
|
+
exemptRe = new RegExp(rules.exemptPrefix);
|
|
30
|
+
typeRe = new RegExp('^(' + rules.types.join('|') + ')' + rules.typeSuffix);
|
|
31
|
+
} catch (e) { fail(`规则单源 ${RULES} 读取失败:${e.message}`); }
|
|
32
|
+
|
|
33
|
+
const argOf = (k) => {
|
|
34
|
+
const i = process.argv.indexOf(k);
|
|
35
|
+
return i >= 0 && i + 1 < process.argv.length ? process.argv[i + 1] : '';
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const gitOut = (args) => {
|
|
39
|
+
// maxBuffer 抬到 64MB:spawnSync 缺省 1MB——区间覆盖整支历史(如 develop→main 同步直推)时
|
|
40
|
+
// %B 全量输出实测超 1MB 即 ENOBUFS(2026-11-05 实测假红)。64MB ≈ 本仓全历史输出的 50 倍余量。
|
|
41
|
+
const r = spawnSync('git', ['-c', 'core.quotepath=off', ...args], { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
42
|
+
if (r.status !== 0) fail(`git ${args.join(' ')} 失败:${String(r.stderr || r.error || '').trim()}`);
|
|
43
|
+
return String(r.stdout || '');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
let base = argOf('--base');
|
|
47
|
+
let baseSource = '--base';
|
|
48
|
+
if (!base) {
|
|
49
|
+
const isPrBuild = Boolean((process.env.SYSTEM_PULLREQUEST_TARGETBRANCH || '').trim());
|
|
50
|
+
const parents = gitOut(['rev-list', '--parents', '-n', '1', 'HEAD']).trim().split(/\s+/).slice(1);
|
|
51
|
+
if (isPrBuild && parents.length > 1) {
|
|
52
|
+
base = parents[0];
|
|
53
|
+
baseSource = 'PR 目标侧第一父';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!base) {
|
|
57
|
+
base = (process.env.CI_PUSH_BEFORE || '').trim();
|
|
58
|
+
baseSource = 'CI_PUSH_BEFORE';
|
|
59
|
+
}
|
|
60
|
+
if (!base) {
|
|
61
|
+
base = 'HEAD~1';
|
|
62
|
+
baseSource = 'HEAD~1 回落';
|
|
63
|
+
console.error('ci-commit-hygiene: advisory: 无 --base / PR 合并检出 / CI_PUSH_BEFORE——退回 HEAD~1(同泳道门口径,多提交直推仅核末笔)');
|
|
64
|
+
}
|
|
65
|
+
base = gitOut(['rev-parse', base]).trim(); // 解析为 40 位 sha,顺带验证区间起点在本仓存在(不合法 loud fail)
|
|
66
|
+
const head = gitOut(['rev-parse', 'HEAD']).trim();
|
|
67
|
+
|
|
68
|
+
const log = gitOut(['log', '--no-merges', '--format=%H%x1f%B%x1e', `${base}..${head}`]);
|
|
69
|
+
const violations = [];
|
|
70
|
+
let total = 0;
|
|
71
|
+
for (const rec of log.split('\u001e')) {
|
|
72
|
+
if (!rec.trim()) continue;
|
|
73
|
+
const [hash, body = ''] = rec.split('\u001f');
|
|
74
|
+
const first = body.split(/\r?\n/)[0] || '';
|
|
75
|
+
total++;
|
|
76
|
+
if (exemptRe.test(first) || typeRe.test(first)) continue;
|
|
77
|
+
violations.push({ hash, first });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const span = `${base.slice(0, 12)}..${head.slice(0, 12)}`;
|
|
81
|
+
if (violations.length) {
|
|
82
|
+
console.error(`ci-commit-hygiene: 区间 ${span}(基准=${baseSource})共 ${total} 笔(不含合并提交),${violations.length} 笔消息违规:`);
|
|
83
|
+
for (const v of violations) console.error(` ${v.hash} 首行:${v.first || '(空首行)'}\n 原因:提交类型须为 ${types.join('/')}(AGENTS.md「git提交」)`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
console.log(`ci-commit-hygiene: 区间 ${span}(基准=${baseSource})共 ${total} 笔(不含合并提交),0 违规`);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ci-install-gitleaks — CI agent 尽力装机 gitleaks 至 .agents/tools/(2026-10-15 papercut 消债;
|
|
3
|
+
// 2026-10-29 改「尽力而为」:装不上不再拦 build)。
|
|
4
|
+
// 背景:verify 安全段 secrets-scan(check-secrets.mjs)解析序 = GITLEAKS_BIN → PATH → .agents/tools/。
|
|
5
|
+
// 2026-10-29 起三处皆缺时不再 loud-skip,而是自动接续纯 Node 兜底扫描(check-secrets-lite.mjs)。
|
|
6
|
+
// 故 CI 装机失败不再等于「密钥门不设防」——只等于「执法者降级为 lite」,不该拦整条流水线。
|
|
7
|
+
// 行为:
|
|
8
|
+
// ① PATH 上已有匹配版本 → 幂等直过;② .agents/tools/ 已有匹配版本 → 幂等直过;
|
|
9
|
+
// ③ 否则从 GitHub releases 下 zip 解压(下载 20s 超时、解压/核验失败均不阻断);
|
|
10
|
+
// ④ 任何失败 = exit 0 + 醒目告警(交由 check-secrets 的 lite 兜底),只有提示信息写日志。
|
|
11
|
+
// 需要「装不上就红」的场合:设 SECRETS_SCAN_REQUIRE_GITLEAKS=1(check-secrets 会 fail-closed exit 2)。
|
|
12
|
+
// 版本锚 8.30.1:与本机及基线生成口径一致(runtime-env §6.3)。agent = 自托管 Windows(池 JAMTC),
|
|
13
|
+
// 解压走 PowerShell Expand-Archive;非 win32 回退 tar -xf(bsdtar 可解 zip),供他日换池。
|
|
14
|
+
// checkout clean:true 每跑重装(.agents/tools/ 在工作区内随清)——~10MB/跑 换确定性,缓存化留待再登记。
|
|
15
|
+
import { execFileSync, spawnSync } from 'node:child_process';
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import os from 'node:os';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
|
|
20
|
+
const VERSION = '8.30.1';
|
|
21
|
+
const win = process.platform === 'win32';
|
|
22
|
+
const plat = win ? 'windows_x64' : 'linux_x64';
|
|
23
|
+
const URL = `https://github.com/gitleaks/gitleaks/releases/download/v${VERSION}/gitleaks_${VERSION}_${plat}.zip`;
|
|
24
|
+
const ROOT = execFileSync('git', ['rev-parse', '--show-toplevel'], { encoding: 'utf8' }).trim();
|
|
25
|
+
const toolsDir = process.env.GITLEAKS_TOOLS_DIR || path.join(ROOT, '.agents', 'tools');
|
|
26
|
+
const bin = path.join(toolsDir, win ? 'gitleaks.exe' : 'gitleaks');
|
|
27
|
+
|
|
28
|
+
const ok = (cmd) => spawnSync(cmd, ['version'], { encoding: 'utf8' });
|
|
29
|
+
const skip = (why) => {
|
|
30
|
+
console.log(`[ci-install-gitleaks] ⏭️ ${why}——密钥门执法者降级为 lite(纯 Node 兜底扫描,仍执法);需要强执法面请把 gitleaks 预装到 agent PATH(runtime-env §6.3)`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// ① PATH 上已有(运维预装的退路)
|
|
35
|
+
const onPath = ok('gitleaks');
|
|
36
|
+
if (onPath.status === 0 && String(onPath.stdout).includes(VERSION)) {
|
|
37
|
+
console.log(`[ci-install-gitleaks] 已装于 PATH(${VERSION})——幂等跳过下载`);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ② 工作区工具目录已有
|
|
42
|
+
if (fs.existsSync(bin)) {
|
|
43
|
+
const p = ok(bin);
|
|
44
|
+
if (p.status === 0 && String(p.stdout).includes(VERSION)) {
|
|
45
|
+
console.log(`[ci-install-gitleaks] 已装机 ${VERSION}(${bin})——幂等跳过下载`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
console.error('[ci-install-gitleaks] 既有二进制版本核验异常,尝试重装覆盖');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
fs.mkdirSync(toolsDir, { recursive: true });
|
|
52
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gitleaks-ci-'));
|
|
53
|
+
const zip = path.join(tmp, 'gitleaks.zip');
|
|
54
|
+
console.log(`[ci-install-gitleaks] 下载 ${URL}`);
|
|
55
|
+
let res;
|
|
56
|
+
try {
|
|
57
|
+
res = await fetch(URL, { signal: AbortSignal.timeout(20000) });
|
|
58
|
+
} catch (e) {
|
|
59
|
+
skip(`下载失败(${e.name === 'TimeoutError' ? '20s 超时' : e.code || e.message};agent 可能不通外网)`);
|
|
60
|
+
}
|
|
61
|
+
if (!res.ok) skip(`下载失败 HTTP ${res.status}`);
|
|
62
|
+
fs.writeFileSync(zip, Buffer.from(await res.arrayBuffer()));
|
|
63
|
+
|
|
64
|
+
const extract = win
|
|
65
|
+
? spawnSync('powershell', ['-NoProfile', '-Command', 'Expand-Archive', '-Path', zip, '-DestinationPath', tmp, '-Force'], { encoding: 'utf8' })
|
|
66
|
+
: spawnSync('tar', ['-xf', zip, '-C', tmp], { encoding: 'utf8' });
|
|
67
|
+
if (extract.status !== 0) skip(`解压失败:${extract.stderr || '(无 stderr)'}`);
|
|
68
|
+
const inner = path.join(tmp, win ? 'gitleaks.exe' : 'gitleaks');
|
|
69
|
+
if (!fs.existsSync(inner)) skip(`解压产物缺 ${inner}(zip 结构变更?)`);
|
|
70
|
+
fs.copyFileSync(inner, bin);
|
|
71
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
72
|
+
|
|
73
|
+
const p = ok(bin);
|
|
74
|
+
if (p.status !== 0 || !String(p.stdout).includes(VERSION)) skip(`装机后版本核验失败(exit ${p.status},out:${p.stdout})`);
|
|
75
|
+
console.log(`[ci-install-gitleaks] ✅ gitleaks ${VERSION} 装机完成:${bin}——check-secrets 将用 gitleaks 强执法`);
|