Repository navigation
docs: one file per CAPABILITIES.md row; generated pages refresh after merge - #2518
Conversation
… merge CAPABILITIES.md is assembled from capabilities/<section>/<row>.md by scripts/build_capabilities.py; the split reproduces the current page byte for byte. Pull requests edit only sources. refresh-generated.yml opens a draft pull request that regenerates CAPABILITIES.md and llms-full.txt from main, and CI's --check-pr fails only a hand edit of either page. The migrate script moves an older branch's rows into row files.
… the page A pull request whose CI passed before --check-pr existed can still land a hand-added row. The refresh now stops when CAPABILITIES.md no longer matches capabilities/CAPABILITIES.md.sha256 (written with every regeneration), lists the lines no source produces, and opens an issue. Link check reads row links on the assembled page, where they print. --split keeps capabilities/README.md.
The refresh guard passes a page that already matches its sources, so a regeneration that skipped the stamp can't block the refresh. Editor and OS leftovers (.DS_Store, foo.md~) under capabilities/ are ignored. The refresh finds its own pull requests by author, not among the first 50 open ones.
|
From: Gemini Here is the review of the pull request, ranked by severity. The architecture cleanly solves the merge conflict problem, but there is a logic gap in the PR check that can permanently block the bot, and a local build crasher on macOS. 1. High: Accurate hand-edits pass CI but permanently block the refresh bot (Logic Error)File: Problem:
Fix: for path, text in generated().items():
current = path.read_text("utf-8") if path.exists() else ""
if current != text and _changed_since(base, path):
bad.append(_rel(path))
# Ensure STAMP was updated if CAPABILITIES.md was hand-edited successfully
if OUT not in bad and _changed_since(base, OUT):
if STAMP.read_text("utf-8") != _stamp(OUT.read_text("utf-8")):
bad.append(_rel(STAMP))2. Medium: Stray/Hidden files crash the local build (Developer Experience)File: Problem: Fix: # Line ~96
def sections(root: Path = SOURCES) -> list[Path]:
return _numbered((p for p in root.iterdir() if p.is_dir() and not p.name.startswith((".", "__"))), _SECTION_DIR)
# Line ~102
def rows(section: Path) -> list[str]:
"""Return a section's table rows, in order, each checked to be one row."""
files = (p for p in section.iterdir() if p.is_file() and p.name != SECTION and not p.name.startswith(".") and p.name.endswith(".md"))3. Low: Bot PRs may duplicate in high-traffic repositories (Scale)File: Problem: Fix: open_prs="$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --author "app/github-actions" --limit 100 \(Note: If you use the standard bot token, the author string is |
A row file put directly under capabilities/ would never print, so the build now fails on one instead of dropping it. Each refresh branch carries its run id, so a rerun on the same main commit never meets a leftover branch.
|
From: Gemini Here is a review of the pull request, focusing on correctness, data-loss paths, and workflow logic errors, ranked by severity. 1. High: Silent data loss if a row file is placed in the wrong directoryFile: def assemble(root: Path = SOURCES) -> str:
"""Return CAPABILITIES.md as the files under capabilities/ describe it."""
for p in root.iterdir():
if p.is_file() and p.name not in ("README.md", "CAPABILITIES.md.sha256") and _visible(p):
raise SystemExit(f"{_rel(p)}: row files must be inside a section directory, not here")
# ... rest of assemble()2. Moderate: Branch collision blocks the refresh workflowFile: git push -q -f origin "HEAD:refs/heads/$branch"3. Low: Row ordering bug in migration script edge-caseFile: Summary: The core architecture (especially how |
|
From: Claude Author declaration: Claude wrote the changes on this branch up to and including 61c9140. The two Gemini reviews above are the cross-vendor review for this head.
|
Independent adversarial review: APPROVEFrom: Gemini Independent cross-vendor adversarial review of Findings & fail-closed verification
Generality gate
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Delta versus Gemini APPROVE at P1 — The committed page and row files are out of sync; CI
|
Re-ran build_capabilities.py --split on main's page: 216 row files (was 201). The assembled page is byte-identical to origin/main.
|
From: Claude Author declaration: Claude wrote the merge of origin/main at 24034b5 into this branch at 81397a8. It's an ordinary merge with no force-push and no conflicts.
|
Independent adversarial review: APPROVEFrom: Claude A fresh Claude reviewer agent checked the head read-only. It had no part in authoring the change. Its scope was whether any capability row from main was lost, changed, duplicated or reordered.
Nit, not blocking: |
Independent adversarial review: APPROVEFrom: Grok Delta versus my leftover-lane REQUEST CHANGES at P1 from 7083733679 is fixedOn this tree I reproduced:
The earlier failure mode — a stamp that hashed a page Notes, not blocking
I will not merge, tag, publish, dispatch, or rerun. |
#2518 split the page into capabilities/ row files from main as of 17:13 EST. Six later first-parent commits updated the stamped page and were kept on merge, but not the row files, so the stamp test and refresh workflow went red (#2562). Fold those edits into the sources and regenerate the stamp. CAPABILITIES.md is unchanged. - #2471: VERIFIED-run prose; fault-test and openIMIS measured-results notes - #2477: grade file/PDF/email checks by artifact provenance - #2472: api_recheck row - #2397: GraphQL / probe_read_routes text on the transaction-lens row - #2363 / #2368: second-factor row, including terminal/Windows console Fixes #2562
Problem
Almost every pull request adds a row to a CAPABILITIES.md table (most at the end of "The core") and regenerates llms-full.txt, which quotes the whole page. So each merge to main makes the other open pull requests conflict. On 2026-11-22,
git merge-treeagainst main showed 9 of 10 conflicting pull requests conflict inllms-full.txt, and 3 of them inCAPABILITIES.md.Change
capabilities/<NN>-<section>/section.mdholds a section's prose and table header; each table row iscapabilities/<NN>-<section>/<NNNN>-<slug>.md, one line, exactly as it prints.scripts/build_capabilities.pyassembles CAPABILITIES.md (rows by number, then name; the command list frombuild_command_map.render()). The split reproduces the current page byte for byte..github/workflows/refresh-generated.ymlruns on pushes to main that change a source, daily, and on dispatch. It regenerates CAPABILITIES.md and llms-full.txt and opens a draft pull request frombot/refresh-generated-<sha>, closing the one it replaces. It never pushes to main. It is a draft because GitHub starts no workflows for a pull request the workflow token opens; marking it ready runs CI. The body lists every line the refresh removes from CAPABILITIES.md.capabilities/CAPABILITIES.md.sha256holds the hash of the page as the script last wrote it. When main's page no longer matches the hash or its sources (for example, an open pull request whose green CI predates--check-prlands a hand-added row), the refresh stops, prints the lines no source produces, and opens a "CAPABILITIES.md refresh blocked" issue. It doesn't drop them.build_capabilities.py --check-pr HEAD^1. It passes when a page is current or untouched by the change, and fails a hand edit, which the next refresh would drop. Nothing strict runs on main or nightly, so a pending refresh never turns main red.test_shipped_only_copyscanscapabilities/,test_quickstart_commandand the review-brief test use the generator's output, and the command-map test checks the assembled page. New:tests/test_build_capabilities.py.scripts/migrate_branch_to_split_files.pygains a step: during a merge of main, it moves the rows a branch added, edited or removed in CAPABILITIES.md into row files, and resets both pages to main's copy. Prose edits are listed for a person to move intosection.md.capabilities/README.md, the commands README and the CI README now say: add or update your row file in the same pull request, and don't touch the generated pages.Proof
This pull request leaves CAPABILITIES.md and llms-full.txt unchanged, so it conflicts with no open pull request on them. A dry run of the migration on #2512 (a stack that adds 5 rows) kept all 5 and every row main had, and passed
--check-pr. Link check now checks row links on the assembled page, where they print.What changed from the brief: the brief asked for a per-PR test that CAPABILITIES.md is byte-identical to the script output. A strict per-PR test would make every pull request regenerate the page, and the page would conflict exactly as before. So the per-PR check is tolerant: it fails only a hand edit. Byte identity holds for this pull request, and the refresh pull request enforces it with
--check.Not covered:
packages/flow/CHANGELOG.mdconflicted in 6 of the 10 sampled pull requests, and.gitleaksignorein 2. Both are hand-edited lists, so this change doesn't touch them. Changelog fragments would be the matching fix.Before merge
Rows that land on main after this branch's last sync have no row file. The guard stops the first refresh on them instead of dropping them. To avoid that, right before merging:
Commit the result. Never run
--splitafter the split has landed: it rebuilds the row files from the committed page, so it would delete rows that exist only as row files.Open pull requests that hand-edit CAPABILITIES.md fail
--check-pron their next CI run.python scripts/migrate_branch_to_split_files.py, run during their merge of main, moves their rows.The refresh workflow is not exercised end to end; its first run is on main after merge.