omp-fabric 1.26.15 → 1.27.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 (203) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +0 -27
  3. package/dist/agents/handoff.d.ts +2 -3
  4. package/dist/agents/handoff.d.ts.map +1 -1
  5. package/dist/agents/manager.d.ts.map +1 -1
  6. package/dist/agents/types.d.ts +0 -7
  7. package/dist/agents/types.d.ts.map +1 -1
  8. package/dist/chunks/{chunk-5EZWERJY.js → chunk-2BOZMRT5.js} +25 -8
  9. package/dist/chunks/{chunk-5EZWERJY.js.map → chunk-2BOZMRT5.js.map} +3 -3
  10. package/dist/chunks/{chunk-TF3MK3TH.js → chunk-4PQDZ3AY.js} +13 -13
  11. package/dist/chunks/{chunk-5U6HKMJV.js → chunk-4XLJPEI4.js} +3 -5
  12. package/dist/chunks/{chunk-5U6HKMJV.js.map → chunk-4XLJPEI4.js.map} +1 -1
  13. package/dist/chunks/{chunk-O5SZML2M.js → chunk-5MH37C4Y.js} +14 -7
  14. package/dist/chunks/chunk-5MH37C4Y.js.map +7 -0
  15. package/dist/chunks/{chunk-YWEXP724.js → chunk-7OZDA7YP.js} +5 -5
  16. package/dist/chunks/{chunk-673LUJCK.js → chunk-7QKSPNXQ.js} +7 -7
  17. package/dist/chunks/{chunk-PTYCFQEH.js → chunk-ABFK2RPI.js} +2 -2
  18. package/dist/chunks/{chunk-S3URDR4K.js → chunk-ANHZ3SWB.js} +8 -9
  19. package/dist/chunks/chunk-ANHZ3SWB.js.map +7 -0
  20. package/dist/chunks/{chunk-YLMDFMXM.js → chunk-BQ2U44IL.js} +2 -2
  21. package/dist/chunks/{chunk-RGE6MBYP.js → chunk-CNCRWY4Q.js} +27 -69
  22. package/dist/chunks/chunk-CNCRWY4Q.js.map +7 -0
  23. package/dist/chunks/{chunk-HWOL2YVU.js → chunk-CT23CX67.js} +48 -7
  24. package/dist/chunks/chunk-CT23CX67.js.map +7 -0
  25. package/dist/chunks/{chunk-3QPIB3H2.js → chunk-EV36BIIO.js} +8 -690
  26. package/dist/chunks/chunk-EV36BIIO.js.map +7 -0
  27. package/dist/chunks/{chunk-CA2P7NLW.js → chunk-FA7TNLOV.js} +2 -88
  28. package/dist/chunks/chunk-FA7TNLOV.js.map +7 -0
  29. package/dist/chunks/{chunk-BV3EDWSX.js → chunk-FVGI5PSL.js} +4 -1
  30. package/dist/chunks/chunk-FVGI5PSL.js.map +7 -0
  31. package/dist/chunks/{chunk-6IPXBDCA.js → chunk-FWFET65L.js} +211 -4
  32. package/dist/chunks/chunk-FWFET65L.js.map +7 -0
  33. package/dist/chunks/{chunk-ESPCTYVX.js → chunk-IPI4UOTC.js} +352 -1
  34. package/dist/chunks/chunk-IPI4UOTC.js.map +7 -0
  35. package/dist/chunks/{chunk-EZWJ5GBW.js → chunk-K7IN6FTM.js} +4 -15
  36. package/dist/chunks/chunk-K7IN6FTM.js.map +7 -0
  37. package/dist/commands/fabric.d.ts.map +1 -1
  38. package/dist/compaction/branch-details.d.ts +3 -9
  39. package/dist/compaction/branch-details.d.ts.map +1 -1
  40. package/dist/compaction/instructions.d.ts +4 -29
  41. package/dist/compaction/instructions.d.ts.map +1 -1
  42. package/dist/compaction/trace-events.d.ts +1 -1
  43. package/dist/compaction/trace-events.d.ts.map +1 -1
  44. package/dist/config-migrations.d.ts +1 -1
  45. package/dist/config-migrations.d.ts.map +1 -1
  46. package/dist/config.d.ts +0 -18
  47. package/dist/config.d.ts.map +1 -1
  48. package/dist/core/action-registry.d.ts.map +1 -1
  49. package/dist/core/action-registry.js +3 -3
  50. package/dist/core/action-repair.d.ts +1 -0
  51. package/dist/core/action-repair.d.ts.map +1 -1
  52. package/dist/core/compact-controller.d.ts +0 -7
  53. package/dist/core/compact-controller.d.ts.map +1 -1
  54. package/dist/entropy/index.js +6 -7
  55. package/dist/execution-service.d.ts.map +1 -1
  56. package/dist/fabric-runtime-state.d.ts +0 -64
  57. package/dist/fabric-runtime-state.d.ts.map +1 -1
  58. package/dist/fabric-runtime-state.js +137 -124
  59. package/dist/fabric-runtime-state.js.map +4 -4
  60. package/dist/fabric-state.d.ts +0 -3
  61. package/dist/fabric-state.d.ts.map +1 -1
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +131 -247
  64. package/dist/index.js.map +3 -3
  65. package/dist/memory/discovery.js +2 -3
  66. package/dist/memory/normalize.js +1 -2
  67. package/dist/memory/search.js +2 -3
  68. package/dist/providers/agents-actions.d.ts.map +1 -1
  69. package/dist/providers/agents-provider.d.ts.map +1 -1
  70. package/dist/providers/compact-provider.d.ts.map +1 -1
  71. package/dist/providers/memory-provider.d.ts +0 -11
  72. package/dist/providers/memory-provider.d.ts.map +1 -1
  73. package/dist/providers/memory-provider.js +4 -7
  74. package/dist/residency/host.js +6 -14
  75. package/dist/residency/omp-entry.js +6 -14
  76. package/dist/residency/omp-entry.js.map +1 -1
  77. package/dist/runtime/core-override-guest-types.js +1 -1
  78. package/dist/runtime/guest-types.d.ts +1 -1
  79. package/dist/runtime/guest-types.d.ts.map +1 -1
  80. package/dist/runtime/guest-types.js +1 -1
  81. package/dist/runtime/node-process-runtime.js +8 -8
  82. package/dist/runtime/quickjs-runtime.d.ts +1 -1
  83. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  84. package/dist/runtime/quickjs-runtime.js +2 -2
  85. package/dist/runtime/type-checker.js +1 -1
  86. package/dist/type-error-guidance.d.ts.map +1 -1
  87. package/dist/ui/controller.d.ts +0 -1
  88. package/dist/ui/controller.d.ts.map +1 -1
  89. package/dist/ui/conversation.js +5 -5
  90. package/dist/ui/dashboard.d.ts.map +1 -1
  91. package/dist/ui/dashboard.js +13 -18
  92. package/dist/ui/dashboard.js.map +2 -2
  93. package/dist/ui/settings.d.ts.map +1 -1
  94. package/dist/ui/settings.js +9 -203
  95. package/dist/ui/settings.js.map +2 -2
  96. package/docs/agents.md +1 -3
  97. package/docs/audit-trace.md +3 -3
  98. package/docs/configuration.md +14 -6
  99. package/docs/entropy.md +1 -2
  100. package/docs/interface.md +0 -35
  101. package/docs/memory-recall.md +6 -11
  102. package/docs/programmatic-compaction.md +14 -32
  103. package/package.json +8 -11
  104. package/dist/chunks/chunk-3J7BKUNG.js +0 -354
  105. package/dist/chunks/chunk-3J7BKUNG.js.map +0 -7
  106. package/dist/chunks/chunk-3QPIB3H2.js.map +0 -7
  107. package/dist/chunks/chunk-6IPXBDCA.js.map +0 -7
  108. package/dist/chunks/chunk-BV3EDWSX.js.map +0 -7
  109. package/dist/chunks/chunk-CA2P7NLW.js.map +0 -7
  110. package/dist/chunks/chunk-ESPCTYVX.js.map +0 -7
  111. package/dist/chunks/chunk-EZWJ5GBW.js.map +0 -7
  112. package/dist/chunks/chunk-G3VKU6GZ.js +0 -1681
  113. package/dist/chunks/chunk-G3VKU6GZ.js.map +0 -7
  114. package/dist/chunks/chunk-HWOL2YVU.js.map +0 -7
  115. package/dist/chunks/chunk-JL3KVPFJ.js +0 -291
  116. package/dist/chunks/chunk-JL3KVPFJ.js.map +0 -7
  117. package/dist/chunks/chunk-O5SZML2M.js.map +0 -7
  118. package/dist/chunks/chunk-QD2B5FUE.js +0 -15
  119. package/dist/chunks/chunk-QD2B5FUE.js.map +0 -7
  120. package/dist/chunks/chunk-QSRTEINF.js +0 -469
  121. package/dist/chunks/chunk-QSRTEINF.js.map +0 -7
  122. package/dist/chunks/chunk-QZJB7QTM.js +0 -248
  123. package/dist/chunks/chunk-QZJB7QTM.js.map +0 -7
  124. package/dist/chunks/chunk-RGE6MBYP.js.map +0 -7
  125. package/dist/chunks/chunk-S3URDR4K.js.map +0 -7
  126. package/dist/chunks/chunk-SMNOQLKU.js +0 -53
  127. package/dist/chunks/chunk-SMNOQLKU.js.map +0 -7
  128. package/dist/chunks/chunk-TQQPXV3I.js +0 -58
  129. package/dist/chunks/chunk-TQQPXV3I.js.map +0 -7
  130. package/dist/chunks/chunk-UAP6IQIR.js +0 -76
  131. package/dist/chunks/chunk-UAP6IQIR.js.map +0 -7
  132. package/dist/chunks/chunk-VE3FWDRH.js +0 -221
  133. package/dist/chunks/chunk-VE3FWDRH.js.map +0 -7
  134. package/dist/chunks/chunk-ZHDN5ESL.js +0 -130
  135. package/dist/chunks/chunk-ZHDN5ESL.js.map +0 -7
  136. package/dist/compaction/bounds.d.ts +0 -25
  137. package/dist/compaction/bounds.d.ts.map +0 -1
  138. package/dist/compaction/branch-summary.d.ts +0 -9
  139. package/dist/compaction/branch-summary.d.ts.map +0 -1
  140. package/dist/compaction/enrichers.d.ts +0 -10
  141. package/dist/compaction/enrichers.d.ts.map +0 -1
  142. package/dist/compaction/hook.d.ts +0 -117
  143. package/dist/compaction/hook.d.ts.map +0 -1
  144. package/dist/compaction/hook.js +0 -21
  145. package/dist/compaction/hook.js.map +0 -7
  146. package/dist/compaction/lcm-addresses.d.ts +0 -10
  147. package/dist/compaction/lcm-addresses.d.ts.map +0 -1
  148. package/dist/compaction/lcm-doctor.d.ts +0 -60
  149. package/dist/compaction/lcm-doctor.d.ts.map +0 -1
  150. package/dist/compaction/lcm-loader.d.ts +0 -12
  151. package/dist/compaction/lcm-loader.d.ts.map +0 -1
  152. package/dist/compaction/lcm-maintenance.d.ts +0 -152
  153. package/dist/compaction/lcm-maintenance.d.ts.map +0 -1
  154. package/dist/compaction/lcm-model.d.ts +0 -44
  155. package/dist/compaction/lcm-model.d.ts.map +0 -1
  156. package/dist/compaction/lcm-recovery.d.ts +0 -7
  157. package/dist/compaction/lcm-recovery.d.ts.map +0 -1
  158. package/dist/compaction/lcm-runtime.d.ts +0 -233
  159. package/dist/compaction/lcm-runtime.d.ts.map +0 -1
  160. package/dist/compaction/lcm-runtime.js +0 -2863
  161. package/dist/compaction/lcm-runtime.js.map +0 -7
  162. package/dist/compaction/lcm-status.d.ts +0 -5
  163. package/dist/compaction/lcm-status.d.ts.map +0 -1
  164. package/dist/compaction/normalize.d.ts +0 -83
  165. package/dist/compaction/normalize.d.ts.map +0 -1
  166. package/dist/compaction/projections.d.ts +0 -26
  167. package/dist/compaction/projections.d.ts.map +0 -1
  168. package/dist/compaction/render.d.ts +0 -11
  169. package/dist/compaction/render.d.ts.map +0 -1
  170. package/dist/core/event-loop-slice.d.ts +0 -11
  171. package/dist/core/event-loop-slice.d.ts.map +0 -1
  172. package/dist/memory/lcm-adapter.d.ts +0 -111
  173. package/dist/memory/lcm-adapter.d.ts.map +0 -1
  174. package/dist/storage/lcm-directory.d.ts +0 -17
  175. package/dist/storage/lcm-directory.d.ts.map +0 -1
  176. package/dist/storage/lcm-identity.d.ts +0 -48
  177. package/dist/storage/lcm-identity.d.ts.map +0 -1
  178. package/dist/storage/lcm-ledger.d.ts +0 -159
  179. package/dist/storage/lcm-ledger.d.ts.map +0 -1
  180. package/dist/storage/lcm-migration.d.ts +0 -87
  181. package/dist/storage/lcm-migration.d.ts.map +0 -1
  182. package/dist/storage/lcm-offthread.d.ts +0 -9
  183. package/dist/storage/lcm-offthread.d.ts.map +0 -1
  184. package/dist/storage/sqlite.d.ts +0 -19
  185. package/dist/storage/sqlite.d.ts.map +0 -1
  186. package/dist/ui/frame.d.ts +0 -7
  187. package/dist/ui/frame.d.ts.map +0 -1
  188. package/dist/ui/lcm-dashboard.d.ts +0 -43
  189. package/dist/ui/lcm-dashboard.d.ts.map +0 -1
  190. package/dist/ui/lcm-dashboard.js +0 -395
  191. package/dist/ui/lcm-dashboard.js.map +0 -7
  192. package/dist/ui/lcm-panel.d.ts +0 -37
  193. package/dist/ui/lcm-panel.d.ts.map +0 -1
  194. package/dist/ui/lcm-panel.js +0 -23
  195. package/dist/ui/lcm-panel.js.map +0 -7
  196. package/docs/adr/0001-lcm-durable-context-ledger.md +0 -6
  197. package/docs/certification.md +0 -134
  198. package/docs/compaction.md +0 -188
  199. /package/dist/chunks/{chunk-TF3MK3TH.js.map → chunk-4PQDZ3AY.js.map} +0 -0
  200. /package/dist/chunks/{chunk-YWEXP724.js.map → chunk-7OZDA7YP.js.map} +0 -0
  201. /package/dist/chunks/{chunk-673LUJCK.js.map → chunk-7QKSPNXQ.js.map} +0 -0
  202. /package/dist/chunks/{chunk-PTYCFQEH.js.map → chunk-ABFK2RPI.js.map} +0 -0
  203. /package/dist/chunks/{chunk-YLMDFMXM.js.map → chunk-BQ2U44IL.js.map} +0 -0
