Skip to content

Trial a guidance-only code review package - #942

Merged
max-sixty merged 2 commits into
mainfrom
codex/code-review-guidance
Sep 22, 2026
Merged

max-sixty merged 2 commits into
mainfrom
codex/code-review-guidance

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

A review page could show current and proposed flows without making their difference easy to inspect. Trial an optional code-review package with brief authoring suggestions drawn from the PR walkthrough: review findings, focused evidence, and behavior comparisons.

The package supplies guidance only and composes with the existing evidence widgets. Authors can select their own review guidance instead. The skill routes code-review authors to it before widget selection, and the package catalog links directly to its guidance. Package checks allow optional themes and catalog entries that expose source rather than a visual demo. The catalog uses normal block flow inside each card so Leaf's generated external-link indicator sits beside “Read guidance” rather than becoming an extra grid row. Todo #20 retains the cold-author discovery experiment.

Validated package checking, guidance output alone and with diagram/diff/pr-review, and an unselected control with identical widget vocabulary. Six focused package/guidance tests, the catalog and built-site theme checks, and changed-file pre-commit checks pass; corpus regeneration produces no changes. The catalog was inspected in Chrome against the previous version and passes light/dark desktop/narrow render validation. Independent prose and composition review found no issues. Agent behavior improvement remains unmeasured.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding code-review to examples/layer.json turns the suite red: two corpus floors read that manifest as the list of packages that ship a vocabulary, and code-review is the first entry that ships neither a theme half nor a demonstrable page.

  • tests/test_product_page.py::test_package_catalog_routes_every_optional_package_to_a_focused_page asserts the package-card names in docs/extending.html equal the manifest minus gallery, in order. Run on this branch: At index 0 diff: 'diagram' != 'code-review'.
  • tests/test_site.py::test_product_pages_vendor_the_composed_theme builds one theme.css per manifest entry and asserts all(source.is_file()). skills/leaf/packages/code-review/ holds only guidance/author.md, so that assertion fails.

The manifest entry itself is right — test_example_layer_selects_existing_packages requires it to be every bundled package directory ("the manifest is what every corpus floor reads, so it has to be the whole directory"). So the manifest now means two things at once: every bundled package, and, to those two floors, every package with a theme and a catalog page. Those coincided until this PR; a guidance-only package is what separates them.

That is the level the fix belongs at. An empty theme.css beside the guidance and a card reusing pr-walkthrough would turn both green while leaving the assumption in place for the next package that doesn't ship widgets. Having the theme floor vendor the halves a package actually declares removes it. The catalog is a product decision rather than a mechanical one: either /extending/ covers guidance-only packages, which needs a page whose "controls, data, and reader task" the surrounding prose promises, or the floor keys on packages that ship a vocabulary and the catalog stays a widget catalog.

Everything else on the claimed path checks out: leaf package check passes on the guidance-only directory, checked_inputs and composed_guidance both admit a package with no registry.json, and incoming_registry over SHIPPED_PACKAGES is unaffected.

Happy to push the fix once you've picked which way the catalog goes.

How this was run

uv run pytest tests/test_product_page.py -p no:randomly -n0 — 2 failed (the catalog floor above, plus a record-demo case whose Chrome aborts on this runner: <process did exit: exitCode=null, signal=SIGABRT>, unrelated to the diff).

uv run pytest tests/test_site.py::test_product_pages_vendor_the_composed_theme -p no:randomly -n0 — 1 failed in 96s.

uv run pytest tests/test_interact_product.py::test_example_layer_selects_existing_packages tests/test_interact_document.py -p no:randomly -n0 — 167 passed.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The theme floor in tests/test_site.py now passes whether or not a bundled package's theme reaches the published page. Path.glob("theme.css") yields nothing for a package that has none, so the surviving assert all(source.is_file() for source in theme_halves) can no longer fail on a package entry, and the per-page theme.read_text() in ... loop below it never looks for that package's rules. On this branch, deleting skills/leaf/packages/diagram/theme.css and running the floor gives 1 passed — a bundled package whose widgets ship unstyled goes green.

The exemption belongs to what the package declares, which is exactly what separates the new package from the rest: code-review is the only bundled package with no registry.json, and registry and theme travel together across all ten others. Keying the entry on registry.json produces today's list unchanged, exempts the guidance-only package, and restores the contrast — I applied the suggestion below and confirmed the intact tree still passes while the same deleted diagram/theme.css fails at assert all(...). Happy to push it if you'd rather not take the suggestion.

