omp-superagent 0.1.6 → 0.1.8

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 (90) hide show
  1. package/DESIGN.md +36 -20
  2. package/README.ko.md +140 -33
  3. package/README.md +165 -41
  4. package/THIRD_PARTY_NOTICES.md +9 -7
  5. package/config.example.json +3 -1
  6. package/docs/OPERATIONS.md +395 -157
  7. package/docs/design/execution.md +156 -22
  8. package/docs/design/messaging.md +258 -52
  9. package/docs/discord-voice.md +8 -4
  10. package/docs/releases/0.1.7.md +25 -0
  11. package/docs/releases/0.1.8.md +21 -0
  12. package/gateway/bin/omp-gateway-darwin-arm64 +0 -0
  13. package/gateway/bin/omp-gateway-darwin-x64 +0 -0
  14. package/gateway/bin/omp-gateway-linux-arm64 +0 -0
  15. package/gateway/bin/omp-gateway-linux-x64 +0 -0
  16. package/host-owner/bin/omp-host-owner-darwin-arm64 +0 -0
  17. package/host-owner/bin/omp-host-owner-darwin-x64 +0 -0
  18. package/host-owner/bin/omp-host-owner-linux-arm64 +0 -0
  19. package/host-owner/bin/omp-host-owner-linux-x64 +0 -0
  20. package/package.json +9 -9
  21. package/scripts/ci.ts +4 -4
  22. package/scripts/test-omp.sh +2 -1
  23. package/skills/head/SKILL.md +26 -5
  24. package/skills/head/references/routing.md +68 -33
  25. package/skills/head/references/supervision.md +20 -4
  26. package/skills/lane/references/workflow.md +16 -7
  27. package/src/board.ts +5 -3
  28. package/src/cli.ts +161 -19
  29. package/src/config.ts +21 -1
  30. package/src/contracts.ts +63 -8
  31. package/src/cron-jobs.ts +443 -19
  32. package/src/cron-pr-intake.ts +257 -0
  33. package/src/discord-markdown.ts +350 -123
  34. package/src/extension.ts +78 -13
  35. package/src/gateway-client.ts +8 -2
  36. package/src/head-quota.ts +80 -0
  37. package/src/head-recovery.ts +40 -1
  38. package/src/host-extension.ts +122 -4
  39. package/src/host-inventory-manifest.ts +2 -2
  40. package/src/host-protocol.ts +11 -0
  41. package/src/host-sdk-helper.ts +121 -12
  42. package/src/host.ts +175 -57
  43. package/src/installed-omp.ts +116 -4
  44. package/src/lane-rows.ts +44 -4
  45. package/src/lane-watch.ts +339 -0
  46. package/src/managed-memory-helper.ts +13 -10
  47. package/src/managed-memory.ts +62 -27
  48. package/src/managed-ulw-probe.ts +75 -20
  49. package/src/managed-ulw.ts +174 -21
  50. package/src/messenger-command-catalog.json +2 -2
  51. package/src/native-launch-profile.ts +4 -2
  52. package/src/native-presets.ts +32 -5
  53. package/src/native-sessions.ts +3 -1
  54. package/src/native-settings.ts +47 -9
  55. package/src/observation-request.ts +23 -0
  56. package/src/omp-usage.ts +254 -36
  57. package/src/pr-github-schema.ts +5 -1
  58. package/src/pr-github.ts +68 -19
  59. package/src/pr-intake-automation.ts +316 -0
  60. package/src/pr-intake-comment.ts +226 -0
  61. package/src/pr-intake-fix.ts +233 -0
  62. package/src/pr-intake-github.ts +480 -0
  63. package/src/pr-intake-material.ts +230 -0
  64. package/src/pr-intake-mode.ts +59 -0
  65. package/src/pr-intake-review.ts +397 -0
  66. package/src/pr-intake-tree.ts +69 -0
  67. package/src/pr-intake-work.ts +29 -0
  68. package/src/pr-watch.ts +91 -32
  69. package/src/runtime.ts +2702 -391
  70. package/src/setup-judge.ts +1 -1
  71. package/src/setup.ts +12 -16
  72. package/src/store.ts +429 -86
  73. package/src/topic-history.ts +243 -47
  74. package/src/worker-checkout.ts +106 -0
  75. package/src/worker-destination.ts +10 -0
  76. package/src/worker-doctor.ts +66 -0
  77. package/src/worker-enrollment.ts +165 -0
  78. package/src/worker-host.ts +180 -0
  79. package/src/worker-ledger.ts +188 -0
  80. package/src/worker-placement.ts +78 -0
  81. package/src/worker-profile.ts +274 -0
  82. package/src/worker-registration.ts +288 -0
  83. package/src/worker-repository.ts +233 -0
  84. package/src/worker-request.ts +74 -0
  85. package/src/worker-service.ts +230 -0
  86. package/src/worker-stdio.ts +61 -0
  87. package/src/worker-trust.ts +36 -0
  88. package/src/worker-wire.ts +204 -0
  89. package/src/workflow.ts +81 -32
  90. package/src/setup-memory.ts +0 -21