package/docs/agents.md CHANGED
@@ -107,8 +107,6 @@ return "Frontier Fabric invocation completed";
107
107
 
108
108
  In the guest, `agents.handoff()` resolves to `{ scheduled: true, status: "deferred", boundary: "fabric_exec_end" }`. Code later in the same Fabric invocation cannot consume the child output. At the outer boundary, Fabric replaces Main's tool result with the compact completion `{ handedOff, completed, status, agent, implementation, error? }`. The `model` field is required. The target runner is OMP. The `worktree` field is unavailable because the implementation must remain visible in the caller's workspace. You can also set `task`, `name`, `transport`, `thinking`, `tools`, `timeoutMs`, `extensions`, `recursive`, `schema`, and `compact`. Fabric does not switch or rewrite the history of the source session.
109
109
 
110
- **Trajectory compaction.** Set `compact` to give the executor a compacted transcript in place of the full raw branch. A value of `true` applies the default summary. Use `{ instructions?, preserve? }` to add compaction instructions of up to 8K characters and as many as 16 explicit preserve facts of up to 2K characters each. These limits match `compact.request`. Fabric writes the child session with a deterministic Fabric compaction entry before the boundary result. The executor context starts with the projected summary. It then contains the retained tail from the calculated cut point and the outer `fabric_exec` result. The append-only child file keeps the complete raw branch below the compaction marker. Fabric records the outcome under `compaction` in the child's `omp-fabric-handoff` custom entry. The outcome contains `applied`, sections, tokens, and cut point. If Fabric skips compaction, it gives the skip reason. Omit `compact` to keep the fork verbatim.
111
-
112
110
  ### Automatic Fabric-boundary prewalk
