Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(feed): retain submit outcomes and receipts [N26,H16,V4,C7]
Corey Olson39abdc0915d3
diff --git a/src/cli.js b/src/cli.jsindex bbc92610..41505a53 100644--- a/src/cli.js+++ b/src/cli.js@@ -1267,10 +1267,18 @@ export async function reportSubmission(ctx, id, commit, gate, doctrine = []) {const { root } = ctx.info;const pin = `refs/pullboard/items/${id}/${commit.slice(0, 12)}`;git(root, ['update-ref', pin, commit]);- const { deliverActivity, activityDeliveryLines } = await import('./activity-delivery-cli.js');- const delivery = await deliverActivity(ctx, { afterSubmit: true, directShouts: false });- ctx.io.result?.({ id, commit, pin, gate, activity: delivery.activity, ...(doctrine.length ? { doctrine } : {}) });- for (const line of activityDeliveryLines(delivery, ctx.config)) ctx.io.say(line);+ const submission = { id, commit, pin, gate, ...(doctrine.length ? { doctrine } : {}) };+ if (ctx.submissionResult) ctx.submissionResult.value = submission;+ try {+ const { deliverActivity, activityDeliveryLines } = await import('./activity-delivery-cli.js');+ const delivery = await deliverActivity(ctx, { afterSubmit: true, directShouts: false });+ submission.activity = delivery.activity;+ for (const line of activityDeliveryLines(delivery, ctx.config)) ctx.io.say(line);+ } catch (error) {+ submission.activity = { receipt: { recorded: false, code: error.code ?? 'ACTIVITY_DELIVERY_FAILED', message: error.message } };+ ctx.io.err(`submitted #${id}, but its activity delivery failed: ${error.message}; read pullboard inbox to retry delivery`);+ }+ ctx.io.result?.(submission);ctx.io.say(`submitted #${id} at ${commit.slice(0, 12)}; ${gate.report}`);ctx.io.say(`pinned as ${pin}, so this work can't be lost; keep your worktree until it is merged`);ctx.io.say(`next: ${reviewerStartup(primaryCheckoutRoot(ctx.info), ctx.config, id)}`);diff --git a/test/activity-feed.test.js b/test/activity-feed.test.jsindex 181cd018..4da2dc91 100644--- a/test/activity-feed.test.js+++ b/test/activity-feed.test.js@@ -21,6 +21,38 @@ import { activityMainFiles, activityWorkingFiles, readActivityCursor, saveActiviconst e2e = createE2eHelpers();after(e2e.cleanup);+test('a recorded submit stays successful when its later activity delivery fails [N26,H16,V4]', () => {+ const box = e2e.project('true');+ const boardPath = join(box.repo, '.git', 'pullboard', 'board.sqlite');+ const board = store.openBoard(boardPath);+ const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Submission survives a delivery failure',+ criterion: 'The private file is committed.' });+ store.closeBoard(board);+ const claimed = box.run(box.web, 'claim', String(id), '--json');+ assert.equal(claimed.code, 0, claimed.out + claimed.err);+ const committed = e2e.commitFile(box, box.web, 'web/delivery-failure.txt', 'private proof\n', 'feat(web): delivery failure fixture [G1]');+ assert.equal(committed.status, 0, committed.stderr);+ const broken = store.openBoard(boardPath);+ // Corrupt only this private derived read state; the authoritative item and move log remain genuine.+ broken.db.prepare('INSERT INTO board_meta(meta_key,meta_value) VALUES (?,?)').run('activity:web-1:cursor:', '{');+ store.closeBoard(broken);+ const submitted = box.run(box.web, 'submit', String(id), '--json');+ assert.equal(submitted.code, 0, submitted.out + submitted.err);+ const document = JSON.parse(submitted.out);+ assert.equal(document.id, id);+ assert.equal(document.gate.green, true);+ assert.equal(document.activity.receipt.recorded, false);+ assert.equal(document.activity.receipt.code, 'ACTIVITY_DELIVERY_FAILED');+ assert.match(submitted.err, /submitted .*activity delivery failed.*inbox/u);+ const after = store.openBoard(boardPath);+ try {+ assert.equal(store.getItem(after, id).item_status, 'submitted');+ assert.equal(store.getItem(after, id).item_commit, document.commit);+ assert.equal(store.events(after).filter(event => event.event_kind === 'submit').length, 1);+ assert.equal(store.events(after).filter(event => event.event_kind === 'activity-delivered').length, 0);+ } finally { store.closeBoard(after); }+});+/** Freeze a private item's exact requirement without claiming a test gate ran in this board-state fixture. */function freeze() {return { text: JSON.stringify({ rows: [], policy: { version: 1, verify: { policy: 'any', family: 'off' } } }), digest: 'activity-fixture' };diff --git a/test/move-registry-baseline.json b/test/move-registry-baseline.jsonindex 77602445..fd6f17a4 100644--- a/test/move-registry-baseline.json+++ b/test/move-registry-baseline.json@@ -62,7 +62,9 @@"recordJobRun","takeCoordinator","landingLeaseMove",- "recordPublishFinding"+ "recordPublishFinding",+ "actOnActivity",+ "recordActivityDelivery"],"itemIdFirstArgument": ["signBar",@@ -631,6 +633,22 @@null,null,null+ ],+ "actOnActivity": [+ null,+ "first",+ null,+ null,+ null,+ null+ ],+ "recordActivityDelivery": [+ null,+ "first",+ null,+ null,+ null,+ null]},"floorCases": [@@ -6952,7 +6970,10 @@"WRONG_BOARD": "open the repository registered to this board and confirm its identity with pullboard status","WRONG_LANE": "create a worktree in the required lane with pullboard worktree <lane> --model \"<model name>\", or take an item in your lane with pullboard next","EXCLUDED_REPOSITORY": "restore the GitHub origin of each excluded project, then run pullboard relay on --all",- "EXCLUDED_INVENTORY": "restore at most 256 excluded boards and their active paired devices, then run pullboard relay on --all"+ "EXCLUDED_INVENTORY": "restore at most 256 excluded boards and their active paired devices, then run pullboard relay on --all",+ "BAD_ACTIVITY_RECEIPT": "read your own inbox again and use its exact interrupt ids",+ "ACTIVITY_NOT_DELIVERED": "read your own inbox before marking its interrupt acted on",+ "STALE_ACTIVITY_RECEIPT": "read inbox again; the claim changed before delivery was recorded"},"replay": {"initial": {diff --git a/test/watch.test.js b/test/watch.test.jsindex 6d1a47ee..ad36c0b8 100644--- a/test/watch.test.js+++ b/test/watch.test.js@@ -258,7 +258,8 @@ test('watch --work announces a claimable item and a review left waiting [A2,N26]writeFileSync(join(builder.path, 'app', 'work.txt'), 'built\n');runFixtureGit(['add', '-A'], { cwd: builder.path, env: box.env, stdio: 'pipe' });runFixtureGit(['commit', '-q', '-m', 'feat(app): fresh work [G1]'], { cwd: builder.path, env: box.env, stdio: 'pipe' });- const firstCommit = box.cli(builder.path, 'submit', String(added.item_id)).commit;+ const firstSubmission = box.cli(builder.path, 'submit', String(added.item_id));+ const firstCommit = firstSubmission.commit;const submitted = lastSequence(box);const review = JSON.parse((await watch.line((line) => JSON.parse(line).kind === 'review-wait', 10_000, 'review-wait notice')).line); // budget: hang ceiling for a 1.2 s review threshold, not a latency claim.assert.equal(review.item, added.item_id);@@ -279,7 +280,8 @@ test('watch --work announces a claimable item and a review left waiting [A2,N26]writeFileSync(join(builder.path, 'app', 'waiting.txt'), 'built\n');runFixtureGit(['add', '-A'], { cwd: builder.path, env: box.env, stdio: 'pipe' });runFixtureGit(['commit', '-q', '-m', 'feat(app): waiting work [G1]'], { cwd: builder.path, env: box.env, stdio: 'pipe' });- const secondCommit = box.cli(builder.path, 'submit', String(waiting.item_id)).commit;+ const secondSubmission = box.cli(builder.path, 'submit', String(waiting.item_id));+ const secondCommit = secondSubmission.commit;runFixtureGit(['switch', '-q', '--detach', secondCommit], { cwd: reviewer, env: box.env, stdio: 'pipe' });box.cli(reviewer, 'next', '--verify', String(waiting.item_id));// The reserve line follows the submit work check while the item is still submitted, before reject reopens it.@@ -307,8 +309,15 @@ test('watch --work announces a claimable item and a review left waiting [A2,N26]'a waiting review is announced once');assert.ok(kinds.includes('accept') && kinds.includes('reject'), 'the verdicts print as events too');const moves = events(box).slice(before).map(event => event.event_kind);- assert.deepEqual(moves, ['add', 'add', 'claim', 'check_accept', 'release', 'claim', 'submit', 'join', 'reserve', 'accept', 'claim', 'submit', 'reserve', 'reject'],- 'watch wrote no event: the new ones are exactly the moves this test made');+ assert.deepEqual(moves, ['add', 'add', 'claim', 'check_accept', 'release', 'claim', 'submit',+ ...(firstSubmission.activity.digests.length ? ['activity-delivered'] : []),+ 'join', 'reserve', 'accept', 'claim', 'submit',+ ...(secondSubmission.activity.digests.length ? ['activity-delivered'] : []), 'reserve', 'reject'],+ 'watch wrote no event: only the explicit moves and their recorded submit-time digests were added');+ for (const event of events(box).slice(before).filter(event => event.event_kind === 'activity-delivered')) {+ assert.equal(event.event_by, builder.agent, 'the submitting recipient records its digest, not watch');+ assert.deepEqual(JSON.parse(event.event_detail).interrupts, [], 'these submit receipts delivered a digest, not an invented interrupt');+ }});test('watch filters by kind, item and addressee, and refuses a flag it cannot follow [A2]', async (t) => {