@mmerterden/multi-agent-pipeline 23.3.0 → 23.5.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 (239) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +27 -8
  3. package/README.tr.md +28 -9
  4. package/SECURITY.md +16 -0
  5. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -1
  6. package/docs/adr/0010-own-code-graph.md +299 -8
  7. package/docs/architecture.md +3 -3
  8. package/docs/ecosystem.md +10 -10
  9. package/docs/engineering.md +4 -4
  10. package/docs/facts.json +8 -8
  11. package/docs/features.md +5 -5
  12. package/docs/performance.md +17 -17
  13. package/install/_dev-only-files.mjs +9 -0
  14. package/install/_platform-filter.mjs +2 -55
  15. package/install/claude.mjs +28 -2
  16. package/install/codex.mjs +1 -3
  17. package/install/copilot.mjs +4 -8
  18. package/install/templates/claude-hooks.json +32 -1
  19. package/manifest.json +236 -167
  20. package/package.json +11 -3
  21. package/pipeline/commands/multi-agent/SKILL.md +1 -1
  22. package/pipeline/commands/multi-agent/design-check/SKILL.md +3 -2
  23. package/pipeline/commands/multi-agent/diff-explain/SKILL.md +3 -3
  24. package/pipeline/commands/multi-agent/graph/SKILL.md +57 -24
  25. package/pipeline/commands/multi-agent/pair/SKILL.md +92 -0
  26. package/pipeline/commands/multi-agent/prune-prompts/SKILL.md +1 -1
  27. package/pipeline/commands/multi-agent/search/SKILL.md +7 -1
  28. package/pipeline/commands/multi-agent/status/SKILL.md +4 -0
  29. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  30. package/pipeline/contract/CHANGELOG.md +63 -0
  31. package/pipeline/contract/README.md +1 -0
  32. package/pipeline/contract/build.mjs +13 -1
  33. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  34. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  35. package/pipeline/contract/fixtures/runs-awaiting-question.json +4 -1
  36. package/pipeline/contract/fixtures/runs-empty.json +1 -1
  37. package/pipeline/contract/fixtures/runs-failed.json +4 -1
  38. package/pipeline/contract/fixtures/runs-old-schema.json +3 -0
  39. package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +4 -1
  40. package/pipeline/contract/fixtures/runs-pr-opened.json +4 -1
  41. package/pipeline/contract/fixtures/runs-running.json +4 -1
  42. package/pipeline/contract/manifest.json +41 -15
  43. package/pipeline/contract/types/index.d.ts +81 -3
  44. package/pipeline/lib/detach-self.mjs +95 -0
  45. package/pipeline/lib/public-mcp-servers.mjs +33 -0
  46. package/pipeline/lib/rotated-log.mjs +93 -0
  47. package/pipeline/lib/stack-detect.sh +1 -1
  48. package/pipeline/lib/tls-trust.mjs +29 -0
  49. package/pipeline/lib/usage-lifecycle.mjs +9 -11
  50. package/pipeline/lib/usage-names.generated.mjs +613 -0
  51. package/pipeline/lib/usage-run-key.mjs +235 -0
  52. package/pipeline/lib/usage-vocab.mjs +210 -0
  53. package/pipeline/multi-agent-refs/analysis/intake.md +2 -2
  54. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  55. package/pipeline/multi-agent-refs/channels/generator.md +4 -5
  56. package/pipeline/multi-agent-refs/cross-cli-contract.md +3 -3
  57. package/pipeline/multi-agent-refs/design-check/init-inventory.md +11 -1
  58. package/pipeline/multi-agent-refs/design-check/scope-and-ledger.md +1 -1
  59. package/pipeline/multi-agent-refs/features/code-graph.md +146 -11
  60. package/pipeline/multi-agent-refs/features/code-intelligence.md +16 -14
  61. package/pipeline/multi-agent-refs/features/dev-critic.md +7 -7
  62. package/pipeline/multi-agent-refs/features/model-fallback.md +6 -4
  63. package/pipeline/multi-agent-refs/features/remote-control.md +253 -0
  64. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  65. package/pipeline/multi-agent-refs/features/review-file-set.md +3 -3
  66. package/pipeline/multi-agent-refs/features/review-multi-repo.md +1 -1
  67. package/pipeline/multi-agent-refs/features/session-brief.md +42 -0
  68. package/pipeline/multi-agent-refs/features/skill-conformance.md +3 -3
  69. package/pipeline/multi-agent-refs/features/usage-reporting.md +255 -27
  70. package/pipeline/multi-agent-refs/help/en.md +3 -2
  71. package/pipeline/multi-agent-refs/help/tr.md +3 -2
  72. package/pipeline/multi-agent-refs/knowledge.md +1 -1
  73. package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -2
  74. package/pipeline/multi-agent-refs/phases/operations.md +2 -2
  75. package/pipeline/multi-agent-refs/phases/phase-0-init.md +13 -12
  76. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  77. package/pipeline/multi-agent-refs/phases/phase-3-review.md +2 -0
  78. package/pipeline/multi-agent-refs/phases/phase-5-report.md +1 -1
  79. package/pipeline/multi-agent-refs/platform-parity.md +2 -2
  80. package/pipeline/multi-agent-refs/wiki-capture.md +3 -17
  81. package/pipeline/office/index.html +1309 -236
  82. package/pipeline/office/toolkit.json +1 -1
  83. package/pipeline/rules/outside-the-pipeline.md +1 -1
  84. package/pipeline/schemas/activity.schema.json +23 -0
  85. package/pipeline/schemas/agent-state.schema.json +6 -1
  86. package/pipeline/schemas/code-graph-calls.schema.json +254 -0
  87. package/pipeline/schemas/code-graph-docs.schema.json +223 -0
  88. package/pipeline/schemas/code-graph-infra.schema.json +227 -0
  89. package/pipeline/schemas/code-graph.schema.json +2 -2
  90. package/pipeline/schemas/examples/design-check-config.json +27 -0
  91. package/pipeline/schemas/learning-curve.schema.json +67 -0
  92. package/pipeline/schemas/mcp-health.schema.json +96 -0
  93. package/pipeline/schemas/office-jobs.json +69 -2
  94. package/pipeline/schemas/office-jobs.schema.json +8 -1
  95. package/pipeline/schemas/phases.json +5 -0
  96. package/pipeline/schemas/phases.schema.json +8 -0
  97. package/pipeline/schemas/prefs.schema.json +46 -12
  98. package/pipeline/schemas/runs-index.schema.json +17 -0
  99. package/pipeline/schemas/toolkit-path-params.json +78 -8
  100. package/pipeline/scripts/README.md +1 -0
  101. package/pipeline/scripts/_code-graph.mjs +184 -103
  102. package/pipeline/scripts/_contract-core.mjs +1 -1
  103. package/pipeline/scripts/_contract-routes-office.mjs +33 -0
  104. package/pipeline/scripts/_diff-impact.mjs +21 -2
  105. package/pipeline/scripts/_graph-sidecars.mjs +372 -0
  106. package/pipeline/scripts/_http-post.mjs +103 -115
  107. package/pipeline/scripts/_safe-read.mjs +57 -0
  108. package/pipeline/scripts/_skill-practices.mjs +26 -0
  109. package/pipeline/scripts/_strip-code.mjs +380 -0
  110. package/pipeline/scripts/activity-snapshot.mjs +13 -1
  111. package/pipeline/scripts/aggregate-metrics.mjs +3 -5
  112. package/pipeline/scripts/build-stack-plugins.mjs +1 -47
  113. package/pipeline/scripts/call-graph/index.mjs +78 -0
  114. package/pipeline/scripts/call-graph/lang/cpp.mjs +308 -0
  115. package/pipeline/scripts/call-graph/lang/csharp.mjs +130 -0
  116. package/pipeline/scripts/call-graph/lang/go.mjs +303 -0
  117. package/pipeline/scripts/call-graph/lang/java.mjs +370 -0
  118. package/pipeline/scripts/call-graph/lang/kotlin.mjs +397 -0
  119. package/pipeline/scripts/call-graph/lang/python.mjs +399 -0
  120. package/pipeline/scripts/call-graph/lang/rust.mjs +345 -0
  121. package/pipeline/scripts/call-graph/lang/shared.mjs +230 -0
  122. package/pipeline/scripts/call-graph/lang/swift.mjs +432 -0
  123. package/pipeline/scripts/call-graph/lang/typescript.mjs +692 -0
  124. package/pipeline/scripts/call-graph/lex.mjs +396 -0
  125. package/pipeline/scripts/call-graph/platform.mjs +86 -0
  126. package/pipeline/scripts/call-graph/profiles.mjs +89 -0
  127. package/pipeline/scripts/call-graph/resolve.mjs +1125 -0
  128. package/pipeline/scripts/call-graph/scan.mjs +267 -0
  129. package/pipeline/scripts/code-graph-rules/android.json +7 -2
  130. package/pipeline/scripts/code-graph-rules/cpp.json +99 -0
  131. package/pipeline/scripts/code-graph-rules/csharp.json +102 -0
  132. package/pipeline/scripts/code-graph-rules/go.json +2 -1
  133. package/pipeline/scripts/code-graph-rules/ios.json +3 -1
  134. package/pipeline/scripts/code-graph-rules/java.json +76 -0
  135. package/pipeline/scripts/code-graph-rules/node.json +7 -2
  136. package/pipeline/scripts/code-graph-rules/python.json +6 -2
  137. package/pipeline/scripts/code-graph-rules/rust.json +105 -0
  138. package/pipeline/scripts/contract-server.mjs +3 -0
  139. package/pipeline/scripts/design-check-config.mjs +205 -0
  140. package/pipeline/scripts/feedback-send.mjs +26 -26
  141. package/pipeline/scripts/gate-ledger.mjs +2 -1
  142. package/pipeline/scripts/gen-facts.mjs +1 -2
  143. package/pipeline/scripts/gen-usage-names.mjs +124 -0
  144. package/pipeline/scripts/graph-affected.mjs +109 -20
  145. package/pipeline/scripts/graph-build.mjs +95 -15
  146. package/pipeline/scripts/graph-export.mjs +272 -0
  147. package/pipeline/scripts/graph-hint.mjs +15 -2
  148. package/pipeline/scripts/graph-query.mjs +305 -26
  149. package/pipeline/scripts/graph-report.mjs +187 -1
  150. package/pipeline/scripts/health-report.mjs +3 -4
  151. package/pipeline/scripts/infra/docs.mjs +317 -0
  152. package/pipeline/scripts/infra/extract.mjs +998 -0
  153. package/pipeline/scripts/infra/graph.mjs +245 -0
  154. package/pipeline/scripts/infra/yaml-lite.mjs +311 -0
  155. package/pipeline/scripts/job-launch.mjs +67 -2
  156. package/pipeline/scripts/learning-curve.mjs +288 -178
  157. package/pipeline/scripts/log-metric.sh +10 -1
  158. package/pipeline/scripts/mcp-health.mjs +309 -0
  159. package/pipeline/scripts/note-agent-event.mjs +3 -4
  160. package/pipeline/scripts/note-command-use.mjs +333 -0
  161. package/pipeline/scripts/note-command-use.sh +126 -0
  162. package/pipeline/scripts/note-mcp-call.sh +89 -0
  163. package/pipeline/scripts/note-mcp-failure.mjs +272 -1
  164. package/pipeline/scripts/note-session.sh +62 -3
  165. package/pipeline/scripts/note-skill-use.mjs +58 -2
  166. package/pipeline/scripts/office-build.mjs +115 -1
  167. package/pipeline/scripts/office-memory.mjs +14 -5
  168. package/pipeline/scripts/pair.mjs +333 -0
  169. package/pipeline/scripts/pre-push-check.sh +1 -1
  170. package/pipeline/scripts/remote/cbor.mjs +128 -0
  171. package/pipeline/scripts/remote/contract.mjs +98 -0
  172. package/pipeline/scripts/remote/handler.mjs +330 -0
  173. package/pipeline/scripts/remote/handles.mjs +57 -0
  174. package/pipeline/scripts/remote/lifecycle.mjs +186 -0
  175. package/pipeline/scripts/remote/listener.mjs +204 -0
  176. package/pipeline/scripts/remote/lockout.mjs +103 -0
  177. package/pipeline/scripts/remote/nonces.mjs +61 -0
  178. package/pipeline/scripts/remote/pairing.mjs +519 -0
  179. package/pipeline/scripts/remote/qr-encode.mjs +459 -0
  180. package/pipeline/scripts/remote/store.mjs +191 -0
  181. package/pipeline/scripts/remote/transport.mjs +211 -0
  182. package/pipeline/scripts/remote/verbs.json +70 -0
  183. package/pipeline/scripts/remote/verbs.mjs +217 -0
  184. package/pipeline/scripts/remote/webauthn.mjs +169 -0
  185. package/pipeline/scripts/remote/wire.mjs +364 -0
  186. package/pipeline/scripts/remote-listener.mjs +83 -0
  187. package/pipeline/scripts/route-learn.mjs +4 -4
  188. package/pipeline/scripts/run-kill.mjs +1 -1
  189. package/pipeline/scripts/run-write.mjs +13 -2
  190. package/pipeline/scripts/runs-index.mjs +30 -3
  191. package/pipeline/scripts/search-logs.sh +9 -0
  192. package/pipeline/scripts/session-brief.mjs +458 -0
  193. package/pipeline/scripts/session-brief.sh +130 -0
  194. package/pipeline/scripts/skill-usage.mjs +16 -5
  195. package/pipeline/scripts/test-gap-rules/cpp.json +25 -0
  196. package/pipeline/scripts/test-gap-rules/csharp.json +20 -0
  197. package/pipeline/scripts/test-gap-rules/java.json +20 -0
  198. package/pipeline/scripts/test-gap-rules/rust.json +14 -0
  199. package/pipeline/scripts/token-budget-report.mjs +3 -2
  200. package/pipeline/scripts/uninstall.mjs +29 -0
  201. package/pipeline/scripts/usage-access.mjs +16 -31
  202. package/pipeline/scripts/usage-health.mjs +31 -62
  203. package/pipeline/scripts/usage-register-beacon.mjs +11 -22
  204. package/pipeline/scripts/usage-register.mjs +39 -29
  205. package/pipeline/scripts/usage-report.mjs +579 -178
  206. package/pipeline/scripts/validate-code-graph.mjs +361 -111
  207. package/pipeline/scripts/write-state.mjs +39 -0
  208. package/pipeline/skills/.skill-manifest.json +21 -17
  209. package/pipeline/skills/.skills-index.json +13 -2
  210. package/pipeline/skills/shared/README.md +5 -4
  211. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +1 -1
  212. package/pipeline/skills/shared/core/multi-agent-diff-explain/SKILL.md +3 -3
  213. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +55 -21
  214. package/pipeline/skills/shared/core/multi-agent-pair/SKILL.md +41 -0
  215. package/pipeline/skills/shared/core/multi-agent-prune-prompts/SKILL.md +1 -1
  216. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  217. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +2 -3
  218. package/pipeline/skills/shared/external/app-store-optimization/references/keyword-research-methodology.md +2 -2
  219. package/pipeline/skills/shared/external/app-store-optimization/references/product-page-variants.md +2 -2
  220. package/pipeline/skills/shared/external/app-store-review/SKILL.md +11 -4
  221. package/pipeline/skills/shared/external/build-settings-audit/SKILL.md +1 -1
  222. package/pipeline/skills/shared/external/build-time-benchmark/SKILL.md +5 -5
  223. package/pipeline/skills/shared/external/build-time-fixes/SKILL.md +5 -5
  224. package/pipeline/skills/shared/external/build-time-optimizer/SKILL.md +6 -6
  225. package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +1 -0
  226. package/pipeline/skills/shared/external/ios-coding-standard/references/STANDARD.md +2 -2
  227. package/pipeline/skills/shared/external/ios-haptics/references/core-haptics.md +1 -1
  228. package/pipeline/skills/shared/external/localization-reuse-map/references/publish-and-snapshot.md +1 -1
  229. package/pipeline/skills/shared/external/package-build-audit/SKILL.md +3 -3
  230. package/pipeline/skills/shared/external/reverse-engineer-own-app/SKILL.md +2 -3
  231. package/pipeline/skills/shared/external/swift-compile-hotspots/SKILL.md +2 -2
  232. package/pipeline/skills/shared/external/weatherkit/SKILL.md +5 -6
  233. package/pipeline/skills/skills-index.md +3 -2
  234. package/docs/FIGMA_PIPELINE.md +0 -137
  235. package/pipeline/lib/identifier-scan.mjs +0 -156
  236. package/pipeline/scripts/_renamed-skills.mjs +0 -164
  237. package/pipeline/scripts/publish-staged.mjs +0 -324
  238. package/pipeline/skills/renamed.json +0 -30
  239. package/pipeline/skills/shared/external/ios-coding-standard/scripts/check_structure.py +0 -765