113
111
 
114
112
  `/fabric prewalk` adapts Can Bölük's [Prewalk research](https://stencil.so/blog/prewalk) for Fabric. OMP changes models inside one live agent loop at the first edit or write that a todo gates. Fabric uses a coarser atomic boundary. The first successful monitored mutation marks the current outer `fabric_exec`. All remaining nested calls settle before prewalk continues. This behavior preserves programmable sequential and parallel Fabric semantics.
@@ -132,7 +130,7 @@ The default value of `prewalk.mode` is `"in-place"`:
132
130
  2. At the finalized outer result boundary, Fabric selects `prewalk.model` on Main.
133
131
  3. Fabric queues a hidden follow-up. It tells Main to continue the current task, complete the remaining implementation, check related call sites, and run verification.
134
132
  4. The terminating outer tool prevents an automatic turn on the old model. OMP drains the queued follow-up and continues the same Main session on the executor model.
135
- 5. After the continuation settles, Fabric compacts the session with the configured compaction engine. Set `prewalk.compactOnReturn` to `false` to skip this step. Fabric then restores the Main model captured at the boundary.
133
+ 5. After the continuation settles, Fabric compacts the session. Set `prewalk.compactOnReturn` to `false` to skip this step. Fabric then restores the Main model captured at the boundary.
136
134
 
137
135
  In-place mode uses Main directly and keeps one transcript. It works with `agents.enabled` set to `false`. OMP's public extension model switch also changes the default model setting, so restoring the captured Main model repairs that default. A switch can fail before continuation when the model is unavailable or unauthenticated. The outer result then reports the cause. Fabric queues a hidden follow-up that asks Main to report the failure and propose the next action.
138
136
 
