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
test(readme): accept both approved layouts [C7,I1]
Corey Olson4de9175a8e05
diff --git a/test/ci.test.js b/test/ci.test.jsindex c39662cf..efa1d23b 100644--- a/test/ci.test.js+++ b/test/ci.test.js@@ -41,6 +41,13 @@ test('CI runs the gate on every push and pull request, Node 22.13 and 24, on Lintest("the README shows the workflow's status badge [C7]", () => {const readme = readFileSync(resolve(ROOT, 'README.md'), 'utf8');- const badge = '[](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml)';- assert.ok(readme.split('\n').slice(0, 4).includes(badge), 'the badge sits under the title');+ const section = readme.search(/^## /mu);+ assert.notEqual(section, -1, 'the README has a section after its header');+ const header = readme.slice(0, section);+ const workflow = 'https://github\\.com/pullboard-dev/pullboard/actions/workflows/gate\\.yml';+ const githubBadge = 'https://github\\.com/pullboard-dev/pullboard/actions/workflows/gate\\.yml/badge\\.svg';+ const shieldsBadge = 'https://img\\.shields\\.io/github/actions/workflow/status/pullboard-dev/pullboard/gate\\.yml';+ const markdown = new RegExp(`\\[!\\[[^\\]]*\\]\\((?:${githubBadge}|${shieldsBadge}(?:\\?[^)]*)?)\\)\\]\\(${workflow}\\)`, 'u');+ const html = new RegExp(`<a\\b(?=[^>]*\\bhref="${workflow}")[^>]*>\\s*<img\\b(?=[^>]*\\balt="gate")(?=[^>]*\\bsrc="(?:${githubBadge}|${shieldsBadge}(?:\\?[^\"]*)?)")[^>]*>\\s*<\\/a>`, 'u');+ assert.ok(markdown.test(header) || html.test(header), 'the header links a GitHub or shields status badge to the gate workflow');});diff --git a/test/e2e.test.js b/test/e2e.test.jsindex 3a52eee2..094df3e2 100644--- a/test/e2e.test.js+++ b/test/e2e.test.js@@ -197,7 +197,17 @@ test("init's spec has its sections and no rows, and the README's example fits unassert.deepEqual(parseSpec(spec).rows, [], 'no placeholder row, so no placeholder id is ever committed and made permanent');assert.deepEqual(parseSpec(spec).sections.map((section) => section.name), ['G · Goals: what the client asked for', 'K · Constraints']);const readme = readFileSync(join(import.meta.dirname, '..', 'README.md'), 'utf8');- const example = /```markdown\n([\s\S]*?)```/.exec(readme.slice(readme.indexOf('## Quick start')))?.[1] ?? '';+ const section = /^## (?:Quick start|By hand)\s*$/mu.exec(readme);+ const markdownExamples = [...readme.matchAll(/```markdown\n([\s\S]*?)```/gu)];+ /** Match the spec example rather than unrelated markdown examples.+ * @param {RegExpMatchArray} block+ * @returns {boolean}+ */+ const isGoalsExample = (block) => /^## G · Goals[^\n]*$/mu.test(block[1]);+ const exampleBlock = markdownExamples.find((block) => isGoalsExample(block) && (!section || block.index > section.index))+ ?? markdownExamples.find(isGoalsExample);+ assert.ok(exampleBlock, "the README has a markdown block with its G rows under Quick start, By hand, or on its own");+ const example = exampleBlock[1];const [heading, ...rows] = example.trim().split('\n');assert.ok(rows.length > 0 && spec.includes(`${heading}\n`), `the README's example heading is one init writes: ${heading}`);writeFileSync(join(repo, 'SPEC.md'), spec.replace(`${heading}\n`, `${heading}\n${rows.join('\n')}\n`));