@@ -96,15 +96,6 @@
96
96
  }
97
97
  }
98
98
  },
99
- "gitIdentities": {
100
- "type": "array",
101
- "deprecated": true,
102
- "description": "DEPRECATED in v2.1.0 - renamed to 'identities'. Migration script converts automatically. Kept in schema temporarily for migration compatibility.",
103
- "items": {
104
- "type": "object",
105
- "additionalProperties": true
106
- }
107
- },
108
99
  "keychainMapping": {
109
100
  "type": "object",
110
101
  "additionalProperties": false,
@@ -1503,12 +1494,12 @@
1503
1494
  "includeTitle": {
1504
1495
  "type": "boolean",
1505
1496
  "default": false,
1506
- "description": "Send a one-line task title (at most 80 characters, code spans, markup and absolute paths removed) with each run record. Off by default: a title is the tracker's text, not pipeline metadata."
1497
+ "description": "Send a summary of the task title with each run record: the number of words, whether it has the shape of a ticket key, and its language (en, tr or other). The title itself is never sent. Off by default: a title is the tracker's text, not pipeline metadata."
1507
1498
  },
1508
1499
  "includePrUrl": {
1509
1500
  "type": "boolean",
1510
1501
  "default": false,
1511
- "description": "Send the PR URL with a run that opened one. Off by default because the URL names the repository; without it the record carries only whether a PR was opened."
1502
+ "description": "Send the PR URL with a run that opened one on github.com, gitlab.com, bitbucket.org or dev.azure.com (no query string or credentials); a pull request on any other host sends nothing. Off by default because the URL names the repository; without it the record carries only whether a PR was opened."
1512
1503
  },
1513
1504
  "trustedHosts": {
1514
1505
  "type": "array",
@@ -1517,6 +1508,11 @@
1517
1508
  "minLength": 1
1518
1509
  },
1519
1510
  "description": "Extra https hosts that may receive the GitHub login proof at registration, besides the default reporting host. Only for a self-hosted endpoint you trust with the account's gh token."
1511
+ },
1512
+ "reportedVersion": {
1513
+ "type": "string",
1514
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$",
1515
+ "description": "The last pipeline version whose install or update record the server accepted. Written by usage-report.mjs; when it differs from the installed version, one lifecycle record is sent and this moves forward."
1520
1516
  }