@@ -1,6 +1,6 @@
1
1
  # Fabric execution trace V1
2
2
 
3
- The final `fabric_exec` result details form a bounded durable envelope that holds `success`, `trace`, the rich render `audits`, `phases`, and `error`. The privacy-projected trace stays the functional record for compaction, memory, and tool ownership. The audits persist verbatim with full arguments, results, and previews. A resumed transcript re-renders and expands the same way as the live one. Collapsed cards provide the visual boundary. The record itself keeps the full data. Final session JSONL details never contain logs, return values, type errors, media payloads, or in-memory media notes.
3
+ The final `fabric_exec` result details form a bounded durable envelope that holds `success`, `trace`, the rich render `audits`, `phases`, and `error`. The privacy-projected trace stays the functional record for memory and tool ownership. The audits persist verbatim with full arguments, results, and previews. A resumed transcript re-renders and expands the same way as the live one. Collapsed cards provide the visual boundary. The record itself keeps the full data. Final session JSONL details never contain logs, return values, type errors, media payloads, or in-memory media notes.
4
4
 
5
5
  The serialized final details object never exceeds 512 KiB. Consumers use current traces structurally. The chat renderer allows one compatibility exception. It can match a pre-change bash digest against string literals or named strings already visible in the outer `fabric_exec` arguments, so old previews can show the original command.
6
6
 
@@ -107,9 +107,9 @@ The package exports `isFabricExecutionTraceV1`, `isFabricExecutionTraceOperation
107
107
 
108
108
  Current sessions render resumed cards from the persisted `details.audits`. These audits win over the trace, and they restore full nested read bodies, edit diffs, bash output, and previews on expand. Sessions written before audit persistence hold the trace alone. Their audits come from operation metadata, which keeps bash command text. Each reconstructed audit carries a trace-derived marker, and its missing payloads show `not retained across reload`. The renderer shows no fabricated content. Old sessions that contain `details.audits` and `details.phases` still render through the legacy adapter. For old digest-only bash traces, the renderer matches the digest against literal and named strings that the outer `fabric_exec` arguments already expose. When the renderer finds no exact command, it drops the digest and shows no hash.
109
109
 
110
- Compaction and memory read only `toolResult.details.trace`, and both pass it through the trace guard. Compaction emits phases and operations in sequence order with stable `entryId/subordinal` addresses. Memory emits one normalized child per operation with address `<outer-entry-id>/<sequence>`. Neither consumer parses `fabric_exec` source, outer output, operation results, or rendered audit prose to recover calls, files, or failures.
110
+ Memory reads only `toolResult.details.trace` and passes it through the trace guard. It emits one normalized child per operation with address `<outer-entry-id>/<sequence>`. It does not parse `fabric_exec` source, outer output, operation results, or rendered audit prose to recover calls, files, or failures.
111
111
 
112
- An invalid or unknown trace, when present, blocks semantic legacy reinterpretation. Compaction can use its separate strict old-session `details.audits` adapter only when the trace field is absent. Memory indexes trace operations only.
112
+ An invalid or unknown trace, when present, blocks semantic legacy reinterpretation. Memory indexes trace operations only.
113
113
 
114
114
  ## Limitations
115
115
 
@@ -161,7 +161,9 @@ where absent values do not participate. Orchestration programs (`agents.run` / `
161
161
  "conversationShortcut": "ctrl+shift+a"
162
162
  },
163
163
  "compaction": {
164
- "engine": "lcm"
164
+ "hardThresholdRatio": 0,
165
+ "thresholds": {},
166
+ "tokenThresholds": {}
165
167
  },
