@mmerterden/multi-agent-pipeline 20.21.0 → 20.22.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 (41) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/docs/adr/0017-change-impact-from-the-graph.md +69 -0
  3. package/docs/adr/README.md +1 -0
  4. package/docs/ecosystem.md +6 -5
  5. package/docs/facts.json +4 -3
  6. package/install/catalog-history.json +1 -1
  7. package/install/templates/copilot-instructions.md +1 -0
  8. package/manifest.json +44 -40
  9. package/package.json +1 -1
  10. package/pipeline/commands/multi-agent/review/SKILL.md +2 -1
  11. package/pipeline/commands/multi-agent/setup/SKILL.md +6 -15
  12. package/pipeline/multi-agent-refs/_dev-context.md +15 -0
  13. package/pipeline/multi-agent-refs/analysis/evidence.md +5 -3
  14. package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
  15. package/pipeline/multi-agent-refs/cross-cli-contract.md +1 -0
  16. package/pipeline/multi-agent-refs/features/code-graph.md +27 -0
  17. package/pipeline/multi-agent-refs/features/product-context.md +238 -0
  18. package/pipeline/multi-agent-refs/knowledge.md +2 -0
  19. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +7 -12
  20. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +1 -1
  21. package/pipeline/multi-agent-refs/phases/phase-3-review.md +7 -6
  22. package/pipeline/multi-agent-refs/platform-parity.md +23 -9
  23. package/pipeline/multi-agent-refs/setup/token-save-flow.md +24 -0
  24. package/pipeline/schemas/agent-state.schema.json +31 -0
  25. package/pipeline/schemas/analysis-spec.schema.json +14 -0
  26. package/pipeline/schemas/code-graph.schema.json +12 -1
  27. package/pipeline/schemas/diff-risk.schema.json +2 -1
  28. package/pipeline/schemas/prefs.schema.json +58 -0
  29. package/pipeline/scripts/_code-graph.mjs +76 -3
  30. package/pipeline/scripts/_diff-impact.mjs +312 -0
  31. package/pipeline/scripts/capture-flush.sh +58 -3
  32. package/pipeline/scripts/diff-risk-score.mjs +80 -9
  33. package/pipeline/scripts/graph-affected.mjs +167 -36
  34. package/pipeline/scripts/graph-query.mjs +16 -4
  35. package/pipeline/scripts/product-context.mjs +539 -0
  36. package/pipeline/scripts/smoke-cross-cli-behavior.sh +39 -1
  37. package/pipeline/scripts/validate-code-graph.mjs +2 -1
  38. package/pipeline/scripts/validate-diff-risk.mjs +1 -0
  39. package/pipeline/skills/.skill-manifest.json +3 -3
  40. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +5 -1
  41. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +8 -6
