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): preserve retired handoff inbox reads [R2,N26,H16,B3]
Corey Olson014534bd101f
diff --git a/src/activity-delivery-cli.js b/src/activity-delivery-cli.jsindex cd218836..044132db 100644--- a/src/activity-delivery-cli.js+++ b/src/activity-delivery-cli.js@@ -1,6 +1,7 @@/** Inbox and successful-submit delivery share one canonical receipt path [R2,N26,H16]. */import * as store from './board.js';import { readActivityDelivery } from './activity-delivery-read.js';+import { handoffMoveProblem } from './handoff-state.js';import {activityMainFiles,activityWorkingFiles,@@ -28,6 +29,7 @@ export function activityDeliveryLines({ shouts, agents, activity }, config) {const direct = new Set(shouts.map(shout => shout.shout_id));for (const entry of activity.entries) if (!direct.has(entry.shout)) lines.push(`${entry.at.slice(0, 16)} ${entry.text}`);for (const digest of activity.digests) lines.push(digest.text);+ if (activity.receipt?.recorded === false) lines.push(`activity delivery was not recorded: ${activity.receipt.message}`);if (!lines.length) lines.push('no new shouts or activity');return lines;}@@ -60,7 +62,9 @@ export async function deliverActivity(ctx, { actedIds = [], afterSubmit = false,const shouts = directShouts ? store.inbox(board, me.id, { through: shoutCursor }).filter(shout => !newsShouts.includes(shout.shout_id)) : [];// Pending obligations survive an output failure: delivery is not acknowledgement.- await recordIncluded(ctx, board, me.id, observation);+ const retired = handoffMoveProblem(board, me.id, 'recordActivityDelivery', [{ agentId: me.id }]);+ if (retired) activity.receipt = { recorded: false, code: retired.code, message: retired.message };+ else await recordIncluded(ctx, board, me.id, observation);return { shouts, agents: store.listAgents(board), activity, local };});if (!saveActivityCursor(delivered.local, delivered.activity.cursor)) {diff --git a/test/handoff.test.js b/test/handoff.test.jsindex 9dcfdf04..1680efda 100644--- a/test/handoff.test.js+++ b/test/handoff.test.js@@ -101,7 +101,16 @@ test('handoff takeover prints real work and retires only the outgoing seat [B3,Nconst inbox = await box.cli(1, ['inbox']);assert.ok(inbox.document.shouts.some(row => row.shout_text === 'The final context is here.'));assert.equal((await box.cli(1, ['shout', '--item', String(id), 'One last question.'])).code, 0);- assert.ok((await box.cli(0, ['inbox'])).document.shouts.some(row => row.shout_text === 'One last question.'));+ const beforeRetiredRead = store.events(box.board).length;+ const retiredInbox = await box.cli(0, ['inbox']);+ assert.equal(retiredInbox.code, 0, retiredInbox.error);+ assert.ok(retiredInbox.document.shouts.some(row => row.shout_text === 'One last question.'));+ assert.equal(retiredInbox.document.activity.receipt.recorded, false);+ assert.equal(retiredInbox.document.activity.receipt.code, 'AGENT_REPLACED');+ assert.equal(store.events(box.board).length, beforeRetiredRead, 'reading a retired seat does not record a delivery');+ const retiredAck = await box.cli(0, ['inbox', '--acted-on', 'event:1']);+ assert.equal(retiredAck.document.error.code, 'AGENT_REPLACED');+ assert.equal(store.events(box.board).length, beforeRetiredRead, 'retirement still blocks acknowledgements without partial writes');assert.equal(readFileSync(join(box.paths[0], 'unfinished.txt'), 'utf8'), 'unfinished ownership');});