@markus-global/cli 0.12.3 → 0.12.5-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/background-maintenance.d.ts +25 -0
  2. package/dist/background-maintenance.d.ts.map +1 -1
  3. package/dist/background-maintenance.js +61 -0
  4. package/dist/background-maintenance.js.map +1 -1
  5. package/dist/commands/im-inbound-origin.d.ts +38 -0
  6. package/dist/commands/im-inbound-origin.d.ts.map +1 -0
  7. package/dist/commands/im-inbound-origin.js +48 -0
  8. package/dist/commands/im-inbound-origin.js.map +1 -0
  9. package/dist/commands/start.d.ts.map +1 -1
  10. package/dist/commands/start.js +211 -46
  11. package/dist/commands/start.js.map +1 -1
  12. package/dist/markus.mjs +18523 -9866
  13. package/dist/web-ui/assets/{AsyncState-_UC7xcxJ.js → AsyncState-ByYn1wrM.js} +1 -1
  14. package/dist/web-ui/assets/ChatComponents-Bwh8SlUV.js +14 -0
  15. package/dist/web-ui/assets/{ContentRenderer-C-V5k_3K.js → ContentRenderer-GLgoGp2a.js} +6 -6
  16. package/dist/web-ui/assets/DeliverableShareModal-CRfnRuR3.js +1 -0
  17. package/dist/web-ui/assets/{Deliverables-CQnWqbTb.js → Deliverables-EFsnf6kU.js} +2 -2
  18. package/dist/web-ui/assets/MarkdownMessage-CaLBeMto.js +4 -0
  19. package/dist/web-ui/assets/{Search-CVYQIy_D.js → Search-COiaXUNr.js} +1 -1
  20. package/dist/web-ui/assets/{SendToChat-IOAvuta-.js → SendToChat-DleryIlc.js} +1 -1
  21. package/dist/web-ui/assets/Settings-CzY8z2Yh.js +8 -0
  22. package/dist/web-ui/assets/{Store-BEsLd_RN.js → Store-C4VpQCM_.js} +1 -1
  23. package/dist/web-ui/assets/Switch-ByogYoGH.js +1 -0
  24. package/dist/web-ui/assets/Team-Cutq2J24.js +93 -0
  25. package/dist/web-ui/assets/Work-BO-mz-na.js +142 -0
  26. package/dist/web-ui/assets/{arc-DP1Vf7Sx.js → arc-mYv67jdD.js} +1 -1
  27. package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-Buq8JYN8.js → architectureDiagram-3BPJPVTR-Bzpz_1r6.js} +1 -1
  28. package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-BCa2p2_X.js → blockDiagram-GPEHLZMM-BBrLiivl.js} +1 -1
  29. package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-BxsgggQY.js → c4Diagram-AAUBKEIU-BwDUoXA_.js} +1 -1
  30. package/dist/web-ui/assets/channel-Bx09lbhA.js +1 -0
  31. package/dist/web-ui/assets/{chunk-2J33WTMH-BJZZ60c9.js → chunk-2J33WTMH-DCSfJ-S9.js} +1 -1
  32. package/dist/web-ui/assets/{chunk-4BX2VUAB-C5hc4E6J.js → chunk-4BX2VUAB-CI0n1b2H.js} +1 -1
  33. package/dist/web-ui/assets/{chunk-55IACEB6-CbyvZ6Mk.js → chunk-55IACEB6-DqlSWLrm.js} +1 -1
  34. package/dist/web-ui/assets/{chunk-727SXJPM-JmNt9TVA.js → chunk-727SXJPM-BtmAfGYV.js} +1 -1
  35. package/dist/web-ui/assets/{chunk-AQP2D5EJ-BTk0v5ba.js → chunk-AQP2D5EJ-BgkA4lpQ.js} +1 -1
  36. package/dist/web-ui/assets/{chunk-FMBD7UC4-BO-dhB1U.js → chunk-FMBD7UC4-DCSr1JH4.js} +1 -1
  37. package/dist/web-ui/assets/{chunk-ND2GUHAM-BdjCcLdb.js → chunk-ND2GUHAM-CETYBRRm.js} +1 -1
  38. package/dist/web-ui/assets/{chunk-QZHKN3VN-BAzRC82n.js → chunk-QZHKN3VN-C58yD7lH.js} +1 -1
  39. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-DGZqU3iA.js +1 -0
  40. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-DGZqU3iA.js +1 -0
  41. package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-CVffmErT.js → cose-bilkent-S5V4N54A-BpvdK03m.js} +1 -1
  42. package/dist/web-ui/assets/{dagre-BM42HDAG-Dd9pB2fX.js → dagre-BM42HDAG-CZ1K-KD5.js} +1 -1
  43. package/dist/web-ui/assets/{diagram-2AECGRRQ-BG_AUqzM.js → diagram-2AECGRRQ-D136Ok1V.js} +1 -1
  44. package/dist/web-ui/assets/{diagram-5GNKFQAL-D5qFMRFf.js → diagram-5GNKFQAL-Ji6qPYYV.js} +1 -1
  45. package/dist/web-ui/assets/{diagram-KO2AKTUF-B3qTxSWl.js → diagram-KO2AKTUF-B-s2RC-f.js} +1 -1
  46. package/dist/web-ui/assets/{diagram-LMA3HP47-BrxC1636.js → diagram-LMA3HP47-COWaps70.js} +1 -1
  47. package/dist/web-ui/assets/{diagram-OG6HWLK6-BvXyEQ9-.js → diagram-OG6HWLK6-bh6MvwWn.js} +1 -1
  48. package/dist/web-ui/assets/{docx-preview-DBAZFeEb.js → docx-preview-BRynUqJd.js} +1 -1
  49. package/dist/web-ui/assets/{erDiagram-TEJ5UH35-CMap9oy_.js → erDiagram-TEJ5UH35-DOPh2LlL.js} +1 -1
  50. package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-BZerJtvk.js → flowDiagram-I6XJVG4X-B_kxDHIp.js} +1 -1
  51. package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-CagPMHMO.js → ganttDiagram-6RSMTGT7-DYBKHOkK.js} +1 -1
  52. package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-DZ5dDKRu.js → gitGraphDiagram-PVQCEYII-D8_0BxLC.js} +1 -1
  53. package/dist/web-ui/assets/index-9SXWNIl0.css +1 -0
  54. package/dist/web-ui/assets/index-TAHyKznL.js +867 -0
  55. package/dist/web-ui/assets/{infoDiagram-5YYISTIA-CHLdsDUZ.js → infoDiagram-5YYISTIA-DayJP7Ws.js} +1 -1
  56. package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-SdeinQaS.js → ishikawaDiagram-YF4QCWOH-vzxCYVSq.js} +1 -1
  57. package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-BtlL2fi0.js → journeyDiagram-JHISSGLW-B-Fud82o.js} +1 -1
  58. package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-BKPQYXkB.js → kanban-definition-UN3LZRKU-DzuKdB65.js} +1 -1
  59. package/dist/web-ui/assets/{mermaid.core-MkJR6w4B.js → mermaid.core-D4ql87kI.js} +5 -5
  60. package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-CbOmHX_u.js → mindmap-definition-RKZ34NQL-DosvXt2g.js} +1 -1
  61. package/dist/web-ui/assets/{pieDiagram-4H26LBE5-CypGjJP1.js → pieDiagram-4H26LBE5-DhXtMWhr.js} +1 -1
  62. package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-CGtemfUz.js → quadrantDiagram-W4KKPZXB-D33pLLOq.js} +1 -1
  63. package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-N7YfpCvE.js → requirementDiagram-4Y6WPE33-B-iIz-XM.js} +1 -1
  64. package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-CYnSrei-.js → sankeyDiagram-5OEKKPKP-BMd9AFEW.js} +1 -1
  65. package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-CsB7dCPF.js → sequenceDiagram-3UESZ5HK-CI1MIdwo.js} +1 -1
  66. package/dist/web-ui/assets/{stateDiagram-AJRCARHV-DTDFUXFP.js → stateDiagram-AJRCARHV-Bq6FKPW2.js} +1 -1
  67. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-8nMhmWY5.js +1 -0
  68. package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-C_bWAN9B.js → timeline-definition-PNZ67QCA-BDdmmSRo.js} +1 -1
  69. package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-CX_qAuUT.js → vennDiagram-CIIHVFJN-DP2q5vY2.js} +1 -1
  70. package/dist/web-ui/assets/{wardley-L42UT6IY-q53jQ293.js → wardley-L42UT6IY-Bw3fjszD.js} +1 -1
  71. package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-D34dKCJU.js → wardleyDiagram-YWT4CUSO-37bQUocJ.js} +1 -1
  72. package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-BFAngp66.js → xychartDiagram-2RQKCTM6-DnLDZyNC.js} +1 -1
  73. package/dist/web-ui/index.html +2 -2
  74. package/docs/README.md +50 -16
  75. package/docs/api/guides/websocket.md +43 -0
  76. package/docs/api/reference.md +657 -0
  77. package/docs/architecture/a2a-communication.md +303 -0
  78. package/docs/architecture/agent-runtime.md +145 -28
  79. package/docs/architecture/architecture.md +30 -11
  80. package/docs/architecture/cognitive-architecture.md +189 -15
  81. package/docs/architecture/concurrent-processing.md +190 -31
  82. package/docs/architecture/context-assembly.md +264 -0
  83. package/docs/architecture/derived-views.md +463 -0
  84. package/docs/architecture/desktop-auto-update.md +185 -0
  85. package/docs/architecture/facts.md +406 -0
  86. package/docs/architecture/learning-loop.md +11 -0
  87. package/docs/architecture/limits.md +79 -0
  88. package/docs/architecture/mailbox-system.md +786 -668
  89. package/docs/architecture/memory-system.md +1 -1
  90. package/docs/architecture/messaging-gateway.md +7 -0
  91. package/docs/architecture/notification-delivery.md +221 -0
  92. package/docs/architecture/notification-sounds.md +177 -0
  93. package/docs/architecture/prompt-engineering.md +171 -700
  94. package/docs/{design/remote-access-contract.md → architecture/remote-access.md} +4 -0
  95. package/docs/architecture/state-machines.md +288 -5
  96. package/docs/architecture/tool-loop-harness.md +362 -0
  97. package/docs/architecture/tool-system.md +40 -16
  98. package/docs/design/background-callback-in-turn-delivery-2026-11-22.md +95 -0
  99. package/docs/design/c10-0b-pick-identity-leak-2026-11-22.md +233 -0
  100. package/docs/design/c10-a-identity-columns-2026-11-22.md +182 -0
  101. package/docs/design/c10-c-trust-boundary-2026-11-23.md +222 -0
  102. package/docs/design/c10-external-adapters-plan-2026-11-19.md +448 -0
  103. package/docs/design/c8-residual-mechanisms-2026-11-15.md +984 -0
  104. package/docs/design/external-signal-decision-loop-2026-11-25.md +579 -0
  105. package/docs/guides/development.md +1 -1
  106. package/docs/{architecture → guides}/mailbox-audit-checklist.md +7 -0
  107. package/docs/guides/remote-access.md +1 -1
  108. package/docs/{design/agent-stop-intent-audit.md → records/agent-stop-intent-audit-2026-11-08.md} +4 -0
  109. package/docs/records/c10-l5-gate-verification-2026-11-26.md +72 -0
  110. package/docs/records/c10-l5-live-verification-2026-11-25.md +117 -0
  111. package/docs/records/cut6-c4-verification-2026-11-12.md +268 -0
  112. package/docs/records/cut6-mailbox-address-envelope-design-2026-11-12.md +871 -0
  113. package/docs/records/cut7-c7a-red-green-evidence-2026-11-13.md +105 -0
  114. package/docs/records/cut7-c7a-workunit-implementation-2026-11-13.md +116 -0
  115. package/docs/records/cut7-c7b-verification-2026-11-14.md +90 -0
  116. package/docs/records/cut7-live-verification-2026-11-14.md +33 -0
  117. package/docs/records/cut7-wiring-negative-cache-2026-11-14.md +64 -0
  118. package/docs/records/cut7-workunit-execution-plan-2026-11-13.md +206 -0
  119. package/docs/records/cut8-a-entity-keys-design-2026-11-14.md +377 -0
  120. package/docs/records/cut8-b-turn-delta-injection-2026-11-14.md +362 -0
  121. package/docs/records/cut8-c-single-clock-2026-11-14.md +119 -0
  122. package/docs/records/cut8-c-single-clock-design-2026-11-14.md +150 -0
  123. package/docs/records/cut8-d-2026-11-14.md +231 -0
  124. package/docs/records/cut8-live-verification-2026-11-14.md +1018 -0
  125. package/docs/records/cut9-adjacent-identity-paths-2026-11-15.md +200 -0
  126. package/docs/records/cut9-identity-declaration-2026-11-15.md +163 -0
  127. package/docs/records/cut9-inbox-dual-run-diff-2026-11-15.md +117 -0
  128. package/docs/records/cut9-live-verification-2026-11-15.md +222 -0
  129. package/docs/records/cut9-runtime-probe-2026-11-19.md +520 -0
  130. package/docs/{design/deliverable-sharing.md → records/deliverable-sharing-2026-08-12.md} +10 -3
  131. package/docs/records/identity-backlog-disposition-2026-11-22.md +143 -0
  132. package/docs/records/marketplace-orphan-freeze-2026-11-22.md +239 -0
  133. package/docs/{architecture/notify-user-context-truth.md → records/notify-user-context-truth-2026-10-28.md} +6 -0
  134. package/docs/{handoff → records}/remote-access-handoff.md +1 -1
  135. package/package.json +1 -1
  136. package/templates/roles/HANDBOOK.md +1 -1
  137. package/templates/skills/agent-building/SKILL.md +1 -1
  138. package/dist/web-ui/assets/ChatComponents-Ca9tWI9W.js +0 -12
  139. package/dist/web-ui/assets/DeliverableShareModal-BvpyowYJ.js +0 -1
  140. package/dist/web-ui/assets/MarkdownMessage-DedA8Zob.js +0 -4
  141. package/dist/web-ui/assets/Settings-BQDqf4q5.js +0 -8
  142. package/dist/web-ui/assets/Switch-C6InTNUi.js +0 -1
  143. package/dist/web-ui/assets/Team-nfNyWj-s.js +0 -85
  144. package/dist/web-ui/assets/Work-BQvgkynj.js +0 -142
  145. package/dist/web-ui/assets/channel-BTSrOo6c.js +0 -1
  146. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-BSYlcnF9.js +0 -1
  147. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-BSYlcnF9.js +0 -1
  148. package/dist/web-ui/assets/index-CKPQYzzR.js +0 -867
  149. package/dist/web-ui/assets/index-CzHSs0Vd.css +0 -1
  150. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-AVnDjlzF.js +0 -1
  151. package/docs/api/api.md +0 -353
  152. package/docs/architecture/llm-provider-timeouts.md +0 -60
  153. package/docs/architecture/state-ownership.md +0 -83
  154. /package/docs/architecture/{frontend/team-chat.md → team-chat.md} +0 -0
  155. /package/docs/{analysis → records}/2026-10-29-a2a-cache-hit-rate.md +0 -0
  156. /package/docs/{fixes → records}/2026-11-12-session-expiry-and-mention-thinking.md +0 -0
  157. /package/docs/{handoff → records}/approval-tri-state-handoff.md +0 -0
  158. /package/docs/{design → records}/overview-attention-redesign.md +0 -0
  159. /package/docs/{remote-access/fast-path-plan.md → records/remote-access-fast-path-plan-2026-10-17.md} +0 -0
