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.

feat: permanent ids, wont rows, briefs and routes [S8,S9,B10,B11]

Corey Olson08e55d393634
diff --git a/skills/pullboard-decompose/SKILL.md b/skills/pullboard-decompose/SKILL.md
index a7ac1542..d5e50707 100644
--- a/skills/pullboard-decompose/SKILL.md
+++ b/skills/pullboard-decompose/SKILL.md
@@ -20,8 +20,8 @@ One requirement per line:
- G1.2 [draft, must] Same file twice is a no-op. | gate: idempotency test | serves: G1
```
-- **id:** a track letter and a number. Never reuse one, even after a row is retired.
-- **status:** `approved` only on the person's word. Your rows are `draft`. An open question is `pending`, with its text phrased as the question; a pending row has no gate.
+- **id:** a track letter and a number. Ids are permanent: once a row is committed, commits and items may cite it, so it is never deleted, renumbered or reused.
+- **status:** `approved` only on the person's word. Your rows are `draft`. An open question is `pending`, with its text phrased as the question; a pending row has no gate. `wont` is a row the person cut: it stays, with its id and text, and nothing builds it. `retired` is a row that no longer applies.
- **tier:** `must` or `aim`.
- **text:** one requirement, under 20 words.
- **gate:** the test or check that would prove it.
@@ -56,7 +56,7 @@ One requirement per line:
Every must-row must be testable without a guess. Name the exact word, format, number or comparison it means: not "overdue tasks are flagged" but "a task due before today's local date shows the word overdue". If the client did not say, write your assumption into the draft row; the person will flip it if it is wrong.
5. Show the person one track at a time. Ask the pending questions one at a time, the most consequential first, each with your recommended answer.
6. After each answer, update the row and keep its id: pending becomes approved with the answer as its text, or draft becomes approved. Run `pullboard spec check`.
-7. Never mark a row approved without the person saying so. Never delete a row; retire it.
+7. Never mark a row approved without the person saying so. Never delete or renumber a row, even to tidy the numbering. When the person cuts one, mark it `wont`; when one stops applying, mark it `retired`. The commit refuses a deleted row.
## Done
diff --git a/skills/pullboard-plan/SKILL.md b/skills/pullboard-plan/SKILL.md
index e7df56e7..dbc1f43b 100644
--- a/skills/pullboard-plan/SKILL.md
+++ b/skills/pullboard-plan/SKILL.md
@@ -7,22 +7,29 @@ description: Turn a project's approved spec rows into work items on the board, i
You turn approved rows into items builders can claim. You do not build.
-1. Read SPEC.md (approved rows only), PRACTICE.md and `pullboard lanes`. If the lanes do not fit the work, propose a change to `pullboard.json` to the person rather than forcing items into the wrong lane.
+1. Read SPEC.md (approved rows only; rows marked `wont` or `retired` are never built or cited), PRACTICE.md and `pullboard lanes`. If the lanes do not fit the work, propose a change to `pullboard.json` to the person rather than forcing items into the wrong lane.
2. **Contracts first.** Find what two lanes will share: a data shape, a module's functions, a file format. Make one item for each shared contract, in the lane that will own it, and add the items that use it with `--after <its id>`. A builder waiting on a contract claims something else; nobody copies another lane's code.
3. **One item per verifiable piece.** Each item:
- sits in the lane that owns its files
- cites the rows it serves with `--specs`
- has a `--criterion` a stranger could check without asking you, with the exact command, input and expected output
-4. **Order with `--after`.** An item that needs another's result waits for it. Keep the chains short; parallel lanes are the point.
-5. **Simplest version first.** Plan the smallest thing that meets the rows. Every addition needs a row that asks for it.
-6. **Real inputs early.** If the project has real inputs (files, an API, data), plan an early item that runs on them, so surprises surface before everything else is built.
-7. Rows gated by review (style, constraints) need no item of their own unless there is work to do; list them in your report.
+ - has a `--brief` (or `--brief-file`) when a builder starting cold would need more than the criterion: the files to touch, the contract to follow, the pattern to copy, the command that proves it. The criterion says what; the brief says how.
+4. **Route the mechanical work light.** When the brief says exactly what to change, where, and how to prove it, a lighter model can build it: `--route light`. Leave on the default strong route anything that needs judgment: a shared contract, a design choice, an edge the brief cannot settle. Agents that join with `--route light` take only light items; strong agents take strong items first.
+5. **Order with `--after`.** An item that needs another's result waits for it. Keep the chains short; parallel lanes are the point.
+6. **Simplest version first.** Plan the smallest thing that meets the rows. Every addition needs a row that asks for it.
+7. **Real inputs early.** If the project has real inputs (files, an API, data), plan an early item that runs on them, so surprises surface before everything else is built.
+8. Rows gated by review (style, constraints) need no item of their own unless there is work to do; list them in your report.
```
pullboard add store "Task file format and store module" --specs G7,D3 --criterion "store.add('x') returns 1 and writes the file in TODO_FILE"
pullboard add cli "todo add prints the new number" --specs G1 --after 1 --criterion "todo add 'buy milk' exits 0 and prints 1"
+pullboard add cli "todo help lists every command" --specs G9 --after 2 --route light \
+ --criterion "todo help exits 0 and names add, list, done and remove" \
+ --brief "Add a help case to the command switch in src/cli.js, next to add. Copy how add prints. Test it in test/cli.test.js the way the add test runs the CLI."
```
+To change a brief or a route later: `pullboard edit <id> --brief "..."` or `--route strong|light`. The criterion changes only by `pullboard refreeze`.
+
## Done
Every approved must-row is cited by an item, or named in your report with the reason it needs none. `pullboard list` shows the order through `after`.
diff --git a/skills/pullboard-spec-review/SKILL.md b/skills/pullboard-spec-review/SKILL.md
index 5f8de0b7..c7edafd9 100644
--- a/skills/pullboard-spec-review/SKILL.md
+++ b/skills/pullboard-spec-review/SKILL.md
@@ -15,6 +15,7 @@ Verification checks the work against the spec. This checks the spec, and what wa
## Look for
- Asks with no row, and rows nobody asked for.
+- Rows deleted or renumbered. Every id ever committed must still be there (`pullboard spec check` lists any that are gone); a cut row is marked `wont`, never removed.
- Rows met to the letter that miss what the client meant.
- A number the client cares about shown blank or zero because an input is missing. Demonstrate the mechanism with a labelled assumption instead.
- Test or demo data that borrows real names from the client's world.
diff --git a/src/board.js b/src/board.js
index 02242a15..90b36247 100644
--- a/src/board.js
+++ b/src/board.js
@@ -13,6 +13,13 @@ import { COORDINATOR } from './config.js';
import { Refused } from './refused.js';
export const ACCEPT_REASON = 'CRITERION_MET';
+
+/**
+ * Who can take an item (B11): `strong` needs a frontier model's judgment; `light` is work any model
+ * can build from its brief. An agent's route is set when it joins.
+ */
+export const ROUTES = ['strong', 'light'];
+const BRIEF_LIMIT = 8000;
export const REJECT_REASONS = [
'TEST_FAILURE',
'BEHAVIOR_MISMATCH',
@@ -32,6 +39,7 @@ const SCHEMA = `
agent_lane TEXT NOT NULL,
agent_path TEXT NOT NULL UNIQUE,
agent_last_shout_id INTEGER NOT NULL DEFAULT 0,
+ agent_route TEXT NOT NULL DEFAULT 'strong',
agent_created_at TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS item (
@@ -42,6 +50,8 @@ const SCHEMA = `
item_criterion TEXT NOT NULL DEFAULT '',
item_spec_ids TEXT NOT NULL DEFAULT '',
item_after TEXT NOT NULL DEFAULT '',
+ item_brief TEXT NOT NULL DEFAULT '',
+ item_route TEXT NOT NULL DEFAULT 'strong',
item_status TEXT NOT NULL DEFAULT 'open',
item_owner TEXT,
item_lease_until TEXT,
@@ -115,9 +125,15 @@ export function openBoard(file, clock = systemClock) {
* @param {DatabaseSync} db
*/
function migrate(db) {
- const columns = db.prepare('PRAGMA table_info(item)').all().map((column) => column.name);
- if (!columns.includes('item_after')) {
- db.exec("ALTER TABLE item ADD COLUMN item_after TEXT NOT NULL DEFAULT ''");
+ const added = [
+ ['item', 'item_after', "TEXT NOT NULL DEFAULT ''"],
+ ['item', 'item_brief', "TEXT NOT NULL DEFAULT ''"],
+ ['item', 'item_route', "TEXT NOT NULL DEFAULT 'strong'"],
+ ['agent', 'agent_route', "TEXT NOT NULL DEFAULT 'strong'"],
+ ];
+ for (const [table, column, type] of added) {
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all().map((entry) => entry.name);
+ if (!columns.includes(column)) db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${type}`);
}
}
@@ -240,20 +256,25 @@ export function agentAt(board, path) {
/**
* Register a worktree as an agent (B3): the main checkout as the one coordinator, any other
- * worktree as the next agent in its lane (`web-1`, `web-2`, ...). Registering again is a no-op.
+ * worktree as the next agent in its lane (`web-1`, `web-2`, ...), on a route: strong, or light for
+ * a model that takes only items routed light (B11). Registering again is a no-op.
*
* @param {any} board
- * @param {{ lane: string, path: string }} who
+ * @param {{ lane: string, path: string, route?: string }} who
* @returns {string} The agent's id.
*/
-export function register(board, { lane, path }) {
+export function register(board, { lane, path, route = 'strong' }) {
+ checkRoute(route);
+ if (lane === COORDINATOR && route !== 'strong') {
+ throw new Refused('BAD_ROUTE', 'the coordinator plans, merges and verifies; it is always strong');
+ }
return atomic(board, () => {
const existing = agentAt(board, path);
if (existing) {
- if (existing.agent_lane !== lane) {
+ if (existing.agent_lane !== lane || existing.agent_route !== route) {
throw new Refused(
'ALREADY_JOINED',
- `this worktree is ${existing.agent_id} in the ${existing.agent_lane} lane; use another worktree for ${lane}`,
+ `this worktree is ${existing.agent_id} in the ${existing.agent_lane} lane, routed ${existing.agent_route}; use another worktree for ${lane} routed ${route}`,
);
}
return existing.agent_id;
@@ -267,10 +288,10 @@ export function register(board, { lane, path }) {
const id = lane === COORDINATOR ? COORDINATOR : `${lane}-${total + 1}`;
board.db
.prepare(
- 'INSERT INTO agent (agent_id, agent_lane, agent_path, agent_created_at) VALUES (?, ?, ?, ?)',
+ 'INSERT INTO agent (agent_id, agent_lane, agent_path, agent_route, agent_created_at) VALUES (?, ?, ?, ?, ?)',
)
- .run(id, lane, path, now(board));
- logEvent(board, id, 'join', null, { lane });
+ .run(id, lane, path, route, now(board));
+ logEvent(board, id, 'join', null, route === 'strong' ? { lane } : { lane, route });
return id;
});
}
@@ -306,16 +327,57 @@ export function listAgents(board) {
}
/**
- * Add an item to a lane, optionally under a parent in the same lane. The caller has checked the
- * lane and the spec ids (B6).
+ * Refuse a route that is not one of ROUTES.
+ *
+ * @param {string} route
+ */
+function checkRoute(route) {
+ if (!ROUTES.includes(route)) {
+ throw new Refused('BAD_ROUTE', `route "${route}" is strong (needs a frontier model) or light (any model can build it from the brief)`);
+ }
+}
+
+/**
+ * Refuse a brief that cannot do its job (B10): too long to read cold, or missing on an item routed
+ * light, where the brief is all a light model has to go on.
+ *
+ * @param {string} brief
+ * @param {string} route
+ */
+function checkBrief(brief, route) {
+ if (brief.length > BRIEF_LIMIT) {
+ throw new Refused('BRIEF_TOO_LONG', `the brief is ${brief.length} characters; keep it under ${BRIEF_LIMIT} and point to longer docs by path`);
+ }
+ if (route === 'light' && !brief.trim()) {
+ throw new Refused('NO_BRIEF', 'an item routed light carries a brief: the files, the contract, the pattern to copy and the command that proves it (--brief or --brief-file)');
+ }
+}
+
+/**
+ * The route an agent joined on; strong for the coordinator and for ids the board does not know.
*
* @param {any} board
- * @param {{ by: string, lane: string, title: string, criterion?: string, specIds?: string[], parentId?: number | null, after?: number[] }} item
+ * @param {string} agentId
+ * @returns {string}
+ */
+function routeOf(board, agentId) {
+ return board.db.prepare('SELECT agent_route FROM agent WHERE agent_id = ?').get(agentId)?.agent_route ?? 'strong';
+}
+
+/**
+ * Add an item to a lane, optionally under a parent in the same lane, with a brief for whoever
+ * builds it and a route saying who can (B10, B11). The caller has checked the lane and the spec
+ * ids (B6).
+ *
+ * @param {any} board
+ * @param {{ by: string, lane: string, title: string, criterion?: string, specIds?: string[], parentId?: number | null, after?: number[], brief?: string, route?: string }} item
* @returns {number} The new item's id.
*/
-export function addItem(board, { by, lane, title, criterion = '', specIds = [], parentId = null, after = [] }) {
+export function addItem(board, { by, lane, title, criterion = '', specIds = [], parentId = null, after = [], brief = '', route = 'strong' }) {
const cleanTitle = title.trim();
if (!cleanTitle) throw new Refused('NO_TITLE', 'an item needs a title');
+ checkRoute(route);
+ checkBrief(brief.trim(), route);
return atomic(board, () => {
if (parentId !== null) {
const parent = itemById(board, parentId);
@@ -335,16 +397,52 @@ export function addItem(board, { by, lane, title, criterion = '', specIds = [],
const result = board.db
.prepare(
`INSERT INTO item (item_parent_id, item_lane, item_title, item_criterion, item_spec_ids,
- item_after, item_created_by, item_created_at, item_updated_at)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
+ item_after, item_brief, item_route, item_created_by, item_created_at, item_updated_at)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
)
- .run(parentId, lane, cleanTitle, criterion.trim(), specIds.join(','), after.join(','), by, at, at);
+ .run(parentId, lane, cleanTitle, criterion.trim(), specIds.join(','), after.join(','), brief.trim(), route, by, at, at);
const id = Number(result.lastInsertRowid);
- logEvent(board, by, 'add', id, { lane, specIds, after });
+ logEvent(board, by, 'add', id, { lane, specIds, after, route });
return id;
});
}
+/**
+ * Change an item's brief or route (B10, B11): how to build it and who can, never what it must do;
+ * the criterion moves only by refreeze. The coordinator or the agent that added it may edit, until
+ * it is verified or withdrawn; the route only while nobody holds it.
+ *
+ * @param {any} board
+ * @param {number} id
+ * @param {{ agentId: string, brief?: string, route?: string }} change
+ */
+export function editItem(board, id, { agentId, brief, route }) {
+ if (brief === undefined && route === undefined) {
+ throw new Refused('USAGE', 'say what changes: --brief "...", --brief-file <file> or --route strong|light');
+ }
+ atomic(board, () => {
+ const item = current(board, itemById(board, id));
+ if (agentId !== COORDINATOR && agentId !== item.item_created_by) {
+ throw new Refused('NOT_YOURS', `only the coordinator or ${item.item_created_by}, who added #${id}, edits it; shout them instead`);
+ }
+ if (['verified', 'withdrawn'].includes(item.item_status)) {
+ throw new Refused('CLOSED', `item #${id} is ${item.item_status}`);
+ }
+ const nextRoute = route ?? item.item_route;
+ const nextBrief = brief === undefined ? item.item_brief : brief.trim();
+ checkRoute(nextRoute);
+ if (nextRoute !== item.item_route && item.item_status !== 'open') {
+ throw new Refused('HELD', `item #${id} is ${item.item_status}; change its route only while it is open`);
+ }
+ checkBrief(nextBrief, nextRoute);
+ setItem(board, id, { item_brief: nextBrief, item_route: nextRoute });
+ logEvent(board, agentId, 'edit', id, {
+ ...(nextBrief !== item.item_brief ? { brief: `${nextBrief.length} characters` } : {}),
+ ...(nextRoute !== item.item_route ? { route: nextRoute } : {}),
+ });
+ });
+}
+
/**
* Claim an item, or renew your own claim (B4, B5, V2).
*
@@ -366,6 +464,9 @@ export function claim(board, id, { agentId, lane, leaseMs, freeze }) {
if (lane !== COORDINATOR && item.item_lane !== lane) {
throw new Refused('WRONG_LANE', `item #${id} is in the ${item.item_lane} lane; you are in ${lane}`);
}
+ if (item.item_route !== 'light' && routeOf(board, agentId) === 'light') {
+ throw new Refused('ROUTE', `item #${id} needs a strong model; you joined on the light route. Take the next light item: pullboard next`);
+ }
for (const dependency of item.item_after ? item.item_after.split(',').map(Number) : []) {
const before = itemById(board, dependency);
if (before.item_status !== 'verified') {
@@ -475,16 +576,20 @@ export function submit(board, id, { agentId, commit, tree }) {
* Who may verify an item, as a refusal when `agentId` may not (V1).
*
* The builder never may. Under `verify: "coordinator"`, lane work is the coordinator's to verify,
- * and the coordinator's own work is any other agent's.
+ * and the coordinator's own work is any other agent's. A light agent verifies light items only.
*
+ * @param {any} board
* @param {any} item
* @param {string} agentId
* @param {string} policy
*/
-function checkVerifier(item, agentId, policy) {
+function checkVerifier(board, item, agentId, policy) {
if (item.item_built_by === agentId) {
throw new Refused('SELF_VERIFY', 'the builder never verifies its own work; another agent must');
}
+ if (item.item_route !== 'light' && routeOf(board, agentId) === 'light') {
+ throw new Refused('ROUTE', `item #${item.item_id} needs a strong verifier; you joined on the light route`);
+ }
if (policy === COORDINATOR && item.item_lane !== COORDINATOR && agentId !== COORDINATOR) {
throw new Refused('COORDINATOR_VERIFIES', 'this repo has the coordinator verify lane work');
}
@@ -538,7 +643,7 @@ export function verify(board, id, { agentId, decision, reason, note = '', head,
if (item.item_status !== 'submitted') {
throw new Refused('NOT_SUBMITTED', `item #${id} is ${current(board, item).item_status}, not submitted`);
}
- checkVerifier(item, agentId, policy);
+ checkVerifier(board, item, agentId, policy);
if (digest !== item.item_frozen_digest) {
throw new Refused(
'CRITERIA_CHANGED',
@@ -763,22 +868,27 @@ export function events(board, { itemId } = {}) {
/**
* The next item an agent can take (N2): for a builder, the oldest open item in its lane whose
- * dependencies are verified; for a verifier, the oldest submitted item it did not build. When
- * nothing is free, the reasons say what everything is waiting on.
+ * dependencies are verified; for a verifier, the oldest submitted item it did not build. A light
+ * agent sees only items routed light; a strong one takes strong items first, leaving light work for
+ * light models while there is any (B11). When nothing is free, the reasons say what everything is
+ * waiting on.
*
* @param {any} board
* @param {{ agentId: string, lane: string, verify?: boolean }} who
* @returns {{ item: any | null, reasons: string[] }}
*/
export function nextFor(board, { agentId, lane, verify = false }) {
- const items = listItems(board).reverse();
+ const isLight = routeOf(board, agentId) === 'light';
+ const items = listItems(board).reverse().filter((entry) => !isLight || entry.item_route === 'light');
+ const routed = isLight ? 'light ' : '';
if (verify) {
const item = items.find((entry) => entry.item_status === 'submitted' && entry.item_built_by !== agentId) ?? null;
- return { item, reasons: item ? [] : ['nothing submitted that you did not build'] };
+ return { item, reasons: item ? [] : [`nothing ${routed}submitted that you did not build`] };
}
const held = items.find((entry) => entry.item_status === 'claimed' && entry.item_owner === agentId && entry.item_parent_id === null);
if (held) return { item: held, reasons: [] };
- const mine = items.filter((entry) => entry.item_status === 'open' && (lane === COORDINATOR || entry.item_lane === lane));
+ const open = items.filter((entry) => entry.item_status === 'open' && (lane === COORDINATOR || entry.item_lane === lane));
+ const mine = [...open.filter((entry) => entry.item_route !== 'light'), ...open.filter((entry) => entry.item_route === 'light')];
const reasons = [];
for (const entry of mine) {
const waiting = (entry.item_after ? entry.item_after.split(',').map(Number) : [])
@@ -787,7 +897,7 @@ export function nextFor(board, { agentId, lane, verify = false }) {
if (!waiting.length) return { item: entry, reasons: [] };
reasons.push(`#${entry.item_id} waits on ${waiting.map((before) => `#${before.item_id} (${before.item_status})`).join(', ')}`);
}
- if (!mine.length) reasons.push(`no open items in the ${lane} lane`);
+ if (!mine.length) reasons.push(`no open ${routed}items in the ${lane} lane`);
return { item: null, reasons };
}
diff --git a/src/cli.js b/src/cli.js
index b8757ff4..c47e8bf7 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -20,12 +20,14 @@ import {
import { initRepo } from './init.js';
import { isLane, laneNames } from './lanes.js';
import { Refused } from './refused.js';
+import { commitCitations, committedIds } from './history.js';
import { promptFor } from './skills.js';
import {
frozenCriterion,
idProblems,
lintSpec,
loadSpec,
+ permanenceProblems,
readSignoffs,
signOff,
standings,
@@ -41,14 +43,18 @@ Nothing ships until a second agent verifies it.
Set up
pullboard init config, SPEC.md, agent instructions, git hooks, board
- pullboard worktree <lane> make a worktree for a new agent in a lane, joined, and say what to run next
- pullboard join <lane> register the worktree you are in as an agent in a lane
+ pullboard worktree <lane> [--route light] make a worktree for a new agent in a lane, joined, and say what to run next
+ pullboard join <lane> [--route light] register the worktree you are in as an agent in a lane
+ --route light: a lighter model that takes only items routed light
pullboard whoami | lanes | status who you are, the lanes, the board at a glance
pullboard hooks reinstall the git hooks (e.g. after a fresh clone)
Work
pullboard add <lane> <title> [--criterion "..."] [--specs G1.2,K3] [--after 3,4] [--parent <id>]
+ [--brief "..." | --brief-file <file>] [--route light]
--after: claiming waits until those items are verified
+ --brief: what a cold agent needs; --route light: any model can build it
+ pullboard edit <id> [--brief "..." | --brief-file <file>] [--route strong|light]
pullboard list [lane] [--all] open and active items; --all adds verified and withdrawn
pullboard show <id> an item, the criterion frozen at claim, its verdicts
pullboard next [--wait <minutes>] claim the next item in your lane that is free to start
@@ -93,6 +99,9 @@ const OPTIONS = {
by: { type: 'string' },
out: { type: 'string' },
after: { type: 'string' },
+ brief: { type: 'string' },
+ 'brief-file': { type: 'string' },
+ route: { type: 'string' },
wait: { type: 'string' },
verify: { type: 'boolean' },
all: { type: 'boolean' },
@@ -123,6 +132,36 @@ function idArg(text, what = 'an item id') {
*/
const idList = (text) => (text ?? '').split(',').map((id) => id.trim()).filter(Boolean);
+/**
+ * The brief a command was given, from --brief or --brief-file, or undefined when neither.
+ *
+ * @param {any} io
+ * @param {any} values
+ * @returns {string | undefined}
+ */
+function briefArg(io, values) {
+ const path = values['brief-file'];
+ if (values.brief !== undefined && path !== undefined) {
+ throw new Refused('USAGE', 'give the brief once: --brief "..." or --brief-file <file>');
+ }
+ if (path === undefined) return values.brief;
+ const file = resolve(io.cwd, path);
+ if (!existsSync(file)) throw new Refused('NO_FILE', `no file ${path}`);
+ return readFileSync(file, 'utf8');
+}
+
+/**
+ * Print an item's brief, indented under a heading, when it has one.
+ *
+ * @param {any} io
+ * @param {string} brief
+ */
+function sayBrief(io, brief) {
+ if (!brief) return;
+ io.say('brief:');
+ brief.split('\n').forEach((line) => io.say(` ${line}`.trimEnd()));
+}
+
/**
* Everything a command needs: the repo, its config, the board's file, and where output goes.
*
@@ -166,7 +205,7 @@ function whoAmI(ctx, board) {
if (!agent) {
throw new Refused('NOT_JOINED', 'this worktree has not joined a lane: pullboard join <lane> (see: pullboard lanes)');
}
- return { id: agent.agent_id, lane: agent.agent_lane };
+ return { id: agent.agent_id, lane: agent.agent_lane, route: agent.agent_route };
}
/**
@@ -190,7 +229,8 @@ function itemLine(item) {
const parent = item.item_parent_id ? ` under #${item.item_parent_id}` : '';
const after = item.item_after ? ` after ${item.item_after.split(',').map((id) => `#${id}`).join(',')}` : '';
const rejected = item.item_status === 'open' && item.item_verdict === 'REJECT' ? ' (rejected)' : '';
- return `#${item.item_id} ${item.item_status}${holder}${verifier}${rejected} ${item.item_lane} ${item.item_title}${specs}${parent}${after}`;
+ const light = item.item_route === 'light' ? ' light' : '';
+ return `#${item.item_id} ${item.item_status}${holder}${verifier}${rejected} ${item.item_lane} ${item.item_title}${specs}${parent}${after}${light}`;
}
/**
@@ -200,7 +240,7 @@ function itemLine(item) {
* @param {{ first?: string }} args
* @returns {Record<string, () => number>}
*/
-function setupCommands(io, { first }) {
+function setupCommands(io, { first, values }) {
return {
init: () => {
const info = repoInfo(io.cwd);
@@ -224,11 +264,12 @@ function setupCommands(io, { first }) {
if (!first || first === COORDINATOR || !isLane(ctx.config, first)) {
throw new Refused('NO_LANE', `no lane "${first ?? ''}"; lanes: ${laneNames(ctx.config).slice(1).join(', ') || 'none yet, declare them in pullboard.json'}`);
}
- const id = withBoard(ctx, (board) => store.register(board, { lane: first, path: ctx.info.root }));
- io.say(`joined as ${id} in the ${first} lane`);
+ const route = values.route ?? 'strong';
+ const id = withBoard(ctx, (board) => store.register(board, { lane: first, path: ctx.info.root, route }));
+ io.say(`joined as ${id} in the ${first} lane${route === 'light' ? ', on the light route' : ''}`);
return 0;
},
- worktree: () => worktreeFor(io, first),
+ worktree: () => worktreeFor(io, first, values.route ?? 'strong'),
};
}
@@ -238,13 +279,17 @@ function setupCommands(io, { first }) {
*
* @param {any} io
* @param {string | undefined} lane
+ * @param {string} route
* @returns {number}
*/
-function worktreeFor(io, lane) {
+function worktreeFor(io, lane, route) {
const ctx = context(io);
if (!lane || lane === COORDINATOR || !isLane(ctx.config, lane)) {
throw new Refused('NO_LANE', `no lane "${lane ?? ''}"; lanes: ${laneNames(ctx.config).slice(1).join(', ') || 'none yet, declare them in pullboard.json'}`);
}
+ if (!store.ROUTES.includes(route)) {
+ throw new Refused('BAD_ROUTE', `route "${route}" is strong (needs a frontier model) or light (any model can build it from the brief)`);
+ }
const mainRoot = resolve(ctx.info.commonDir, '..');
const pathFor = (n) => join(dirname(mainRoot), `${basename(mainRoot)}-${lane}-${n}`);
const isTaken = (n) => existsSync(pathFor(n)) || tryGit(mainRoot, ['rev-parse', '--verify', '--quiet', `refs/heads/${lane}/${n}`]).status === 0;
@@ -252,8 +297,8 @@ function worktreeFor(io, lane) {
while (isTaken(n)) n += 1;
git(mainRoot, ['worktree', 'add', '-q', '-b', `${lane}/${n}`, pathFor(n), git(mainRoot, ['rev-parse', 'HEAD'])]);
const root = git(pathFor(n), ['rev-parse', '--show-toplevel']);
- const id = withBoard(ctx, (board) => store.register(board, { lane, path: root }));
- io.say(`made ${root} on branch ${lane}/${n}, joined as ${id} in the ${lane} lane`);
+ const id = withBoard(ctx, (board) => store.register(board, { lane, path: root, route }));
+ io.say(`made ${root} on branch ${lane}/${n}, joined as ${id} in the ${lane} lane${route === 'light' ? ', on the light route' : ''}`);
io.say('next, from that folder:');
io.say(` cd ${root}`);
if (existsSync(join(root, 'package.json'))) io.say(' npm install (its own install, so its tests run its own code)');
@@ -273,7 +318,7 @@ function readCommands(io, { first, values }) {
whoami: () => {
const ctx = context(io);
const me = withBoard(ctx, (board) => whoAmI(ctx, board));
- io.say(`${me.id} (${me.lane} lane) at ${ctx.info.root}`);
+ io.say(`${me.id} (${me.lane} lane${me.route === 'light' ? ', light route' : ''}) at ${ctx.info.root}`);
return 0;
},
lanes: () => {
@@ -308,6 +353,7 @@ function readCommands(io, { first, values }) {
}
io.say(itemLine(item));
if (item.item_criterion) io.say(`criterion: ${item.item_criterion}`);
+ sayBrief(io, item.item_brief);
if (item.item_frozen) {
const frozen = JSON.parse(item.item_frozen);
io.say(`frozen at claim (${item.item_frozen_digest.slice(0, 12)}):`);
@@ -501,6 +547,7 @@ async function nextHere(io, values) {
io.say(`${found.held ? 'you hold' : 'claimed'} #${item.item_id}: ${item.item_title}`);
if (item.item_criterion) io.say(`criterion: ${item.item_criterion}`);
for (const row of item.item_frozen ? JSON.parse(item.item_frozen).rows : []) io.say(` ${row.id}: ${row.text}`);
+ sayBrief(io, item.item_brief);
io.say(`when it is built and committed: pullboard submit ${item.item_id}`);
}
return 0;
@@ -536,10 +583,26 @@ function workCommands(io, args) {
const parentId = values.parent ? idArg(values.parent, 'a parent item id') : null;
const after = idList(values.after).map((text) => idArg(text, 'an item id after --after'));
const title = [second, ...rest].filter(Boolean).join(' ');
- const id = store.addItem(board, { by: me.id, lane: first, title, criterion: values.criterion ?? '', specIds, parentId, after });
+ const id = store.addItem(board, {
+ by: me.id,
+ lane: first,
+ title,
+ criterion: values.criterion ?? '',
+ specIds,
+ parentId,
+ after,
+ brief: briefArg(io, values) ?? '',
+ route: values.route ?? 'strong',
+ });
io.say(`#${id}`);
return 0;
}),
+ edit: () => act((ctx, board, me) => {
+ const id = idArg(first);
+ store.editItem(board, id, { agentId: me.id, brief: briefArg(io, values), route: values.route });
+ io.say(`edited #${id}`);
+ return 0;
+ }),
next: () => nextHere(io, values),
claim: () => act((ctx, board, me) => {
const result = store.claim(board, idArg(first), { agentId: me.id, lane: me.lane, leaseMs: ctx.config.leaseMs, freeze: freezer(ctx) });
@@ -579,6 +642,25 @@ function workCommands(io, args) {
};
}
+/**
+ * Every spec id something cites (S8): commit headers since the spec's first commit, and every item
+ * on the board, open or closed. Each must still be in the spec.
+ *
+ * @param {any} ctx
+ * @param {string | null} since
+ * @returns {Map<string, string>} Each id, with who cites it.
+ */
+function citations(ctx, since) {
+ const cited = since ? commitCitations(ctx.info.root, since) : new Map();
+ if (!existsSync(ctx.file)) return cited;
+ for (const item of withBoard(ctx, (board) => store.listItems(board, { all: true }))) {
+ for (const id of item.item_spec_ids ? item.item_spec_ids.split(',') : []) {
+ if (!cited.has(id)) cited.set(id, `item #${item.item_id}`);
+ }
+ }
+ return cited;
+}
+
/**
* The spec commands: check, show, unmet, signoff.
*
@@ -597,9 +679,13 @@ function specCommand(io, { first, second, rest, values }) {
for (const [name, parsed] of files) {
const findings = lintSpec(parsed);
findings.forEach((finding) => io.say(`${name}:${finding.line} ${finding.id ?? ''} ${finding.level}: ${finding.message}`.replace(' ', ' ')));
- const fileErrors = findings.filter((finding) => finding.level === 'error').length;
+ const history = committedIds(ctx.info.root, name);
+ const cited = name === ctx.config.spec ? citations(ctx, history.since) : new Map();
+ const lost = permanenceProblems(parsed, { committed: history.ids, cited });
+ lost.forEach((problem) => io.say(`${name}: ${problem.id} error: ${problem.message}`));
+ const fileErrors = findings.filter((finding) => finding.level === 'error').length + lost.length;
errors += fileErrors;
- io.say(`${name}: ${parsed.rows.length} rows, ${fileErrors} errors, ${findings.length - fileErrors} warnings`);
+ io.say(`${name}: ${parsed.rows.length} rows, ${fileErrors} errors, ${findings.length + lost.length - fileErrors} warnings`);
}
return errors ? 1 : 0;
}
diff --git a/src/history.js b/src/history.js
new file mode 100644
index 00000000..f08f3d64
--- /dev/null
+++ b/src/history.js
@@ -0,0 +1,84 @@
+/**
+ * What git history holds the spec to (S8). Ids are permanent: every id that was ever committed to
+ * the spec, and every id a commit cites, must still be there, so a commit or an item that cites a
+ * row keeps its meaning however the spec changes.
+ */
+import { spawnSync } from 'node:child_process';
+import { ID_RE, citedIds, parseSpec } from './spec.js';
+
+/**
+ * Run git for output that can be large, or null when it fails.
+ *
+ * @param {string} root
+ * @param {string[]} args
+ * @returns {string | null}
+ */
+function gitOut(root, args) {
+ const result = spawnSync('git', ['-c', 'core.quotepath=false', ...args], {
+ cwd: root,
+ encoding: 'utf8',
+ maxBuffer: 1024 * 1024 * 1024,
+ });
+ return result.status === 0 ? result.stdout : null;
+}
+
+/**
+ * Every committed version of a file reachable from HEAD, newest first: the commit, and the file's
+ * whole text after it. Renames are followed. One git process, however long the history.
+ *
+ * @param {string} root
+ * @param {string} path
+ * @returns {{ commit: string, text: string }[]}
+ */
+export function fileVersions(root, path) {
+ const out = gitOut(root, [
+ 'log', '--follow', '--format=%x00%H', '-p', '--unified=1000000',
+ '--no-color', '--no-ext-diff', '--no-textconv', 'HEAD', '--', path,
+ ]);
+ if (!out) return [];
+ return out.split('\0').filter((chunk) => chunk.trim()).map((chunk) => {
+ const [commit = '', ...lines] = chunk.split('\n');
+ const hunk = lines.findIndex((line) => line.startsWith('@@'));
+ const after = hunk === -1 ? [] : lines.slice(hunk + 1).filter((line) => line.startsWith(' ') || line.startsWith('+'));
+ return { commit: commit.trim(), text: after.map((line) => line.slice(1)).join('\n') };
+ });
+}
+
+/**
+ * Every id ever committed to a spec file, with the commit that first had it.
+ *
+ * @param {string} root
+ * @param {string} path
+ * @returns {{ ids: Map<string, string>, since: string | null }} `since` is the file's first commit.
+ */
+export function committedIds(root, path) {
+ const versions = fileVersions(root, path);
+ const ids = new Map();
+ for (const { commit, text } of versions) {
+ for (const row of parseSpec(text).rows) ids.set(row.id, commit);
+ }
+ return { ids, since: versions.at(-1)?.commit ?? null };
+}
+
+/**
+ * The spec ids cited in commit headers from `since` (the spec's first commit) to HEAD, each with
+ * the newest commit that cites it. Commits older than the spec cite nothing it could hold.
+ *
+ * @param {string} root
+ * @param {string} since
+ * @returns {Map<string, string>}
+ */
+export function commitCitations(root, since) {
+ const out = [
+ gitOut(root, ['log', '--format=%h%x09%s', `${since}..HEAD`]),
+ gitOut(root, ['log', '-1', '--format=%h%x09%s', since]),
+ ].join('\n');
+ const cited = new Map();
+ for (const line of out.split('\n')) {
+ const [short, ...subject] = line.split('\t');
+ for (const id of citedIds(subject.join('\t')).filter((entry) => ID_RE.test(entry))) {
+ if (!cited.has(id)) cited.set(id, `commit ${short}`);
+ }
+ }
+ return cited;
+}
diff --git a/src/hooks.js b/src/hooks.js
index cc61ed3b..73d82eb9 100644
--- a/src/hooks.js
+++ b/src/hooks.js
@@ -7,7 +7,7 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'n
import { join } from 'node:path';
import { git, tryGit } from './git.js';
import { outOfLane } from './lanes.js';
-import { citedIds, idProblems } from './spec.js';
+import { citedIds, deletedIds, idProblems } from './spec.js';
export const HOOKS = ['pre-commit', 'commit-msg', 'pre-push'];
export const HOOKS_DIR = '.githooks';
@@ -81,7 +81,7 @@ export function commitMsgProblems(raw, { rules, spec }) {
const ids = citedIds(header);
problems.push(
...idProblems(spec, ids).map(
- (problem) => `cite only rows that exist, separated by commas like [G1,G2] (${problem})`,
+ (problem) => `cite only rows that exist and are live, separated by commas like [G1,G2] (${problem})`,
),
);
if (type && rules.requireIds.includes(type) && !ids.length) {
@@ -203,6 +203,7 @@ export function preCommitProblems({ root, isMain, config, agent }) {
const diff = git(root, ['diff', '--cached', '--text', '--no-ext-diff', '--no-textconv', '--no-color', '-U0']);
problems.push(...secretsIn(addedLines(diff)).map((where) => `possible secret: ${where}`));
}
+ problems.push(...deletedRowProblems(root, [config.spec, config.practice]));
if (isMain) return problems;
if (!agent) {
problems.push('this worktree has not joined a lane: pullboard join <lane>');
@@ -215,6 +216,27 @@ export function preCommitProblems({ root, isMain, config, agent }) {
return problems;
}
+/**
+ * Rows the staged change deletes from the spec or the practice (S8). Nobody is exempt, the
+ * coordinator included: a commit or an item may cite any row, so a row that is cut stays, marked
+ * wont (won't build) or retired.
+ *
+ * @param {string} root
+ * @param {string[]} paths
+ * @returns {string[]}
+ */
+export function deletedRowProblems(root, paths) {
+ return paths.flatMap((path) => {
+ const before = tryGit(root, ['show', `HEAD:${path}`]);
+ if (before.status !== 0) return [];
+ const staged = tryGit(root, ['show', `:${path}`]);
+ if (staged.status !== 0) return [`${path} is deleted; ids are permanent: restore it`];
+ return deletedIds(before.stdout, staged.stdout).map(
+ (id) => `${path}: ${id} is gone; ids are permanent: keep the row and mark it wont (won't build) or retired`,
+ );
+ });
+}
+
/**
* Problems with a push (C3): uncommitted changes, or a ref that is not the checked-out commit, so
* the gate that runs next checks exactly what leaves this machine.
diff --git a/src/spec.js b/src/spec.js
index b143b8c9..0ae779b2 100644
--- a/src/spec.js
+++ b/src/spec.js
@@ -12,7 +12,7 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { Refused } from './refused.js';
-export const STATUSES = ['approved', 'draft', 'pending', 'fact', 'retired'];
+export const STATUSES = ['approved', 'draft', 'pending', 'fact', 'wont', 'retired'];
export const TIERS = ['must', 'aim'];
export const SIGNOFFS_FILE = '.pullboard/signoffs.jsonl';
@@ -183,7 +183,7 @@ export function lintSpec(spec, { maxWords = 20 } = {}) {
/**
* The spec ids an item or a commit cites, checked against the spec: every one must exist, and a
- * retired row cannot be built against.
+ * retired row or one marked wont (won't build) cannot be built against.
*
* @param {ReturnType<typeof parseSpec>} spec
* @param {string[]} ids
@@ -195,6 +195,7 @@ export function idProblems(spec, ids) {
const row = byId.get(id);
if (!row) return [`${id} is not in ${spec.name ?? 'the spec'}`];
if (row.status === 'retired') return [`${id} is retired`];
+ if (row.status === 'wont') return [`${id} is marked won't build; the person reopens it first`];
return [];
});
}
@@ -210,7 +211,7 @@ export function idProblems(spec, ids) {
export function frozenCriterion(spec, item) {
const ids = item.item_spec_ids ? item.item_spec_ids.split(',') : [];
const problems = idProblems(spec, ids);
- if (problems.length) throw new Refused('UNKNOWN_SPEC', `${problems.join('; ')}; fix the spec or the item`);
+ if (problems.length) throw new Refused('UNKNOWN_SPEC', `${problems.join('; ')}; fix the spec, or the coordinator withdraws the item`);
const rows = ids.map((id) => {
const row = spec.rows.find((entry) => entry.id === id);
return { id, text: row.text, gate: row.gate };
@@ -316,3 +317,41 @@ export function citedIds(header) {
if (!match) return [];
return match[1].split(',').map((id) => id.trim()).filter(Boolean);
}
+
+/**
+ * Ids that left the spec though something still points at them (S8). Ids are permanent: a row that
+ * is cut stays, marked wont (won't build) or retired, so every commit and item that cites it keeps
+ * its meaning.
+ *
+ * @param {ReturnType<typeof parseSpec>} spec
+ * @param {{ committed: Map<string, string>, cited: Map<string, string> }} references - each id ever
+ * committed to the spec with the commit that first had it, and each cited id with who cites it.
+ * @returns {{ id: string, message: string }[]}
+ */
+export function permanenceProblems(spec, { committed, cited }) {
+ const present = new Set(spec.rows.map((row) => row.id));
+ const problems = [...committed]
+ .filter(([id]) => !present.has(id))
+ .map(([id, commit]) => ({
+ id,
+ message: `was committed in ${commit.slice(0, 12)} and is gone; ids are permanent: restore the row and mark it wont or retired`,
+ }));
+ for (const [id, where] of cited) {
+ if (!present.has(id) && !committed.has(id)) {
+ problems.push({ id, message: `${where} cites it, but it was never committed to the spec; add it as a retired row saying what it meant` });
+ }
+ }
+ return problems;
+}
+
+/**
+ * Rows in `before` that `after` no longer has: what a change to a spec file deletes (S8).
+ *
+ * @param {string} before
+ * @param {string} after
+ * @returns {string[]} The deleted ids.
+ */
+export function deletedIds(before, after) {
+ const kept = new Set(parseSpec(after).rows.map((row) => row.id));
+ return parseSpec(before).rows.map((row) => row.id).filter((id) => !kept.has(id));
+}
diff --git a/src/templates.js b/src/templates.js
index 9a0a39fe..3d53cf73 100644
--- a/src/templates.js
+++ b/src/templates.js
@@ -37,7 +37,7 @@ export function specTemplate(project) {
Every requirement is a row with an id. Agents build against approved rows; commits cite the ids they serve. \`pullboard spec check\` lints this file.
-Statuses: approved = decided · draft = proposed · pending = open question · fact = true today · retired = spent, never reused. Tiers: must · aim.
+Statuses: approved = decided · draft = proposed · pending = open question · fact = true today · wont = won't build, decided and kept · retired = no longer applies, kept. Ids are permanent: never delete or renumber a row. Tiers: must · aim.
## G · Goals: what the client asked for
- G1 [draft, must] Replace with the first thing the client needs, in one line. | gate: the test that proves it
@@ -59,7 +59,7 @@ export function practiceTemplate() {
How this project is built: the house rules, as rows. SPEC.md says what to build; this file says how. Edit it for your project: keep, change or retire each row, and approve what you keep. A row whose gate names a check fails the build when broken; a row gated by review guides agents and reviewers.
-Statuses: approved = in force · draft = proposed · retired = dropped, id kept. Tiers: must · aim.
+Statuses: approved = in force · draft = proposed · wont = considered and declined, id kept · retired = dropped, id kept. Ids are permanent: never delete or renumber a row. Tiers: must · aim.
## W · Writing
- W1 [approved, must] Numbers over adjectives. No hedges, no filler. | gate: review
@@ -112,7 +112,7 @@ export function agentsBlock() {
This repo runs on pullboard: a work board, lanes and a spec that live in git. Nothing ships until a second agent verifies it.
-**Source of truth.** \`SPEC.md\` holds every requirement as a row with an id, like \`G1.2\`. Code follows the spec. Commits cite the ids they serve: \`feat(scope): subject [G1.2]\`. Only a person approves or changes an approved row.
+**Source of truth.** \`SPEC.md\` holds every requirement as a row with an id, like \`G1.2\`. Code follows the spec. Commits cite the ids they serve: \`feat(scope): subject [G1.2]\`. Only a person approves or changes an approved row. Ids are permanent: a row the person cuts stays, marked \`wont\` (won't build), so every commit that cites it keeps its meaning.
**House rules.** \`PRACTICE.md\` holds how this project is built, in the same row format. Its approved rows are in force; follow them as you would the spec.
@@ -122,11 +122,11 @@ This repo runs on pullboard: a work board, lanes and a spec that live in git. No
pullboard worktree <lane>
-It prints the folder to work in and what to run there first. Verifiers take the \`review\` lane, which owns no folders. Keep your worktree and branch until your items are merged.
+It prints the folder to work in and what to run there first. Verifiers take the \`review\` lane, which owns no folders. A lighter model joins with \`--route light\` and takes only items routed light, each with a brief. Keep your worktree and branch until your items are merged.
**The loop.**
1. \`pullboard inbox\`.
-2. \`pullboard next\` claims the next item in your lane that is free to start. When everything is waiting on other work, \`pullboard next --wait 30\` keeps looking for up to 30 minutes. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against.
+2. \`pullboard next\` claims the next item in your lane that is free to start. When everything is waiting on other work, \`pullboard next --wait 30\` keeps looking for up to 30 minutes. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against, and its brief says how to start.
3. Build inside your lane's folders (\`pullboard lanes\`). Pre-commit refuses anything else; shout the owner instead.
4. Commit, then \`pullboard submit <id>\`. It needs a clean tree and the gate green at HEAD.
5. A different agent verifies: \`pullboard next --verify\` names the next item to check. It checks out the submitted commit and runs \`pullboard verify <id> accept --note "how it proved it"\`, or \`pullboard verify <id> reject --reason TEST_FAILURE --note "what failed"\`.
@@ -138,7 +138,7 @@ If your item needs code another lane owns and it is not there yet, shout that la
**Talk.** \`pullboard shout <lane|agent|all> "<text>"\`. Read \`pullboard inbox\` before you start and after you submit.
-**Never.** Bypass a hook with \`--no-verify\`, or get past a refusal with filler text: fix what it names. Edit the board's database. Verify your own work. Change an approved spec row without the person's OK. Count a yes relayed by another agent as the person's approval.
+**Never.** Bypass a hook with \`--no-verify\`, or get past a refusal with filler text: fix what it names. Edit the board's database. Verify your own work. Change an approved spec row without the person's OK. Delete or renumber a spec row. Count a yes relayed by another agent as the person's approval.
${AGENTS_END}
`;
}
diff --git a/src/view.js b/src/view.js
index fa7ec40b..a7bba5ee 100644
--- a/src/view.js
+++ b/src/view.js
@@ -46,9 +46,10 @@ function signoffCell(row, by) {
function rowHtml(row, by, withSignoff) {
const tier = row.tier ? ` <span class="tier">${esc(row.tier)}</span>` : '';
const serves = row.serves.length ? esc(row.serves.join(', ')) : '';
- const search = esc(`${row.id} ${row.status} ${row.tier} ${row.text} ${row.gate}`.toLowerCase());
+ const label = row.status === 'wont' ? "won't build" : row.status;
+ const search = esc(`${row.id} ${row.status} ${label} ${row.tier} ${row.text} ${row.gate}`.toLowerCase());
const signoff = withSignoff ? `<td>${signoffCell(row, by).html}</td>` : '';
- return `<tr data-text="${search}"><td class="id">${esc(row.id)}</td><td><span class="st st-${esc(row.status)}">${esc(row.status)}</span>${tier}</td><td>${esc(row.text)}</td><td class="gate">${esc(row.gate)}</td><td class="id">${serves}</td>${signoff}</tr>`;
+ return `<tr data-text="${search}"><td class="id">${esc(row.id)}</td><td><span class="st st-${esc(row.status)}">${esc(label)}</span>${tier}</td><td>${esc(row.text)}</td><td class="gate">${esc(row.gate)}</td><td class="id">${serves}</td>${signoff}</tr>`;
}
/**
@@ -99,15 +100,16 @@ function summaryHtml(spec, by) {
[count('pending'), 'open questions'],
[`${tally('met')}/${musts.length}`, 'approved must-rows signed'],
[tally('stale'), 'sign-offs gone stale'],
+ ...(count('wont') ? [[count('wont'), "won't build"]] : []),
];
return `<div class="summary">${items.map(([value, label]) => `<div><b>${esc(value)}</b><span>${esc(label)}</span></div>`).join('')}</div>`;
}
const STYLE = `
:root { --bg: #f4f6f3; --card: #fff; --ink: #17211b; --muted: #5a665f; --rule: #d7ddd8;
- --approved: #1d7748; --draft: #5a665f; --pending: #8a5b0c; --fact: #2b55a3; --retired: #9aa39e; --stale: #a1453a; }
+ --approved: #1d7748; --draft: #5a665f; --pending: #8a5b0c; --fact: #2b55a3; --wont: #7d5f4b; --retired: #9aa39e; --stale: #a1453a; }
@media (prefers-color-scheme: dark) { :root { --bg: #101512; --card: #161d19; --ink: #e5ebe7; --muted: #9aa69f;
- --rule: #29322d; --approved: #57c48d; --draft: #9aa69f; --pending: #e0b25a; --fact: #86a9ee; --retired: #6f7a74; --stale: #e08a7e; color-scheme: dark; } }
+ --rule: #29322d; --approved: #57c48d; --draft: #9aa69f; --pending: #e0b25a; --fact: #86a9ee; --wont: #c49f86; --retired: #6f7a74; --stale: #e08a7e; color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
@@ -134,7 +136,7 @@ td.id { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowr
td.gate { color: var(--muted); }
.st { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 600; }
.st-approved { color: var(--approved); } .st-draft { color: var(--draft); } .st-pending { color: var(--pending); }
-.st-fact { color: var(--fact); } .st-retired { color: var(--retired); text-decoration: line-through; }
+.st-fact { color: var(--fact); } .st-wont { color: var(--wont); font-style: italic; } .st-retired { color: var(--retired); text-decoration: line-through; }
.tier { color: var(--muted); font-size: .78rem; }
.so { font-size: .82rem; white-space: nowrap; } .so-met { color: var(--approved); } .so-stale { color: var(--stale); } .so-open { color: var(--muted); }
.empty { color: var(--muted); }
diff --git a/test/hooks.test.js b/test/hooks.test.js
index e49a92b3..a9081c0a 100644
--- a/test/hooks.test.js
+++ b/test/hooks.test.js
@@ -34,7 +34,7 @@ test('header format, length, case and period [C1]', () => {
'start the subject with a lowercase letter (saw "Explain lanes.")',
'remove the period at the end of the subject',
]);
- assert.match(check('feat: x [G K P D]')[0], /cite only rows that exist, separated by commas like \[G1,G2\]/);
+ assert.match(check('feat: x [G K P D]')[0], /cite only rows that exist and are live, separated by commas like \[G1,G2\]/);
assert.deepEqual(check('docs: explain lanes\nsecond line'), ['leave a blank line after the header']);
});