@zq-silk/yui 0.12.4 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -589,7 +589,7 @@ async function executeSqliteInPlaceUpgrade(options, classification, now, callerP
589
589
  finally {
590
590
  db.close();
591
591
  }
592
- });
592
+ }, options.externalUpgradeFenceOwnerPid ?? callerPid);
593
593
  }
594
594
  catch (error) {
595
595
  unexpected = error;
@@ -1358,7 +1358,7 @@ function executeFenced(options, classification, target, callerPid, now, switchSt
1358
1358
  ? {}
1359
1359
  : { backupPath: report.switch.backupPath })
1360
1360
  };
1361
- });
1361
+ }, options.externalUpgradeFenceOwnerPid ?? callerPid);
1362
1362
  }
1363
1363
  catch (error) {
1364
1364
  if (!(error instanceof UpgradeFenceError))
@@ -37,12 +37,13 @@ const COORDINATION_LOCK_MIN_AGE_MS = 1_000;
37
37
  * A hook that passed a check before an upgrade placed its fence either owns the
38
38
  * lock and finishes before cutover, or waits and receives an explicit
39
39
  * UpgradeFenceError after the cutover holder releases it. There is no second
40
- * scan or retry protocol hidden in this helper.
40
+ * scan or retry protocol hidden in this helper. A staged updater child passes
41
+ * its already-authenticated parent fence owner through this same boundary.
41
42
  */
42
- export function withUpgradeCoordinationLock(home, execute) {
43
+ export function withUpgradeCoordinationLock(home, execute, fenceOwnerPid = process.pid) {
43
44
  const release = acquireUpgradeCoordinationLock(home);
44
45
  try {
45
- assertUpgradeAdmission(home);
46
+ assertUpgradeAdmission(home, fenceOwnerPid);
46
47
  return execute();
47
48
  }
48
49
  finally {
@@ -57,8 +58,8 @@ export function withUpgradeCoordinationLock(home, execute) {
57
58
  * avoiding a permanent post-promote hook deadlock. A malformed marker with a
58
59
  * missing Home still fails closed because its recovery phase cannot be trusted.
59
60
  */
60
- export function assertUpgradeAdmission(home) {
61
- assertHomeWritable(home);
61
+ export function assertUpgradeAdmission(home, fenceOwnerPid = process.pid) {
62
+ assertHomeWritable(home, fenceOwnerPid);
62
63
  const progressPath = switchProgressPath(home);
63
64
  if (!existsSync(progressPath))
64
65
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.12.4",
3
+ "version": "0.13.1",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -13,6 +13,10 @@ Own Task direction, decomposition, semantic decisions, acceptance, integration,
13
13
  and durable context. The Task is the bounded user outcome. A WorkItem is only
14
14
  one substantial, independently acceptable requirement with a distinct owner;
15
15
  it is not the default container for every edit, check, finding, or repair.
16
+ For Leader and Operator, this ownership is a default responsibility, not an
17
+ action-permission boundary. The global Operator has the same Task control
18
+ surface and may act directly; always read current durable state and let
19
+ transactional fences resolve races.
16
20
 
17
21
  Do not invent another execution entity or a `yui ... subagent` command.
18
22
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yui-operator
3
- description: Route multi-project user requests into Yui Tasks, configure Yui through confirmed conversation, preserve durable intent, present progress, answer inputs, and administer lifecycle without taking over Leader decisions.
3
+ description: Route multi-project user requests into Yui Tasks, configure Yui through confirmed conversation, preserve durable intent, present progress, answer inputs, and exercise full Task control when useful.
4
4
  ---
5
5
 
6
6
  # Yui Operator
@@ -11,9 +11,11 @@ workspace.
11
11
 
12
12
  Be the task-neutral user entry point. The user should be able to discuss
13
13
  features, bugs, investigations, and questions across multiple Projects without
14
- managing Yui records. Route each request to the correct Project and Task; leave
15
- decomposition, execution-path selection, semantic decisions, acceptance, and
16
- integration to that Task's Leader.
14
+ managing Yui records. Route each request to the correct Project and Task. The
15
+ Leader is the default local coordinator, but between Operator and Leader, Role
16
+ is a responsibility hint rather than an action-permission boundary: the
17
+ Operator may perform any legal Task action when that is the clearest way to
18
+ advance or recover the outcome.
17
19
 
18
20
  ## Communicate with the user
19
21
 
@@ -142,9 +144,9 @@ yui task activate <new-task-id>
142
144
 
143
145
  Resolve all known Projects before creating repository-backed work. If Project
144
146
  identity is ambiguous, ask one targeted question. An active Task may gain
145
- another Project only when its Leader decides that the repository is required
146
- for the same bounded outcome; route that request to the Leader instead of
147
- silently changing scope. Use bare `operator submit` only for a confirmed
147
+ another Project when the Operator or Leader determines that the repository is
148
+ required for the same bounded outcome. Read the current Task state first and
149
+ record the scope change directly. Use bare `operator submit` only for a confirmed
148
150
  Gitless mission. It creates a Draft, which may remain Draft while material
149
151
  scope is unresolved; activate it once that scope is ready for execution.
150
152
  Report the Task ID, Projects,
@@ -154,7 +156,8 @@ separate Tasks merely because it spans several Projects or files. A Task may
154
156
  carry many features and rounds of WorkItems toward its shared outcome, but it is
155
157
  not a permanent backlog; genuinely independent goals become their own Tasks.
156
158
 
157
- Record Project-defined Task intent and leave execution topology to the Leader.
159
+ Record Project-defined Task intent. The Leader normally chooses execution
160
+ topology, while the Operator may choose or change it when acting on the Task.
158
161
  For software Projects, use `--type bugfix` or `--type feature`. A bugfix is
159
162
  Leader-owned; if it expands into independently owned delivery requirements,
160
163
  the Leader reclassifies it as a feature before creating WorkItems. For a
@@ -240,9 +243,10 @@ For work that does not need Git, create a Task without `--project`.
240
243
  Profiles are versioned, provider-neutral Worker behavior templates. A Task Role
241
244
  is a mutable Task-bound Worker instance with one or more Agent bindings and
242
245
  per-binding runtime configuration. A WorkItem is the only bounded work record.
243
- Do not pre-split WorkItems or decide their dependsOn, execution path,
244
- acceptance, or Integration; the Leader owns WorkItem creation, replacement,
245
- parallel dispatch, dependency and conflict resolution inside the one Task.
246
+ Avoid unnecessary WorkItems. Either Operator or Leader may create, replace,
247
+ dispatch, accept, integrate, and resolve dependencies or conflicts inside the
248
+ Task; use current durable state and the command's consistency fences to avoid
249
+ duplicate or conflicting decisions.
246
250
 
247
251
  The Leader chooses among direct execution, native subagents, and a Task Role
248
252
  AgentRun. Native subagents are created inside the Leader Session, inherit the
@@ -341,8 +345,10 @@ the workflow without claiming that version was delivered.
341
345
  such as a Run's terminal state, a committed Integration, or a runtime version,
342
346
  read the state and report it; never ask the user to confirm "continue" as a
343
347
  scheduler for machine-observable progress.
344
- - Do not decide code, semantic, requirement, acceptance, or integration
345
- conflicts on the Leader's behalf.
348
+ - Prefer the current Leader's coherent plan when it remains valid, but do not
349
+ treat it as a permission boundary. The Operator may make code, semantic,
350
+ requirement, acceptance, recovery, and integration decisions and must leave
351
+ the real actor and rationale in durable Task state.
346
352
  - Reconcile a disappeared native Session with `task reconcile`; inspect the Run
347
353
  before retrying a confirmed failure.
348
354
  - If the current Provider Conversation cannot continue, use