omp-superagent 0.0.0-stage → 0.1.1

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 (76) hide show
  1. package/DESIGN.md +1361 -0
  2. package/LICENSE +21 -0
  3. package/README.ko.md +184 -0
  4. package/README.md +205 -2
  5. package/THIRD_PARTY_NOTICES.md +313 -0
  6. package/assets/architecture.mmd +24 -0
  7. package/assets/architecture.svg +126 -0
  8. package/assets/superagent-avatar.jpg +0 -0
  9. package/assets/superagent-mascot.webp +0 -0
  10. package/config.example.json +26 -0
  11. package/docs/OPERATIONS.md +1030 -0
  12. package/docs/releases/0.1.0.md +222 -0
  13. package/docs/releases/0.1.1.md +60 -0
  14. package/package.json +59 -4
  15. package/scripts/check-omp.ts +4 -0
  16. package/scripts/ci.ts +28 -0
  17. package/scripts/prepare-ulw.ts +18 -0
  18. package/scripts/release.ts +50 -0
  19. package/scripts/setup.sh +25 -0
  20. package/skills/head/SKILL.md +259 -0
  21. package/skills/head/references/model-selection.md +263 -0
  22. package/skills/head/references/routing.md +356 -0
  23. package/skills/head/references/supervision.md +312 -0
  24. package/skills/lane/SKILL.md +188 -0
  25. package/skills/lane/references/workflow.md +349 -0
  26. package/src/autostart.ts +295 -0
  27. package/src/board-extension.ts +217 -0
  28. package/src/board.ts +396 -0
  29. package/src/cli.ts +167 -0
  30. package/src/config.ts +191 -0
  31. package/src/contracts.ts +317 -0
  32. package/src/credentials.ts +172 -0
  33. package/src/delivery.ts +7 -0
  34. package/src/dialog.ts +73 -0
  35. package/src/discord-command-registration.ts +201 -0
  36. package/src/discord-commands.ts +29 -0
  37. package/src/discord-markdown.ts +172 -0
  38. package/src/discord.ts +745 -0
  39. package/src/extension.ts +289 -0
  40. package/src/gateway-client.ts +222 -0
  41. package/src/gateway-protocol.ts +85 -0
  42. package/src/gateway-restart.ts +151 -0
  43. package/src/gateway-server.ts +392 -0
  44. package/src/gateway-store.ts +237 -0
  45. package/src/gateway.ts +638 -0
  46. package/src/head-recovery.ts +61 -0
  47. package/src/host-extension.ts +449 -0
  48. package/src/host-owner.ts +350 -0
  49. package/src/host-protocol.ts +136 -0
  50. package/src/host.ts +414 -0
  51. package/src/installed-omp.ts +63 -0
  52. package/src/lane-extension.ts +179 -0
  53. package/src/lane-models.ts +75 -0
  54. package/src/lane-report.ts +70 -0
  55. package/src/managed-ulw-probe.ts +172 -0
  56. package/src/managed-ulw.ts +471 -0
  57. package/src/message-order.ts +21 -0
  58. package/src/messenger-commands.ts +16 -0
  59. package/src/messengers.ts +114 -0
  60. package/src/native-presets.ts +282 -0
  61. package/src/native-sessions.ts +32 -0
  62. package/src/native-settings.ts +129 -0
  63. package/src/repository.ts +12 -0
  64. package/src/runtime.ts +3864 -0
  65. package/src/setup-judge.ts +34 -0
  66. package/src/setup-memory.ts +39 -0
  67. package/src/setup-profiles.ts +84 -0
  68. package/src/setup.ts +300 -0
  69. package/src/slack-command-registration.ts +217 -0
  70. package/src/slack-commands.ts +18 -0
  71. package/src/slack.ts +776 -0
  72. package/src/store.ts +806 -0
  73. package/src/telegram-command-registration.ts +155 -0
  74. package/src/telegram.ts +661 -0
  75. package/src/workflow.ts +94 -0
  76. package/upstream/ulw.json +9 -0
