@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,231 @@
1
+ # C8-D — action-tool reachability: always present, and eviction you can undo
2
+
3
+ > **Historical record.** The durable contract from this cut now lives in
4
+ > [`tool-system.md §1.0.2`](../architecture/tool-system.md) — derived action whitelist,
5
+ > fail-closed on a ghost id, eviction only for restorable tools, actionable eviction hint.
6
+ > This file keeps the red-before-green evidence and the cut narrative.
7
+
8
+ Date: 2026-11-14 · Branch: `task/c8-d-tool-reachability` · Base: `feat/refactor-plan` @ `0425bd48`
9
+
10
+ ## 1. Defect
11
+
12
+ Tool definitions are capped by a token budget (`TOOL_DEF_BUDGET_*`). The evictor
13
+ ranks by eviction tier and then by **schema size**, so an agent under pressure
14
+ could lose the tools that let it *act* — create / update / submit work, read its
15
+ own ledger, look at its queue, answer a human. Nothing announced the loss: the
16
+ model was told nothing about what left the schema, and even if it had noticed, it
17
+ had no stated way to get the tool back.
18
+
19
+ This is "Agent self-knowledge" gap C: **the agent wants to act, cannot, and is not
20
+ told why.** The whitelist investigation that opened this card is itself a live
21
+ sample of the same gap — a name (`request_user_input`) was copied out of prose
22
+ into the intended whitelist and it did not exist in the tool registry.
23
+
24
+ ## 2. Root cause (R1 / R2)
25
+
26
+ - **R1 (one fact, several writers):** "which tools does this turn need" was
27
+ answered in two places — the selection step (base sets, keyword groups, pack
28
+ branches) and the budget evictor (tier + size). Neither knew about "action",
29
+ so the fact "this tool is required to work" had no single owner.
30
+ - **R2 (one invariant, several measurements):** the invariant "a tool the runtime
31
+ tells the model to call must exist" was enforced by hand for a growing list of
32
+ special cases (`end_turn`, `open_right_panel`, lifecycle tools …), each with
33
+ its own comment, none derived from the registry.
34
+
35
+ Fix direction: **one derived whitelist**, one assertion, and eviction restricted
36
+ to tools that can be brought back.
37
+
38
+ ## 3. Design
39
+
40
+ ### 3.1 Whitelist is derived, grouped, and typed
41
+
42
+ `packages/core/src/capability-packs.ts`
43
+
44
+ ```ts
45
+ export const ACTION_TOOL_GROUPS = {
46
+ task: ['task_create', 'task_update', 'task_submit_review'], // needs a task service
47
+ ledger: ['work_status', 'check_mailbox'], // always registered
48
+ human: ['notify_user', 'request_user_input'], // schema-injected + protected
49
+ } as const;
50
+ export const ACTION_TOOL_IDS = [ ...task, ...ledger, ...human ];
51
+ ```
52
+
53
+ - `ACTION_TOOL_IDS` is **flattened from the groups** — no second list to drift.
54
+ - `ActionToolId` is a literal union, so a *typo'd* name fails `tsc` before any test.
55
+ - The seven ids were resolved against the **live tool face** (factories
56
+ `createAgentTaskTools` / `createMailboxTools`, plus ToolSelector's `pushUnique`
57
+ injections), not copied from prose.
58
+ - **The face is not the handler registry.** `notify_user`, `request_user_input` and
59
+ `end_turn` have a dispatch branch and a pushed schema but no `registerTool`
60
+ handler. The first draft of this list treated handler-lessness as
61
+ unreachability, and the inconsistency showed up immediately: it kept
62
+ `notify_user` and dropped `request_user_input` although the two are identical in
63
+ every respect. One predicate, one answer — `toolFaceNames()` is that answer.
64
+ - `request_user_input` is a first-class member on purpose: when the surface is
65
+ compressed the agent must still be able to say "I am blocked, I need one line of
66
+ authorisation". A face that cannot ask a human is the defect, not an edge case.
67
+
68
+ ### 3.2 Fail-fast assertion (no silent filtering)
69
+
70
+ ```ts
71
+ assertActionToolReachability(face, { notWired?: ['task'] })
72
+ ```
73
+
74
+ - Throws, naming the missing id and its group.
75
+ - Called at the one moment the face is final: `AgentManager`'s two assembly tails
76
+ (`createAgent`, restore path), through `toolFaceNames()` = registered handlers ∪
77
+ eviction-immune ∪ schema-injected. The registry alone under-reports: `notify_user`
78
+ has a dispatch branch and a schema but no `registerTool` handler.
79
+ - A deployment with no task service must **declare** `notWired: ['task']`. That is
80
+ a named degradation (greppable, one word), not a filter.
81
+
82
+ ### 3.3 Selection: action tools are not "situational extras"
83
+
84
+ `ToolSelector.selectTools()` forces `ACTION_TOOL_IDS` into the selection for every
85
+ pack except `reflex` (a patrol tick is not a work unit). Work-context lifecycle
86
+ tools stay session-gated, so `task_submit_review` still cannot leak into free chat.
87
+
88
+ ### 3.4 Eviction may only take what can come back
89
+
90
+ When the guard is on, `protectedNames` gains
91
+ 1. every action tool (tier 0 — never a victim), and
92
+ 2. every tool with **no handler and no schema-injection entry** — such a tool is
93
+ unreachable for the rest of the turn once evicted, so it is never a legal victim.
94
+
95
+ ### 3.5 The eviction hint is actionable
96
+
97
+ `formatEvictedToolCatalog()` now states the count, names the tools, and gives the
98
+ recovery call with real names:
99
+
100
+ ```
101
+ ## Deferred Tools (schemas omitted for budget)
102
+ Core platform tools (shell/files/tasks/memory) and the action tools (create / update /
103
+ submit / work_status / check_mailbox / notify_user) stay LIVE above.
104
+ These 18 tool(s) were moved OUT of this turn's schema to stay inside the
105
+ tool-definition budget. They are not gone — each one is re-discoverable:
106
+ recover: discover_tools({ name: ["bulk_tool_59", "bulk_tool_58", …] })
107
+ Activation is sticky: the schema is back from your next turn. Do not guess a tool you cannot see.
108
+ - `bulk_tool_59`: …
109
+ ```
110
+
111
+ ### 3.6 Single switch
112
+
113
+ `MARKUS_ACTION_TOOL_GUARD=0` (or `actionToolGuard: false` on `selectTools`) restores
114
+ the pre-C8-D behaviour wholesale: no forcing, no protection, no restriction.
115
+
116
+ ## 4. Evidence
117
+
118
+ ### 4.1 Red before implementation
119
+
120
+ ```
121
+ npx vitest run packages/core/test/action-tool-reachability.test.ts
122
+ TypeError: Cannot read properties of undefined (reading 'filter') # ACTION_TOOL_IDS absent
123
+ ```
124
+
125
+ ### 4.2 The test bites (ghost id ⇒ red)
126
+
127
+ Temporarily adding a non-existent id to the whitelist (`human: ['notify_user',
128
+ 'request_user_input', 'ghost_action_tool']`):
129
+
130
+ ```
131
+ × every whitelisted id resolves on the live tool face
132
+ × the whitelist is exactly the seven registry-verified action tools
133
+ × execute pack: all seven action tools survive, and pressure really did evict
134
+ × converse pack: the action surface stays, work-context tools stay session-gated
135
+ Tests 4 failed | 8 passed (12)
136
+ "Error: Action tool face is incomplete: ghost_action_tool (human). …"
137
+ ```
138
+
139
+ The mirror experiment — delete the `pushUnique({ name: 'request_user_input' … })`
140
+ block — turns the HITL test red: the schema no longer offers it, so the face
141
+ loses it and `assertActionToolReachability` throws. Reachability is therefore
142
+ falsifiable for the schema-injected members too, not just for the registered ones.
143
+
144
+ ### 4.3 Green after implementation
145
+
146
+ ```
147
+ npx vitest run packages/core/test/action-tool-reachability.test.ts
148
+ ✓ 12 tests
149
+ # and with the neighbours:
150
+ tool-selector / capability-packs / task-lifecycle-tool-eviction /
151
+ scenario-tool-face / tool-selector-activation → 6 files, 65 tests, all pass
152
+ ```
153
+
154
+ The over-budget fixture (60 oversized ordinary builtins, forced into the selection
155
+ via the `code` group) proves pressure was real: the deferred catalog is non-empty
156
+ **and** all seven action tools are still LIVE.
157
+
158
+ ### 4.4 Gate readings (this worktree, serial)
159
+
160
+ | Gate | Result |
161
+ |---|---|
162
+ | `npm run typecheck` (`tsc -b` + web-ui `tsc --noEmit`) | 0 errors |
163
+ | `npm run lint` | 0 errors (1001 warnings, pre-existing) |
164
+ | `node scripts/architecture-guard.mjs` | 18/18 invariants, all hits allow-listed |
165
+ | `node scripts/security-guard.mjs` | ok |
166
+ | `npm run test` (full, serial) | 1 failed file / 1 failed test · 8510 passed · 13 skipped |
167
+ | `npm run test:web-ui` | 1476 passed · 3 skipped |
168
+
169
+ The one red is `packages/cli/test/commands-start-integration.test.ts > auto-runs
170
+ quickInit when config is missing` (60s timeout), and it is **pre-existing and
171
+ environmental**, established three ways rather than asserted: (a) it reproduces in
172
+ isolation, so concurrency is not the cause; (b) `lsof -nP -iTCP:8056 -sTCP:LISTEN`
173
+ shows the running Markus process holding port 8056, which the test's backend boot
174
+ collides with; (c) with this card's source changes reverted to the base versions,
175
+ the same test times out identically. No new red is attributable to this card.
176
+
177
+ ### 4.5 A regression found and fixed during the work
178
+
179
+ The first version called `agent.getTools()` unconditionally in `AgentManager`, and
180
+ `packages/core/test/agent-manager-core.test.ts` (which `vi.mock`s the whole Agent
181
+ class) went from 50/50 green to almost all red with
182
+ `TypeError: agent.getTools is not a function`. Fixed by skipping **only** when the
183
+ face is unobservable (a test double with no registry), which is stated in the code
184
+ rather than hidden: the check is skipped for "not a real agent", never for "some
185
+ ids are missing". After the fix: 62/62 green for that file + this card's suite, and
186
+ the full-suite count returns to the base reading.
187
+
188
+ ## 5. Single-source decisions worth recording
189
+
190
+ - **`request_user_input` IS in the whitelist.** An earlier draft excluded it on the
191
+ ground that `discover_tools` answers `unknown` for it. That reasoning mixed two
192
+ different questions: *discoverability* (can `discover_tools` activate it?) and
193
+ *reachability* (is it on the schema the model sees?). It is always pushed into
194
+ the schema and it is eviction-protected, so it is always reachable — it simply
195
+ never needs recovery, because it can never be evicted. Excluding it while
196
+ keeping `notify_user` (identical in both respects) was one predicate answered
197
+ two ways, i.e. the very R1 this card exists to remove.
198
+ - **The requirement-action evidence set is derived, not re-typed.** `agent.ts` used
199
+ to carry a free-floating `REQ_ACTION_TOOLS = [...]` literal inside the tool loop.
200
+ That set answers a *different* question from the whitelist — "did this turn
201
+ actually do something?" rather than "must this tool stay reachable?" — so merging
202
+ them would be wrong in both directions (`task_update` is reachable but proves no
203
+ action; a requirement status write proves action but is scenario-gated). It now
204
+ lives next to the whitelist as `REQUIREMENT_ACTION_EVIDENCE_TOOLS`, with the
205
+ overlapping names (`notify_user`, `request_user_input`, `task_create`) **derived**
206
+ from `ACTION_TOOL_GROUPS` — a new human-channel tool cannot be added to one list
207
+ and forgotten in the other. One test pins the resulting membership so a silent
208
+ re-scoping goes red.
209
+ - **`reflex` is excluded** from forced action-tool selection on purpose (heartbeat
210
+ patrol carries no work entity). `check_mailbox` is already in the reflex allowlist.
211
+ - **Test doubles**: the assembly assertion is skipped when the Agent class is
212
+ replaced wholesale (no registry). Production always observes a real Agent, and
213
+ ids that are merely missing are never skipped.
214
+
215
+ ## 6. Files
216
+
217
+ - `packages/core/src/capability-packs.ts` — `ACTION_TOOL_GROUPS` / `ACTION_TOOL_IDS`,
218
+ `REQUIREMENT_ACTION_EVIDENCE_TOOLS`, `actionToolGuardEnabled()`, `toolFaceNames()`,
219
+ `assertActionToolReachability()`, actionable `formatEvictedToolCatalog()`.
220
+ - `packages/core/src/tool-selector.ts` — `actionToolGuard` opt; action tools forced
221
+ into the selection (non-reflex); action + non-re-discoverable tools protected from
222
+ eviction.
223
+ - `packages/core/src/agent-manager.ts` — assembly-tail assertion (create + restore).
224
+ - `packages/core/src/agent.ts` — the `REQ_ACTION_TOOLS` literal inside the tool loop
225
+ is replaced by the derived `REQUIREMENT_ACTION_EVIDENCE_TOOLS`.
226
+ - `packages/core/test/action-tool-reachability.test.ts` — 12 tests, one per clause.
227
+
228
+ ## 7. Rollback
229
+
230
+ `MARKUS_ACTION_TOOL_GUARD=0` restores the previous face without a deploy of code
231
+ changes; deleting the branch restores it entirely.