Answer stability round 1: 0 🔴, 4 🟡 (0 misread); count chunks and projects as the archive holds them, date the 876 commits, fail the print when a font fails to load, build the image under run-heavy, and print from Python
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@
|
||||
!docs/*.md
|
||||
!presentation/
|
||||
!presentation/README.md
|
||||
!presentation/build-pdf.sh
|
||||
!presentation/build-pdf.py
|
||||
!presentation/index.html
|
||||
!presentation/render-pdf.js
|
||||
!principles/
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
## Rebuild the PDF
|
||||
|
||||
```sh
|
||||
presentation/build-pdf.sh
|
||||
presentation/build-pdf.py
|
||||
```
|
||||
|
||||
It writes `presentation/loop-claude-explained.pdf`, which stays out of git. It needs Docker and the `playwright-for-claude` image, which `~/code/playwright-for-agents/pw about:blank` builds once.
|
||||
It writes `presentation/loop-claude-explained.pdf`, which stays out of git. It needs Docker and the `playwright-for-claude` image. Build the image once with `~/.claude/bin/run-heavy docker build -t playwright-for-claude ~/code/playwright-for-agents`.
|
||||
|
||||
`index.html` is an artifact body: it has no doctype, head or body of its own. `build-pdf.sh` wraps it the way the artifact host does. To publish an edited page, publish `index.html` to the same artifact.
|
||||
`index.html` is an artifact body: it has no doctype, head or body of its own. `build-pdf.py` wraps it the way the artifact host does. To publish an edited page, publish `index.html` to the same artifact.
|
||||
|
||||
## Who it is for
|
||||
|
||||
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print index.html to loop-claude-explained.pdf beside it, in the playwright-for-claude image."""
|
||||
import pathlib, shutil, subprocess, sys, tempfile
|
||||
|
||||
HERE = pathlib.Path(__file__).resolve().parent
|
||||
IMAGE = "playwright-for-claude"
|
||||
# index.html is an artifact body, without a doctype, head or body of its own, so wrap it as the artifact host does.
|
||||
HEAD = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><style>:root{color-scheme:light}body{margin:0}img{max-width:100%}[hidden]{display:none!important}</style></head><body>\n'
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if subprocess.run(["docker", "image", "inspect", IMAGE], capture_output=True).returncode != 0:
|
||||
print(f"No {IMAGE} image. Build it once with: ~/.claude/bin/run-heavy docker build -t {IMAGE} ~/code/playwright-for-agents", file=sys.stderr)
|
||||
return 1
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
work = pathlib.Path(folder)
|
||||
(work / "page.html").write_text(HEAD + (HERE / "index.html").read_text(encoding="utf-8") + "</body></html>\n", encoding="utf-8")
|
||||
shutil.copy(HERE / "render-pdf.js", work)
|
||||
printed = subprocess.run(["docker", "run", "--rm", "--init", "--memory", "2g", "--memory-swap", "2g", "-v", f"{work}:/work", "-w", "/work", "--entrypoint", "node", IMAGE, "render-pdf.js"])
|
||||
if printed.returncode != 0:
|
||||
return printed.returncode
|
||||
shutil.copy(work / "out.pdf", HERE / "loop-claude-explained.pdf")
|
||||
print(f"Wrote {HERE / 'loop-claude-explained.pdf'}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Print index.html to loop-claude-explained.pdf beside it, in the playwright-for-claude image.
|
||||
# The image comes from ~/code/playwright-for-agents: its ./pw builds it on first use.
|
||||
set -eu
|
||||
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
work=$(mktemp -d)
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
|
||||
if ! docker image inspect playwright-for-claude >/dev/null 2>&1; then
|
||||
echo "No playwright-for-claude image. Build it once with: ~/code/playwright-for-agents/pw about:blank" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# index.html is an artifact body, without a doctype, head or body of its own, so wrap it as the artifact host does.
|
||||
{
|
||||
printf '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"><style>:root{color-scheme:light}body{margin:0}img{max-width:100%%}[hidden]{display:none!important}</style></head><body>\n'
|
||||
cat "$here/index.html"
|
||||
printf '</body></html>\n'
|
||||
} > "$work/page.html"
|
||||
cp "$here/render-pdf.js" "$work/"
|
||||
|
||||
docker run --rm --init --memory 2g --memory-swap 2g -v "$work:/work" -w /work --entrypoint node playwright-for-claude render-pdf.js
|
||||
cp "$work/out.pdf" "$here/loop-claude-explained.pdf"
|
||||
echo "Wrote $here/loop-claude-explained.pdf"
|
||||
@@ -231,9 +231,9 @@ dl.gloss dt { font-weight: 700; } dl.gloss dd { margin: 0; color: var(--muted);
|
||||
<div class="intro-foot">
|
||||
<p><b>For</b> developers and teams who build with AI agents and want a software factory: work that keeps flowing without someone watching it, at a quality they would sign off on.</p>
|
||||
<div class="tiles">
|
||||
<div><b>362</b><span>chunks finished since 2026-10-04, one PR each</span></div>
|
||||
<div><b>17</b><span>projects run by the loop</span></div>
|
||||
<div><b>2,526</b><span>commits in the setup's own repo</span></div>
|
||||
<div><b>466</b><span>chunks finished since 2026-10-03, one PR each</span></div>
|
||||
<div><b>12</b><span>projects that finished a chunk</span></div>
|
||||
<div><b>2,538</b><span>commits in the setup's own repo</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -991,7 +991,7 @@ dl.gloss dt { font-weight: 700; } dl.gloss dd { margin: 0; color: var(--muted);
|
||||
<div class="tablewrap"><table class="src-t"><colgroup><col style="width:4%"><col style="width:24%"><col style="width:72%"></colgroup><tbody>
|
||||
<tr id="src-14"><td>14</td><td><b>Narrow, separate reviewers</b></td><td><span class="kind x">Experience</span> Early on, a reviewer with too broad a responsibility found fewer issues.<br><span class="kind m">Own measurement</span> On 2026-11-09, merged reviewers were replayed on archived rounds. Stability, product owner and prose as one reviewer cost half as much, but found 15 of 34 prose findings again, against 22–23 for the prose reviewer. Architect and principles auditor as one found 5 of 17 principles findings, against 10, and lost both red ones. Even stability and product owner alone, as one, found 4–5 of 16 product-owner findings, against 7–10. In every merge, one absorbed pass lost findings, at a third to half the cost. Method and figures: <code>reviewer-merge-trials/</code> in the setup's repo. Merging reviewers that check the same kind of thing did hold up: one principles auditor found as much as several.</td></tr>
|
||||
<tr id="src-15"><td>15</td><td><b>At most two rounds per reviewer</b></td><td><span class="kind m">Own measurement</span> Since 2026-10-21, across all projects: round 1 ran 357 times and found 59 red findings. Round 2 ran about 200 times and found 12, mostly in round 1's fixes. Rounds 3 and later ran about 110 times and found none, for about $125. Asks for more rounds were 24 of 59 interrupts.</td></tr>
|
||||
<tr id="src-16"><td>16</td><td><b>Reviewers report only real problems</b></td><td><span class="kind r">Vendor docs</span> Anthropic's Claude Code best practices: "A reviewer prompted to find gaps will usually report some, even when the work is sound."<br><span class="kind m">Own measurement</span> 320 of this repo's 876 commits answered a review round. So stability and product owner report only defects, broken requirements or broken principles.</td></tr>
|
||||
<tr id="src-16"><td>16</td><td><b>Reviewers report only real problems</b></td><td><span class="kind r">Vendor docs</span> Anthropic's Claude Code best practices: "A reviewer prompted to find gaps will usually report some, even when the work is sound."<br><span class="kind m">Own measurement</span> 320 of the setup repo's first 876 commits, by 2026-10-13, answered a review round. So stability and product owner report only defects, broken requirements or broken principles.</td></tr>
|
||||
<tr id="src-17"><td>17</td><td><b>Architect and principles only in the release review</b></td><td><span class="kind m">Own measurement</span> The principles audit was the costliest reviewer after the worker, and filed findings unrelated to the chunk. Once a release, over the whole project, catches the same drift.</td></tr>
|
||||
<tr id="src-18"><td>18</td><td><b>Security: <code>/security-review</code>, not a hand-written reviewer</b></td><td><span class="kind x">Reasoning</span> Its tuned exclusion list and confidence floor would be reproduced worse by hand.<br><span class="kind m">Own measurement</span> Run beside the deep scan, it returned a near-identical report, so the deep scan replaces it when both would run.</td></tr>
|
||||
<tr id="src-19"><td>19</td><td><b>Mutation testing instead of coverage</b></td><td><span class="kind r">Research</span> Coverage barely predicts fault detection: Inozemtseva & Holmes, ICSE 2014. Surviving mutants do predict real faults: Just et al., FSE 2014. Google runs mutation testing in code review: Petrović et al., arXiv:2102.11378.</td></tr>
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
// Print /work/page.html to /work/out.pdf with Chromium, as build-pdf.sh runs it inside the playwright-for-claude image.
|
||||
// build-pdf.py runs this in the playwright-for-claude image: it prints /work/page.html to /work/out.pdf with Chromium.
|
||||
const { chromium } = require('/app/node_modules/playwright');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ args: ['--no-sandbox', '--disable-dev-shm-usage'] });
|
||||
const page = await browser.newPage({ viewport: { width: 1100, height: 1400 } });
|
||||
// A font that fails to load falls back to another, and the pages no longer fit their sheets, so any failed request fails the build.
|
||||
const failed = [];
|
||||
page.on('requestfailed', (request) => failed.push(request.url()));
|
||||
page.on('response', (response) => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); });
|
||||
// networkidle waits for the Google Fonts the page loads; fonts.ready waits for them to apply.
|
||||
await page.goto('file:///work/page.html', { waitUntil: 'networkidle' });
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
if (failed.length) {
|
||||
console.error(`Not printed, since these failed to load: ${failed.join(', ')}`);
|
||||
await browser.close();
|
||||
process.exit(1);
|
||||
}
|
||||
await page.emulateMedia({ media: 'print' });
|
||||
// preferCSSPageSize takes the page's own @page rule: A4 landscape.
|
||||
await page.pdf({ path: '/work/out.pdf', format: 'A4', printBackground: true, preferCSSPageSize: true });
|
||||
|
||||
Reference in New Issue
Block a user