@undefineds.co/linx 0.3.20 → 0.3.22

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 (97) hide show
  1. package/dist/generated/version.js +1 -1
  2. package/dist/index.js +6 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/auto-mode/pod-persistence.js +53 -3
  5. package/dist/lib/auto-mode/pod-persistence.js.map +1 -1
  6. package/dist/lib/auto-mode/secretary.js +2 -2
  7. package/dist/lib/auto-mode/secretary.js.map +1 -1
  8. package/dist/lib/chat-api.js +23 -61
  9. package/dist/lib/chat-api.js.map +1 -1
  10. package/dist/lib/codex-plugin/index.js +1 -0
  11. package/dist/lib/codex-plugin/index.js.map +1 -1
  12. package/dist/lib/codex-plugin/symphony-mcp.js +335 -0
  13. package/dist/lib/codex-plugin/symphony-mcp.js.map +1 -0
  14. package/dist/lib/linx-cloud-errors.js +0 -5
  15. package/dist/lib/linx-cloud-errors.js.map +1 -1
  16. package/dist/lib/linx-status-line.js +1 -8
  17. package/dist/lib/linx-status-line.js.map +1 -1
  18. package/dist/lib/models.js +3 -2
  19. package/dist/lib/models.js.map +1 -1
  20. package/dist/lib/pi-adapter/auth.js +68 -0
  21. package/dist/lib/pi-adapter/auth.js.map +1 -0
  22. package/dist/lib/pi-adapter/branding.js +34 -103
  23. package/dist/lib/pi-adapter/branding.js.map +1 -1
  24. package/dist/lib/pi-adapter/interactive.js +35 -49
  25. package/dist/lib/pi-adapter/interactive.js.map +1 -1
  26. package/dist/lib/pi-adapter/pod-mirror.js +38 -107
  27. package/dist/lib/pi-adapter/pod-mirror.js.map +1 -1
  28. package/dist/lib/pi-adapter/pod-native.js +2 -0
  29. package/dist/lib/pi-adapter/pod-native.js.map +1 -1
  30. package/dist/lib/pi-adapter/pod-tools.js +140 -0
  31. package/dist/lib/pi-adapter/pod-tools.js.map +1 -0
  32. package/dist/lib/pi-adapter/runtime.js +2 -12
  33. package/dist/lib/pi-adapter/runtime.js.map +1 -1
  34. package/dist/lib/pi-adapter/session.js +13 -17
  35. package/dist/lib/pi-adapter/session.js.map +1 -1
  36. package/dist/lib/pi-adapter/stream.js +2 -20
  37. package/dist/lib/pi-adapter/stream.js.map +1 -1
  38. package/dist/lib/pod-chat-store.js +53 -4
  39. package/dist/lib/pod-chat-store.js.map +1 -1
  40. package/dist/lib/resource-identity.js +2 -0
  41. package/dist/lib/resource-identity.js.map +1 -0
  42. package/dist/lib/status-line-command.js +2 -2
  43. package/dist/lib/status-line-command.js.map +1 -1
  44. package/dist/lib/symphony/archive.js +15 -37
  45. package/dist/lib/symphony/archive.js.map +1 -1
  46. package/dist/lib/symphony/pod-projection.js +189 -1346
  47. package/dist/lib/symphony/pod-projection.js.map +1 -1
  48. package/dist/lib/symphony-command.js +209 -109
  49. package/dist/lib/symphony-command.js.map +1 -1
  50. package/dist/plugins/linx-symphony-codex/.codex-plugin/plugin.json +38 -0
  51. package/dist/plugins/linx-symphony-codex/.mcp.json +10 -0
  52. package/dist/plugins/linx-symphony-codex/README.md +9 -0
  53. package/dist/plugins/linx-symphony-codex/hooks.json +60 -0
  54. package/dist/plugins/linx-symphony-codex/scripts/symphony-hook-events.mjs +119 -0
  55. package/dist/plugins/linx-symphony-codex/scripts/symphony-mcp.mjs +335 -0
  56. package/dist/plugins/linx-symphony-codex/skills/symphony/SKILL.md +791 -0
  57. package/dist/skills/symphony/SKILL.md +7 -0
  58. package/dist/skills/xpod-cli/SKILL.md +2 -13
  59. package/package.json +4 -4
  60. package/vendor/agent-runtime/dist/chat-reconciler.d.ts +33 -0
  61. package/vendor/agent-runtime/dist/chat-reconciler.js +108 -0
  62. package/vendor/agent-runtime/dist/index.d.ts +4 -1
  63. package/vendor/agent-runtime/dist/index.js +4 -1
  64. package/vendor/agent-runtime/dist/matrix-client.d.ts +149 -0
  65. package/vendor/agent-runtime/dist/matrix-client.js +220 -0
  66. package/vendor/agent-runtime/dist/pod-resource-identity.d.ts +17 -0
  67. package/vendor/agent-runtime/dist/pod-resource-identity.js +54 -0
  68. package/vendor/agent-runtime/dist/reconciler.d.ts +0 -11
  69. package/vendor/agent-runtime/dist/reconciler.js +5 -43
  70. package/vendor/agent-runtime/dist/symphony.d.ts +272 -27
  71. package/vendor/agent-runtime/dist/symphony.js +1268 -21
  72. package/vendor/agent-runtime/dist/workspace.d.ts +61 -0
  73. package/vendor/agent-runtime/dist/workspace.js +81 -0
  74. package/vendor/agent-runtime/package.json +5 -1
  75. package/vendor/stores/dist/current-pod-base.d.ts +2 -0
  76. package/vendor/stores/dist/current-pod-base.js +14 -0
  77. package/vendor/stores/dist/exact-records.d.ts +7 -0
  78. package/vendor/stores/dist/exact-records.js +87 -0
  79. package/vendor/stores/dist/index.d.ts +1 -0
  80. package/vendor/stores/dist/index.js +1 -0
  81. package/vendor/stores/dist/login.d.ts +51 -0
  82. package/vendor/stores/dist/login.js +195 -0
  83. package/vendor/stores/dist/pod-collection.d.ts +28 -0
  84. package/vendor/stores/dist/pod-collection.js +194 -0
  85. package/vendor/stores/dist/pod-write-guard.d.ts +5 -0
  86. package/vendor/stores/dist/pod-write-guard.js +133 -0
  87. package/vendor/stores/dist/symphony-control.d.ts +245 -0
  88. package/vendor/stores/dist/symphony-control.js +2175 -0
  89. package/vendor/stores/package.json +14 -0
  90. package/dist/lib/capture/persistence.js +0 -377
  91. package/dist/lib/capture/persistence.js.map +0 -1
  92. package/dist/lib/capture/tool.js +0 -242
  93. package/dist/lib/capture/tool.js.map +0 -1
  94. package/dist/skills/basic/SKILL.md +0 -46
  95. package/dist/skills/capture/SKILL.md +0 -165
  96. package/vendor/agent-runtime/dist/coordination.d.ts +0 -93
  97. package/vendor/agent-runtime/dist/coordination.js +0 -145
