@tnunamak/dalan 0.8.4 → 0.8.5
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 +12 -0
- package/bin/dot-acp-agent.mjs +3 -1
- package/bin/dot-worker.mjs +15 -1
- package/package.json +1 -1
- package/src/server.mjs +2 -1
- package/src/store.mjs +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.8.5 (2026-12-03)
|
|
8
|
+
|
|
9
|
+
- Look up delegated work with `dalan get` and the ID from its first reply, even without an original local receipt. This read uses the installed bridge owner's existing permission.
|
|
10
|
+
- Admission shows a run-length estimate when worker session reports are absent. It names its source and sample count: observed first claim to final report per worker run. Provider start and end times remain unknown.
|
|
11
|
+
|
|
12
|
+
## 0.8.4 (2026-12-03)
|
|
13
|
+
|
|
14
|
+
- Identical requests to different workers stay separate. Retries still find matching work submitted before the upgrade.
|
|
15
|
+
- Cancelling withdraws queued or claimed work after a short grace window. An immediate follow-up keeps the original job attached; a late follow-up is not silently run as a new task.
|
|
16
|
+
- Published build results name the branch, draft PR and verified commit. They no longer ask callers to apply and push an already published patch. Changed publication details or verification timeouts keep the patch fallback.
|
|
17
|
+
- Worker-reported runtime safety blocks use the refusal outcome and preserve their text. Ordinary checkout and tool failures remain blocked.
|
|
18
|
+
|
|
7
19
|
## 0.8.3 (2026-12-03)
|
|
8
20
|
|
|
9
21
|
## 0.8.2 (2026-12-03)
|
package/bin/dot-acp-agent.mjs
CHANGED
|
@@ -321,7 +321,9 @@ function admissionText(admission, attached) {
|
|
|
321
321
|
if (session?.source === 'worker_reported_sessions') {
|
|
322
322
|
if (count(session.p50_ms)) line.push(`typical session ~${duration(session.p50_ms)} (worker reported, n ${session.n}${window(session.window_days)})`);
|
|
323
323
|
else line.push(`typical session: not enough history (worker reported, n ${count(session.n) ? session.n : 0})`);
|
|
324
|
-
|
|
324
|
+
} else if (session?.source === 'bridge_observed_acquisition_runs') {
|
|
325
|
+
if (count(session.p50_ms)) line.push(`typical session estimate ~${duration(session.p50_ms)} (bridge-observed claim-to-final-report per run, n ${session.n}${window(session.window_days)})`);
|
|
326
|
+
else line.push(`typical session estimate: not enough history (bridge-observed run spans, n ${count(session.n) ? session.n : 0})`);
|
|
325
327
|
}
|
|
326
328
|
const warnings = Array.isArray(submission_warnings) ? submission_warnings.filter(value => typeof value === 'string') : [];
|
|
327
329
|
return [`${line.join('; ')}.`, ...warnings.map(warning => `Submission warning: ${warning}`)].join('\n');
|
package/bin/dot-worker.mjs
CHANGED
|
@@ -182,6 +182,20 @@ function writeReceipt(id, token, body, delivery, review=false, background=false,
|
|
|
182
182
|
return receipt(id);
|
|
183
183
|
}
|
|
184
184
|
function operator() { const file=defaultPath(home,'.config/dot-bridge/operator.key'); const mode=fs.statSync(file).mode&0o777; if(mode!==0o600) throw new Error('operator key must be mode 0600'); return fs.readFileSync(file,'utf8').trim(); }
|
|
185
|
+
// Only local operator reads can recover facade handles without copying its host's secret.
|
|
186
|
+
// A saved receipt always keeps its own authority; this never applies to writes or waits.
|
|
187
|
+
function getReadHeaders(id) {
|
|
188
|
+
if(id.startsWith('msg_')) return {};
|
|
189
|
+
let missing=false;
|
|
190
|
+
try { fs.lstatSync(receiptPath(id)); }
|
|
191
|
+
catch(error) { if(error.code!=='ENOENT') throw error; missing=true; }
|
|
192
|
+
if(missing && /^acp-[a-f0-9]{24}(?:_r[2-6])?$/.test(id)) {
|
|
193
|
+
try { return {'x-operator-key':operator()}; }
|
|
194
|
+
catch(error) { if(error.code!=='ENOENT') throw error; }
|
|
195
|
+
}
|
|
196
|
+
return {'x-owner-capability':receipt(id).token};
|
|
197
|
+
}
|
|
198
|
+
|
|
185
199
|
async function waitForAssignment(id, timeout) {
|
|
186
200
|
const seconds=timeout===null?300:Number(timeout);
|
|
187
201
|
if(!Number.isInteger(seconds)||seconds<1||seconds>3600) throw new Error('wait timeout must be an integer from 1 to 3600 seconds');
|
|
@@ -596,7 +610,7 @@ async function main() {
|
|
|
596
610
|
if(!json&&!waitOutput&&process.stdout.isTTY) { result=`Request ID: ${id}${briefGiven?`\nSend your worker: ${workerPrompt(id)}`:''}`; plainOutput=true; endNote=endNote.split('\n').filter(l=>!l.startsWith('Request ID: ')&&!l.startsWith('Send your worker: ')).join('\n'); }
|
|
597
611
|
break;
|
|
598
612
|
}
|
|
599
|
-
case 'get': { refuseUnknownOptions('get',{flags:['--json']}); const id=args[0]; if(!id||id.startsWith('-')) throw new Error(`get needs a request ID: ${cli} get REQUEST_ID (list your jobs with: ${cli} inbox --all)`); const headers=
|
|
613
|
+
case 'get': { refuseUnknownOptions('get',{flags:['--json']}); const id=args[0]; if(!id||id.startsWith('-')) throw new Error(`get needs a request ID: ${cli} get REQUEST_ID (list your jobs with: ${cli} inbox --all)`); const headers=getReadHeaders(id); result=await request('/get?id='+encodeURIComponent(id)+(headers['x-operator-key']?'&peek=1':''),'GET',null,headers); if(!id.startsWith('msg_')) indexArtifacts(id,result);
|
|
600
614
|
// Human mode: one extra line on stderr so stdout stays the JSON document.
|
|
601
615
|
if(!json&&result?.claim?.activity) { const a=result.claim.activity, age=a.last_tool_at?Math.max(0,Math.round((Date.now()-Date.parse(a.last_tool_at))/1000)):null;
|
|
602
616
|
console.error(`worker activity: ${a.tool_calls} call${a.tool_calls===1?'':'s'}${a.last_tool?`, last ${a.last_tool} at ${a.last_tool_at.slice(11,19)}Z (${age<90?age+'s':age<5400?Math.round(age/60)+'m':Math.round(age/3600)+'h'} ago)`:''}${a.first_workspace_tool_at?'':', no workspace tool'}${a.last_tool_error?`, last error: ${a.last_tool_error}`:''}`); }
|
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -1624,7 +1624,8 @@ const adminServer=http.createServer(async(req,res)=>{
|
|
|
1624
1624
|
if(url.pathname==='/get') {
|
|
1625
1625
|
const requestId=id(url.searchParams.get('id'));
|
|
1626
1626
|
if(!store.hasAssignment(requestId)&&!store.pullQueue.row(requestId)) return json(res,200,{kind:'message',message:store.getMessage(requestId)});
|
|
1627
|
-
|
|
1627
|
+
if(req.headers['x-operator-key']!==undefined && /^acp-[a-f0-9]{24}(?:_r[2-6])?$/.test(requestId)) adminOperator(req);
|
|
1628
|
+
else adminOwner(req,requestId);
|
|
1628
1629
|
store.assertProtocolAvailable(requestId);
|
|
1629
1630
|
store.recordFetched(requestId);
|
|
1630
1631
|
// Read before recording consumption: the response then matches a peek read, which records no consumption.
|
package/src/store.mjs
CHANGED
|
@@ -1385,8 +1385,17 @@ export class Store {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
sessionLength(worker,days=7) {
|
|
1387
1387
|
const since=iso(this.nowMs()-days*86400000), min_samples=QUEUE_WINDOW.minSamples;
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1388
|
+
const reported=this.db.prepare('SELECT duration_ms FROM worker_sessions WHERE worker=? AND ended_at>=? ORDER BY duration_ms').all(worker,since).map(row=>row.duration_ms);
|
|
1389
|
+
// A worker supplies one acquisition ID per run. These are observed work spans,
|
|
1390
|
+
// not provider start/end receipts: omit runs with an active or missing report.
|
|
1391
|
+
const spans=reported.length ? [] : this.db.prepare(`SELECT MIN(c.claimed_at) started_at,MAX(r.created_at) ended_at
|
|
1392
|
+
FROM claims c LEFT JOIN reports r ON r.request_id=c.request_id AND r.claim_id=c.claim_id
|
|
1393
|
+
WHERE c.worker=? AND c.acquisition_id IS NOT NULL AND c.acquisition_id NOT LIKE 'handoff-%'
|
|
1394
|
+
GROUP BY c.subject,c.acquisition_id
|
|
1395
|
+
HAVING MAX(r.created_at)>=? AND SUM(r.claim_id IS NULL)=0`).all(worker,since)
|
|
1396
|
+
.map(row=>Date.parse(row.ended_at)-Date.parse(row.started_at)).filter(ms=>Number.isFinite(ms)&&ms>=0).sort((a,b)=>a-b);
|
|
1397
|
+
const lengths=reported.length?reported:spans;
|
|
1398
|
+
return {source:reported.length?'worker_reported_sessions':'bridge_observed_acquisition_runs',n:lengths.length,min_samples,window_days:days,
|
|
1390
1399
|
p50_ms:lengths.length<min_samples?null:lengths[Math.ceil(lengths.length/2)-1]};
|
|
1391
1400
|
}
|
|
1392
1401
|
trackRecord(worker,kind,days=7) {
|