@mmerterden/multi-agent-pipeline 20.39.0 → 20.40.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.
Files changed (436) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +24 -9
  3. package/README.tr.md +22 -8
  4. package/docs/FIGMA_PIPELINE.md +1 -1
  5. package/docs/ecosystem.md +6 -6
  6. package/docs/facts.json +5 -5
  7. package/docs/features.md +4 -4
  8. package/index.js +13 -2
  9. package/install/_common.mjs +0 -126
  10. package/install/_dev-only-files.mjs +1 -0
  11. package/install/_managed-block.mjs +5 -18
  12. package/install/_unattended-profile.mjs +200 -30
  13. package/install/claude.mjs +29 -39
  14. package/install/codex.mjs +2 -1
  15. package/install/copilot.mjs +1 -23
  16. package/install/index.mjs +195 -54
  17. package/install/templates/claude-hooks.json +23 -1
  18. package/manifest.json +438 -381
  19. package/package.json +3 -2
  20. package/pipeline/agents/code-reviewer.md +1 -1
  21. package/pipeline/commands/multi-agent/SKILL.md +1 -1
  22. package/pipeline/commands/multi-agent/analysis/SKILL.md +1 -1
  23. package/pipeline/commands/multi-agent/autopilot/SKILL.md +3 -3
  24. package/pipeline/commands/multi-agent/autopilot-off/SKILL.md +15 -13
  25. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +7 -5
  26. package/pipeline/commands/multi-agent/health/SKILL.md +6 -4
  27. package/pipeline/commands/multi-agent/office-on/SKILL.md +2 -3
  28. package/pipeline/commands/multi-agent/office-pair/SKILL.md +23 -0
  29. package/pipeline/contract/CHANGELOG.md +27 -0
  30. package/pipeline/contract/README.md +2 -0
  31. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  32. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  33. package/pipeline/contract/fixtures/error-unsigned.json +1 -1
  34. package/pipeline/contract/fixtures/launch-plan.json +1 -1
  35. package/pipeline/contract/manifest.json +28 -2
  36. package/pipeline/contract/types/index.d.ts +178 -5
  37. package/pipeline/lib/agent-model-sync.mjs +2 -4
  38. package/pipeline/lib/args.mjs +194 -0
  39. package/pipeline/lib/autopilot-activation.sh +1 -1
  40. package/pipeline/lib/autopilot-state.sh +1 -1
  41. package/pipeline/lib/bg-launch.mjs +3 -3
  42. package/pipeline/lib/classify-intent.sh +9 -9
  43. package/pipeline/lib/claude-sessions.mjs +74 -5
  44. package/pipeline/lib/cli-help.mjs +80 -0
  45. package/pipeline/lib/credential-inventory.sh +23 -4
  46. package/pipeline/lib/credential-resolve.mjs +8 -12
  47. package/pipeline/lib/credential-store.sh +1 -1
  48. package/pipeline/lib/cross-repo.mjs +61 -0
  49. package/pipeline/lib/extract-conventions.sh +27 -27
  50. package/pipeline/lib/fetch-figma-annotations.sh +1 -1
  51. package/pipeline/lib/free-hosts.generated.mjs +22 -0
  52. package/pipeline/lib/glob-match.mjs +189 -0
  53. package/pipeline/lib/health-messages.mjs +351 -0
  54. package/pipeline/lib/identifier-scan.mjs +22 -11
  55. package/pipeline/lib/jira-family-write.sh +3 -3
  56. package/pipeline/lib/jira-publish.sh +1 -1
  57. package/pipeline/lib/json-file-lock.mjs +24 -23
  58. package/pipeline/lib/mcp-config-audit.mjs +1479 -0
  59. package/pipeline/lib/outbound-gate.mjs +8 -70
  60. package/pipeline/lib/owned-path-gate.mjs +6 -180
  61. package/pipeline/lib/plan-todos.sh +1 -1
  62. package/pipeline/lib/plugin-skill-roots.mjs +45 -1
  63. package/pipeline/lib/pr-request-location.mjs +3 -3
  64. package/pipeline/lib/prefs-value.mjs +122 -21
  65. package/pipeline/lib/regular-file.mjs +11 -6
  66. package/pipeline/lib/repo-profile-derive.mjs +138 -65
  67. package/pipeline/lib/repo-profile-root.mjs +52 -0
  68. package/pipeline/lib/repo-profile.mjs +5 -38
  69. package/pipeline/lib/review-watch.sh +1 -1
  70. package/pipeline/lib/run-worktree.mjs +147 -0
  71. package/pipeline/lib/run-writable.sh +85 -0
  72. package/pipeline/lib/safe-write.mjs +542 -0
  73. package/pipeline/lib/secret-patterns.generated.mjs +249 -0
  74. package/pipeline/lib/shadow-git.sh +1 -1
  75. package/pipeline/lib/slug.mjs +118 -0
  76. package/pipeline/lib/tdd-evidence.mjs +13 -13
  77. package/pipeline/lib/unattended-profile-check.mjs +75 -31
  78. package/pipeline/lib/unattended-tool-homes.mjs +1407 -0
  79. package/pipeline/lib/untrusted-fence.mjs +65 -0
  80. package/pipeline/lib/untrusted.mjs +13 -25
  81. package/pipeline/lib/user-facing.mjs +3 -5
  82. package/pipeline/lib/vercel-deploy.sh +2 -2
  83. package/pipeline/lib/web-push.mjs +198 -0
  84. package/pipeline/multi-agent-refs/analysis/locked.md +6 -6
  85. package/pipeline/multi-agent-refs/analysis-template.md +3 -3
  86. package/pipeline/multi-agent-refs/conventions-defaults.md +2 -2
  87. package/pipeline/multi-agent-refs/features/autopilot-operations.md +10 -7
  88. package/pipeline/multi-agent-refs/features/constitution.md +3 -3
  89. package/pipeline/multi-agent-refs/features/doctor.md +6 -1
  90. package/pipeline/multi-agent-refs/features/external-context-injection.md +1 -1
  91. package/pipeline/multi-agent-refs/features/office-remote-protocol.md +152 -1
  92. package/pipeline/multi-agent-refs/features/office-threat-model.md +1 -1
  93. package/pipeline/multi-agent-refs/features/phone-api.md +1 -1
  94. package/pipeline/multi-agent-refs/features/plan-critic.md +3 -3
  95. package/pipeline/multi-agent-refs/features/repo-profile.md +2 -2
  96. package/pipeline/multi-agent-refs/features/review-decision.md +21 -8
  97. package/pipeline/multi-agent-refs/features/scaffold.md +1 -1
  98. package/pipeline/multi-agent-refs/features/unattended-gates.md +3 -3
  99. package/pipeline/multi-agent-refs/features/unattended-security.md +486 -22
  100. package/pipeline/multi-agent-refs/features/usage-reporting.md +60 -0
  101. package/pipeline/multi-agent-refs/garbage-collect/phases.md +3 -1
  102. package/pipeline/multi-agent-refs/help/en.md +2 -2
  103. package/pipeline/multi-agent-refs/help/tr.md +7 -7
  104. package/pipeline/multi-agent-refs/keychain.md +1 -0
  105. package/pipeline/multi-agent-refs/knowledge.md +1 -0
  106. package/pipeline/multi-agent-refs/orchestrator/skill-loading.md +1 -1
  107. package/pipeline/multi-agent-refs/outside-the-pipeline.md +1 -0
  108. package/pipeline/multi-agent-refs/phases/phase-3-review.md +4 -3
  109. package/pipeline/multi-agent-refs/phases/phase-5-report.md +6 -4
  110. package/pipeline/multi-agent-refs/phases.md +1 -1
  111. package/pipeline/multi-agent-refs/sync/stack-plugins.md +1 -1
  112. package/pipeline/multi-agent-refs/test-gen/stages.md +1 -1
  113. package/pipeline/multi-agent-refs/tracker-contract.md +2 -2
  114. package/pipeline/multi-agent-refs/unattended-contract.md +1 -1
  115. package/pipeline/office/assets/app_icon_180.png +0 -0
  116. package/pipeline/office/assets/app_icon_192.png +0 -0
  117. package/pipeline/office/assets/app_icon_512.png +0 -0
  118. package/pipeline/office/index.html +502 -6
  119. package/pipeline/office/toolkit.json +1 -1
  120. package/pipeline/preferences-template.json +2 -1
  121. package/pipeline/rules/figma-pipeline.md +1 -1
  122. package/pipeline/rules/outside-the-pipeline.md +3 -3
  123. package/pipeline/schemas/agent-state.schema.json +1 -1
  124. package/pipeline/schemas/analysis-spec.schema.json +1 -1
  125. package/pipeline/schemas/autopilot-config.schema.json +1 -1
  126. package/pipeline/schemas/autopilot-off-request.schema.json +1 -1
  127. package/pipeline/schemas/autopilot-off.schema.json +8 -2
  128. package/pipeline/schemas/dev-critic-output.schema.json +1 -1
  129. package/pipeline/schemas/launch.json +6 -6
  130. package/pipeline/schemas/learnings-ledger.schema.json +8 -0
  131. package/pipeline/schemas/office-archive.schema.json +168 -0
  132. package/pipeline/schemas/office-server-room.schema.json +283 -0
  133. package/pipeline/schemas/prefs.schema.json +17 -1
  134. package/pipeline/schemas/runs-index.schema.json +1 -1
  135. package/pipeline/schemas/secret-patterns.json +257 -1
  136. package/pipeline/schemas/secret-patterns.schema.json +25 -4
  137. package/pipeline/schemas/toolkit-path-params.json +1077 -0
  138. package/pipeline/schemas/toolkit-path-params.schema.json +36 -0
  139. package/pipeline/schemas/unattended-policy.json +10 -1
  140. package/pipeline/schemas/unattended-policy.schema.json +4 -0
  141. package/pipeline/schemas/unattended-profile.json +93 -4
  142. package/pipeline/schemas/unattended-profile.schema.json +10 -0
  143. package/pipeline/scripts/_active-run.mjs +6 -3
  144. package/pipeline/scripts/_analysis-doc-diagrams.mjs +115 -0
  145. package/pipeline/scripts/_analysis-doc-markers.mjs +252 -0
  146. package/pipeline/scripts/_analysis-doc-redesign.mjs +160 -0
  147. package/pipeline/scripts/_analysis-doc-rules.mjs +191 -0
  148. package/pipeline/scripts/_analysis-doc-shapes.mjs +196 -0
  149. package/pipeline/scripts/_analysis-doc-structure.mjs +313 -0
  150. package/pipeline/scripts/_autopilot-ops.mjs +12 -3
  151. package/pipeline/scripts/_contract-core.mjs +282 -0
  152. package/pipeline/scripts/_contract-office-page.mjs +108 -0
  153. package/pipeline/scripts/_contract-routes-catalog.mjs +84 -0
  154. package/pipeline/scripts/_contract-routes-office.mjs +133 -0
  155. package/pipeline/scripts/_contract-routes-ops.mjs +538 -0
  156. package/pipeline/scripts/_contract-routes-repos.mjs +270 -0
  157. package/pipeline/scripts/_contract-routes-runs.mjs +468 -0
  158. package/pipeline/scripts/_contract-routes-work.mjs +255 -0
  159. package/pipeline/scripts/_lint-suppression.mjs +1067 -0
  160. package/pipeline/scripts/_memory-policy.mjs +40 -26
  161. package/pipeline/scripts/_renamed-skills.mjs +11 -2
  162. package/pipeline/scripts/_retrieval.mjs +2 -6
  163. package/pipeline/scripts/_secret-scan.mjs +8 -2
  164. package/pipeline/scripts/_stack-adapter.mjs +28 -19
  165. package/pipeline/scripts/_test-gaming.mjs +44 -6
  166. package/pipeline/scripts/_unified-diff.mjs +2 -2
  167. package/pipeline/scripts/activity-snapshot.mjs +36 -15
  168. package/pipeline/scripts/analysis-conform-coverage.mjs +3 -0
  169. package/pipeline/scripts/analysis-sources.mjs +3 -0
  170. package/pipeline/scripts/analysis-story-tree.mjs +6 -5
  171. package/pipeline/scripts/analysis-tickets-writeback.mjs +7 -0
  172. package/pipeline/scripts/anonymize-findings.mjs +1 -1
  173. package/pipeline/scripts/answer-check.mjs +3 -0
  174. package/pipeline/scripts/answer-question.mjs +22 -9
  175. package/pipeline/scripts/argv-secret-scan.mjs +3 -0
  176. package/pipeline/scripts/audit-log.sh +22 -2
  177. package/pipeline/scripts/autopilot-arming.mjs +6 -5
  178. package/pipeline/scripts/autopilot-awake.mjs +3 -0
  179. package/pipeline/scripts/autopilot-control.mjs +31 -34
  180. package/pipeline/scripts/autopilot-intake.mjs +3 -0
  181. package/pipeline/scripts/autopilot-publish.mjs +34 -13
  182. package/pipeline/scripts/autopilot-runner.mjs +289 -86
  183. package/pipeline/scripts/autopilot-status.sh +1 -1
  184. package/pipeline/scripts/base-branch-candidates.mjs +7 -0
  185. package/pipeline/scripts/bug-bash.mjs +3 -0
  186. package/pipeline/scripts/build-references.mjs +3 -0
  187. package/pipeline/scripts/build-skills-index.mjs +16 -5
  188. package/pipeline/scripts/build-stack-plugins.mjs +3 -0
  189. package/pipeline/scripts/bulk-read.sh +1 -1
  190. package/pipeline/scripts/capture-evidence.sh +1 -1
  191. package/pipeline/scripts/capture-flush.sh +52 -2
  192. package/pipeline/scripts/check-derived-drift.mjs +5 -2
  193. package/pipeline/scripts/classify-plan-safety.mjs +7 -0
  194. package/pipeline/scripts/commands.mjs +21 -11
  195. package/pipeline/scripts/confirm-command.mjs +3 -0
  196. package/pipeline/scripts/confluence-readback.mjs +3 -0
  197. package/pipeline/scripts/constitution.mjs +6 -13
  198. package/pipeline/scripts/contract-server.mjs +710 -2317
  199. package/pipeline/scripts/cost-analyze.mjs +8 -18
  200. package/pipeline/scripts/cost-budget-check.mjs +4 -15
  201. package/pipeline/scripts/council-view.mjs +3 -0
  202. package/pipeline/scripts/crush-json.mjs +3 -0
  203. package/pipeline/scripts/debt-ledger.mjs +12 -37
  204. package/pipeline/scripts/decisions-log.mjs +14 -8
  205. package/pipeline/scripts/diff-explain.mjs +8 -16
  206. package/pipeline/scripts/diff-risk-score.mjs +5 -15
  207. package/pipeline/scripts/doctor.mjs +47 -11
  208. package/pipeline/scripts/edit-syntax-gate.mjs +5 -10
  209. package/pipeline/scripts/estimate.mjs +5 -10
  210. package/pipeline/scripts/evidence-gate.mjs +5 -21
  211. package/pipeline/scripts/explore-findings.mjs +3 -0
  212. package/pipeline/scripts/feedback-send.mjs +5 -6
  213. package/pipeline/scripts/file-context.mjs +20 -22
  214. package/pipeline/scripts/find-polluter.mjs +29 -17
  215. package/pipeline/scripts/finding-fingerprint.mjs +22 -9
  216. package/pipeline/scripts/gate-ledger.mjs +25 -21
  217. package/pipeline/scripts/gc-abandoned.sh +143 -40
  218. package/pipeline/scripts/gc-plan.mjs +8 -1
  219. package/pipeline/scripts/gc-refs.sh +4 -4
  220. package/pipeline/scripts/gc-tmp.sh +3 -3
  221. package/pipeline/scripts/gc-worktrees.sh +4 -4
  222. package/pipeline/scripts/gen-facts.mjs +3 -0
  223. package/pipeline/scripts/gen-free-hosts.mjs +132 -0
  224. package/pipeline/scripts/gen-mode-dispatch.mjs +11 -3
  225. package/pipeline/scripts/gen-secret-patterns.mjs +263 -0
  226. package/pipeline/scripts/gen-skills-index.mjs +11 -1
  227. package/pipeline/scripts/graph-affected.mjs +3 -0
  228. package/pipeline/scripts/graph-build.mjs +6 -18
  229. package/pipeline/scripts/graph-confirm.mjs +3 -0
  230. package/pipeline/scripts/graph-hint.mjs +13 -19
  231. package/pipeline/scripts/graph-links.mjs +3 -0
  232. package/pipeline/scripts/graph-mermaid.mjs +3 -0
  233. package/pipeline/scripts/graph-query.mjs +3 -0
  234. package/pipeline/scripts/handle-diff-audit.mjs +20 -12
  235. package/pipeline/scripts/health-report.mjs +201 -158
  236. package/pipeline/scripts/host-hooks.mjs +3 -0
  237. package/pipeline/scripts/issues.mjs +26 -11
  238. package/pipeline/scripts/jira-family.mjs +14 -23
  239. package/pipeline/scripts/jira-search.sh +1 -1
  240. package/pipeline/scripts/jira-wiki-escape.mjs +10 -0
  241. package/pipeline/scripts/job-launch.mjs +107 -8
  242. package/pipeline/scripts/launch-request.mjs +6 -2
  243. package/pipeline/scripts/learn-from-transcripts.mjs +14 -25
  244. package/pipeline/scripts/learnings-ledger.mjs +113 -81
  245. package/pipeline/scripts/localize-commands.mjs +7 -0
  246. package/pipeline/scripts/log-metric.sh +26 -8
  247. package/pipeline/scripts/match-skills.mjs +7 -0
  248. package/pipeline/scripts/mcp-config-audit.mjs +130 -0
  249. package/pipeline/scripts/migrate-prefs.mjs +34 -21
  250. package/pipeline/scripts/migrate-state.mjs +3 -0
  251. package/pipeline/scripts/mutation-probe.mjs +51 -32
  252. package/pipeline/scripts/note-agent-event.mjs +7 -14
  253. package/pipeline/scripts/note-skill-use.mjs +273 -0
  254. package/pipeline/scripts/note-skill-use.sh +19 -0
  255. package/pipeline/scripts/observations.mjs +17 -16
  256. package/pipeline/scripts/office-archive.mjs +267 -0
  257. package/pipeline/scripts/office-build.mjs +117 -8
  258. package/pipeline/scripts/office-control.mjs +7 -3
  259. package/pipeline/scripts/office-credentials.mjs +3 -0
  260. package/pipeline/scripts/office-ledger.mjs +3 -0
  261. package/pipeline/scripts/office-memory.mjs +6 -3
  262. package/pipeline/scripts/office-pair.mjs +24 -3
  263. package/pipeline/scripts/office-prune.mjs +3 -0
  264. package/pipeline/scripts/office-push.mjs +613 -0
  265. package/pipeline/scripts/office-remote-client.mjs +30 -3
  266. package/pipeline/scripts/office-server-room.mjs +435 -0
  267. package/pipeline/scripts/office-settings.mjs +4 -4
  268. package/pipeline/scripts/office-webapp.mjs +59 -0
  269. package/pipeline/scripts/offload-ref.sh +1 -1
  270. package/pipeline/scripts/open-questions-gate.mjs +25 -12
  271. package/pipeline/scripts/output-quality-check.sh +1 -1
  272. package/pipeline/scripts/owned-path-gate.mjs +22 -11
  273. package/pipeline/scripts/package-manager.mjs +7 -0
  274. package/pipeline/scripts/parity-score.mjs +3 -0
  275. package/pipeline/scripts/phase-tracker.sh +179 -35
  276. package/pipeline/scripts/phase0-exit-gate.mjs +4 -1
  277. package/pipeline/scripts/phone-devices.mjs +32 -16
  278. package/pipeline/scripts/plan-complexity.mjs +17 -13
  279. package/pipeline/scripts/plan-coverage-gate.mjs +3 -2
  280. package/pipeline/scripts/plan-critique-gate.mjs +22 -12
  281. package/pipeline/scripts/plan-remote-links.mjs +18 -11
  282. package/pipeline/scripts/plugin-refresh.sh +1 -1
  283. package/pipeline/scripts/pr-request.mjs +3 -0
  284. package/pipeline/scripts/pr-timeline.mjs +13 -9
  285. package/pipeline/scripts/pre-commit-check.sh +175 -124
  286. package/pipeline/scripts/pre-push-check.sh +12 -0
  287. package/pipeline/scripts/probe-evidence-capability.sh +1 -1
  288. package/pipeline/scripts/probe-store-key.mjs +33 -15
  289. package/pipeline/scripts/product-context.mjs +25 -26
  290. package/pipeline/scripts/prune-logs.sh +4 -4
  291. package/pipeline/scripts/purge.sh +2 -2
  292. package/pipeline/scripts/record-phase.mjs +19 -9
  293. package/pipeline/scripts/release-notes.mjs +3 -0
  294. package/pipeline/scripts/render-flow-run.mjs +48 -32
  295. package/pipeline/scripts/render-jira-evidence.mjs +18 -11
  296. package/pipeline/scripts/render-work-summary.sh +1 -1
  297. package/pipeline/scripts/repo-map.mjs +35 -20
  298. package/pipeline/scripts/repo-profile.mjs +21 -21
  299. package/pipeline/scripts/repo-recommend.mjs +22 -9
  300. package/pipeline/scripts/research-gate.mjs +20 -12
  301. package/pipeline/scripts/review-decision-gate.mjs +209 -33
  302. package/pipeline/scripts/review-delta.mjs +36 -15
  303. package/pipeline/scripts/review-file-filter.mjs +3 -0
  304. package/pipeline/scripts/review-scope.mjs +3 -0
  305. package/pipeline/scripts/rework-base.mjs +3 -0
  306. package/pipeline/scripts/rework-escalation.mjs +25 -20
  307. package/pipeline/scripts/rework-rulings.mjs +3 -0
  308. package/pipeline/scripts/routine-registry.mjs +27 -20
  309. package/pipeline/scripts/run-aggregator.mjs +15 -16
  310. package/pipeline/scripts/run-commit-check.mjs +3 -0
  311. package/pipeline/scripts/run-kill.mjs +6 -14
  312. package/pipeline/scripts/run-log.mjs +32 -15
  313. package/pipeline/scripts/run-metrics.mjs +7 -0
  314. package/pipeline/scripts/run-results.mjs +3 -0
  315. package/pipeline/scripts/run-scope-guard.mjs +3 -0
  316. package/pipeline/scripts/run-stop-guard.mjs +15 -9
  317. package/pipeline/scripts/run-write.mjs +400 -0
  318. package/pipeline/scripts/runs-index.mjs +22 -15
  319. package/pipeline/scripts/scaffold-gate.mjs +26 -9
  320. package/pipeline/scripts/scan-agent-config.sh +39 -11
  321. package/pipeline/scripts/scan-skills.sh +17 -6
  322. package/pipeline/scripts/scenario-audit.mjs +3 -0
  323. package/pipeline/scripts/scope-check-gate.mjs +21 -11
  324. package/pipeline/scripts/search-logs.sh +1 -1
  325. package/pipeline/scripts/security-evidence-gate.mjs +23 -12
  326. package/pipeline/scripts/service-read.mjs +6 -9
  327. package/pipeline/scripts/skill-candidates.mjs +3 -0
  328. package/pipeline/scripts/skill-conformance.mjs +29 -15
  329. package/pipeline/scripts/skill-siblings.mjs +34 -4
  330. package/pipeline/scripts/skill-usage.mjs +379 -0
  331. package/pipeline/scripts/smoke-schema-validation.sh +1 -1
  332. package/pipeline/scripts/spec-consistency-gate.mjs +22 -12
  333. package/pipeline/scripts/stack-toggle.mjs +3 -0
  334. package/pipeline/scripts/status-overview.mjs +2 -2
  335. package/pipeline/scripts/steer-run.mjs +3 -0
  336. package/pipeline/scripts/symbol-existence-gate.mjs +22 -14
  337. package/pipeline/scripts/sync-skill-copies.mjs +141 -0
  338. package/pipeline/scripts/system-status.mjs +3 -0
  339. package/pipeline/scripts/task-mirror.mjs +59 -22
  340. package/pipeline/scripts/test-classify.mjs +15 -10
  341. package/pipeline/scripts/test-gap-scan.mjs +5 -15
  342. package/pipeline/scripts/test-gen-gate.mjs +19 -10
  343. package/pipeline/scripts/test-gen-state.mjs +16 -15
  344. package/pipeline/scripts/test-integrity-gate.mjs +113 -16
  345. package/pipeline/scripts/test-stability-gate.mjs +3 -0
  346. package/pipeline/scripts/test-strength.mjs +39 -18
  347. package/pipeline/scripts/test-summary.mjs +24 -16
  348. package/pipeline/scripts/token-budget-report.mjs +18 -8
  349. package/pipeline/scripts/toolkit-tools.mjs +19 -4
  350. package/pipeline/scripts/transcript-index.mjs +38 -18
  351. package/pipeline/scripts/triage-memory.mjs +20 -59
  352. package/pipeline/scripts/unattended_policy.py +1828 -27
  353. package/pipeline/scripts/uninstall.mjs +120 -13
  354. package/pipeline/scripts/update-check.sh +1 -1
  355. package/pipeline/scripts/update-issue-progress.sh +6 -6
  356. package/pipeline/scripts/usage-identity.mjs +18 -7
  357. package/pipeline/scripts/usage-register-beacon.mjs +3 -0
  358. package/pipeline/scripts/usage-register.mjs +21 -12
  359. package/pipeline/scripts/usage-report.mjs +27 -11
  360. package/pipeline/scripts/user-test-handoff.sh +1 -1
  361. package/pipeline/scripts/validate-analysis-doc.mjs +163 -1240
  362. package/pipeline/scripts/validate-analysis.mjs +7 -0
  363. package/pipeline/scripts/validate-code-graph.mjs +7 -0
  364. package/pipeline/scripts/validate-complaint-doc.mjs +3 -0
  365. package/pipeline/scripts/validate-diff-risk.mjs +7 -0
  366. package/pipeline/scripts/validate-planning.mjs +3 -0
  367. package/pipeline/scripts/validate-reviewer.mjs +7 -0
  368. package/pipeline/scripts/validate-state.mjs +7 -0
  369. package/pipeline/scripts/validate-test-gap.mjs +7 -0
  370. package/pipeline/scripts/validate-triage.mjs +7 -0
  371. package/pipeline/scripts/valven-gate.mjs +14 -14
  372. package/pipeline/scripts/valven-port.mjs +14 -13
  373. package/pipeline/scripts/valven-split.mjs +14 -13
  374. package/pipeline/scripts/verify-citations.mjs +13 -14
  375. package/pipeline/scripts/verify.mjs +3 -0
  376. package/pipeline/scripts/work-items.mjs +5 -5
  377. package/pipeline/scripts/worktree-finalize.sh +3 -3
  378. package/pipeline/scripts/worktree-prepare-all.mjs +3 -0
  379. package/pipeline/scripts/worktrees.mjs +3 -0
  380. package/pipeline/scripts/write-state.mjs +33 -23
  381. package/pipeline/scripts/write-store-config.mjs +5 -1
  382. package/pipeline/skills/.skill-manifest.json +40 -40
  383. package/pipeline/skills/.skills-index.json +32 -32
  384. package/pipeline/skills/shared/README.md +31 -31
  385. package/pipeline/skills/shared/core/google-play-compliance/references/examples.md +1 -1
  386. package/pipeline/skills/shared/core/multi-agent-autopilot-off/SKILL.md +15 -13
  387. package/pipeline/skills/shared/core/multi-agent-health/SKILL.md +6 -2
  388. package/pipeline/skills/shared/external/agent-introspection-debugging/SKILL.md +1 -6
  389. package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
  390. package/pipeline/skills/shared/external/app-clips/SKILL.md +1 -1
  391. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +1 -1
  392. package/pipeline/skills/shared/external/app-store-release-notes/SKILL.md +1 -1
  393. package/pipeline/skills/shared/external/app-store-release-notes/evals/trigger-eval.json +11 -0
  394. package/pipeline/skills/shared/external/app-store-review/SKILL.md +1 -1
  395. package/pipeline/skills/shared/external/apple-on-device-ai/SKILL.md +1 -1
  396. package/pipeline/skills/shared/external/avkit/SKILL.md +1 -1
  397. package/pipeline/skills/shared/external/context-compression/SKILL.md +1 -1
  398. package/pipeline/skills/shared/external/core-bluetooth/SKILL.md +1 -1
  399. package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
  400. package/pipeline/skills/shared/external/council/SKILL.md +1 -6
  401. package/pipeline/skills/shared/external/e2e-testing/SKILL.md +1 -9
  402. package/pipeline/skills/shared/external/fix-review-verdicts/SKILL.md +3 -0
  403. package/pipeline/skills/shared/external/humanizer/SKILL.md +1 -5
  404. package/pipeline/skills/shared/external/ios-coding-standard/references/lint-local.sh +1 -1
  405. package/pipeline/skills/shared/external/ios-localization/SKILL.md +1 -1
  406. package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
  407. package/pipeline/skills/shared/external/ios-simulator/SKILL.md +1 -1
  408. package/pipeline/skills/shared/external/kotlin-coroutines-expert/references/patterns.md +1 -1
  409. package/pipeline/skills/shared/external/live-activities/SKILL.md +1 -1
  410. package/pipeline/skills/shared/external/macos-app-distribution/SKILL.md +1 -1
  411. package/pipeline/skills/shared/external/macos-app-distribution/evals/trigger-eval.json +10 -0
  412. package/pipeline/skills/shared/external/macos-menubar-utility/SKILL.md +1 -1
  413. package/pipeline/skills/shared/external/macos-menubar-utility/evals/trigger-eval.json +10 -0
  414. package/pipeline/skills/shared/external/mapkit-location/SKILL.md +1 -1
  415. package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +1 -1
  416. package/pipeline/skills/shared/external/push-notifications/SKILL.md +1 -1
  417. package/pipeline/skills/shared/external/search-first/SKILL.md +1 -6
  418. package/pipeline/skills/shared/external/skill-creator/SKILL.md +1 -1
  419. package/pipeline/skills/shared/external/storekit/SKILL.md +1 -1
  420. package/pipeline/skills/shared/external/swift-concurrency-fix/SKILL.md +1 -1
  421. package/pipeline/skills/shared/external/swift-concurrency-fix/evals/trigger-eval.json +11 -0
  422. package/pipeline/skills/shared/external/swift-formatstyle/SKILL.md +1 -1
  423. package/pipeline/skills/shared/external/swift-testing/SKILL.md +1 -1
  424. package/pipeline/skills/shared/external/swift-testing-review/SKILL.md +1 -1
  425. package/pipeline/skills/shared/external/swift-testing-review/evals/trigger-eval.json +11 -0
  426. package/pipeline/skills/shared/external/swiftdata/SKILL.md +1 -1
  427. package/pipeline/skills/shared/external/swiftdata-review/SKILL.md +1 -1
  428. package/pipeline/skills/shared/external/swiftdata-review/evals/trigger-eval.json +11 -0
  429. package/pipeline/skills/shared/external/swiftui-glass-effects/SKILL.md +1 -1
  430. package/pipeline/skills/shared/external/tailwind-styling/SKILL.md +1 -1
  431. package/pipeline/skills/shared/external/tailwind-styling/evals/trigger-eval.json +11 -0
  432. package/pipeline/skills/shared/external/vision-framework/SKILL.md +1 -1
  433. package/pipeline/skills/shared/external/widgetkit/SKILL.md +1 -1
  434. package/pipeline/skills/skill-copies.json +43 -0
  435. package/pipeline/skills/skills-index.md +31 -31
  436. package/pipeline/office/NOTICE.md +0 -18
