@groundnuty/macf 0.2.35 → 0.2.37

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 (105) hide show
  1. package/dist/.build-info.json +2 -2
  2. package/dist/cli/claude-sh.d.ts +12 -10
  3. package/dist/cli/claude-sh.d.ts.map +1 -1
  4. package/dist/cli/claude-sh.js +26 -13
  5. package/dist/cli/claude-sh.js.map +1 -1
  6. package/dist/cli/commands/certs.js +3 -3
  7. package/dist/cli/commands/certs.js.map +1 -1
  8. package/dist/cli/commands/init.d.ts.map +1 -1
  9. package/dist/cli/commands/init.js +10 -0
  10. package/dist/cli/commands/init.js.map +1 -1
  11. package/dist/cli/commands/monitor.d.ts +16 -0
  12. package/dist/cli/commands/monitor.d.ts.map +1 -0
  13. package/dist/cli/commands/monitor.js +96 -0
  14. package/dist/cli/commands/monitor.js.map +1 -0
  15. package/dist/cli/commands/propose.d.ts +21 -0
  16. package/dist/cli/commands/propose.d.ts.map +1 -0
  17. package/dist/cli/commands/propose.js +128 -0
  18. package/dist/cli/commands/propose.js.map +1 -0
  19. package/dist/cli/commands/rules-refresh.d.ts +1 -0
  20. package/dist/cli/commands/rules-refresh.d.ts.map +1 -1
  21. package/dist/cli/commands/rules-refresh.js +22 -1
  22. package/dist/cli/commands/rules-refresh.js.map +1 -1
  23. package/dist/cli/commands/update.d.ts.map +1 -1
  24. package/dist/cli/commands/update.js +23 -2
  25. package/dist/cli/commands/update.js.map +1 -1
  26. package/dist/cli/env-files-update.d.ts.map +1 -1
  27. package/dist/cli/env-files-update.js +5 -1
  28. package/dist/cli/env-files-update.js.map +1 -1
  29. package/dist/cli/env-files.d.ts +38 -13
  30. package/dist/cli/env-files.d.ts.map +1 -1
  31. package/dist/cli/env-files.js +73 -14
  32. package/dist/cli/env-files.js.map +1 -1
  33. package/dist/cli/index.js +109 -0
  34. package/dist/cli/index.js.map +1 -1
  35. package/dist/cli/monitor/digest.d.ts +89 -0
  36. package/dist/cli/monitor/digest.d.ts.map +1 -0
  37. package/dist/cli/monitor/digest.js +232 -0
  38. package/dist/cli/monitor/digest.js.map +1 -0
  39. package/dist/cli/monitor/github-reader.d.ts +38 -0
  40. package/dist/cli/monitor/github-reader.d.ts.map +1 -0
  41. package/dist/cli/monitor/github-reader.js +65 -0
  42. package/dist/cli/monitor/github-reader.js.map +1 -0
  43. package/dist/cli/monitor/reflections.d.ts +18 -0
  44. package/dist/cli/monitor/reflections.d.ts.map +1 -0
  45. package/dist/cli/monitor/reflections.js +72 -0
  46. package/dist/cli/monitor/reflections.js.map +1 -0
  47. package/dist/cli/monitor/run.d.ts +30 -0
  48. package/dist/cli/monitor/run.d.ts.map +1 -0
  49. package/dist/cli/monitor/run.js +67 -0
  50. package/dist/cli/monitor/run.js.map +1 -0
  51. package/dist/cli/project-rules.d.ts +105 -0
  52. package/dist/cli/project-rules.d.ts.map +1 -0
  53. package/dist/cli/project-rules.js +305 -0
  54. package/dist/cli/project-rules.js.map +1 -0
  55. package/dist/cli/propose/candidates.d.ts +95 -0
  56. package/dist/cli/propose/candidates.d.ts.map +1 -0
  57. package/dist/cli/propose/candidates.js +117 -0
  58. package/dist/cli/propose/candidates.js.map +1 -0
  59. package/dist/cli/propose/invariants.d.ts +49 -0
  60. package/dist/cli/propose/invariants.d.ts.map +1 -0
  61. package/dist/cli/propose/invariants.js +154 -0
  62. package/dist/cli/propose/invariants.js.map +1 -0
  63. package/dist/cli/propose/proposal-writer.d.ts +33 -0
  64. package/dist/cli/propose/proposal-writer.d.ts.map +1 -0
  65. package/dist/cli/propose/proposal-writer.js +53 -0
  66. package/dist/cli/propose/proposal-writer.js.map +1 -0
  67. package/dist/cli/propose/report.d.ts +49 -0
  68. package/dist/cli/propose/report.d.ts.map +1 -0
  69. package/dist/cli/propose/report.js +227 -0
  70. package/dist/cli/propose/report.js.map +1 -0
  71. package/dist/cli/propose/run.d.ts +41 -0
  72. package/dist/cli/propose/run.d.ts.map +1 -0
  73. package/dist/cli/propose/run.js +62 -0
  74. package/dist/cli/propose/run.js.map +1 -0
  75. package/dist/cli/settings-writer.d.ts +87 -6
  76. package/dist/cli/settings-writer.d.ts.map +1 -1
  77. package/dist/cli/settings-writer.js +141 -6
  78. package/dist/cli/settings-writer.js.map +1 -1
  79. package/dist/reconciler/parse-delivered.d.ts +32 -0
  80. package/dist/reconciler/parse-delivered.d.ts.map +1 -0
  81. package/dist/reconciler/parse-delivered.js +18 -0
  82. package/dist/reconciler/parse-delivered.js.map +1 -0
  83. package/dist/reconciler/parse-processed.d.ts +57 -0
  84. package/dist/reconciler/parse-processed.d.ts.map +1 -0
  85. package/dist/reconciler/parse-processed.js +41 -0
  86. package/dist/reconciler/parse-processed.js.map +1 -0
  87. package/dist/reconciler/reconcile.d.ts +130 -0
  88. package/dist/reconciler/reconcile.d.ts.map +1 -0
  89. package/dist/reconciler/reconcile.js +119 -0
  90. package/dist/reconciler/reconcile.js.map +1 -0
  91. package/dist/reconciler/run.d.ts +23 -0
  92. package/dist/reconciler/run.d.ts.map +1 -0
  93. package/dist/reconciler/run.js +273 -0
  94. package/dist/reconciler/run.js.map +1 -0
  95. package/package.json +2 -2
  96. package/plugin/rules/coordination.md +22 -13
  97. package/plugin/rules/gh-token-attribution-traps.md +4 -0
  98. package/plugin/rules/mention-routing-hygiene.md +2 -0
  99. package/plugin/rules/observability-wiring.md +3 -3
  100. package/plugin/rules/reflection-staging.md +65 -0
  101. package/plugin/rules/silent-fallback-hazards.md +64 -8
  102. package/scripts/check-auditor-never-acts.sh +167 -0
  103. package/scripts/check-gh-attribution.sh +230 -0
  104. package/scripts/emit-turn-receipt.sh +81 -0
  105. package/scripts/harvest-reflection.sh +125 -0
