@groundnuty/macf 0.2.35 → 0.2.36

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.
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "3a7b7c62b7bc3dfec44d98bf5bc4c3cedc107b63",
3
- "built_at": "2026-06-05T12:40:50.183Z"
2
+ "commit": "5a9da8d337d2a40bf2010c6282e57f1feef432dc",
3
+ "built_at": "2026-06-07T23:02:21.494Z"
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claude-sh.d.ts","sourceRoot":"","sources":["../../src/cli/claude-sh.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAuBnD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CA4B/D;AAYD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAejD;AA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CA+DV;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAkBhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAiB1D;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAgC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAuFhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,MAAM,CAUnF"}
1
+ {"version":3,"file":"claude-sh.d.ts","sourceRoot":"","sources":["../../src/cli/claude-sh.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAuBnD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CA4B/D;AAYD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAejD;AA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CA+DV;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAkBhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAiB1D;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAgC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAkGhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,MAAM,CAUnF"}
@@ -535,10 +535,21 @@ export function generateClaudeSh(config) {
535
535
  // prior session state is missing/partial. Normal production runs
536
536
  // (MACF_TEST unset) get the resume-by-default behavior. See
537
537
  // macf#189 sub-item 4.
538
+ //
539
+ // Permanent agents resume with `-c`, but fall back to a FRESH session
540
+ // when no conversation is resumable for this workspace (first launch, or
541
+ // history keyed under a different/physical path) — otherwise `claude -c`
542
+ // exits non-zero immediately and the launch dies with no agent. The
543
+ // resume attempt isn't `exec`'d so the `||` fallback can fire; the
544
+ // fallback IS `exec`'d (terminal). CV-migration dogfooding finding #6.
538
545
  'if [ -n "${MACF_TEST:-}" ]; then',
539
- ` exec claude ${['--plugin-dir', '"$SCRIPT_DIR/.macf/plugin"'].join(' ')} "$@"`,
546
+ ' exec claude --plugin-dir "$SCRIPT_DIR/.macf/plugin" "$@"',
540
547
  'else',
541
- ` exec claude ${[...resumeFlags(config), '--plugin-dir', '"$SCRIPT_DIR/.macf/plugin"'].join(' ')} "$@"`,
548
+ ...(resumeFlags(config).length > 0
549
+ ? [
550
+ ` claude ${resumeFlags(config).join(' ')} --plugin-dir "$SCRIPT_DIR/.macf/plugin" "$@" || exec claude --plugin-dir "$SCRIPT_DIR/.macf/plugin" "$@"`,
551
+ ]
552
+ : [' exec claude --plugin-dir "$SCRIPT_DIR/.macf/plugin" "$@"']),
542
553
  'fi',
543
554
  '',
544
555
  ].join('\n');
@@ -1 +1 @@
1
- {"version":3,"file":"claude-sh.js","sourceRoot":"","sources":["../../src/cli/claude-sh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,8EAA8E;AAC9E,mDAAmD;AACnD,8EAA8E;AAC9E,EAAE;AACF,0DAA0D;AAC1D,2DAA2D;AAC3D,+DAA+D;AAC/D,kEAAkE;AAClE,0DAA0D;AAC1D,qEAAqE;AACrE,oEAAoE;AACpE,sDAAsD;AACtD,EAAE;AACF,iEAAiE;AACjE,gEAAgE;AAChE,oEAAoE;AACpE,2DAA2D;AAC3D,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AAEzE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAA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CAAkC;QAClC,4DAA4D;QAC5D,MAAM;QACN,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;YAChC,CAAC,CAAC;gBACE,YAAY,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,2GAA2G;aACrJ;YACH,CAAC,CAAC,CAAC,4DAA4D,CAAC,CAAC;QACnE,IAAI;QACJ,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,MAAuB;IACzE,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACvC,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,uEAAuE;IACvE,qEAAqE;IACrE,kEAAkE;IAClE,oDAAoD;IACpD,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -225,9 +225,9 @@ export async function issueRoutingClient(projectDir, opts = {}) {
225
225
  console.log('ROUTING_CLIENT_KEY = ' + Buffer.from(result.keyPem).toString('base64'));
226
226
  }
227
227
  console.log('');
228
- console.log('Next steps (see macf-actions#8):');
228
+ console.log('Next steps (consumer Stage-3 wiring — see groundnuty/macf-actions CHANGELOG, "Migration for consumers"):');
229
229
  console.log(' 1. Paste ROUTING_CLIENT_CERT and ROUTING_CLIENT_KEY into your consumer repo\'s GHA secrets');
230
- console.log(' 2. Upgrade the caller workflow to macf-actions @v2.x when available');
231
- console.log(' 3. Remove the AGENT_SSH_KEY secret once mTLS transport is proven');
230
+ console.log(' 2. Set the other v3 router secrets: TS_OAUTH_CLIENT_ID/SECRET + MACF_ROUTING_APP_ID/KEY (a dedicated variables:read-only App)');
231
+ console.log(' 3. Point the caller workflow at macf-actions/.github/workflows/agent-router.yml@v3 (with: { project }, secrets: inherit)');
232
232
  }
233
233
  //# sourceMappingURL=certs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"certs.js","sourceRoot":"","sources":["../../../src/cli/commands/certs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EAAE,aAAa,EAAE,YAAY,EAC5C,UAAU,IAAI,aAAa,EAAE,SAAS,IAAI,YAAY,EAAE,KAAK,EAC7D,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,KAAK,UAAU,gBAAgB,CAAC,OAAe;IAC7C,IAAI,CAAC;QACH,OAAO,MAAM,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,eAAe,EAAE,CA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59
59
  */
60
60
  export declare const MACF_CLOSE_HOOK_COMMAND = "$CLAUDE_PROJECT_DIR/.claude/scripts/check-close-keyword.sh";
61
+ /**
62
+ * The UserPromptSubmit turn-ack receipt hook (groundnuty/macf#444 Option D,
63
+ * piece 2). When the router injects a prompt carrying the correlation marker
64
+ * `[macf-route:<run_id>:<agent>]` (macf-actions piece 1), this hook fires on
65
+ * submit and emits a `turn_processed` OTel span — making a routed ping that
66
+ * BECAME A TURN observable, so a dropped one surfaces as a missing span
67
+ * (closes the #437 send≠receipt gap). Unlike the PreToolUse `check-*` hooks
68
+ * this is NOT a blocker (it observes, never `exit 2`s) and is registered
69
+ * `async: true` so it adds no turn latency. No-op on non-routed prompts.
70
+ */
71
+ export declare const MACF_TURN_RECEIPT_HOOK_COMMAND = "$CLAUDE_PROJECT_DIR/.claude/scripts/emit-turn-receipt.sh";
61
72
  /**
62
73
  * Permission patterns pre-approving the `macf-agent` plugin skills.
63
74
  * Without these, every first invocation of a skill (e.g. `/macf-status`
@@ -1 +1 @@
1
- {"version":3,"file":"settings-writer.d.ts","sourceRoot":"","sources":["../../src/cli/settings-writer.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,0DAA0D,CAAC;AAEzF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,iEAAiE,CAAC;AAExG;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,2DAA2D,CAAC;AAE/F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,+DAA+D,CAAC;AA+DpG;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAMrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAGxD,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM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;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAmE7D"}
@@ -80,6 +80,17 @@ export const MACF_LGTM_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/check
80
80
  * `Closes #own` passes); override via MACF_SKIP_CLOSE_CHECK=1.
81
81
  */
82
82
  export const MACF_CLOSE_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/check-close-keyword.sh';
83
+ /**
84
+ * The UserPromptSubmit turn-ack receipt hook (groundnuty/macf#444 Option D,
85
+ * piece 2). When the router injects a prompt carrying the correlation marker
86
+ * `[macf-route:<run_id>:<agent>]` (macf-actions piece 1), this hook fires on
87
+ * submit and emits a `turn_processed` OTel span — making a routed ping that
88
+ * BECAME A TURN observable, so a dropped one surfaces as a missing span
89
+ * (closes the #437 send≠receipt gap). Unlike the PreToolUse `check-*` hooks
90
+ * this is NOT a blocker (it observes, never `exit 2`s) and is registered
91
+ * `async: true` so it adds no turn latency. No-op on non-routed prompts.
92
+ */
93
+ export const MACF_TURN_RECEIPT_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/emit-turn-receipt.sh';
83
94
  /**
84
95
  * The hook filenames used to identify MACF-managed entries on refresh.
85
96
  * Matched by path-end equality (see isMacfManagedCommand) so operator
@@ -90,6 +101,7 @@ const MACF_HOOK_FILENAMES = [
90
101
  'check-mention-routing.sh',
91
102
  'check-lgtm-gate.sh',
92
103
  'check-close-keyword.sh',
104
+ 'emit-turn-receipt.sh',
93
105
  ];
94
106
  /**
95
107
  * True iff the command string represents one of our managed hooks — i.e.
@@ -619,6 +631,7 @@ export function installGhTokenHook(workspaceDir) {
619
631
  const settings = readSettings(path);
620
632
  const hooks = settings.hooks ?? {};
621
633
  const preToolUse = hooks.PreToolUse ?? [];
634
+ const userPromptSubmit = hooks.UserPromptSubmit ?? [];
622
635
  // Drop any prior MACF-managed entries (any hook file in
623
636
  // MACF_HOOK_FILENAMES) so we can replace them cleanly — guards against
624
637
  // stale flags from older CLI versions + handles renames/additions to
@@ -645,11 +658,24 @@ export function installGhTokenHook(workspaceDir) {
645
658
  hooks: [{ type: 'command', command: MACF_CLOSE_HOOK_COMMAND }],
646
659
  },
647
660
  ];
661
+ // UserPromptSubmit: the turn-ack receipt hook (groundnuty/macf#444). Same
662
+ // preserve-then-replace discipline as PreToolUse above — drop any prior
663
+ // MACF-managed UserPromptSubmit entry (by MACF_HOOK_FILENAMES basename) and
664
+ // re-add ours, leaving operator-authored UserPromptSubmit hooks intact. No
665
+ // `matcher` (UserPromptSubmit isn't tool-gated); `async: true` so it never
666
+ // adds turn latency.
667
+ const preservedUps = userPromptSubmit.filter((entry) => !entry.hooks.some((h) => isMacfManagedCommand(h.command)));
668
+ const macfUpsEntries = [
669
+ {
670
+ hooks: [{ type: 'command', command: MACF_TURN_RECEIPT_HOOK_COMMAND, async: true }],
671
+ },
672
+ ];
648
673
  const updated = {
649
674
  ...settings,
650
675
  hooks: {
651
676
  ...hooks,
652
677
  PreToolUse: [...preserved, ...macfEntries],
678
+ UserPromptSubmit: [...preservedUps, ...macfUpsEntries],
653
679
  },
654
680
  };
655
681
  writeFileSync(path, JSON.stringify(updated, null, 2) + '\n');
@@ -1 +1 @@
1
- {"version":3,"file":"settings-writer.js","sourceRoot":"","sources":["../../src/cli/settings-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,uDAAuD,CAAC;AAEzF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8DAA8D,CAAC;AAExG;;;;;;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C/D;KACF,CAAC;IAEF,0EAA0E;IAC1E,wEAAwE;IACxE,4EAA4E;IAC5E,2EAA2E;IAC3E,2EAA2E;IAC3E,qBAAqB;IACrB,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAC1C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CACrE,CAAC;IACF,MAAM,cAAc,GAAyB;QAC3C;YACE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;SACnF;KACF,CAAC;IAEF,MAAM,OAAO,GAAa;QACxB,GAAG,QAAQ;QACX,KAAK,EAAE;YACL,GAAG,KAAK;YACR,UAAU,EAAE,CAAC,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;YAC1C,gBAAgB,EAAE,CAAC,GAAG,YAAY,EAAE,GAAG,cAAc,CAAC;SACvD;KACF,CAAC;IAEF,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Parser for the macf-actions router's "delivered" log lines (groundnuty/macf#444
3
+ * Option D, piece 4 — the "expected set").
4
+ *
5
+ * Each `route-by-*` block in `agent-router.yml` echoes a success line when it
6
+ * delivers a routed prompt to an agent's tmux session:
7
+ *
8
+ * route-by-label → `Routed issue #N to <AGENT> via helper|inline (…)`
9
+ * route-by-mention → `Routed mention to <AGENT> via helper|inline (…)`
10
+ * route-by-ci-completion → `Routed CI completion for PR #N to <AGENT> via helper|inline (…)`
11
+ * route-by-pr-review-state→ `Routed review-state (STATE) for PR #N to <AGENT> via helper|inline (…)`
12
+ *
13
+ * The common, stable shape is `Routed … to <AGENT> via (helper|inline)`. A
14
+ * `Routed …` with no `via helper|inline` (e.g. the `delivery FAILED` /
15
+ * `offline, skipping` lines) is NOT a delivery and must not be counted. The
16
+ * agent token is kebab (`code-agent`, `science-agent`, `devops-agent`) — for
17
+ * `route-by-label` it's the label (== the agent name), which is exactly what
18
+ * the marker `[macf-route:${RUN_ID}:${AGENT_NAME|LABEL}]` and thus the
19
+ * `turn_processed` span's `agent` attr also carry, so the join matches by
20
+ * construction.
21
+ *
22
+ * `runId` + `deliveredAtMs` come from the run's metadata (caller supplies them),
23
+ * not the log text. Pure (testable) — the gh-API fetch lives in run.ts.
24
+ */
25
+ import type { DeliveredRoute } from './reconcile.js';
26
+ /**
27
+ * Extract the agents a single router run delivered to, from its log text.
28
+ * Dedups per (runId, agent) — a run that logs the same agent twice yields one
29
+ * DeliveredRoute. Returns one entry per distinct delivered agent.
30
+ */
31
+ export declare function parseDeliveredFromLog(logText: string, runId: string, deliveredAtMs: number): DeliveredRoute[];
32
+ //# sourceMappingURL=parse-delivered.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-delivered.d.ts","sourceRoot":"","sources":["../../src/reconciler/parse-delivered.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQrD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GACpB,cAAc,EAAE,CAMlB"}
@@ -0,0 +1,18 @@
1
+ // `Routed <anything-not-newline> to <kebab-agent> via helper|inline`.
2
+ // The non-greedy `.*?` + the required `via (helper|inline)` tail excludes the
3
+ // failure/offline lines (which have no `via helper|inline`). `\b` after the
4
+ // alternation avoids matching a longer accidental token.
5
+ const ROUTED_LINE = /Routed [^\n]*? to ([a-z][a-z0-9-]*) via (?:helper|inline)\b/g;
6
+ /**
7
+ * Extract the agents a single router run delivered to, from its log text.
8
+ * Dedups per (runId, agent) — a run that logs the same agent twice yields one
9
+ * DeliveredRoute. Returns one entry per distinct delivered agent.
10
+ */
11
+ export function parseDeliveredFromLog(logText, runId, deliveredAtMs) {
12
+ const agents = new Set();
13
+ for (const m of logText.matchAll(ROUTED_LINE)) {
14
+ agents.add(m[1]);
15
+ }
16
+ return [...agents].map((agent) => ({ runId, agent, deliveredAtMs }));
17
+ }
18
+ //# sourceMappingURL=parse-delivered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-delivered.js","sourceRoot":"","sources":["../../src/reconciler/parse-delivered.ts"],"names":[],"mappings":"AA0BA,sEAAsE;AACtE,8EAA8E;AAC9E,4EAA4E;AAC5E,yDAAyD;AACzD,MAAM,WAAW,GAAG,8DAA8D,CAAC;AAEnF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAe,EACf,KAAa,EACb,aAAqB;IAErB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Parser for the Tempo TraceQL search response → PROCESSED receipts
3
+ * (groundnuty/macf#444 Option D, piece 4 — the "actual set").
4
+ *
5
+ * Query the reconciler runs (science-agent, empirically verified on live Tempo):
6
+ *
7
+ * GET /api/search
8
+ * q = {name="turn_processed" && resource.service.namespace="macf"}
9
+ * | select(span.routed_run_id, span.agent)
10
+ * start = <epoch SECONDS> end = <epoch SECONDS> limit = <high>
11
+ *
12
+ * `select(span.<key>)` brings the span attrs back IN the search response
13
+ * (no per-trace `/api/traces/<id>` fetch). Response shape:
14
+ *
15
+ * { "traces": [ { "spanSets": [ { "spans": [
16
+ * { "attributes": [ { "key": "routed_run_id", "value": { "stringValue": "…" } },
17
+ * { "key": "agent", "value": { "stringValue": "…" } } ] } ] } ] } ] }
18
+ *
19
+ * Gotchas handled (per science's notes):
20
+ * 1. `spanSets` (plural array) in current Tempo; older Tempo uses singular
21
+ * `spanSet` — handle both.
22
+ * 2. attribute `value` is typed: `{ stringValue: … }` for ours.
23
+ * 3. truncation (Tempo `limit` cap) is the CALLER's concern — a silently
24
+ * truncated PROCESSED set would read as missing receipts ⇒ false drops
25
+ * (Pattern-A class). The fetcher must assert `traceCount < limit`; this
26
+ * pure parser just reports `traceCount` so the caller can check.
27
+ *
28
+ * Pure (no I/O) so it's unit-testable against the recorded live shape; the
29
+ * fetch + truncation-guard live in run.ts.
30
+ */
31
+ import type { ProcessedReceipt } from './reconcile.js';
32
+ export interface ParseProcessedResult {
33
+ readonly receipts: readonly ProcessedReceipt[];
34
+ /** Number of traces in the response — caller compares against `limit` to
35
+ * detect silent truncation (false-drop hazard). */
36
+ readonly traceCount: number;
37
+ }
38
+ /**
39
+ * Parse a Tempo `/api/search` response into PROCESSED receipts. Each
40
+ * `turn_processed` trace is a single-span trace; we read `routed_run_id` +
41
+ * `agent` from its span attributes. Spans missing either key are skipped
42
+ * (defensive — a malformed span isn't a receipt).
43
+ */
44
+ export declare function parseProcessedFromTempo(body: unknown): ParseProcessedResult;
45
+ /**
46
+ * Interpret a parsed result against the Tempo query `limit`. A result that HIT
47
+ * the limit is (possibly) TRUNCATED — and a truncated PROCESSED set is missing
48
+ * real receipts, which `reconcile()` would read as drops → a FALSE incident on
49
+ * exactly the busy windows the reconciler exists to handle (Pattern A). So
50
+ * truncation is NOT "these are the receipts"; it makes the PROCESSED set
51
+ * **unknowable**, the same as a Tempo outage. Returns the receipts only when
52
+ * the set is known-complete (`traceCount < limit`), else `null` — the caller
53
+ * treats `null` as "Tempo problem → true no-op this run" (never open, never
54
+ * close), distinguishing "Tempo unknown" from "0 verified drops".
55
+ */
56
+ export declare function receiptsIfComplete(parsed: ParseProcessedResult, limit: number): readonly ProcessedReceipt[] | null;
57
+ //# sourceMappingURL=parse-processed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-processed.d.ts","sourceRoot":"","sources":["../../src/reconciler/parse-processed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAyBvD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C;wDACoD;IACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,CAiB3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,MAAM,GACZ,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAEpC"}
@@ -0,0 +1,41 @@
1
+ function attrString(attrs, key) {
2
+ return attrs?.find((a) => a.key === key)?.value?.stringValue;
3
+ }
4
+ /**
5
+ * Parse a Tempo `/api/search` response into PROCESSED receipts. Each
6
+ * `turn_processed` trace is a single-span trace; we read `routed_run_id` +
7
+ * `agent` from its span attributes. Spans missing either key are skipped
8
+ * (defensive — a malformed span isn't a receipt).
9
+ */
10
+ export function parseProcessedFromTempo(body) {
11
+ const resp = (body ?? {});
12
+ const traces = resp.traces ?? [];
13
+ const receipts = [];
14
+ for (const trace of traces) {
15
+ const spanSets = trace.spanSets ?? (trace.spanSet ? [trace.spanSet] : []);
16
+ for (const set of spanSets) {
17
+ for (const span of set.spans ?? []) {
18
+ const runId = attrString(span.attributes, 'routed_run_id');
19
+ const agent = attrString(span.attributes, 'agent');
20
+ if (runId && agent)
21
+ receipts.push({ runId, agent });
22
+ }
23
+ }
24
+ }
25
+ return { receipts, traceCount: traces.length };
26
+ }
27
+ /**
28
+ * Interpret a parsed result against the Tempo query `limit`. A result that HIT
29
+ * the limit is (possibly) TRUNCATED — and a truncated PROCESSED set is missing
30
+ * real receipts, which `reconcile()` would read as drops → a FALSE incident on
31
+ * exactly the busy windows the reconciler exists to handle (Pattern A). So
32
+ * truncation is NOT "these are the receipts"; it makes the PROCESSED set
33
+ * **unknowable**, the same as a Tempo outage. Returns the receipts only when
34
+ * the set is known-complete (`traceCount < limit`), else `null` — the caller
35
+ * treats `null` as "Tempo problem → true no-op this run" (never open, never
36
+ * close), distinguishing "Tempo unknown" from "0 verified drops".
37
+ */
38
+ export function receiptsIfComplete(parsed, limit) {
39
+ return parsed.traceCount >= limit ? null : parsed.receipts;
40
+ }
41
+ //# sourceMappingURL=parse-processed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-processed.js","sourceRoot":"","sources":["../../src/reconciler/parse-processed.ts"],"names":[],"mappings":"AAmDA,SAAS,UAAU,CAAC,KAAuC,EAAE,GAAW;IACtE,OAAO,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC;AAC/D,CAAC;AASD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAa;IACnD,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAwB,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1E,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;gBACnC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;gBAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBACnD,IAAI,KAAK,IAAI,KAAK;oBAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA4B,EAC5B,KAAa;IAEb,OAAO,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Route-receipt reconciler — pure drop-detection logic (groundnuty/macf#444
3
+ * Option D, piece 4).
4
+ *
5
+ * Closes the structural gap: a `turn_processed` span nobody queries is
6
+ * *forensic*, not *surfacing*. This is the consumer that turns the ABSENCE of
7
+ * a receipt span into a structural signal.
8
+ *
9
+ * It joins two sets on `(runId, agent)`:
10
+ * - DELIVERED — the routes the macf-actions router LOGGED as delivered
11
+ * (`Routed … to <AGENT> via helper|inline`), each with the route run's
12
+ * timestamp. (Source: GitHub run logs — see sources.ts.)
13
+ * - PROCESSED — the `turn_processed` spans the substrate UserPromptSubmit
14
+ * hook emitted when the marked prompt became a turn. (Source: Tempo
15
+ * TraceQL `{name="turn_processed" && resource.service.namespace="macf"}`.)
16
+ *
17
+ * A DELIVERED route is a **drop** iff it has no matching PROCESSED span AND it
18
+ * is older than the open-threshold. The threshold is load-bearing: a
19
+ * *legitimately busy* agent processes the ping late (the #437 co-verify showed
20
+ * ~4 min legit latency), so a recent unmatched delivery is "still in flight",
21
+ * NOT a drop. The threshold must exceed observed busy-turn latency (≈15–20 min,
22
+ * tunable). This + the per-run recompute gives the open-on-absence /
23
+ * self-close-on-appearance behaviour (e2e.yml #166/#163 shape): while drops
24
+ * exist the workflow holds an incident open; once a late span lands (or none
25
+ * remain) the next run reports zero drops and the workflow self-closes.
26
+ *
27
+ * The join key is the **marker-parsed** `(runId, agent)` — both sides derive
28
+ * from the router's `[macf-route:${GITHUB_RUN_ID}:${AGENT_NAME}]` marker /
29
+ * `Routed … to <AGENT>` log line, so they match by construction. (NOT the
30
+ * receiving agent's `MACF_AGENT_NAME`, which is unset on substrate — see #444
31
+ * discussion + the #451 hook.)
32
+ *
33
+ * This module is intentionally PURE (no I/O) so the load-bearing logic is fully
34
+ * unit-testable; the GitHub/Tempo fetchers + the incident open/self-close live
35
+ * in sources.ts / run.ts / the scheduled workflow.
36
+ */
37
+ /** A delivered route the router logged, with the route run's completion time. */
38
+ export interface DeliveredRoute {
39
+ /** The `${GITHUB_RUN_ID}` of the agent-router run that delivered it. */
40
+ readonly runId: string;
41
+ /** The target agent the route was delivered to (`Routed … to <AGENT>`). */
42
+ readonly agent: string;
43
+ /** Epoch ms when the route was delivered (the router run's timestamp). */
44
+ readonly deliveredAtMs: number;
45
+ }
46
+ /** A `(runId, agent)` pair that produced a `turn_processed` span. */
47
+ export interface ProcessedReceipt {
48
+ readonly runId: string;
49
+ readonly agent: string;
50
+ }
51
+ export interface ReconcileOptions {
52
+ /** Current time (epoch ms). Injected for deterministic tests. */
53
+ readonly nowMs: number;
54
+ /**
55
+ * A delivered-but-unmatched route younger than this is "still in flight"
56
+ * (a busy agent may process it late), NOT a drop. Must exceed observed
57
+ * busy-turn latency (#437: ~4 min) — default ≈15 min, env-tunable.
58
+ */
59
+ readonly openThresholdMs: number;
60
+ /**
61
+ * Deployment-boundary cutoff (epoch ms): ignore delivered routes older than
62
+ * this. Routes that predate the receipt mechanism's go-live (a pre-v1.3.4
63
+ * router prompt with no marker, hitting a session with no hook) have no
64
+ * `turn_processed` receipt by construction — a missing receipt there is
65
+ * EXPECTED, not a drop. Without this the first reconcile after enabling
66
+ * would flag every pre-deployment route in the lookback window as a false
67
+ * drop (groundnuty/macf#444). Undefined / 0 ⇒ no cutoff (judge all routes).
68
+ */
69
+ readonly sinceMs?: number;
70
+ }
71
+ export interface ReconcileResult {
72
+ /**
73
+ * Deliveries with no matching `turn_processed` span, older than the
74
+ * open-threshold — the structural drops to alert on. Empty ⇒ the workflow
75
+ * self-closes any open incident.
76
+ */
77
+ readonly drops: readonly DeliveredRoute[];
78
+ /** Count of delivered routes considered (diagnostic). */
79
+ readonly deliveredCount: number;
80
+ /** Count of distinct processed receipts seen (diagnostic). */
81
+ readonly processedCount: number;
82
+ /**
83
+ * Delivered routes that are unmatched but still within the threshold —
84
+ * "in flight", reported for visibility but NOT alerted on.
85
+ */
86
+ readonly inFlight: readonly DeliveredRoute[];
87
+ }
88
+ /** Canonical join key for a `(runId, agent)` pair. */
89
+ export declare function receiptKey(p: {
90
+ runId: string;
91
+ agent: string;
92
+ }): string;
93
+ /**
94
+ * Pure reconciliation: which delivered routes are drops (no receipt span +
95
+ * older than the open-threshold) vs. still-in-flight (no receipt yet but
96
+ * within the threshold) vs. processed (have a receipt).
97
+ */
98
+ export declare function reconcile(delivered: readonly DeliveredRoute[], processed: readonly ProcessedReceipt[], opts: ReconcileOptions): ReconcileResult;
99
+ //# sourceMappingURL=reconcile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/reconciler/reconcile.ts"],"names":[],"mappings":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
+ /**
2
+ * Route-receipt reconciler — pure drop-detection logic (groundnuty/macf#444
3
+ * Option D, piece 4).
4
+ *
5
+ * Closes the structural gap: a `turn_processed` span nobody queries is
6
+ * *forensic*, not *surfacing*. This is the consumer that turns the ABSENCE of
7
+ * a receipt span into a structural signal.
8
+ *
9
+ * It joins two sets on `(runId, agent)`:
10
+ * - DELIVERED — the routes the macf-actions router LOGGED as delivered
11
+ * (`Routed … to <AGENT> via helper|inline`), each with the route run's
12
+ * timestamp. (Source: GitHub run logs — see sources.ts.)
13
+ * - PROCESSED — the `turn_processed` spans the substrate UserPromptSubmit
14
+ * hook emitted when the marked prompt became a turn. (Source: Tempo
15
+ * TraceQL `{name="turn_processed" && resource.service.namespace="macf"}`.)
16
+ *
17
+ * A DELIVERED route is a **drop** iff it has no matching PROCESSED span AND it
18
+ * is older than the open-threshold. The threshold is load-bearing: a
19
+ * *legitimately busy* agent processes the ping late (the #437 co-verify showed
20
+ * ~4 min legit latency), so a recent unmatched delivery is "still in flight",
21
+ * NOT a drop. The threshold must exceed observed busy-turn latency (≈15–20 min,
22
+ * tunable). This + the per-run recompute gives the open-on-absence /
23
+ * self-close-on-appearance behaviour (e2e.yml #166/#163 shape): while drops
24
+ * exist the workflow holds an incident open; once a late span lands (or none
25
+ * remain) the next run reports zero drops and the workflow self-closes.
26
+ *
27
+ * The join key is the **marker-parsed** `(runId, agent)` — both sides derive
28
+ * from the router's `[macf-route:${GITHUB_RUN_ID}:${AGENT_NAME}]` marker /
29
+ * `Routed … to <AGENT>` log line, so they match by construction. (NOT the
30
+ * receiving agent's `MACF_AGENT_NAME`, which is unset on substrate — see #444
31
+ * discussion + the #451 hook.)
32
+ *
33
+ * This module is intentionally PURE (no I/O) so the load-bearing logic is fully
34
+ * unit-testable; the GitHub/Tempo fetchers + the incident open/self-close live
35
+ * in sources.ts / run.ts / the scheduled workflow.
36
+ */
37
+ /** Canonical join key for a `(runId, agent)` pair. */
38
+ export function receiptKey(p) {
39
+ return `${p.runId}:${p.agent}`;
40
+ }
41
+ /**
42
+ * Pure reconciliation: which delivered routes are drops (no receipt span +
43
+ * older than the open-threshold) vs. still-in-flight (no receipt yet but
44
+ * within the threshold) vs. processed (have a receipt).
45
+ */
46
+ export function reconcile(delivered, processed, opts) {
47
+ const processedKeys = new Set(processed.map(receiptKey));
48
+ // Deployment-boundary guard (groundnuty/macf#444): drop routes delivered
49
+ // before the receipt mechanism went live from scope entirely — those prompts
50
+ // had no marker and hit hookless sessions, so a missing receipt is EXPECTED,
51
+ // not a drop. Else the first reconcile after enabling would false-alarm on
52
+ // every pre-deployment route in the lookback window.
53
+ const sinceMs = opts.sinceMs;
54
+ const inScope = sinceMs ? delivered.filter((r) => r.deliveredAtMs >= sinceMs) : delivered;
55
+ const drops = [];
56
+ const inFlight = [];
57
+ for (const route of inScope) {
58
+ if (processedKeys.has(receiptKey(route)))
59
+ continue; // receipt landed — fine
60
+ const ageMs = opts.nowMs - route.deliveredAtMs;
61
+ if (ageMs > opts.openThresholdMs) {
62
+ drops.push(route); // unmatched + past the threshold → structural drop
63
+ }
64
+ else {
65
+ inFlight.push(route); // unmatched but young → busy agent may process late
66
+ }
67
+ }
68
+ return {
69
+ drops,
70
+ inFlight,
71
+ deliveredCount: inScope.length,
72
+ processedCount: processedKeys.size,
73
+ };
74
+ }
75
+ //# sourceMappingURL=reconcile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../src/reconciler/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAyDH,sDAAsD;AACtD,MAAM,UAAU,UAAU,CAAC,CAAmC;IAC5D,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,SAAoC,EACpC,SAAsC,EACtC,IAAsB;IAEtB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAEzD,yEAAyE;IACzE,6EAA6E;IAC7E,6EAA6E;IAC7E,2EAA2E;IAC3E,qDAAqD;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1F,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAqB,EAAE,CAAC;IAEtC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAAE,SAAS,CAAC,wBAAwB;QAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC;QAC/C,IAAI,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,mDAAmD;QACxE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,oDAAoD;QAC5E,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK;QACL,QAAQ;QACR,cAAc,EAAE,OAAO,CAAC,MAAM;QAC9B,cAAc,EAAE,aAAa,CAAC,IAAI;KACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/reconciler/run.ts"],"names":[],"mappings":""}
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Route-receipt reconciler entrypoint (groundnuty/macf#444 Option D, piece 4).
4
+ *
5
+ * Invoked by the scheduled `route-reconciler.yml` workflow. Thin I/O glue over
6
+ * the unit-tested pure pieces (reconcile / parse-delivered / parse-processed):
7
+ *
8
+ * 1. DELIVERED — `gh run list` the `agent-router` runs (success, recent) +
9
+ * `gh run view --log` each → parse the `Routed … to <AGENT>` lines.
10
+ * 2. PROCESSED — Tempo `/api/search` for `turn_processed` spans → parse the
11
+ * `(routed_run_id, agent)` attrs.
12
+ * 3. reconcile() → drops (delivered, no receipt, older than the open-threshold).
13
+ * 4. Emit `tempo_ok` + `drops_count` / `drops_json` to `$GITHUB_OUTPUT` for
14
+ * the workflow's open-on-absence / self-close-on-appearance incident steps.
15
+ *
16
+ * Pattern-A safety (false-drop avoidance): any Tempo problem — unreachable,
17
+ * HTTP error, OR a result hitting the `limit` (truncation) — makes the
18
+ * PROCESSED set UNKNOWABLE, which is NOT the same as "zero drops". Treating it
19
+ * as empty would false-OPEN incidents (a truncated set reads as missing
20
+ * receipts) and treating it as `drops_count=0` would false-CLOSE a real
21
+ * incident on a transient outage. So all three paths emit `tempo_ok=false`;
22
+ * the workflow gates BOTH the open AND the self-close steps on
23
+ * `tempo_ok == 'true'`, making a Tempo problem a TRUE no-op (incidents left
24
+ * exactly as they are). Only a verified-complete query opens (real drops) or
25
+ * closes (verified zero).
26
+ *
27
+ * Config (env, set by the workflow):
28
+ * RECONCILER_REPO owner/repo (default $GITHUB_REPOSITORY)
29
+ * ROUTER_WORKFLOW router workflow file (default agent-router.yml)
30
+ * TEMPO_QUERY_ENDPOINT Tempo query base, e.g. http://<tailnet-host>:13200
31
+ * OPEN_THRESHOLD_MIN drop threshold, must exceed busy-turn latency (default 15)
32
+ * LOOKBACK_MIN how far back to scan runs + Tempo (default 120; keep
33
+ * below the window where the router exceeds the run-list
34
+ * cap, else the DELIVERED set truncates → delivered_ok=false)
35
+ * TEMPO_LIMIT Tempo search result cap (default 1000)
36
+ */
37
+ import { execFileSync } from 'node:child_process';
38
+ import { appendFileSync } from 'node:fs';
39
+ import { reconcile } from './reconcile.js';
40
+ import { parseDeliveredFromLog } from './parse-delivered.js';
41
+ import { parseProcessedFromTempo, receiptsIfComplete } from './parse-processed.js';
42
+ const MIN = 60_000;
43
+ /** `gh run list` page cap. If the router bursts past this in the lookback
44
+ * window the DELIVERED set truncates silently (Pattern A on the delivered
45
+ * side: a missed delivery → its receipt is never looked for → a real drop is
46
+ * silently NOT flagged). We WARN when the cap is hit so the symmetry is
47
+ * observable, but don't abort: delivered-side truncation under-reports drops
48
+ * (false negative), which is far less harmful than the processed-side
49
+ * truncation that would over-report them (false incident). */
50
+ const RUN_LIST_LIMIT = 100;
51
+ const envStr = (name, def) => {
52
+ const v = process.env[name];
53
+ return v !== undefined && v.length > 0 ? v : def;
54
+ };
55
+ const REPO = envStr('RECONCILER_REPO', process.env['GITHUB_REPOSITORY'] ?? '');
56
+ const ROUTER_WORKFLOW = envStr('ROUTER_WORKFLOW', 'agent-router.yml');
57
+ const TEMPO = envStr('TEMPO_QUERY_ENDPOINT', 'http://127.0.0.1:13200').replace(/\/+$/, '');
58
+ const OPEN_THRESHOLD_MS = Number(envStr('OPEN_THRESHOLD_MIN', '15')) * MIN;
59
+ const LOOKBACK_MS = Number(envStr('LOOKBACK_MIN', '120')) * MIN;
60
+ const TEMPO_LIMIT = Number(envStr('TEMPO_LIMIT', '1000'));
61
+ /** Deployment-boundary cutoff (groundnuty/macf#444): ignore routes delivered
62
+ * before the receipt mechanism went live. Set `RECONCILER_SINCE` to the
63
+ * hook-go-live time (ISO-8601 e.g. `2026-06-06T08:00:00Z`, or epoch ms) at the
64
+ * first `RECONCILER_ENABLED` flip — pre-deployment routes had no marker + hit
65
+ * hookless sessions, so their missing receipt is EXPECTED, not a drop. Without
66
+ * it, run 1 would false-alarm on every pre-deployment route in the lookback.
67
+ * Self-obsoletes once LOOKBACK_MIN slides fully past the cutoff; unset ⇒ no cutoff. */
68
+ const SINCE_MS = (() => {
69
+ const raw = process.env['RECONCILER_SINCE'];
70
+ if (!raw)
71
+ return undefined;
72
+ const ms = /^\d+$/.test(raw) ? Number(raw) : Date.parse(raw);
73
+ if (!Number.isFinite(ms)) {
74
+ console.error(`WARN: RECONCILER_SINCE="${raw}" not parseable (want ISO-8601 or epoch ms) — ignoring cutoff.`);
75
+ return undefined;
76
+ }
77
+ return ms;
78
+ })();
79
+ /** DELIVERED set: parse the router runs' `Routed … to <AGENT>` success lines.
80
+ * `truncated` is true when `gh run list` hit its page cap — the set is then
81
+ * UNKNOWABLE (older routes fell off the page), so the caller must NOT flag
82
+ * drops this run. Symmetric to the Tempo `tempo_ok` guard, on the delivered
83
+ * side (Pattern A): silently bounding coverage would let a real drop hide. */
84
+ function fetchDelivered(nowMs) {
85
+ const listJson = execFileSync('gh', ['run', 'list', '--repo', REPO, '--workflow', ROUTER_WORKFLOW,
86
+ '--status', 'success', '--limit', String(RUN_LIST_LIMIT), '--json', 'databaseId,createdAt'], { encoding: 'utf-8' });
87
+ const runs = JSON.parse(listJson);
88
+ const truncated = runs.length >= RUN_LIST_LIMIT;
89
+ if (truncated) {
90
+ console.error(`WARN: gh run list hit the ${RUN_LIST_LIMIT}-run cap — DELIVERED set UNKNOWABLE (truncated; older routes in the ${LOOKBACK_MS / MIN}-min window fell off the page). Emitting delivered_ok=false (no drops this run); narrow LOOKBACK_MIN or raise the cap.`);
91
+ }
92
+ const out = [];
93
+ for (const run of runs) {
94
+ const createdMs = Date.parse(run.createdAt);
95
+ if (!Number.isFinite(createdMs) || nowMs - createdMs > LOOKBACK_MS)
96
+ continue;
97
+ let log;
98
+ try {
99
+ log = execFileSync('gh', ['run', 'view', String(run.databaseId), '--repo', REPO, '--log'], { encoding: 'utf-8', maxBuffer: 64 * 1024 * 1024 });
100
+ }
101
+ catch {
102
+ continue; // log unavailable (expired/in-progress) — skip, not a drop signal
103
+ }
104
+ out.push(...parseDeliveredFromLog(log, String(run.databaseId), createdMs));
105
+ }
106
+ return { routes: out, truncated };
107
+ }
108
+ /** PROCESSED set: Tempo `turn_processed` spans → receipts. Aborts (no drops)
109
+ * on a Tempo failure to avoid false alarms (Pattern A). */
110
+ async function fetchProcessed(nowMs) {
111
+ const startSec = Math.floor((nowMs - LOOKBACK_MS) / 1000);
112
+ const endSec = Math.floor(nowMs / 1000);
113
+ const q = '{name="turn_processed" && resource.service.namespace="macf"} | select(span.routed_run_id, span.agent)';
114
+ const url = `${TEMPO}/api/search?q=${encodeURIComponent(q)}&start=${startSec}&end=${endSec}&limit=${TEMPO_LIMIT}`;
115
+ let res;
116
+ try {
117
+ res = await fetch(url, { signal: AbortSignal.timeout(15_000) });
118
+ }
119
+ catch (err) {
120
+ // `fetch failed` is opaque — the real cause is in err.cause (undici wraps
121
+ // the network error). Surface its code + message so an unreachable Tempo
122
+ // tells us WHICH failure: ENOTFOUND (MagicDNS not resolving the host),
123
+ // ECONNREFUSED (nothing listening / not `tailscale serve`d), ETIMEDOUT
124
+ // (ACL/firewall dropping the connection), or AbortError (15s timeout).
125
+ const e = err;
126
+ const detail = e.cause?.code ?? e.cause?.message ?? e.name;
127
+ console.error(`WARN: Tempo query unreachable [${url}] — ${e.message}: ${detail} — PROCESSED set unknowable; NOT flagging drops this run (avoids false alarms).`);
128
+ return null;
129
+ }
130
+ if (!res.ok) {
131
+ console.error(`WARN: Tempo query HTTP ${res.status} — PROCESSED set unknowable; treating as Tempo-unknown (true no-op this run).`);
132
+ return null;
133
+ }
134
+ const parsed = parseProcessedFromTempo(await res.json());
135
+ // Truncation is a Tempo problem too: an incomplete PROCESSED set reads as
136
+ // missing receipts → false drops. receiptsIfComplete() returns null when the
137
+ // result hit the limit, so it's handled identically to unreachable/HTTP-error.
138
+ const receipts = receiptsIfComplete(parsed, TEMPO_LIMIT);
139
+ if (receipts === null) {
140
+ console.error(`WARN: Tempo returned ${parsed.traceCount} >= limit ${TEMPO_LIMIT} — PROCESSED set may be truncated (Pattern A: a truncated set reads as missing receipts → false drops). Treating as Tempo-unknown (true no-op this run); narrow LOOKBACK_MIN or raise TEMPO_LIMIT.`);
141
+ }
142
+ return receipts;
143
+ }
144
+ async function main() {
145
+ const nowMs = Date.now();
146
+ const processed = await fetchProcessed(nowMs);
147
+ if (processed === null) {
148
+ // Tempo problem (unreachable / HTTP error / truncated) — the PROCESSED set
149
+ // is UNKNOWABLE, NOT "zero drops". Emit tempo_ok=false; the workflow gates
150
+ // BOTH its open AND its self-close steps on tempo_ok==true, so this is a
151
+ // TRUE no-op: incidents are left exactly as they are (never false-OPEN on a
152
+ // truncated set, never false-CLOSE a real incident on a transient outage).
153
+ console.error('WARN: PROCESSED set unknowable this run — emitting tempo_ok=false (no open, no close).');
154
+ emit({ tempoOk: false, deliveredOk: true, dropsCount: 0, inFlightCount: 0, dropsJson: '[]' });
155
+ return;
156
+ }
157
+ const { routes: delivered, truncated } = fetchDelivered(nowMs);
158
+ if (truncated) {
159
+ // DELIVERED set unknowable (truncated) — like a Tempo problem, NOT "zero
160
+ // drops". Emit delivered_ok=false so the workflow's open AND self-close
161
+ // steps both no-op this run (each gated on tempo_ok && delivered_ok).
162
+ emit({ tempoOk: true, deliveredOk: false, dropsCount: 0, inFlightCount: 0, dropsJson: '[]' });
163
+ return;
164
+ }
165
+ const result = reconcile(delivered, processed, { nowMs, openThresholdMs: OPEN_THRESHOLD_MS, sinceMs: SINCE_MS });
166
+ const dropsJson = JSON.stringify(result.drops);
167
+ console.error(`reconcile: delivered=${result.deliveredCount} processed=${result.processedCount} ` +
168
+ `drops=${result.drops.length} in_flight=${result.inFlight.length}` +
169
+ (SINCE_MS ? ` (since=${new Date(SINCE_MS).toISOString()} — pre-deployment routes excluded)` : ''));
170
+ if (result.drops.length > 0)
171
+ console.error(`DROPS: ${dropsJson}`);
172
+ emit({ tempoOk: true, deliveredOk: true, dropsCount: result.drops.length, inFlightCount: result.inFlight.length, dropsJson });
173
+ }
174
+ function emit(o) {
175
+ const out = process.env['GITHUB_OUTPUT'];
176
+ if (!out)
177
+ return;
178
+ appendFileSync(out, `tempo_ok=${o.tempoOk}\ndelivered_ok=${o.deliveredOk}\ndrops_count=${o.dropsCount}\nin_flight_count=${o.inFlightCount}\ndrops_json=${o.dropsJson}\n`);
179
+ }
180
+ main().catch((err) => {
181
+ console.error(`Fatal: ${err instanceof Error ? err.message : String(err)}`);
182
+ process.exit(1);
183
+ });
184
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/reconciler/run.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,SAAS,EAA8C,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB;;;;;;+DAM+D;AAC/D,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,GAAW,EAAU,EAAE;IACnD,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/E,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AACtE,MAAM,KAAK,GAAG,MA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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundnuty/macf",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "description": "Multi-Agent Coordination Framework CLI — coordinate Claude Code agents via GitHub. Installs as `macf` binary; use `macf init` to set up an agent workspace, `macf update` to refresh rules + version pins.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "test:watch": "vitest"
36
36
  },
37
37
  "dependencies": {
38
- "@groundnuty/macf-core": "0.2.35",
38
+ "@groundnuty/macf-core": "0.2.36",
39
39
  "commander": "^14.0.3",
40
40
  "reflect-metadata": "^0.2.2",
41
41
  "zod": "^4.0.0"
@@ -115,6 +115,27 @@ The rules here are topology-agnostic: they work whether the project uses a scien
115
115
 
116
116
  4. **Concise comments** — 1-3 sentences unless detail is needed.
117
117
 
118
+ 5. **Inbound review requests are action asks that block the requester — not status FYIs.** Issue Lifecycle rule 2 covers the implementer's OUTBOUND queue ("work through your assigned-label queue without prompting"). This rule covers the symmetric REVIEWER-side INBOUND obligation, which is just as load-bearing and far easier to strand.
119
+
120
+ **(a) Treat "PR ready: #N" / "ready for review" as a request that blocks the peer's next move.** When a peer posts a review-request comment on a thread, that is not an informational status update you can note-and-defer — it is an action ask directed at you. The LGTM/merge-gate makes this structural: per `pr-discipline.md`, a peer's PR cannot merge without a reviewer's **formal approval** (`gh pr review --approve`), so until you review, the peer is blocked. Not slowed — blocked, and silently, because nothing on their side surfaces "my reviewer never saw this." A stranded review request stalls the peer indefinitely. Pick it up, review honestly, and submit a formal approve / request-changes (not a plain comment — see `pr-discipline.md §"How to submit LGTM"`; only the formal state-change fires the reviewer-notification routing).
121
+
122
+ **(b) Run an INBOUND review-sweep before declaring idle — especially after surfacing from a long single-threaded task.** Before you say "caught up" / "nothing pending" / "your call" / go idle, sweep your repos for review requests addressed to you. This matters most right after you surface from a deep, single-threaded arc (a long workflow, a multi-step investigation): while you were heads-down on one thread, a review request can have arrived on another and been easy to miss.
123
+
124
+ # Peer-authored PRs awaiting YOUR review (review not yet given):
125
+ for r in <your-repos>; do
126
+ gh pr list --repo "$r" --state open \
127
+ --json number,author,reviewDecision,title \
128
+ --jq '.[] | select(.reviewDecision == "REVIEW_REQUIRED" or .reviewDecision == null)
129
+ | select(.author.login != "<your-login>")'
130
+ done
131
+ # Plus: open threads where you were @mentioned and haven't replied.
132
+
133
+ (The query intentionally surfaces *any* peer-authored PR lacking a review, not only those that formally requested you by name — on a small fleet that breadth is a feature: it catches a peer blocked on review even when the request didn't route to you. Narrow it with a requested-reviewer filter on a larger fleet.)
134
+
135
+ **Why the sweep is necessary — and why it's mechanism-agnostic.** Routing delivers each notification as a **discrete event at the moment it occurs** — a push to your channel-server, an A2A message — not as a standing inbox you can re-open and re-read later. Once that event has been delivered (or has arrived while you were mid-turn on a different thread), it is not re-presented to you on its own. So a review-request ping that landed while you were deep in another task is gone from the live stream and only recoverable by querying GitHub state directly. This is the **general silent-fallback shape** (see `silent-fallback-hazards.md`): the routing layer reports the ping delivered, but "delivered" does not guarantee "processed by the recipient," and nothing surfaces the gap until the blocked peer escalates. The sweep is the result-invariant check at the reviewer boundary — assert against GitHub state ("are there peer PRs awaiting my review?") rather than trusting that you'd remember every ping that flowed past.
136
+
137
+ **Verified motivation:** three operator-surfaced stalls where a peer's review request sat idle (42 min in one case; ~2.5 h in another) because the reviewer went idle without sweeping — the ping had arrived during a long single-threaded task and was never picked back up. In each case the peer's PR was blocked the entire time on a formal approval that never came.
138
+
118
139
  ---
119
140
 
120
141
  ## When You're Stuck — Escalation
@@ -160,19 +181,7 @@ The goal is correctness through dialogue, not compliance.
160
181
 
161
182
  ---
162
183
 
163
- ## Submitting a Prompt to a Claude Code TUI (tmux)
164
-
165
- When a hook or script needs to programmatically submit a prompt to a Claude Code TUI running in tmux, **always use the canonical helper**:
166
-
167
- .claude/scripts/tmux-send-to-claude.sh <session-or-empty> "<prompt text>"
168
-
169
- Pass `""` for the session to target the current pane.
170
-
171
- **Never** call `tmux send-keys "<prompt>" Enter` inline. Claude Code's TUI is in multi-line input mode by default, so a single Enter inserts a newline instead of submitting — the prompt sits in the buffer unsubmitted. The helper handles the submit-quirk correctly: clear existing input with `C-u`, send the text with a first Enter, sleep 1 second (load-bearing — without it tmux batches both Enters and Claude processes them atomically as "newline + newline"), then send a second Enter that actually submits.
172
-
173
- The helper is distributed to every agent workspace by `macf init` and refreshed by `macf update` (same mechanism as this rules file). If you're writing a new hook or automation that needs to prompt Claude, use the helper — do not re-implement the pattern.
174
-
175
- ### Canonical tmux launch pattern
184
+ ## Canonical tmux launch pattern
176
185
 
177
186
  **One session per agent, named `<project>@<agent>`.** Post-v0.2.10, `claude.sh` self-wraps in tmux with this naming structurally — bare `./claude.sh` produces the canonical session. Pre-v0.2.10 consumers (and operators wanting manual launch) use the explicit form:
178
187
 
@@ -117,6 +117,8 @@ Per `groundnuty/macf#244` + `#272`, this rule is enforced by a Claude Code PreTo
117
117
 
118
118
  The hook is the same shape as `check-gh-token.sh` (#140 attribution-trap defense) — bash command-type hook distributed via `macf init` / `macf update` / `macf rules refresh` to every workspace's `.claude/scripts/check-mention-routing.sh` with the entry registered in `.claude/settings.json` `hooks.PreToolUse`. Substrate workspaces, tester agents, CV consumers, and future MACF-consumer projects all get the protection uniformly.
119
119
 
120
+ Because the hook is registered as a path-invocation (`"command": "$CLAUDE_PROJECT_DIR/.claude/scripts/check-mention-routing.sh"`), Claude Code execs the script fresh on every event, so a change to the **script body** goes live on the very next event as soon as the file is synced on disk — a `macf update` that updates the script is immediately in force for consumers with no session relaunch and no relaunch-coordination needed. Only a change to the hook **registration** in `.claude/settings.json` (or to the launch environment) requires a relaunch to take effect.
121
+
120
122
  **Heuristic** (subject to refinement; documented for transparency):
121
123
 
122
124
  - Already wrapped in backticks (`` `@<bot>[bot]` ``) → routing-suppressed; allowed (canonical describing form §5); does NOT count toward Check A
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Workspaces without full `macf init`** (e.g. `groundnuty/macf` itself, or any Claude Code workspace operated by a bot that isn't a MACF-registered agent) can still get this canonical rule via `macf rules refresh --dir <workspace>`. Same copy, no App credentials or registry required.
6
6
 
7
- This rule names the CLASS so agents recognize the shape on first encounter rather than re-discovering each instance from scratch. Nine specific instances are documented below as worked examples spanning different architectural layers (identity, parsing, TUI binding, observability routing, config substitution, multi-agent coordination protocol, metric-instrumentation lifecycle, observability-endpoint routing, release-pipeline-partial-publish). Seven of nine have structural defenses applied or in flight — the pattern of defense generalizes alongside the pattern of hazard.
7
+ This rule names the CLASS so agents recognize the shape on first encounter rather than re-discovering each instance from scratch. Ten active instances are documented below as worked examples spanning different architectural layers (identity, parsing, TUI binding, observability routing, config substitution, multi-agent coordination protocol, metric-instrumentation lifecycle, observability-endpoint routing, release-pipeline-partial-publish, third-party-action retry-exhaustion). (Instance 10 — a legacy substrate-routing receipt-gap — was retired 2026-06-07; its number is kept, not reused.) Nine of ten active instances have structural defenses applied or in flight — the pattern of defense generalizes alongside the pattern of hazard.
8
8
 
9
9
  Instance 9 is annotated as **sister-shape** (failure correctly surfaced + partial side-effect breaks retry idempotency) — listed here for cross-reference convenience but warrants a sibling canonical rule (`partial-side-effect-hazards.md`) if more instances surface. The two classes share "multi-step pipeline where consumer assumes atomicity" but the failure surface differs: silent-fallback hides at the API boundary; partial-side-effect surfaces loudly but persists semi-state.
10
10
 
@@ -23,7 +23,7 @@ The trap is that defensive programming targets exit codes, but exit-code success
23
23
 
24
24
  ---
25
25
 
26
- ## Nine known instances
26
+ ## Known instances
27
27
 
28
28
  ### Instance 1 — gh-token attribution traps
29
29
 
@@ -51,10 +51,10 @@ This is a distinct sub-case from the missing-helper / mis-pipefail / wrong-prefi
51
51
  **Failure shape:** `tmux send-keys` exits 0 + keystrokes are written to pane stdin, but Claude Code's input handler is bound to a different IPC channel (RC's SDK socket); routing-via-tmux silently bypasses the actual input path → recipient never sees the routed prompt.
52
52
  **Recurrence:** Cross-agent triangulated; 2+ confirmed firings on real routes hours apart, same shape.
53
53
  **Defense status:** Two-tier per fleet class:
54
- - **Consumer fleet** (CV agents, tester agents, future macf-init'd consumers): structurally retired via Stage 3 channel-server primitive (HTTP POST bypasses tmux layer entirely). Operational as of DR-020 / macf-actions v3+.
54
+ - **Consumer fleet** (CV agents, tester agents, future macf-init'd consumers): largely mitigated, not fully eliminated. The routed **message** arrives via the channel-server's HTTP/MCP path (not as a keystroke), so the prompt *content* reaches the agent regardless of RC state — that's the structural win over send-keys routing (DR-020 / macf-actions v3+). The **residual**: the channel-server's `wakeViaTmux` nudge still uses send-keys, so under RC-bound input the auto-wake keystroke may not land — the message sits in the MCP channel until the agent next reads it, rather than being lost. So the hazard is reduced to a wake-latency issue, not a content-drop.
55
55
  - **Substrate fleet** (workspaces operated as the design surface, not registered MACF consumers): permanent operational reality — substrate workspaces don't run `macf init`. Defensive posture: rule-discipline + Pattern C fragility detector (`tmux display -p '#{session_activity}'` doesn't advance under RC-bound input).
56
56
 
57
- The structural retirement applies to consumer fleet only; substrate fleet expects Instance 3 firings to recur on routes indefinitely; rule-discipline catches the failure at observation time, not pre-emptively.
57
+ The content-drop is retired for the consumer fleet (message arrives via HTTP/MCP); only the wake-nudge residual remains there. The substrate fleet expects full Instance 3 firings to recur on routes indefinitely; rule-discipline catches the failure at observation time, not pre-emptively.
58
58
 
59
59
  ### Instance 4 — Loki / ClickHouse-logs pipeline divergence (label-vs-structured-metadata)
60
60
 
@@ -163,6 +163,44 @@ Both classes share "multi-step pipeline where consumer assumes atomicity" but th
163
163
 
164
164
  **Codification rationale:** 3 instances across 2 trigger mechanisms + defense pattern stable + operator-witnessed across 2 calendar days (2026-05-18 + 2026-05-19) + cross-agent (instance 1 via science-agent's authoring; instances 2/3 via code-agent's release-cut workflow) — meets all four "When to add a new instance" criteria. The sister-class question (separate `partial-side-effect-hazards.md` canonical rule) is acknowledged inline + deferred to the 5-instance threshold per rule-promotion convention.
165
165
 
166
+ ### Instance 10 — retired (legacy substrate-routing receipt-gap)
167
+
168
+ Documented a send-logged ≠ received gap on the legacy Stage-2 substrate routing last-mile, a path the macf **product** does not use: consumers route via the channel-server / A2A path, whose `notify_received` / `mcp_pushed` + OTel receipt spans (`macf.mcp.push`, `macf.tmux_wake.deliver`) already capture receipt. Removed from canonical 2026-06-07 — legacy-routing operational detail belongs in substrate workbench + git history, not the product rules. The number is retained (not reused) to keep Instances 1–9 + 11 stable as identifiers.
169
+
170
+ ---
171
+
172
+ ### Instance 11 — Third-party retry-wrapping action exits 0 on internal retry-exhaustion (connect-failure masked as step-success)
173
+
174
+ **Surface:** any consumer-CI step that delegates a connect/auth handshake to a third-party GitHub Action (or wrapper tool) that owns its own internal retry loop — tailnet join (`tailscale/github-action`), OTLP collector connect, cloud-provider auth (`aws-actions/configure-aws-credentials`, `google-github-actions/auth`), registry login, etc. The action retries internally and reports a single aggregate exit code for the step.
175
+
176
+ **Failure shape:** the wrapped tool fails on EVERY internal retry (a hard error, not a transient one — e.g. an invalid-auth `400` that no amount of retrying can fix), the action **exhausts its retry budget and still exits `0`**, and the workflow continues into a broken state. The connect never happened, but the step is green. The real failure then surfaces far downstream as a *different* problem — every later fetch/query against the resource the step was supposed to make reachable fails, and the symptom (timeout, connection-refused, "endpoint unreachable") points the investigator at the downstream consumer, not at the masked upstream connect. The exit-0 step is the last place anyone looks because it's the one place that reported success.
177
+
178
+ **Recurrence:** First confirmed instance — groundnuty/macf#461 (2026-06-07). The e2e workflow's `tailscale/github-action` step was configured with `tags: tag:ci`, but the OAuth client + ACL only permit `tag:ci-runner`. `tailscale up` returned `Status 400 "requested tags [tag:ci] are invalid or not permitted"` on all 5 internal retries; the action exited `0`; the runner never joined the tailnet; every subsequent tailnet fetch failed, presenting as a generic **"Tempo query unreachable."** Because the connect step was *green*, it was the last place examined — the diagnosis cycled through transient-retry, Tempo-serve-config, and DNS-vs-IP hypotheses until reading the connect step's **actual output** (not its exit code) surfaced the `400`. (Two *genuinely separate* upstream bugs — a devbox/Nix-install step-ordering fault [#460] and the Tempo query port not being tailnet-exposed [devops-toolkit #88] — were correctly diagnosed and landed first; they were real fixes, not projections of this masked failure. The exit-0 masking is what hid *this* failure for an extra diagnostic cycle even after those two were resolved.)
179
+
180
+ **Distinct from the sister GHA-surface instances** — do NOT fold this into Instance 5 or Instance 8:
181
+
182
+ | Aspect | Instance 5 (secrets-misnamed) | Instance 8 (OTLP endpoint silent-drop) | Instance 11 (this) |
183
+ |---|---|---|---|
184
+ | Where the lie originates | empty-string substitution at `${{ }}` expansion, BEFORE the tool runs | exporter silently retries-then-drops, no exit code surfaced at all | third-party action runs, fails every retry, then **exits `0` reporting success** |
185
+ | What's wrong | a required input is missing/renamed | a long-lived process points at a dead endpoint | a connect handshake hard-fails but its wrapper claims success |
186
+ | Downstream disguise | misleading auth error at the *consuming* step | empty observability surface, no failure signal anywhere | masquerades as a *different* downstream problem (here: "Tempo unreachable") |
187
+
188
+ Instance 5 is "the input was never there"; Instance 8 is "the data went into a void with no signal"; Instance 11 is "the connection step actively *reported success* while having hard-failed." All three live on the GitHub-Actions / CI-plumbing surface but the trust boundary that breaks differs — Instance 11's is specifically *a third party's exit code about its own retry exhaustion*. The tailscale case above is just the worked example: any consumer CI that wraps a connect/auth in a retrying action (tailnet, OTLP, cloud-auth, registry-login) is exposed to the same shape.
189
+
190
+ **Defense status:** SHIPPED (Pattern A result-invariant assert, with a Pattern D precheck flavor) — a **"Verify <resource> is up" step placed immediately after the connect step**, asserting the connection's result-invariant and failing LOUD (red job) when it doesn't hold. Never trust a third-party action's exit code as evidence that its own internal retries succeeded — assert the post-connect state directly.
191
+
192
+ ```bash
193
+ # After the tailscale connect step (NOT trusting its exit 0):
194
+ tailscale status --json | jq -e '.BackendState == "Running"' >/dev/null \
195
+ || { echo "::error::tailnet did not come up — tailscale BackendState != Running."; \
196
+ echo "::error::The connect action may have exhausted retries and exited 0 anyway"; \
197
+ echo "::error::(e.g. tag/ACL mismatch returns Status 400 on every retry)."; \
198
+ tailscale status || true; exit 1; }
199
+ echo "✓ tailnet up (BackendState=Running)"
200
+ ```
201
+
202
+ Generalizes to any retry-wrapping action: assert the result-invariant the connect was *supposed to establish* — `BackendState == "Running"` for a tailnet, a successful authenticated probe for cloud-auth, a `200` from the collector's health endpoint for OTLP — in a dedicated step right after the connect, before any downstream consumer runs. This converts a far-downstream misdiagnosis (the 3-hop red-herring chase in #461) into a fail-at-the-boundary red job pointing directly at the broken connect.
203
+
166
204
  ---
167
205
 
168
206
  ## How to recognize the class on first encounter
@@ -306,7 +344,7 @@ Silent-fallback hazards are **architectural**, not implementation bugs. They eme
306
344
 
307
345
  For coordination-system safety analysis: this is a class of hazards multi-agent systems must explicitly defend against. Each new instance teaches the same lesson; the class-name is what makes the lesson transferable across agents.
308
346
 
309
- ### Defense-pattern emergence (7-of-9 known instances have structural defense applied or shipped)
347
+ ### Defense-pattern emergence (9-of-10 active instances have structural defense applied or shipped)
310
348
 
311
349
  | Instance | Surface | Structural defense | Pattern |
312
350
  |---|---|---|---|
@@ -319,10 +357,11 @@ For coordination-system safety analysis: this is a class of hazards multi-agent
319
357
  | 7 — OTel-counter cumulative-state vs short-lived-process lifecycle | Metric-instrumentation lifecycle | Two-phase: doc workaround `sum(increase(...))` + OTel SDK delta temporality | Pattern A |
320
358
  | 8 — OTLP endpoint silent-drop | Observability-endpoint routing | Five-surface defense: CLI release-discipline + substrate testers env-override + canonical template `:14318` default + cluster-side compat port-map + agent-process `doctor-otel.sh` Pattern A | Pattern A (composite — first multi-architectural-layer case in this rule; instances 1-7 have single-pattern defenses) |
321
359
  | 9 — Sigstore TLOG orphans on failed npm publish (sister-class) | npm publish + sigstore attestation pipeline | Three-defense composite: bump-version recovery (DR-022 Amendment L) + pre-flight registry-collision check (Pattern D analog, macf#380) + TLOG-state observability (devops-toolkit#74+#77 Grafana dashboard live) | Pattern D analog (pre-flight precheck) + recovery-procedure-codification |
360
+ | 11 — Third-party retry-wrapping action exits 0 on retry-exhaustion | Consumer-CI connect/auth via third-party action (tailnet, OTLP, cloud-auth, registry-login) | SHIPPED — "Verify <resource> is up" step immediately after the connect asserts the connection's result-invariant (e.g. `tailscale status` `BackendState == "Running"`) + fails LOUD; never trusts the action's exit code about its own retry exhaustion (macf#461) | Pattern A (post-connect result-invariant assert) + Pattern D flavor (precheck-before-downstream) |
322
361
 
323
- Seven of nine instances have structural defense applied or shipped. Defense patterns (A, B, C, D, E) generalize across instances — they're reusable defense templates, not case-specific fixes. **Pattern A (result-invariant assertion at the boundary) bears the most weight** — it's the structural defense for instances 4, 7, AND 8 (3 of 9), each at a different architectural boundary (logs pipeline, metric counter, observability endpoint). Instance 8's five-surface defense topology (consumer canonical + cluster-side compat port-map + concrete Pattern A impl) demonstrates that structural defense at the observability-pipeline-class can compose across architectural layers — the canonical-distribution layer + the cluster-infrastructure layer + the assertion-script layer all reinforce each other rather than substituting for each other. Instance 9 demonstrates that the Pattern D template generalizes from workflow-secrets-prechecks to release-pipeline-prechecks AND that recovery-procedure-codification (DR-022 Amendment L's bump-version-not-tag-retry) is its own defense category — distinct from detection-pre-merge defenses (Patterns A/B/D) and discrimination-at-receiver defenses (Pattern E).
362
+ Nine of ten active instances have structural defense applied or shipped. Defense patterns (A, B, C, D, E) generalize across instances — they're reusable defense templates, not case-specific fixes. **Pattern A (result-invariant assertion at the boundary) bears the most weight** — it's the structural defense for instances 4, 7, 8, AND 11 (4 of 10), each at a different architectural boundary (logs pipeline, metric counter, observability endpoint, third-party-action connect-verify). Instance 8's five-surface defense topology (consumer canonical + cluster-side compat port-map + concrete Pattern A impl) demonstrates that structural defense at the observability-pipeline-class can compose across architectural layers — the canonical-distribution layer + the cluster-infrastructure layer + the assertion-script layer all reinforce each other rather than substituting for each other. Instance 9 demonstrates that the Pattern D template generalizes from workflow-secrets-prechecks to release-pipeline-prechecks AND that recovery-procedure-codification (DR-022 Amendment L's bump-version-not-tag-retry) is its own defense category — distinct from detection-pre-merge defenses (Patterns A/B/D) and discrimination-at-receiver defenses (Pattern E).
324
363
 
325
- The breadth of layers spanned by 5 different defense patterns (identity, parsing, TUI binding, observability routing, config substitution, multi-agent coordination protocol, metric-instrumentation lifecycle, observability-endpoint routing, release-pipeline-partial-publish) is independent evidence that the hazard CLASS is real. If silent-fallback was a single-instance accident, no defense pattern would emerge. **Pattern A's recurrence across 3 different observability boundaries (logs / metrics / endpoint) is the strongest signal that result-invariant assertion is the load-bearing structural-defense template for the entire observability-pipeline-class** of silent fallback.
364
+ The breadth of layers spanned by 5 different defense patterns (identity, parsing, TUI binding, observability routing, config substitution, multi-agent coordination protocol, metric-instrumentation lifecycle, observability-endpoint routing, release-pipeline-partial-publish, third-party-action retry-exhaustion) is independent evidence that the hazard CLASS is real. If silent-fallback was a single-instance accident, no defense pattern would emerge. **Pattern A's recurrence across 3 different observability boundaries (logs / metrics / endpoint) is the strongest signal that result-invariant assertion is the load-bearing structural-defense template for the entire observability-pipeline-class** of silent fallback.
326
365
 
327
366
  ---
328
367
 
@@ -336,7 +375,7 @@ Add when ALL of the following hold:
336
375
 
337
376
  The class-name is what makes the lesson transferable, not multi-agent witness. A single-agent-confirmed instance with a concrete trace + identified defense pattern is sufficient for canonicalization (instances 4, 5, 7, 8 are all single-agent-confirmed). Cross-agent triangulation strengthens the framing but isn't a precondition.
338
377
 
339
- Add as a new numbered section under "Nine known instances" (will become "Ten known instances" etc.) with the same fields: Surface / Failure shape / Recurrence / Defense status. Increment the intro paragraph's instance count + the Defense-pattern emergence header's `N-of-M known instances` count too.
378
+ Add as a new numbered section (the next number is **12** numbering is append-only; retired instances keep their slot, see Instance 10) with the same fields: Surface / Failure shape / Recurrence / Defense status. Increment the intro paragraph's active-instance count + the Defense-pattern emergence header's `N-of-M active instances` count too.
340
379
 
341
380
  ---
342
381
 
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env bash
2
+ # UserPromptSubmit hook — turn-ack receipt for routed prompts
3
+ # (groundnuty/macf#444 Option D, piece 2).
4
+ #
5
+ # When the router injects a prompt it appends a correlation marker
6
+ # `[macf-route:<run_id>:<agent>]` (macf-actions#45, piece 1). When that prompt
7
+ # is submitted AS A TURN, this hook fires and emits a `turn_processed` OTel
8
+ # span carrying (routed_run_id, agent). A reconciler (piece 4) joins the
9
+ # router's delivered-pairs log against these spans: a delivered route with no
10
+ # matching span past the open-threshold = a dropped ping that surfaces
11
+ # structurally (closes the #437 send≠receipt gap). A prompt with NO marker
12
+ # (a typed prompt, a non-routed turn) is a no-op — exit 0, emit nothing.
13
+ #
14
+ # Registered `async: true` (settings.json) so it never adds turn latency. It
15
+ # NEVER blocks the turn: any failure path exits 0 (with a stderr WARN on a
16
+ # genuine emit error — fail-loud per silent-fallback-hazards.md Instance 8).
17
+ #
18
+ # Dependency: a live OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT — populated on
19
+ # substrate by the #418 launcher OTEL block). Absent/unreachable → curl fails
20
+ # → WARN, no span, no crash. So this ships safely before #418's relaunch; it
21
+ # simply no-ops-with-WARN until substrate OTel is live.
22
+ set -uo pipefail
23
+
24
+ INPUT="$(cat)"
25
+
26
+ # Extract the submitted prompt text. jq if available; else scan the raw payload.
27
+ PROMPT=""
28
+ if command -v jq >/dev/null 2>&1; then
29
+ PROMPT="$(printf '%s' "$INPUT" | jq -r '.prompt // empty' 2>/dev/null || true)"
30
+ fi
31
+ [ -z "$PROMPT" ] && PROMPT="$INPUT"
32
+
33
+ # Route-correlation markers: [macf-route:<digits>:<kebab-agent>]. No match → not
34
+ # a routed prompt → no-op. A COALESCED turn (a busy agent processing several
35
+ # queued routed pings in one turn) carries MULTIPLE markers — emit a receipt for
36
+ # EACH distinct one. A receipt then means "the marked prompt reached the agent",
37
+ # not "a distinct turn happened". (Was `head -1`, which under-emitted → the
38
+ # macf#444 reconciler false-flagged the un-receipted markers as drops — #462.)
39
+ MARKERS="$(printf '%s' "$PROMPT" | grep -oE '\[macf-route:[0-9]+:[a-z0-9-]+\]' | sort -u || true)"
40
+ [ -z "$MARKERS" ] && exit 0
41
+
42
+ # Need curl + openssl to emit; absent → degrade silently (no span, no noise).
43
+ command -v curl >/dev/null 2>&1 || exit 0
44
+ command -v openssl >/dev/null 2>&1 || exit 0
45
+
46
+ BASE="${OTEL_EXPORTER_OTLP_ENDPOINT:-http://127.0.0.1:14318}"
47
+ BASE="${BASE%/v1/traces}"
48
+
49
+ # One independent span per distinct marker (own trace/span id + timestamp).
50
+ printf '%s\n' "$MARKERS" | while IFS= read -r MARKER; do
51
+ [ -z "$MARKER" ] && continue
52
+ RUN_ID="$(printf '%s' "$MARKER" | sed -E 's/.*\[macf-route:([0-9]+):([a-z0-9-]+)\].*/\1/')"
53
+ AGENT="$(printf '%s' "$MARKER" | sed -E 's/.*\[macf-route:([0-9]+):([a-z0-9-]+)\].*/\2/')"
54
+
55
+ # Nanosecond epoch. `date +%s%N` is GNU-only (substrate is Linux); on a BSD/mac
56
+ # date that prints a literal `N`, fall back to seconds×1e9.
57
+ NOW="$(date +%s%N 2>/dev/null || true)"
58
+ case "$NOW" in
59
+ *N|'' ) NOW="$(( $(date +%s) * 1000000000 ))" ;;
60
+ esac
61
+ TID="$(openssl rand -hex 16)"
62
+ SID="$(openssl rand -hex 8)"
63
+
64
+ # Identity on resource attrs (matches the collector's resource/paper-dims +
65
+ # the `{resource."gen_ai.agent.name"=…}` TraceQL); correlation on span attrs.
66
+ curl -sf -m 3 -X POST "${BASE}/v1/traces" \
67
+ -H 'Content-Type: application/json' --data-binary @- <<JSON >/dev/null \
68
+ || echo "WARN: turn_processed span emit failed (endpoint=${BASE}/v1/traces run=${RUN_ID} agent=${AGENT})" >&2
69
+ {"resourceSpans":[{"resource":{"attributes":[
70
+ {"key":"service.name","value":{"stringValue":"${OTEL_SERVICE_NAME:-macf-agent}"}},
71
+ {"key":"gen_ai.agent.name","value":{"stringValue":"${AGENT}"}},
72
+ {"key":"service.namespace","value":{"stringValue":"macf"}}
73
+ ]},"scopeSpans":[{"scope":{"name":"macf.hook"},"spans":[{
74
+ "traceId":"${TID}","spanId":"${SID}","name":"turn_processed","kind":1,
75
+ "startTimeUnixNano":"${NOW}","endTimeUnixNano":"${NOW}",
76
+ "attributes":[{"key":"routed_run_id","value":{"stringValue":"${RUN_ID}"}},
77
+ {"key":"agent","value":{"stringValue":"${AGENT}"}}],"status":{"code":1}}]}]}]}
78
+ JSON
79
+ done
80
+
81
+ exit 0