1521
1517
  }
1522
1518
  },
@@ -2083,6 +2079,44 @@
2083
2079
  }
2084
2080
  }
2085
2081
  },
2082
+ "sessionBrief": {
2083
+ "type": "object",
2084
+ "additionalProperties": false,
2085
+ "description": "Opt-in block a session can open with (pipeline/scripts/session-brief.sh, SessionStart on Claude Code): an index of the repo's learnings ledger with a pointer per line, one line about its code graph, the skill indexes of the enabled toolkits and, as a separate setting, a few working notes. Off until enabled is true; a repo with no ledger entries and no code graph gets nothing. Costs about 350 tokens per session at the defaults and again after each compaction. A detached process rebuilds a cache, the hook only prints it. Silent in unattended and pipeline contexts (MULTI_AGENT_UNATTENDED, MULTI_AGENT_TASK_ID, MULTI_AGENT_PHASE) and for non-interactive sessions. MULTI_AGENT_SESSION_BRIEF=0 turns it off for one process.",
2086
+ "properties": {
2087
+ "enabled": {
2088
+ "type": "boolean",
2089
+ "default": false,
2090
+ "description": "true turns the brief on. Absent or false = the hook prints nothing and starts nothing."
2091
+ },
2092
+ "maxEntries": {
2093
+ "type": "integer",
2094
+ "minimum": 0,
2095
+ "maximum": 10,
2096
+ "default": 5,
2097
+ "description": "Ledger lines shown. 0 leaves the ledger layer out."
2098
+ },
2099
+ "maxChars": {
2100
+ "type": "integer",
2101
+ "minimum": 400,
2102
+ "maximum": 4000,
2103
+ "default": 2400,
2104
+ "description": "Size of the whole block. Whole lines are dropped to fit: working notes first, then skill routing, the graph line, then ledger entries from the last."
2105
+ },
2106
+ "kinds": {
2107
+ "type": "array",
2108
+ "items": {
2109
+ "enum": ["fact", "convention", "rejected-preference", "decision", "security-note"]
2110
+ },
2111
+ "description": "Ledger kinds shown. Absent = all."
2112
+ },
2113
+ "discipline": {
2114
+ "type": "boolean",
2115
+ "default": false,
2116
+ "description": "true adds the working notes (lead with the answer; one question about why only when the goal is unclear; options with a recommendation; a check per step; time in minutes or hours)."
2117
+ }
2118
+ }
2119
+ },
2086
2120
  "stopGuard": {
2087
2121
  "type": "object",
2088
2122
  "additionalProperties": false,
@@ -2818,7 +2852,7 @@
2818
2852
  "lastIdentity": {
2819
2853
  "type": "integer",
2820
2854
  "minimum": 0,
2821
- "description": "Legacy field. Index into global.gitIdentities (v2.0.0). v2.1.0+ uses platformIdentityRouting."
2855
+ "description": "Legacy field. Index into the retired gitIdentities list (v2.0.0). v2.1.0+ uses platformIdentityRouting."
2822
2856
  },
2823
2857
  "jiraProjectKeys": {
2824
2858
  "type": "array",
@@ -141,6 +141,23 @@
141
141
  "x-sensitivity": "none",
142
142
  "description": "The step a paused run re-enters (agent-state waitingFor): maturity, user-channels-choice, local-test, attended-reply or question; null or absent when the run is not waiting. Added in 1.1.0."
143
143
  },
144
+ "waitingSince": {
145
+ "type": ["string", "null"],
146
+ "format": "date-time",
147
+ "x-sensitivity": "none",
148
+ "description": "When a run in the waiting group began to wait: the state's own waitingSince when it has one, else the state file's modification time. Null outside the waiting group. Added in 1.5.0."
149
+ },
150
+ "waitingSinceSource": {
151
+ "enum": ["state", "file-time", null],
152
+ "x-sensitivity": "none",
153
+ "description": "Where waitingSince came from: state is the run's own record of when it parked, file-time is the state file's modification time, which a rewrite moves, so a client shows it as approximate. Null when waitingSince is null. Added in 1.5.0."
154
+ },
155
+ "finishedAt": {
156
+ "type": ["string", "null"],
157
+ "format": "date-time",
158
+ "x-sensitivity": "none",
159
+ "description": "When the run finished or was stopped (agent-state finishedAt); null while it is going and when its state records no end. Added in 1.5.0."
160
+ },
144
161
  "pendingQuestion": {
145
162
  "x-sensitivity": "none",
146
163
  "description": "The question the run stopped on, present only with waitingFor question. Answer it with one of options[].id through `answer-question.mjs` or POST /v1/runs/{id}/answer. text and labels are scrubbed under --redact. Added in 1.1.0.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$comment": "Generated by pipeline/scripts/gen-toolkit-path-params.mjs from multi-agent-mcp tool-manifest.json; do not edit. Per toolkit tool: the parameters it writes to and the filesystem paths it reads, both confined by scripts/unattended_policy.py.",
3
- "toolkitVersion": "4.2.0",
3
+ "toolkitVersion": "4.4.0",
4
4
  "tools": {
5
5
  "agent_query_output": {
6
6
  "writes": [],
@@ -162,6 +162,12 @@
162
162
  "writes": [],
163
163
  "reads": []
164
164
  },
165
+ "binary_android": {
166
+ "writes": [],
167
+ "reads": [
168
+ "path"
169
+ ]
170
+ },
165
171
  "binary_compare_versions": {
166
172
  "writes": [],
167
173
  "reads": [
@@ -176,6 +182,24 @@
176
182
  "observed"
177
183
  ]
178
184
  },
185
+ "binary_evm": {
186
+ "writes": [],
187
+ "reads": [
188
+ "path"
189
+ ]
190
+ },
191
+ "binary_firmware": {
192
+ "writes": [],
193
+ "reads": [
194
+ "path"
195
+ ]
196
+ },
197
+ "binary_formats": {
198
+ "writes": [],
199
+ "reads": [
200
+ "path"
201
+ ]
202
+ },
179
203
  "binary_inspect": {
180
204
  "writes": [],
181
205
  "reads": [
@@ -188,6 +212,18 @@
188
212
  "path"
189
213
  ]
190
214
  },
215
+ "binary_pcap": {
216
+ "writes": [],
217
+ "reads": [
218
+ "path"
219
+ ]
220
+ },
221
+ "binary_sqlite": {
222
+ "writes": [],
223
+ "reads": [
224
+ "path"
225
+ ]
226
+ },
191
227
  "binary_strings_endpoints": {
192
228
  "writes": [],
193
229
  "reads": [
@@ -250,7 +286,9 @@
250
286
  },
251
287
  "context_get": {
252
288
  "writes": [],
253
- "reads": []
289
+ "reads": [
290
+ "path"
291
+ ]
254
292
  },
255
293
  "context_index": {
256
294
  "writes": [],
@@ -606,7 +644,8 @@
606
644
  "out_dir"
607
645
  ],
608
646
  "reads": [
609
- "path"
647
+ "path",
648
+ "against"
610
649
  ]
611
650
  },
612
651
  "media_music_beats": {
@@ -624,14 +663,20 @@
624
663
  ]
625
664
  },
626
665
  "media_thumbnail_check": {
627
- "writes": [],
666
+ "writes": [
667
+ "cover.output"
668
+ ],
628
669
  "reads": [
629
670
  "path"
630
671
  ]
631
672
  },
632
673
  "media_transcript": {
633
- "writes": [],
634
- "reads": []
674
+ "writes": [
675
+ "out_dir"
676
+ ],
677
+ "reads": [
678
+ "path"
679
+ ]
635
680
  },
636
681
  "media_video_check": {
637
682
  "writes": [],
@@ -660,7 +705,21 @@
660
705
  "footage_dir",
661
706
  "voice_dir",
662
707
  "sfx[].file",
663
- "music"
708
+ "music",
709
+ "brand",
710
+ "brand.logo",
711
+ "brand.intro",
712
+ "brand.outro",
713
+ "scenes[].image",
714
+ "variants[].music",
715
+ "variants[].footage_dir",
716
+ "variants[].voice_dir",
717
+ "variants[].brand",
718
+ "variants[].brand.logo",
719
+ "variants[].brand.intro",
720
+ "variants[].brand.outro",
721
+ "variants[].scenes[].image",
722
+ "variants[].sfx[].file"
664
723
  ]
665
724
  },
666
725
  "pass_build": {
@@ -940,6 +999,14 @@
940
999
  "bibliography"
941
1000
  ]
942
1001
  },
