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(spec): preserve proposal kind and draft idempotence [P6,B23]

Corey Olson7133522ff1c1
diff --git a/src/row-draft-store.js b/src/row-draft-store.js
index 0c064b8c..128f9b5b 100644
--- a/src/row-draft-store.js
+++ b/src/row-draft-store.js
@@ -12,7 +12,8 @@ export function recordRowDraft(board, { agentId, row, written = false }) {
// The same writer asking again for the same definition, as a resumed blueprint add does, keeps the id
// it reserved; a different gate, tier, section, target or writer is another proposal and gets its own id.
const same = current.find((draft) => draft.id === row.id && draft.by === agentId && draft.written === Boolean(written)
- && ['text', 'gate', 'tier', 'section', 'revises', 'file', 'source', 'replacement', 'status', 'reason'].every((key) => (draft[key] ?? '') === (row[key] ?? '')) && draft.target === (row.target ?? 'spec'));
+ && ['text', 'gate', 'tier', 'section'].every((key) => (draft[key] ?? '') === (row[key] ?? '')) && draft.target === (row.target ?? 'spec')
+ && (row.revises === undefined ? draft.revises === undefined : ['revises', 'file', 'source', 'replacement', 'status', 'reason'].every(key => draft[key] === row[key])));
if (same) return same;
const [, prefix, number] = /^(.*?)(\d+)$/u.exec(row.id);
let next = Number(number);
diff --git a/src/spec-revisions.js b/src/spec-revisions.js
index 9676c6c3..8ae74cc3 100644
--- a/src/spec-revisions.js
+++ b/src/spec-revisions.js
@@ -45,7 +45,7 @@ export function planSpecRevision(root, config, { revises, text, gate, status, re
if (replacement === source) throw new Refused('SPEC_REVISION', 'the proposed row is unchanged; give new text, gate or status');
const prefix = /^([A-Z][A-Z0-9]*?)\d+(?:\.\d+)*$/u.exec(revises)?.[1];
const plan = draftRow(root, config, { target: 'spec', text, gate: nextGate, tier: row.tier, section: prefix, taken, write: false });
- return { ...plan.row, revises, file: config.spec, source, replacement, status: wanted, reason: reason.trim() };
+ return { ...plan.row, target: 'spec', revises, file: config.spec, source, replacement, status: wanted, reason: reason.trim() };
}
/** The signed reference includes the immutable complete proposal, not mutable display labels. */