@@ -0,0 +1,791 @@
1
+ ---
2
+ name: symphony
3
+ description: "LinX Symphony control-plane skill for system evolution: maintain control records, judge whether input changes existing design/work, coordinate Secretary/workers, and feed evidence back into system state."
4
+ ---
5
+
6
+ # Symphony
7
+
8
+ Use this when LinX Symphony mode is enabled, when the user says `$symphony`, when
9
+ the Codex project prompt `/symphony` is invoked, or when a coding agent is
10
+ designing, implementing, or reviewing Symphony behavior.
11
+
12
+ This skill is the single Symphony skill. It covers portable control-plane
13
+ semantics and Codex control-lane behavior. It does not require LinX Pod/xpod and
14
+ does not implement product `/symphony`, Pod persistence, backend projection, or
15
+ storage templates.
16
+
17
+ `/symphony` is only a control switch. In product runtime, the objective comes
18
+ from a normal user chat message.
19
+
20
+ ## Core Loop
21
+
22
+ Run this loop before creating work or dispatching workers:
23
+
24
+ ```text
25
+ System Situation
26
+ -> Evolution Judgment
27
+ -> Execution Control
28
+ -> Evidence Feedback
29
+ -> updated System Situation
30
+ ```
31
+
32
+ ## Recording Trigger
33
+
34
+ Do not wait for the user to say "record" or "summarize." Every conversation
35
+ produces signals—Idea, Design Decision, Research Finding, Meta-Rule,
36
+ Product Direction, or Project Context. The Secretary must decide when
37
+ these signals should become durable control records.
38
+
39
+ Judgment rules:
40
+
41
+ - A clear design conclusion has been reached ("放弃长链条归因 → 版本记录").
42
+ → Create or update the relevant control record. Ask for the user only
43
+ when authority, target, or type classification is ambiguous.
44
+ - The user has corrected the Secretary's behavior ("你应该自己判断什么时候记录").
45
+ → This is a Meta-Rule. Record it as one.
46
+ - A research finding with external evidence has been cited ("GraphGPO 困于单任务轨迹").
47
+ → Record it with provenance.
48
+ - A new candidate work item or architectural direction has been identified.
49
+ → Record it as an Idea first. Promote to Issue only when acceptance, scope,
50
+ and compatibility impact are clear.
51
+ - The user explicitly asks to record ("记录一下").
52
+ → This is the fallback, not the primary trigger. The Secretary should have
53
+ already proposed recording before the user asks.
54
+
55
+ Do not create a control record for:
56
+
57
+ - Ordinary back-and-forth that doesn't change system state.
58
+ - Transient task instructions ("帮我查一下").
59
+ - Social chatter or off-topic remarks.
60
+
61
+ When in doubt, propose: "这个要落到控制记录里吗?" and show the
62
+ classification (Idea / Decision / Finding / Meta-Rule). The user confirms
63
+ or corrects—once. Do not ask again for the same kind of signal in the same
64
+ session unless the user's intent genuinely changed.
65
+
66
+ ## Runtime Boundary
67
+
68
+ Portable runtimes such as Codex or Claude Code use local Markdown/JSON control
69
+ records plus available tools. LinX runtime must store shared control-plane facts
70
+ in its modeled Pod/RDF resources. In LinX product runtime, local files are only
71
+ runtime-private logs, no-Pod recovery material, or RDF/JSON-LD mirrors pulled
72
+ from Pod; they are not an independent Symphony business schema. Do not put Pod
73
+ paths, RDF predicates, URI templates, or LinX-specific synchronization mechanics
74
+ in this skill; they belong in LinX models/adapters, not as the core Symphony
75
+ skill contract.
76
+
77
+ LinX runtime writes its own control records to modeled Pod/RDF resources as the
78
+ authoritative product state for shared recovery and cross-client visibility.
79
+ Do not describe those writes as sync or projection. Reserve sync/projection
80
+ language for external/backend/runtime facts that are being translated into the
81
+ LinX control plane, or for local mirrors materialized from Pod.
82
+
83
+ The portable Symphony runtime contract is storage-agnostic. It may produce
84
+ control records, work splits, prompts, and reports, but it does not own Pod IO.
85
+ LinX product runtime persists through shared models/repositories. When the
86
+ writer is an AI operating through terminal/tools rather than in-process LinX
87
+ code, `xpod` CLI is the preferred direct Pod tool surface. Use model-backed
88
+ `xpod obj` operations for Symphony resources when available; do not invent a
89
+ parallel Symphony-specific AI tool API and do not hand-patch modeled TTL paths.
90
+
91
+ In LinX Agent Runtime, Pod authority belongs to the runtime session and should
92
+ be inherited by tools launched inside that session. If a Secretary or worker has
93
+ Pod access, `xpod` commands it runs should use the runtime-provided authority
94
+ bridge. Outside that bridge, all Solid apps share the same local auth source
95
+ `$SOLID_HOME/auth/credentials.json`; old `~/.xpod/config.json` and
96
+ `~/.xpod/secrets.json` files are not Solid auth sources, and their presence
97
+ alone must be treated as unauthenticated. If `xpod auth status --json` reports a
98
+ different WebID or Pod root than the shared Solid auth file, treat it as an
99
+ auth-store mismatch and stop before writing. Never ask the model to handle raw
100
+ tokens, refresh tokens, client secrets, cookies, or DPoP material directly.
101
+
102
+ ## Agent Config And Skill Resources
103
+
104
+ Do not treat an agent's backend, model, credentials, tools, or skills as hidden
105
+ prompt blobs. They are managed resources with runtime snapshots.
106
+
107
+ In LinX runtime, an Agent is a resource/container. Its default runtime config is
108
+ metadata on that Agent container; skills are file or folder resources bound by
109
+ lightweight metadata. A Solid-backed implementation may use a container `.meta`
110
+ document to describe the Agent container itself, but Symphony code and prompts
111
+ must not hardcode those paths or predicates. Use shared models, repositories,
112
+ or xpod/adapters for the concrete storage shape.
113
+
114
+ Treat an Agent root as a context folder with multiple authority surfaces, not as
115
+ one merged config object. System-managed surfaces and user-managed surfaces live
116
+ under the same Agent folder. This is analogous to platform/system instructions
117
+ plus a repository `AGENTS.md`: both are loaded into runtime context, but they
118
+ remain separate sources of truth. Do not describe this as a field-level overlay
119
+ that rewrites the system package or user personalization into one blob.
120
+
121
+ The default Secretary Agent key is the system-reserved `__secretary__`.
122
+ The default Secretary Chat may use the same reserved key under the Chat
123
+ resource base, for example `/.data/chat/__secretary__/index.ttl#this`; this
124
+ does not make the Chat resource an Agent identity. Durable Agent, Skill,
125
+ maker/actor, grant-recipient, and runtime snapshot identity should use the
126
+ `/agents/__secretary__/` container resource. Do not treat `.meta` as the Agent
127
+ identity, and do not introduce non-reserved Secretary slugs.
128
+
129
+ Agent root and Agent identity are separate:
130
+
131
+ - The Agent root is the configuration/resource container.
132
+ - An Agent WebID is needed only when the AI acts as an auditable actor,
133
+ requester, maker, grant recipient, credential holder, or authorization
134
+ subject.
135
+ - Ordinary Skills, Issues, Tasks, Runs, Evidence, Reports, and files use their
136
+ own resource URIs; they do not become WebIDs.
137
+
138
+ Skill content is file-backed. Skill metadata may record enabled state, version,
139
+ source, checksum, load policy, dependencies, and relations, but it must not
140
+ duplicate the full skill text in RDF or runtime config. Agent-scoped skill
141
+ resources are bindings/installations; external or reusable skills are referenced
142
+ through source/version/checksum/root and may be materialized locally per Agent.
143
+ Secretary and workers should refer to configured skill resources and loaded skill versions rather than
144
+ assuming a skill is just an invisible system-prompt section.
145
+
146
+ For the default Secretary, system-managed surfaces include the installed
147
+ Secretary package, built-in skill bindings, migration records, capability
148
+ envelope, and default policy pointers. User-managed surfaces include
149
+ `AGENTS.md`, preferences, user-installed skills, grants, memory policy, and
150
+ forked skill bindings. Upgrades may mutate system-managed surfaces only.
151
+ User-managed surfaces survive upgrades unless the user explicitly accepts a
152
+ migration or edits them. If a system skill is customized, represent it as a
153
+ user-managed fork or override binding with its own source/version/checksum.
154
+
155
+ Runtime startup resolves the Agent default config plus launch/session
156
+ overrides, projects the Agent folder in authority order, then freezes the
157
+ effective backend, model, credential source, skill set, loaded system package
158
+ version, user surface revisions, skill checksums, and authority/tool policy into
159
+ Session/Run metadata. Resume should use that snapshot by default. A different
160
+ backend/model/credential source means a new runtime session or an explicit
161
+ override record, not silent mutation of an old run's meaning.
162
+
163
+ ## Control Lane
164
+
165
+ When Symphony is active in Codex:
166
+
167
+ - The main thread discusses requirements, system situation, design, steering,
168
+ acceptance, and final reports with the user.
169
+ - The main thread updates the relevant control record before non-trivial
170
+ implementation delegation.
171
+ - The main thread owns integration, review, closure, and evidence feedback.
172
+ - Implementation and test-writing should be delegated to bounded workers when a
173
+ suitable worker surface is available.
174
+ - If no worker surface is available, simulate the mode locally and say that full
175
+ delegation is unavailable.
176
+
177
+ ## Control Records
178
+
179
+ Treat Symphony docs as control records, not essays. Keep them readable for
180
+ humans and stable enough for agents to bind work, compare state, and append
181
+ evidence without reconstructing truth from chat.
182
+
183
+ Useful headings:
184
+
185
+ - Status
186
+ - Scope
187
+ - Current Truth
188
+ - Active Work
189
+ - Release Boundary
190
+ - Compatibility Impact
191
+ - Evidence
192
+ - Open Questions
193
+ - Next Step
194
+ - Related Docs
195
+
196
+ Keep current truth separate from history. Put rejected alternatives, stale
197
+ notes, and superseded decisions under explicit headings.
198
+
199
+ Do not keep parallel truth copies. A repository document may summarize or link
200
+ to a control state, but the authoritative state field must live in exactly one
201
+ control record. If a local summary is needed for readability, label it as a
202
+ projection and include the source record and revision or timestamp.
203
+
204
+ Steering does not bypass the control record. When a new message changes active
205
+ work, update the relevant control record first, then deliver the resulting
206
+ delta to workers as a bounded steer, restart, cancellation, or follow-up. Do not
207
+ push raw chat into a worker as hidden scope change.
208
+
209
+ Steering deltas are navigation, not authority. Include the updated record path,
210
+ revision or timestamp when available, changed sections, superseded assumptions,
211
+ and required action. If scope, acceptance, release boundary, compatibility,
212
+ privacy, authority, or blocker rules changed, tell the worker to reread the
213
+ affected authoritative sections before continuing.
214
+
215
+ ## State And Ownership
216
+
217
+ Distinguish these axes instead of collapsing everything into one status:
218
+
219
+ - system state: existing, partial, verified, known-broken, deprecated, stale, or
220
+ superseded;
221
+ - work state: drafting, ready, running, blocked, reviewing, completed, failed,
222
+ or cancelled;
223
+ - roadmap state: candidate, planned, deferred, rejected, or superseded;
224
+ - compatibility impact: compatible, behavior_change, breaking, or
225
+ migration_required.
226
+
227
+ Every mutable state field needs a primary writer:
228
+
229
+ - User owns intent, authority, and final acceptance input.
230
+ - Secretary or main control lane owns System Situation, Evolution Judgment, Spec
231
+ state, Work split/assignment, acceptance, compatibility impact, release
232
+ boundary, and closure.
233
+ - Worker owns progress, observed implementation facts, feasibility findings,
234
+ blockers, Implementation Change Requests, and evidence for assigned Work.
235
+ - Runtime/controller owns Run lifecycle and tool/runtime events.
236
+ - Reviewer/verifier owns findings and verification evidence.
237
+
238
+ Resource boundaries:
239
+
240
+ - Message is an immutable utterance or event, not automatically an Issue.
241
+ - Idea is a lightweight candidate extracted from one or more Messages. It is
242
+ not a requirement, decision, Issue, or Task until promoted.
243
+ - Spec holds desired system change, rationale, non-goals, acceptance, and
244
+ compatibility impact.
245
+ - Work/Task is a bounded execution slice.
246
+ - Run is one execution attempt.
247
+ - Delivery is a proposed result package, not accepted truth.
248
+ - Evidence is append-only proof or finding.
249
+ - ReleasePlan is a rolling publish boundary: what is safe to ship now, what
250
+ remains open after release, and what evidence/status must be updated before
251
+ publishing.
252
+
253
+ Chat, Run state, and Delivery have different jobs:
254
+
255
+ - Chat is the low-latency interaction channel between Secretary and a worker.
256
+ It is for clarification, steering, small decisions, and work-in-progress
257
+ coordination.
258
+ - Run state is the scheduler truth. When a worker asks for input, that Run is
259
+ `waiting_input`; if Secretary cannot resolve it, the owning Task/Issue may
260
+ become `blocked`. The system may continue other work instead of pretending
261
+ the worker is still running.
262
+ - Delivery is the stage boundary. It packages proposed results, patches,
263
+ artifacts, verification, risks, and final reports. It is not ordinary chat and
264
+ not accepted truth by itself.
265
+ - Chat must not replace state. Any chat exchange that changes scope,
266
+ acceptance, compatibility, release boundary, authority, or lifecycle state
267
+ must be reflected in the control record.
268
+ - Delivery must not replace chat. Do not force every small clarification into a
269
+ delivery packet when an interactive worker session is available.
270
+
271
+ If a role needs to change state it does not own, it writes a proposal, finding,
272
+ or Implementation Change Request instead of mutating the authoritative field.
273
+
274
+ Prevent split-brain documentation with field-level ownership:
275
+
276
+ - One mutable fact has one authoritative field and one primary writer.
277
+ - Workers may append execution facts, evidence, delivery notes, and scoped
278
+ implementation documentation, but they do not close work or redefine
279
+ acceptance by writing another document.
280
+ - Secretary/control lane merges worker facts into Issue/Spec/Task status only
281
+ after checking evidence, current revision, and acceptance.
282
+ - Repo docs may explain implementation state, but they must not become a second
283
+ task tracker. Link to the control record instead of duplicating lifecycle
284
+ truth.
285
+
286
+ In LinX runtime, the MVP default is that workers do not directly access Pod.
287
+ Secretary/control lane gives workers a task brief or control-record snapshot,
288
+ and workers return progress, blockers, Evidence, Delivery reports, and
289
+ Implementation Change Requests for Secretary/control lane to persist. Direct
290
+ worker Pod read or restricted write is an explicit granted capability; when
291
+ granted, the write surface is still limited to execution facts such as
292
+ Run/RunStep, progress, blockers, Evidence, Delivery reports, and Implementation
293
+ Change Requests. Workers do not directly close Issues, change acceptance,
294
+ rewrite Spec truth, change roadmap/release boundaries, or create grants.
295
+ Structured Pod data must be read/written via shared models/ORM; do not invent
296
+ raw TTL patches or Pod paths inside the skill. LinX product Pod records should
297
+ expose this worker access policy on assigned Task/Delivery/Run/session metadata
298
+ so UI, Secretary, and runtime adapters enforce the same boundary instead of
299
+ relying on prompt text alone.
300
+
301
+ Pod and repository docs have different authority. In LinX runtime, Pod
302
+ Issue/Spec/Task records are the control authority for state, scope, acceptance,
303
+ split, ownership, closure, and cross-client coordination. Repository docs are
304
+ the implementation authority for code-adjacent design, behavior, tests,
305
+ examples, migration details, and file-level evidence. Repo work briefs or
306
+ implementation docs may link to Pod Issue/Spec/Task URIs, but they must not
307
+ become a second Issue truth. If implementation evidence contradicts the Pod
308
+ control record, workers write an Implementation Change Request and the control
309
+ lane updates Pod plus repo docs.
310
+
311
+ ## Idea Capture
312
+
313
+ Use Idea as the buffer between fragmented conversation and committed system
314
+ work.
315
+
316
+ When Symphony is active, capture meaningful but uncommitted fragments as Ideas
317
+ when they describe a possible system direction, concern, product capability,
318
+ modeling principle, or improvement area. Do not capture ordinary chat, games,
319
+ or one-off explanations.
320
+
321
+ An Idea record should stay small and explicit:
322
+
323
+ - summary;
324
+ - source messages or source event references;
325
+ - affected area;
326
+ - status: captured, exploring, candidate, promoted, deferred, rejected, or
327
+ superseded;
328
+ - commitment: thought, direction, tentative_decision, or committed;
329
+ - current understanding;
330
+ - open questions;
331
+ - related records;
332
+ - conflicts;
333
+ - next step.
334
+
335
+ Promotion gates:
336
+
337
+ - Promote Idea to Requirement Candidate only after the problem, area, value,
338
+ current understanding, and open questions are explicit.
339
+ - Promote to Spec only after expected behavior, scope, compatibility impact,
340
+ acceptance, and commitment are explicit.
341
+ - Promote to Work/Task only after implementation boundary, evidence plan, and
342
+ blocker rules are explicit.
343
+
344
+ Symphony may automatically capture and merge Ideas, but it must not
345
+ automatically treat an Idea as committed product semantics or dispatchable work.
346
+ If commitment is unclear, keep it as `thought` or `candidate` and continue
347
+ discussion.
348
+
349
+ ## Sufficiency And Escalation
350
+
351
+ Default to AI judgment inside the current control boundary. It is sufficient to
352
+ proceed without asking when the input binds to one active object, the acting role
353
+ owns the state being changed, acceptance/evidence can be derived from current
354
+ records, and the action is reversible or non-destructive.
355
+
356
+ Escalation is necessary only when missing information belongs to another owner
357
+ and cannot be safely inferred. Workers escalate to Secretary/control lane first.
358
+ The control lane asks the user only for user-owned intent, authority, privacy,
359
+ credentials, destructive permission, or final acceptance.
360
+
361
+ Do not ask the user to decide ordinary implementation details, routine evidence
362
+ choices, obvious duplicate binding, or release bookkeeping.
363
+
364
+ ## Control Gates
365
+
366
+ Control gates are internal decision points. Users do not need to name them.
367
+ Secretary and workers must recognize them when normal execution cannot safely
368
+ continue on the current path.
369
+
370
+ Use the smallest sufficient gate set:
371
+
372
+ - `binding`: decide whether input is ordinary chat, an Idea, a new Issue, a bug,
373
+ or a change to existing work.
374
+ - `change`: decide whether active scope, acceptance, compatibility, release
375
+ boundary, or base revision has changed enough to rebase, steer, restart,
376
+ cancel, split, or supersede work.
377
+ - `feasibility`: decide whether the assigned plan still can be implemented
378
+ under current constraints. Workers may trigger this gate; Secretary/control
379
+ lane resolves it.
380
+ - `authority`: decide whether user-owned authority, credentials, privacy,
381
+ approval, grant, destructive permission, or external production access is
382
+ required.
383
+ - `quality`: decide whether evidence is sufficient or the work needs fixes,
384
+ review, retry, or more tests.
385
+ - `acceptance`: decide whether a Delivery can be accepted, rejected, partially
386
+ accepted, reopened, or turned into follow-up work.
387
+
388
+ A gate is not a chat message, Delivery, or mode. Record it only when it changes
389
+ the control path: a control-record update, Run/Task status transition,
390
+ Implementation Change Request, Approval/InputRequest, Evidence, Report, or
391
+ Delivery decision. If it does not change execution or authority, keep it as
392
+ ordinary discussion or evidence.
393
+
394
+ Default ownership:
395
+
396
+ - Secretary/control lane resolves binding, change, feasibility, quality, and
397
+ acceptance gates when current records and evidence are sufficient.
398
+ - Workers report feasibility, quality, blocker, and change signals; they do not
399
+ resolve gates that alter scope, acceptance, authority, release boundary, or
400
+ closure.
401
+ - The human user is asked only for gates that require user-owned intent,
402
+ authority, privacy, credentials, destructive permission, or final acceptance.
403
+
404
+ ## Evolution Judgment
405
+
406
+ For each meaningful user message or system event, bind it before turning it into
407
+ work:
408
+
409
+ - `ordinary_message`: conversation, explanation, game play, or casual chat. Keep
410
+ it as Message; do not create an Issue.
411
+ - `new_concern`: new system concern or capability direction.
412
+ - `update_existing`: change to an existing capability, Spec, Issue, Task, or
413
+ active execution.
414
+ - `steering`: correction while work is in progress.
415
+ - `bug_or_regression`: observed behavior conflicts with expected system state.
416
+ - `conflict`: request would break current product/system semantics.
417
+ - `duplicate`: already covered by open concern or active work.
418
+ - `defer`: should wait until active branch/spec lands.
419
+ - `ask`: binding, authority, target, visibility, or acceptance is ambiguous.
420
+
421
+ If a new requirement arrives while work is active, diff it against the active
422
+ record first:
423
+
424
+ - same intended outcome with narrower detail: update acceptance/context;
425
+ - changed intended outcome: steer or restart work when it changes the intended
426
+ outcome;
427
+ - incompatible with current semantics: mark conflict or breaking impact;
428
+ - unrelated future direction: capture as roadmap candidate/deferred work;
429
+ - duplicate of existing work: link it and avoid dispatching a second task.
430
+
431
+ Then consider whether the ReleasePlan is still coherent. Symphony does not
432
+ manage AI work by human-style time boxes or work-hour estimates. AI can keep
433
+ working and release continuously, but each release checkpoint needs a clear
434
+ publish boundary, explicit evidence, and status feedback.
435
+
436
+ The release tradeoff is whether to keep working or close and publish the
437
+ verified part now. Consider how much more work remains, whether remaining work
438
+ is uncertain or risky, and whether completed work already satisfies an urgent
439
+ coherent need. Prefer closing a verified release and leaving the rest open when
440
+ the completed part is independently valuable.
441
+
442
+ ## Execution Control
443
+
444
+ Create Issue/Task/Delivery/Session/Run objects only when they help control work.
445
+
446
+ Before dispatching workers for non-trivial work, ensure this chain exists or can
447
+ be represented:
448
+
449
+ ```text
450
+ Spec -> Work -> Status -> Evidence
451
+ ```
452
+
453
+ Workers should receive a stable control record or task brief to follow, not raw
454
+ conversation as scope. Each worker task needs one owner, one objective, concrete
455
+ acceptance, source context, workspace/resource boundaries, dependencies,
456
+ blocker conditions, and instructions to report blockers to Secretary/control
457
+ lane rather than asking the human user directly.
458
+
459
+ Every worker handoff must identify the source record and base revision. A
460
+ worker result based on an old revision is still useful evidence, but it must not
461
+ be merged directly into current control state until Secretary/control lane
462
+ rebases it against the latest record.
463
+
464
+ Symphony separates three spaces, but it does not force every space to split the
465
+ same way:
466
+
467
+ - Control space is shared. Secretary, workers, UI, and runtime adapters refer to
468
+ the same Issue, Spec, Task, Delivery, Session, Run, and Evidence records.
469
+ - Runtime session topology is explicit. A worker may collaborate in the same
470
+ conversation/work room as Secretary, or may run in a separate backend session
471
+ reached by runtime input projection or control events. Do not assume one
472
+ topology from the other.
473
+ - Workspace belongs to a Thread, not to an Agent. One independent Thread may
474
+ have one worker and its own worktree. If three AIs are collaborating in the
475
+ same Thread, they should normally share the same workspace so their edits,
476
+ tests, and evidence are coherent. Different Threads may use separate
477
+ worktrees when isolation or conflict control requires it.
478
+
479
+ Worker workspaces are environment-scoped. A worker's workspace is wherever that
480
+ worker runtime is executing: local shell, remote container, Codex, Claude Code,
481
+ CodeBuddy, cloud runner, or another runtime. Workers assigned to the same
482
+ Thread in the same environment should share the same workspace unless isolation
483
+ is explicitly required. The boundary is portability, not exclusivity: do not
484
+ assume Secretary, the user, or sibling workers in other environments can see the
485
+ same absolute path. Align cross-environment file work through control object
486
+ URIs, environment identity, workspace identity, repo-relative paths plus base
487
+ revision, checksums/etags, patch/artifact URIs, and evidence. Workers write in
488
+ their assigned workspace and report patches, artifacts, changed files, base
489
+ revision, and verification; the control lane decides how to apply or replay
490
+ results elsewhere.
491
+
492
+ Do not require fixed worker roles at the start. Use one bounded owner for one
493
+ coherent Work item by default. Role-based worker dispatch is a future LinX
494
+ runtime capability; when implemented, roles should be execution profiles
495
+ selected from contacts or created as AI contacts, and they bind to Work rather
496
+ than splitting Spec by themselves.
497
+
498
+ Dispatch targets are Contact-first. A Contact is the durable App-visible
499
+ participant and may point to an Agent; a worker instance is only a Run/Session
500
+ role. Chat participants must use Contact URIs, while backend/model/runtime facts
501
+ stay on Agent/Run/Session. Default coding contacts should use backend keys such
502
+ as `codex` unless a deliberate persona is introduced.
503
+
504
+ Interactive worker sessions do not need a Delivery tool for every blocker. When
505
+ Secretary launches or manages the worker session, the worker-facing `user`
506
+ input is a Secretary-controlled projection. If the worker lacks information,
507
+ authority, or a decision, it may ask in that conversation directly; Secretary
508
+ answers from the control record, updates the control record, steers the worker,
509
+ or escalates to the human user when the missing decision belongs to the user.
510
+ Delivery remains the channel for proposed result packages, async handoff,
511
+ artifacts, and final reports, not the required path for ordinary interactive
512
+ clarification.
513
+
514
+ Thread messages and LLM inputs are different layers. A Message records who said
515
+ what in a Thread. Backend `system/user/assistant/tool` inputs are runtime
516
+ projections derived from Thread facts and control records. If Secretary speaks
517
+ on behalf of the user, record Secretary as the maker/source in the Thread and
518
+ let the runtime adapter project that intent into the backend-required role.
519
+ Do not ask workers to fabricate user-authored chat messages just because the
520
+ backend protocol needs a `user` input.
521
+
522
+ Group coordination goes through Thread reconciliation, not direct member
523
+ wakeups:
524
+
525
+ - Chat is the long-lived groupable collaboration surface. Thread is the
526
+ concrete observable work site under a Chat.
527
+ - Messages, control events, Delivery submissions, InboxNotification envelopes, linked approvals/input requests, and
528
+ schedule ticks are appended to a Thread first.
529
+ - A Reconciler observes Thread state, classifies and deduplicates events,
530
+ applies Thread policy, and creates or skips WakeJobs.
531
+ - A Scheduler runs selected agent runtimes from WakeJobs. Agents append their
532
+ outputs back to the Thread.
533
+ - Secretary is an in-Thread agent role, not the program controller. The
534
+ Reconciler may wake Secretary; Secretary then performs semantic judgment.
535
+ - Worker tools may submit structured events such as `input.required`,
536
+ `approval.required`, `worker.blocked`, `change.requested`, or
537
+ `delivery.submitted`, but those events still go through Reconciler/Scheduler.
538
+ - `auto` and Symphony worker Threads use the same path: input, approval, or
539
+ blocker events wake the same-Thread Secretary first; unresolved requests stay
540
+ pending in a linked control resource surfaced through Inbox for the human or higher-level Secretary.
541
+ - Inbox is the ledger for input and approval lifecycle, including requests that
542
+ Secretary resolved automatically. It is also the user-visible passive surface
543
+ for pending approval/input: the user can inspect and act on it directly
544
+ without any chat turn.
545
+ - InboxNotification envelope changes are events distributed through Pod subscribe/watch. Subscribe
546
+ notifies active clients; it does not directly wake a member or create chat.
547
+ Every client may refresh Inbox and display badge/toast state. Only an
548
+ agent-capable client that matches runtime presence/policy and successfully
549
+ claims the linked ApprovalRequest/InputRequest/control resource through `leaseOwner` / `leaseExpiresAt` may schedule a
550
+ local Secretary Inbox-check job.
551
+ Clients that lose the claim remain display-only. If the user is active in a
552
+ main Thread, the winning Secretary may naturally bring the pending item into
553
+ that conversation; if not, the item remains visible in Inbox without forcing
554
+ an interruption.
555
+ - A pending control resource surfaced through Inbox is runtime/control context, not a user-authored,
556
+ system-authored, or developer-authored message. Persist the real actor on the
557
+ `InputRequest`, `ApprovalRequest`, or `ControlEvent`; `InboxNotification` is only the envelope. If a
558
+ backend adapter must project it into a `user` role, label it as a runtime
559
+ control event and not a human user message.
560
+ - Delivery is a stage/result package, not generic message transport. Ordinary
561
+ questions, answers, steering, and checkpoints remain Messages.
562
+ - Schedules are event sources. A schedule tick is appended to a stable schedule
563
+ main Thread and may split a child execution Thread only when work is noisy,
564
+ long-running, worker-owned, or needs separate review.
565
+
566
+ ## Worker Protocol
567
+
568
+ Worker-facing minimum contract:
569
+
570
+ - Treat the worker-facing `user` input as Secretary-controlled unless the task
571
+ brief explicitly says a human is speaking directly.
572
+ - Read the assigned control record or task brief before implementation.
573
+ - Keep ordinary clarification in chat with Secretary.
574
+ - When waiting on Secretary or user-owned authority, report the blocker and
575
+ allow the Run to become `waiting_input`; unresolved work may move the Task or
576
+ Issue to `blocked`.
577
+ - Use Delivery only for stage results, async handoff, artifacts, proposed
578
+ patches, verification evidence, and final reports.
579
+ - In final reports, explicitly separate assigned-work evidence from follow-up
580
+ candidates: new defects, missing shared abstractions, app-local glue that
581
+ should move to models/drizzle-solid/xpod, live-verification gaps, or
582
+ deferred cleanup. Workers may recommend follow-up, but they do not decide
583
+ whether it becomes a new Issue.
584
+ - If the LinX Symphony Codex plugin is installed, prefer its `linx-symphony`
585
+ MCP tools to check and write the delivery. The MCP helper only validates/writes
586
+ the portable Delivery file; it does not directly mutate Pod Issues, Tasks,
587
+ Deliveries, or acceptance state.
588
+ - Otherwise include the same terminal facts in the final report using the
589
+ `symphonyFinal: true` JSON envelope so LinX can archive the transcript through
590
+ shared control-plane use-cases; it is not a separate worker schema.
591
+ - Never use chat, Delivery, or repo docs to redefine scope, acceptance,
592
+ compatibility, lifecycle state, or release boundary. Write an Implementation
593
+ Change Request instead.
594
+
595
+ Workers must perform an implementation feasibility recheck before committing to
596
+ execution. This is where downstream work can discover that upstream judgment was
597
+ wrong, incomplete, or too broad.
598
+
599
+ If the plan cannot be fully implemented under the current control record, the
600
+ worker must not silently downgrade acceptance or ship a partial substitute.
601
+ Write an Implementation Change Request with:
602
+
603
+ - the failed upstream assumption;
604
+ - evidence from code, tests, logs, runtime behavior, or dependency inspection;
605
+ - what can be completed safely, if anything;
606
+ - recommended next shape: split, redesign, defer, spike/report, reduce scope, or
607
+ request missing authority;
608
+ - the smallest coherent verified increment if partial progress is useful.
609
+
610
+ Workers may stop at the smallest coherent verified increment only when it still
611
+ satisfies current acceptance or the control lane has revised acceptance.
612
+ Otherwise the correct outcome is blocked/change-request, not incomplete work
613
+ presented as done.
614
+
615
+ Workers keep execution-facing documentation current while they work. They may
616
+ update progress, implementation notes within assigned scope, verification
617
+ evidence, blockers, risks, failed approaches, dependency waits, and proposed
618
+ adjustments. They must not silently update product semantics, acceptance,
619
+ compatibility impact, authority/privacy/visibility decisions, task scope,
620
+ ownership, or split strategy.
621
+
622
+ Worker documentation updates must be either append-only evidence or scoped
623
+ patches to the implementation surface they changed. If a needed documentation
624
+ change would alter scope, acceptance, compatibility, lifecycle state, or release
625
+ boundary, the worker writes an Implementation Change Request and waits for the
626
+ control lane to update the authoritative record.
627
+
628
+ ## Worker Closure And Attempts
629
+
630
+ Do not collapse worker completion, integration, and release into one `done`
631
+ state. A worker thread is a work room and may be reopened or followed up later;
632
+ the terminal object is the current Run, Delivery, or Task decision.
633
+
634
+ Use this minimum lifecycle:
635
+
636
+ - `Run completed`: the worker runtime attempt ended without waiting on more
637
+ input. This does not mean the task is accepted.
638
+ - `Delivery submitted`: the worker packaged a final report, patches/artifacts,
639
+ verification evidence, risks, and remaining work.
640
+ - `Delivery accepted`: Secretary/control lane checked the Delivery against
641
+ acceptance and recorded accepted, rejected, partially accepted, follow-up, or
642
+ reopened.
643
+ - `integrated`: the accepted result has been merged, applied, or otherwise
644
+ verified in the target workspace. If the worker already acted in the target
645
+ workspace, record integration as verified rather than inventing a merge step.
646
+ - `released`: the integrated result entered a release boundary. Release is only
647
+ required when acceptance explicitly includes publishing, packaging, deploy, or
648
+ user-visible availability.
649
+
650
+ Worker closure is therefore:
651
+
652
+ ```text
653
+ no active Run
654
+ + latest Delivery is final
655
+ + Secretary/control lane has recorded an acceptance/rejection/follow-up decision
656
+ ```
657
+
658
+ Do not require release for every worker. Do require Secretary/control lane
659
+ acceptance before closing a Task as completed. User acceptance is required only
660
+ for user-owned intent, product semantic approval, destructive authority,
661
+ external production access, long-lived grants, or final release acceptance
662
+ unless an existing auto policy or grant covers it.
663
+
664
+ Repeated failed attempts must be recorded without creating duplicate Tasks.
665
+
666
+ - `RunStep` records each attempt fact: action tried, environment, command/tool,
667
+ result, error summary, log/artifact pointer, and timestamp.
668
+ - `Evidence` records reusable findings distilled from attempts: failed
669
+ approach, constraint, dependency behavior, blocker, or proof.
670
+ - `ImplementationChangeRequest` records the worker's conclusion that the
671
+ current plan or acceptance cannot be completed as written.
672
+ - `Report` summarizes the attempt history, final result, unresolved risks, and
673
+ recommended next action.
674
+
675
+ Use URI relations for traceability and duplicate avoidance, not filesystem
676
+ symlinks or transcript scanning. A next worker should be able to query relevant
677
+ findings before repeating work:
678
+
679
+ ```text
680
+ RunStep -> run
681
+ RunStep -> task
682
+ RunStep -> delivery
683
+ Evidence -> sourceRunStep
684
+ Evidence -> subject
685
+ Evidence -> blocks / invalidates / supports / recommends
686
+ ImplementationChangeRequest -> basedOn Evidence[]
687
+ Report -> evidence[]
688
+ Delivery -> report
689
+ ```
690
+
691
+ If a failed attempt exposed an independent product bug or future concern, link
692
+ or promote it through Idea/Issue binding. Otherwise keep it as RunStep/Evidence
693
+ under the current work so the system learns without multiplying issues.
694
+
695
+ ## Post-Run Reconciliation And Follow-Up Extraction
696
+
697
+ Worker completion is not the end of Secretary work. After every terminal
698
+ Delivery or Report, Secretary/control lane must perform a post-run
699
+ reconciliation pass before closing the Task/Issue.
700
+
701
+ The pass has two separate questions:
702
+
703
+ 1. Did the assigned work satisfy current acceptance with sufficient evidence?
704
+ 2. Did the execution reveal new work that should be tracked separately?
705
+
706
+ Secretary must inspect the worker Report, Evidence, RunSteps, failed attempts,
707
+ review findings, and any local compromises. It should extract follow-up
708
+ candidates even when the worker did not label them explicitly. Typical signals:
709
+
710
+ - app-local glue that should be moved into a shared package such as
711
+ `@undefineds.co/models`, `drizzle-solid`, xpod CLI, or shared runtime;
712
+ - missing repository/helper APIs exposed by repeated shell-side composition;
713
+ - live Pod/cloud/manual verification that was intentionally left out;
714
+ - schema, protocol, permission, auth, or persistence gaps discovered while
715
+ implementing the assigned task;
716
+ - cleanup, migration, compatibility, release, or documentation work that is
717
+ not required to accept the current Delivery but should not be forgotten;
718
+ - repeated failed approaches or flaky behavior that future work should avoid.
719
+
720
+ Secretary owns classification. A worker may propose a follow-up but must not
721
+ create or close Issues, rewrite acceptance, or re-split the roadmap unless the
722
+ Delivery explicitly grants that authority.
723
+
724
+ Classify each follow-up candidate as one of:
725
+
726
+ - `same_issue_task`: append a Task or remaining-work item to the current Issue;
727
+ - `new_issue`: create a separate Issue and link the source Report/Evidence/Run;
728
+ - `idea`: capture as an Idea because scope, value, or acceptance is not clear;
729
+ - `evidence_only`: keep as a finding/proof without new work;
730
+ - `ask_user`: escalate only when user-owned intent, authority, priority, or
731
+ acceptance is required.
732
+
733
+ When creating a new Issue, link provenance back to the originating Issue, Task,
734
+ Delivery, Report, Evidence, Run, Thread, and source message where available.
735
+ When no new Issue is created, record why the finding is evidence-only,
736
+ deferred, duplicate, or folded into the current Issue. This prevents workers
737
+ from missing second-order architecture/product gaps and prevents the main
738
+ thread from silently losing follow-up work after a successful Delivery.
739
+
740
+ ## Evidence Feedback
741
+
742
+ Completion is not a worker saying "done". Accept completion only when evidence
743
+ satisfies the intended system change.
744
+
745
+ For non-trivial implementation, Design, Implementation, Tests, Examples, Docs,
746
+ and Evidence should describe the same capability semantics. Accepted work must
747
+ update the relevant control record status and evidence so future workers do not
748
+ need to reconstruct truth from transcript.
749
+
750
+ After execution, update:
751
+
752
+ - what changed;
753
+ - which control record changed and its new status;
754
+ - what remains open;
755
+ - what was confirmed or rejected;
756
+ - what is now stale or superseded;
757
+ - which follow-up should happen next.
758
+
759
+ ## Measurement
760
+
761
+ Record observable events that let later agents judge whether Symphony worked:
762
+ input classification, control-record updates, dispatch/steering, worker
763
+ blockers, Implementation Change Requests, delivery acceptance/rejection,
764
+ release-boundary changes, reopened work, and missing evidence. Metrics events
765
+ must point to control records, runs, deliveries, and evidence; do not duplicate
766
+ raw transcripts, prompts, secrets, or private worker context into metrics.
767
+
768
+ ## Hard Rules
769
+
770
+ - Do not treat every Symphony-mode chat message as an Issue.
771
+ - Do not expose Symphony binding, routing, Issue/Task analysis, worker
772
+ selection, or report headings in ordinary user-facing chat. Reply like normal
773
+ chat by default, and show control-plane detail only for visible state changes,
774
+ blockers, handoffs, or explicit status/details requests.
775
+ - Do not treat `/symphony` slash arguments as an objective.
776
+ - Do not create work before binding the input to the relevant system object.
777
+ - Do not dispatch workers before updating the relevant control record enough for
778
+ bounded execution.
779
+ - Do not steer active workers through unrecorded chat context.
780
+ - Do not treat breaking changes as ordinary status changes.
781
+ - Do not invent Pod paths, RDF predicates, URI templates, or shared model fields.
782
+ - Do not use runtime Session as Chat.
783
+ - Do not treat worker self-report as sufficient completion evidence.
784
+ - Do not read sibling worker transcripts unless Secretary includes them in a
785
+ Delivery.
786
+
787
+ ## Exit
788
+
789
+ If the user asks to leave Symphony mode, return to normal behavior. Do not keep
790
+ applying the control-lane rule across future turns unless Symphony is explicitly
791
+ active or the user asks to continue it.