@@ -16,6 +16,34 @@ do not isolate shared refs, services or integration effects.
16
16
 
17
17
  ### Management tools
18
18
 
19
+ **Remote placement.** The head may bind a new lane to a verified SSH worker.
20
+ The durable binding includes the target enrollment, repository identity, revision
21
+ and subdirectory. Admission, approvals and messenger delivery remain head-owned;
22
+ the worker launches the stock Host and owns its Unix socket, processes and native
23
+ journal. An SSH disconnect is client detach, not cancellation, an exit receipt,
24
+ or authority to reassign work. Open and attachment are separate from sending
25
+ the first input. A pending or ambiguous launch must be reconciled on that
26
+ worker, never retried on another machine. Remote PIDs and session paths are not
27
+ local filesystem or board identities. See [worker enrollment](../../README.md#add-a-remote-worker).
28
+
29
+ When several workers qualify, placement accounts for both reported free slots
30
+ and head assignments waiting to start. Concurrent admissions reserve their
31
+ selection before the next admission decides, without serializing SSH probes.
32
+ On the target, a failure before native session preparation releases the slot;
33
+ after preparation begins, an uncertain attempt keeps its reservation.
34
+ An absent socket alone cannot resolve a pending open: an SSH request may
35
+ still arrive. Explicit close or resume can seal that generation on the worker
36
+ before proceeding. A later open for the sealed generation is refused.
37
+
38
+ Only an operator-approved head checkout may use a default worker implicitly;
39
+ Git origin and commit identify compatible contents, not permission to send a
40
+ task. Worker verification must not execute checkout-configured Git filters.
41
+ The remote native owner accepts only session-bound control, inspection and
42
+ ordinary prompts, not the full stock RPC surface. In particular, callers
43
+ cannot use attach to choose a different session or invoke native shell commands.
44
+ The target account and its explicitly approved extensions remain trusted;
45
+ OpenSSH command restrictions are not an OS sandbox for native agent tools.
46
+
19
47
  The [head extension](../../src/extension.ts) restricts manager tools to
20
48
  the managed root. Use live tool schemas for arguments and [head role
21
49
  references](../../skills/head/SKILL.md) for operating policy.
@@ -32,12 +60,14 @@ references](../../skills/head/SKILL.md) for operating policy.
32
60
  | `thread_inspect`, `lane_thread_update` and the `decision_*` tools | Use the [messaging and authority contract](messaging.md) for scope, original thread/approval identities and readback. |
33
61
 
34
62
  Send only the original task, relevant evidence, constraints and acceptance
35
- criteria to a lane; never copy the full head transcript. A new topic starts
36
- with the exact observed head model, not its conversation; subsequent work uses
37
- the topic's own saved model and session. A topic lane replies in the operator's
38
- language through the controller outbox. Explicit manager handoffs and their
39
- internal reports use English. No lane gains messenger credentials. Distinguish dispatch acceptance, actual
40
- execution, native settlement, verified acceptance criteria, and user delivery.
63
+ criteria to a lane; never copy the full head transcript. Controller-created
64
+ topics start with the exact observed head model, while explicit manager
65
+ handoffs use the model or preset selected at `lane_start`. Subsequent work
66
+ uses the topic's own saved model and session. Ordinary bound-topic work replies
67
+ in the operator's language through the controller outbox. Explicit manager
68
+ handoffs and their internal reports use English. No lane gains messenger
69
+ credentials. Distinguish dispatch acceptance, actual execution, native
70
+ settlement, verified acceptance criteria, and user delivery.
41
71
 
42
72
  The [`lane_report` tool](../../src/lane-extension.ts) records evidence in the
43
73
  native journal. It hashes selected files in bounded chunks, verifying their identity