@@ -0,0 +1,222 @@
1
+ # C9 live verification — facts layer, derived board, independent verifier
2
+
3
+ Date: 2026-11-15 · Head at time of writing: `feat/refactor-plan` (C9 code merged via #459)
4
+ Status: **code complete and verified on real data; 刀-level close-out recorded here for the first time**
5
+
6
+ ---
7
+
8
+ ## 1. Why this record exists (and why it is dated the same day as the cut)
9
+
10
+ The C9 row in the master plan requires this file as an acceptance condition. It did
11
+ not exist. The acceptance task that would have produced it (`tsk_b06a0b33`) was
12
+ cancelled on the Owner's instruction and replaced with verification done directly in
13
+ session — but the conclusion was never written down.
14
+
15
+ That is the specific failure this file repairs: **a verification that exists only in a
16
+ conversation is not a verification, because the next reader cannot check it.** C8
17
+ already paid for this lesson (see `cut8-live-verification-2026-11-14.md`); C9 repeated
18
+ it. The fix is not "be more careful next time", it is "the record is a deliverable,
19
+ not a by-product".
20
+
21
+ ## 1a. Runtime half — verified 2026-11-19
22
+
23
+ Everything in this record was measured on the **branch**, not on a running build: at the
24
+ time of writing the serving instance predated C9-E, so "the terminal hooks bite" was
25
+ inferred from tests and live-DB reads.
26
+
27
+ That half is now done and recorded separately:
28
+ **`docs/records/cut9-runtime-probe-2026-11-19.md`** (C10-0D) — steps 0–5 executed against
29
+ the instance restarted into the `#464` build at 2026-11-19 14:09:30 CST. Read both
30
+ together: this file proves the *code and data* are right, that one proves the *running
31
+ system* behaves that way.
32
+
33
+ Two things that file corrects about this one:
34
+
35
+ - The `FACTS_ENABLED=0` rollback described in §6 of `docs/architecture/facts.md` no longer
36
+ exists (deleted 2026-11-15, Owner decision). The lazy form is "a deployment that never
37
+ wires the facts port", measured at `storage.factService` absent → four `fact_*` tools
38
+ unregistered and both terminal hooks inert.
39
+ - `submitForReview` checks **pending subtasks before** the completion-evidence gate
40
+ (`task-service.ts:5104`), so a probe taken on a card with open subtasks measures the
41
+ subtask gate. The facts-gate rejection requires a card with none pending.
42
+
43
+ ## 2. Verification tree — which code is being verified
44
+
45
+ **The code under test is on `feat/refactor-plan`, not `main`.** Per master plan §5.1
46
+ rule 0, nothing enters `main` until all cuts are complete and accepted. A running
47
+ instance built from `main` therefore does **not** contain C9, and any reading taken
48
+ against it would be measuring the wrong build.
49
+
50
+ This is not a gap and not a pending approval. It is the accepted sequencing.
51
+
52
+ | Item | Where |
53
+ |---|---|
54
+ | `facts` table, unique writer, predicate closed set, three tools | `packages/core/src/facts/fact-service.ts` |
55
+ | derived stage (pure function) | `packages/core/src/facts/derive-stage.ts` |
56
+ | consolidation suggestions (closes DR7) | `packages/core/src/facts/consolidation-suggestions.ts`, `consolidation-recorder.ts` |
57
+ | facts prompt block | `packages/core/src/facts/facts-block.ts` |
58
+ | single cards | PRs #454–#458, all CLOSED, absorbed by **#459 `build/c9-integration`** |
59
+
60
+ > Note on PR archaeology: the five single-card PRs all show CLOSED. That is the
61
+ > cost of integrating through a branch — it reads as "nothing merged" to anyone
62
+ > scanning the PR list. Recorded here so the next reader does not re-open them.
63
+
64
+ ## 3. The gates: what is enforced, and against what
65
+
66
+ `scripts/identity-audit.mjs` carries thirteen predicates. The ones that belong to C9:
67
+
68
+ | # | Gate | Reading on live DB (2026-11-15 21:5x) |
69
+ |---|---|---|
70
+ | 6 | fact has no source identity | **0** |
71
+ | 7 | fact not traceable (`source_refs_json` empty/invalid) | **0** |
72
+ | 8 | self-verified (`verified_by` == `asserted_by`) | **0** |
73
+ | 9 | two active values for one `subject+predicate` | **0** |
74
+ | 10 | predicate outside the closed set | **0** |
75
+ | 11 | new-epoch decision row without `work_unit_ref` | **0** (see §6 — column added today) |
76
+ | 12 | verification verdict without evidence | **0** |
77
+ | 13 | verification verdict without an author | **0** |
78
+
79
+ Every one of these can be shown to bite: `--self-test` seeds one violation per
80
+ predicate into a temporary database, asserts the count is 1, applies the fix, and
81
+ asserts the count returns to 0. Current result: **12/12 predicates bite and return to
82
+ zero.** A gate that has never been seen red is not known to work.
83
+
84
+ ## 4. Live-database readings
85
+
86
+ Probe: `~/.markus/data.db`, read-only, 2026-11-15 21:53 local (Asia/Shanghai).
87
+
88
+ ### 4.1 Facts
89
+
90
+ | Reading | Value |
91
+ |---|---|
92
+ | total facts | **18** |
93
+ | with non-empty `work_unit_ref` | **18 / 18** |
94
+ | with valid non-empty `source_refs_json` | **18 / 18** |
95
+
96
+ By predicate:
97
+
98
+ | predicate | count |
99
+ |---|---|
100
+ | `task.completion_evidence` | 11 |
101
+ | `task.rejection_reason` | 3 |
102
+ | `agent.capability_claim` | 3 |
103
+ | `memory.consolidation_suggestion` | 1 |
104
+
105
+ The predicate set is closed and small on purpose. A facts table that accepts any
106
+ predicate string is a key-value store with extra steps; the closed set is what makes
107
+ "this conclusion is about a task's completion evidence" a checkable claim rather than
108
+ a convention.
109
+
110
+ ### 4.2 Supersede chain
111
+
112
+ | Reading | Value |
113
+ |---|---|
114
+ | active (`superseded_by IS NULL`) | **12** |
115
+ | superseded | **6** |
116
+
117
+ Facts are never edited in place. A conclusion that changes is superseded: the old row
118
+ keeps its value and gains a pointer to its replacement. History is never rewritten —
119
+ which is the only way "what did we believe on date X" stays answerable.
120
+
121
+ ### 4.3 Independent verification
122
+
123
+ | Reading | Value |
124
+ |---|---|
125
+ | facts carrying a `pass`/`fail` verdict | 1 |
126
+ | of those, `verified_by` ≠ `asserted_by` | **1 / 1** |
127
+
128
+ The one verifiable fact was asserted by `agt_d7f911ea…` and verified by
129
+ `agt_b56cd620…`. Gate 8 exists precisely so that this ratio can never quietly become
130
+ 0/N: a project that verifies its own work has no verifier, only a second signature
131
+ from the same hand.
132
+
133
+ ### 4.4 Work units (the substrate facts hang on)
134
+
135
+ | status | count |
136
+ |---|---|
137
+ | idle | 178 |
138
+ | paused_budget | 5 |
139
+ | running | 6 |
140
+ | **total** | **185** |
141
+
142
+ Gate 3 (running with an expired lease) reads **0** — the six running units all hold
143
+ live leases, so they are working, not zombies.
144
+
145
+ ## 5. Code-level verification
146
+
147
+ | Check | Reading |
148
+ |---|---|
149
+ | `tsc -b packages/{shared,storage,core}` | **0 errors** |
150
+ | C9-focused tests (`derive-stage`, `consolidation-suggestions`, `facts-block`, `fact-tools`) | **90 passed** |
151
+ | `derive-stage.test.ts` | 42 tests |
152
+ | `consolidation-suggestions.test.ts` | 20 tests |
153
+ | `identity-audit --self-test` | 12/12 predicates bite, all return to 0 |
154
+
155
+ `deriveStage()` is a pure function over facts; its 42 cases are positive and negative
156
+ per stage, so a stage regression fails by name rather than by a diff nobody reads.
157
+
158
+ ## 6. Work done today that this cut depended on
159
+
160
+ Gate 11 had been **permanently skipped**, not passing: `agent_decisions` had no
161
+ `work_unit_ref` column, so "who cancelled which round" had no gate looking at it. The
162
+ column landed today (`d0fc267e`), together with the writer, the read direction, and a
163
+ fixed epoch for the gate (`DECISIONS_IDENTITY_EPOCH = 2026-11-15`) so it does not
164
+ spend a week red on 226,964 historical rows that can never be repaired.
165
+
166
+ Historical rows stay NULL and are not backfilled: their work units were never
167
+ recorded, so any value written there would be invention rather than data.
168
+
169
+ ## 7. Conclusion — three-way, per the card discipline
170
+
171
+ **Verdict: PASS on code and live readings; two residual items, both named below.**
172
+
173
+ ### Residual 1 — requirement status not yet updated
174
+
175
+ `req_dcbf7ddf997c6346e0ee1ba2` still reads `in_progress`. All five execution cards and
176
+ all four close-out cards are `completed`, and the code is on the integration branch.
177
+ The requirement status is the last bookkeeping step, and it is **not** something this
178
+ record may flip on its own authority — it is the Owner's acceptance signal, and
179
+ flipping it here would be the same class of error as self-verification.
180
+
181
+ ### Residual 2 — C10 prerequisites are genuinely absent, and that is deliberate
182
+
183
+ `organizations.org_slug`, `agents.agent_alias`, `agents.role_slug`, and the
184
+ `envelope.auth` slot do not exist. Master plan §8 item 10 records this as an explicit
185
+ decision, not an oversight. C10 must not start before the facts layer is stable
186
+ (§5.1 discipline 3), and it has not.
187
+
188
+ ### What is NOT residual
189
+
190
+ - The five single-card PRs showing CLOSED (§2) — that is how branch integration looks.
191
+ - Running against a `main` build instead of a `feat/refactor-plan` build (§2).
192
+ - Any expectation that C9 verification implies C10 may begin. It does not.
193
+
194
+ ## 8. Reproduce
195
+
196
+ ```bash
197
+ # gates against the live database (read-only)
198
+ node scripts/identity-audit.mjs
199
+
200
+ # prove the gates still bite (temp DB, seeds one violation each, asserts 1 then 0)
201
+ node scripts/identity-audit.mjs --self-test
202
+
203
+ # C9 code-level surface
204
+ npx tsc -b packages/shared packages/storage packages/core
205
+ npx vitest run packages/core/test/derive-stage.test.ts \
206
+ packages/core/test/consolidation-suggestions.test.ts \
207
+ packages/core/test/facts-block.test.ts \
208
+ packages/core/test/fact-tools.test.ts
209
+ ```
210
+
211
+ ## 9. What this record does not cover
212
+
213
+ - The four-stage derivation's UI badge (§C9-C) — verified by `derive-stage.test.ts`
214
+ and the component, not re-verified here.
215
+ - Inbox dual-run equivalence — has its own record:
216
+ `cut9-inbox-dual-run-diff-2026-11-15.md`.
217
+ - Adjacent identity paths (shutdown re-queue, gateway receipt) — have their own
218
+ records: `cut9-adjacent-identity-paths-2026-11-15.md`,
219
+ `cut9-identity-declaration-2026-11-15.md`.
220
+
221
+ This file records the cut-level close-out; those three record their own subjects. No
222
+ fact is duplicated across them.