@tnunamak/dalan 0.9.0 → 0.9.3
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/CHANGELOG.md +18 -0
- package/bin/dot-acp-agent.mjs +15 -4
- package/bin/dot-worker.mjs +11 -1
- package/docs/operations.md +23 -0
- package/docs/pull-workers.md +10 -4
- package/docs/test-suite-isolation.md +36 -0
- package/package.json +1 -1
- package/qualification/README.md +2 -2
- package/qualification/registry-questions-v1.json +126 -0
- package/scripts/worker-bridge-setup.mjs +23 -21
- package/src/acp-bridge.mjs +41 -8
- package/src/cli-help.mjs +1 -1
- package/src/execution.mjs +6 -2
- package/src/get-summary.mjs +3 -2
- package/src/patch-apply.mjs +2 -1
- package/src/phase-trace.mjs +59 -2
- package/src/pr-preflight.mjs +3 -1
- package/src/server.mjs +117 -22
- package/src/service-update-runtime.mjs +18 -7
- package/src/store.mjs +65 -10
- package/src/t3-control.mjs +4 -0
- package/src/tool-registry.mjs +73 -14
- package/src/try-hosted.mjs +5 -2
- package/src/work-order.mjs +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.9.3
|
|
8
|
+
|
|
9
|
+
- Pull request review jobs whose pinned revision has changed stop appearing ready. If an explicit claim confirms the original revision is back, the stale status clears even when all worker lanes are busy.
|
|
10
|
+
- Dalan alerts the operator when a worker keeps receiving eligible work without claiming it. Temporary pauses and failed alert delivery preserve the outstanding alert.
|
|
11
|
+
- Blank clarification responses leave the question open and prompt once more. A trial update retains its settings and scratch files if shutdown cannot be confirmed.
|
|
12
|
+
- Recovery after an interrupted apply shows the original result and preserves its patch when publication cannot be verified.
|
|
13
|
+
|
|
14
|
+
## 0.9.2
|
|
15
|
+
|
|
16
|
+
- An operator can limit private scoped-file reads to one held read-only assignment and set them to expire within its claim lease. The worker needs a separate grant for other assignments.
|
|
17
|
+
|
|
18
|
+
- Muse can accept a delegated review of specific files at a pushed commit and return its work ID.
|
|
19
|
+
- The requester reports an oversized bridge reply and stops retrying it, including when the bridge reports a server error.
|
|
20
|
+
- Work that fails, is blocked, or is refused shows its outcome without suggesting acceptance. Linked corrections remain available.
|
|
21
|
+
- If a worker cannot verify a required capability, Dalan points to a supported adapter.
|
|
22
|
+
- A caller can require identified questions on a worker configured for them. The worker must have both question tools enabled and granted.
|
|
23
|
+
- Use `dalan tell --work ID` to attach a lightweight message to your open work. While work is open, a worker-inbox acknowledgment appears in that child's transcript without waking the parent.
|
|
24
|
+
|
|
7
25
|
## 0.9.0
|
|
8
26
|
|
|
9
27
|
- **Before upgrading, keep a verified backup and the previous installation.** The bridge still uses schema 75 and adds records for native withdrawal, lane reservations and worker-scoped breaks. Before rolling back, verify the old package can use the retained state. Keep newer reports, receipts, artifacts and delivery acknowledgments.
|
package/bin/dot-acp-agent.mjs
CHANGED
|
@@ -324,7 +324,7 @@ function publishPending(s, ctl) {
|
|
|
324
324
|
function storedRepositoryContext(assignment, preparedContext) {
|
|
325
325
|
const input = assignment?.inputs?.[0];
|
|
326
326
|
if (!input) return preparedContext ?? 'No repository input was submitted. The worker sees only the local material included in the brief.';
|
|
327
|
-
const context = preparedContext ?? `Repository input: ${input.github_repo} at pinned commit ${input.head_sha ?? input.base_sha}. The worker can see local changes included in the brief. Other local work is unseen.`;
|
|
327
|
+
const context = preparedContext ?? `Repository input: ${input.github_repo} at pinned commit ${input.head_sha ?? input.base_sha}. The worker can see only local changes explicitly included in the brief. Other local work is unseen.`;
|
|
328
328
|
const fileCount = assignment.paged_read_scope === true ? assignment.scope_paths.length : undefined;
|
|
329
329
|
return withReadScope(context, assignment.read_paths, fileCount);
|
|
330
330
|
}
|
|
@@ -678,18 +678,29 @@ async function handleQuestions(s, ctl, say, client, notice) {
|
|
|
678
678
|
continue;
|
|
679
679
|
}
|
|
680
680
|
if (ctl.cancelled) return;
|
|
681
|
-
(
|
|
682
|
-
|
|
681
|
+
if (response?.action !== 'accept') {
|
|
682
|
+
(ctl.askedQuestions ??= new Set()).add(q.question_id);
|
|
683
683
|
await say('agent_message_chunk', `Work ${rid}: you declined to answer question ${q.question_id}. The question is still open and the job waits for an answer (child turn held).\n\n`);
|
|
684
684
|
continue;
|
|
685
685
|
}
|
|
686
|
+
const accepted = response.content?.answer;
|
|
687
|
+
if (typeof accepted !== 'string' || !accepted.trim()) {
|
|
688
|
+
if (ctl.blankAnswerNotices?.has(q.question_id)) {
|
|
689
|
+
(ctl.askedQuestions ??= new Set()).add(q.question_id);
|
|
690
|
+
} else {
|
|
691
|
+
(ctl.blankAnswerNotices ??= new Set()).add(q.question_id);
|
|
692
|
+
await say('agent_message_chunk', `Work ${rid}: question ${q.question_id} received no answer. The question is still open. I will ask once more. To answer manually: dot-worker answer ${rid} ${q.question_id} TEXT\n\n`);
|
|
693
|
+
}
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
(ctl.askedQuestions ??= new Set()).add(q.question_id);
|
|
686
697
|
const stillOpen = await live(q.question_id);
|
|
687
698
|
if (ctl.cancelled) return;
|
|
688
699
|
if (!stillOpen) {
|
|
689
700
|
await say('agent_message_chunk', `Work ${rid}: question ${q.question_id} was answered or closed while you decided, so your answer was not sent.\n\n`);
|
|
690
701
|
continue;
|
|
691
702
|
}
|
|
692
|
-
text =
|
|
703
|
+
text = accepted;
|
|
693
704
|
}
|
|
694
705
|
await answerThroughJournal({receiptsDir, job:rid, questionId:q.question_id, text,
|
|
695
706
|
readRevision:async () => (await readRowOrThrow(rid)).protocol_revision ?? null,
|
package/bin/dot-worker.mjs
CHANGED
|
@@ -721,7 +721,17 @@ async function main() {
|
|
|
721
721
|
post:envelope=>request('/answer','POST',envelope,owner(),ANSWER_TIMEOUT_MS),
|
|
722
722
|
readQuestion:async()=>(await request('/questions?id='+encodeURIComponent(id),'GET',null,owner())).questions.find(q=>q.question_id===questionId)});
|
|
723
723
|
break; }
|
|
724
|
-
case 'tell': {
|
|
724
|
+
case 'tell': {
|
|
725
|
+
const worker=option('--worker'), work=option('--work'), valued=new Set(['--worker','--work']);
|
|
726
|
+
if((args.includes('--worker')&&!worker)||(args.includes('--work')&&!work)) throw new Error('tell options require a value');
|
|
727
|
+
const rest=args.filter((arg,index)=>!valued.has(arg)&&!valued.has(args[index-1])&&arg!=='--json');
|
|
728
|
+
if(rest.some(arg=>arg.startsWith('-'))) throw new Error('tell accepts --worker NAME, --work ID and --json');
|
|
729
|
+
const text=rest.join(' ');
|
|
730
|
+
if(!text) throw new Error('tell requires text');
|
|
731
|
+
const headers=work?{'x-owner-capability':receipt(work).token}:{};
|
|
732
|
+
result=await request('/tell','POST',{text,...(worker?{worker}:{}),...(work?{request_id:work}:{})},headers);
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
725
735
|
case 'untell': { const worker=option('--worker'),rest=args.filter((a,i)=>a!=='--worker'&&args[i-1]!=='--worker'&&a!=='--json');if(rest.length!==1||rest[0].startsWith('-')) throw new Error('untell requires message ID (optional --worker NAME, --json)');result=await request('/untell','POST',{message_id:rest[0],...(worker?{worker}:{})});break; }
|
|
726
736
|
case 'audit': { const since=option('--since'); result=await request('/audit'+(since?'?since='+encodeURIComponent(since):''),'GET',null,{'x-operator-key':operator()}); break; }
|
|
727
737
|
case 'pause': { const reason=option('--reason'); if(!reason) throw new Error('pause requires --reason'); result=await request('/pause','POST',{reason},{'x-operator-key':operator()}); break; }
|
package/docs/operations.md
CHANGED
|
@@ -249,6 +249,23 @@ The service checks subscription lapse, missing active subscriptions, repeated ca
|
|
|
249
249
|
|
|
250
250
|
Optional self-check timers are deployment-specific, so review their endpoint, issuer, TLS and repository assumptions before enabling them. For token and subscription lifetime guidance, see [connection longevity](connection-longevity.md).
|
|
251
251
|
|
|
252
|
+
## Scoped-file grants for one assignment
|
|
253
|
+
|
|
254
|
+
Use the operator-authenticated local admin endpoint `POST /tools/grant` with
|
|
255
|
+
`name: "fetch_scoped_input"`, the exact `worker`, and a `scope` containing
|
|
256
|
+
`request_id`, `claim_id`, and ISO `expires_at`. Choose an expiration at or before
|
|
257
|
+
the current claim deadline. The assignment must already be claimed, read-only,
|
|
258
|
+
and pinned to a GitHub revision with explicitly approved files. Directory
|
|
259
|
+
expansion is refused for assignment grants.
|
|
260
|
+
|
|
261
|
+
Each chunk still requires the original live claim, its authenticated worker
|
|
262
|
+
and connection, and the current repository and file policy. The grant ends
|
|
263
|
+
at its own expiry even if the claim is renewed. A new claim or a changed
|
|
264
|
+
assignment requires a fresh grant. Use the existing operator revoke operation
|
|
265
|
+
to remove the grant earlier. A grant for a single assignment supersedes a
|
|
266
|
+
worker-wide grant on this tool. Revoke it before deliberately adding a
|
|
267
|
+
worker-wide grant. Older versions cannot use the assignment grant.
|
|
268
|
+
|
|
252
269
|
## Upgrade and rollback
|
|
253
270
|
|
|
254
271
|
The package version is `0.6.0`; the bridge database schema is version 66. Stop the service and every other writer before making a backup or replacing files; keep them stopped until the complete backup set is captured. Keep each backup set consistent: include `<home>/.local/share/dalan/bridge.db`, `delivery-acks.db`, `notify-sent.db`, `<config>/dalan/as.sqlite` when built-in authorization is used, the private `<config>/dalan` files, owner receipts in `<home>/.local/share/dalan/receipts`, and artifact ownership entries in `<home>/.local/share/dalan/artifact-index`. Preserve file permissions. Do not copy either `bridge.db.secrets/owner.sqlite` or `as-owner.sqlite` lock database; recreate them locally after restoring with the service stopped, as described above. If external OAuth is used, its issuer database is managed separately and is not part of this bridge backup.
|
|
@@ -488,6 +505,12 @@ Four line kinds split the time from submit to claim. `wake_delivery` is written
|
|
|
488
505
|
|
|
489
506
|
MCP arrivals and response outcomes are logged without request contents or secrets. `mcp_inbound`, `mcp_outcome` and an answered `signal` line carry `worker`, the configured worker name, so a gap in one worker's calls (for example after a deploy) can be measured from the log. A failed tool call's `mcp_outcome` line also carries `tool_error_message`: the bridge's error text, redacted like alert notes and cut to 300 characters (null for a successful call).
|
|
490
507
|
|
|
508
|
+
### A ready offer without a claim
|
|
509
|
+
|
|
510
|
+
When an authenticated batch listing returns ready work and the worker sends no claim for five minutes, the bridge checks that eligible work and capacity are still available. It logs `claim_offer_stalled` with elapsed milliseconds and publishes through the configured operator alert channel. Open the worker conversation to nudge it if needed. A claim attempt ends this episode, even if the claim is refused. Ordinary webhook wakes continue.
|
|
511
|
+
|
|
512
|
+
If an automatic finish handoff expires before the worker starts it, the bridge records `claim_expired_before_first_action`. On the batch-claim profile it defers new automatic handoffs to that worker for five minutes. The worker can still claim work explicitly and recover an existing live handoff.
|
|
513
|
+
|
|
491
514
|
### Usage breaks and usage estimates
|
|
492
515
|
|
|
493
516
|
The bridge records usage breaks and slows the worker only on evidence: an owner-confirmed break or a pause. Rate limits are estimates that it reports and never enforces. See [usage](usage.md#usage-breaks-and-usage-estimates) for the commands.
|
package/docs/pull-workers.md
CHANGED
|
@@ -10,22 +10,28 @@ Start a new [ChatGPT worker](chatgpt-worker-onboarding.md) or [Claude worker](cl
|
|
|
10
10
|
|
|
11
11
|
Each run checks the worker's MCP connector. The bridge stores the job, progress and owner notes. An independent run needs no earlier grant, but a run that continues after a QUESTION/answer pause or reconnect must retain its acquisition ID, claimant and claim ID. A new run cannot use an active grant merely because `get` shows it.
|
|
12
12
|
|
|
13
|
-
1. Call `list_pending`. For a saved continuation, read any `attention` notes with `get` and continue under the saved grant
|
|
14
|
-
2.
|
|
13
|
+
1. Call `list_pending`. For a saved continuation, read any `attention` notes with `get` and continue under the saved grant. For new work, act only when the listing accepts claims and shows claimable work. If neither needs work, stop. An empty run costs one tool call.
|
|
14
|
+
2. For ordinary queued work, prefer `claim({ next: 1, claimant, acquisition_id })` when you can start one job and the bridge and client advertise `next`. Let the bridge choose from its current queue. Use a stable `claimant` and a fresh random `acquisition_id` for each new acquisition. On a transport failure with an unknown outcome, retry the exact same call with that ID and the same arguments. Retain each returned grant and epoch for continuation.
|
|
15
|
+
- After a successful claim, start the granted work. If the reply's `next_action` offers more claims and you can start more compatible jobs now, make a fresh acquisition before the first job finishes. Claim at most the number offered and only as many jobs as you can start.
|
|
16
|
+
- If the reply grants nothing, call `list_pending` again promptly. Stop when claims are unavailable or no eligible work is ready. If you try a new acquisition from the fresh listing, use a fresh ID.
|
|
17
|
+
- Keep the existing acquisition routes for named jobs, resume, and policy work. Use `request_id` for ordinary work on a client that does not advertise `next`. A live competing named claim returns `claim_busy`. If the client shows a generic error, keep the actual reason unknown. Refresh `list_pending` before continuing and use only grants returned by a successful claim.
|
|
18
|
+
- The default lease is 60 minutes. You can request `lease_ms` from 1 ms up to the owner-configured maximum. The grant records that duration and returns `lease_expires_at`. Matching live retries keep the stored duration. Expired idle own claims can rotate as described below.
|
|
15
19
|
3. Read the job with `get`. Do the work. For repository jobs, use `list_files`, `read_file`, `apply_patch` and `workspace_result`.
|
|
16
20
|
4. Call `progress` while you work. Accepted claim-bearing activity slides a legacy non-protocol lease; `get` does not. Native protocol leases have a fixed deadline: activity and repeated `claim` do not slide it. Use explicit `renew_claim` with the current grant, command key and revision before expiry.
|
|
17
21
|
5. To ask the requester a question, send `progress` with a note that starts `QUESTION:`. The requester answers with `dalan note REQUEST_ID TEXT`. `list_pending` lists claimed jobs with unread owner notes under `attention`, and `get` shows the answer. QUESTION records waiting history but does not pause the lease, stop compute or renew authority when the answer arrives. Continue with the saved grant while it remains valid. If an independent later run takes over, it must use its own acquisition and wait for lease expiry and verified effect-channel cessation; it must not copy the earlier grant from `get`.
|
|
18
|
-
6. Call `finish` with the report. If
|
|
22
|
+
6. Call `finish` with the report. If `finish` returns work that is already claimed for you, start it using the supplied grant. On a wake or a hint about more queued work, start a new cycle at `list_pending`. For builds, inspect `workspace_result` first. The bridge computes the patch from the workspace changes.
|
|
19
23
|
|
|
20
24
|
Messages that the owner sends with `dalan tell` show up in `list_pending`; read them, then call `ack_message`.
|
|
21
25
|
|
|
26
|
+
Finish the assignment through the original requester’s route. A separate message to a T3 thread needs its own thread authorization and delivery confirmation. Report a cancelled or unavailable send as undelivered. If a direct T3 send is unavailable, put the update in `progress` on its original job. Use an operator-registered relay only if discovery shows that grant. A cancelled relay with no delivery attempts did not dispatch a message.
|
|
27
|
+
|
|
22
28
|
Put this loop in the worker's standing instructions, for example in its scheduled task prompt. The bridge also returns short guidance in each `get` response.
|
|
23
29
|
|
|
24
30
|
### Claim several ready assignments in one call
|
|
25
31
|
|
|
26
32
|
The opt-in `batch-claim-v1` catalog advertises `claim({ next, claimant, acquisition_id, lease_ms? })`. Set `next` to 1 through 8 instead of `request_id`. The bridge returns `{ claims, free_lanes }`; each entry is a normal claim reply with the assignment, claim ID and epoch. Treat each entry as a separate grant and start the work before moving on. Save the original acquisition ID and the returned grants across retries. Choose a new acquisition ID for a new batch.
|
|
27
33
|
|
|
28
|
-
The bridge takes ordinary, unskipped queued assignments in list order, limited by current free lanes. It stops at the first refusal and returns the admitted prefix. Cancelled, skipped, and resumable grants are not batch candidates. Native protocol jobs and policy work still use the explicit request ID or their existing acquisition path. A retry with the same batch arguments
|
|
34
|
+
The bridge takes ordinary, unskipped queued assignments in list order, limited by current free lanes. It stops at the first refusal and returns the admitted prefix. Cancelled, skipped, and resumable grants are not batch candidates. Native protocol jobs and policy work still use the explicit request ID or their existing acquisition path. A retry with the same batch arguments uses the original selection. If the bridge saved a nonempty selection and no grant committed, it can still try those same jobs. Once a grant commits, a retry can only recover grants from that batch that are still live. If the returned batch is partial, call `list_pending` to see what's ready and use a fresh acquisition ID for a new batch.
|
|
29
35
|
|
|
30
36
|
Older profiles and single-request calls are unchanged. Only enable the opt-in catalog after coordinating the deployment pin and refreshing the connector's tool schema. Until both advertise `next`, continue using `request_id`.
|
|
31
37
|
|
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
The ordered commands in `scripts/test-segments.json` are the audit boundary. The suite owns mutable state below private, randomly allocated roots. Tests may allocate more private children. Code, installed dependencies, system binaries, and kernel metadata remain shared read-only inputs. Real systemd checks share the user manager but use a distinct unit name per suite.
|
|
4
4
|
|
|
5
|
+
## Parallel qualification
|
|
6
|
+
|
|
7
|
+
The Linux checkout can run the full manifest under one CPU, memory, and process
|
|
8
|
+
governor. Stage each lane in a separate clean checkout at the same commit.
|
|
9
|
+
Point each lane at the same lockfile-matched dependencies. Stage the checkouts
|
|
10
|
+
and keep their short private HOME and scratch roots on disk. Run these commands
|
|
11
|
+
inside the existing qualification governor from the source checkout.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
node scripts/test-qualification-plan.mjs \
|
|
15
|
+
"$serial_profile" scripts/test-qualification-policy.json "$output" "$@" > "$plan"
|
|
16
|
+
node scripts/test-segments.mjs --qualification-plan "$plan"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Pass one staged checkout root per lane as positional arguments. The measured
|
|
20
|
+
plan uses twelve roots. The serial profile must cover the exact command
|
|
21
|
+
manifest in one passing run. The plan records each expected exit and recorded
|
|
22
|
+
skip count by original ordinal. A changed capability or skip needs a new
|
|
23
|
+
serial reference under that host configuration.
|
|
24
|
+
|
|
25
|
+
Commands absent from the reviewed policy run in the serial phase. Changing the
|
|
26
|
+
manifest requires a new policy digest and a matching serial baseline.
|
|
27
|
+
The loopback lanes have separate network and PID namespaces. Tests that inspect
|
|
28
|
+
the original filesystem owners, use normal DNS behavior, or exercise the native
|
|
29
|
+
trial tools share the host network with independent checkout and fixture roots.
|
|
30
|
+
The host executor, nested sandbox and outbound capability tests share one
|
|
31
|
+
lane. Run the existing host-only release proof as usual.
|
|
32
|
+
|
|
33
|
+
On success, `qualification.json` records the commit, governor, serial baseline
|
|
34
|
+
digest and original lane receipts. `segments.jsonl` contains one record per
|
|
35
|
+
manifest ordinal with the qualification and lane run identities. Compare
|
|
36
|
+
`qualification.json` and the runner exit before using the combined profile.
|
|
37
|
+
Individual lane logs remain available on failure. The `npm test` entry point
|
|
38
|
+
continues to run the manifest serially.
|
|
39
|
+
|
|
40
|
+
|
|
5
41
|
## Confirmed failures
|
|
6
42
|
|
|
7
43
|
| Failure | Shared resource or race | Correction and evidence |
|
package/package.json
CHANGED
package/qualification/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Adapter qualification
|
|
2
2
|
|
|
3
|
-
A worker profile may name an `adapter`: `mcp` or `
|
|
3
|
+
A worker profile may name an `adapter`: `mcp`, `protocol-v0`, or `registry-questions-v1`. Omission means unqualified. This field is independent of the `t3` authority grant and of Gozar tunnel routes.
|
|
4
4
|
|
|
5
5
|
Records follow [the adapter schema](../contracts/adapter-qualification.schema.json), copied from the handoff schema with adapter naming. `yes` with a passing observation maps to `verified`; `no` with a passing observation maps to `unsupported`; everything else maps to `unknown`. Unknown capabilities never satisfy a submission requirement.
|
|
6
6
|
|
|
7
|
-
`protocol-v0` qualifies identified question/answer/consume behavior through the local real-server fixture
|
|
7
|
+
`protocol-v0` qualifies identified question/answer/consume behavior through the local real-server fixture and applies only with the `protocol-v0` catalog profile. `registry-questions-v1` qualifies the keyed question path in the authenticated `batch-claim-v1` fixture. Admission requires current write grants for both `ask_question` and `consume_answer`. Its catalog fingerprint covers the granted registry tools returned to the fixture worker. `mcp` makes no verified capability claims. The records cover local fixtures. Hosted models, native session continuity, activation, and worker sandboxes remain unqualified. The source pins identify the probe baselines.
|
|
8
8
|
|
|
9
9
|
Run `node scripts/qualification-gate-test.mjs` to validate the records, compare them with the runtime capability table, and rerun their observations. The gate refuses missing observations, failed probes, mismatched values, duplicate or missing capability names, and unbound evidence. Run `node scripts/adapter-qualification-test.mjs` to exercise actual `/submit` admission and inspect SQLite after refusals. `node scripts/pull-catalog-hash-test.mjs` pins the unchanged worker catalog for all profiles with T3 tools on and off.
|
|
10
10
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"record_kind": "draft_internal_qualification_record_not_wire_protocol",
|
|
4
|
+
"adapter_id": "registry-questions-v1",
|
|
5
|
+
"observed_on": "2026-12-04",
|
|
6
|
+
"pins": {
|
|
7
|
+
"dalan_commit": "f9faa4805a4fa6d9f1831acad33559ebe9bff9a1",
|
|
8
|
+
"requester_ref": "private admin HTTP",
|
|
9
|
+
"worker_host_ref": "local authenticated batch-claim-v1 registry fixture",
|
|
10
|
+
"protocol": "batch-claim-v1",
|
|
11
|
+
"sdk": null,
|
|
12
|
+
"catalog_fingerprint": "57b24428f36fbf0a4d41afa186f64873a4fa17c6118281f683813f83cf769ddd"
|
|
13
|
+
},
|
|
14
|
+
"roles": [
|
|
15
|
+
"worker"
|
|
16
|
+
],
|
|
17
|
+
"continuity": "unknown",
|
|
18
|
+
"activation": "unknown",
|
|
19
|
+
"capabilities": [
|
|
20
|
+
{
|
|
21
|
+
"name": "private_loopback",
|
|
22
|
+
"declared": "unknown",
|
|
23
|
+
"observed": "not_tested",
|
|
24
|
+
"required": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "host_loopback_denied",
|
|
28
|
+
"declared": "unknown",
|
|
29
|
+
"observed": "not_tested",
|
|
30
|
+
"required": false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "lan_denied",
|
|
34
|
+
"declared": "unknown",
|
|
35
|
+
"observed": "not_tested",
|
|
36
|
+
"required": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "unix_sockets_denied",
|
|
40
|
+
"declared": "unknown",
|
|
41
|
+
"observed": "not_tested",
|
|
42
|
+
"required": false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "credential_services_denied",
|
|
46
|
+
"declared": "unknown",
|
|
47
|
+
"observed": "not_tested",
|
|
48
|
+
"required": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "closed_inherited_fds",
|
|
52
|
+
"declared": "unknown",
|
|
53
|
+
"observed": "not_tested",
|
|
54
|
+
"required": false
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "read_scope_enforced",
|
|
58
|
+
"declared": "unknown",
|
|
59
|
+
"observed": "not_tested",
|
|
60
|
+
"required": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "write_scope_enforced",
|
|
64
|
+
"declared": "unknown",
|
|
65
|
+
"observed": "not_tested",
|
|
66
|
+
"required": false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "full_tree_cancel_verified",
|
|
70
|
+
"declared": "unknown",
|
|
71
|
+
"observed": "not_tested",
|
|
72
|
+
"required": false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "offline_transition_revokes_connections",
|
|
76
|
+
"declared": "unknown",
|
|
77
|
+
"observed": "not_tested",
|
|
78
|
+
"required": false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "artifact_export_no_follow",
|
|
82
|
+
"declared": "unknown",
|
|
83
|
+
"observed": "not_tested",
|
|
84
|
+
"required": false
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "runner_observed_evidence",
|
|
88
|
+
"declared": "unknown",
|
|
89
|
+
"observed": "not_tested",
|
|
90
|
+
"required": false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "native_darwin_execution",
|
|
94
|
+
"declared": "unknown",
|
|
95
|
+
"observed": "not_tested",
|
|
96
|
+
"required": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "immutable_input_snapshot",
|
|
100
|
+
"declared": "unknown",
|
|
101
|
+
"observed": "not_tested",
|
|
102
|
+
"required": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "identified_questions",
|
|
106
|
+
"declared": "yes",
|
|
107
|
+
"observed": "passed",
|
|
108
|
+
"required": false,
|
|
109
|
+
"evidence_refs": [
|
|
110
|
+
"scripts/adapter-qualification-test.mjs"
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"qualification": {
|
|
115
|
+
"state": "passed_for_declared_scope",
|
|
116
|
+
"evidence_level": "actual_store_integration",
|
|
117
|
+
"run_refs": [
|
|
118
|
+
"scripts/adapter-qualification-test.mjs"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"limits": [
|
|
122
|
+
"Applies only to batch-claim-v1 with current write grants for ask_question and consume_answer.",
|
|
123
|
+
"No live hosted-worker qualification or native session continuity or activation guarantee.",
|
|
124
|
+
"Sandbox capabilities remain unknown. Host execution keeps its separate backend admission."
|
|
125
|
+
]
|
|
126
|
+
}
|
|
@@ -917,24 +917,6 @@ export function workerRouteReference(home, retained, view, custody) {
|
|
|
917
917
|
}
|
|
918
918
|
|
|
919
919
|
export async function publishWorkerRoute({ o, env, gozar, url, secret, urlFile, configDir, log, consent = routeConsent(log), readReference = readWorkerRouteReference, write = writeAtomic, observeRoute = observeRetainedRoute, platform = process.platform }) {
|
|
920
|
-
const reference = path.join(configDir, 'route-reference.json');
|
|
921
|
-
let ref = readReference(o.home, reference);
|
|
922
|
-
const home = ref?.home ?? gozarHomeFor(env);
|
|
923
|
-
const custody = ref?.custody ?? routeCustodyPath({ HOME: os.homedir(), ...env }, home);
|
|
924
|
-
const target = o.lan ? `${o.lan.address}:${o.lan.port}` : `127.0.0.1:${o.port}`;
|
|
925
|
-
const external = !ref?.handle || ref.handle.kind === 'external';
|
|
926
|
-
const remember = value => {
|
|
927
|
-
const next = { ...value, custody };
|
|
928
|
-
write(reference, JSON.stringify(next));
|
|
929
|
-
ref = next;
|
|
930
|
-
};
|
|
931
|
-
gozar ??= await resolveGozar({ env, home, custody });
|
|
932
|
-
const observed = ref && await observeRoute(gozar, ref);
|
|
933
|
-
const view = observed?.state === 'recorded' ? observed.view : await ensureDurableRoute({
|
|
934
|
-
gozar, query: buildQuery({ home, origin: url, target, address: 'stable', usage: { kind: 'durable', routeId: `dalan-${o.worker}` } }),
|
|
935
|
-
consent, remember, recovery: ref, external: true,
|
|
936
|
-
});
|
|
937
|
-
if (!ref?.handle || (!ref.operationId && view.operationId)) remember(workerRouteReference(home, ref, view, custody));
|
|
938
920
|
const retainedInstall = () => {
|
|
939
921
|
const dir = unitDirFor(platform, env);
|
|
940
922
|
const unit = dir && path.join(dir, platform === 'darwin' ? `${launchLabel(o.worker)}.plist` : `dot-bridge-${o.worker}.service`);
|
|
@@ -945,8 +927,28 @@ export async function publishWorkerRoute({ o, env, gozar, url, secret, urlFile,
|
|
|
945
927
|
};
|
|
946
928
|
return { homeRetained: entry(o.home)?.isDirectory() === true, serviceRetained: entry(unit)?.isFile() === true };
|
|
947
929
|
};
|
|
948
|
-
let
|
|
930
|
+
let phase = 'route_preparation';
|
|
931
|
+
let view, retained;
|
|
949
932
|
try {
|
|
933
|
+
const reference = path.join(configDir, 'route-reference.json');
|
|
934
|
+
let ref = readReference(o.home, reference);
|
|
935
|
+
const home = ref?.home ?? gozarHomeFor(env);
|
|
936
|
+
const custody = ref?.custody ?? routeCustodyPath({ HOME: os.homedir(), ...env }, home);
|
|
937
|
+
const target = o.lan ? `${o.lan.address}:${o.lan.port}` : `127.0.0.1:${o.port}`;
|
|
938
|
+
const external = !ref?.handle || ref.handle.kind === 'external';
|
|
939
|
+
const remember = value => {
|
|
940
|
+
const next = { ...value, custody };
|
|
941
|
+
write(reference, JSON.stringify(next));
|
|
942
|
+
ref = next;
|
|
943
|
+
};
|
|
944
|
+
gozar ??= await resolveGozar({ env, home, custody });
|
|
945
|
+
const observed = ref && await observeRoute(gozar, ref);
|
|
946
|
+
view = observed?.state === 'recorded' ? observed.view : await ensureDurableRoute({
|
|
947
|
+
gozar, query: buildQuery({ home, origin: url, target, address: 'stable', usage: { kind: 'durable', routeId: `dalan-${o.worker}` } }),
|
|
948
|
+
consent, remember, recovery: ref, external: true,
|
|
949
|
+
});
|
|
950
|
+
if (!ref?.handle || (!ref.operationId && view.operationId)) remember(workerRouteReference(home, ref, view, custody));
|
|
951
|
+
phase = 'public_verification';
|
|
950
952
|
if (external) requireExternalRoute(view, url, target);
|
|
951
953
|
if (!isPublished(view) || view.published !== url) {
|
|
952
954
|
retained = retainedInstall();
|
|
@@ -957,7 +959,7 @@ export async function publishWorkerRoute({ o, env, gozar, url, secret, urlFile,
|
|
|
957
959
|
}
|
|
958
960
|
} catch (error) {
|
|
959
961
|
error.partialSetup = {
|
|
960
|
-
phase
|
|
962
|
+
phase, ...(retained ?? retainedInstall()), resourceUrlRewritten: false,
|
|
961
963
|
};
|
|
962
964
|
throw error;
|
|
963
965
|
}
|
|
@@ -1021,7 +1023,7 @@ if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import
|
|
|
1021
1023
|
try { await run(process.argv.slice(2)); }
|
|
1022
1024
|
catch (e) {
|
|
1023
1025
|
console.error(`worker-bridge-setup: ${e.message}`);
|
|
1024
|
-
if (e.partialSetup?.phase
|
|
1026
|
+
if (['route_preparation', 'public_verification'].includes(e.partialSetup?.phase)) {
|
|
1025
1027
|
const { homeRetained, serviceRetained } = e.partialSetup;
|
|
1026
1028
|
console.error(`worker-bridge-setup: partial setup: home ${homeRetained ? 'retained' : 'not retained'}; service unit ${serviceRetained ? 'retained' : 'not retained'}; resource URL not rewritten.`);
|
|
1027
1029
|
}
|
package/src/acp-bridge.mjs
CHANGED
|
@@ -37,7 +37,7 @@ export function paths(env = process.env) {
|
|
|
37
37
|
export class BridgeError extends Error {
|
|
38
38
|
constructor(message, kind, httpStatus) { super(message); this.kind = kind; this.http_status = httpStatus ?? null; }
|
|
39
39
|
}
|
|
40
|
-
export const transient = e => e.kind === 'transport' || e.http_status >= 500;
|
|
40
|
+
export const transient = e => e.retryable !== false && (e.kind === 'transport' || e.http_status >= 500);
|
|
41
41
|
|
|
42
42
|
const isReplyRecord = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
43
43
|
function validAdminVerdict(value) {
|
|
@@ -48,7 +48,7 @@ function validAdminVerdict(value) {
|
|
|
48
48
|
reason.candidates.every(candidate => typeof candidate === 'string'))));
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export function adminRequest(socket, route, { method = 'GET', payload, token, signal, timeoutMs } = {}) {
|
|
51
|
+
export function adminRequest(socket, route, { method = 'GET', payload, token, signal, timeoutMs, maxResponseBytes } = {}) {
|
|
52
52
|
const positive = (value, fallback) => Number.isFinite(Number(value)) && Number(value) > 0 ? Number(value) : fallback;
|
|
53
53
|
const baseMs = positive(process.env.DOT_ACP_HTTP_TIMEOUT_MS, 20000);
|
|
54
54
|
const graceMs = positive(process.env.DOT_ACP_HTTP_GRACE_MS, 1000);
|
|
@@ -62,13 +62,43 @@ export function adminRequest(socket, route, { method = 'GET', payload, token, si
|
|
|
62
62
|
let timer;
|
|
63
63
|
const fail = error => { clearTimeout(timer); reject(error instanceof BridgeError ? error : Object.assign(new BridgeError(error.message, 'transport'), { name: error.name })); };
|
|
64
64
|
const headers = { 'content-type': 'application/json', 'content-length': Buffer.byteLength(bytes), ...(token ? { 'x-owner-capability': token } : {}) };
|
|
65
|
+
// A response intrinsically over the cap will be over it on every retry, so it is a
|
|
66
|
+
// deterministic, nonretryable diagnostic (kind 'local'), never a transport error the
|
|
67
|
+
// restart wrapper repeats. Output stays bounded: chunks past the cap are not retained.
|
|
68
|
+
// An interrupted response (error/aborted/deadline) remains transport and retryable.
|
|
69
|
+
const capBytes = positive(maxResponseBytes ?? process.env.DOT_ACP_ADMIN_RESPONSE_CAP_BYTES, 16 * 1024 * 1024);
|
|
70
|
+
const tooLarge = status => Object.assign(
|
|
71
|
+
new BridgeError(`admin response too large: ${method} ${url.pathname} exceeds the ${capBytes}-byte response cap (HTTP ${status}); not retrying`, 'local', status),
|
|
72
|
+
{ code: 'admin_response_too_large', retryable: false, cap_bytes: capBytes });
|
|
65
73
|
const req = http.request({ socketPath: socket, path: route, method, headers, signal }, res => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
res.
|
|
69
|
-
|
|
74
|
+
const chunks = [];
|
|
75
|
+
let received = 0, capped = false;
|
|
76
|
+
const declared = Number(res.headers['content-length']);
|
|
77
|
+
if (Number.isFinite(declared) && declared > capBytes) {
|
|
78
|
+
capped = true;
|
|
79
|
+
res.destroy();
|
|
80
|
+
req.destroy();
|
|
81
|
+
return fail(tooLarge(res.statusCode));
|
|
82
|
+
}
|
|
83
|
+
res.on('data', b => {
|
|
84
|
+
if (capped) return;
|
|
85
|
+
received += b.length;
|
|
86
|
+
if (received > capBytes) {
|
|
87
|
+
capped = true;
|
|
88
|
+
chunks.length = 0;
|
|
89
|
+
res.destroy();
|
|
90
|
+
req.destroy();
|
|
91
|
+
fail(tooLarge(res.statusCode));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
chunks.push(b);
|
|
95
|
+
});
|
|
96
|
+
res.on('error', error => { if (!capped) fail(error); });
|
|
97
|
+
res.on('aborted', () => { if (!capped) fail(new Error('admin response aborted')); });
|
|
70
98
|
res.on('end', () => {
|
|
99
|
+
if (capped) return;
|
|
71
100
|
clearTimeout(timer);
|
|
101
|
+
const out = Buffer.concat(chunks).toString('utf8');
|
|
72
102
|
let value;
|
|
73
103
|
try { value = JSON.parse(out); } catch { return fail(new Error('invalid admin response')); }
|
|
74
104
|
const admission = url.pathname === '/submit' || url.pathname === '/submit-preview';
|
|
@@ -101,7 +131,7 @@ export async function adminRequestThroughRestart(socket, route, options = {}) {
|
|
|
101
131
|
catch (e) {
|
|
102
132
|
const unsent = ['ECONNREFUSED', 'ENOENT'].includes(e.code) || /ECONNREFUSED|ENOENT/.test(e.message ?? '');
|
|
103
133
|
const quiescing = /bridge_quiescing/.test(e.message ?? '');
|
|
104
|
-
const retry = unsent || quiescing || (read && e.kind === 'transport');
|
|
134
|
+
const retry = e.retryable !== false && e.code !== 'admin_response_too_large' && (unsent || quiescing || (read && e.kind === 'transport'));
|
|
105
135
|
if (!retry || options.signal?.aborted || Date.now() + stepMs > until) throw e;
|
|
106
136
|
await new Promise(resolve => setTimeout(resolve, stepMs));
|
|
107
137
|
}
|
|
@@ -143,7 +173,10 @@ export function adminArtifact(socket, artifactId, token, timeoutMs = 5000, wallC
|
|
|
143
173
|
// T3's delegate_task puts `Act as the <role> sub-agent for this task.\n\n` before the task for every role except general
|
|
144
174
|
// (and none); parseIdentity strips it, because otherwise the token line and a [dot-build] line are no longer first.
|
|
145
175
|
export function parsePrompt(prompt, { worker = null } = {}) {
|
|
146
|
-
const
|
|
176
|
+
const legacy = parseIdentity(prompt, { prefix: 'dot-decision', idPattern });
|
|
177
|
+
const { id: root, text, brief } = worker === 'muse' && legacy.text.startsWith('[muse-decision:')
|
|
178
|
+
? parseIdentity(prompt, { prefix: 'muse-decision', idPattern })
|
|
179
|
+
: legacy;
|
|
147
180
|
// Without a token the identity is the text after the T3 preamble, so a resend with or without a role maps to one request.
|
|
148
181
|
const lines = brief.split('\n');
|
|
149
182
|
let priority = 'normal', requirements = [];
|
package/src/cli-help.mjs
CHANGED
|
@@ -110,7 +110,7 @@ export const COMMANDS = [
|
|
|
110
110
|
{ name: 'note', summary: 'Add a note to a job', usage: 'dalan note ID TEXT [--json]' },
|
|
111
111
|
{ name: 'questions', summary: 'List a job\'s open worker questions', usage: 'dalan questions ID [--json]' },
|
|
112
112
|
{ name: 'answer', summary: 'Answer a worker question', usage: 'dalan answer ID QUESTION_ID TEXT [--json]' },
|
|
113
|
-
{ name: 'tell', summary: 'Send a message to
|
|
113
|
+
{ name: 'tell', summary: 'Send a worker-inbox message, optionally linked to open work', usage: 'dalan tell [--worker NAME] [--work ID] TEXT [--json]' },
|
|
114
114
|
{ name: 'untell', summary: 'Withdraw a message', usage: 'dalan untell MESSAGE_ID [--worker NAME] [--json]' },
|
|
115
115
|
{ name: 'audit', summary: 'Show the audit trail', usage: 'dalan audit [--since RFC3339]' },
|
|
116
116
|
{ name: 'claims', summary: 'List active worker claims', usage: 'dalan claims [--json]' },
|
package/src/execution.mjs
CHANGED
|
@@ -117,13 +117,17 @@ export function withEvidence(row) {
|
|
|
117
117
|
// Committed adapter qualification is independent of per-worker authority grants.
|
|
118
118
|
export const ADAPTER_QUALIFICATIONS = Object.freeze({
|
|
119
119
|
mcp: Object.freeze({capabilities: Object.freeze({})}),
|
|
120
|
+
'registry-questions-v1': Object.freeze({capabilities: Object.freeze({identified_questions: 'verified'})}),
|
|
120
121
|
'protocol-v0': Object.freeze({capabilities: Object.freeze({identified_questions: 'verified'})}),
|
|
121
122
|
});
|
|
122
123
|
|
|
123
|
-
export function admitAdapterCapabilities(adapter, required, catalogProfile) {
|
|
124
|
+
export function admitAdapterCapabilities(adapter, required, catalogProfile, {registryQuestions=false}={}) {
|
|
124
125
|
const qualification = Object.hasOwn(ADAPTER_QUALIFICATIONS, adapter) ? ADAPTER_QUALIFICATIONS[adapter] : null;
|
|
126
|
+
const profileMatches = adapter === 'protocol-v0' ? catalogProfile === 'protocol-v0'
|
|
127
|
+
: adapter === 'registry-questions-v1' ? catalogProfile === 'batch-claim-v1' && registryQuestions
|
|
128
|
+
: true;
|
|
125
129
|
for (const name of required ?? []) {
|
|
126
|
-
const state =
|
|
130
|
+
const state = profileMatches ? qualification?.capabilities[name] ?? 'unknown' : 'unknown';
|
|
127
131
|
if (state !== 'verified') throw new Error(
|
|
128
132
|
'capability_not_available: ' + name + ' (adapter ' + (adapter ?? 'undeclared') + ' declares ' + state + ')');
|
|
129
133
|
}
|
package/src/get-summary.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export function formatGetSummary(job, { id, cli }) {
|
|
|
16
16
|
const count = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
|
17
17
|
const artifacts = (job.artifacts?.length ?? 0) || (job.artifact_ids?.length ?? 0), checks = job.checks?.length ?? 0;
|
|
18
18
|
if (artifacts || checks) lines.push('', `Evidence: ${[artifacts && count(artifacts, 'artifact'), checks && count(checks, 'check')].filter(Boolean).join(', ')}`);
|
|
19
|
-
const next = correctionAction(job, cli) ?? (state === 'finished' ? `${cli} decide ${id} accepted`
|
|
19
|
+
const next = correctionAction(job, cli) ?? (state === 'finished' ? (hasSuccessfulReport(job) ? `${cli} decide ${id} accepted` : null)
|
|
20
20
|
: state === 'cancelled' ? null
|
|
21
21
|
: `${cli} wait ${id} --timeout 3600, then ${cli} get ${id}`);
|
|
22
22
|
if (next) lines.push('', `Next: ${next}`);
|
|
@@ -25,11 +25,12 @@ export function formatGetSummary(job, { id, cli }) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const correctionAction = (job, cli) => job?.revised_by?.request_id ? `${cli} get ${job.revised_by.request_id}` : null;
|
|
28
|
+
const hasSuccessfulReport = job => ['completed', 'done'].includes(job?.report?.outcome);
|
|
28
29
|
|
|
29
30
|
// Piped human output retains the full JSON record and adds only this stderr guidance.
|
|
30
31
|
export function formatGetEndNote(job, { id, cli, decideWords }) {
|
|
31
32
|
const correction = correctionAction(job, cli);
|
|
32
|
-
return correction ? `Next: ${correction}` : job?.status === 'finished' ? `decide: ${cli} decide ${id} ${decideWords}` : null;
|
|
33
|
+
return correction ? `Next: ${correction}` : job?.status === 'finished' && hasSuccessfulReport(job) ? `decide: ${cli} decide ${id} ${decideWords}` : null;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// `dalan wait` on a terminal: one line, in place of the JSON status document.
|
package/src/patch-apply.mjs
CHANGED
|
@@ -111,6 +111,7 @@ function publicationBudget(timeoutMs) {
|
|
|
111
111
|
// Shared owner-side publication path. Approval and formatting belong to the caller.
|
|
112
112
|
export async function materialize({id, got, dir, grantFile, download, recheck,
|
|
113
113
|
dryRun=false, approve=false, standingOnly=false, fetchBase=false, timeoutMs=30000}) {
|
|
114
|
+
if(got?.request_id!==id) throw new Error('materialize result does not match the requested work');
|
|
114
115
|
const grant=readMaterializeGrant(grantFile);
|
|
115
116
|
if(got.status!=='finished'||got.revised_by) throw new Error('materialize needs a current, finished result');
|
|
116
117
|
const ev=got.report?.workspace_evidence, art=ev?.patch_artifact, inputs=got.assignment?.inputs;
|
|
@@ -145,7 +146,7 @@ export async function materialize({id, got, dir, grantFile, download, recheck,
|
|
|
145
146
|
rememberCleanup:()=>{ cleanupPending=true; },recheck:async(phase='push')=>{
|
|
146
147
|
const current=await budget.read(signal=>recheck({signal}));
|
|
147
148
|
const after=phase==='pr' ? 'the branch was pushed, so it exists, but no draft pull request was opened' : 'nothing pushed';
|
|
148
|
-
if(current.status!=='finished'||current.revised_by||current.report?.workspace_evidence?.patch_artifact?.sha256!==art.sha256) {
|
|
149
|
+
if(current?.request_id!==id||current.status!=='finished'||current.revised_by||current.report?.workspace_evidence?.patch_artifact?.sha256!==art.sha256) {
|
|
149
150
|
throw new Error('materialize result changed before publication; '+after);
|
|
150
151
|
}
|
|
151
152
|
const currentDecision=materializeDecision(readMaterializeGrant(grantFile),repo,id,current.publication_authority);
|