@yugoo-design/companion 0.1.0-beta.10 → 0.1.0-beta.12

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 (38) hide show
  1. package/README.md +6 -6
  2. package/package.json +1 -1
  3. package/payload/desktop-preparation/hosts/workbuddy/design-SKILL.md +58 -4
  4. package/payload/desktop-preparation/materials.json +6 -5
  5. package/payload/desktop-preparation/plugin/design-system/skills/design-panel/native-execution.md +413 -0
  6. package/payload/desktop-preparation/qwenwork-template/skills/yugoo/native-execution.md +48 -1
  7. package/payload/desktop-preparation/src/workbuddy-mcp-relay.mjs +44 -17
  8. package/payload/desktop-preparation/src/workbuddy-relay-probe.mjs +25 -14
  9. package/payload/desktop-preparation/workbuddy-package.mjs +8 -2
  10. package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
  11. package/payload/overlays/claude-code/skills/yugoo/native-execution.md +48 -1
  12. package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
  13. package/payload/overlays/codex/skills/design-panel/native-execution.md +48 -1
  14. package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
  15. package/payload/overlays/qoder/skills/yugoo/native-execution.md +48 -1
  16. package/payload/shared/authoring/panel-components.json +317 -216
  17. package/payload/shared/bundles/role_access/panel.yaml +7 -0
  18. package/payload/shared/scripts/{content-archive-Dc-eUqE_.mjs → content-archive-ChKG0eA3.mjs} +2 -2
  19. package/payload/shared/scripts/{core-entry-Bj1isC2W.mjs → core-entry-Cfvnjfig.mjs} +60 -3
  20. package/payload/shared/scripts/design.mjs +37 -14
  21. package/payload/shared/scripts/{git-index-library-08zOq52I.mjs → git-index-library-B13yHuBj.mjs} +76 -76
  22. package/payload/shared/scripts/{git-index-library-C_wZ6wUq.mjs → git-index-library-Cb11yV6m.mjs} +1 -1
  23. package/payload/shared/scripts/{git-native-NCzpyKUp.mjs → git-native-BsLG3Dyx.mjs} +3 -3
  24. package/payload/shared/scripts/git-native-worker.js +1 -1
  25. package/payload/shared/scripts/git-runtime-check.mjs +1 -1
  26. package/payload/shared/scripts/knowledge-snapshot-query.mjs +1 -1
  27. package/payload/shared/scripts/{load-B9zD0DAZ.mjs → load-C46tLUT4.mjs} +1 -1
  28. package/payload/shared/scripts/{panel-preview-CE8w39XL.mjs → panel-preview-Cb8owVHh.mjs} +2 -2
  29. package/payload/shared/scripts/{server-DPhB5zaI.mjs → server-CxKbY4vh.mjs} +3949 -3090
  30. package/payload/shared/scripts/{studio-content-archive-DmZ57yxv.mjs → studio-content-archive-BMwyZh9-.mjs} +3 -3
  31. package/payload/shared/scripts/{studio-instance-composition-BONpvYpU.mjs → studio-instance-composition-18DCColt.mjs} +2 -2
  32. package/payload/shared/scripts/{studio-instances-B_x9lgOw.mjs → studio-instances-Y02vAs6u.mjs} +2 -2
  33. package/payload/shared/scripts/{studio-panel-drafts-mDQAikiO.mjs → studio-panel-drafts-BUZIydyq.mjs} +3 -3
  34. package/payload/shared/scripts/{windows-private-storage-C0NrKMtt.mjs → windows-private-storage-C9MEHzjA.mjs} +1 -1
  35. package/payload/shared/scripts/workbuddy-panel-service.mjs +65 -18
  36. package/payload/shared/web/client.js +47652 -47475
  37. package/release-manifest.json +41 -40
  38. package/payload/shared/scripts/{windows-private-storage-1S6Keug-.mjs → windows-private-storage-BbXmYqAe.mjs} +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Yugoo Design Companion — beta
2
2
 
3
- Package: `@yugoo-design/companion@0.1.0-beta.10`.
3
+ Package: `@yugoo-design/companion@0.1.0-beta.12`.
4
4
 
5
5
  Yugoo Design (语构设计系统) is an interactive design plugin for native Agent Hosts.
6
6
  It combines domain methods, Design Projects, versioned Design Files and shared
@@ -21,7 +21,7 @@ selected beta to the exact version and integrity before acquisition; keep the
21
21
  previous installed version available during updates. Do not substitute `latest`.
22
22
 
23
23
  ```sh
24
- ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.10 --registry=https://registry.npmjs.org
24
+ ONNXRUNTIME_NODE_INSTALL_CUDA=skip npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.12 --registry=https://registry.npmjs.org
25
25
  npx --no-install design-system --help
26
26
  ```
27
27
 
@@ -38,7 +38,7 @@ allowBuilds:
38
38
  ```
39
39
 
40
40
  ```sh
41
- ONNXRUNTIME_NODE_INSTALL_CUDA=skip pnpm add --save-exact @yugoo-design/companion@0.1.0-beta.10 --registry=https://registry.npmjs.org
41
+ ONNXRUNTIME_NODE_INSTALL_CUDA=skip pnpm add --save-exact @yugoo-design/companion@0.1.0-beta.12 --registry=https://registry.npmjs.org
42
42
  pnpm exec design-system --help