166
168
  "retention": {
167
169
  "orphanedTempRunMs": 21600000,
@@ -220,7 +222,7 @@ Unknown definitions stay visible as waiting. They do not fail the Fabric runtime
220
222
 
221
223
  `prewalk.detectShellWrites` defaults to `true`. When armed, a `fabric_exec` boundary that ran a successful `omp.bash` without an audited `omp.edit` / `omp.write` / `schema.commit` claims the handoff if file size or mtime stats drifted from the arm-time baseline. This routes shell heredocs and formatter binaries to the executor as well. The report's `trigger.files` lists the bounded drifted paths. Set it to `false` to accept audited mutations only.
222
224
 
223
- `prewalk.compactOnReturn` defaults to `true`. When an in-place continuation settles, Fabric requests a compaction with the configured `compaction.engine` and commits it while the executor is still the active model. Main's restored model receives the compacted transcript. Set this option to `false` when Main must receive the complete transcript.
225
+ `prewalk.compactOnReturn` defaults to `true`. When an in-place continuation settles, Fabric requests a compaction and commits it while the executor is still the active model. Main's restored model receives the compacted transcript. Set this option to `false` when Main must receive the complete transcript.
224
226
 
225
227
  Each in-place handoff captures Main's active model at the boundary and restores it when the continuation settles. OMP's public `setModel` extension API also updates OMP's default model setting, so the restore returns the configured default to Main's model as well. A session that ends mid-continuation keeps the executor selection persisted until the next settle.
226
228
 
@@ -245,7 +247,7 @@ Each in-place handoff captures Main's active model at the boundary and restores
245
247
 
246
248
  `executor.resultFormat` sets the default for `fabric_exec` return values. Find it under `/fabric settings` → **Executor**. `"auto"` keeps strings as text and renders structured values as syntax-highlighted YAML. `"yaml"`, `"json"`, and `"text"` each force their named behavior. A call-level `resultFormat` parameter overrides the configured default.
247
249
 
248
- Configure compaction under `/fabric settings` → **Compaction**. Select `"lcm"` for durable hierarchical context or `"omp"` to hand compaction to OMP core.
250
+ Configure compaction thresholds under `/fabric settings` → **Compaction**.
249
251
 
250
252
  ## Code modes
251
253
 
@@ -309,7 +311,7 @@ In orchestration-only mode:
309
311
  A guest core-tool call returns the whole result, or it says that it did not. When the host cut a payload, the returned string ends with one extra line:
310
312
 
311
313
  ```text
312
- [[omp-fabric:truncated]] {"reasons":["matchLimit"],"perFileMatchLimit":200}
314
+ [[omp-fabric:truncated]] {"reasons":["matchLimit"],"perFileMatchLimit":50}
313
315
  ```
314
316
 
315
317
  The marker is the last line, it is emitted only for a partial result, and a complete result is byte-identical to the file or command output. Programs that parse a whole file therefore keep working, and a program that must detect a cut branches on the marker.
@@ -561,9 +563,15 @@ Three path overrides carry no default value and stay file-only as well: `memory.
561
563
 
562
564
  ## Compaction
563
565
 
564
- The LCM compaction engine is on by default. It keeps OMP's bounded `keepRecentTokens` continuity tail and assembles durable summary nodes. `compaction.targetContextRatio` sets a hard occupancy ceiling. Set `compaction.engine` to `"omp"` to use OMP's native compaction. See [compaction](compaction.md) for invariants, loss guarantees, sections, and limits.
566
+ OMP owns compaction. Fabric registers no compaction hook, so OMP summarizes the session at every compaction boundary. Fabric only decides when to ask for one:
565
567
 
566
- Two occupancy ratios decide when work happens. `compaction.softThresholdRatio` (default `0.55`, clamped to 0.10-0.95) is the occupancy floor that forces a maintenance pass; below it maintenance still runs on its own backlog, once the active branch carries `compaction.lcmMaxLeafEntries` uncovered entries or a claimable job is waiting, and a turn always appends every entry to the ledger, so the store stays lossless whatever the ratio is. `compaction.lcmMaxDailyModelCalls`, `compaction.lcmMaxSessionModelCalls` and `compaction.lcmMaxDailyModelSeconds` bound what that costs: an exhausted budget schedules no pass at all. `compaction.lcmMaintenanceConcurrency` (default `3`, clamped to 1-8) is how many summary calls one maintenance run keeps in flight, editable under **Compaction → Maintenance concurrency**. Raising it clears a backlog in fewer turns and multiplies the spend rate by the same factor; the budget keys above stay the ceiling. `compaction.lcmMaintenanceRunSeconds` (default `60`, clamped to 10-600) is the wall-time budget of one maintenance run, editable under **Compaction → Maintenance run time**. The deadline stops new summary dispatch and lets calls already in flight finish. Maintenance is scheduled after every turn, including each turn inside a long agent run, so a run that spans many tool rounds keeps writing summaries while it works; a turn that lands while a run is in flight starts no second run. A claim reserves one call for itself and one for every live sibling lease, so admitted calls stay inside the daily and session call caps, and a lease counts against the cap until 60 seconds after it lapses, the moment the sweep hands its slot back. `compaction.hardThresholdRatio` (default `0`, meaning disabled, otherwise clamped to 0.20-0.98) is the occupancy at which Fabric compacts a model that has no entry of its own in `compaction.thresholds` or `compaction.tokenThresholds`; leaving it at `0` keeps the blocking trigger with the host. Per-model entries always win over it. When an enabled hard ratio is not above the soft one, the soft ratio is lowered to `hard - 0.05` and re-clamped, so maintenance always has a window before the blocking trigger.
568
+ - `compaction.thresholds` maps a `provider/model` key to a context ratio, clamped to 0.25-0.95. Fabric requests a compaction after a turn once usage reaches the ratio.
569
+ - `compaction.tokenThresholds` maps a `provider/model` key to an exact token count, clamped to 1,000-100,000,000. A token entry wins over a ratio entry for the same model.
570
+ - `compaction.hardThresholdRatio` (default `0`, meaning disabled, otherwise clamped to 0.20-0.98) is the occupancy at which Fabric compacts a model that has no entry of its own. Leaving it at `0` keeps the trigger with the host.
571
+
572
+ The `compact` provider records one pending request and commits it between turns. Its `instructions` go to OMP unchanged, and `preserve` items are appended to them as a bulleted list under `Preserve these facts in the summary:`.
573
+
574
+ A configuration file written by an earlier release may still carry `compaction.engine`, `compaction.summaryModel`, `compaction.targetContextRatio`, `compaction.softThresholdRatio`, or a `compaction.lcm*` key. Loading it drops those keys and rewrites the file at configuration version 6.
567
575
 
568
576
  ## Catalog repairs
569
577
 
package/docs/entropy.md CHANGED
@@ -350,8 +350,7 @@ what a quarantine is allowed to do. The report carries the verdict
350
350
  (`clean`, `costly`, or `no-evidence`), both window scores, and the
351
351
  per-ref divergence counts.
352
352
 
353
- The certification harness exits nonzero on any failed check, mirroring
354
- `certify:context`: determinism (double-run hash equality), exact metric math
353
+ The certification harness exits nonzero on any failed check: determinism (double-run hash equality), exact metric math
355
354
  on fixed corpora, the full ratchet loop with convergence, the compile loop
356
355
  with a gate-rejected round and a converged second pass, surface-apply
357
356
  purity, synthetic session-JSONL ingestion, and audit-derived value
package/docs/interface.md CHANGED
@@ -41,43 +41,8 @@ This is a focused view over the existing worker, not a second native OMP runtime
41
41
  ## Activity surface
42
42
 
43
43
  Fabric ships a general-purpose, theme-aware activity surface that works with any agent setup:
44
-
45
44
  - A compact widget above the chat (like `pi-supervisor`) follows the current phase in its header. It lists active and completed one-shot agents plus active actor workers. Their recent or running child tools nest beneath the owner, with compact edit/write change lines and owner metadata. Extensions, custom items, and shared tasks/state stay summarized by the header or appear in the dashboard, so they never occupy widget rows. The widget retains completed agent rows and a per-run high-water height, which stops tool finalization from pulling the chat upward. It resets that lease when a newer run starts, and the latest completed summary stays visible until that newer run replaces it. Snapshot bounds first preserve every active local agent, then local history, and only then admit remote project records. When a collapsed Fabric result becomes shorter at completion, the card reveals a bounded number of otherwise hidden TypeScript source lines. Those lines replace the removed rows without blank padding, and any residual deficit shrinks naturally.
46
45
  - `/fabric` (or `/fabric dashboard`) opens a responsive interactive overlay with two views: **Activity** and a unified **Topology**. Press `1` for Activity and `2` for Topology.
47
- - `/fabric lcm` opens the LCM ledger dashboard: health checks with repairs, the node graph, branch coverage, and maintenance jobs. See [compaction](compaction.md).
48
- - **Activity** lays out the workflow phase sidebar on the left and the selected phase's activity on the right. The user-facing OMP agent is always present as **Main**, including when no Fabric child exists and regardless of the status filter. Main remains an actionable queue target. The right pane orders entities under type headings for agents, actors, tools, extensions, tasks, custom items, and shared state, with a blank row between groups. The selectable order matches the rendered group order. One-shot agents stay stable in creation order. Attention-priority work keeps the default focus, so Main does not steal it.
49
- - **Topology** merges the selected retained run with the live project mesh in one graph rooted at **Main**. It deduplicates agents observed through both run and participant data, and it separates execution membership from coordination infrastructure:
50
-
51
- ```text
52
- Main
53
- ├─ Participants
54
- │ ├─ Sessions peers and remote root OMP sessions
55
- │ ├─ Agents local, remote, and recursively owned agents
56
- │ └─ Actors local and remote persistent actors
57
- └─ Mesh
58
- ├─ Topics
59
- │ ├─ Fabric fabric.state, fabric.schema, and fabric.<family>.*
60
- │ └─ Project arbitrary topics grouped by their first namespace
61
- └─ State
62
- ├─ World state
63
- │ ├─ current
64
- │ ├─ goal
65
- │ └─ Complexity
66
- │ └─ <project directories> → <file ledger>
67
- ├─ Schema
68
- │ ├─ workspace
69
- │ ├─ Hypotheses → <id>
70
- │ ├─ Certificates → <token hash>
71
- │ └─ <future schema namespaces>
72
- └─ Project state
73
- └─ <key directories> → <entry>
74
- ```
75
-
76
- Explicit ownership stays intact below those categories. Recursive agents nest under their parents. Actor workers remain under their actor, and remote descendants keep their place under the remote root. State ownership uses a mesh relationship. Owned state remains in the State tree. A state entry that identifies a project-relative file (including every `state/complexity/<file>` ledger) exposes a bounded, line-numbered Shiki source preview in both the topology inspector and full dashboard detail. The preview resolver rejects absolute paths, traversal, symlink escapes, non-files, and binary content. It caches by real path, mtime, and size. Internal membership and control keys (`topology/*`, legacy `sessions/*`, and actor registry `actors/*`) are filtered from shared state, because their canonical entities already appear under Participants. Global actor templates are absent because they are not running project nodes.
77
- - Topic names accept `.`, `:`, and `/`. A `fabric.*` topic uses the Fabric branch. Every other name uses Project topics, grouped by its first namespace. Built-in host traffic includes `fabric.actor.*`, `fabric.control.*`, `fabric.participant.lifecycle`, `fabric.steer`, and `fabric.compact`. System-only topics stay suppressed as standalone nodes unless someone explicitly subscribes to them, and their traffic can still appear in the bounded event feed. State keys preserve `/` hierarchy. The known durable families are `state/current`, `state/goal`, `state/complexity/<file>`, `schema/workspace`, `schema/hypothesis/<id>`, and `schema/certificate/<hash>`. Every other visible mesh key falls back to Project state without losing its directory structure.
78
- - The graph renders status-coloured node shapes, orthogonal connectors, animated traffic, an optional fixed-width selected-node inspector, and directional off-canvas summaries. Traffic follows the same structural branches through the source/target lowest common ancestor. It never draws direct lines through unrelated subtrees. A large or deeply recursive graph opens around the attention-priority node. When you move between nodes, a damped spring camera retargets smoothly and the viewport does not snap. Live and replay animation drives renders only while the dashboard is open. Narrow terminals keep the centred graph and drop the inspector.
79
- - Retained-run selection works as a lens over the same topology. Pressing `[` or `]` changes the highlighted run and its phase context, and live actors and remote project participants stay visible. Route records remain selectable, and they aggregate repeated traffic by source, target, topic, and kind. The recent event feed is a bounded live window. It does not replace audit history.
80
- - **Inspection and control** work the same way in both views. Agent detail includes Markdown-rendered tasks and results, highlighted YAML values, model, current tool, usage, worktree, and attach metadata. Tool-call details show highlighted command, file, and edit inputs, with Markdown or YAML outputs. Persisted bash calls keep their command text. Space peeks at an agent or actor transcript. `t` toggles between summary and transcript detail. The initial bounded tail is paged directly from OMP RPC, OMP session, and Claude stream-JSON logs. At the loaded top, `k` or Up fetches one older page, `g` loads and jumps to the true beginning, and `G` jumps to the growing tail and resumes follow mode. Assistant text uses native Markdown. Tool calls retain structured arguments and results, so they get the same read, bash, search, edit, and write previews as the parent card. Credential and token redaction applies before rendering. You can steer Main and active one-shot agents or queue them a follow-up, and one-shot agents can also be stopped safely. Persistent actors accept `s` mailbox messages. Where configured, they expose model (`m`), thinking (`e`), the complete session-bound OMP host-event catalog (`v`), instructions (`i`), mailbox clearing (`c`), and export (`x`). Remote participants expose only their advertised capabilities. Control resolves their owner and reports success after acknowledgement. From Activity, global templates stay available for import (`p`), instruction editing (`i`), and deletion (`d`).
81
46
  - `/fabric settings` opens an inline settings view that mirrors OMP core's `/settings`, with top and bottom borders, fuzzy search, and section submenus, and it writes changes to `fabric.json`. Every session opens at the global `<active OMP agent dir>/fabric.json`. In a trusted project, pressing **Ctrl+G** anywhere in the view switches both the displayed configuration layer and the save destination to the `<project>/.omp/fabric.json` overrides and back. The global view keeps global edits visible even when a project override remains effective, and its scope banner states that precedence explicitly. Untrusted sessions stay global-only. In RPC hosts, the same hierarchy is exposed through recursive select/input dialogs; a root save-scope action replaces the Ctrl+G shortcut, while Back returns one section at a time. Full code mode, capture, executor, approvals, and UI changes apply immediately when they change the effective configuration. Mesh, agent, retention, and MCP changes persist and take effect on the next `/fabric reload`. The UI section includes **Tool display** (`full` by default or `compact`), a default-on **Agent tool preview** toggle, and a global **Update debounce** (`0`/Off through `1000ms`, default `100ms`); all apply immediately. Compact display makes the declared Fabric display name/description the card header, hides outer TypeScript at every expansion level, and retains bounded nested tool details. The Agents section selects the default runner, keeps independent OMP and runtime-enumerated Claude model pickers, and exposes free-text Veda backend, persona, and model fields for the Veda runner. List editors for `agents.defaultTools` and `capture.keepVisible` toggle known tools on and off. The `keepVisible` candidates include `fabric_exec` plus every captured extension tool.
82
47
 
83
48
  ### Keybindings
@@ -441,15 +441,11 @@ while (chunk.next !== null && chunk.next !== undefined) {
441
441
  ```
442
442
 
443
443
  The default aggregate text budget is 20,000 characters and `maxChars` can
444
- request a smaller chunk. An `lcm.summary:` address expands the node's
445
- constituents under the same contract and the same default budget, spent across
446
- the page; its `next` carries `entryOffset` with `textOffset`, so a constituent
447
- that outruns the budget resumes before the page advances. Indices, stable entry
448
- IDs, operation addresses, an inclusive `entryRange`, and `before`/`after` select
449
- constituents there exactly as they select session entries, and `entryCount`
450
- counts the whole descent, not the page. Out-of-range indices, ranges,
451
- and continuation offsets return `index_out_of_bounds` or
452
- `text_offset_out_of_bounds` on both routes; neither clamps. Valid
444
+ request a smaller chunk. Indices, stable entry IDs, operation addresses, an
445
+ inclusive `entryRange`, and `before`/`after` select session entries, and
446
+ `entryCount` counts the whole selection, not the page. Out-of-range indices,
447
+ ranges, and continuation offsets return `index_out_of_bounds` or
448
+ `text_offset_out_of_bounds`; neither clamps. Valid
453
449
  typed operation and branch-fact payloads stay available as bounded structured
454
450
  fields. Oversized structured payloads set `structuredTruncated` and stay out of
455
451
  the envelope.
@@ -482,8 +478,7 @@ With no selector, `memory.walk` obtains an integrity-bound session range and
482
478
  visits the whole normalized session. With a selector, it visits only that
483
479
  selection and optional context. Start it from an original selection, not a
484
480
  continuation with a nonzero `textOffset`, because every callback receives a
485
- complete entry. On every expansion route, including `lcm.summary:`
486
- constituents, the helper follows all expansion pages, validates continuity, and
481
+ complete entry. On every expansion route, the helper follows all expansion pages, validates continuity, and
487
482
  reassembles each `textRange` fully before invoking the visitor. It awaits async
488
483
  visitors and nested tool calls, and returns `{visited, stopped}`.
489
484
  A provider error is returned as `walk.error`. Functions remain inside the guest
@@ -4,9 +4,9 @@ A model, skill, or peer can **ask** the host to compact its context at a safe
4
4
  boundary. The request also works on a running agent's context.
5
5
 
6
6
  One gated channel carries the request to the host. The host selects the safe
7
- time. Fabric performs deterministic compaction without another model call,
8
- which keeps repeated results testable. Each request records a labeled
9
- **advisory** intent. The host later performs the **committed** context change.
7
+ time. OMP performs the compaction with its own summarizer. Each request
8
+ records a labeled **advisory** intent. The host later performs the
9
+ **committed** context change.
10
10
 
11
11
  ## Advisory and committed steps
12
12
 
@@ -44,7 +44,7 @@ latest instructions.
44
44
  | The context is a cache for the store. | Compaction changes the cache through an explicit, labeled transition. `status()` records the intent and last commit outside the context, where they survive compaction. |
45
45
  | Derived views are pure functions of the log. | `CompactStatus` reads the controller's recorded intents and commits. It never reads the compacted context itself. |
46
46
  | The host enforces transition boundaries. | The model requests compaction. The host commits at `agent_end`. `maybeCommit` and the `agent_end` handler contain the boundary gate. |
47
- | A task boundary can carry a compaction request. | The model selects the request time and instructions. The host selects a safe commit time. OMP core keeps its token-threshold trigger. |
47
+ | A task boundary can carry a compaction request. | The model selects the request time and instructions. The host selects a safe commit time. The optional threshold settings in [configuration](configuration.md#compaction) also request a compaction after a turn. |
48
48
 
49
49
  ## API surface
50
50
 
@@ -67,7 +67,7 @@ await compact.request({
67
67
  // Read the pending intent and the last committed/failed compaction info.
68
68
  const status = await compact.status();
69
69
  // { pending?: { reason?, instructions?, preserve?, requestedBy, requestedAt },
70
- // last?: { at, requestedBy, status: "committed"|"cancelled"|"failed",
70
+ // last?: { at, requestedBy, status: "committed"|"skipped"|"cancelled"|"failed",
71
71
  // summary?, tokensBefore?, estimatedTokensAfter?, error? } }
72
72
 
73
73
  // Clear a pending intent before the host commits it.
@@ -77,35 +77,17 @@ await compact.cancel();
77
77
  Risk classes: `request` is `write` (it mutates host session state). `status`
78
78
  and `cancel` are `read`.
79
79
 
80
- With only `instructions` present, Fabric forwards it as ordinary OMP
81
- `customInstructions`. Manual `/compact` text and programmatic requests then
82
- get the same Fabric rendering. When `preserve` is present, the controller
83
- encodes `{version: 1, instructions?, preserve}` behind an exact versioned
84
- prefix plus JSON. The compaction and branch hooks strictly decode that shape
85
- and render valid bounded values under `[Compaction Request]`. On tree
86
- navigation, OMP's explicit `replaceInstructions: true` mode delegates to
87
- OMP/default summarization. Fabric cannot execute an arbitrary replacement
88
- summarizer prompt, so it produces no typed Fabric branch details in that mode.
89
-
90
- The prefix is reserved. Malformed JSON or scalars, duplicate decoded protocol
91
- keys (including escaped aliases), unknown fields or versions, invalid types,
92
- unpaired UTF-16 surrogates, excessive structure, or exceeded limits return a
93
- structured decode error and cancel the operation. Fabric never falls back to
94
- prose for such a payload. A bounded structural parser performs these checks
95
- before canonicalization, and it never uses regex to recover protocol
96
- data. Fabric never renders a rejected payload. A context with UI/RPC notification support
97
- receives a bounded error. Ordinary manual and OMP instructions remain explicit text and
98
- never gain routing semantics.
80
+ Fabric forwards the text to OMP as `customInstructions`. With only
81
+ `instructions` present, the text goes unchanged. When `preserve` is present,
82
+ Fabric appends the items to the instructions after a blank line, as a bulleted
83
+ list under `Preserve these facts in the summary:`. OMP's own summarizer reads
84
+ that text, so how closely a summary honors it depends on the model.
99
85
 
100
86
  `compact.request` validates its input with a bounded TypeBox schema before
101
87
  argument mapping. Instructions cap at 8192 characters and 8192 UTF-8 bytes.
102
88
  `preserve` accepts at most 16 items, and each item caps at 2048 characters and
103
- 2048 UTF-8 bytes. The complete encoded prefix-plus-JSON request must fit
104
- within 16 KiB. The decoder checks aggregate source bytes before structural
105
- parsing, then validates duplicate keys, scalars, and surrogate pairing while
106
- parsing. It checks the preserve count before iterating or canonicalizing
107
- items. Ordinary manual and OMP instructions remain bounded explicit text and
108
- never become typed protocol input.
89
+ 2048 UTF-8 bytes. The composed text must fit within 16 KiB of UTF-8. Unpaired
90
+ UTF-16 surrogates in either field are rejected.
109
91
 
110
92
  #### Commit semantics
111
93
 
@@ -196,9 +178,9 @@ safety needs no configuration.
196
178
 
197
179
  | File | Role |
198
180
  | --- | --- |
199
- | `src/core/compact-controller.ts` | Pending-intent controller with `request`, `cancel`, `status`, and `maybeCommit`. Uses a single replaceable slot, typed preserve encoding, an in-flight guard, and a quiet clear on cancelled or already-compacted outcomes. |
181
+ | `src/core/compact-controller.ts` | Pending-intent controller with `request`, `cancel`, `status`, and `maybeCommit`. Uses a single replaceable slot, plain-text preserve composition, an in-flight guard, and a quiet clear on cancelled or already-compacted outcomes. |
200
182
  | `src/providers/compact-provider.ts` | Fabric provider that exposes a bounded TypeBox-validated `request` (write, including optional `preserve: string[]`), `status` (read), and `cancel` (read). Registered always, with activity audit. |
201
- | `src/fabric-state.ts` | Constructs the controller with mesh-publish hooks, registers the provider, and resets on re-init or shutdown. |
183
+ | `src/fabric-runtime-state.ts` | Constructs the controller with mesh-publish hooks, registers the provider, and resets on re-init or shutdown. |
202
184
  | `src/index.ts` | Invokes `state.compact.maybeCommit(context)` in the existing `agent_end` handler. |
203
185
  | `src/agents/types.ts` | Extends `AgentSteerEntry["type"]` with `"compact"` and adds the optional `instructions` field. |
204
186
  | `src/agents/manager.ts` | `compact(id, instructions?)` appends a compact entry through the steer channel and rejects Claude-runner children. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-fabric",
3
- "version": "1.26.15",
3
+ "version": "1.27.0",
4
4
  "description": "A programmable tool and agent runtime for Oh My Pi (OMP)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,13 +31,10 @@
31
31
  "test:changed": "node scripts/test-dirty.mjs",
32
32
  "test:related": "bun --bun node_modules/vitest/vitest.mjs related",
33
33
  "check:fast": "bun run typecheck && bun run test:changed",
34
- "certify:context": "bun run build && bun scripts/certify-context.mjs",
35
34
  "certify:entropy": "bun run build && bun scripts/certify-entropy.mjs",
36
- "benchmark:real-resume": "bun run build && bun scripts/benchmark-real-resume.mjs",
37
35
  "benchmark:memory-heads": "bun run build && bun scripts/benchmark-memory-heads.mjs",
38
36
  "benchmark:codemap": "bun scripts/benchmark-codemap.mjs",
39
37
  "benchmark:skill-router": "bun scripts/benchmark-skill-router.mjs",
40
- "benchmark:lcm": "bun run build && bun scripts/benchmark-lcm.mjs",
41
38
  "lint:dead": "knip --no-gitignore",
42
39
  "check": "bun run typecheck && bun run build && bun run assert:lazy-graph && bun run test && bun run lint:dead",
43
40
  "assert:lazy-graph": "node scripts/assert-lazy-graph-host-free.mjs",
@@ -81,9 +78,9 @@
81
78
  "image": "https://raw.githubusercontent.com/tickernelz/omp-fabric/main/media/banner.svg"
82
79
  },
83
80
  "dependencies": {
84
- "@oh-my-pi/pi-agent-core": "18.18.8",
85
- "@oh-my-pi/pi-ai": "18.18.8",
86
- "@oh-my-pi/pi-utils": "18.18.8",
81
+ "@oh-my-pi/pi-agent-core": "18.20.2",
82
+ "@oh-my-pi/pi-ai": "18.20.2",
83
+ "@oh-my-pi/pi-utils": "18.20.2",
87
84
  "@jitl/quickjs-singlefile-mjs-release-sync": "^0.32.0",
88
85
  "@shikijs/langs": "4.4.3",
89
86
  "@shikijs/themes": "4.4.3",
@@ -101,10 +98,10 @@
101
98
  "@oh-my-pi/pi-tui": ">=18.4.4"
102
99
  },
103
100
  "devDependencies": {
104
- "@oh-my-pi/omptype": "18.18.8",
105
- "@oh-my-pi/pi-coding-agent": "18.18.8",
106
- "@oh-my-pi/pi-natives": "18.18.8",
107
- "@oh-my-pi/pi-tui": "18.18.8",
101
+ "@oh-my-pi/omptype": "18.20.2",
102
+ "@oh-my-pi/pi-coding-agent": "18.20.2",
103
+ "@oh-my-pi/pi-natives": "18.20.2",
104
+ "@oh-my-pi/pi-tui": "18.20.2",
108
105
  "@types/cross-spawn": "^6.0.6",
109
106
  "@types/node": "^26.1.2",
110
107
  "esbuild": "^0.25.12",