@zq-silk/yui 0.8.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +48 -46
- package/README.md +33 -31
- package/dist/cli/commandCatalog.js +7 -7
- package/dist/cli.js +1 -31
- package/dist/commands/executionAuditCommands.js +2 -2
- package/dist/commands/taskCommands.js +110 -307
- package/dist/commands/taskCompletionGate.js +15 -12
- package/dist/commands/taskContextCommand.js +18 -11
- package/dist/commands/taskNextActionCommand.js +4 -5
- package/dist/commands/taskWorkspaceCommands.js +2 -2
- package/dist/execution/executionGroup.js +0 -3
- package/dist/executor/agentExecutor.js +4 -2
- package/dist/executor/effectiveLaunch.js +33 -3
- package/dist/integration/gitIntegrationService.js +1 -1
- package/dist/lifecycle/exactRunTerminalization.js +12 -8
- package/dist/observability/orchestrationMetrics.js +5 -19
- package/dist/profile/agentProfile.js +1 -1
- package/dist/repository/taskWorkspaceCoordinator.js +2 -0
- package/dist/repository/taskWorkspacePreparer.js +173 -26
- package/dist/review/reviewRound.js +41 -24
- package/dist/storage/migration/productionRegistry.js +138 -0
- package/dist/storage/sqliteStore.js +1 -1
- package/dist/storage/taskStore.js +26 -27
- package/dist/task/completionReadiness.js +24 -22
- package/dist/task/nextAction.js +47 -61
- package/dist/task/task.js +12 -19
- package/dist/web/assets/client/components.js +3 -1
- package/dist/web/assets/client/i18n.js +6 -0
- package/dist/web/webSnapshot.js +0 -3
- package/i18n/README.zh-CN.md +18 -19
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +47 -43
- package/skills/yui-operator/SKILL.md +24 -33
- package/skills/yui-reviewer/SKILL.md +18 -12
- package/skills/yui-worker/SKILL.md +5 -3
package/ARCHITECTURE.md
CHANGED
|
@@ -5,31 +5,32 @@ runtimes. The user talks to one Operator. The Operator routes each request to
|
|
|
5
5
|
the right Project and Task; that Task's Leader owns decomposition, execution
|
|
6
6
|
choice, review, integration, and completion.
|
|
7
7
|
|
|
8
|
-
## One outcome
|
|
9
|
-
|
|
10
|
-
`Task` is the bounded user outcome. Its
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
managed Task main without
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
8
|
+
## One outcome, Leader-chosen execution topology
|
|
9
|
+
|
|
10
|
+
`Task` is the bounded user outcome. Its optional `type` describes intent, not
|
|
11
|
+
execution topology; software Projects normally use `feature` or `bugfix`, while
|
|
12
|
+
other Projects may define their own types. Yui does not store a direct versus
|
|
13
|
+
integrated delivery mode.
|
|
14
|
+
|
|
15
|
+
A software bugfix is Leader-owned: the Leader implements and verifies it in the
|
|
16
|
+
managed Task main without manufacturing a WorkItem. If the scope proves to need
|
|
17
|
+
independent delivery owners, reclassify it as a feature before creating those
|
|
18
|
+
units. For a feature, the Leader judges whether the whole result is small
|
|
19
|
+
enough to own in the same way or large enough to need independently owned
|
|
20
|
+
delivery units.
|
|
21
|
+
|
|
22
|
+
`WorkItem` means one substantial, independently acceptable requirement with a
|
|
23
|
+
clear owner. Create multiple WorkItems only when multiple Workers can own and
|
|
24
|
+
advance those requirements independently, normally in parallel. Internal
|
|
25
|
+
implementation steps, test runs, review findings, and local fixes remain Run,
|
|
26
|
+
Event, report, or commit evidence under the existing Task or WorkItem; they are
|
|
27
|
+
not new WorkItems.
|
|
28
|
+
|
|
29
|
+
Each WorkItem may use a native subagent inside the Leader conversation or a
|
|
30
|
+
Task Role AgentRun backed by a durable Worker Session. There is no Yui
|
|
31
|
+
subagent launcher or child-session record. AgentRun is an execution attempt,
|
|
32
|
+
not a requirement, and repeated Runs may continue the same compatible Role
|
|
33
|
+
Session.
|
|
33
34
|
|
|
34
35
|
## Profiles, Roles, and Agents
|
|
35
36
|
|
|
@@ -49,8 +50,10 @@ independent execution additionally records an AgentRun.
|
|
|
49
50
|
- A `WorkItemCandidate` is the explicit result currently awaiting Leader
|
|
50
51
|
acceptance. It snapshots the WorkItem revision, summary, and either a
|
|
51
52
|
yielded execution Run or a Leader-managed direct source.
|
|
52
|
-
- `ReviewRound` records
|
|
53
|
-
|
|
53
|
+
- `ReviewRound` records one semantic judgment. A WorkItem Review references
|
|
54
|
+
that WorkItem's immutable Candidate. A Task-final Review references the
|
|
55
|
+
frozen Task heads directly and has no synthetic WorkItem/Candidate anchor.
|
|
56
|
+
It is never another WorkItem.
|
|
54
57
|
|
|
55
58
|
Adding another Agent requires an explicit adapter implementation. Profiles do
|
|
56
59
|
not choose adapters, own Sessions, or carry credentials.
|
|
@@ -65,7 +68,7 @@ effort, round, result, and checks.
|
|
|
65
68
|
|
|
66
69
|
## Lifecycle and acceptance
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
Native-subagent WorkItem execution follows:
|
|
69
72
|
|
|
70
73
|
```text
|
|
71
74
|
todo -> running -> done | failed
|
|
@@ -92,16 +95,12 @@ Every result awaiting acceptance is stored as an explicit WorkItem candidate.
|
|
|
92
95
|
`always` dispatches a review AgentRun for every candidate, whether it comes
|
|
93
96
|
from a yielded execution Run or a Leader-managed direct result; `leader`
|
|
94
97
|
leaves every candidate for the Leader to accept directly or review explicitly.
|
|
95
|
-
`final`
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
provenance.
|
|
102
|
-
Any established immutable Task-final contract or Round remains an obligation.
|
|
103
|
-
A changed integrated head queues a new round; the previous report remains
|
|
104
|
-
evidence. This final Reviewer evaluates the whole
|
|
98
|
+
`final` keeps WorkItem acceptance and Integration independent and supplies the
|
|
99
|
+
default Reviewer Role when the Leader decides the frozen Task result warrants
|
|
100
|
+
an independent final Review. An immutable Task-final contract can require that
|
|
101
|
+
Review. Once a Task-final Round exists, it remains an obligation; a changed
|
|
102
|
+
Task head requires a new Round and the previous report remains evidence. This
|
|
103
|
+
final Reviewer evaluates the whole
|
|
105
104
|
Task, so normal delivery does not pay for a complete review of every WorkItem.
|
|
106
105
|
Review Runs complete only their exact ReviewRound, leave the WorkItem awaiting
|
|
107
106
|
acceptance, and never trigger another review or append a Candidate. Successful
|
|
@@ -114,9 +113,12 @@ never merges it automatically.
|
|
|
114
113
|
Roles describe Agent capability, but they do not own repository workspaces. A
|
|
115
114
|
`ManagedWorkspace` is keyed by its durable owner (`Task`, `WorkItem`,
|
|
116
115
|
`ReviewRound`, or `IntegrationAttempt`); an AgentRun carries only a launch
|
|
117
|
-
snapshot. Review workspaces are
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
snapshot. Review workspaces are writable copies at the frozen commit, so
|
|
117
|
+
diagnostics cannot redirect Develop or become a ChangeSet source. Task-final
|
|
118
|
+
Rounds keep independent immutable records but may reassign one clean physical
|
|
119
|
+
workspace to the next Round for the same Reviewer Role. This lets the native
|
|
120
|
+
Reviewer Session continue while every Run remains bound to its exact Round and
|
|
121
|
+
head.
|
|
120
122
|
|
|
121
123
|
Dependencies are enforced at dispatch. A Role cannot have overlapping active
|
|
122
124
|
Runs, and terminal Task state fences new messages, dispatches, retries, and
|
|
@@ -147,8 +149,8 @@ Projects and Task-main context for the rest. The managed dispatch and
|
|
|
147
149
|
writable set. Provider permission is binding configuration: every managed Role
|
|
148
150
|
defaults to `bypass`, while `default` and `configured` preserve provider-native
|
|
149
151
|
behavior. Provider permission and Profile access intent do not grant Project
|
|
150
|
-
writes. A
|
|
151
|
-
|
|
152
|
+
writes. A Leader-owned source write requires the exact Task-main owner. A
|
|
153
|
+
WorkItem source write requires an exact WorkItem write scope and matching
|
|
152
154
|
managed workspace; a review write instead
|
|
153
155
|
requires an exact ReviewRound owner and frozen Candidate base. Profiles and
|
|
154
156
|
Skills constrain behavior even when provider prompts are bypassed. Provider
|
|
@@ -185,9 +187,9 @@ independently acceptable ownership.
|
|
|
185
187
|
|
|
186
188
|
Capture at the same HEAD reuses the existing ChangeSet. A repaired HEAD creates
|
|
187
189
|
a new candidate; only the latest reviewed candidate may satisfy acceptance.
|
|
188
|
-
An isolated WorkItem cannot be accepted, or
|
|
189
|
-
any writable Project's latest result is uncaptured or unintegrated.
|
|
190
|
-
completion instead requires a clean committed exact Task-main snapshot.
|
|
190
|
+
An isolated WorkItem cannot be accepted, or a Task with WorkItems completed,
|
|
191
|
+
while any writable Project's latest result is uncaptured or unintegrated.
|
|
192
|
+
Leader-owned completion instead requires a clean committed exact Task-main snapshot.
|
|
191
193
|
Workspace roots are
|
|
192
194
|
multi-Project; ChangeSets and Integration Attempts remain single-Project Git
|
|
193
195
|
boundaries.
|
package/README.md
CHANGED
|
@@ -250,8 +250,8 @@ yui project update app --alias app-cli
|
|
|
250
250
|
yui project refresh app
|
|
251
251
|
yui project list
|
|
252
252
|
|
|
253
|
-
yui task create "Fix CSV escaping" --project app --
|
|
254
|
-
yui task create "Ship CSV export" --project app --
|
|
253
|
+
yui task create "Fix CSV escaping" --project app --type bugfix
|
|
254
|
+
yui task create "Ship CSV export" --project app --type feature
|
|
255
255
|
yui task update <task-id> --priority high --tags release,csv --due-at 2026-08-01T00:00:00Z
|
|
256
256
|
yui task update <task-id> --clear-priority --clear-tags --clear-due-at
|
|
257
257
|
yui task show <task-id>
|
|
@@ -259,18 +259,16 @@ yui task context <task-id>
|
|
|
259
259
|
yui task activate <task-id>
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
provenance. Legacy `--require-integration` is an alias for
|
|
273
|
-
`--delivery integrated`, and integrated delivery cannot be downgraded.
|
|
262
|
+
Task type describes intent rather than selecting an execution protocol.
|
|
263
|
+
Software Projects use `bugfix` or `feature`: a bugfix is Leader-owned; if it
|
|
264
|
+
grows into independently owned delivery requirements, reclassify it as a
|
|
265
|
+
feature before creating WorkItems. The Leader decides whether a feature is
|
|
266
|
+
small enough to deliver on Task main or large enough for independently owned WorkItems. A WorkItem is
|
|
267
|
+
one substantial requirement for one Worker, not a development step, test run,
|
|
268
|
+
review finding, or local fix. Multiple WorkItems are useful only when distinct
|
|
269
|
+
Workers can advance meaningful requirements independently. Once WorkItems
|
|
270
|
+
produce Git results, their ChangeSets must be integrated into the Leader's
|
|
271
|
+
Task main before Task-final Review or completion.
|
|
274
272
|
|
|
275
273
|
`project refresh` is the explicit network operation for a stable Project checkout. It fetches the
|
|
276
274
|
configured stable branch directly from the Project remote URL and advances only through a clean,
|
|
@@ -313,9 +311,9 @@ yui config show
|
|
|
313
311
|
yui config workflow clear review
|
|
314
312
|
```
|
|
315
313
|
|
|
316
|
-
For Project-backed software delivery, use `--trigger final` to
|
|
317
|
-
|
|
318
|
-
|
|
314
|
+
For Project-backed software delivery, use `--trigger final` to supply the
|
|
315
|
+
default Reviewer Role when the Leader decides the complete frozen Task result
|
|
316
|
+
needs an independent Review:
|
|
319
317
|
|
|
320
318
|
```sh
|
|
321
319
|
yui config workflow set review --role reviewer --trigger final
|
|
@@ -330,10 +328,13 @@ or a Leader-managed direct result; `leader` leaves the candidate awaiting
|
|
|
330
328
|
acceptance so the Leader can accept it directly or run
|
|
331
329
|
`yui task work review <task-id>/<work-item-id>`. A configured review rule therefore keeps
|
|
332
330
|
Leader-managed candidates awaiting a decision instead of marking them done.
|
|
333
|
-
`final` does not create WorkItem ReviewRounds
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
331
|
+
`final` does not create WorkItem ReviewRounds or decide Task topology. The
|
|
332
|
+
Leader explicitly requests a Task-scoped Review, unless an immutable Task
|
|
333
|
+
contract requires one. The Round freezes Task main directly, so even a
|
|
334
|
+
Leader-owned Task with no WorkItem can be reviewed. A changed frozen head needs
|
|
335
|
+
a new semantic Round; the same compatible Reviewer Session may continue in its
|
|
336
|
+
stable workspace, while every Run remains bound to its exact Round and head.
|
|
337
|
+
The Reviewer follows Project Policy/Knowledge and reports reachable, material,
|
|
337
338
|
actionable findings across the complete Task.
|
|
338
339
|
A ReviewRound freezes the Candidate's exact Git commit and creates a fresh,
|
|
339
340
|
ReviewRound-owned writable worktree on a unique branch. Its AgentRun may edit,
|
|
@@ -385,7 +386,7 @@ expands:
|
|
|
385
386
|
yui task create "Update authentication" \
|
|
386
387
|
--project backend --project frontend \
|
|
387
388
|
--base backend=develop --base frontend=main \
|
|
388
|
-
--
|
|
389
|
+
--type feature
|
|
389
390
|
yui task project add <task-id> shared-sdk --base main
|
|
390
391
|
```
|
|
391
392
|
|
|
@@ -565,15 +566,15 @@ bounded next options. Yield records immutable Run/Candidate or Review evidence
|
|
|
565
566
|
only; it does not imply acceptance, WorkItem completion, ChangeSet capture,
|
|
566
567
|
Integration, or Task completion.
|
|
567
568
|
|
|
568
|
-
For
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
For one substantial feature requirement, the Leader may create a WorkItem and
|
|
570
|
+
give it to a native subagent or Task Role Worker. A small Task or bugfix stays
|
|
571
|
+
on Task main. Do not create a WorkItem merely to record implementation steps,
|
|
572
|
+
tests, review, or follow-up fixes:
|
|
572
573
|
|
|
573
574
|
```sh
|
|
574
|
-
yui task work create <task-id> "
|
|
575
|
-
--objective "
|
|
576
|
-
--accept "
|
|
575
|
+
yui task work create <task-id> "Implement the export API" \
|
|
576
|
+
--objective "Deliver the independently acceptable export API requirement" \
|
|
577
|
+
--accept "The API contract and focused validation are complete"
|
|
577
578
|
yui task work update <task-id>/<work-item-id> running
|
|
578
579
|
yui config profile show reviewer
|
|
579
580
|
```
|
|
@@ -706,8 +707,9 @@ yui task complete <task-id> --summary-file delivery.txt \
|
|
|
706
707
|
This does not weaken normal freshness checks. Yui requires the current,
|
|
707
708
|
unsuperseded Publication to be merged and verified, its local commit to equal
|
|
708
709
|
the physical Task head, its remote commit to be ancestry-divergent, and both
|
|
709
|
-
commits to resolve to the same exact tree.
|
|
710
|
-
|
|
710
|
+
commits to resolve to the same exact tree. When a Task-final Review obligation
|
|
711
|
+
exists, completion also requires the latest semantic Round to attest the
|
|
712
|
+
accepted Task head; otherwise completion does not invent a ReviewRound.
|
|
711
713
|
`--refresh-remote` fetches
|
|
712
714
|
the remote object graph before resolving that Publication commit. For a Task
|
|
713
715
|
governed by a durable exact final-review contract, the user/Operator command
|
|
@@ -241,9 +241,9 @@ const taskChildren = [
|
|
|
241
241
|
{
|
|
242
242
|
name: "create",
|
|
243
243
|
summary: "Create a Draft Task.",
|
|
244
|
-
usage: "yui task create <title> [--
|
|
245
|
-
options: ["--
|
|
246
|
-
optionValues: { "--
|
|
244
|
+
usage: "yui task create <title> [--type <project-defined-type>] [--project <project> ...] [--base <project>=<ref> ...]",
|
|
245
|
+
options: ["--type", "--project", "--base"],
|
|
246
|
+
optionValues: { "--type": ["feature", "bugfix"] }
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
name: "project",
|
|
@@ -266,15 +266,15 @@ const taskChildren = [
|
|
|
266
266
|
{
|
|
267
267
|
name: "update",
|
|
268
268
|
summary: "Update Task metadata.",
|
|
269
|
-
usage: "yui task update <id> [--title <text>] [--description <text>|--clear-description] [--priority <low|medium|high|urgent>|--clear-priority] [--tags <comma-separated>|--clear-tags] [--due-at <RFC3339>|--clear-due-at]
|
|
269
|
+
usage: "yui task update <id> [--title <text>] [--type <project-defined-type>|--clear-type] [--description <text>|--clear-description] [--priority <low|medium|high|urgent>|--clear-priority] [--tags <comma-separated>|--clear-tags] [--due-at <RFC3339>|--clear-due-at]",
|
|
270
270
|
options: [
|
|
271
|
-
"--title", "--description", "--priority", "--tags", "--due-at",
|
|
271
|
+
"--title", "--type", "--description", "--priority", "--tags", "--due-at",
|
|
272
|
+
"--clear-type",
|
|
272
273
|
"--clear-description", "--clear-priority", "--clear-tags", "--clear-due-at",
|
|
273
|
-
"--delivery", "--require-integration"
|
|
274
274
|
],
|
|
275
275
|
optionValues: {
|
|
276
276
|
"--priority": ["low", "medium", "high", "urgent"],
|
|
277
|
-
"--
|
|
277
|
+
"--type": ["feature", "bugfix"]
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
{ name: "activate", summary: "Activate a Draft Task.", usage: "yui task activate <id>" },
|
package/dist/cli.js
CHANGED
|
@@ -1844,36 +1844,6 @@ async function prepareReviewLaneWorkspaces(taskId, reviewRoundId, store, prepare
|
|
|
1844
1844
|
return map;
|
|
1845
1845
|
}
|
|
1846
1846
|
async function directTaskMainSnapshotForTaskCommand(args, store, preparer, environment, taskFinalReviewContract) {
|
|
1847
|
-
const deliveryOption = args.indexOf("--delivery", 3);
|
|
1848
|
-
const deliveryPromotion = args[0] === "task"
|
|
1849
|
-
&& args[1] === "update"
|
|
1850
|
-
&& args[2] !== undefined
|
|
1851
|
-
&& (args.includes("--require-integration", 3)
|
|
1852
|
-
|| (deliveryOption >= 0 && args[deliveryOption + 1] === "integrated"));
|
|
1853
|
-
if (deliveryPromotion) {
|
|
1854
|
-
const task = store.getTask(args[2]);
|
|
1855
|
-
if (task === null
|
|
1856
|
-
|| (task.status !== "active" && task.status !== "draft")
|
|
1857
|
-
|| task.requireIntegration === true
|
|
1858
|
-
|| task.projectBindings.length === 0) {
|
|
1859
|
-
return undefined;
|
|
1860
|
-
}
|
|
1861
|
-
const workspace = store.getTaskWorkspace(task.id);
|
|
1862
|
-
if (task.status === "draft" && workspace === null)
|
|
1863
|
-
return undefined;
|
|
1864
|
-
if (workspace === null
|
|
1865
|
-
|| workspace.owner.type !== "task"
|
|
1866
|
-
|| workspace.owner.taskId !== task.id) {
|
|
1867
|
-
throw usageError(`Task has no authoritative main workspace: ${task.id}.`);
|
|
1868
|
-
}
|
|
1869
|
-
try {
|
|
1870
|
-
return await preparer.snapshotDirectTaskMain(workspace, task.projectBindings.map(({ projectId }) => projectId));
|
|
1871
|
-
}
|
|
1872
|
-
catch (error) {
|
|
1873
|
-
throw usageError(`Delivery promotion Task-main verification failed for ${task.id}: `
|
|
1874
|
-
+ `${error instanceof Error ? error.message : String(error)}`);
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
1847
|
if (taskFinalReviewContract === undefined
|
|
1878
1848
|
|| args[0] !== "task"
|
|
1879
1849
|
|| args[1] !== "work"
|
|
@@ -1913,7 +1883,7 @@ async function actualTaskReviewCandidateForTaskCommand(args, store, preparer, en
|
|
|
1913
1883
|
if (task === null || task.status !== "active" || task.projectBindings.length === 0) {
|
|
1914
1884
|
return undefined;
|
|
1915
1885
|
}
|
|
1916
|
-
// Every Project-backed completion
|
|
1886
|
+
// Every Project-backed completion must freeze
|
|
1917
1887
|
// a clean committed Task-main snapshot. Review policy only decides whether
|
|
1918
1888
|
// that head also needs an independent ReviewRound.
|
|
1919
1889
|
taskId = task.id;
|
|
@@ -219,7 +219,7 @@ export function renderExecutionAudit(report, width = defaultTableWidth()) {
|
|
|
219
219
|
if (orchestration.tasks.length > 0) {
|
|
220
220
|
lines.push(renderTable("Task orchestration metrics", [
|
|
221
221
|
{ header: "Task", minWidth: 7, maxWidth: 14 },
|
|
222
|
-
{ header: "
|
|
222
|
+
{ header: "Type", minWidth: 8, maxWidth: 12 },
|
|
223
223
|
{ header: "Runs", minWidth: 4, maxWidth: 6 },
|
|
224
224
|
{ header: "WIs", minWidth: 3, maxWidth: 5 },
|
|
225
225
|
{ header: "Review F/D/N", minWidth: 12, maxWidth: 16 },
|
|
@@ -229,7 +229,7 @@ export function renderExecutionAudit(report, width = defaultTableWidth()) {
|
|
|
229
229
|
{ header: "Advice", minWidth: 6, maxWidth: 8 }
|
|
230
230
|
], orchestration.tasks.map((task) => [
|
|
231
231
|
task.taskId,
|
|
232
|
-
task.
|
|
232
|
+
task.taskType ?? "unspecified",
|
|
233
233
|
String(task.runs.total),
|
|
234
234
|
String(task.workItems),
|
|
235
235
|
`${task.reviews.full}/${task.reviews.delta}/${task.reviews.nonSemantic}`,
|