@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,406 @@
1
+ # Facts (C9) — the row contract and the verification mechanism
2
+
3
+ > **Single authority.** 本文件是 C9 事实层的单一权威,2026-11-15 由 `facts-layer.md` 与
4
+ > `facts-verification.md` 合并而来(原因:两者描述同一子系统,分开维护会产生第二写者)。
5
+ >
6
+ > The merge is lossless: **Part I** is the C9-A row contract (invariants, single writer, rejection
7
+ > matrix, schema, prompt surface, flag, CI gates), **Part II** is the C9-E verification mechanism
8
+ > (producer ≠ confirmer, write-once verdicts, the two terminal hooks, dream suggestions, the
9
+ > read-only audit page). Section numbers stay 1-7 and 8-12 respectively, so that a `§N` reference
10
+ > pointing at this subsystem keeps resolving after the merge.
11
+
12
+ Status: **implemented** (C9-A + C9-E). The stage / inbox derivation and the four observation
13
+ tables are C9-C / C9-D / C9-B and live in [`derived-views.md`](./derived-views.md).
14
+
15
+ A **fact** is a structured statement that some work *proved* something, with the evidence pointer
16
+ and the identity of the turn that asserted it. It replaces prose-as-record on the read path:
17
+ `task_comments` / `deliverables` stay the narrative layer, `facts` is the machine layer.
18
+
19
+ This file is the single source of truth for the invariants below. Every invariant names its
20
+ enforcement point — an invariant without an execution point is not an invariant.
21
+
22
+ ---
23
+
24
+ ## Part I — the row contract (C9-A)
25
+
26
+ ### 1. Invariants and where each one is enforced
27
+
28
+ | # | Invariant | Enforced by |
29
+ |---|---|---|
30
+ | 1 | A fact is **immutable**; it is superseded, never rewritten | DB trigger `facts_no_rewrite` (any `UPDATE` touching `value_json` / `predicate` / subject / identity columns → `RAISE(ABORT)`) + `FactService.assert` never issues such an update |
31
+ | 2 | Identity is mandatory: `work_unit_ref`, `asserted_by`, `source_refs_json` non-empty. Empty = error, **not** a default | DB trigger `facts_require_provenance` (INSERT with NULL/'' → `RAISE(ABORT)`) + `missing_provenance` rejection in `FactService.assert` |
32
+ | 3 | Predicates are a **closed set** — no `custom.*`, no runtime registration | `packages/shared/src/facts/predicates.ts` (`FACT_PREDICATES`, compile-time visible) + `unknown_predicate` rejection + gate G5 |
33
+ | 4 | A subject+predicate has **at most one active row** | Partial unique index `ux_facts_active` + `must_supersede` rejection (never auto-supersede: replacing a conclusion is a separate decision) |
34
+ | 5 | **No self-verification**: the assertor cannot be the verifier of its own fact | `self_verification_forbidden` rejection in `FactService.assert` + gate G3 |
35
+ | 6 | Facts are only asserted at a **terminal hook**, never per turn | Prompt contract (§5) + product decision, not a runtime gate |
36
+ | 7 | Every turn that can assert a fact carries a **turn WorkUnit identity**, and an execution turn's identity is `WORK_UNIT_REF.task(taskId, round)` with the same `round` the session is actually running | `Agent.turnWorkUnitRef()` reads `taskAsyncContext.workUnitRef` first (per-execution scope) and only then the mailbox-focus field; `executeTaskConcurrent` / `executeChatTask` / the review turn each set it from that one constructor |
37
+ | 8 | **`round` has exactly one owner: the dispatcher.** Consumers set no default; when a consumer cannot see the authoritative round it must not speak for it (no identity, fail closed) | `work_units.work_unit_ref` / `facts.work_unit_ref` / the task session id are all built by `WORK_UNIT_REF.task(taskId, round)` — one constructor; the only `?? 1` is in `TaskService` at the point that creates the `task_execution` mailbox item; guard `identity-string-single-builder` forbids a second builder or a reverse parse (string → entity) anywhere else |
38
+
39
+ **What "no identity default" means here — precisely.** There is **no identity-specific default and
40
+ no tool-layer fallback**, and there is **no round default in any consumer**: the round has exactly
41
+ one owner, the dispatcher (`TaskService`, at the point where it creates the `task_execution`
42
+ mailbox item — "definitional default: never executed ⇒ round 1"). Everything downstream derives
43
+ the identity, the session id and the fact provenance from that one value through one constructor
44
+ (`WORK_UNIT_REF.task(taskId, round)`). A consumer that cannot see the authoritative round does
45
+ **not** substitute `1`: it refuses to start the epoch, logs a structured warning, and claims no
46
+ identity at all (`fact_*` then rejects with `missing_provenance`). Guessing would be worse than
47
+ failing: the 2026-11-15 incident is exactly a consumer that computed round `1` for a session that
48
+ was running round 2, and injected a human comment into the *previous* epoch's session where the
49
+ running execution could never see it — silently, with no error.
50
+
51
+ **Derived rule — a terminal hook may only demand what is reachable in the same turn.**
52
+ Both C9-E hooks (§9) require a fact before the transition, so the tool that writes the fact must be
53
+ usable in the very turn that calls the hook. The 2026-11-15 incident is the counter-example:
54
+ the hooks were correct and *unreachable* at once, because task-execution turns carried no
55
+ identity and `fact_assert` / `fact_verify` therefore rejected with `missing_provenance`
56
+ (identity came only from the mailbox-focus chain). Reachability is part of the gate's contract,
57
+ not an implementation detail.
58
+
59
+ ### 2. Single writer
60
+
61
+ ```
62
+ packages/core/src/facts/fact-service.ts → port (assert / supersede / queryActive)
63
+ packages/org-manager/src/fact-service.ts → implementation — the ONLY file with `INSERT INTO facts` / `UPDATE facts`
64
+ ```
65
+
66
+ `grep -rn "INSERT INTO facts\|UPDATE facts" packages/*/src` must return exactly that one file.
67
+ This is machine-enforced by the `facts-single-writer` invariant in `scripts/architecture-guard.mjs`
68
+ (fixtures self-test included), so a second write path fails CI rather than review.
69
+
70
+ The `supersede` update only ever sets `superseded_by` + `superseded_at` — never the value.
71
+
72
+ ### 3. Rejection matrix (all rejections are actionable, none silent)
73
+
74
+ `FactService.assert()` returns `{ status: 'rejected', code, message, … }`:
75
+
76
+ | Condition | code | extra |
77
+ |---|---|---|
78
+ | predicate not in the closed set | `unknown_predicate` | `allowed: string[]` (nearest legal predicates) |
79
+ | value fails the predicate's schema | `schema_violation` | `path` (e.g. `/evidence_refs/0`) |
80
+ | `work_unit_ref` empty (turn not bound to a WorkUnit) | `missing_provenance` | — |
81
+ | `verified_by` == `asserted_by` | `self_verification_forbidden` | — |
82
+ | an active row already exists for subject+predicate | `must_supersede` | `existing_fact_id` |
83
+
84
+ `fact_supersede` performs "assert new + mark old" in one call, in one transaction: a two-step API
85
+ guarantees someone does only one half.
86
+
87
+ `fact_query` is **exact matching only** (subject / predicate / active). No fuzzy or semantic
88
+ search: a guess layer on top of the fact layer puts back the ambiguity the facts exist to remove.
89
+ Its description states the division of labour (`memory_search` = "what did we discuss",
90
+ `fact_query` = "what is concluded").
91
+
92
+ ### 4. Schema
93
+
94
+ `facts` is created in `packages/storage/src/sqlite-storage.ts` (`SCHEMA_SQL`), pure additive — no
95
+ backfill, no historical comment/deliverable migration. Columns: `id`, `subject_kind`,
96
+ `subject_id`, `predicate`, `value_json`, `work_unit_ref`, `asserted_by`, `source_refs_json`,
97
+ `verification_json` (`{result, verified_by, evidence_refs, verified_at?, work_unit_ref?}` or NULL — `evidence_refs` is required since C9-E), `confidence`,
98
+ `created_at`, `superseded_by`, `superseded_at`.
99
+
100
+ `verification_json` lives on the asserting row (rather than a second "verification fact" row) so
101
+ that "who verified this" can never be a second writer of the same conclusion; C9-E builds the
102
+ verifier flow on top of it (§8).
103
+
104
+ ### 5. Prompt surface: `[FACTS:<subject>]`
105
+
106
+ `packages/core/src/facts/facts-block.ts` is a **pure function** — no IO, no clock, no randomness —
107
+ rendered into the per-turn volatile tail (`ContextEngine.buildSystemPrompt` → `volatile`), never
108
+ into the byte-stable system text (same reason knowledge.md moved there: a per-turn change inside
109
+ the system message invalidates the whole prefix cache).
110
+
111
+ ```
112
+ [FACTS:task_tsk_a208c5c7]
113
+ · task.completion_evidence {"summary":"…","evidence_refs":3}
114
+ · work.defect_class {"class":"R1","instances":4}
115
+ +2 more (use fact_query)
116
+ ```
117
+
118
+ Guarantees (each one machine-tested, no mocked repo):
119
+
120
+ - **Same subject + same fact set ⇒ byte-identical output.** Sorted by predicate; no timestamps,
121
+ no `Date.now()`, no ids in the header beyond the subject.
122
+ - Only the **current subject** is rendered — a different subject's facts never leak in.
123
+ - Budget: ≤ 20 facts and ≤ 2000 characters. Over budget, truncation follows priority
124
+ (`task.completion_evidence` > `task.rejection_reason` > `verification.result` > others) and the
125
+ block ends with `+N more (use fact_query)`.
126
+ - An **empty set still emits a stable empty form** (`[FACTS:<subject>]` + `(no facts yet)`).
127
+ "Omit the whole block when empty" is forbidden: two prefixes would mean two cache entries for
128
+ the same state.
129
+
130
+ ### 6. Turning the facts layer off: the switch is gone, the wiring is the state
131
+
132
+ > Historical note, explicitly marked: `FACTS_ENABLED=0` **was deleted on 2026-11-15**
133
+ > (Owner decision; see `agent-manager.ts:3768` and `:3785`). It is recorded here only so a
134
+ > reader who meets it in an old record knows what it meant. It is not a supported runtime
135
+ > form and must not be reintroduced.
136
+
137
+ Why it was removed: a switch that can turn the whole layer off is itself the debt. It
138
+ branches four call sites, keeps a test that exists only for rollback, and hands out "just
139
+ switch it off" as the escape hatch for what is now a core capability.
140
+
141
+ What remains — and is the **only legal lazy form** — is a deployment that never wires the
142
+ facts dependency. That is a *dependency absence at assembly time*, not a runtime flag:
143
+
144
+ - `setFactService` is never called on `AgentManager` (`api-server.ts:2099`), so every agent
145
+ is built without fact tools, and never called on `TaskService` (`api-server.ts:2101`), so
146
+ both terminal hooks stay inert;
147
+ - the four tools (`fact_assert` / `fact_supersede` / `fact_query` / `fact_verify`) are **not registered** (they do not appear in any tool schema);
148
+ - no `[FACTS:…]` block is rendered (the volatile tail is byte-identical to pre-C9);
149
+ - submission and rejection by an agent behave exactly as before C9-E;
150
+ - nothing reads or writes the `facts` table, so `DROP TABLE facts` is a complete rollback.
151
+
152
+ The state is not reachable by configuration in a normal start: `storage-bridge.ts:272`
153
+ constructs the writer unconditionally, so only a deployment or test harness that omits the
154
+ dependency gets there. Measured (2026-11-19): `docs/records/cut9-runtime-probe-2026-11-19.md`
155
+ §7 — an instance with the dependency absent reads **both** consumer ports as `null`, drops
156
+ the agent tool count **117 → 113**, and accepts a submission with no evidence.
157
+
158
+ ### 7. CI gates
159
+
160
+ `scripts/identity-audit.mjs` runs the same `SINCE` mechanism as the C8 gates:
161
+
162
+ | Gate | Violation |
163
+ |---|---|
164
+ | G6 | fact rows with empty `work_unit_ref` |
165
+ | G7 | fact rows with no usable `source_refs_json` |
166
+ | G8 | self-verified pass (`verification.result='pass'` and `verified_by = asserted_by`) |
167
+ | G9 | more than one active row for the same subject+predicate |
168
+ | G10 | predicate outside the closed set (whitelist injected from code) |
169
+ | G11 | `agent_decisions` rows in the new epoch (`created_at >= SINCE`) without identity |
170
+
171
+ G11 becomes active when C9-B adds `agent_decisions.work_unit_ref`; until that column exists the
172
+ gate reports **skipped (column not migrated)** instead of failing — an always-red gate that nobody
173
+ can act on is worse than no gate. The self-test still proves it bites on a migrated schema.
174
+
175
+ ---
176
+
177
+ ## Part II — verification, terminal hooks and audit (C9-E)
178
+
179
+ Part II builds on Part I (the C9-A row contract), on the thread-stage derivation (C9-C) and on the
180
+ inbox derivation (C9-D) — the latter two now live in [`derived-views.md`](./derived-views.md).
181
+
182
+ C9-A made "what did this work prove" a structured row with identity. C9-E closes the three things
183
+ that a row alone cannot close:
184
+
185
+ 1. **Who confirms it** — a verdict written by somebody other than the assertor, through the one
186
+ write path, and impossible to write for oneself.
187
+ 2. **When a claim must exist** — the two terminal hooks at which prose used to be enough.
188
+ 3. **Where the dream's advisory output goes** — into `memory.consolidation_suggestion` facts
189
+ instead of prose in `knowledge.md` (closes DR7).
190
+
191
+ Nothing here adds a second writer. Every new write goes through `FactService` and therefore the
192
+ same single SQL file (`packages/org-manager/src/fact-service.ts`) that §2 already pins, which is
193
+ why the `facts-single-writer` CI invariant keeps holding without a new rule.
194
+
195
+ ### 8. Verification is a fact *about* a fact
196
+
197
+ **Reachability invariant (2026-11-15 incident).** Both terminal hooks (§9) are only satisfiable
198
+ if the turn that calls them can *write* the fact they require. `FactService.assert` / `verify`
199
+ reject any turn without a WorkUnit identity (`missing_provenance`), so identity has to be
200
+ established by the turn itself: an execution turn's identity is `WORK_UNIT_REF.task(taskId, round)`
201
+ with the round actually being executed, held in the per-execution async scope
202
+ (`taskAsyncContext`) and read through the single reader `Agent.turnWorkUnitRef()`.
203
+ There is **no** "assert it from a chat turn instead" route: a chat round asserting on behalf of an
204
+ execution round is a second writer for the same fact and is not a legal path — when the two
205
+ disagree the answer is to fix the identity chain, never to route the write elsewhere.
206
+
207
+ `verification_json` lives on the asserting row (§4). C9-E gives it the only write path it may
208
+ ever have:
209
+
210
+ ```
211
+ FactService.verify({ factId, result: 'pass' | 'fail', verifiedBy, evidenceRefs, workUnitRef })
212
+ ```
213
+
214
+ | Rule | Why | Enforced by |
215
+ |---|---|---|
216
+ | `verified_by ≠ asserted_by` | producer ≠ confirmer; "I checked my own work" is the failure this whole layer exists to make impossible | `self_verification_forbidden` rejection in `FactService.verify` + gate G8 (SQL-level backstop) |
217
+ | only `verification_json` is written | a verdict must never rewrite the claim it judges | `verify()` issues no other column; DB trigger `facts_no_rewrite` aborts any update that touches value / predicate / subject / identity |
218
+ | the target must be **active** and exist | verifying history is meaningless (a superseded claim keeps the verdict it had) | `not_found` / `must_supersede` rejections |
219
+ | a verdict needs **at least one evidence pointer** | a pass with no pointer is the same unfalsifiable claim as prose | `schema_violation` at `/evidence_refs`, for `pass` **and** `fail` |
220
+ | **write-once** per fact | flipping a verdict in place would make the one column two writers over time; a changed verdict is a changed claim | `already_verified` rejection naming the existing verdict; the fix is to supersede the claim (a new row, unverified) |
221
+
222
+ `FactVerification` gained two optional fields inside the JSON column — `verified_at` and
223
+ `work_unit_ref` (the verifier's turn) — so the audit page can answer "who, when, in which turn".
224
+ No table change: the column shape is C9-A's.
225
+
226
+ **Who verifies** (requirement decision 3, written down so it is decided once):
227
+
228
+ | Situation | Verifier |
229
+ |---|---|
230
+ | Same team | the task's **reviewer** (never the assignee) |
231
+ | Cross-team | an agent named by the owning team's **manager** |
232
+ | Human reviewer | the human's decision is recorded by the platform as `verified_by = <user id>` |
233
+
234
+ `deriveStage()` (C9-C, [`derived-views.md`](./derived-views.md) §3) is the **only** consumer that
235
+ turns a verdict into a stage: `pass` + independent verifier ⇒ `done`; anything else (no verdict,
236
+ `fail`, or a self-verdict smuggled in past the write path) ⇒ `in_verification`. C9-E adds no second
237
+ derivation — the acceptance test removes the verification from a real fact and asserts the stage
238
+ falls back.
239
+
240
+ ### 9. Terminal hooks — the only two places a claim is mandatory
241
+
242
+ Facts are **not** a per-turn obligation (the 166-turn incident in §5 came from exactly that
243
+ pressure). Two transitions are gated, both inside `TaskService`, which is the single execution
244
+ point for every caller (agent tool and REST alike):
245
+
246
+ | Hook | Gate | Rejection text must tell the model what to do |
247
+ |---|---|---|
248
+ | `task_submit_review` | an active `task.completion_evidence` fact for that task | names the exact `fact_assert` call shape (subject, predicate, value fields, source_refs) |
249
+ | reviewer rejects (`requestRevision`) | the acting agent must have an active `task.rejection_reason` fact for that task | names `fact_assert` with the `{reason, blocking_refs}` value shape |
250
+
251
+ Out of scope on purpose, and stated here so nobody "fixes" it later by accident:
252
+
253
+ - **chat / heartbeat / a2a** turns never need a fact — they have no terminal state.
254
+ - a **human** rejecting from the UI is not gated: a human has no turn identity and cannot assert
255
+ a fact, so gating would only block the decision, not record it.
256
+ - `rejectTask` (a human rejecting a *pending* task at the approval gate) is a different event:
257
+ it decides whether work starts, not whether work is done.
258
+
259
+ **Rollback**: the only rollback is the dependency (§6): a deployment that never wires the
260
+ facts port leaves both hooks inert, and submission/rejection behave exactly as before C9-E.
261
+ It is not `FACTS_ENABLED`, which was deleted on 2026-11-15 and cannot be executed — there is
262
+ no reader left to notice it. Measured, not assumed — see `cut9-runtime-probe-2026-11-19.md` §7.
263
+
264
+ ### 10. dream output: seven suggestion actions land as facts (closes DR7)
265
+
266
+ DR7's authority is master plan §3.3: the seven advisory actions in `learning-loop.md §5` had no
267
+ landing place other than prose in `knowledge.md`, so they were unqueryable, unreviewable, and
268
+ could not be superseded. Target shape is master plan §4.5 line 784.
269
+
270
+ The **closed set of exactly seven** (an eighth is a schema violation, a missing one is a test
271
+ failure — both are mechanical):
272
+
273
+ | # | action | what it advises | `target_refs` |
274
+ |---|---|---|---|
275
+ | 1 | `archive` | a skill with no usage and age > 30 days | skill ids |
276
+ | 2 | `revise` | a skill whose success/usage < 0.5 (usage ≥ 3) | skill ids |
277
+ | 3 | `merge` | duplicate skill names / tags | colliding skill ids |
278
+ | 4 | `ttl` | notebook entries past their tier TTL | entry ids / tier keys |
279
+ | 5 | `promote` | 3+ observations sharing a theme | observation ids |
280
+ | 6 | `negative_feedback` | ≥ 3 negative feedback on a skill → revision task | skill ids + feedback ids |
281
+ | 7 | `team_skill` | ≥ 3 agents independently recorded the same theme | agent ids + observation ids |
282
+
283
+ Landing: **one active `memory.consolidation_suggestion` fact per agent**, whose value is the
284
+ current suggestion set:
285
+
286
+ ```json
287
+ { "suggestions": [ { "action": "archive", "target_refs": ["skl_…"] },
288
+ { "action": "promote", "target_refs": ["obs_…", "obs_…", "obs_…"] } ] }
289
+ ```
290
+
291
+ Why a set-valued fact and not seven rows: §1 invariant 4 pins **at most one active row per
292
+ subject+predicate** (partial unique index `ux_facts_active`). Seven active rows for one agent would
293
+ need either a second index change (C9-A's table, out of scope) or a synthetic subject id that
294
+ encodes the action — structure inferred from a payload, which is R3. One row per agent also gives
295
+ the audit page the thing that actually matters: last cycle's suggestion set → this cycle's, with
296
+ who/when on both.
297
+
298
+ Each dream cycle therefore **supersedes** the previous snapshot (or asserts the first one), which
299
+ is the same lifecycle as any other conclusion; `supersede` keeps the old row, so history is never
300
+ rewritten.
301
+
302
+ **`knowledge.md` must not receive these seven as prose.** The writer is `writeKnowledgeMd` (single
303
+ physical writer, unchanged); the dream's suggestion stage calls `FactService`, never the memory
304
+ store. Two guards keep that from drifting back:
305
+
306
+ - the dream prompt says these are emitted as `suggestions` and **must not** be written as prose;
307
+ - a test runs the suggestion stage against a real memory store and asserts the `knowledge.md`
308
+ bytes are unchanged (a reintroduced prose write turns it red).
309
+
310
+ The 7 actions are **computed** by a **pure** function
311
+ (`packages/core/src/facts/consolidation-suggestions.ts`): it takes structural inputs (skill
312
+ usage/success, notebook ages vs tier TTL, observation clusters, negative-feedback counts, peer
313
+ themes) and returns suggestions. No clock, no IO — the caller passes `now`. That is what makes
314
+ "all seven have a landing point" a unit test rather than a hope, and it keeps the platform from
315
+ inventing advice: a rule with no signal emits nothing.
316
+
317
+ #### 10.1 What the platform derives today, and what the model must declare
318
+
319
+ The pure function's input **type** is wider than what the dream actually supplies. Today the
320
+ production caller (`Agent.recordDreamSuggestions`) passes **exactly one** signal:
321
+
322
+ | action | derived by the platform at dream time? | signal / where it comes from |
323
+ |---|---|---|
324
+ | `promote` | **yes** | `plan.promote` — the clusters the dream's own consolidation step formed (3+ observations, one theme) |
325
+ | `archive` · `revise` · `merge` · `negative_feedback` | **no** | only the model's `suggestions` declaration |
326
+ | `ttl` | **no** | only the model's `suggestions` declaration |
327
+ | `team_skill` | **no** | only the model's `suggestions` declaration |
328
+
329
+ So in production, six of the seven land **only when the model declares them** in its `suggestions`
330
+ array; the closed-set parser drops anything that is not one of the seven, and drops an item with no
331
+ `target_refs`. Nothing is derived for them and nothing is written as prose instead.
332
+
333
+ What the dream prompt shows the model (built in `Agent.dream`): the current memory entries, a
334
+ preview of curated `knowledge.md` sections, and the seven action definitions with their thresholds.
335
+ What it does **not** show: per-skill usage/success counters, notebook tier TTLs, other agents'
336
+ observations. So the model's declarations are bounded by what it can see.
337
+
338
+ Why the other six are not derived — the signals have no producer today:
339
+
340
+ - **`archive` / `revise` / `merge`** need per-skill `usage_count` / `success_count` / `name` /
341
+ `tags` / age. `recordSkillActivation` is wired (`Agent`, skill activation path), but the
342
+ counters that make a *rate* are not: `recordSkillTaskSuccess` and `recordSkillTaskRejection`
343
+ have no production caller (`packages/core/src/learning-loop.ts`), so `success_count` stays 0 —
344
+ a derived `revise` would read a permanent 0/N and fire on every used skill. That is the platform
345
+ manufacturing advice (R4), worse than emitting nothing.
346
+ - **`ttl`** would be a permanently empty branch: entries past their tier TTL are already removed by
347
+ `pruneNotebookEntries` (per-tier TTL pass) before the dream reads the notebook, so there is never
348
+ an expired entry left to report.
349
+ - **`team_skill`** needs a cross-agent view of observations; the core `Agent` has no such source.
350
+
351
+ The row that says "no" is a contract: any change that starts deriving one of those six must update
352
+ this table in the same commit. And the `negative_feedback` signal likewise needs a real feedback
353
+ producer before it can be derived rather than declared.
354
+
355
+ ### 11. Read-only audit page `/#/audit/facts`
356
+
357
+ The product rule for the reader is: **a person never needs to see the fact layer to do their
358
+ job**, but the evidence chain and the audit trail must be reachable when something is questioned.
359
+
360
+ | Aspect | Decision |
361
+ |---|---|
362
+ | Who | `owner` / `admin` only. Everyone else gets no page and no navigation entry — the check is on the API (`403`) and the page is not even mounted, so a deep link cannot leak |
363
+ | What | active + superseded rows, filterable by subject kind / subject id / predicate / time range |
364
+ | Chain | each row shows `old → new → who → when` for its supersede link, plus `work_unit_ref` and the verifier (`result`, `verified_by`, `verified_at`) |
365
+ | Writes | none. The endpoint is `GET` only; there is no UI affordance that asserts, supersedes or verifies |
366
+
367
+ API: `GET /api/facts` — `subjectKind`, `subjectId`, `predicate`, `predicatePrefix`, `since`,
368
+ `until`, `includeSuperseded`, `limit` → `{ facts: [...], truncated: boolean }`.
369
+
370
+ ### 12. Rollback and CI
371
+
372
+ There is no flag (deleted 2026-11-15, §6). The lazy form is an **unwired facts dependency**,
373
+ and it covers five surfaces, all measured in `cut9-runtime-probe-2026-11-19.md` §7:
374
+
375
+ 1. `fact_assert` / `fact_supersede` / `fact_query` / `fact_verify` are not registered (tool count 117 → 113);
376
+ 2. no `[FACTS:…]` block in the volatile tail;
377
+ 3. `GET /api/facts` answers "facts unavailable" for that deployment (the page then shows the
378
+ disabled state rather than an empty table — an empty table would look like "no data");
379
+ 4. `task_submit_review` and reviewer rejection behave exactly as they did before C9-E;
380
+ 5. the dream cycle runs, but asserts no suggestion fact (it never writes prose either way).
381
+
382
+ Both `AgentManager.factService` and `TaskService.factService` must read `null` in that state.
383
+ They are two independent injection points (`api-server.ts:2099` / `:2101`); verifying only
384
+ "the tools disappeared" would leave a half-wired instance undetected.
385
+
386
+ Gate for this document itself:
387
+
388
+ ```bash
389
+ grep -rn "FACTS_ENABLED" docs/
390
+ ```
391
+
392
+ Every hit must be inside an explicitly marked *deleted* historical note. As of 2026-11-19 the
393
+ only remaining places that still name the flag as a live mechanism are three UI locale
394
+ strings under `packages/web-ui/src/locales/`; they describe the disabled state of the facts
395
+ page and are product copy, so they are reported rather than edited as part of a docs change.
396
+
397
+ CI gates added on top of §7:
398
+
399
+ | Gate | Violation |
400
+ |---|---|
401
+ | G12 | a `pass` verdict with no evidence pointer (`evidence_refs` empty / not an array) |
402
+ | G13 | a verdict whose `verified_by` is empty (a verdict with no author) |
403
+
404
+ `scripts/architecture-guard.mjs` keeps `facts-single-writer`; C9-E adds one more invariant —
405
+ `terminal-hook-single-point`: the two terminal checks live in `task-service.ts` and nowhere else
406
+ (the tool layer must not re-implement them, or a caller using the REST path would skip them).
@@ -139,6 +139,17 @@ MUST: Periodic dream/consolidation SHOULD also:
139
139
  6. When negative feedback ≥ 3 on a skill, open/suggest a revision task
140
140
  7. When ≥ 3 agents independently record the same insight theme, suggest a team skill
141
141
 
142
+ **Where these seven land (C9-E, closes DR7)**: as a `memory.consolidation_suggestion` fact
143
+ (`{suggestions: [{action, target_refs}]}`, one active snapshot per agent, superseded each cycle) —
144
+ **not** as prose in `knowledge.md`. The seven action names are a closed set in
145
+ `@markus/shared` (`CONSOLIDATION_ACTIONS`): `archive | revise | merge | ttl | promote |
146
+ negative_feedback | team_skill`. An eighth is a schema violation; a missing one is a failing test.
147
+ Derivation is pure (`packages/core/src/facts/consolidation-suggestions.ts`) and the write goes
148
+ through the single facts writer. See `facts.md §10`.
149
+
150
+ MUST NOT: write these seven as prose into `knowledge.md`, a notebook, or any other store. A
151
+ suggestion that is prose cannot be counted, queried, or superseded — that was DR7 itself.
152
+
142
153
  Test IDs: `C-dream-archive-suggest`, `C-dream-state-ttl`, `C-dream-promote-insight`,
143
154
  `B-dream-no-habits`.
144
155
 
@@ -0,0 +1,79 @@
1
+ # Platform limits — what exists, who it protects, whether you can change it
2
+
3
+ Every numeric limit in Markus answers one question: **who is hurt if it is missing?**
4
+ That question is the admission rule. A limit with no victim is a bug, not a policy.
5
+
6
+ ```
7
+ victim = nobody → delete the limit
8
+ victim = the user himself → keep it, expose it in Settings, pick a sane default
9
+ victim = the system → keep it, derive the default from the hardware, don't expose it
10
+ victim = other people → keep it, expose it (fairness is negotiable by the owner)
11
+ ```
12
+
13
+ This document is the registry of decisions. Adding a limit without adding a row here is
14
+ the defect this file exists to prevent — the same way `packages/shared/src/limits.ts` is
15
+ the single place a numeric constant may live.
16
+
17
+ ## 1. Exposed in Settings (the victim is the user, and only the user can judge it)
18
+
19
+ | Limit | Default | Where | Why the user decides |
20
+ |---|---|---|---|
21
+ | Pending requirement proposals / agent | 10 (was 3) | Settings → Execution | An agent's own backlog. Only the owner knows how many proposals he is willing to triage. |
22
+ | Pending tasks / agent | 20 | Settings → Execution | Same family — per-agent queue depth. |
23
+ | Tool iterations per turn | 0 (unlimited) | Settings → Execution | Trades token spend against how much autonomy one turn gets. |
24
+ | Concurrent workers | `min(8, max(2, cores-1))` | Settings → Execution | Buy speed with CPU/memory and provider rate limits. |
25
+
26
+ **Retired:** an org-wide cap on total active tasks existed as a governance-policy field that
27
+ defaulted to 0 (unlimited) and had no UI to turn it on — a gate that can never fire. Removed
28
+ on the owner's call (2026-11-27); `checkTaskLimits` no longer reads it, and the type field is
29
+ kept only as an optional, unread residue for persisted project JSON (removal condition is
30
+ documented at the field).
31
+
32
+ Note on `0`: it means **unlimited**, never "forbidden". Any UI that renders these must say
33
+ "unlimited" rather than showing a bare `0` — the number reads as a prohibition to everyone
34
+ who did not write the code.
35
+
36
+ ## 2. Kept, with a sane default, deliberately not exposed (the victim is the system)
37
+
38
+ | Limit | Value | Victim it protects | Why no knob |
39
+ |---|---|---|---|
40
+ | Image upload size | 10 MB (was 2 MB) | disk | 2 MB rejected ordinary phone screenshots; 10 MB still bounds a runaway upload. Nobody benefits from choosing another number. |
41
+ | Files per upload request | 10 | process memory (each entry is buffered during parse) | Already bounded together with the size cap. |
42
+ | A2A nesting depth | 20 | stack | A recursion guard, not a product policy. |
43
+ | Review settlement batch | 1000 | memory | Internal batching ceiling. |
44
+ | Mailbox processing timeout | 45 min of **inactivity** | hung turns | Measures silence, not duration: a long multi-tool turn is never interrupted. |
45
+ | Task/mailbox retry counts | 3 / 2 / 8 | provider rate limits | Retrying the same failure rarely self-corrects. |
46
+
47
+ ## 3. Internal, never surfaced (implementation detail)
48
+
49
+ Tool-response sizes (`TASK_GET_NOTES_DEFAULT`), prompt section budgets
50
+ (`PROMPT_*_CHARS`), pagination caps (`TASK_LIST_PAGE_MAX`), archive ages, TTLs. Exposing
51
+ these would add dozens of knobs that no user can reason about, and turning them the wrong
52
+ way silently degrades prompt quality. They belong in code review, not in Settings.
53
+
54
+ ## 4. Changed in this pass, and why
55
+
56
+ - **Pending requirement proposals 3 → 10, now configurable.** The original value was a
57
+ `private static readonly 3` inside the service — the owner could neither see it nor
58
+ change it. Three concurrent proposals is not a "backlog", it is a working set; an agent
59
+ hit the wall and could not file a fourth (2026-11-27, live).
60
+ - **Image upload 2 MB → 10 MB.** No victim: the bytes land in the local avatars directory.
61
+ - **Concurrent workers 3 → derived from CPU cores.** A hard-coded 3 only fits the
62
+ developer's laptop; on an 18-core machine it left 15 cores idle. The default now comes
63
+ from the hardware, and an explicit setting still wins.
64
+
65
+ ## 6. Saving model (why there are no Save buttons)
66
+
67
+ The Execution tab used to have one Save button per group. Two groups, two buttons, and
68
+ the failure was structural: change the top group, change the bottom group, press one
69
+ button — the other group silently keeps its old value. Fields now auto-save with a 600 ms
70
+ debounce, out-of-order responses are discarded by sequence number, and a pending write is
71
+ flushed on unmount so switching tabs never loses an edit. The UI only reports state
72
+ (saving / saved / failed) instead of asking the user to remember to commit.
73
+
74
+ The **knowledge-injection budget** (`knowledgeInjectionCapChars` → 6000 execute / 4800
75
+ converse chars) caps how much of its own curated knowledge an agent can see in one turn.
76
+ Its victim is the owner's token bill, so by the rule above it belongs in group 1 — but
77
+ raising it raises cost on every single turn, and the current value was chosen deliberately
78
+ against a documented ceiling ("never 15 000"). Changing it needs the owner's call on
79
+ cost-vs-capability, so it stays as-is and is listed here instead of being quietly raised.