@@ -78,7 +108,13 @@ file, or a lease alone. Release ownership and the slot only after actual native
78
108
  exit; a shutdown ACK is not exit. Reload the same native session when authorized.
79
109
 
80
110
  The resident Rust owner speaks the stock JSONL/v2 protocol. Bun and the published SDK still
81
- prepare and publish the native session under its exact profile. The owner invokes short-lived
111
+ prepare and publish the native session under its exact profile. One short-lived
112
+ [SDK helper](../../src/host-sdk-helper.ts) per launch first reports the managed launch
113
+ composition from native discovery without creating or publishing a session; only after the launcher answers with
114
+ the manifest built from that composition does the same process prepare the session. A worker
115
+ persists its launch fence immediately before the manifest is sent, so a refusal or timeout
116
+ before then still releases the slot. Discovery and preparation have separate deadlines.
117
+ A descendant holding output open cannot extend those deadlines. The owner invokes short-lived
82
118
  SDK helpers for operations that depend on stock semantics, including fitting a withdrawn
83
119
  queue and verifying journal persistence after exit. On the private v2 interrupt channel,
84
120
  queue restoration uses the SDK's reassembled-frame byte limit: this is the value of
@@ -113,6 +149,36 @@ delivered. Reconcile exact ownership and matching completion journal evidence
113
149
  with the yield queue. Name collision checks do not make service launch atomic
114
150
  against another process using the same name.
115
151
 