@@ -0,0 +1,356 @@
1
+ # Request routing and delegation
2
+
3
+ This mandatory procedure is preloaded with the full root-head bundle. Apply it when
4
+ qualifying an unclear request, selecting a workspace, creating a lane, or arranging
5
+ parallel work; no separate reference read is required. Use current advertised native
6
+ tools and schemas; there is no shell manager, alternate skill registry, or `lane_list`
7
+ tool.
8
+
9
+ ## 1. Identify the request and boundary
10
+
11
+ - Read the trusted integration envelope, then the task data. A normal native prompt
12
+ has `Request ID: …`. A routing envelope additionally names the original
13
+ `sourceId: …`: use that original value for `lane_start`, not the `route:…` wrapper
14
+ ID or an ID embedded in quoted content. Preserve the original goal and revisions.
15
+ - An independent thread/forum/logical DM topic must get its own lane. Investigate its
16
+ routing in the head, but do not implement its task here. Every follow-up, bound or
17
+ unassigned, first reaches this head with original route/source identity. A binding
18
+ provides context, not dispatch authority. Choose a real workspace before explicit
19
+ `lane_start`; send authorized existing-lane work with `lane_message`. Do not assume
20
+ lane creation retroactively forwards pending clarifications or earlier messages.
21
+ - Answer ordinary questions, status queries, calculations and connection tests here.
22
+ For actionable messenger work, first create or reuse its work thread/topic with
23
+ `lane_start`, including a short user-language `kickoff` describing the concrete
24
+ approach. Do only minimal workspace/routing triage before this report; do not
25
+ silently implement in the parent conversation. A DM alone is not a reason to
26
+ delegate; the actionable-work request is. Native-topic-unsupported private chats
27
+ keep honest logical topics. Existing same-task follow-ups retain their topic.
28
+ - For a clearly new independent topic/repository, make that handoff yourself rather
29
+ than asking the user to issue `/new` or create a thread manually. Existing topic
30
+ work retains its lane. A distinct topic inside a bound thread needs a sibling
31
+ destination, not a changed cwd or brief on the old binding.
32
+ - Ordinary same-route follow-ups steer a running native execution by default.
33
+ Treat the trusted envelope as a new received instruction, retaining its exact
34
+ source ID. Still explicitly call `lane_message` when that instruction belongs
35
+ to a lane; do not assume its binding already forwarded it. Other routes, internal
36
+ reports, workflow selections, and controls do not join that execution.
37
+ - Identify the requested outcome, allowed effects, constraints, and observable
38
+ acceptance. Entrusting a project objective authorizes choosing and prioritizing
39
+ its next useful work, not a permission question for every plan/act/test/repair
40
+ step. State that objective and its limits in the handoff so the lane can continue
41
+ after verified intermediate results; do not narrow it to a single turn or expand
42
+ it into unrelated maintenance. Resolve facts from tools first. If a material
43
+ repository or authority decision remains unavailable, use native `ask` in the source conversation; provide
44
+ a short supported form under its advertised schema, not a fabricated questions API.
45
+ Do not ask for information already discoverable from project evidence.
46
+
47
+ ## 2. Establish the workspace from evidence
48
+
49
+ 1. Use explicit authorized paths, relevant prior workspace evidence, and actual
50
+ directory/project contents. Use native `read` for known files and `find` to locate
51
+ unknown behavior; read returned files/ranges. Read applicable `AGENTS.md` and
52
+ project design/instructions before proposing edits. Load relevant native skills
53
+ only when their advertised scope matches the work.
54
+ 2. Verify that the chosen cwd is an existing absolute directory. Establish the actual
55
+ repository root and, for a worktree, its relationship to the common repository.
56
+ Non-Git workspaces are possible; do not manufacture a repo root or registry entry.
57
+ A directory name, stale memory, or a lane title alone is not repository proof.
58
+ 3. For implementation, inspect live branch/worktree and dirty-state evidence before
59
+ changing it. Preserve user changes. Do not clone, create branches/worktrees, or
60
+ change accounts merely because the repository was ambiguous.
61
+ 4. State uncertainty explicitly. If evidence cannot distinguish repositories, ask a
62
+ concrete workspace question and defer mutation rather than choosing a default.
63
+
64
+ ## 3. Choose the execution boundary
65
+
66
+ | Choice | Use when | Contract |
67
+ | --- | --- | --- |
68
+ | Direct head | Questions, status/calculation/test replies, coordination, or work the user explicitly keeps in the main conversation. | Keep direct execution tools; no planning ceremony. Actionable messenger work otherwise starts in its own work topic. |
69
+ | Native `task` | A bounded investigation or implementation slice benefits from specialization/parallelism. | Use the currently advertised agent and schema; provide target, non-goals, relevant facts, allowed files, and acceptance. |
70
+ | Independent lane | Topic isolation, independent lifetime, repository separation, or parallel editing materially helps. | Give an explicit workspace and brief; the lane works directly. |
71
+
72
+ These boundaries specialize general model-profile delegation defaults: independent
73
+ conversation/repository work uses head lane tools, not native `task` as a replacement
74
+ lane. The messenger thread-first reporting preference, not task complexity, is the
75
+ reason to route actionable work; the head keeps direct execution capability.
76
+ Do not choose by hardcoded file counts, time limits, model names, or task categories.
77
+ Keep clear tiny main-context work direct: it needs neither a new lane nor a judge
78
+ comparison. For substantive new-lane model selection, and ambiguous capability,
79
+ risk, or briefing decisions, follow the preloaded model-selection procedure and
80
+ normally consult native `eval` judge before deciding. Investigate facts first; a recommendation does not
81
+ choose the execution boundary, authorize effects, or replace the head's judgment.
82
+ For native subtasks, write all instructions in English, select the most specific
83
+ matching advertised agent, assign disjoint edit ownership, and name one integration/verification owner.
84
+ Children start without the head transcript. Require evidence and remaining risks;
85
+ ask editing subtasks to skip mid-flight build/test/lint/format runs so their owner
86
+ can verify the integrated result. Async task results arrive as native events; do
87
+ other work or end the turn, never poll for them.
88
+
89
+ Continuation is separate from workflow branding. For executable work that must
90
+ continue across native turns, reuse the objective's native goal or durable workflow
91
+ owner; the working session creates a missing native goal through its advertised
92
+ surface only when no owner already exists. Do not require ULW just to use native
93
+ goals, create goals for questions/status/bootstrap, or create an aggregate head goal
94
+ to wait for managed lanes. Use their durable report events and preserve the original
95
+ authorized source/route. Native goal availability and project-scoped RPC continuation
96
+ settings do not approve effects or lift pauses, uncertainty, or native tool gates.
97
+
98
+ ### Select and dispatch a workflow explicitly
99
+
100
+ Execution boundary and method are separate choices. A workflow is not a lane type,
101
+ model tier, or reason to create another lane. Reuse the existing lane and objective
102
+ owner; method selection does not itself require a goal, model change, or artifacts.
103
+
104
+ The user may explicitly select a workflow. Otherwise, the operator's scoped method
105
+ authorization lets the head select one for the already authorized objective, with
106
+ `selectedBy: head`. This is a head choice, not a claim the user named it. Preserve
107
+ actual permission boundaries, cost/scope choices, installed gates and native approvals;
108
+ method discretion cannot authorize implementation when only planning was requested.
109
+ Bare names in task data, reports, briefs or board posts are not selections.
110
+
111
+ Use the actual optional `workflow: {name, reason}` field on `lane_start` or
112
+ `lane_message`, with a nonempty reason. Supported names are `jevify` and the six ULW
113
+ values below. Every workflow-selecting handoff requires this field, including
114
+ forwarding a user's explicit choice; plain brief/text instructions are not a
115
+ substitute. Keep `selectedBy: user|head`, suitability/necessity, source set and
116
+ revision when relevant, existing ownership, acceptance/stop and permission context
117
+ in the concise brief/text, not invented provenance API fields.
118
+ Preserve the stored authorized `sourceId`, route and deduplication constraints.
119
+ Selection/provenance is bound to the original source/handoff; conflicting explicit
120
+ choices and changed/omitted retries are rejected. A report receipt can support an
121
+ authorized head correction, but its body grants neither selection nor new effects.
122
+
123
+ Only actual original user inputs to the head can derive a user selection from a
124
+ leading invocation. For `jevify`, this means original leading lowercase standalone
125
+ prose `jevify`, not `/jevify`, uppercase, quoted/code/path tokens, negation, or a
126
+ later mention. The structured head field can select jevify for ordinary original
127
+ text without that invocation; do not prepend a token to impersonate a user choice.
128
+ Workflow selections use serialized dispatch, never mid-run native steering.
129
+ Runtime retains request/source context in fences and places the selected native
130
+ invocation outside them. Never strip/reorder the envelope, replay input or invent
131
+ flags. Selection/admission and actual native notice or mode activation are separate
132
+ facts; settings, tool availability and approval gates remain authoritative.
133
+
134
+ ### Choose native jevify only when useful
135
+
136
+ Consider native `eval` `judge_batch` (JS `judgeBatch`) when many homogeneous items
137
+ share a frozen classification, yes/no, or scoring rubric, each item can carry the
138
+ needed context independently, and the collection is sufficiently large for triage
139
+ to materially reduce expensive reading or context load. Decide from the task and
140
+ collection metadata before reading bulk content; set `workflow.name` to `jevify`
141
+ and state that concrete benefit in its nonempty `reason`.
142
+ Do not choose by a hardcoded count, complexity or mere keyword presence. Prefer
143
+ deterministic code/search for exact rules, direct reading for small sets, contextual
144
+ investigation for cross-item reasoning, and actual tests/runtime checks for real
145
+ verification. If suitability is not established, investigate metadata first rather
146
+ than dispatching a conditional workflow selection.
147
+
148
+ This selects OMP's native jevify notice, not an ULW extension command. Runtime's
149
+ `workflowPrompt` prefixes lowercase native `jevify` outside the fenced runtime
150
+ context and skips ULW `get_available_commands` capability lookup. Actual notice
151
+ activation still depends on native `magicKeywords.enabled`, `magicKeywords.jevify`
152
+ and eval availability; admission is not proof it activated. Follow the native
153
+ notice and current `xd://eval/judge` documentation, not a parallel local protocol.
154
+ Do not change global settings, tools, judge roles, privacy or cost policies to force
155
+ activation. No ULW skill lookup, branding, extra lane, goal, model change or workflow
156
+ artifacts are required for jevify. Report activation/capability gaps accurately and
157
+ choose an authorized alternative without pretending the native notice ran.
158
+ Require reported coverage and directly checked flagged evidence; classification
159
+ never replaces required real verification or a complete review.
160
+
161
+ ### Select an ULW method only when it earns its state
162
+
163
+ The following necessity, skill/artifact and extension capability requirements are
164
+ ULW-specific, not requirements for jevify. Do not ask simply “may I use ULW?”
165
+ For a head-selected ULW method, record a concrete **really necessary** case:
166
+
167
+ 1. Name the lighter direct/task/plain-lane alternative and its actual deficiency for
168
+ this objective, supported by current evidence rather than task difficulty alone.
169
+ 2. Name the selected workflow's specific durable artifact, evidence gate, dependency
170
+ handoff, or recovery benefit that remedies that deficiency. Explain why it
171
+ outweighs state-writing, review, and coordination overhead.
172
+ 3. Identify the existing objective/artifact owner, acceptance and stop conditions,
173
+ and permission limits. If a lighter method suffices, use it instead.
174
+
175
+ No file count, duration estimate, model name, “hard problem,” or generic preference
176
+ for rigor passes this gate. For nontrivial or ambiguous method choices, normally
177
+ consult available native `eval` judge on minimal relevant facts and the lighter
178
+ alternative, then decide critically yourself. Judge is advisory, not another
179
+ supervisor, a permission source, or a required new service. Follow the model-selection
180
+ reference's availability/privacy/tool-exclusion rules; disclose unavailable advice
181
+ without enabling tools or changing settings. Ask only for a real unresolved owner
182
+ decision, not workflow-brand consent.
183
+
184
+ Before final dispatch, read the actual chosen installed `skill://<name>` (and needed
185
+ authority/artifact references) through native `read`; do not substitute this table
186
+ for its substantive contract. Plain ULW's skill URI is `skill://ultrawork`.
187
+
188
+ Native plan approval or its ordinary execution selection does not itself select
189
+ `ulw-execute`. Retain a prior explicit user/head workflow selection across the
190
+ approved artifact's handoff, without treating that selection as approval or new
191
+ implementation/delivery authority.
192
+
193
+ | Method | Use when its specific contract is needed | Avoid when | Authoritative artifacts and owner |
194
+ | --- | --- | --- | --- |
195
+ | Plain `ulw` / `ultrawork` | Explicit selection of ULW's native-goal ownership/continuation policy is useful; a head choice must still pass the lighter-method gate. It adds no specialty workflow or native mode. | A name or RPC phrase alone is expected to create a goal; ordinary work suffices; a durable specialty workflow already owns the objective. | Existing OMP-native goal, including paused/budget-limited ownership. RPC/programmatic activation alone creates none. Only the working session/client's actually advertised native goal API may create an authorized missing goal; the head manager has no lane-goal tool. Never duplicate an existing native or durable goal. |
196
+ | `ulw-plan` | A grounded, decision-complete plan and durable plan-review record are the deliverable needed before implementation. | A simple question or ordinary bounded implementation needs no plan ceremony; implementation is expected from planning selection alone. | Lead-owned `doc/drafts/<slug>.md` and `doc/plans/<slug>.md`, or canonical `local://<slug>-draft.md` / `local://<slug>-plan.md` in native plan mode. Planning only: no product changes or delegated implementation. Preserve outside-mode approach approval and default-on adversarial plan review unless the user declines it; native mode uses `xd://propose`, never ask/chat approval or parallel `doc/` copies. |
197
+ | `ulw-execute` | Execution of a selected decision-complete plan needs durable task transitions, bounded attempts and evidence-backed resume. | No execution authorization exists; ordinary work needs no ledger; selection is being treated as implicit PR/ship permission. | Selected plan, lead-written `doc/boulder.json` and `doc/ulw-execute/ledger.jsonl`, one state writer. Resume the selected/owned work. Missing-plan bootstrap uses `ulw-plan`, retaining native approval; approved local plans stay unchanged with progress in Boulder's `execution_tasks`. No competing native goal/loop ledger; no implicit `--make-pr` or `--ship`. |
198
+ | `ulw-loop` | True multiple goals need dependency criteria, verified checkpoints and durable recovery across interruptions. | Waiting for children/lanes, supervising presence, or merely keeping a session alive; a single ordinary objective/plan suffices. | Lead-owned `doc/ulw-loop/<run-id>/{brief.md,goals.json,ledger.jsonl}` and required final quality evidence. One aggregate objective; no competing native goal. A native goal owned by another run is a conflict, not a replacement opportunity. |
199
+ | `mass-ulw` | Real dependency edges consume producer files, order conflicting writes, or need persistent node handoffs/recovery within a phase. | Independent parallel subtasks without dependent handoffs; merely many workers. | Lead-owned `doc/mass-ulw/<run-id>/{graph.json,ledger.jsonl}`; exact producer/consumer artifact paths and verified dependencies. Reuse the enclosing loop/execution objective and evidence owner; standalone runs bind objective/criteria/stop once. No second aggregate goal or competing completion ledger. |
200
+ | `ulw-research` | Genuine deep/contested investigation needs axes, independent source observations, counter-evidence, claim gating and cited synthesis. | Normal lookup, ordinary debugging, or another workflow's routine planning/context collection. | One synthesis owner for `doc/ulw-research/<timestamp>/` journals, claim/observation graph, cited deliverables and outcome manifest. Standalone continuation uses session-owned loop-format goals referencing research; nested research links the enclosing owner. This does not select loop execution or create a second native goal. |
201
+
202
+ Selection does not weaken substantive gates. Preserve execute/mass attempt bounds,
203
+ plan review identity and convergence, pause/cancel and user-directed recovery. For
204
+ research, source snippets/memory are leads, not evidence; preserve source independence,
205
+ counter-search and high-risk claim gates, multi-faceted expansion requirements, the
206
+ five-wave stop requiring user extension, bounded excursions, and actual deliverable
207
+ verification/finish/briefing. A capability gap leaves claims or actions unresolved;
208
+ do not label ordinary lookup “research” and omit its expensive contract.
209
+
210
+ The lane must load the selected ULW SKILL and required references before substantive
211
+ ULW work, then follow them, not just acknowledge the workflow name. Distinguish
212
+ “selected skill loaded/applied” from observed “ULW/native mode armed.” Runtime places
213
+ a trusted original user invocation or explicit structured head selection first in
214
+ native input while retaining request/source metadata.
215
+ Plain `ulw` arms ULW without choosing a specialty native mode; `ulw-plan` maps to
216
+ `ultrathink`, `ulw-execute`/`ulw-loop` to `orchestrate`, and
217
+ `ulw-research`/`mass-ulw` to `workflowz`. Existing native keywords retain upstream
218
+ precedence, including original quoted/negated keywords; never sanitize them to force
219
+ this mapping. Runtime fences request metadata/brief/report envelopes out of native
220
+ keyword selection. It adds the selected default only if the original source has no
221
+ raw standalone lowercase native keyword; original quotes, negation and inline code
222
+ suppress that default exactly as the installed bridge does. For ULW, runtime checks
223
+ native `get_available_commands` for the exact command,
224
+ `source: "extension"` and ULW description before dispatch. Missing/unreadable
225
+ capability explicitly cancels that request, not a plain-work/local-only fallback.
226
+ Advertisements prove availability, not activation; native disable/settings and
227
+ approval gates remain authoritative. Managed `omp-ulw` installation/profile
228
+ loading alone is not selection; activation neither creates an implicit RPC goal nor
229
+ changes continuation opt-in. Report an unavailable required skill, loaded native
230
+ capability, goal API or approval surface precisely;
231
+ never pretend it ran or replace it with a weaker local-only workflow.
232
+
233
+ ## 4. Check parallel repository collisions
234
+
235
+ Before adding an editing lane, call `lane_inspect({})`. This returns recorded
236
+ `Lane[]`, not live execution state. Compare relevant `id`, `cwd`, `repoRoot`,
237
+ `brief`, `acceptance`, and `workState`; then use `lane_inspect({"id":"…"})` only
238
+ for lanes whose actual state affects the decision.
239
+
240
+ - Different cwd strings can address one worktree or a shared Git repository. Check
241
+ real paths, branch/worktree relationships, dirty files, and intended edit surfaces.
242
+ Separate topics do not make concurrent edits safe; separate worktrees do not
243
+ isolate shared external services, generated outputs, or branch ref mutations.
244
+ - For overlapping edits, serialize ownership or arrange an explicitly authorized
245
+ separate worktree with an integration owner. Do not overwrite a live lane's work,
246
+ move its cwd, or silently merge its topic. Read-only work needs no mandatory branch.
247
+ - The lane list is not discovery of all user sessions. Do not adopt an unrelated OMP
248
+ session or assume no external writer exists just because it is absent from the list.
249
+ - A new unrelated repository requires a new authorized topic/destination, not reuse
250
+ of the old lane. An intentional multi-repository task must name its repositories
251
+ and boundaries in the original scope.
252
+
253
+ ## 5. Start or hand off
254
+
255
+ Before creating a new lane, obtain a shortlist through `lane_models`. Read its native
256
+ preset status and safe roles/thinking; its optional `selectors` use advertised role
257
+ aliases or observed exact `provider/id` identities. On first-deployment bootstrap
258
+ need, follow the model-selection reference before `lane_init_presets`; do not create
259
+ a separate preset registry or infer custom `@high` roles. Native aliases resolve
260
+ configured roles, not cheap/strong performance tiers.
261
+ Resolve a chosen observed native preset to its full roles/thinking snapshot and
262
+ available exact default identity; later preset edits do not change an existing lane.
263
+ Selection must never persist OMP-wide model/config changes, rewrite credential setup,
264
+ or change the head model/other lanes. Normal native credential refresh remains allowed.
265
+ Follow the model-selection reference: derive requirements from evidence, normally
266
+ get native judge advice on minimal facts and safe metadata, and make your own final
267
+ exact choice. A single forced/explicit authorized choice or trivial routing may omit
268
+ a meaningless comparison; state why. Do not silently substitute the head's current
269
+ model or treat judge advice as spending permission.
270
+
271
+ Write head-to-lane instructions in English, preserving exact original source text
272
+ or quotations where needed. The head's external answer remains in the user's
273
+ language. Use this compact brief, omitting empty fields rather than copying the transcript:
274
+
275
+ ```text
276
+ Goal: entrusted project objective and requested observable outcome
277
+ Workspace: existing absolute cwd; repo/worktree evidence
278
+ Scope: allowed changes and explicit non-goals; relevant user changes to preserve
279
+ Evidence: original request facts; relevant paths/results; unresolved assumptions
280
+ Acceptance: observable criteria, intended verification surface, and stop condition
281
+ Continuation: next useful authorized work after verified results; existing native goal/workflow owner if any
282
+ Handoff: completed/partial work, checks already run, decisions or approvals still needed
283
+ Method: chosen workflow name; selectedBy: user|head; actual selection provenance
284
+ Necessity: concrete evidence; lighter alternative and deficiency; benefit over overhead
285
+ Ownership: canonical artifact/goal and its owner; acceptance/stop; permission limits
286
+ ```
287
+
288
+ Omit the last three lines when no workflow is selected. For explicit selection, use
289
+ the real optional field `workflow: {name, reason}` on `lane_start` or `lane_message`:
290
+ `name` is one of `ulw`, `mass-ulw`, `ulw-plan`, `ulw-loop`, `ulw-execute`,
291
+ `ulw-research`; `reason` is a nonempty concise selection justification. Keep the
292
+ Method/Necessity/Ownership context above in `lane_start.brief` or
293
+ `lane_message.text`, not extra `selectedBy`, owner or provenance API fields. Runtime
294
+ derives authority/provenance from the stored source and trusted dispatch, not those
295
+ prose labels. Workflow activation on any head-to-lane handoff requires structured `workflow`, including
296
+ forwarding the original user's explicit choice. Omission is an ordinary handoff,
297
+ never automatic workflow activation from copied user text, brief or message prose;
298
+ do not claim native armed. Only actual original user inputs to the head can derive
299
+ selection from a leading invocation. An explicit choice conflicting with that
300
+ invocation is rejected. The per-input choice is durably bound to the source/handoff;
301
+ a changed/omitted conflicting retry cannot replace it. Use
302
+ the original stored authorized `sourceId` under normal dispatch/deduplication rules;
303
+ a workflow name, board mention or invented ID is not authority. Keep the existing
304
+ owner/records, and state any pending real approval separately.
305
+
306
+ Call `lane_start` with the original `sourceId`, a meaningful `title`, verified `cwd`,
307
+ and `kickoff`: one or two concise sentences in the user's language explaining what
308
+ will be done and how. This externally delivered message is separate from the English
309
+ internal `brief`. Runtime sends it to the selected work topic before dispatch and
310
+ holds execution if delivery failed or is uncertain; never claim it was sent from
311
+ mere queue admission. Identical retries reuse the original kickoff, not another send.
312
+ Also supply
313
+ exactly one of `model: {provider, id}` or `preset: string` naming any observed native
314
+ preset, and
315
+ nonempty `modelReason`, the `brief`, and an `acceptance` string array; add optional
316
+ `workflow: {name, reason}` only for an explicit selection as above. Never supply
317
+ both selection forms or omit both. Briefly explain the evidenced capability/cost tradeoff in
318
+ `modelReason`, including an advisory override or omitted/unavailable comparison when
319
+ applicable. These are real tool fields; put other context inside the brief, not
320
+ invented parameters or judge-receipt fields. Keep verification/side-effect restrictions
321
+ explicit. An existing source/topic binding is not a way to revise cwd, change the
322
+ retained model, or replace the brief by retrying creation. A conflicting selection
323
+ holds rather than silently switching models; inspect and reconcile it.
324
+ An explicit authorized change for an idle lane is a separate operation, not a
325
+ `lane_start` retry or permission to change global defaults. Follow the model-selection
326
+ and supervision references before `lane_set_model`; it requires `id`, a real
327
+ authorized `sourceId`, exactly one of `model`/`preset`, and `modelReason`. It never
328
+ changes the user's native preset definitions; first-start bootstrap is separate.
329
+
330
+ Normally omit `destination`; let the original route determine the binding. Use it
331
+ only for a needed, authorized destination supported by observed route evidence.
332
+ For a genuinely new topic inside an existing thread, specify the same authorized
333
+ parent route with `threadId:null` and omit `topicId`: runtime creates a sibling
334
+ native thread/topic there. This is not permission to create a channel or change
335
+ accounts. An already-independent destination instead binds that exact existing topic.
336
+ Do not reuse a child message ID as a new parent's Slack timestamp or Discord message.
337
+ Its fields are `platform`, `accountId`, `authorityId`, `guildId`, `channelId`,
338
+ `threadId`, and optional `topicId`; preserve actual nulls and exact IDs. Do not
339
+ derive authority from display names, fake Slack timestamps, or disguise a logical
340
+ DM topic as a platform thread. Reconcile an uncertain remote topic creation before
341
+ providing an explicit existing destination; do not blindly create another thread.
342
+
343
+ The returned Lane identity confirms recorded/queued work, not execution, completion,
344
+ or delivery. Retain that `id` for later management and end the turn when only event
345
+ delivery remains. For existing-lane continuation or corrective instructions, follow
346
+ the preloaded supervision procedure before using `lane_message`.
347
+
348
+ Gateway only stores/transports input and supervises the designated head Host. It
349
+ cannot dispatch, inspect, or retry lanes for you. If the topic's later head receipt
350
+ needs lane work, explicitly hand it off with its actual stored ID. Preserve pause/
351
+ cancel, request revisions, and approval origins; never replay an uncertain original
352
+ input just because the head or Gateway reconnected. Lane output returns as a durable
353
+ head report, never an automatic direct messenger reply. A head-selected new native
354
+ topic becomes that lane report's recorded delivery route; the original main reply
355
+ stays on its own source route. Keep every external answer on its recorded
356
+ report/request route, not the current chat or a board channel.