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(line): count legacy submissions without history [N2,H16]
Corey Olson27b8a91f53bd
diff --git a/src/line-capacity.js b/src/line-capacity.jsindex 58be301c..2c124466 100644--- a/src/line-capacity.js+++ b/src/line-capacity.js@@ -18,7 +18,7 @@ export function lineCapacitySnapshot(board, { windowMinutes = 60 } = {}) {const reviewers = board.db.prepare(`SELECT DISTINCT event_by FROM event JOIN agent ON agent_id=event_byWHERE event_kind IN ('reserve','accept','reject','verify') AND event_at>=? AND event_at<=?`).all(window.since, window.until);const pending = board.db.prepare(`SELECT item.*, MAX(event.event_id) AS submitted_order FROM item- JOIN event ON event.item_id=item.item_id AND event_kind='submit' WHERE item_status='submitted'+ LEFT JOIN event ON event.item_id=item.item_id AND event_kind='submit' WHERE item_status='submitted'GROUP BY item.item_id ORDER BY submitted_order, item.item_id`).all();const building = board.db.prepare("SELECT COUNT(*) AS count FROM item WHERE item_status='claimed' AND item_lease_until>?").get(window.until).count;return { ...window, activeReviewers: Math.max(reviewers.length, 1), pending, building, wip: pending.length + building };diff --git a/test/line-capacity.test.js b/test/line-capacity.test.jsindex 011cdd22..99616014 100644--- a/test/line-capacity.test.js+++ b/test/line-capacity.test.js@@ -112,3 +112,19 @@ test('the total cap covers builds and submitted work together without rounding aassert.throws(() => f.claim(fourth, f.reviewer), { code: 'LINE_WIP_LIMIT' });assert.equal(store.getItem(f.board, fourth).item_status, 'open');});++test('legacy submissions without recorded submit history still consume native WIP [N2,H16]', t => {+ const f = fixture(t), waiting = f.submit();+ const original = store.events(f.board, { itemId: waiting });+ const legacy = exportBoard(f.board);+ // Model a legacy imported snapshot, preserving the original private board and all its receipts.+ legacy.tables.event = legacy.tables.event.filter(row => !(row.item_id === waiting && row.event_kind === 'submit'));+ const replica = store.openBoard(join(f.root, 'legacy.sqlite'), f.board.clock);+ t.after(() => store.closeBoard(replica));+ importBoard(replica, legacy);+ const snapshot = lineCapacitySnapshot(replica);+ assert.equal(snapshot.wip, 1);+ assert.equal(snapshot.pending[0].item_id, waiting);+ assert.equal(snapshot.pending[0].submitted_order, null, 'missing history is unknown, never an invented submit time');+ assert.deepEqual(store.events(f.board, { itemId: waiting }), original);+});