weir-harness 1.2.3 → 2.0.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/cordis.patch.yml +7 -18
- package/lib/client.file-lease-badge.js +307 -0
- package/lib/client.js +20 -30
- package/lib/client.settings-page.js +10 -34
- package/package.json +2 -2
- package/src/capabilities/store/checked-contract.d.ts +2 -2
- package/src/capabilities/store/fs-adapter.js +2 -3
- package/src/context-guard/index.js +2 -2
- package/src/delegate/supervision-mount.js +5 -5
- package/src/delegate/tool.js +2 -10
- package/src/file-lease/client.js +1066 -0
- package/src/file-lease/index.js +30 -0
- package/src/file-lease/lineage.js +207 -0
- package/src/file-lease/node-contracts.d.ts +42 -0
- package/src/file-lease/plugin.js +789 -0
- package/src/file-lease/singleton.js +155 -0
- package/src/file-lease/spawn.js +62 -0
- package/src/file-lease/tools.js +459 -0
- package/src/file-lease/view.js +144 -0
- package/src/hashline-edit/index.js +76 -42
- package/src/hashline-edit/write-tool.js +90 -0
- package/src/lease-broker/entry.js +98 -0
- package/src/lease-broker/node-contracts.d.ts +63 -0
- package/src/lease-broker/protocol.js +236 -0
- package/src/lease-broker/server.js +399 -0
- package/src/lease-broker/state.js +425 -0
- package/src/lsp/tools.js +137 -27
- package/src/settings/index.js +2 -44
- package/src/settings/sections.js +2 -24
- package/src/shared/audit.js +6 -1
- package/src/todo-driver/index.js +1 -6
- package/src/worktree/cards.js +6 -21
- package/src/worktree/lane-core.js +1 -19
- package/src/worktree/lane-workflows.js +11 -32
- package/lib/client.edit-lock-maintenance.js +0 -592
- package/lib/client.edit-lock-panel.js +0 -405
- package/src/edit-lock/adapter.js +0 -57
- package/src/edit-lock/admin-ledger.js +0 -149
- package/src/edit-lock/admin-recovery.js +0 -151
- package/src/edit-lock/admission.js +0 -82
- package/src/edit-lock/binding-attestation.js +0 -29
- package/src/edit-lock/binding-guidance.js +0 -72
- package/src/edit-lock/binding-machine.js +0 -312
- package/src/edit-lock/call-context.js +0 -65
- package/src/edit-lock/derived-facts.js +0 -67
- package/src/edit-lock/domain.js +0 -165
- package/src/edit-lock/domains.js +0 -170
- package/src/edit-lock/host.js +0 -149
- package/src/edit-lock/incarnations.js +0 -150
- package/src/edit-lock/index.js +0 -1303
- package/src/edit-lock/inspect.js +0 -219
- package/src/edit-lock/lifecycle.js +0 -579
- package/src/edit-lock/limits.js +0 -61
- package/src/edit-lock/maintenance.js +0 -310
- package/src/edit-lock/manager.js +0 -875
- package/src/edit-lock/negotiation.js +0 -132
- package/src/edit-lock/operation-history.js +0 -214
- package/src/edit-lock/peer-client.js +0 -86
- package/src/edit-lock/peer-transport.js +0 -76
- package/src/edit-lock/peer.js +0 -87
- package/src/edit-lock/publisher.js +0 -191
- package/src/edit-lock/read-authority.js +0 -101
- package/src/edit-lock/recovery.js +0 -139
- package/src/edit-lock/remote.js +0 -362
- package/src/edit-lock/request-binding.js +0 -42
- package/src/edit-lock/request-data.js +0 -40
- package/src/edit-lock/reservation.js +0 -301
- package/src/edit-lock/reserved-runtime.js +0 -45
- package/src/edit-lock/resource-identity.js +0 -130
- package/src/edit-lock/runtime.js +0 -145
- package/src/edit-lock/settle.js +0 -144
- package/src/edit-lock/snapshot.js +0 -175
- package/src/edit-lock/stale-sweep.js +0 -120
- package/src/edit-lock/state.js +0 -462
- package/src/edit-lock/store.js +0 -327
- package/src/edit-lock/tool-scope.js +0 -29
- package/src/edit-lock/view.js +0 -170
- package/src/edit-lock/write-scopes.js +0 -48
- package/src/edit-lock/write-tool.js +0 -45
- package/src/shared/delegate-edit-lifecycle.js +0 -36
- package/src/worktree/authority.js +0 -56
|
@@ -118,7 +118,7 @@ function apply(ctx, config = {}) {
|
|
|
118
118
|
const request = state.request
|
|
119
119
|
if (!live(agent) || request?.kind !== 'applied' || request.delivered) return
|
|
120
120
|
fresh(agent)
|
|
121
|
-
if (request.kind !== 'applied' || request.controller.signal.aborted
|
|
121
|
+
if (request.kind !== 'applied' || request.controller.signal.aborted) {
|
|
122
122
|
state.blocked = true
|
|
123
123
|
request.delivered = true
|
|
124
124
|
record(agent, request, 'resume-blocked')
|
|
@@ -197,7 +197,7 @@ function apply(ctx, config = {}) {
|
|
|
197
197
|
if (decision.kind !== 'enter') return decision
|
|
198
198
|
let resume
|
|
199
199
|
const current = state.request
|
|
200
|
-
if (current?.kind === 'applied' && !current.delivered && !signal?.aborted
|
|
200
|
+
if (current?.kind === 'applied' && !current.delivered && !signal?.aborted) {
|
|
201
201
|
current.delivered = true
|
|
202
202
|
current.detach?.(); current.detachMaintenance?.()
|
|
203
203
|
resume = RESUME_AFTER_COMPACTION
|
|
@@ -10,7 +10,6 @@ import { auditFilePathOf, isTerminalStatus, readAuditTail, readChildFinalText }
|
|
|
10
10
|
import { AUDIT_TYPES } from '../shared/audit.js'
|
|
11
11
|
import { userTextMessage } from '../shared/user-message.js'
|
|
12
12
|
import { contentText } from '../shared/content-text.js'
|
|
13
|
-
import { withSupervisedEditResume, settleDelegateEditLifecycle } from '../shared/delegate-edit-lifecycle.js'
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Mount the supervision subsystem on the plugin ctx.
|
|
@@ -81,8 +80,8 @@ export function mountSupervision({ ctx, audit, settings, supervisionNow, onChild
|
|
|
81
80
|
sendTo: async (childId, text) => {
|
|
82
81
|
await ctx.subagents.sendMessage(parent, childId, [{ type: 'text', text }], { signal: new AbortController().signal })
|
|
83
82
|
},
|
|
84
|
-
resumeTo: (childId, text) =>
|
|
85
|
-
ctx.subagents.sendMessage(parent, childId, [{ type: 'text', text }], { signal: new AbortController().signal })
|
|
83
|
+
resumeTo: (childId, text) =>
|
|
84
|
+
ctx.subagents.sendMessage(parent, childId, [{ type: 'text', text }], { signal: new AbortController().signal }),
|
|
86
85
|
interruptChild: (childId) => {
|
|
87
86
|
ctx.subagents.interrupt(childId, { kind: 'ancestor', agent: parent })
|
|
88
87
|
},
|
|
@@ -107,8 +106,9 @@ export function mountSupervision({ ctx, audit, settings, supervisionNow, onChild
|
|
|
107
106
|
const runtime = runtimeFor(fact.childId)
|
|
108
107
|
// No observed quiescence means no automatic handoff, including
|
|
109
108
|
// a cold bookkeeping fact. Lane reconciliation owns that case.
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
// Runtime quiescence is the ONLY gate: the retired Edit Lock
|
|
110
|
+
// disposition acknowledgement used to join here as well.
|
|
111
|
+
void runtime.promise
|
|
112
112
|
.then(() => onChildSettled?.(fact.childId, parent))
|
|
113
113
|
.catch(error => {
|
|
114
114
|
const note = `child ${fact.childId}: terminal handoff failed; lane remains bound: ${error?.message ?? error}`
|
package/src/delegate/tool.js
CHANGED
|
@@ -5,7 +5,6 @@ import { parseEscalation } from './escalate.js'
|
|
|
5
5
|
import { continuableLane, oneShotLane, spawnGuardedChild, supervisedLane } from './spawn-adapter.js'
|
|
6
6
|
import { WORKTREE_CODES } from '../worktree/errors.js'
|
|
7
7
|
import { contentText } from '../shared/content-text.js'
|
|
8
|
-
import { settleDelegateEditLifecycle } from '../shared/delegate-edit-lifecycle.js'
|
|
9
8
|
|
|
10
9
|
export const DELEGATE_TOOL_NAME = 'delegate'
|
|
11
10
|
export const BATCH_LIMIT = 16
|
|
@@ -319,16 +318,9 @@ async function spawnBackground(item, args, deps, exec) {
|
|
|
319
318
|
return { job_id: jobId, label }
|
|
320
319
|
}
|
|
321
320
|
|
|
322
|
-
async function settledResult(started, parent) {
|
|
323
|
-
try { return await started.result } finally {
|
|
324
|
-
// subagent/end is emit, not an awaited barrier. Explicitly join the
|
|
325
|
-
// incarnation's standard edit disposition before result/escalation/handoff.
|
|
326
|
-
await settleDelegateEditLifecycle(parent, started.id, started.agent)
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
321
|
/** Await one child, honoring the one-level ESCALATE contract. */
|
|
330
322
|
async function withEscalation(started, item, deps, exec, binding = null) {
|
|
331
|
-
const first = await
|
|
323
|
+
const first = await started.result
|
|
332
324
|
const text = contentText(first.output)
|
|
333
325
|
const escalation = parseEscalation(text)
|
|
334
326
|
if (!escalation) {
|
|
@@ -345,7 +337,7 @@ async function withEscalation(started, item, deps, exec, binding = null) {
|
|
|
345
337
|
// The escalated respawn works in the same lane under the same binding (the
|
|
346
338
|
// lane's bound child stays the first child; it settles once, after this).
|
|
347
339
|
const respawned = await spawnGuardedChild({ target, prompt, parent: exec.agent, signal: exec.signal, label: `${laneLabel(target.label, binding)} (escalated)`, laneGuard: laneGuardOf(binding, deps, exec) }, oneShotLane(), deps)
|
|
348
|
-
const second = await
|
|
340
|
+
const second = await respawned.result
|
|
349
341
|
return {
|
|
350
342
|
id: respawned.id,
|
|
351
343
|
status: second.stopReason,
|