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
docs: serve board badges from tracked landing counts [N26,B3,V1]
Corey Olson10933e81d0b9
diff --git a/README.md b/README.mdindex 7ed67f8c..d64d1cf5 100644--- a/README.md+++ b/README.md@@ -10,8 +10,8 @@<p align="center"><a href="https://pullboard.dev"><b>pullboard.dev</b></a> · lives in your git repo · no dependencies · <b>Walk away, and it builds.</b></p><p align="center">- <a href="https://pullboard.dev"><img alt="pullboard: 893 items" src="https://img.shields.io/badge/pullboard-893%20items-2f7d5b?style=flat-square"></a>- <a href="#how-it-works"><img alt="agent-verified: 100%" src="https://img.shields.io/badge/agent--verified-100%25-6e7781?style=flat-square"></a>+ <a href="https://pullboard.dev"><img alt="pullboard: finished items" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpullboard-dev%2Fpullboard%2Fmain%2Fdocs%2Fbadges%2Fitems.json&style=flat-square"></a>+ <a href="#how-it-works"><img alt="agent-verified: independently checked" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpullboard-dev%2Fpullboard%2Fmain%2Fdocs%2Fbadges%2Fchecked.json&style=flat-square"></a><a href="https://www.npmjs.com/package/pullboard"><img alt="npm" src="https://img.shields.io/badge/npm-v0.9.2-121a17?style=flat-square"></a><a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/npm/l/pullboard?style=flat-square&color=6b4fc8"></a></p>diff --git a/docs/badges/checked.json b/docs/badges/checked.jsonnew file mode 100644index 00000000..a77c670e--- /dev/null+++ b/docs/badges/checked.json@@ -0,0 +1,6 @@+{+ "schemaVersion": 1,+ "label": "agent-verified",+ "message": "2%",+ "color": "6e7781"+}diff --git a/docs/badges/items.json b/docs/badges/items.jsonnew file mode 100644index 00000000..0761ed68--- /dev/null+++ b/docs/badges/items.json@@ -0,0 +1,6 @@+{+ "schemaVersion": 1,+ "label": "pullboard",+ "message": "1164 items",+ "color": "2f7d5b"+}diff --git a/docs/readme-badges.test.js b/docs/readme-badges.test.jsnew file mode 100644index 00000000..c2c33bf2--- /dev/null+++ b/docs/readme-badges.test.js@@ -0,0 +1,90 @@+/** @pullboard-test-input source-tree */+/** README board badges use tracked endpoints that a real landing refreshes [I10,B3,V1]. */+import assert from 'node:assert/strict';+import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';+import { join, resolve } from 'node:path';+import { after, test } from 'node:test';+import { badgeDocuments } from '../src/badge.js';+import { createE2eHelpers } from '../test/e2e-helpers.js';+import { runFixtureGit } from '../test/fixture-child.js';++const ROOT = resolve(import.meta.dirname, '..');+const e2e = createE2eHelpers();+after(e2e.cleanup);++test('README board-count badges read tracked main endpoint documents [I10,B3,V1]', () => {+ const readme = readFileSync(join(ROOT, 'README.md'), 'utf8');+ const badges = [...readme.matchAll(/<img\b[^>]*alt="(pullboard|agent-verified)(?:: [^"]*)?"[^>]*src="([^"]+)"/gu)];+ assert.deepEqual(badges.map(([, label]) => label).sort(), ['agent-verified', 'pullboard'],+ 'both distinct board-count badges remain present');+ for (const [, label, source] of badges) {+ const url = new URL(source.replaceAll('&', '&'));+ assert.equal(url.origin, 'https://img.shields.io');+ assert.equal(url.pathname, '/endpoint', `${label} reads live endpoint data`);+ const path = `docs/badges/${label === 'pullboard' ? 'items' : 'checked'}.json`;+ assert.equal(url.searchParams.get('url'), `https://raw.githubusercontent.com/pullboard-dev/pullboard/main/${path}`);+ assert.equal(url.searchParams.get('style'), 'flat-square');+ assert.equal(runFixtureGit(['ls-files', '--error-unmatch', '--', path], { cwd: ROOT }), path,+ 'the endpoint is tracked, so publishing main makes it reachable');+ const document = JSON.parse(readFileSync(join(ROOT, path), 'utf8'));+ assert.equal(document.schemaVersion, 1);+ assert.equal(document.label, label);+ assert.match(document.message, label === 'pullboard' ? /^\d+ items$/u : /^\d+%$/u);+ assert.equal(document.isError, undefined);+ }+});++test('landing rewrites stale tracked board badge counts inside the containing merge [B3,V1]', () => {+ const check = 'node --test --test-reporter=tap web/badge.test.cjs';+ const box = e2e.project(check);+ // These are fresh fixture CLIs; retain native admission while avoiding nested Node worker suppression.+ delete box.env.NODE_TEST_CONTEXT;+ assert.equal(box.run(box.web, 'join', 'web', '--model', 'Badge fixture', '--parent', 'readme-badge-builder').code, 0);+ assert.equal(box.run(box.repo, 'join', 'coordinator', '--model', 'Badge fixture', '--parent', 'readme-badge-reviewer').code, 0);+ const configPath = join(box.repo, 'pullboard.json');+ const config = JSON.parse(readFileSync(configPath, 'utf8'));+ writeFileSync(configPath, JSON.stringify({ ...config, landing: { publish: 'separate' } }, null, 2));+ mkdirSync(join(box.repo, 'docs/badges'), { recursive: true });+ const stale = badgeDocuments({ items: 99, percent: 0 });+ for (const document of stale) writeFileSync(join(box.repo, document.path), document.text);+ box.git(box.repo, 'add', 'pullboard.json', ...stale.map(document => document.path));+ box.git(box.repo, 'commit', '-q', '-m', 'test: seed stale tracked badge endpoints');+ box.git(box.web, 'merge', '-q', '--ff-only', 'main');+ const added = box.run(box.repo, 'add', 'web', 'Refresh tracked badges', '--criterion', 'The native probe passes.',+ '--check', check, '--json');+ assert.equal(added.code, 0, added.err || added.out);+ const id = JSON.parse(added.out).item.item_id;+ assert.equal(box.run(box.web, 'claim', String(id)).code, 0);+ const committed = e2e.commitFile(box, box.web, 'web/badge.test.cjs',+ "const { test } = require('node:test'); test('the badge probe passes [G1]', () => {});\n", 'test(web): badge probe [G1]');+ assert.equal(committed.status, 0, committed.stderr);+ const commit = box.git(box.web, 'rev-parse', 'HEAD');+ const submitted = box.run(box.web, 'submit', String(id));+ assert.equal(submitted.code, 0, submitted.err || submitted.out);+ const checkLog = box.git(box.web, 'rev-parse', '--git-path', 'pullboard-submit.log.check.log');+ const proof = readFileSync(resolve(box.web, checkLog), 'utf8');+ assert.match(proof, /ok 1 - the badge probe passes \[G1\]/u, 'submit executes the real probe body');+ assert.match(proof, /# tests 1\b/u);+ assert.match(proof, /# fail 0\b/u);+ box.git(box.repo, 'switch', '-q', '--detach', commit);+ try {+ const accepted = box.run(box.repo, 'verify', String(id), 'accept', '--as', 'coordinator', '--note', 'The real native probe passed.');+ assert.equal(accepted.code, 0, accepted.err || accepted.out);+ } finally { box.git(box.repo, 'switch', '-q', 'main'); }+ const before = box.git(box.repo, 'rev-parse', 'HEAD');+ for (const document of stale) assert.equal(box.git(box.repo, 'show', `HEAD:${document.path}`), document.text.trim());+ const result = box.run(box.repo, 'land', '--json');+ assert.equal(result.code, 0, result.err || result.out);+ const landed = JSON.parse(result.out);+ assert.deepEqual(landed.landed, [id]);+ const item = JSON.parse(box.run(box.repo, 'show', String(id), '--json').out);+ assert.equal(item.item_merged_commit, landed.batch.tip);+ assert.deepEqual(box.git(box.repo, 'rev-list', '--parents', '-n', '1', landed.batch.tip).split(' '),+ [landed.batch.tip, before, commit], 'the refresh preserves both real merge parents');+ for (const document of badgeDocuments({ items: 1, percent: 100 })) {+ assert.equal(box.git(box.repo, 'show', `${landed.batch.tip}:${document.path}`), document.text.trim(),+ 'the landed commit replaces the stale count with the actual independent board count');+ }+ assert.equal(box.git(box.repo, 'rev-parse', 'HEAD'), landed.batch.tip);+ assert.equal(box.git(box.repo, 'status', '--porcelain'), '', 'the refreshed endpoints are committed');+});