@@ -80,6 +80,69 @@ 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
+ * Auditor-never-acts hook command (groundnuty/macf#499 — DR-026 F1). Blocks
85
+ * state-mutating `gh` ops (`gh pr merge` / `gh issue close` / `gh pr close`)
86
+ * when the active identity is the auditor (`MACF_AGENT_ROLE=auditor`), while
87
+ * leaving the propose verbs (`gh issue/pr create|comment`) untouched. For every
88
+ * NON-auditor identity the hook is inert (`exit 0` before any parsing), so
89
+ * fleet-wide distribution via `macf init` / `macf update` is a no-op everywhere
90
+ * except the auditor.
91
+ *
92
+ * Why structural and not permission-based: a GitHub App's `pull_requests:write`
93
+ * grants merge+close TOGETHER with open-PR — there is no "open-a-PR-but-not-
94
+ * merge" scope to express the auditor's write-proposals-only boundary, so it
95
+ * must be enforced at tool-call time. Sister to the #140 / #244+#272 / #270 /
96
+ * #431 PreToolUse hooks; override via MACF_SKIP_AUDITOR_ACT_CHECK=1.
97
+ */
98
+ export const MACF_AUDITOR_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/check-auditor-never-acts.sh';
99
+ /**
100
+ * The UserPromptSubmit turn-ack receipt hook (groundnuty/macf#444 Option D,
101
+ * piece 2). When the router injects a prompt carrying the correlation marker
102
+ * `[macf-route:<run_id>:<agent>]` (macf-actions piece 1), this hook fires on
103
+ * submit and emits a `turn_processed` OTel span — making a routed ping that
104
+ * BECAME A TURN observable, so a dropped one surfaces as a missing span
105
+ * (closes the #437 send≠receipt gap). Unlike the PreToolUse `check-*` hooks
106
+ * this is NOT a blocker (it observes, never `exit 2`s) and is registered
107
+ * `async: true` so it adds no turn latency. No-op on non-routed prompts.
108
+ */
109
+ export const MACF_TURN_RECEIPT_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/emit-turn-receipt.sh';
110
+ /**
111
+ * Attribution-result PostToolUse hook command (groundnuty/macf#489). After a
112
+ * `gh`-write Bash op (`gh issue/pr comment`, `gh issue/pr create`,
113
+ * `gh issue/pr close --comment`), this hook reads the just-written resource
114
+ * back from GitHub and warns LOUDLY (PostToolUse `exit 2`) if it was authored
115
+ * by the operator's USER account rather than the bot — the silent-fallback
116
+ * Instance-12 attribution trap. It is the result-invariant backstop to the
117
+ * #140 PreToolUse `check-gh-token.sh`: that one catches the missing-bot-token
118
+ * shape BEFORE the call; this one catches a slipped write AFTER the fact.
119
+ *
120
+ * PostToolUse CANNOT block (the tool already ran), so this is registered on
121
+ * the `PostToolUse` event (matcher `Bash`), NOT `PreToolUse`. Fail-open:
122
+ * every uncertain branch in the script exits 0; only a CONFIRMED
123
+ * user-authored write fires `exit 2`. Override: MACF_SKIP_ATTRIBUTION_CHECK=1.
124
+ */
125
+ export const MACF_ATTRIBUTION_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/check-gh-attribution.sh';
126
+ /**
127
+ * Reflection-harvest PreCompact hook command (groundnuty/macf#500 — DR-026 F2).
128
+ * At compaction (auto OR manual `/compact`), this hook harvests the agent's
129
+ * *staged* reflection (`.claude/.macf/reflections/pending.json`, maintained
130
+ * incrementally per `reflection-staging.md`), wraps it in the versioned
131
+ * reflection-schema envelope (`@groundnuty/macf-core` `ReflectionRecordSchema`),
132
+ * appends it as one line to a local per-session JSONL ledger, and clears the
133
+ * stage. F4's Monitor reads the ledger back.
134
+ *
135
+ * It runs on the `PreCompact` event (matcher-less, like SessionStart / Stop /
136
+ * UserPromptSubmit). Per DR-023 §UC-3 it is observational + NON-BLOCKING: the
137
+ * script ALWAYS `exit 0` (even on internal error) so it can never delay/block
138
+ * compaction. Fast + local; no network. Override: MACF_SKIP_REFLECTION_HARVEST=1.
139
+ *
140
+ * Distinct from the plugin's existing PreCompact `checkpoint_to_memory`
141
+ * mcp_tool entry (DR-023 §UC-3 session-checkpoint): that ships via the plugin
142
+ * `hooks.json` mcp_tool path; THIS is a bash command-type hook installed into
143
+ * settings.json — both can coexist on the PreCompact event.
144
+ */
145
+ export const MACF_REFLECTION_HOOK_COMMAND = '$CLAUDE_PROJECT_DIR/.claude/scripts/harvest-reflection.sh';
83
146
  /**
84
147
  * The hook filenames used to identify MACF-managed entries on refresh.
85
148
  * Matched by path-end equality (see isMacfManagedCommand) so operator
@@ -90,6 +153,10 @@ const MACF_HOOK_FILENAMES = [
90
153
  'check-mention-routing.sh',
91
154
  'check-lgtm-gate.sh',
92
155
  'check-close-keyword.sh',
156
+ 'check-auditor-never-acts.sh',
157
+ 'emit-turn-receipt.sh',
158
+ 'check-gh-attribution.sh',
159
+ 'harvest-reflection.sh',
93
160
  ];
94
161
  /**
95
162
  * True iff the command string represents one of our managed hooks — i.e.
@@ -600,16 +667,34 @@ export function installPluginSkillPermissions(workspaceDir) {
600
667
  * - `check-close-keyword.sh` (groundnuty/macf#431 — blocks `gh pr
601
668
  * create`/`edit` that would auto-close another agent's issue via a
602
669
  * close-keyword adjacent to its ref)
670
+ * - `check-auditor-never-acts.sh` (groundnuty/macf#499 — DR-026 F1; when
671
+ * `MACF_AGENT_ROLE=auditor`, blocks state-mutating `gh pr merge` /
672
+ * `gh issue close` / `gh pr close`; inert for every non-auditor identity)
673
+ *
674
+ * Plus, on the PostToolUse event:
675
+ * - `check-gh-attribution.sh` (groundnuty/macf#489 — after a `gh`-write
676
+ * op, reads the resource back from GitHub and warns (`exit 2`) if it
677
+ * was authored by the operator's user account instead of the bot;
678
+ * the result-invariant backstop to the #140 PreToolUse token check)
679
+ *
680
+ * And, on the UserPromptSubmit event:
681
+ * - `emit-turn-receipt.sh` (groundnuty/macf#444 — async turn-ack span)
682
+ *
683
+ * And, on the PreCompact event:
684
+ * - `harvest-reflection.sh` (groundnuty/macf#500 — DR-026 F2; at compaction,
685
+ * harvests the agent's staged reflection into a local JSONL ledger. Matcher-
686
+ * less + NON-BLOCKING; operator-authored PreCompact hooks are preserved)
603
687
  *
604
688
  * Creates the `.claude/` directory and the file if either is missing.
605
689
  * Idempotent: repeated calls don't duplicate entries.
606
690
  *
607
- * All hooks share `matcher: "Bash"` because Claude Code's matcher field
608
- * gates which tool fires the hook; the wrapped-command detection (gh vs
609
- * git-push for token, gh issue/pr comment for routing, gh pr merge for
610
- * LGTM) happens INSIDE each script. Distinct entries per script keep
611
- * them independently upgradeable + diagnosable in `gh issue list` style
612
- * settings audits.
691
+ * The PreToolUse + PostToolUse hooks share `matcher: "Bash"` because Claude
692
+ * Code's matcher field gates which tool fires the hook; the wrapped-command
693
+ * detection (gh vs git-push for token, gh issue/pr comment for routing,
694
+ * gh pr merge for LGTM, close-keyword for auto-close, the auditor-role
695
+ * acting-verb gate, gh-write for attribution) happens INSIDE each script.
696
+ * Distinct entries per script keep them independently upgradeable +
697
+ * diagnosable in `gh issue list` style settings audits.
613
698
  */
614
699
  export function installGhTokenHook(workspaceDir) {
615
700
  const absDir = resolve(workspaceDir);
@@ -619,6 +704,9 @@ export function installGhTokenHook(workspaceDir) {
619
704
  const settings = readSettings(path);
620
705
  const hooks = settings.hooks ?? {};
621
706
  const preToolUse = hooks.PreToolUse ?? [];
707
+ const postToolUse = hooks.PostToolUse ?? [];
708
+ const userPromptSubmit = hooks.UserPromptSubmit ?? [];
709
+ const preCompact = hooks.PreCompact ?? [];
622
710
  // Drop any prior MACF-managed entries (any hook file in
623
711
  // MACF_HOOK_FILENAMES) so we can replace them cleanly — guards against
624
712
  // stale flags from older CLI versions + handles renames/additions to
@@ -644,12 +732,59 @@ export function installGhTokenHook(workspaceDir) {
644
732
  matcher: 'Bash',
645
733
  hooks: [{ type: 'command', command: MACF_CLOSE_HOOK_COMMAND }],
646
734
  },
735
+ {
736
+ matcher: 'Bash',
737
+ hooks: [{ type: 'command', command: MACF_AUDITOR_HOOK_COMMAND }],
738
+ },
739
+ ];
740
+ // PostToolUse: the attribution-result hook (groundnuty/macf#489). Same
741
+ // preserve-then-replace discipline as PreToolUse above — drop any prior
742
+ // MACF-managed PostToolUse entry (by MACF_HOOK_FILENAMES basename) and
743
+ // re-add ours, leaving operator-authored PostToolUse hooks intact. It runs
744
+ // on the `PostToolUse` event (NOT PreToolUse) because it inspects the tool's
745
+ // OUTPUT — the resource is already written; the hook reads it back from
746
+ // GitHub and warns (`exit 2`) on a user-attributed write.
747
+ const preservedPost = postToolUse.filter((entry) => !entry.hooks.some((h) => isMacfManagedCommand(h.command)));
748
+ const macfPostEntries = [
749
+ {
750
+ matcher: 'Bash',
751
+ hooks: [{ type: 'command', command: MACF_ATTRIBUTION_HOOK_COMMAND }],
752
+ },
753
+ ];
754
+ // UserPromptSubmit: the turn-ack receipt hook (groundnuty/macf#444). Same
755
+ // preserve-then-replace discipline as PreToolUse above — drop any prior
756
+ // MACF-managed UserPromptSubmit entry (by MACF_HOOK_FILENAMES basename) and
757
+ // re-add ours, leaving operator-authored UserPromptSubmit hooks intact. No
758
+ // `matcher` (UserPromptSubmit isn't tool-gated); `async: true` so it never
759
+ // adds turn latency.
760
+ const preservedUps = userPromptSubmit.filter((entry) => !entry.hooks.some((h) => isMacfManagedCommand(h.command)));
761
+ const macfUpsEntries = [
762
+ {
763
+ hooks: [{ type: 'command', command: MACF_TURN_RECEIPT_HOOK_COMMAND, async: true }],
764
+ },
765
+ ];
766
+ // PreCompact: the reflection-harvest hook (groundnuty/macf#500, DR-026 F2).
767
+ // Same preserve-then-replace discipline — drop any prior MACF-managed
768
+ // PreCompact entry (by MACF_HOOK_FILENAMES basename) and re-add ours, leaving
769
+ // operator-authored PreCompact hooks intact (e.g. the plugin's
770
+ // checkpoint_to_memory mcp_tool entry lives in the plugin hooks.json, not
771
+ // here; an operator's own settings.json PreCompact bash hook is preserved).
772
+ // Matcher-less (PreCompact isn't tool-gated). NON-BLOCKING by script contract
773
+ // (always exit 0) — so no `async` flag is needed; it can't delay compaction.
774
+ const preservedCompact = preCompact.filter((entry) => !entry.hooks.some((h) => isMacfManagedCommand(h.command)));
775
+ const macfCompactEntries = [
776
+ {
777
+ hooks: [{ type: 'command', command: MACF_REFLECTION_HOOK_COMMAND }],
778
+ },
647
779
  ];
648
780
  const updated = {
649
781
  ...settings,
650
782
  hooks: {
651
783
  ...hooks,
652
784
  PreToolUse: [...preserved, ...macfEntries],
785
+ PostToolUse: [...preservedPost, ...macfPostEntries],
786
+ UserPromptSubmit: [...preservedUps, ...macfUpsEntries],
787
+ PreCompact: [...preservedCompact, ...macfCompactEntries],
653
788
  },
654
789
  };
655
790
  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;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,wDAAwD,CAAC;AAE/F;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,4DAA4D,CAAC;AAEpG;;;;GAIG;AACH,MAAM,mBAAmB,GAAsB;IAC7C,mBAAmB;IACnB,0BAA0B;IAC1B,oBAAoB;IACpB,wBAAwB;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,oBAAoB,CAAC,OAAe;IAC3C,iEAAiE;IACjE,6EAA6E;IAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAA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,CAAC,CACrE,CAAC;IACF,MAAM,kBAAkB,GAAyB;QAC/C;YACE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;SACpE;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,WAAW,EAAE,CAAC,GAAG,aAAa,EAAE,GAAG,eAAe,CAAC;YACnD,gBAAgB,EAAE,CAAC,GAAG,YAAY,EAAE,GAAG,cAAc,CAAC;YACtD,UAAU,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,kBAAkB,CAAC;SACzD;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,130 @@
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
+ * Coalesced-turn proximity window (epoch ms) for the macf#479 precision-floor
72
+ * gate. A would-be drop is SUPPRESSED (benign coalesce) when a *different*
73
+ * delivery to the same agent within ±this is receipted — proof the agent was
74
+ * alive and processing routed turns then, so this one coalesced/clobbered into
75
+ * a sibling's turn. Must be > the turn-batching window (~couple min) and <
76
+ * `openThresholdMs` (so a real lone/offline/RC-bound drop, which has no
77
+ * receipted sibling, still flags). Undefined / 0 ⇒ no suppression (pre-#479).
78
+ */
79
+ readonly proximityMs?: number;
80
+ }
81
+ /**
82
+ * A would-be drop suppressed by the macf#479 coalesced-turn gate: a sibling
83
+ * delivery to the same agent was receipted within the proximity window, so the
84
+ * agent demonstrably processed routed turns around this delivery. Reported
85
+ * separately (not in `drops`) so the caller can emit a LOUD, counted signal —
86
+ * the suppression is observable (never a silent mask), keeping the clobber rate
87
+ * visible for the source-side `C-u`-clobber follow-up.
88
+ */
89
+ export interface SuppressedCoalesce {
90
+ readonly route: DeliveredRoute;
91
+ /** The receipted sibling delivery's run id that proves the agent was active. */
92
+ readonly siblingRunId: string;
93
+ /** `sibling.deliveredAtMs − route.deliveredAtMs` (signed), for the log. */
94
+ readonly deltaMs: number;
95
+ }
96
+ export interface ReconcileResult {
97
+ /**
98
+ * Deliveries with no matching `turn_processed` span, older than the
99
+ * open-threshold — the structural drops to alert on. Empty ⇒ the workflow
100
+ * self-closes any open incident.
101
+ */
102
+ readonly drops: readonly DeliveredRoute[];
103
+ /** Count of delivered routes considered (diagnostic). */
104
+ readonly deliveredCount: number;
105
+ /** Count of distinct processed receipts seen (diagnostic). */
106
+ readonly processedCount: number;
107
+ /**
108
+ * Delivered routes that are unmatched but still within the threshold —
109
+ * "in flight", reported for visibility but NOT alerted on.
110
+ */
111
+ readonly inFlight: readonly DeliveredRoute[];
112
+ /**
113
+ * Would-be drops suppressed by the macf#479 coalesced-turn gate (a receipted
114
+ * sibling delivery to the same agent within the proximity window). NOT alerted
115
+ * on, but the caller logs + counts each so the suppression stays observable.
116
+ */
117
+ readonly suppressed: readonly SuppressedCoalesce[];
118
+ }
119
+ /** Canonical join key for a `(runId, agent)` pair. */
120
+ export declare function receiptKey(p: {
121
+ runId: string;
122
+ agent: string;
123
+ }): string;
124
+ /**
125
+ * Pure reconciliation: which delivered routes are drops (no receipt span +
126
+ * older than the open-threshold) vs. still-in-flight (no receipt yet but
127
+ * within the threshold) vs. processed (have a receipt).
128
+ */
129
+ export declare function reconcile(delivered: readonly DeliveredRoute[], processed: readonly ProcessedReceipt[], opts: ReconcileOptions): ReconcileResult;
130
+ //# sourceMappingURL=reconcile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/reconciler/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ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