package/CHANGELOG.md CHANGED
@@ -16,6 +16,39 @@ Internal file-layout changes that don't affect the slash-command surface are sti
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [20.22.0] - 2026-10-13
20
+
21
+ ### Added
22
+
23
+ - **Product context: planning reads the product's other repositories at their latest branch.** A run develops in its active stack's repositories; Phase 1 Step 1.6 now also reads every other repository of the product (the other platform's app, web, backend services, the shared resources repo), read-only, at `develop` or else the remote's default branch, pinned to a sha, through the multi-agent-toolkit's `repo_*` tools (≥ v3.22.1). It is symmetric: whichever stack is primary, the rest are references. Each join key (Figma node id, localization key, endpoint path, analytics event) lands as `implemented`, `not-yet-implemented` (this run is first; nothing is ported) or `diverges`, in `state.productContext` and in the plan. Never blocking. Contract: `multi-agent-refs/features/product-context.md`.
24
+ - `prefs.global.products` and `prefs.projects[<key>].product`, the product map. GitHub and Bitbucket repositories mix in one product; a repository may name a read-token credential key and `basic` or `bearer` auth. The dev-context step offers to map an unmapped project once (attended only), suggesting repositories whose name core matches; declining is remembered.
25
+ - `scripts/product-context.mjs` (`refs`, `suggest`, `needs-mapping`, `learn`, `decline`, `record`, `recall`). Each reference carries a tool-ready `spec`. Findings are appended to the related repository's own `knowledge/<repo>/product-context.jsonl`, keyed by the sha they were read at, so what an iOS run learns about Android serves the next Android run while that sha is current; the knowledge row keeps the tool's status and the planner's note, while a `diverges` verdict stays in the run's state. `learn` merges by remote, re-checks every credential the merge keeps, caps a product at 20 repositories (one `repo_find_keys` call), accepts `file://` only with the toolkit's file switch, and keeps the preferences file's mode.
26
+ - **Change impact from the code graph.** `graph-affected --diff <base>` (also `<base>..<head>` and `--diff-file`) seeds the reverse walk from a diff: each hunk maps onto the innermost declaration it touches through indentation-derived spans (`endLine`, code-graph schema 1.1.0, attribute lines and multi-line headers included, `#if` lines skipped), read on the side of the diff the graph was built from (`side`), so a graph built on the base checkout maps a branch's diff correctly and a deleted file reaches its dependents; enclosing declarations are seeded too, and the JSON names `changedSymbols`, `notIndexed` and `fileLevel`. Contract: `multi-agent-refs/features/code-graph.md`; decision: `docs/adr/0017-change-impact-from-the-graph.md`.
27
+ - **Graph freshness on every answer.** `graph-affected` reports `freshness`: files edited since the build (uncommitted work included), files removed, and whether HEAD moved. A stale answer says it is stale.
28
+ - **`dependents_reached` risk signal.** `diff-risk-score --graph` adds the number of distinct non-test files that depend on the changed declarations, two rings out, capped at 20 so it never outweighs a security path. Phase 3 Step 1.75 passes the project's graph; without one, nothing changes.
29
+
30
+ ### Changed
31
+
32
+ - Phase 3 platform parity and `/multi-agent:review` take their counterparts from the product first and compare at the pinned sha, without a local checkout; the mirrored ios ↔ android resolution remains the fallback. The sibling-directory source keeps only repositories whose name core matches the primary's, and lists the main checkout's parent, not a worktree's.
33
+ - `/multi-agent:analysis` reads every repository other than the one it runs from at its latest integration branch through `repo_*`, records `evidence.repoShas[]`, and includes those shas in `evidence_digest`.
34
+ - `/multi-agent:setup hosts` re-opens the host prompts and the repository read binding (Token Save Flow Step 3.7) for tokens already saved; a GitHub or Bitbucket token pass asks for the binding after its host.
35
+ - `smoke-cross-cli-behavior.sh` installs Codex as well and checks that product context reaches Claude Code, Copilot CLI and Codex CLI.
36
+
37
+ ### Fixed
38
+
39
+ - `graph-affected` reaches transitive dependents: the walk continues through what each dependent file declares, instead of stopping after one ring, and no longer lists the defining file as a dependent.
40
+ - `graph-query` charges its token budget for the line it prints, so the reported count matches the output.
41
+ - `capture-flush.sh` finds a run's triage when only Phase 3's own round files exist: after the salvaged and worktree copies it reads each worktree's newest `.pipeline/triage-round-<N>.json`, including worktrees a multi-repo run lists under `projects[]`, then the state directory. A run that died before its `triage-output.json` copy no longer leaves the triage corpus and learnings ledger empty.
42
+ - `capture-flush.sh` files triage-corpus and ledger entries under the run's own repository (its worktree's main checkout, else the project in the state), not under the directory the hook fired in.
43
+ - `capture-flush.sh` prefers the newer of a worktree's `triage-output.json` and its newest round, names a submodule's store after the submodule, and ignores a project name that is not a plain name.
44
+ - Copilot's instructions map `$HOME/.claude/scripts/` and `lib/` in refs read from `~/.claude` or GitHub to the Copilot copies.
45
+ - `diff-risk-score` reads `--numstat -z`, so renamed, braced and non-ASCII paths are the new path exactly.
46
+ - `graph-build` lists files with `ls-files -z`, so files with non-ASCII names (`Ödeme Özeti.swift`) are indexed.
47
+
48
+ ### Security
49
+
50
+ - A repository credential is accepted by `learn` only when `prefs.global.credentialHosts` already binds the key to that https host. The binding is written by `/multi-agent:setup` (Token Save Flow Step 3.7) with the person present; the product map never creates one. Requires multi-agent-toolkit ≥ v3.22.1, which reads bindings from the same place.
51
+
19
52
  ## [20.21.0] - 2026-10-12
20
53
 
21
54
  ### Added
