Skip to content

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.

fix(merge): preserve sealed item threads and shouts [N38,B29]

Corey Olsoneac6bc6d0d4f
diff --cc src/api.js
index eb5bd1d7,29dbbd9b..b470dfb5
--- a/src/api.js
+++ b/src/api.js
@@@ -210,11 -211,9 +212,12 @@@ export function createLocalApiHandler(
state.requests = projectData.requests;
state.milestones = projectData.milestones;
state = projectRowDecisions(projectData.rowDecisions, state);
+ state.items = state.items.map((item) => ({ ...item, thread: projectData.threads.get(item.id) ?? [] }));
return state;
},
+ shout: (board, id) => relayLinked(board.root)
+ ? relayPresentationShout(board.root, id)
+ : withBoard(board.root, (db) => store.shoutDetails(db, id)),
code: (board, ref) => codeAt(board.root, ref),
events: (board, after) => afterEvents(board.root, after),
eventLogVersion: () => store.EVENT_LOG_VERSION,
diff --cc src/relay-presentation.js
index def3464c,9b98342c..8072c377
--- a/src/relay-presentation.js
+++ b/src/relay-presentation.js
@@@ -10,27 -10,13 +10,27 @@@ import { projectState } from './serve.j
/** Capture spec, doctrine, config and board presentation without sending plaintext to a relay. */
export function relayPresentation(root) {
+ const state = projectState(root);
const info = repoInfo(root);
const board = store.openBoard(join(info.commonDir, 'pullboard', 'board.sqlite'));
- let shouts;
- try { shouts = store.allShouts(board); } finally { store.closeBoard(board); }
- return { version: 1, state: projectState(root), config: loadConfig(root), shouts };
- try { return { version: 1, state: store.projectItemThreads(board, state), config: loadConfig(root) }; }
++ try { return { version: 1, state: store.projectItemThreads(board, state), config: loadConfig(root), shouts: store.allShouts(board) }; }
+ finally { store.closeBoard(board); }
}
+/** Resolve one shout from the complete history carried only inside the sealed presentation. */
+export function relayPresentationShout(root, id) {
+ return presentationShout(relayPresentation(root), id);
+}
+
+/** Resolve one addressed shout from an already decoded snapshot without local repository access. */
+export function presentationShout(presentation, id) {
+ if (!Array.isArray(presentation?.shouts)) throw new Refused('SHOUT_NOT_AVAILABLE', 'this snapshot does not include addressed shout history; refresh it with a current CLI');
+ const found = presentation.shouts.find((shout) => shout.shout_id === id);
+ if (!found) throw new Refused('NO_SHOUT', `no shout #${id}`);
+ const answer = found.shout_decision ? presentation.shouts.find((shout) => shout.shout_answers === id) ?? null : null;
+ return { ...found, decision_state: found.shout_decision ? (answer ? 'answered' : 'open') : null, decision_answer: answer };
+}
+
/** Notice presentation-only changes, including a spec or doctrine edit without a board move. */
export function presentationDigest(presentation) {
return createHash('sha256').update(JSON.stringify(presentation)).digest('hex');