152
+ ### Native memory preflight
153
+
154
+ Resolve the effective OMP memory backend for the selected native profile,
155
+ workspace, and launch settings. Any supported backend other than `off`
156
+ satisfies the managed configuration requirement; retain it unchanged. If the
157
+ effective setting is unconfigured or globally `off`, the fallback persists
158
+ only the selected profile's global `memory.backend: mnemopi`. Setup discloses
159
+ this before final save and applies it only after successful publication.
160
+ Gateway start/restart check the head profile before activating adapters; a
161
+ new head or lane Host checks its own workspace before launching stock OMP.
162
+ `doctor` only inspects the effective configuration. A workspace dotenv file can
163
+ select a different profile for native reads, but cannot authorize a global
164
+ write there. Lanes also honor the profile bound in the head's private launch
165
+ manifest, rather than treating its post-dotenv environment as operator input.
166
+
167
+ A restart runner checks eligibility without writing while the predecessor can
168
+ still accept a stop. If the fallback is needed, the runner applies it after
169
+ the predecessor exits and the runner obtains the lifetime lock, before spawning
170
+ the validated successor. A failure to write at that point fails the restart;
171
+ it does not restart the predecessor or activate adapters. Head and lane extension
172
+ composition must be valid before either launch can persist a fallback.
173
+
174
+ The [guarded native writer](../../src/native-settings.ts) rechecks the expected
175
+ configuration under the native lock, preserves unrelated settings, and reads
176
+ back the effective value. It does not overwrite stale values, higher-priority
177
+ disables or unsets, or unverified legacy/unknown settings. If enabled memory
178
+ cannot be verified, launch stays blocked. This preflight does not initialize
179
+ memory or verify live search. [Historical topic search](messaging.md#topic-routing-and-controls)
180
+ still specifically requires an active, searchable Mnemopi backend on the head.
181
+
116
182
  ### Native discovery and resume
117
183
 
118
184
  [Native discovery](../../src/native-sessions.ts) publishes symlinks to the
@@ -157,7 +223,17 @@ Create only missing presets and verify native readback before ordinary work
157
223
  starts. Invalid, tombstoned, shadowed or operator-edited entries are not
158
224
  overwritten. Managed presets follow the native `slow`, `default`, and `smol`
159
225
  roles respectively when their available selections change. Refresh only the
160
- entries still under management; do not switch existing sessions. These labels
226
+ entries still under management; do not switch existing sessions. Preset role
227
+ synchronization watches the configured native preset/role files, parent
228
+ directories (so replaced directories with new inodes rebind cleanly), and
229
+ every symlink hop (`fs.watch`, debounced), watches surviving ancestors for
230
+ uncreated directories, and reconciles once after installing watchers. On macOS
231
+ the maintenance tick also checks file metadata to recover changes missed during
232
+ FSEvents registration. Unchanged files do not trigger a preset reload. Errors
233
+ and explicit `"deferred"` outcomes get bounded backoff retries. Deferred work
234
+ continues at a slow interval after those retries so late model availability
235
+ can apply without another config edit. Slow periodic polling also stays
236
+ active whenever any source is uncovered or a watcher errors. These labels
161
237
  are preset names, not custom roles or tested performance/cost tiers.
162
238
 
163
239
  Each lane records a resolved model, selection reason, and the complete native
@@ -201,8 +277,8 @@ profiles can guide methods, not redefine the topology, routing or approvals.
201
277
 
202
278
  Use direct work, native `task` or an ordinary lane unless a workflow has a
203
279
  concrete advantage. `jevify` uses native Eval to classify independent
204
- homogeneous items under a fixed rubric; it is not ULW or a verification
205
- substitute. Select ULW only when its specific durable plan, evidence gates,
280
+ homogeneous items under a fixed rubric; it is not a SUPER workflow or a verification
281
+ substitute. Select SUPER only when its specific durable plan, evidence gates,
206
282
  dependency handoff, or recovery artifacts justify the extra work. The head
207
283
  may select a method inside an already authorized objective without claiming the
208
284
  operator selected it. Read the installed skill and preserve its approval and
@@ -214,15 +290,37 @@ source and an explicit `workflow: {name, reason}` on every workflow-selecting
214
290
  or report is not the selection field. Preserve the original text and native
215
291
  keyword interpretation; keep generated metadata fenced. Selection is
216
292
  serialized, not injected as steering. A conflict or missing advertised
217
- capability does not silently downgrade a selected ULW request to ordinary work.
218
-
219
- `jevify` uses the native notice (subject to native settings and Eval availability);
220
- plain `ulw` arms ULW without choosing a specialized mode or implicitly creating
221
- a goal. `ulw-plan` maps to `ultrathink`; `ulw-execute` and `ulw-loop` map to
222
- `orchestrate`; `ulw-research` and `mass-ulw` map to `workflowz`, subject to
223
- the original source's native keywords. Installation, profile load, selected
224
- skill application, actual native activation, goal creation, and work completion
225
- are separate facts.
293
+ capability does not silently downgrade a selected SUPER request to ordinary work.
294
+
295
+ SUPER's command, skill and native-keyword contracts are based on
296
+ [omp-superkit `c11a6e4e185f9c31f484a05a13528ef724337bc1`](https://github.com/dbc-hbin/omp-superkit/tree/c11a6e4e185f9c31f484a05a13528ef724337bc1).
297
+ Use a leading invocation; the `/` is optional in request text. These are OMP
298
+ extension commands, not registered messenger controls.
299
+
300
+ | OMP command | `workflow.name` | Discoverable OMP skill | Default native keyword |
301
+ | --- | --- | --- | --- |
302
+ | `/super` | `super` | `skill://ultrawork` | None |
303
+ | `/super-plan` | `super-plan` | `skill://ulw-plan` | `ultrathink` |
304
+ | `/super-run` | `super-run` | `skill://ulw-execute` | `orchestrate` |
305
+ | `/super-loop` | `super-loop` | `skill://ulw-loop` | `orchestrate` |
306
+ | `/super-research` | `super-research` | `skill://ulw-research` | `workflowz` |
307
+ | `/super-graph` | `super-graph` | `skill://mass-ulw` | `workflowz` |
308
+
309
+ Plain SUPER arms the session without selecting a specialty workflow or implicitly
310
+ creating a goal in RPC. SUPER Graph selects the graph workflow, not plain SUPER
311
+ activation. Defaults apply only when the original request has no native keyword;
312
+ leave quoted and negated keywords to native OMP interpretation. `jevify` uses
313
+ the native notice, subject to native settings and Eval availability, with no
314
+ extension-command preflight. Installation, profile load, skill application,
315
+ actual native activation, goal creation, and work completion are separate facts.
316
+
317
+ On upgrade, old ULW invocations remain valid in original user text and are
318
+ preserved there. New structured choices use only the canonical values above
319
+ (or `jevify`), not legacy aliases or a `skill://` ID. Existing durable workflow
320
+ records, skill IDs, flags and native journal types are not renamed. A resident
321
+ pre-upgrade Host can still receive the mapped old command if it advertises
322
+ that original extension registration; a compatibility alias on a current Host
323
+ does not stand in for its missing canonical command.
226
324
 
227
325
  ## Managed omp-superkit integration
228
326
 
@@ -255,7 +353,7 @@ not a match against a newer active pointer; an unverified older Host can still
255
353
  be inspected and stopped. Gateway status distinguishes `head.loadedSuperkitPath`
256
354
  (the attached head's startup receipt) from `ulw.packagePath` (next launch).
257
355
  This is not a continuous check of workflow mode or prompt execution. Managed discovery preserves
258
- unrelated native resources and avoids loading a duplicate ULW instance. Refuse
356
+ unrelated native resources and avoids loading a duplicate omp-superkit instance. Refuse
259
357
  configurations the stock CLI cannot express without silently changing scope,
260
358
  discarding custom commands or enabling disabled extensions.
261
359
 
@@ -278,8 +376,34 @@ discarding custom commands or enabling disabled extensions.
278
376
  approval authority. An unresolved run is not repeated; a head stop fence
279
377
  requires explicit per-job resume. Pause and removal can cancel a queued
280
378
  run, not interrupt submitted or uncertain work. Delivery uses the normal
281
- head outbox. See the [operator reference](../OPERATIONS.md#예약-작업-cron)
282
- for schedule syntax and controls.
379
+ head outbox. Direct shell schedules are disabled: an authenticated route and
380
+ scrubbed credentials are not a runtime capability boundary. Legacy shell
381
+ jobs remain inspectable and removable; pending runs are cancelled rather
382
+ than forwarded to a model, and queued shell output is not sent. Verify any
383
+ previously started legacy run on its original host before resolving it.
384
+ See the [operator reference](../OPERATIONS.md#예약-작업-cron) for syntax and controls.
385
+ - [Repository PR intake](../../src/cron-pr-intake.ts) is a typed cron job, not
386
+ an executable prompt. Only original configured-owner Discord guild parent
387
+ controls enroll a repository. Discovery pins the authenticated GitHub owner
388
+ and repository, filters old/self-authored PRs, and records each offer before
389
+ delivery. The separately authenticated registration/mode action sets a bounded
390
+ unattended ceiling: review/comment, safe fix, or protected merge. The confirmed
391
+ bot offer's Discord snowflake identifies the one thread for that PR. A
392
+ noninteractive controller receipt admits an exact SHA to a tool-less native
393
+ lane; it is not owner input and cannot serve as a source for manager tools.
394
+ No ordinary scheduled prompt, observed PR text or model answer grants authority.
395
+ Older discovery-only registrations remain manual until the owner opts in.
396
+ [Review control](../../src/pr-intake-review.ts) binds subsequent actions to
397
+ that lane, route, enrollment epoch, review input, delivered answer and SHA.
398
+ Static review uses a trusted workspace without a contributor checkout. Unlike
399
+ ordinary coding lanes, this restricted local Host must attest a tool-less
400
+ session on a supported native provider before the controller submits patch
401
+ data. It does not need manager, coordination, shell or editing tools. Fix
402
+ proposals and merge verdicts are data, not standing write authority. Each
403
+ effect checks the enrolled repository, original route and policy revision;
404
+ higher stages require an explicit policy or a fresh SHA-bound owner command.
405
+ An uncertain write permits read-only reconciliation, not resubmission. See [operator commands
406
+ and supported GitHub protections](../OPERATIONS.md#새-외부-pr-검토-cron-pr-add).
283
407
  - [PR watch](../../src/pr-watch.ts) reads only explicitly registered GitHub PRs
284
408
  through existing `gh` authentication and GETs. Establish a quiet baseline,
285
409
  then record changed observations and their cursor together. Work only while
@@ -287,6 +411,16 @@ discarding custom commands or enabling disabled extensions.
287
411
  between reads. A head stop holds old watches; a merged PR ends observation,
288
412
  while a non-merged closure can later reopen. GitHub content is untrusted, not
289
413
  a new owner source or authority to dispatch, resume, or perform effects.
414
+ The same PR may be watched by different conversations without transferring
415
+ registration or notifications. The original operator can inspect and remove
416
+ their conversation's watch. A pass means the observed checks on the current
417
+ head succeeded, not that branch policy permits merging.
418
+ - Lane watches observe the controller's existing records, not a second Host
419
+ session. Status, stop, and notifications are scoped to the registration's
420
+ original route; stopping observation does not pause or cancel the lane.
421
+ An unloaded Host, an empty socket, and an `agent_end` event are not proof
422
+ that the work stalled or finished. Clear observation requests may route to
423
+ HEAD from a bound thread. Routing text alone changes no subscription.
290
424
 
291
425
  ## Shared information board
292
426