@@ -0,0 +1,69 @@
1
+ # 17. Change impact from the graph: spans, a transitive walk, and freshness
2
+
3
+ **Status:** Accepted · 2026-10-12 · extends [ADR-0010](./0010-own-code-graph.md)
4
+
5
+ ## Context
6
+
7
+ ADR-0010 built the code graph to answer "where does this live" and "what
8
+ depends on this". Four properties of the graph shape the second answer:
9
+
10
+ - References point from files to symbols, and a file's only incoming edges are
11
+ imports. A reverse walk therefore needs a hop from each dependent file to the
12
+ declarations it makes before it can reach the next ring, and the file that
13
+ defines a seed is not one of its dependents.
14
+ - A reviewer starts from a diff, not from a symbol name, so the walk needs a
15
+ way to turn changed lines into declarations.
16
+ - The manifest written at build time records each file's size and mtime, which
17
+ is enough to tell whether an answer describes the current tree.
18
+ - A query budget is only honest when it is charged for the text the caller
19
+ receives.
20
+
21
+ Two public references solved parts of this. `DeusData/codebase-memory-mcp`
22
+ (MIT) maps a diff onto the symbols that contain the changed lines and walks
23
+ outward for blast radius, and reports whether the paths asked about are indexed
24
+ and fresh. `Graphify-Labs/graphify` (Apache-2.0) seeds its affected walk from a
25
+ declaration's members and counts the tokens of the answer it actually returns.
26
+ Both are design references only: the first is a C daemon with tree-sitter
27
+ grammars, a file watcher and a browser UI, the second a Python service with
28
+ incremental reconciliation, and ADR-0004 forbids a native runtime dependency.
29
+
30
+ ## Decision
31
+
32
+ Extend the graph in place:
33
+
34
+ - **Spans.** Every definition gets an `endLine`: the line before the next
35
+ definition at the same or a lower indentation, or the end of the file. It is
36
+ derived from the indentation signal the engine already uses for nesting, so
37
+ it needs no parser and holds across the brace languages and Python. Schema
38
+ 1.1.0; a 1.0.0 graph stays readable.
39
+ - **Diff seeding.** `graph-affected --diff` maps each hunk onto the innermost
40
+ declaration it touches and seeds the walk with it and its enclosing
41
+ declarations. A file from a pre-1.1.0 graph is seeded whole and listed as
42
+ such; a changed file the graph does not contain is listed as not indexed.
43
+ The diff is read on the side the graph describes: the new side when the
44
+ graph matches the tree, otherwise the old side, where its spans hold.
45
+ - **A transitive walk.** Dependents are files; the walk continues through what
46
+ each dependent file declares, never follows `defines`, and never reports a
47
+ seed's defining file.
48
+ - **Freshness on every answer.** Size and mtime against the manifest, plus the
49
+ build commit against HEAD. A stale answer says it is stale.
50
+ - **Risk.** `diff-risk-score --graph` adds `dependents_reached`, combined with
51
+ the existing security, public-API and missing-test signals and capped, so a
52
+ change is not ranked by graph distance alone.
53
+ - **Honest budgets.** `graph-query` charges for the printed line.
54
+
55
+ ## Not adopted
56
+
57
+ A daemon or watcher, incremental reconciliation (a full build takes seconds;
58
+ graphify's history shows how many defects incremental state produces), Cypher,
59
+ a UI, LLM-labelled edges and confidence scores. The single-candidate rule from
60
+ ADR-0010 stays: an ambiguous reference gets no edge rather than a guessed one.
61
+
62
+ ## Consequences
63
+
64
+ A reviewer and Phase 3 get the blast radius of the actual diff. A span is an
65
+ upper bound, so a hunk in trailing blank lines or a closing brace counts toward
66
+ the declaration above it; that errs toward more dependents, not fewer. Method
67
+ level precision is still bounded by regex extraction; confirming candidates
68
+ through the language server (`code_references`) is the next step and is not
69
+ part of this decision.
@@ -26,6 +26,7 @@ Format: lightly adapted from [Michael Nygard's ADR template](https://cognitect.c
26
26
  | [0014](./0014-six-phase-consolidation.md) | Six phases, because two of the eight were doing the same work twice | Accepted (amended by 0015: the depth answer is removed) |
27
27
  | [0015](./0015-one-pipeline-no-depth-answer.md) | One pipeline: the depth question is removed | Accepted (extended by 0016: the workspace and resume names go too) |
28
28
  | [0016](./0016-the-run-shape-is-asked-not-typed.md) | The shape of a run is asked, not typed into its name | Accepted |
29
+ | [0017](./0017-change-impact-from-the-graph.md) | Change impact from the graph: spans, a transitive walk, freshness | Accepted |
29
30
 
30
31
  ## Writing a New ADR
31
32
 
package/docs/ecosystem.md CHANGED
@@ -7,7 +7,7 @@ separately, wired together at install time and at run time:
7
7
  |---|---|---|
8
8
  | **`multi-agent-pipeline`** (this repo) | Orchestration: the 6-phase flow, the 64 slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
9
9
  | **`multi-agent-plugins`** | Stack knowledge: per-platform component/lifecycle skills (iOS, Android, Frontend, Backend) + shared knowledge | Claude Code marketplace, 6 independently-versioned plugins |
10
- | **`multi-agent-toolkit-mcp`** | The pipeline's hands on devices and browsers: 191 MCP tools across 20 categories (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance, web automation and scraping, Figma-vs-mock design audit, code intelligence, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed research, verified hand-off of simple text tasks to free models, video key frames, offline security scoring, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones) | npm package, registered as a standard stdio MCP server on every host |
10
+ | **`multi-agent-toolkit-mcp`** | The pipeline's hands on devices and browsers: 197 MCP tools across 21 categories (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance, web automation and scraping, Figma-vs-mock design audit, code intelligence, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed research, verified hand-off of simple text tasks to free models, video key frames, offline security scoring, read-only access to related repositories at their latest branch, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones) | npm package, registered as a standard stdio MCP server on every host |
11
11
 
12
12
  None of the three depends on the others at the code level. They compose through two
13
13
  narrow contracts: the **Skill tool** (pipeline → plugin, at Phase 2) and the **MCP
@@ -234,14 +234,14 @@ Detail: [`unattended-security.md`](../pipeline/multi-agent-refs/features/unatten
234
234
 
235
235
  ### multi-agent-toolkit-mcp's tools, by category
236
236
 
237
- 191 tools in 20 categories, counted from the server's own `tools/list` response
238
- at toolkit 3.21.0 rather than from a README. Three families are defined in
237
+ 197 tools in 21 categories, counted from the server's own `tools/list` response
238
+ at toolkit 3.22.1 rather than from a README. Three families are defined in
239
239
  modules the main file only spreads in, so a count taken from the source reads
240
240
  low; the response is the only place the whole surface appears at once.
241
241
 
242
242
  The families can be narrowed per host: `MCP_TOOLKIT_CAPS` serves only the named
243
- ones, and unset serves all 191. A frontend repo that sets `web,code,context`
244
- sees 47 tools instead of 191, which matters because every registered server's
243
+ ones, and unset serves all 197. A frontend repo that sets `web,code,context`
244
+ sees 47 tools instead of 197, which matters because every registered server's
245
245
  tool list is charged against the context window on every turn.
246
246
 
247
247
  | Category | Tools | Primary pipeline consumers |
@@ -262,6 +262,7 @@ tool list is charged against the context window on every turn.
262
262
  | Free Models | 2 (`llm_delegate`, `llm_providers`) | `route-on --free`: `bulk-read.sh` through the `multi-agent-toolkit-llm` CLI, the `delegate` call site in skills and analysis evidence gathering ([`free-models.md`](../pipeline/multi-agent-refs/features/free-models.md)). Allowed in unattended runs only while the free chain is on |
263
263
  | Media | 1 (`media_frames`) | Phase 2 visual evidence: turns a screen recording into frames a reviewer and a model can both look at |
264
264
  | Security | 2 (`security_cvss_score`, `security_dep_inventory`) | the Phase 3 Step 2.7 security audit (`security-auditor`) and `/multi-agent:security-review`; offline, no egress |
265
+ | Related Repositories | 6 (`repo_resolve`, `repo_grep`, `repo_read`, `repo_ls`, `repo_log`, `repo_find_keys`) | Phase 1 Step 1.6 product context, Phase 3 platform parity, `/multi-agent:review`, `/multi-agent:analysis`; read-only, pinned to a sha |
265
266
  | Travel Document Fixtures | 2 (`document_mrz_build`, `document_generate`) | the `e2e-testing` skill's MRZ and document-scan recipes |
266
267
  | Voice | 6 | none in the pipeline; a local voice host outside it |
267
268
  | Store APIs | 30 | `/multi-agent:store-ready`, `/multi-agent:setup` credential onboarding |
package/docs/facts.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by pipeline/scripts/gen-facts.mjs. Do not hand-edit: the site reads this, and a number edited here instead of at its source is the drift this file removes.",
3
3
  "generatedAt": "2026-10-12",
4
- "version": "20.21.0",
4
+ "version": "20.22.0",
5
5
  "phaseSchema": 2,
6
6
  "phases": [
7
7
  {
@@ -40,7 +40,7 @@
40
40
  "skillCountAll": 228,
41
41
  "agentCount": 10,
42
42
  "hosts": ["Claude Code", "Codex CLI", "Copilot CLI"],
43
- "toolCount": 191,
43
+ "toolCount": 197,
44
44
  "toolCategories": {
45
45
  "ios": 42,
46
46
  "web": 35,
@@ -49,6 +49,7 @@
49
49
  "vphone": 10,
50
50
  "code": 8,
51
51
  "design": 7,
52
+ "repo": 6,
52
53
  "voice": 6,
53
54
  "context": 4,
54
55
  "pass": 4,
@@ -61,5 +62,5 @@
61
62
  "ui": 1
62
63
  },
63
64
  "pluginSkillCount": 252,
64
- "toolkitVersion": "3.21.1"
65
+ "toolkitVersion": "3.22.1"
65
66
  }