@@ -10,7 +10,8 @@
10
10
  * stores under ~/.claude/memory/multi-agent/<repo-slug>/:
11
11
  *
12
12
  * learnings-ledger.jsonl durable facts and conventions whose scope covers the file,
13
- * minus those the feedback suppressed (_memory-policy.mjs)
13
+ * minus those the feedback suppressed or a later entry
14
+ * superseded (_memory-policy.mjs)
14
15
  * triage-corpus.jsonl the latest review findings recorded against it
15
16
  * debt.jsonl open known limits in it (debt-ledger.mjs)
16
17
  *
@@ -42,24 +43,22 @@
42
43
  */
43
44
 
44
45
  import { spawnSync } from "node:child_process";
45
- import {
46
- existsSync,
47
- lstatSync,
48
- mkdirSync,
49
- readFileSync,
50
- realpathSync,
51
- statSync,
52
- writeFileSync,
53
- } from "node:fs";
46
+ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, statSync } from "node:fs";
54
47
  import { homedir, tmpdir } from "node:os";
55
48
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
56
49
 
57
50
  import { fitToBudget, HOOK_OUTPUT_LIMIT } from "../lib/context-budget.mjs";
58
51
  import { wrapUntrusted } from "../lib/untrusted.mjs";
52
+ import { readRegularJson } from "../lib/regular-file.mjs";
53
+ import { writeFileSafe } from "../lib/safe-write.mjs";
59
54
  import { findActiveRun } from "./_active-run.mjs";
