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(core): preserve historical person-waiver receipts [B3,R3,H16]
Corey Olsonc0553cb80f5d
diff --git a/src/board.js b/src/board.jsindex 795f73fa..7295df1b 100644--- a/src/board.js+++ b/src/board.js@@ -2727,7 +2727,9 @@ export function recordLandingWaiver(board, { agentId, channel, id, test, until,throw new Refused('LAND_WAIVER', 'name a test, a future --until date and a nonempty --reason; run pullboard land --waive <test> --until <date> --reason "why"');}return atomic(board, () => {- const waiver = { id, test, kind: landingWaiverKind(test), until: new Date(until).toISOString(), reason: reason.trim(), by: PERSON, channel };+ // This ordered result and event retain their released shape on every replay engine.+ // File/name classification belongs to a derived read, never immutable waiver history.+ const waiver = { id, test, until: new Date(until).toISOString(), reason: reason.trim(), by: PERSON, channel };logEvent(board, PERSON, 'landing_waiver', null, { waiver });return waiver;});@@ -2740,10 +2742,11 @@ export function landingWaivers(board) {.map((row) => JSON.parse(row.event_detail).waiver);}-/** Find a live person's waiver covering the exact failing file or test name [B3,R3]. */+/** Find a live person's waiver and derive its match kind without rewriting history [B3,R3,H16]. */export function landingWaiverFor(board, failure) {- return landingWaivers(board).findLast((waiver) => Date.parse(waiver.until) > board.clock.now().getTime()- && landingWaiverCovers(waiver, failure)) ?? null;+ const waiver = landingWaivers(board).findLast((entry) => Date.parse(entry.until) > board.clock.now().getTime()+ && landingWaiverCovers(entry, failure));+ return waiver ? { ...waiver, kind: waiver.kind ?? landingWaiverKind(waiver.test) } : null;}/** File one durable defect per flaky test and retain its source digest [B3,R3]. */diff --git a/src/cli.js b/src/cli.jsindex 2020343e..94aa2eb9 100644--- a/src/cli.js+++ b/src/cli.js@@ -3251,7 +3251,7 @@ function workCommands(io, args) {const waiver = await ordered(ctx, board, 'recordLandingWaiver', [{ agentId: store.PERSON, channel: io.personChannel ?? 'terminal',id: randomUUID(), test: values.waive, until: values.until, reason: values.reason }]);io.result?.({ batch: null, landed: [], conflicts: [], blocked: [], culprits: [], flakes: [], waiver });- io.say(`waived ${waiver.kind} ${waiver.test} until ${waiver.until}: ${waiver.reason}`);+ io.say(`waived ${waiver.kind ?? store.landingWaiverKind(waiver.test)} ${waiver.test} until ${waiver.until}: ${waiver.reason}`);return 0;}if (values.until !== undefined || values.reason !== undefined || values.max !== undefined && (!/^[1-9][0-9]*$/u.test(values.max) || !Number.isSafeInteger(Number(values.max)))) throw new Refused('USAGE', 'use --max with a positive item count, or --waive with --until and --reason');diff --git a/src/landing-exceptions.js b/src/landing-exceptions.jsindex b57e8758..e52170d7 100644--- a/src/landing-exceptions.js+++ b/src/landing-exceptions.js@@ -7,7 +7,8 @@/*** Name what a waiver argument is: a test file path, or a test's name. A path is a directory and a* file with an extension (spaces and any language allowed), or one spaceless file name with an- * extension; anything else is a name. Earlier waivers carry no kind and are read the same way.+ * extension; anything else is a name. Waiver history retains the person's original argument;+ * classification is a derived read, so released ordered receipts stay unchanged.* Guessing wrong only narrows a waiver, since each kind matches one field of a failure.*/export function landingWaiverKind(test) {diff --git a/test/landing-waiver-replay.test.js b/test/landing-waiver-replay.test.jsnew file mode 100644index 00000000..b597aef3--- /dev/null+++ b/test/landing-waiver-replay.test.js@@ -0,0 +1,38 @@+/** Compare an actual released waiver receipt against two private current replicas [B3,R3,H16]. */+import assert from 'node:assert/strict';+import {mkdtempSync,mkdirSync,rmSync} from 'node:fs';+import {tmpdir} from 'node:os';+import {join} from 'node:path';+import {pathToFileURL} from 'node:url';+import {test} from 'node:test';+import * as store from '../src/board.js';+import {exportBoard,importBoard} from '../src/exchange.js';+import {applyEngineMove,engineReceipt} from '../src/engine.js';+import {unpackRelease} from './release-archive.js';+/** Ignore only the current writer marker, never historical semantic rows or ordered receipts. */+function withoutWriterMarker(doc){const x=structuredClone(doc);x.tables.board_meta=x.tables.board_meta.filter(r=>r.meta_key!=='relay_engine_version');return x;}+test('an actual engine12 person waiver keeps its exact receipt and history on both replicas [B3,R3,H16]',async t=>{+ const dir=mkdtempSync(join(tmpdir(),'pullboard-655-old-waiver-'));const archived=join(dir,'engine12');mkdirSync(archived);+ unpackRelease('59a6e2b286ee852add0d68a659f1a1e6b3257c44',archived);+ const oldStore=await import(pathToFileURL(join(archived,'src/board.js')));+ const oldEngine=await import(pathToFileURL(join(archived,'src/engine.js')));+ const oldExchange=await import(pathToFileURL(join(archived,'src/exchange.js')));+ const oldMachine=await import(pathToFileURL(join(archived,'src/machine.js')));assert.equal(oldMachine.ENGINE_VERSION,12);+ const old=oldStore.openBoard(join(dir,'old.sqlite'));const replicas=[store.openBoard(':memory:'),store.openBoard(':memory:')];+ t.after(()=>{for(const b of replicas)store.closeBoard(b);oldStore.closeBoard(old);rmSync(dir,{recursive:true,force:true});});+ oldStore.ensureCoordinator(old,'/fixture');const seed=oldExchange.exportBoard(old);for(const b of replicas)importBoard(b,seed);+ const move=oldEngine.prepareEngineMove(old,'recordLandingWaiver',[{agentId:'person',channel:'terminal',id:'legacy-waiver',test:'test/flaky.test.js',until:'2099-01-01T00:00:00.000Z',reason:'Synthetic private replay proof'}],{id:'old-person-waiver'});+ const order={sequence:1,at:'2026-10-17T20:00:00.000Z'};const original=oldEngine.applyEngineMove(old,move,order);assert.equal(original.error,undefined);+ const current=replicas.map(b=>applyEngineMove(b,move,order));assert.deepEqual(current[0],current[1],'current replicas agree');+ assert.deepEqual(exportBoard(replicas[0]),exportBoard(replicas[1]),'current ordered prefixes agree');+ assert.deepEqual(current[0],original,'the old move must retain its released receipt shape');+ for(const b of replicas){+ assert.deepEqual(engineReceipt(b,move.id),oldEngine.engineReceipt(old,move.id));+ assert.deepEqual(withoutWriterMarker(exportBoard(b)),withoutWriterMarker(oldExchange.exportBoard(old)));+ const before=exportBoard(b);+ assert.equal(store.landingWaiverFor(b,{file:'test/flaky.test.js',name:'unrelated behavior'}).kind,'file');+ assert.equal(store.landingWaiverFor(b,{file:'test/unrelated.test.js',name:'test/flaky.test.js'}),null,'a file waiver cannot cover a test merely named like its file');+ assert.deepEqual(exportBoard(b),before,'derived waiver classification never writes history');+ assert.deepEqual(applyEngineMove(b,move,order),original,'retrying the old move preserves its released receipt');+ }+});