1002
+ "thesis_convert": {
1003
+ "writes": [
1004
+ "out"
1005
+ ],
1006
+ "reads": [
1007
+ "paths"
1008
+ ]
1009
+ },
943
1010
  "thesis_overlap": {
944
1011
  "writes": [],
945
1012
  "reads": [
@@ -954,7 +1021,9 @@
954
1021
  ]
955
1022
  },
956
1023
  "thesis_reference_verify": {
957
- "writes": [],
1024
+ "writes": [
1025
+ "out_dir"
1026
+ ],
958
1027
  "reads": [
959
1028
  "bibliography"
960
1029
  ]
@@ -1183,6 +1252,7 @@
1183
1252
  },
1184
1253
  "web_session_open": {
1185
1254
  "writes": [
1255
+ "record_video.out_dir",
1186
1256
  "profile_dir"
1187
1257
  ],
1188
1258
  "reads": []
@@ -94,6 +94,7 @@ Shell scripts invoked during pipeline execution.
94
94
  - `eval-mine-corpus.mjs` - manual maintainer CLI: mines `~/.claude/memory/multi-agent/<repo-slug>/triage-corpus.jsonl` from real runs into new triage eval fixtures (dev-only, excluded from the npm package; not part of `npm test`)
95
95
  - `gen-skills-index.mjs` - regenerates `pipeline/skills/shared/README.md` skill catalog
96
96
  - `gen-facts.mjs` - derives `docs/facts.json`, the counts the docs and the website state; `gen-fact-marks.mjs` renders them into the docs
97
+ - `gen-office-command-matrix.mjs` - writes `pipeline/office/command-matrix.json`, how the office handles each command (start, window, or terminal-only with its reason); `--check` runs in `npm test`
97
98
  - `migrate-prefs.mjs` - preference migration driver
98
99
  - `migrate-state.mjs` - generic migration runner (reads `schemas/migrations/`)
99
100
  - `token-budget-report.mjs` - per-phase token usage report
@@ -5,11 +5,12 @@
5
5
  * instead of hand-writing architecture.md from a single task's window. The
6
6
  * design: extraction with zero LLM cost, one graph file, an incremental
7
7
  * manifest gate, hub nodes, and token-budgeted traversal as the query surface.
8
- * The extraction itself is
8
+ * Definitions and imports are
9
9
  * regex over comment-stripped source rather than tree-sitter - a tree-sitter
10
- * binding would be an npm runtime dependency, which ADR-0004 forbids. That
11
- * trade is deliberate: definitions and imports survive it, call graphs and type
12
- * resolution do not, and neither consumer needs those.
10
+ * binding would be an npm runtime dependency, which ADR-0004 forbids. Calls are
11
+ * resolved by the hand-written readers in call-graph/, which are heuristic and
12
+ * say so on every edge (`via`, `confidence`); infrastructure, configuration,
13
+ * documentation and rationale come from infra/.
13
14
  *
14
15
  * Definition and import patterns come from the rule files. References do NOT:
15
16
  * a per-language reference regex is both brittle and redundant once every
@@ -17,10 +18,13 @@
17
18
  * with the global symbol index instead. That is language-agnostic and cannot
18
19
  * drift from the definition patterns, because it is derived from them.
19
20
  *
20
- * Two passes, one read per file:
21
+ * Passes, one read per file:
21
22
  * 1. strip comments and strings, extract definitions + imports, keep the
22
- * file's identifier set (a Set of strings, not the source text)
23
+ * file's identifier set (a Set of strings, not the source text) and the
24
+ * file's call facts
23
25
  * 2. intersect each identifier set with the symbol index to emit references
26
+ * 3. resolve the call facts across files into calls edges
27
+ * 4. add infrastructure, configuration, documentation and rationale nodes
24
28
  *
25
29
  * Zero runtime dependencies (ADR-0004).
26
30
  *
@@ -33,9 +37,19 @@ import { join, dirname, relative, sep } from "node:path";
33
37
  import { fileURLToPath } from "node:url";
34
38
  import { isExcludedBy } from "./_path-match.mjs";
35
39
  import { supertypesAt } from "./_supertypes.mjs";
40
+ import { analyzeFile, addCallEdges } from "./call-graph/index.mjs";
41
+ import { codeReads, mayReadConfig } from "./infra/extract.mjs";
42
+ import { addInfra } from "./infra/graph.mjs";
43
+ import { addDocs, rationaleComments } from "./infra/docs.mjs";
44
+ import { attachSidecars, makeSidecar } from "./_graph-sidecars.mjs";
45
+ import { stripCode } from "./_strip-code.mjs";
46
+
47
+ export { stripCode };
36
48
 
37
49
  const __dirname = dirname(fileURLToPath(import.meta.url));
38
50
 
51
+ const MAX_SKIPPED_LISTED = 200;
52
+
39
53
  export const GRAPH_SCHEMA_VERSION = "1.2.0";
40
54
 
41
55
  /**
@@ -118,79 +132,6 @@ export function loadRules(requested, baseDir = __dirname) {
118
132
  };
119
133
  }
120
134
 
121
- /**
122
- * Remove comments and string literals so they cannot produce phantom edges.
123
- *
124
- * Character-scanned rather than regex-replaced: a regex pass cannot tell a `//`
125
- * inside a string from a real comment, and that difference is exactly what
126
- * makes reference edges noisy. Replaces removed spans with spaces so byte
127
- * offsets, and therefore line numbers, are preserved.
128
- *
129
- * @param {string} text - source text
130
- * @param {object} comments - rules.comments
131
- * @returns {string} same length, comments and string bodies blanked
132
- */
133
- export function stripCode(text, comments = {}) {
134
- const line = comments.line || [];
135
- const block = comments.block || [];
136
- const quotes = comments.string || [];
137
- const out = text.split("");
138
-
139
- let i = 0;
140
- const blank = (from, to) => {
141
- for (let k = from; k < to && k < out.length; k++) {
142
- if (out[k] !== "\n") out[k] = " ";
143
- }
144
- };
145
-
146
- while (i < text.length) {
147
- const rest = text.slice(i, i + 8);
148
-
149
- const lineTok = line.find((t) => rest.startsWith(t));
150
- if (lineTok) {
151
- let end = text.indexOf("\n", i);
152
- if (end === -1) end = text.length;
153
- blank(i, end);
154
- i = end;
155
- continue;
156
- }
157
-
158
- const blockTok = block.find(([open]) => rest.startsWith(open));
159
- if (blockTok) {
160
- const [open, close] = blockTok;
161
- let end = text.indexOf(close, i + open.length);
162
- end = end === -1 ? text.length : end + close.length;
163
- blank(i, end);
164
- i = end;
165
- continue;
166
- }
167
-
168
- const quoteTok = quotes.find((q) => rest.startsWith(q));
169
- if (quoteTok) {
170
- let j = i + quoteTok.length;
171
- while (j < text.length) {
172
- if (text[j] === "\\") {
173
- j += 2;
174
- continue;
175
- }
176
- if (text.startsWith(quoteTok, j)) {
177
- j += quoteTok.length;
178
- break;
179
- }
180
- if (text[j] === "\n" && quoteTok.length === 1) break;
181
- j++;
182
- }
183
- blank(i, j);
184
- i = j;
185
- continue;
186
- }
187
-
188
- i++;
189
- }
190
-
191
- return out.join("");
192
- }
193
-
194
135
  /**
195
136
  * First populated capture group of a match.
196
137
  *
@@ -223,6 +164,8 @@ function blankImportLines(stripped) {
223
164
  return stripped.replace(IMPORT_LINE_RE, (line) => " ".repeat(line.length));
224
165
  }
225
166
 
167
+ const NO_READS = { env: [], config: [] };
168
+
226
169
  const IDENTIFIER_RE = /[A-Za-z_][A-Za-z0-9_]*/g;
227
170
 
228
171
  /**
@@ -388,9 +331,11 @@ export function assignSpans(definitions, lines) {
388
331
  *
389
332
  * @param {string} text - raw source
390
333
  * @param {object} rules - merged rules from loadRules
391
- * @returns {{definitions: Array, imports: string[], tokens: Set<string>}}
334
+ * @param {string} [path] - repo-relative path; when given, call facts are scanned too
335
+ * @param {{skipCalls?: string}} [options] - skipCalls names why call facts are not scanned for this file
336
+ * @returns {{definitions: Array, imports: string[], tokens: Set<string>, calls: object|null}}
392
337
  */
393
- export function extractFile(text, rules) {
338
+ export function extractFile(text, rules, path, { skipCalls = null } = {}) {
394
339
  const stripped = stripCode(text, rules.comments);
395
340
 
396
341
  // Swift and the JVM name a module with a bare identifier, so the fully
@@ -452,33 +397,64 @@ export function extractFile(text, rules) {
452
397
 
453
398
  assignSpans(definitions, body.split("\n"));
454
399
  for (const d of definitions) delete d.indent;
455
- return { definitions, imports, tokens: identifiers(body), conformances };
400
+ const why = rationaleComments(text);
401
+ const reads = mayReadConfig(text)
402
+ ? codeReads(stripCode(text, { line: rules.comments.line, block: rules.comments.block }))
403
+ : NO_READS;
404
+ const { facts, skipped } = skipCalls
405
+ ? { facts: null, skipped: path ? skipCalls : null }
406
+ : path
407
+ ? analyzeFile(
408
+ text,
409
+ (o) =>
410
+ o.keepStrings
411
+ ? stripCode(text, { line: rules.comments.line, block: rules.comments.block })
412
+ : stripCode(text, rules.comments, o),
413
+ path,
414
+ )
415
+ : { facts: null };
416
+ return {
417
+ definitions,
418
+ imports,
419
+ tokens: identifiers(body),
420
+ conformances,
421
+ calls: facts,
422
+ ...(reads.env.length || reads.config.length ? { reads } : {}),
423
+ ...(why.length ? { rationale: why } : {}),
424
+ ...(skipped ? { skipped } : {}),
425
+ };
456
426
  }
457
427
 
458
428
  /**
459
- * Every source file under root, honouring .gitignore and excludePathGlobs.
460
- *
461
- * Uses `git ls-files` when root is a work tree, so .gitignore and
462
- * .git/info/exclude are respected without reimplementing them; falls back to a
463
- * directory walk otherwise.
429
+ * Every file under root that the work tree tracks or would add, honouring
430
+ * .gitignore and .git/info/exclude without reimplementing them; a directory
431
+ * walk stands in when root is not a work tree.
464
432
  *
465
433
  * @param {string} root - absolute repo root
466
- * @param {object} rules - merged rules
467
- * @returns {string[]} repo-relative paths, sorted
434
+ * @returns {string[]} repo-relative paths
468
435
  */
469
- export function listSourceFiles(root, rules) {
470
- let candidates;
436
+ export function listCandidateFiles(root) {
471
437
  try {
472
438
  const out = execFileSync("git", ["-C", root, "ls-files", "-z", "-co", "--exclude-standard"], {
473
439
  encoding: "utf8",
474
440
  maxBuffer: 64 * 1024 * 1024,
475
441
  stdio: ["ignore", "pipe", "ignore"],
476
442
  });
477
- candidates = out.split("\0").filter(Boolean);
443
+ return out.split("\0").filter(Boolean);
478
444
  } catch {
479
- candidates = walkDir(root, root);
445
+ return walkDir(root, root);
480
446
  }
447
+ }
481
448
 
449
+ /**
450
+ * Every source file of the stack, honouring excludePathGlobs.
451
+ *
452
+ * @param {string} root - absolute repo root
453
+ * @param {object} rules - merged rules
454
+ * @param {string[]} [candidates] - listCandidateFiles(root), when the caller already has it
455
+ * @returns {string[]} repo-relative paths, sorted
456
+ */
457
+ export function listSourceFiles(root, rules, candidates = listCandidateFiles(root)) {
482
458
  const isSource = (p) => {
483
459
  if (!rules.sourceExtensions.some((ext) => p.endsWith(ext))) return false;
484
460
  if (isExcludedBy(p, rules.excludePathGlobs)) return false;
@@ -539,9 +515,17 @@ export const symbolNodeId = (path, name) => `sym:${path}#${name}`;
539
515
  * @param {object} [params.manifest] - relPath -> {size, mtimeMs}
540
516
  * @param {string|null} [params.baseCommit]
541
517
  * @param {string} [params.generatedAt] - ISO timestamp, injected by the caller
542
- * @returns {object} graph conforming to code-graph.schema.json
518
+ * @param {Map<string, object>} [params.infra] - collectInfra result; omitted for none
519
+ * @param {Set<string>} [params.known] - every path that exists, to resolve file references
520
+ * @param {Map<string, object>} [params.docs] - collectDocs result; omitted for none
521
+ * @param {boolean} [params.calls] - build the calls sidecar; default true
522
+ * @param {object} [params.caps] - per-sidecar {maxNodes, maxEdges} overrides
523
+ * @param {number} [params.resolveBudgetMs] - time the call resolution may take; files left over are listed
524
+ * @param {() => number} [params.resolveClock] - clock for that budget, injectable for tests
525
+ * @returns {{graph: object, sidecars: object}} the main graph (schema 1.2.0) and the
526
+ * sidecars that were asked for
543
527
  */
544
- export function buildGraph({
528
+ export function buildGraphSet({
545
529
  root,
546
530
  stack,
547
531
  extracted,
@@ -549,6 +533,13 @@ export function buildGraph({
549
533
  manifest = {},
550
534
  baseCommit = null,
551
535
  generatedAt,
536
+ infra = null,
537
+ known = null,
538
+ docs = null,
539
+ calls = true,
540
+ caps = {},
541
+ resolveBudgetMs,
542
+ resolveClock,
552
543
  }) {
553
544
  const nodes = new Map();
554
545
  const edges = [];
@@ -673,25 +664,115 @@ export function buildGraph({
673
664
  }
674
665
 
675
666
  for (const edge of edges) {
676
- if (nodes.has(edge.from)) nodes.get(edge.from).degree++;
677
- if (nodes.has(edge.to)) nodes.get(edge.to).degree++;
667
+ nodes.get(edge.from).degree++;
668
+ nodes.get(edge.to).degree++;
678
669
  }
679
670
 
680
- return {
671
+ const graph = {
681
672
  schemaVersion: GRAPH_SCHEMA_VERSION,
682
673
  stack,
683
674
  root,
684
675
  baseCommit,
685
676
  generatedAt,
686
- stats: {
687
- files: extracted.size,
688
- nodes: nodes.size,
689
- edges: edges.length,
690
- },
677
+ stats: { files: extracted.size, nodes: nodes.size, edges: edges.length },
691
678
  nodes: [...nodes.values()],
692
679
  edges,
693
680
  manifest,
694
681
  };
682
+ const sidecars = {};
683
+ const layer = (build) => {
684
+ const view = new Map(nodes);
685
+ const extra = [];
686
+ const annotations = {};
687
+ const info = build(view, extra, annotations) || {};
688
+ const fresh = [...view.values()].filter((n) => !nodes.has(n.id));
689
+ return { nodes: fresh, edges: extra, annotations, ...info };
690
+ };
691
+
692
+ if (calls) {
693
+ const body = layer((view, extra, annotations) => {
694
+ const st = addCallEdges({
695
+ extracted,
696
+ nodes: view,
697
+ edges: extra,
698
+ annotations,
699
+ isTest: (p) => isTestPath(p, rules),
700
+ budgetMs: resolveBudgetMs,
701
+ now: resolveClock,
702
+ });
703
+ const skipped = [
704
+ ...[...extracted]
705
+ .filter(([, d]) => d.skipped)
706
+ .map(([path, d]) => ({ path, reason: d.skipped })),
707
+ ...st.unresolved.map((path) => ({ path, reason: "resolve-time-budget" })),
708
+ ];
709
+ return {
710
+ stats: { calls: st.calls, callFilesSkipped: skipped.length },
711
+ coverage: { callAnalysisSkipped: skipped.slice(0, MAX_SKIPPED_LISTED) },
712
+ };
713
+ });
714
+ sidecars.calls = makeSidecar("calls", graph, body, caps.calls);
715
+ }
716
+
717
+ if (infra) {
718
+ const readers = [...extracted].filter(([, d]) => d.reads);
719
+ const body = layer((view, extra) => {
720
+ const st = addInfra({
721
+ nodes: view,
722
+ edges: extra,
723
+ files: infra,
724
+ reads: new Map(readers.map(([path, d]) => [path, d.reads])),
725
+ known: known || new Set(extracted.keys()),
726
+ });
727
+ return {
728
+ stats: { infra: st.infra, env: st.env, config: st.config },
729
+ ...(infra.skipped?.length ? { coverage: { skipped: infra.skipped } } : {}),
730
+ };
731
+ });
732
+ body.manifest = inputManifest(root, [...infra.keys(), ...readers.map(([p]) => p)]);
733
+ sidecars.infra = makeSidecar("infra", graph, body, caps.infra);
734
+ }
735
+
736
+ if (docs) {
737
+ const whys = [...extracted].filter(([, d]) => d.rationale);
738
+ const body = layer((view, extra) => {
739
+ const st = addDocs({
740
+ nodes: view,
741
+ edges: extra,
742
+ docs,
743
+ rationale: new Map(whys.map(([path, d]) => [path, d.rationale])),
744
+ });
745
+ return {
746
+ stats: { docs: st.docs, rationale: st.rationale },
747
+ ...(docs.skipped?.length ? { coverage: { skipped: docs.skipped } } : {}),
748
+ };
749
+ });
750
+ body.manifest = inputManifest(root, [...docs.keys(), ...whys.map(([p]) => p)]);
751
+ sidecars.docs = makeSidecar("docs", graph, body, caps.docs);
752
+ }
753
+
754
+ return { graph, sidecars };
755
+ }
756
+
757
+ function inputManifest(root, paths) {
758
+ const out = {};
759
+ for (const p of paths) {
760
+ try {
761
+ out[p] = manifestEntry(join(root, p));
762
+ } catch {
763
+ // vanished between read and stat: it is simply not an input of this build
764
+ }
765
+ }
766
+ return out;
767
+ }
768
+
769
+ /**
770
+ * The same build as buildGraphSet with every layer joined to the main graph in
771
+ * memory, the view a reader gets from loadGraph.
772
+ */
773
+ export function buildGraph(params) {
774
+ const { graph, sidecars } = buildGraphSet(params);
775
+ return attachSidecars(graph, "in-memory.json", { parsed: sidecars });
695
776
  }
696
777
 
697
778
  /**