60
- import { ledgerRowId, standing } from "./_memory-policy.mjs";
55
+ import { ledgerRowId, standing, supersededBy } from "./_memory-policy.mjs";
61
56
  import { openScanner } from "./_secret-scan.mjs";
62
57
  import { invokedDirectly } from "../lib/invoked-directly.mjs";
58
+ import { prefsPath } from "../lib/prefs-value.mjs";
59
+ import { exitOnHelp } from "../lib/cli-help.mjs";
60
+
61
+ exitOnHelp(import.meta.url);
63
62
 
64
63
  const MAX_INPUT = 256 * 1024;
65
64
  const MAX_LINE_CHARS = 220;
@@ -69,9 +68,6 @@ const STORE_MAX_BYTES = 4 * 1024 * 1024;
69
68
  /** Drop order under the budget: the lowest number goes first. */
70
69
  const PRIORITY = { review: 1, ledger: 2, limit: 3, security: 3 };
71
70
 
72
- const prefsPath = (env) =>
73
- env.MULTI_AGENT_PREFS || join(env.HOME || homedir(), ".claude", "multi-agent-preferences.json");
74
-
75
71
  /** off | on | run-only, from prefs.global.fileContext.enabled. */
76
72
  export function mode(env = process.env) {
77
73
  try {
@@ -173,7 +169,10 @@ export function entriesFor(storeDir, rel, { overlap = false } = {}) {
173
169
  if (!feedback.has(f.id)) feedback.set(f.id, []);
174
170
  feedback.get(f.id).push(f);
175
171
  }
176
- for (const r of rows(join(storeDir, "learnings-ledger.jsonl"))) {
172
+ const ledger = rows(join(storeDir, "learnings-ledger.jsonl"));
173
+ const retired = supersededBy(ledger);
174
+ for (const [i, r] of ledger.entries()) {
175
+ if (retired[i] !== null) continue;
177
176
  if (!(overlap ? scopeOverlaps(r.scope, rel) : scopeCovers(r.scope, rel))) continue;
178
177
  if (standing(feedback.get(ledgerRowId(r)) ?? []).suppressed) continue;
179
178
  const priority = r.kind === "security-note" ? PRIORITY.security : PRIORITY.ledger;
@@ -364,12 +363,11 @@ function sessionCache(sessionId) {
364
363
  const dir = join(tmpdir(), `multi-agent-file-context-${uid}`);
365
364
  const f = join(dir, `${String(sessionId).replace(/[^A-Za-z0-9_-]/g, "")}.json`);
366
365
  if (!ownDir(dir)) return NO_CACHE;
367
- let seen = [];
368
- try {
369
- seen = JSON.parse(readFileSync(f, "utf8"));
370
- } catch {
371
- /* first file this session */
372
- }
366
+ // The cache lives in the temp directory, which a sandboxed run can write;
367
+ // this hook runs outside the sandbox, so it reads only a regular file there
368
+ // and writes through safe-write, never through a link.
369
+ const read = readRegularJson(f, [], { maxBytes: 1 << 20, within: [dir] });
370
+ const seen = Array.isArray(read) ? read : [];
373
371
  const set = new Set(seen);
374
372
  const added = [];
375
373
  return {
@@ -381,7 +379,7 @@ function sessionCache(sessionId) {
381
379
  save() {
382
380
  if (!added.length) return;
383
381
  try {
384
- writeFileSync(f, JSON.stringify([...seen, ...added].slice(-500)), { mode: 0o600 });
382
+ writeFileSafe(f, JSON.stringify([...seen, ...added].slice(-500)), { mode: 0o600 });
385
383
  } catch {
386
384
  /* a lost cache only means saying it twice */
387
385
  }
@@ -47,6 +47,10 @@ import { existsSync, lstatSync, readFileSync, realpathSync, rmSync } from "node:
47
47
  import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
48
48
 
49
49
  import { invokedDirectly } from "../lib/invoked-directly.mjs";
50
+ import { exitOnHelp } from "../lib/cli-help.mjs";
51
+ import { ArgsError, parseArgs as parseArgv } from "../lib/args.mjs";
52
+
53
+ exitOnHelp(import.meta.url);
50
54
 
51
55
  const DEFAULT_TIMEOUT_SEC = 300;
52
56
 
@@ -96,23 +100,31 @@ export function bisect(items, pollutes) {
96
100
 
97
101
  function parseArgs(argv) {
98
102
  const opts = { tests: [], timeoutSec: DEFAULT_TIMEOUT_SEC };
99
- for (let i = 0; i < argv.length; i++) {
100
- const a = argv[i];
101
- const val = () => {
102
- const v = argv[++i];
103
- if (v === undefined) throw new UsageError(`${a} needs a value`);
104
- return v;
105
- };
106
- if (a === "--run") opts.run = val();
107
- else if (a === "--list") opts.list = val();
108
- else if (a === "--test") opts.tests.push(val());
109
- else if (a === "--absent") opts.absent = val();
110
- else if (a === "--target") opts.target = val();
111
- else if (a === "--reset") opts.reset = val();
112
- else if (a === "--cwd") opts.cwd = val();
113
- else if (a === "--timeout-sec") opts.timeoutSec = Number(val());
114
- else if (a === "--json") opts.json = true;
115
- else throw new UsageError(`unexpected argument ${a}`);
103
+ try {
104
+ parseArgv(argv, {
105
+ strings: ["run", "list", "test", "absent", "target", "reset", "cwd", "timeout-sec"],
106
+ booleans: ["json"],
107
+ multiple: ["test"],
108
+ unknown: "error",
109
+ positionals: false,
110
+ equals: false,
111
+ terminator: false,
112
+ valuePrefix: null,
113
+ onArg: ({ flag, value }) => {
114
+ if (flag === "test") opts.tests.push(value);
115
+ else if (flag === "timeout-sec") opts.timeoutSec = Number(value);
116
+ else if (flag === "json") opts.json = true;
117
+ else opts[flag] = value;
118
+ },
119
+ });
120
+ } catch (err) {
121
+ if (!(err instanceof ArgsError)) throw err;
122
+ throw new UsageError(
123
+ err.kind === "missing-value"
124
+ ? `${err.token} needs a value`
125
+ : `unexpected argument ${err.token}`,
126
+ { cause: err },
127
+ );
116
128
  }
117
129
  if (!opts.run) throw new UsageError("--run is required");
118
130
  if (Boolean(opts.absent) === Boolean(opts.target)) {
@@ -16,6 +16,10 @@
16
16
  import { readFileSync, writeFileSync } from "node:fs";
17
17
 
18
18
  import { annotate, findingFingerprint, KINDS } from "./_fingerprint.mjs";
19
+ import { exitOnHelp } from "../lib/cli-help.mjs";
20
+ import { ArgsError, parseArgs as parseArgv } from "../lib/args.mjs";
21
+
22
+ exitOnHelp(import.meta.url);
19
23
 
20
24
  const USAGE = `usage:
21
25
  finding-fingerprint.mjs annotate <path|-> [--kind ${KINDS.join("|")}|auto] [--in-place]
@@ -23,15 +27,24 @@ const USAGE = `usage:
23
27
 
24
28
  function parseArgs(argv) {
25
29
  const opts = { _: [] };
26
- for (let i = 0; i < argv.length; i++) {
27
- const a = argv[i];
28
- if (a === "--in-place") opts.inPlace = true;
29
- else if (a === "--kind") opts.kind = argv[++i];
30
- else if (a === "--file") opts.file = argv[++i];
31
- else if (a === "--issue") opts.issue = argv[++i];
32
- else if (a === "--rule-id") opts.ruleId = argv[++i];
33
- else if (a.startsWith("--")) return null;
34
- else opts._.push(a);
30
+ const named = { kind: "kind", file: "file", issue: "issue", "rule-id": "ruleId" };
31
+ try {
32
+ parseArgv(argv, {
33
+ booleans: ["in-place"],
34
+ values: Object.keys(named),
35
+ unknown: "error",
36
+ equals: false,
37
+ terminator: false,
38
+ valuePrefix: null,
39
+ onArg: ({ flag, value }) => {
40
+ if (flag === null) opts._.push(value);
41
+ else if (flag === "in-place") opts.inPlace = true;
42
+ else opts[named[flag]] = value === true ? undefined : value;
43
+ },
44
+ });
45
+ } catch (err) {
46
+ if (err instanceof ArgsError) return null;
47
+ throw err;
35
48
  }
36
49
  return opts;
37
50
  }
@@ -10,7 +10,7 @@
10
10
  * `sha` is the repository HEAD the gate ran against. The pipeline commits only
11
11
  * in Phase 4, so every gate of a run records the same HEAD, and the commit hook
12
12
  * (pre-commit-check.sh) asks this file whether the latest entry of each
13
- * mandatory gate for that HEAD passed. A gate the run skipped leaves no entry,
13
+ * required gate for that HEAD passed. A gate the run skipped leaves no entry,
14
14
  * and a missing entry blocks the commit the same way a failing one does.
15
15
  *
16
16
  * Entries are written while the quality gates are active (lib/unattended.mjs,
@@ -59,22 +59,26 @@ import {
59
59
  mkdtempSync,
60
60
  readFileSync,
61
61
  realpathSync,
62
- renameSync,
63
62
  rmSync,
64
63
  statSync,
65
64
  writeFileSync,
66
65
  } from "node:fs";
67
66
  import { tmpdir } from "node:os";
68
- import { basename, dirname, join } from "node:path";
67
+ import { dirname, join } from "node:path";
69
68
 
70
69
  import { decisionEntry, withDecision } from "../lib/decisions.mjs";
71
70
  import { invokedDirectly } from "../lib/invoked-directly.mjs";
72
71
  import { readRegularFile, readRegularJson } from "../lib/regular-file.mjs";
72
+ import { writeFileSafe } from "../lib/safe-write.mjs";
73
73
  import { globalPref } from "../lib/prefs-value.mjs";
74
74
  import { modeEntry } from "../lib/run-completion.mjs";
75
75
  import { attendedVerdict, gatesActive } from "../lib/unattended.mjs";
76
76
  import { listRuns, resolveRunFile } from "./_run-paths.mjs";
77
77
  import { acquireLock, releaseLock, stillOurs } from "./write-state.mjs";
78
+ import { ArgsError, parseArgs } from "../lib/args.mjs";
79
+ import { exitOnHelp } from "../lib/cli-help.mjs";
80
+
81
+ exitOnHelp(import.meta.url);
78
82
 
79
83
  export const VERDICTS = ["pass", "fail", "not-applicable"];
80
84
  export const PASSING = new Set(["pass", "not-applicable"]);
@@ -416,7 +420,10 @@ export function gateContext({ statePath = null, repo = null, env = process.env }
416
420
  * Read-modify-write one state document under the write-state lock.
417
421
  *
418
422
  * A `mutate` that returns the document it was given has changed nothing, so
419
- * nothing is written and `rev` stays where it was.
423
+ * nothing is written and `rev` stays where it was. A run can write its own
424
+ * state directory, so the state is read only when it resolves inside that
425
+ * directory and written through lib/safe-write.mjs, which never follows a link
426
+ * planted at the state or a temp name.
420
427
  *
421
428
  * @param {string} path
422
429
  * @param {(state: object) => object} mutate returns the next document
@@ -427,7 +434,7 @@ export async function updateState(path, mutate) {
427
434
  try {
428
435
  let current;
429
436
  try {
430
- current = JSON.parse(readRegularFile(path));
437
+ current = JSON.parse(readRegularFile(path, { within: [dirname(path)] }));
431
438
  } catch (err) {
432
439
  throw new LedgerError("io", `state unreadable: ${err.message}`);
433
440
  }
@@ -440,9 +447,7 @@ export async function updateState(path, mutate) {
440
447
  if (!stillOurs(path, ino)) {
441
448
  throw new LedgerError("io", `the lock on ${path} was taken mid-write; nothing written`);
442
449
  }
443
- const tmp = `${dirname(path)}/.${basename(path)}.${process.pid}.gates.tmp`;
444
- writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`);
445
- renameSync(tmp, path);
450
+ writeFileSafe(path, `${JSON.stringify(next, null, 2)}\n`);
446
451
  return next;
447
452
  } finally {
448
453
  releaseLock(path, ino);
@@ -647,19 +652,18 @@ export function checkCommit(state, sha, { mandatory = MANDATORY_AT_COMMIT } = {}
647
652
  // CLI
648
653
 
649
654
  function parse(argv) {
650
- const opts = {};
651
- for (let i = 1; i < argv.length; i++) {
652
- const a = argv[i];
653
- if (a === "--json") {
654
- opts.json = true;
655
- continue;
656
- }
657
- if (!a.startsWith("--")) throw new LedgerError("usage", `unexpected argument ${a}`);
658
- const v = argv[++i];
659
- if (v === undefined) throw new LedgerError("usage", `${a} needs a value`);
660
- opts[a.slice(2)] = v;
655
+ try {
656
+ return parseArgs(argv.slice(1), {
657
+ booleans: ["json"],
658
+ unknown: "value",
659
+ valuePrefix: null,
660
+ positionals: false,
661
+ equals: false,
662
+ terminator: false,
663
+ }).flags;
664
+ } catch (e) {
665
+ throw e instanceof ArgsError ? new LedgerError("usage", e.message) : e;
661
666
  }
662
- return opts;
663
667
  }
664
668
 
665
669
  async function main(argv) {
@@ -730,7 +734,7 @@ async function main(argv) {
730
734
  if (!opts.json)
731
735
  writeFileSync(
732
736
  1,
733
- `gate-ledger: ${MANDATORY_AT_COMMIT.length} mandatory gate(s) pass for ${sha.slice(0, 12)}\n`,
737
+ `gate-ledger: ${MANDATORY_AT_COMMIT.length} required gate(s) pass for ${sha.slice(0, 12)}\n`,
734
738
  );
735
739
  return 0;
736
740
  }