Separately, the .package-card rewrite from display: grid; gap to display: block with margin-bottom on strong, span carries no stated purpose, and the new card does not need it — its three children are the same as every other card's. Under grid, align-content resolves to stretch, so a card shorter than its row neighbour spread the extra height across its rows and its Open page ↗ sat on the card's bottom edge, aligned across the row; under block the content hugs the top and the labels no longer line up. Chrome aborts on this runner so I could not render either version — if the comparison the description mentions covered this and you prefer the new spacing, that settles it.

Everything the previous review raised is otherwise resolved: the manifest entry is right, the catalog floor now admits a source link and still pins it to a file that exists in the tree, and the guidance-only package works end to end.

What was run

uv run pytest tests/test_product_page.py::test_package_catalog_routes_every_optional_package_to_inspectable_content tests/test_product_page.py::test_docs_pages_use_only_registered_widgets tests/test_site.py::test_product_pages_vendor_the_composed_theme tests/test_interact_product.py::test_example_layer_selects_existing_packages -p no:randomly -n0 — 4 passed. Both floors the previous review reported are green.

leaf page init --package code-review --package diagram --package diff then leaf page guidance <page> lists author, and leaf page guidance <page> author composes the package's text ahead of the others. The guidance-only selection is delivered.

Theme floor, three runs: base tree green; skills/leaf/packages/diagram/theme.css removed, still green (the finding); with the suggestion applied, green on the intact tree and assert False ... all(...) on the removed theme.

Declared halves per examples/layer.json entry — code-review has neither registry.json nor theme.css; diagram, diff, swipe, playground, targeting, command-hub, pr-review, monitoring, visual-review, and gallery have both.

Comment thread tests/test_site.py Resolved
@max-sixty

Copy link
Copy Markdown
Owner Author

Thanks @leaf-agent. Please reconsider these two points against the existing contract and rendered output, and review current head d0de359ac2b023e18c5c61dee2a85d5f113ef981 for approval if satisfied.

The package contract explicitly says “No individual file is required.” registry.json does not declare a requirement for theme.css; a widget may use inherited page typography, and a registry can also contain only data contracts. I verified a scratch package containing a real lf-review-note declaration (x-content: markup, x-upgrade: false, an example with a paragraph), with no stylesheet: both package check and page init --package ./.tmp/registry-only pass. Conditioning theme existence on registry existence would replace the original correlation with another invalid requirement.

The site test proves composition: every theme supplied by the source tree must appear in each published page. Removing a source theme changes that input; dropping a present theme from the built output still fails the substring assertion. Whether deleting a particular widget’s CSS damages its presentation belongs to the rendered widget checks, rather than making all registries require a stylesheet. Kernel/default/site themes remain required here. This follows your initial recommendation to check the halves packages actually supply.

I rendered both card layouts. The new anchor has an additional runtime-generated child, <svg class="lf-ui lf-external-mark" ...>, because its guidance URL is external. The old grid puts that indicator on a separate fourth row below “Read guidance”. Block flow keeps it inline with the action; the other card headings and descriptions remain top-aligned. I removed the authored arrow on this card so the generated indicator is the only one. Chrome light/dark desktop/narrow render validation passes, and I inspected matched 1200×900 screenshots. The PR description now records that purpose.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both points settled — withdrawing the theme-floor suggestion.

Keying the theme entry on registry.json would have encoded a requirement the package contract doesn't make: a registry carrying only data contracts, or widgets that inherit page typography, is a legitimate package with no stylesheet, and the floor would then fail on one. Your framing is the falsifiable one — the floor asserts that every theme the source tree supplies reaches every published page, and whether a particular widget ships styling belongs to the rendered checks. The glob states that directly, and the four fixed entries still hold all(source.is_file()) up.

On the card, renderExternalLinks in skills/leaf/assets/runtime/presentation.js appends the .lf-external-mark svg as a direct child of the anchor, so under display: grid it takes a fourth row of its own — this card has a reason the others don't, and your rendering decides the spacing that follows from it.

Re-ran the two floors plus test_example_layer_selects_existing_packages on d0de359 — 3 passed — and test and lint are green on that head.

@max-sixty
max-sixty merged commit f2ffa28 into main Sep 22, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/code-review-guidance branch September 22, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants