Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Shipping requires separate repository-owner authorization. An owner can grant st

Claims default to FIFO. A harness coordinating an explicit owner request can pass its queued `requestId` to `claim_work` without claiming unrelated earlier work. Selection stays project-scoped and does not create a new request. Claims are exclusive per project and tied to a leased credential. Revocation, cancellation, or lease expiry blocks further authorized updates. Expired runs become failed and release the queue, with a visible instruction to inspect prior work. They are never replayed automatically. After inspecting the frozen request, prior run and existing branches/PRs, the original connector can use `resume_work` with an inspection summary. It retains the same request and delivery references, rotates the lease and refuses cancelled, resolved or superseded work. Competing claims and resumes remain exclusive per project. The harness must stop work after a failed heartbeat; cancellation cannot undo source changes it already made. Agent snapshots have a 512 KB limit.

Execution and delivery are tracked separately. Use `record_delivery` early to save a run link, PR link, summary and explicit `remaining` requirements. Later updates can record review, merge, deployment and verification links. A verified production report requires an exact 40-character commit SHA, PR/review/deployment/verification evidence, no remaining requirements and no newer unsubmitted feedback. These are reported evidence records, not a substitute for independent review or CI. Only the original connector or project owner can reconcile terminal delivery. New owner requests retain explicitly unfinished requirements and prior run/PR references; existing tasks without structured delivery remain readable.
Execution and delivery are tracked separately. Use `record_delivery` early to save a run link, PR link, summary and explicit `remaining` requirements. Later updates can record review, merge, deployment and verification links. A verified production report requires an exact 40-character commit SHA, PR/review/deployment/verification evidence, no remaining requirements and no newer unsubmitted feedback. An older review or failed request can report verified delivery only when the latest request is also review or failed, has verified delivery with no remaining work, and records the same PR and exact commit. These are reported evidence records, not a substitute for independent review or CI. Only the original connector or project owner can reconcile terminal delivery. New owner requests retain explicitly unfinished requirements and prior run/PR references; existing tasks without structured delivery remain readable.

Requests queued for more than ten minutes display **Waiting for runner**. This is an attention signal, not an automatic retry or a claim that the runner was notified. Failed executions retain their delivery references and inspection history. A thread with explicit remaining work cannot be resolved until that work is completed or the owner cancels it. No automatic publishing, merging, scheduling or permission changes are performed by the toolbar.

Expand Down
21 changes: 19 additions & 2 deletions src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,23 @@ export function createApp(options: Options) {
await access(principal, before.projectId, true, true);
}
const thread = requireValue(await store.get('threads', before.threadId, threadSchema));
const latest =
input.delivery.stage === 'verified'
? (await store.query('jobs', jobSchema, { threadId: thread.id }, 1, 0, true))[0]
: undefined;
if (input.delivery.stage === 'verified') {
const latest = (await store.query('jobs', jobSchema, { threadId: thread.id }, 1, 0, true))[0];
if (latest?.id !== before.id || (await publicThread(thread)).unsubmittedMessageCount)
const reconcilesHistorical =
latest &&
['review', 'failed'].includes(before.status) &&
['review', 'failed'].includes(latest.status) &&
latest.delivery?.details.stage === 'verified' &&
latest.delivery.details.remaining.length === 0 &&
latest.delivery.details.commit === input.delivery.commit &&
latest.delivery.details.pullRequestUrl === input.delivery.pullRequestUrl;
if (
(latest?.id !== before.id && !reconcilesHistorical) ||
(await publicThread(thread)).unsubmittedMessageCount
)
throw new HttpError(409, 'Newer feedback remains. Verify the current request first.');
}
const at = now();
Expand All @@ -1337,6 +1351,9 @@ export function createApp(options: Options) {
},
{ kind: 'jobs', id: job.id, before, after: job },
{ kind: 'threads', id: thread.id, before: thread, after: updated },
...(latest && latest.id !== before.id
? [{ kind: 'jobs', id: latest.id, before: latest, after: latest }]
: []),
],
[store.auditStatement(job.projectId, principal.id, 'work.delivery-recorded', job.id)],
))
Expand Down
Loading
Loading