43
43
  ```
44
44
 
@@ -86,7 +86,7 @@ process value:
86
86
  $previousOrtCuda = [Environment]::GetEnvironmentVariable('ONNXRUNTIME_NODE_INSTALL_CUDA', 'Process')
87
87
  try {
88
88
  $env:ONNXRUNTIME_NODE_INSTALL_CUDA = 'skip'
89
- npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.10 --registry=https://registry.npmjs.org
89
+ npm install --ignore-scripts=false --save-exact @yugoo-design/companion@0.1.0-beta.12 --registry=https://registry.npmjs.org
90
90
  } finally {
91
91
  [Environment]::SetEnvironmentVariable('ONNXRUNTIME_NODE_INSTALL_CUDA', $previousOrtCuda, 'Process')
92
92
  }
@@ -108,8 +108,8 @@ to an already published package. Users do not install DSH and Companion separate
108
108
  | WorkBuddy | `install --host workbuddy`: prepare the stable marketplace and plugin; import or update and enable through the host. |
109
109
  | DSH | `install --host dsh`: run the existing plan/apply transaction with the bound aggregate, official CLI/Loader and an explicitly selected existing profile. |
110
110
 
111
- For a fresh WorkBuddy installation, use native suite `0.3.23` with
112
- `--suite-version 0.3.23`, the verified Node executable and a persistent external
111
+ For a fresh WorkBuddy installation, use native suite `0.3.25` with
112
+ `--suite-version 0.3.25`, the verified Node executable and a persistent external
113
113
  preparation destination. Import the returned `nativeImport.market` directory and
114
114
  enable its `yugoo-design` plugin. The fresh market is also named `yugoo-design`;
115
115
  no previous test market or preparation receipt is required. An owned update with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugoo-design/companion",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.12",
4
4
  "description": "Yugoo Design Companion beta: interactive Design Projects and Panels in supported native Agent Hosts.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -5,6 +5,9 @@ description: Open and use Yugoo Design in this WorkBuddy conversation with a bro
5
5
 
6
6
  Use this Skill for an authorized Design task in the current WorkBuddy conversation.
7
7
  The user starts WorkBuddy normally; never create a host launcher or another model client.
8
+ For the main U/S/T and conditional background review protocols, read the installed
9
+ [native execution reference](native-execution.md). The WorkBuddy placement limits
10
+ below still apply: foreground Producers remain serial and Workers are unsupported.
8
11
 
9
12
  1. Obtain this conversation's exact `sessionId`, `nativeCwd` and `transcriptPath` from its current
10
13
  `YUGOO_WORKBUDDY_IDENTITY_PROBE` Hook context. This is routing evidence, not task
@@ -80,15 +83,32 @@ The user starts WorkBuddy normally; never create a host launcher or another mode
80
83
  never guess names or conclude that all Bundles require a Producer from an
81
84
  unknown-name error. The catalog declares execution policy, not verified host
82
85
  capabilities; preparation still checks the requested placement.
86
+ Read the complete returned `method`, starting with its shared native execution
87
+ contract, and pass it unchanged to the selected executor together with its
88
+ `executionContract`, resource and Design Files paths. That contract maps
89
+ Bundle operation names to the current Host; references do not override it
90
+ with DSH-only tool spellings. Do not conclude that native file generation is
91
+ unavailable merely because MCP has no `write`, `edit`, `design_validate` or
92
+ `design_publish`. Native filesystem tools author the owned files;
93
+ `design_finish_run` / `design_finish_main_bundle` validate and publish them.
83
94
  - For `execution.mode: main`, read the entire returned Bundle method/output
84
95
  contract, then use `design_begin_main_bundle` and `design_finish_main_bundle`
85
96
  with its exact invocation ID. Publish unanswered questions with
86
97
  `scope: state`, `outcome: pause`; never invent answers.
87
98
  - For `execution.mode: subagent`, use one foreground native general-purpose
88
99
  `Agent`. Its first bootstrap task only returns READY and performs no writes.
100
+ Do not choose a read-only research Agent or supply a tool filter that removes
101
+ the native file/command tools required for the subsequent generation task.
102
+ If the child reports missing capability, inspect its actual native tool names
103
+ and the Agent type/permissions/filter once; a list of MCP tools alone cannot
104
+ establish that native Write/Edit/command tools are absent. Report a real
105
+ denial without changing permissions or borrowing another executor.
89
106
  Obtain the actual Agent ID from the native result, then call
90
107
  `design_register_run` with the exact connection, `runId`, current session as
91
108
  `parentRunId`, `role: producer`, the prepared `skill`, and stable `artifactId`.
109
+ Use the returned real `agent-...` ID, not a task name. WorkBuddy does not use
110
+ Codex `launchCallId` / `agentPath` or QwenWork `taskPath`; its child transcript
111
+ is derived from the already bound original conversation.
92
112
  The server cross-checks the parent native receipt and child transcript; a
93
113
  filename, assistant assertion or pasted Agent ID cannot grant authority.
94
114
  After successful binding, `resume` that same Agent in foreground. Give it
@@ -102,20 +122,54 @@ The user starts WorkBuddy normally; never create a host launcher or another mode
102
122
  validation still needs repair after return, resume the same Agent; do not
103
123
  repair its files in main or call its work complete based on a text response.
104
124
  Never use background mode for a foreground Producer.
105
- Workers/nested delegation and GRA are unavailable in this preview. Execute the
106
- Producer serially; never change a subagent Bundle to main mode or substitute
125
+ Workers/nested delegation remain unavailable. Background GRA requires the
126
+ current-service readiness proof described below; it does not enable Workers.
127
+ Execute the Producer serially; never change a subagent Bundle to main mode or substitute
107
128
  another model/CLI. Failed binding or absent native Agent/resume support is a
108
129
  real error, not permission to bypass the guard.
109
130
  5. The shared Panel validates and saves before notification. After a user-authorized
110
131
  save notice, read `design_status` once using its exact connection and read the
111
132
  canonical saved state. Confirm the actual answers; never reapply saved edits.
133
+ In the actual main continuation turn, call `design_main_context` for the current
134
+ exact U/S/T input and shared rubric. Reuse a current assessment; otherwise
135
+ assess the saved facts in main and call `report_design_clarity` with that exact
136
+ input before the final reply or next Design recommendation. Report at most once
137
+ per real user turn; a new save, Kit or user interjection requires fresh context,
138
+ not relabeling old scores. A background review cannot substitute for this main
139
+ report. Missing verified native history means unavailable, not a made-up score.
112
140
  If the widget is closed or the original conversation changes, notification may
113
141
  fail while files remain saved. Explain this and preserve the existing project;
114
142
  do not blindly repeat a send or create another project.
115
143
 
116
144
  KAG uses the shared local implementation and exposes actual status; report failures
117
- honestly. Serial native Producer bootstrap/resume and publication have a separate
118
- acceptance boundary from Workers and background GRA, which remain disabled. An interface
145
+ honestly. Successful saves already admit indexing. Use `design_knowledge_context`
146
+ and `design_query_knowledge` only when useful, retaining exact project/checkpoint/
147
+ revision pins and checking source facts; indexing never blocks save acknowledgement.
148
+
149
+ For GRA, immediately read `design_status.hostCapabilities` before any real review.
150
+ Only `backgroundReviewReadiness: ready` and `backgroundReviews: true` permit
151
+ dispatch. WorkBuddy 5.8.3's public `Agent(run_in_background=true)` can fall back
152
+ to synchronous execution when native background capability is disabled. Do not
153
+ probe it with a real review prompt. Unverified readiness keeps requests pending;
154
+ use the returned content-free `backgroundReviewProtocol.bootstrap` only as an
155
+ explicit readiness check, then read status again. Do not change Host settings or
156
+ repeat an uncertain probe. Proof must be newer than this exact Companion connection
157
+ opening; a historical descriptor from the same session is insufficient.
158
+
159
+ When ready, honor the project GRA policy (`off` forbids automatic review) and reuse
160
+ the exact `dispatch:true` prepared IDs. Follow the installed native execution
161
+ reference: launch independent read-only native background reviewers, bind actual
162
+ structured task IDs with `design_bind_reviews`, and let each child read its own
163
+ `design_read_review` prompt/schema and submit through `design_submit_review`.
164
+ Review only the request's committed snapshot through `design_git_read`; keep its
165
+ checkpoint on every page, and do not edit Design Files or execute advice. Producer
166
+ write/command instructions above are not reviewer permissions. A synchronous
167
+ `lastId` result, teammate name or assistant assertion is not a background handle.
168
+ The server checks the descriptor against the actual parent Agent call; native
169
+ `TaskOutput(task_id, block=false)` structured receipts establish terminal state.
170
+ Unknown/externalized status stays unknown. Do not poll, wait for reviews, or block
171
+ the user's task. Serial Producer, conditional background GRA and unsupported
172
+ Workers retain separate acceptance boundaries. An interface
119
173
  receipt is not proof that the agent consumed a message; actual readback is required.
120
174
 
121
175
  Conversation history uses the exact Hook transcript path, verified session and cwd.
@@ -5,7 +5,8 @@
5
5
  "LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
6
6
  "NOTICE": "6b4eec391144fcbd96ec7b45a28764ab1932722a96325248377c3e28aac2c62d",
7
7
  "THIRD_PARTY_NOTICES.md": "bfcab921c6c15ccc47f9b1a6cc5941675c95962de5ea5b0edc50fbfa2aef136a",
8
- "hosts/workbuddy/design-SKILL.md": "2452f5eab1ba7c87699c44df7254ea8fdbe2d2c018da921e5b4cdabf76fe3a78",
8
+ "hosts/workbuddy/design-SKILL.md": "5cc44054186fccb6bba66e237367cec3774ea59f64ae93ea4acf5648355f22b0",
9
+ "plugin/design-system/skills/design-panel/native-execution.md": "7a2ab8b2aff916115a8c767c3c1e8156dc71a58c154366a0e8ba5c80256aeda3",
9
10
  "qwenwork-package.mjs": "ae340c245feb2beab0de9e02c09b37d9924fa0d6fe9f3dd1c329242e4a350c11",
10
11
  "qwenwork-template/.claude-plugin/plugin.json": "7beaf01908b62b4ad6c0a371f09b45cb3236f622910c3769f8b3393e4cacb354",
11
12
  "qwenwork-template/.mcp.json": "931fdcd8efa8e0cfe1dbdda225c523d62dbc4bacb5a33d01eebe84933b712353",
@@ -22,7 +23,7 @@
22
23
  "qwenwork-template/scripts/windows-private-storage.mjs": "27c3eb052278f0cb2850326e1d0864cfd2f3f6d2b1975ec7c24535ef6251ac94",
23
24
  "qwenwork-template/skills/design-component/SKILL.md": "85a1f2a016174787226eaa9e9e6675e86057212d322a65014edd71f3e4861b34",
24
25
  "qwenwork-template/skills/yugoo/SKILL.md": "3aedb6739f204c9931cf1d406e5a71d59fc3424875746ee5737e68e5a58236bc",
25
- "qwenwork-template/skills/yugoo/native-execution.md": "c23d1840c2557a4bdc9442edb3e6b488e1acb4dfb564b966e123c105710ec849",
26
+ "qwenwork-template/skills/yugoo/native-execution.md": "9d300490b3493ff9f4826414cfa832244acc29b2205b825d3ccaff8665049ddd",
26
27
  "src/browser-access.mjs": "4b64284b9bfaaa32c8502ab00febdda4f8a972f4b41e822d4e708b27e7e3efdf",
27
28
  "src/native-hook-transport.mjs": "a5878335c40bc930d28d34e079de09f7628dc0cbcc828a1309826c1829640a83",
28
29
  "src/qwenwork-connection.mjs": "850b95ea4f57ccf4e1cb6463f98625b941d74f4df76bc24f05dbdf15b8597b3a",
@@ -30,12 +31,12 @@
30
31
  "src/windows-native-platform.mjs": "57ac50c9a8cc0371597d6d40e3efe4cbe2a470e98f75f0229721c7d5a48e7e98",
31
32
  "src/windows-private-storage.mjs": "27c3eb052278f0cb2850326e1d0864cfd2f3f6d2b1975ec7c24535ef6251ac94",
32
33
  "src/workbuddy-context-probe.mjs": "1553e01ab95d7d9f2099806a7af5dd76cab856bd5fe8483b29c4cd8f7d30bff8",
33
- "src/workbuddy-mcp-relay.mjs": "5a9fc1d8ef5acb90c471e9405c53591b9e94c8fb7b60d6e43a45f6ce48567d46",
34
+ "src/workbuddy-mcp-relay.mjs": "92a30918792f5d4543a7c94e2d86446e7df4069f8ce26fe20b9439dad7b30286",
34
35
  "src/workbuddy-message-probe.mjs": "9366d0ebc8c4133c8d3c4acb793c0319b9f6bb4a123381bd2d83f6ecb6275101",
35
36
  "src/workbuddy-panel-mcp.mjs": "55accb55244f86e86d9f36e445e450fedba47e7bce80cacd2ceb6327a14b99ef",
36
- "src/workbuddy-relay-probe.mjs": "ea20a6f03a9fe661990c10da0bf5b2431f784f3724a9827a250c84f480159e69",
37
+ "src/workbuddy-relay-probe.mjs": "c5ea46abadbf9dfe265eb40eb81ed08a4f6596dd5f673fd248843e7775160cc4",
37
38
  "src/workbuddy-relay-service.mjs": "44d60d6956250417507fb76c71c3030a01bc38e565e4572a761b46f255f8e669",
38
39
  "src/workbuddy-ui-probes.mjs": "a91d4651248125769254755bdf66a44bbc9e5a793dad0a137c35acbb10a89a88",
39
- "workbuddy-package.mjs": "25bb0db84c5d11fdad27b25cc796c8c43cf32a52a864ee786a8108a2f426f36b"
40
+ "workbuddy-package.mjs": "cc3ca0be5cc120f107119bf82897a83d555f71338347c7908568dba562111ec9"
40
41
  }
41
42
  }
@@ -0,0 +1,413 @@
1
+ # Native Design execution
2
+
3
+ The native Host owns spawning, concurrency, messages, cancellation and permissions. The
4
+ companion owns Design Files, Panels and the existing validation/Git/journal path.
5
+ Do not invoke a second `codex exec`, `resume`, or app-server to simulate children.
6
+ If native delegation is unavailable, report the limitation rather than claim
7
+ fanout succeeded. The Producer may perform the scoped artifact work itself.
8
+
9
+ ## Common bridge
10
+
11
+ `serve` prints a private `connection` file path. Keep it inside the local task
12
+ context; do not print its contents or include its token in a shared artifact.
13
+ Prefer the plugin's MCP tools. Pass `connection` as that exact file path on each
14
+ call; no temporary request file or shell process is needed. Do not infer the
15
+ calling child's identity from the connection, which belongs to the main session.
16
+
17
+ | Existing operation | MCP tool |
18
+ | --- | --- |
19
+
20
+ | `prepareBundle` | `design_prepare_bundle` |
21
+ | `registerNativeRun` | `design_register_run` |
22
+ | `finishNativeRun` | `design_finish_run` |
23
+ | `focusArtifact` | `design_focus_artifact` |
24
+ | `prepareReview`, `bindReviewRun`, `submitReview` | `design_prepare_review`, `design_bind_review`, `design_submit_review` |
25
+ | `prepareReviews`, `readReview`, `bindReviewRuns` | `design_prepare_reviews`, `design_read_review`, `design_bind_reviews` |
26
+ | `claimReviewAction`, `settleReviewAction` | `design_claim_action`, `design_settle_action` |
27
+ | `mainContext`, `reportMainClarity` | `design_main_context`, `report_design_clarity` |
28
+
29
+ ### Main U/S/T after saved output
30
+
31
+ At a meaningful saved Design output boundary, including the actual continuation
32
+ turn after Panel Save and continue, call `design_main_context`. It returns the
33
+ latest exact `input`, shared assessment method, current score and KAG status.
34
+ Use a current score; otherwise assess the saved facts against the agreed user
35
+ scope in this main conversation and call `report_design_clarity` with that exact
36
+ input before a final reply or next Design recommendation. The service verifies
37
+ the real native main call and records at most one new report per actual user
38
+ turn. An identical retry retains the original audit provenance. A newer save,
39
+ Kit change or user interjection invalidates old inputs: read context again,
40
+ never relabel old reasoning. If the current turn already reported, await a real
41
+ new user boundary before creating a different report. Missing verified native
42
+ history means unavailable assessment, not a fabricated turn or score.
43
+
44
+ This main report uses the existing Journal and clarity authority. It neither
45
+ runs a second evaluator nor waits for background GRA. U/S/T identifies useful
46
+ evidence gaps; it does not override explicit user work or impose mandatory
47
+ stages. KAG is derived discovery: successful saves already admit maintenance,
48
+ and pending indexing never gates the save acknowledgement or ordinary design.
49
+
50
+ ### Serial artifact focus
51
+
52
+ Before the main Agent or an existing native Producer begins work on one
53
+ artifact, call `design_focus_artifact` with the exact connection and either
54
+ `invocationId` from `design_begin_main_bundle` or the Producer's registered
55
+ `runId`. Supply `artifact_kind`, `artifact_id` and `artifact_file` together.
56
+ Keep the stable ID/path/kind identical when returning to the same target. For
57
+ example, after starting a Research main invocation:
58
+
59
+ ```json
60
+ {
61
+ "connection": "/exact/private/connection.json",
62
+ "invocationId": "<invocationId returned by design_begin_main_bundle>",
63
+ "artifact_kind": "direction",
64
+ "artifact_id": "R-001/D-001",
65
+ "artifact_file": "research/R-001/D-001.md"
66
+ }
67
+ ```
68
+
69
+ Replace the illustrative connection and invocation values with actual returned
70
+ values. For Producer execution, replace `invocationId` with its actual `runId`;
71
+ never register the main Agent as a Producer. The generic Companion CLI `call`
72
+ operation exposes the same bridge method `focusArtifact` with camel-case
73
+ `artifactKind`, `artifactId`, `artifactFile`. This only associates observed native
74
+ activity; it creates no artifact, attempt, agent or acceptance receipt. Canonical
75
+ Bundle JSON, other Bundle paths, settled invocations and Worker owners are rejected.
76
+
77
+ Workspace `artifactActivities` carries the actual native executor and a
78
+ `logTarget`. Pass its `artifactId` and optional main `invocationId` with the
79
+ actual `runId` to `readExecutionLog`. Only rows after focus and before the next
80
+ target switch or Bundle settlement are returned. Returning to a target aggregates
81
+ its separate segments. Earlier main conversation history is not artifact work.
82
+ Rows already evicted by the bounded native observer are marked truncated;
83
+ unavailable or invalid native logs produce unavailable activity, never completion.
84
+ Native status and published artifact availability remain independent facts.
85
+
86
+
87
+ Parameters below are unchanged apart from the additional `connection` path.
88
+ Use `design_status` for a compact execution/clarity/handoff read when needed,
89
+ not as a polling loop. Keep large artifacts in files with native filesystem tools.
90
+
91
+ If MCP tools are unavailable in this host/session, report that limitation and
92
+ use the existing CLI fallback: write a small request JSON outside `design_files`, then call:
93
+
94
+ ```sh
95
+ node /absolute/plugin-root/scripts/design.mjs call \
96
+ --connection /absolute/connection.json --request /absolute/request.json
97
+ ```
98
+
99
+ Requests have `{ "method": "operation", "params": { ... } }` shape. This local
100
+ bridge does not dispatch agents. Use native spawning tools for that operation.
101
+ The common operations below are available only while this companion is running.
102
+
103
+ ## Producer
104
+
105
+ `prepareBundle` also returns shared `cooperationMethod`, `workerMethod` and
106
+ `knowledgeMethod` guidance. Apply cooperationMethod and knowledgeMethod in the
107
+ Bundle executor, whether main or Producer. Forward workerMethod and
108
+ knowledgeMethod along with a bounded task/evidence brief to native Workers.
109
+ Source locators and relevant excerpts avoid blanket rereads; exact assets and
110
+ validator inputs remain file-backed. Query KAG only when useful to the task,
111
+ passing actual returned pins to children; missing capability/pins fall back to
112
+ source files without blocking. These fields do not change native permissions.
113
+
114
+ Execution placement comes from `prepareBundle.execution.mode`: `subagent`
115
+ (also the default for older manifests) creates a native Producer; `main` runs
116
+ the same Bundle method in this conversation. Worker fanout is a separate Bundle
117
+ decision, not a consequence of this mode. Do not silently substitute a mode when
118
+ the host cannot support it.
119
+
120
+ For `main`, call `beginMainBundle` (`design_begin_main_bundle`) with the skill.
121
+ Keep its exact `invocationId`; this is a Bundle invocation, **not** a native run
122
+ ID. Read the returned method/resources yourself, maintain canonical JSON and
123
+ perform the same validation. Call `finishMainBundle`
124
+ (`design_finish_main_bundle`) with that invocation ID and the same scope/outcome
125
+ described below. Correct validation failures here before retrying settlement.
126
+ Cancel/wait for any Workers before settling; a new main Bundle cannot start until
127
+ the current one is settled. Never register the main Agent as a Producer child.
128
+ Completing the Bundle does not end the main conversation. A focused main artifact
129
+ uses its actual conversation observer and bounded target segments; no Producer
130
+ rolling log or attempt is fabricated. Real Workers retain ordinary status and logs.
131
+
132
+ The following child-registration steps apply to `subagent` mode:
133
+
134
+ 1. Request `prepareBundle` with `{ "skill": "page_design" }` (the selected
135
+ Bundle name, not a fixed Page default). Read the returned Bundle method,
136
+ referenced artifact contract and the applicable Mindset. Pass a bounded user
137
+ task, exact returned resource paths and the same project context to a native
138
+ Producer child. The parent owns registration; the child does not scan sessions
139
+ or rediscover the installed Bundle. A not-yet-created output directory is normal.
140
+ 2. Register that child using `registerNativeRun`: `role: "producer"`, `skill`,
141
+ `artifactId` (Bundle name for its root), and exact native `runId`. For `host=codex` only,
142
+ an exact `launchCallId` or uniquely recorded `agentPath` from native spawn can
143
+ be supplied instead. The adapter resolves paths inside the bound host session
144
+ storage; do not search or print session metadata. Parent defaults to the main
145
+ conversation; a Worker of a Producer must supply its real Producer parent ID.
146
+ Explicit `transcriptPath` (and Qoder `taskPath`) remain supported. Native
147
+ metadata must prove the parent/child relationship and the native cwd supplied
148
+ to `serve --host-cwd` (not necessarily the Design Project root). Never
149
+ select a newest log or fabricate IDs. If metadata is not yet written,
150
+ register after it becomes available; don't respawn a duplicate child.
151
+ 3. The Producer maintains canonical JSON, preserves user edits and coordinates
152
+ artifacts. Workers can write distinct artifacts; only the Producer edits
153
+ the shared JSON. Producer takeover remains available. A missing reference
154
+ means planned, not completed; do not insert execution statuses into JSON.
155
+ 4. On child completion or an intentional user handoff, call `finishNativeRun`
156
+ with its `runId` and `scope: "completion"` or `scope: "state"` respectively.
157
+ This reads files directly, runs shared validation, and uses the existing
158
+ Bundle Git publication path. Fix actionable diagnostics in the generator.
159
+ On failure/cancellation call it with `outcome: "failed"`/`"cancelled"` to
160
+ audit existing facts; Git cadence does not depend on design success.
161
+
162
+ Native terminal events, not this bridge call, drive execution indicators. Panel
163
+ content is read from files even before settlement. If the Producer forgot the
164
+ settlement call, the parent performs it once; don't rerun generation just to
165
+ obtain a publication tool call.
166
+
167
+ ## Worker
168
+
169
+ For independent artifacts, follow the Bundle's delegation method. The native
170
+ parent is the Producer in `subagent` mode or the main Agent in `main` mode.
171
+ Give each Worker the artifact contract, its concrete task, existing shared
172
+ design inputs and exact `artifact_id`, `artifact_kind`, `artifact_file` from
173
+ the Bundle. No additional task schema is required in `skill.yaml`.
174
+
175
+ Register each actual child with `registerNativeRun`, `role: "worker"`, its
176
+ native `runId`, Producer `parentRunId`, exact native `transcriptPath`, `skill`,
177
+ `artifactId`, `artifactKind`, `artifactFile`. This maps native events/logs to the
178
+ correct entity and round. Do not reuse one child's identity for several files.
179
+ When the parent is the main Agent, supply its actual `parentRunId` and the exact
180
+ `invocationId` returned by `beginMainBundle` as well. Do not invent an intermediate
181
+ Producer. The main Agent then performs the same JSON integration duties below.
182
+
183
+ Workers write artifacts directly in `design_files`, use Bundle file-oriented
184
+ scripts for required layout/validation and repair diagnostics before returning.
185
+ Return only the path and compact validation result, not the complete HTML/XML.
186
+ The optional `finishNativeRun` call returns a compact file receipt. The Producer
187
+ updates canonical references as each Worker finishes, without waiting for the
188
+ remaining Workers. All workers must finish or be cancelled before the Producer
189
+ settles its Bundle. Do not hide failure by substituting another file.
190
+
191
+ ## Mapping existing Bundle tool terminology
192
+
193
+ | Bundle operation | Native Codex operation |
194
+ | --- | --- |
195
+ | `design_delegate` | Native child spawn, followed by exact run/target registration |
196
+ | `read_skill_resource` | Read the referenced file under returned Bundle resources |
197
+ | `list`, `read`, `write`, `edit` and worker artifact tools | Native filesystem tools on the same Design Files project |
198
+ | `run_skill_script` | Native shell, run the actual Bundle script with its documented file-path arguments; use Design Files as cwd |
199
+ | `design_validate` | Packaged `validate --project … --skill … --scope …` |
200
+ | `design_publish`, `design_finish` | `finishNativeRun` for a Producer, `finishMainBundle` for main execution; state scope preserves the same handoff |
201
+
202
+ These mappings adapt execution, not the Bundle's schema, generation method or
203
+ validation criteria. Native permissions remain authoritative. Never disable
204
+ approvals or install dependencies silently to make a task pass.
205
+
206
+ ## Background GRA and U/S/T
207
+
208
+ ### Shared Design KAG
209
+
210
+ All Bundles can use the same stored graph; it is not a required preliminary
211
+ workflow. When a task needs cross-file evidence, `design_knowledge_context`
212
+ returns availability, a bounded starting context and the shared reading method.
213
+ Use `design_query_knowledge` for more: preserve its exact `project`, `checkpoint`
214
+ and `revision` pins, select source files or original entity IDs, then traverse
215
+ one-hop `incidentTo` neighborhoods with `direction` and optional `relationTypes`.
216
+ Pagination must retain the same filters. Read the referenced files to verify
217
+ facts; similarity is a candidate, and isolation or partial search is not proof
218
+ of a missing design. If pins become stale, restart the bounded investigation
219
+ from a new context rather than mixing versions. Unavailable graph access does
220
+ not block normal source-file work or authorize repeated retries.
221
+
222
+ The packaged local embedding runtime uses cached model weights by default. If
223
+ weights are missing, file projection still works and semantic coverage reports
224
+ an error, not completion. With the user's agreement to download model weights,
225
+ start Companion with `--allow-embedding-download`; text remains local. Use
226
+ `--disable-embedding` for structural-only operation. Do not silently change to
227
+ a cloud embedding endpoint. Packages include native inference dependencies for
228
+ their recorded build platform/architecture, not every operating system.
229
+
230
+ GRA's existing result may include evidence-backed relationships or justified
231
+ retractions of its own prior relationships; it does not edit Design Files.
232
+ Use exact IDs and the supplied output schema. Empty results do not clear graph
233
+ state. A negative search conclusion belongs to that review's checked scope and
234
+ file revision, not an enduring “missing” fact; reassess after source changes.
235
+ Clarity reads evidence but does not maintain relationships. Service-managed
236
+ reviewers receive a fixed read replica and read-only query helper when available;
237
+ they must not contact the main session or use its MCP connection.
238
+
239
+ First honor the current host's execution capability: if `design_status` reports
240
+ `hostCapabilities.backgroundReviews: false` or `reviewDispatchOwner: "unavailable"`,
241
+ do not prepare, spawn, bind or recheck reviews. Keep the existing requests/results
242
+ and explain the capability gap without changing the user's review policy. A Hook
243
+ notification and a synchronous Agent call do not establish background execution.
244
+ Clarity is a separate assessment capability; unavailable evaluation must not be
245
+ reported as a current score or as successful GRA. Continue the authorized
246
+ foreground task. The launch instructions below require available native
247
+ background execution as well as an exact `dispatch:true` reference.
248
+
249
+ For WorkBuddy, read `design_status.hostCapabilities` immediately before any real
250
+ review dispatch. Its `backgroundReviewReadiness` must be `ready`; the public
251
+ `backgroundReviewProtocol` alone does not prove capability. WorkBuddy 5.8.3 can
252
+ silently execute `Agent(run_in_background=true)` synchronously when background
253
+ capability is disabled. Never use a real review prompt to test this. With
254
+ unverified readiness, keep reviews pending and explain the normal Host capability
255
+ gap. The protocol includes a content-free readiness bootstrap that may be run
256
+ explicitly; it returns immediately without reading files, using tools or
257
+ assessing Design. Read status again afterwards. Do not change private Host
258
+ settings or automatically repeat the probe. Only a native descriptor created
259
+ after this exact Companion connection opened proves readiness; an old descriptor
260
+ in the same session is insufficient after restart.
261
+
262
+ Once ready and given an exact prepared review reference, use the ordinary native
263
+ `Agent` tool with `run_in_background=true`. Bind its structured `subAgent.sessionId`
264
+ task ID and exact background descriptor to that review; never use a teammate name,
265
+ assistant text, synchronous `lastId` result or a guessed log. The adapter verifies
266
+ the actual parent call, session, cwd and child path. Spawn RPC completion proves
267
+ only launch, not review completion. WorkBuddy's `TaskOutput(task_id, block=false)`
268
+ structured `agent-output` receipt supplies native status. Externalized/missing
269
+ status or newer unbound child activity remains unknown. Do not follow paths in
270
+ tool text, busy-poll, wait for review completion or block the main user task.
271
+
272
+ When `design_status` reports `reviewDispatchOwner: "companion"`, or preparation
273
+ returns `dispatchOwner: "companion"`, the service owns background review execution.
274
+ Do not prepare, spawn, bind, follow up, or wait for reviewer children. Continue the
275
+ user's design work; review results appear in the existing background area,
276
+ advisory queue and clarity score. The native-child instructions below apply only
277
+ when the main Agent owns dispatch. Enabling `serve --background-reviews` is an
278
+ explicit account-quota decision, not something to enable silently during setup.
279
+
280
+ Successful Panel saves and Bundle publications automatically admit KAG maintenance;
281
+ graph reads and Worker drafts do not trigger it. `design_status` also exposes the
282
+ project `reviewPolicy`: auto combines Agent initiative with a publication rule
283
+ after a configurable quiet window (default 30 seconds), continuous checks the
284
+ latest published checkpoint every configured N minutes even without file changes,
285
+ and off forbids autonomous GRA but still permits an
286
+ explicit human `design_recheck_reviews` request. Never change this user policy
287
+ yourself. Clarity is independent. In native-dispatch mode the rule queues a notice
288
+ with exact prepared review IDs; it does not itself spawn native children. Queue
289
+ acceptance is not execution, and uncertain delivery must not be blindly replayed.
290
+
291
+ Save/finish responses and `design_status` expose the same derived `reviews`
292
+ summary. It is a read-only reminder. `due` means evidence or
293
+ observed editing scope needs review; `prepared` means a request exists but is not
294
+ bound. Inspect/reuse it rather than blindly spawning a duplicate. `running` is
295
+ not a result; `unsubmitted`, `failed`, `interrupted` and `unavailable` require
296
+ inspection, not a claim that review passed or an automatic retry loop. Do not
297
+ poll in the main conversation or wait for reviews before continuing user work.
298
+
299
+ For useful Agent initiative in auto mode, use one
300
+ `prepareReviews` call, normally omitting `profiles`; it bypasses the rule's wait
301
+ and reuses current work. Do not mechanically call it after every save. In off
302
+ mode use `design_recheck_reviews` only for an explicit human request, with one
303
+ stable requestId across retries, without changing the policy. The service
304
+ considers all three GRA profiles and initial/stale
305
+ clarity, reusing current requests without dispatching duplicates. A paraphrased
306
+ context does not create a new default review. Explicit `profiles` remain for a
307
+ user-requested scoped reassessment or diagnostics, not arbitrary omission and
308
+ later catch-up rounds. These remain independent reviews, not one merged review.
309
+ Only entries with `dispatch:true` authorize a new launch in this batch. Reused
310
+ prepared requests require inspection of any prior launch before recovery; do not
311
+ spawn duplicates after an uncertain response. A batch shares preparation context,
312
+ not an immutable file snapshot: `revisionChanged:true` means do not dispatch it.
313
+ An explicit publication-rule notice is different: its exact requests deliberately
314
+ pin immutable historical Git commits. Read only that checkpoint, not live files;
315
+ historical results cannot become current advice, Clarity, or KAG observations.
316
+ WorkBuddy requests also pin committed evidence for Agent-initiated preparation;
317
+ follow each exact request's checkpoint and `design_git_read` pagination contract.
318
+ Pass `userContext` with the current user request, relevant requests to simplify
319
+ or defer, and concrete work still being edited. Do not invent user preferences.
320
+ Observed running targets are not exclusions: an Agent can still be alive after
321
+ settlement or resume after a pause. Review saved evidence and avoid judging
322
+ in-progress output as complete. Report any coverage limitation separately to the
323
+ parent; when that editing scope clears, check for a follow-up review even if the
324
+ file revision did not change.
325
+ The response supplies short request references. Reviewers use `readReview` with
326
+ their exact `reviewId` and `connection` to obtain the full prompt and schema;
327
+ the parent need not read or rewrite them. Do not dump Design Files into the parent.
328
+
329
+ Spawn independent native **background** review children from the main Agent.
330
+ Give each only its review ID, connection path and instructions to read its request
331
+ and submit its own structured result. Launch independent children together when
332
+ the host supports it. Use one `bindReviewRuns` call with
333
+ `{bindings:[{reviewId,nativeRun},...]}` for the exact native launch results;
334
+ `nativeRun` can contain just the actual `runId` (or, for `host=codex` only, an exact launch reference
335
+ as above); the service fills paths and verifies native evidence. Do not send
336
+ reviewers to scan logs for their identity. Inspect per-entry errors: partial
337
+ success is possible, and successful bindings must not be relaunched. Never guess
338
+ the latest log path. The child reads the registered binding from `readReview`
339
+ before submission, eliminating a separate parent message carrying that binding.
340
+ It may read evidence while binding is pending. If still unbound when ready to
341
+ submit, report the pending binding and yield; do not poll or claim success.
342
+ If that same child has already yielded for binding (or ended without submitting),
343
+ after successful binding use one native follow-up/resume to tell it to read its
344
+ registered request and submit. Reuse the same child, not a new spawn. This is
345
+ recovery for an early finish, not a mandatory message for every running reviewer.
346
+ If the request is superseded or its revision changed, report that limitation;
347
+ do not present the old assessment as current. A reviewer
348
+ may handle another bounded profile or later revision with its own review ID and
349
+ schema; this does not reuse the previous result or grant editing authority.
350
+ Submit with `submitReview` params `{reviewId, nativeRun, result}`. The child may
351
+ read evidence while registration completes, but cannot publish before binding.
352
+ The single-review prepare/bind tools remain compatibility paths, not the default
353
+ multi-profile orchestration. Do not use them to reproduce four preparation rounds.
354
+ If a user save or message arrives during preparation, handle the user's work
355
+ first. Reconcile the existing requests at the next settled checkpoint, without
356
+ automatically completing the old batch or restarting it in the foreground.
357
+ Do not synchronously wait for GRA or treat review completion as a prerequisite
358
+ for foreground generation, user interaction, or a successful Bundle result.
359
+ Use native notifications for completion; no busy-loop polling or unbounded
360
+ self-respawning. A subsequent settled change can start the next bounded review.
361
+
362
+ The reviewers have no authority to edit Design Files or automatically accept
363
+ advice. Use `submitReview` for structured result publication, preserving the
364
+ exact review ID/native child binding. Errors return diagnostics for correction.
365
+ Do not force stale results onto newer project evidence. UI reads and polling
366
+ must never launch reviews. Native permission/cancellation remains in Codex.
367
+
368
+ GRA and U/S/T are distinct: U/S/T updates assessment; GRA contributes suggestions
369
+ to the shared advisory inbox. Only a real user acceptance dispatches a scoped
370
+ foreground action with the original exact action receipt. Queue acceptance is
371
+ not proof that the action started or completed.
372
+
373
+ For an accepted action in `main` mode, begin the exact target main Bundle and
374
+ claim it with `{receiptId, invocationId}` before editing. After file settlement,
375
+ use that same pair to settle the action; the main session need not end. A failed
376
+ claim grants no permission to execute the advisory.
377
+
378
+ For an accepted action in `subagent` mode, spawn the exact target Producer initially instructed to
379
+ wait before editing. Register its actual native identity, then call
380
+ `claimReviewAction` with `{receiptId, runId}`. Only after a successful claim send
381
+ the native Producer permission to begin this scoped action. After file settlement
382
+ via `finishNativeRun` and the native terminal event, call `settleReviewAction`
383
+ with `{receiptId, runId}`; the bridge derives the outcome, not the caller.
384
+ If claiming fails, cancel the waiting child and report the diagnostic. This is
385
+ workflow coordination, not a replacement for native host permissions.
386
+
387
+ ## Return control to the user
388
+
389
+ After the foreground Bundle settles, honor any already requested next task.
390
+ Otherwise briefly explain the result and, when a user choice is needed, offer
391
+ the most relevant next steps through the host's native question tool if it is
392
+ available in the current mode. Do not wait for GRA; use available evidence and
393
+ report unavailable clarity honestly. Ask about consequential choices, not routine
394
+ bookkeeping, and retain the option to adjust or stop.
395
+
396
+ If the native question tool is unavailable in this session/mode, do not omit the
397
+ next-step choice: ask one concise question in the main conversation with concrete
398
+ options and a short recommendation, including adjusting or stopping where useful.
399
+ A recommendation sentence alone is not a choice handoff: finish with an actual
400
+ question the user can answer, such as “继续梳理核心流程,还是先调整这些功能?”.
401
+ Do not invent a native question event from that prose, enable experimental host
402
+ features, or change collaboration mode to force a question tool to appear.
403
+ Use the tools actually exposed by the current host; a tool name in this document
404
+ does not make it callable. Do not switch modes or launch another host to manufacture a question
405
+ tool. The companion's message queue is not a native-question answer channel;
406
+ never present a queued message as an answer to a pending native question.
407
+
408
+ ## Development handoff and existing specs
409
+
410
+ When the user requests implementation or a development brief from a Design Project, use the selected project and the specified coding workspace; this is not a request to run another design Bundle. Confirm the actual project root, Kit pin and published design checkpoint with available host readers. Keep unpublished differences separate. Read only the records and artifacts relevant to the authorized task; KAG is a discovery aid, not a substitute for those originals, and unavailable or partial knowledge does not prevent reading the files.
411
+ Inspect the target repository's instructions and existing specs before proposing an output location. Recognize GitHub Spec Kit's specs/<feature>/spec.md, plan.md and tasks.md; OpenSpec's openspec/specs/<domain>/spec.md and openspec/changes/<change>/ proposal, spec deltas, design and tasks; and Kiro's .kiro/specs/<feature>/requirements.md, design.md and tasks.md. Preserve the actual repository's structure and responsibilities, including its current-spec versus proposed-change distinction. These paths are discovery hints, not permission to create every file or assume a framework is active. If several conventions coexist, follow the one governing this task; if none exists, propose an existing convention or an ordinary Markdown brief and resolve the location before writing. Do not install a framework or invent a Yugoo spec schema.
412
+ For the task-scoped brief, use ordinary Markdown links to the actual design source paths, relevant artifact paths and precise record IDs or JSON pointers, with the project, Kit pin and verified published checkpoint beside the links. Use relative links where the target workspace can resolve them; disclose external project paths instead of claiming they are portable. Do not invent a remote URL, copy all design artifacts, or treat a prototype, inference, score or unanswered field as a confirmed requirement. Organize the affected user behavior and scope, important exceptions and constraints, implementation tasks and observable acceptance criteria in the repository's existing requirement/design/task sections; keep design decisions, implementation proposals and unresolved product decisions distinct.
413
+ Produce the brief before coding when scope needs agreement. Existing user authorization carries forward; ask only about consequential unresolved scope or product decisions. Updating target specs or code requires that workspace's authorization, and this guidance grants none. Implement only the agreed slice and report checks actually run. For a design change, return the discrepancy to its owning Bundle's ordinary validation and publication route; after publication, update only affected spec links, tasks and acceptance criteria against the new checkpoint. Development specs and code do not write back to Design Files or silently become design authority. No second requirements store, automatic bidirectional synchronization or required full-project rewrite is introduced.