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): project approval commit dates [S1,B26,N26]

Corey Olson2e3198d3be04
diff --git a/src/needs.js b/src/needs.js
index 3823811a..5101dc1e 100644
--- a/src/needs.js
+++ b/src/needs.js
@@ -39,7 +39,7 @@ export function personNeeds(state) {
{ verb: 'spec-approve', args: { ids: revision.id } }, { verb: 'spec-decline', args: { ids: revision.id } }] })),
...(state.sentinelDrafts ?? []),
...(state.spec ?? []).filter(row => row.agentApproval && row.agentApproval.mode !== 'allow' && row.decision?.decision !== 'decline').map(row => ({ kind: 'agent-approved', id: row.id,
- ref: row.id, agent: row.agentApproval.agent, commit: row.agentApproval.commit, attribution: row.agentApproval.attribution,
+ ref: row.id, agent: row.agentApproval.agent, commit: row.agentApproval.commit, approvedAt: row.agentApproval.approvedAt ?? null, attribution: row.agentApproval.attribution,
text: `${row.id} is agent-approved; ${row.agentApproval.attribution}: ${row.agentApproval.agent}; commit ${row.agentApproval.commit ?? 'not committed'}`,
what: 'confirm or decline this row', target: `spec:${row.id}`,
actions: [{ verb: 'spec-approve', args: { ids: row.id } }, { verb: 'spec-decline', args: { ids: row.id } }] })),
diff --git a/src/spec-approval.js b/src/spec-approval.js
index 9c6eaa59..6ac229ef 100644
--- a/src/spec-approval.js
+++ b/src/spec-approval.js
@@ -37,11 +37,16 @@ function rowOrigins(root, file) {
let line;
let commit;
let author = '';
+ let approvedAt = null;
for (const text of (result.status === 0 ? result.stdout : '').split('\n')) {
const header = /^([0-9a-f]{40,64}) \d+ (\d+)(?: \d+)?$/u.exec(text);
- if (header) { commit = /^0+$/u.test(header[1]) ? null : header[1]; line = Number(header[2]); author = ''; }
+ if (header) { commit = /^0+$/u.test(header[1]) ? null : header[1]; line = Number(header[2]); author = ''; approvedAt = null; }
else if (text.startsWith('author ')) author = text.slice(7);
- else if (text.startsWith('\t') && line) origins.set(line, { commit, agent: author || 'unknown', attribution: 'Git author, seat unknown' });
+ else if (text.startsWith('committer-time ') && commit) {
+ const date = new Date(Number(text.slice(15)) * 1000);
+ approvedAt = Number.isFinite(date.getTime()) ? date.toISOString() : null;
+ }
+ else if (text.startsWith('\t') && line) origins.set(line, { commit, approvedAt, agent: author || 'unknown', attribution: 'Git author, seat unknown' });
}
// Only origins are reused: live board decisions and signature trust are checked on every projection.
if (key !== null && result.status === 0 && before === signature()) {
@@ -116,7 +121,7 @@ export function specApprovalState(root, { board, config, spec = loadSpec(root, c
});
const origins = unconfirmed.length ? rowOrigins(root, config.spec) : new Map();
return { mode, baselinePending: false, baselineInvalid, evidenceErrors, rows: unconfirmed.map(row => ({ id: row.id, text: row.text, gate: row.gate,
- status: 'agent-approved', ...(origins.get(row.line) ?? { commit: null, agent: 'unknown', attribution: 'Git author, seat unknown' }) })) };
+ status: 'agent-approved', ...(origins.get(row.line) ?? { commit: null, approvedAt: null, agent: 'unknown', attribution: 'Git author, seat unknown' }) })) };
}
/** Current unconfirmed citations for a raw board item or an API item projection. */