Skip to content

Test what the docs do, not their wording - #424

Merged
Deicyde merged 38 commits into
mainfrom
cleanup/test-behavior-not-wording
Oct 24, 2026
Merged

Deicyde merged 38 commits into
mainfrom
cleanup/test-behavior-not-wording

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

tests/test_skill_examples.py had 41 tests at de6de5f and about 590 literal-string checks on skill and doc sentences:

On 2026-10-20 Jack approved replacing them with general checks.

Change

  • New general checks:
    • every relative link and anchor in tracked Markdown resolves (one generated target is allowlisted);
    • every autoform ... invocation in the CLI reference and the skills parses with the real parser, with placeholders filled in. That covers more than 100 invocations, and all of them parse today;
    • schema ids the docs name exist in code, and so do codes the skills name. The read-back rubric's two ids are allowlisted, because their tooling is in Add read-back cards and the testimony validator #216 and Add statement-review commands #284;
    • frontmatter keys the skills teach are keys the graph loader accepts;
    • the REPL import allowlist is documented;
    • 11 safety sentences stay in their skills (outward-facing actions, consent, library text is data, trust caveats). This is the only wording still pinned.
  • The 27 tests that only checked that sentences exist are deleted. The wording and config-string pins in the 13 kept behavior tests are trimmed. Against current main, the file goes from 1,758 to 916 lines, and from 47 tests to 26.
  • develop-plugin's "preserve insight in a focused test" rule becomes: fix the product first, add a skill sentence only when behavior cannot carry the fix, and never pin a skill's wording in a test, except the short safety-rule list. The 220-word cap goes with its test.
  • The tests of the generated workflows' safety steps stay: Pages deploys only from main, and the verify workflow cleans only the root package, rejects kernel-check bypass options, audits every root-package declaration, checks elan's checksum and installs nothing from @main.
  • Two doc fixes:
    • AGENTS.md's init exit row. In fact init leaves an existing entry alone and exits 0. It exits nonzero for an input or target it cannot use safely, such as a case or Unicode variant of a path it manages (even with --force), a link, an unusable root .gitignore, a directory it cannot list or an invalid option.
    • The README's four publishing steps, which listed autoform dashboard as a fifth command that never returns.

Kept on purpose

Test

  • With the no-pytest runner, the module passes on this branch after the merge with main (36 passed: 26 tests, one of them with 11 safety cases). Before the deletions, with every old test present, it also passed (57).
  • ruff passes.
  • CI runs the full suite.

Overlap

This conflicts in tests/test_skill_examples.py with:

#90, #407, #397, #378 and the 0.6.0 release (#439) have merged, and this branch now merges main: the tests this PR deletes go along with their edits, and their new tests stay as main has them. Three checks were adjusted for the new docs. The code check now reads codes audit builds with an f-string (catalog-{problem}-limit). The frontmatter check skips a bare warning: prefix. The command check skips autoform 0.5.0 (...), which is --version output, and inline mentions of the generated workflow's name, autoform verify. The new schema check found that #397's changelog still named autoform-runtime/v3; the 0.6.0 release fixed that line.

No other open PR gains a conflict.

Add general checks to tests/test_skill_examples.py: every relative link
and anchor in tracked Markdown resolves; every `autoform ...` in the CLI
reference and the skills parses with the real argparse parser; schema
ids and codes the docs name exist in code; frontmatter keys the skills
teach are ones the graph loader accepts; the REPL import allowlist is
documented. A short parametrized list pins the safety rules, the only
wording kept, so the sentence pins can go next.
These 27 tests asserted that particular sentences exist in the skills,
the READMEs, and AGENTS.md, about 470 prose pins in all. They checked no
behavior, so every edit to a skill or README had to edit them too. The
few real checks they held (finding codes exist, links and anchors
resolve, the REPL import allowlist is documented) now live in the
general checks.
The behavior tests also pinned README and source-page phrases, the
roadmap reference's prose, mkdocs, theme, and workflow strings (down to
the elan checksum), and the launcher paragraph. The template equivalence
tests already compare the example's workflows and mkdocs.yml, and the
link check covers the example's pages. What stays: the graph, statuses,
declaration links, audit coverage, rendered site, SHA-pinned actions,
the launcher, and the REPL tag the docs name.
develop-plugin told agents to preserve each user nudge in a focused
test, which is what kept adding sentence pins to test_skill_examples.
Ask for a fix in the command's output, error, or default first, a skill
sentence only when behavior cannot carry it, and tests that check
behavior, links, and that documented commands parse.
init leaves an existing entry alone and exits 0 unless --force
overwrites it. It exits nonzero for an entry that differs from a path it
manages only in letter case or Unicode form, even with --force, and for
a write through a link, as the CLI reference says.
The block that introduces four steps listed five commands, and the
fifth, `autoform dashboard`, serves until it is stopped, so an agent
running the block as validation never returned. The dashboard is now
described after the block as the optional local preview it is.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 21, 2026
Deicyde added a commit that referenced this pull request Oct 21, 2026
Jack approved testing what the docs do rather than their wording (#424).
The record-output tests already cover the too-long case.
#90 edited tests/test_skill_examples.py. The tests this branch deletes
go with #90's edits to them, and its five new tests stay as main has
them: test_generated_site_docs_describe_one_multiscale_explorer,
test_the_example_uses_nothing_newer_than_its_autoform_pin,
test_agent_review_judges_a_catalog_as_an_inventory,
test_roadmap_repository_scope_inventories_existing_lean and
test_roadmap_and_formalize_leave_code_an_audit_warns_about_to_the_user.
From #90's change to the site-contract test's mkdocs.yml pins, the new
check that the explorer script is not loaded on every page stays.
#90's skill text names catalog-unbounded-limit and catalog-unscoped-limit,
which audit builds as f"catalog-{problem}-limit", so the code check now
matches an f-string code by its fixed parts. It also shows a bare
`warning:` prefix, which the frontmatter check now skips like `error:`.
Three of this branch's lines are wrapped to the 120-column limit.
#407 added test_roadmap_retracts_against_the_branch_formalize_works_from
beside a test this branch deletes. The deleted test goes, and #407's
new test stays as main has it.
#397's CHANGELOG lists autoform-runtime/v3 among the schema ids on main,
but main's runtime has been autoform-runtime/v4 since #90, which the
schema check found. The README now shows `autoform 0.5.0 (...)`, the
--version output, which the command check no longer reads as a command.
@Deicyde
Deicyde marked this pull request as ready for review October 21, 2026 22:53
@Deicyde
Deicyde marked this pull request as draft October 21, 2026 23:14
@Deicyde

Deicyde commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Review at 9c669f1: one finding blocks merge. One round, read-only; the planned conflicts with other open PRs are out of scope, as asked. The review ran at 4e7833d, and I re-checked each finding at 0df905f and 9c669f1, after the merges with main.

The rest holds. The 27 deleted tests only read files, match regexes or check that paths exist, and the new link, path, anchor and command-parse tests cover what they checked. The merges with main keep #90's edits to the two kept setup-asset tests and its 5 new tests. 45f4cfb changes only skills/develop-plugin/SKILL.md, so the freeze holds. aead840's init row matches scaffold.py, and 4e7833d is right that the generated blueprint-pages.yml already runs check, render and the mkdocs build. CI: all 8 checks pass at 9c669f1.

Blocks merge:

  1. 16f7a5a deletes the only tests of the generated workflows' safety steps. On main (0a8e3e5), test_setup_asset_static_site_contract asserts that the verify workflow keeps lake clean "$root_package", the "Reject kernel-check bypass options" step (forbidden="skip""KernelTC" and git grep -n -I "$forbidden" -- .) and the elan checksum, and that Pages deploys only from main (tests/test_skill_examples.py:990-1005). At this head no test checks any of them, and test_example_workflows_match_the_scaffold_templates only compares the example with the template, so removing a step from both stays green. These are product template contents, not doc wording. The bypass scan matters most: tests/test_lake_artifact_audit.py:1107-1108 notes that neither the axiom walk nor the safety scan catches a declaration the kernel never checked, and that the workflow's lexical check is not part of the probe. Keep these assertions, for example in tests/test_scaffold.py against autoform_cli/templates/github/workflows/.

Notes:

  1. The init row is still partial (AGENTS.md:75). Every ScaffoldError exits 2 (__main__.py:538-541), so init also exits 2 for a non-regular, hard-linked or oversized root .gitignore, a directory it cannot list, and a bad --autoform-ref or --autoform-source. It also exits 0 with a warning when it skips CI for lack of a pin. List them, or call the row a summary.
  2. The new develop-plugin rule contradicts a kept test. skills/develop-plugin/SKILL.md:13 says never add a test that pins a skill's wording, and test_safety_rules_stay_in_their_skill pins 11 skill sentences. A carve-out for the safety rules fixes it.
  3. Two new tests can pass vacuously. test_markdown_links_and_anchors_resolve and test_documented_schema_ids_exist_in_code assert only that nothing is broken or missing, so if the extraction stopped matching they would check nothing. test_documented_autoform_commands_parse guards against this with checked > 100, and the same kind of floor works here.
  4. Counts. The description's "40 tests" was 41 at de6de5f (40 without can you have more sessions coordinate? #421's), and 27 of the 36 merges that touched a SKILL.md also edited this file, not 26.

The trim of the site-contract test also dropped its only checks that the
generated workflows keep their safety steps: Pages deploys only from
main, the verify workflow cleans only the root package, rejects
kernel-check bypass options, audits every root-package declaration,
checks elan's download against its checksum, and installs nothing from a
moving @main ref. Those are product template contents, not wording, so
they come back. The example mirrors the templates, so they hold for
both.
The link and schema checks now also require that their extraction finds
something, as the command check already did, so a regex that stops
matching cannot pass them vacuously. develop-plugin's rule names the
safety-rule list as its one exception, and AGENTS.md's init row covers
every refusal init makes, as a summary.
@Deicyde

Deicyde commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Blocker 1 is fixed in a85cf5a: the site-contract test again asserts the generated workflows' safety steps (main-only Pages deploy, scoped lake clean, the kernel-check bypass scan, the root-package audit, elan's checksum, no @main), next to the SHA-pin loop it kept. 40a32c3 takes notes 2 to 4: the init row now summarizes every refusal, develop-plugin's rule names the safety list as its one exception, and the link and schema checks require their extraction to find something. The description's counts are corrected (note 5). The skill tests pass, 36 run directly.

#399 changed how the Pages workflow deploys only from main: on a
successful verify run of a main push, not on a push ref. The kept
safety assertions follow it, checking the workflow_run conclusion, head
branch and workflow path instead of github.ref.
#399's docs name the generated verify workflow, `autoform verify`, in
inline code, which the command check read as a command that does not
exist. Inline code that matches a workflow template's name is now
skipped.
@Deicyde

Deicyde commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Head check: the blocker is fixed; ready to merge once CI finishes (reviewed at f8028e4; review at 9c669f1).

  • a85cf5a restores the assertions on the generated workflows' safety steps: the scoped lake clean, the kernel-check bypass scan, the root-package audit, elan's version and checksum, and no @main. The merge with main moved the Pages check to Deploy Pages only from the commit autoform verify passed on main #399's github.event.workflow_run.head_branch == 'main', which matches the template.
  • 40a32c3 takes notes 2 to 4, and f8028e4 skips the generated workflow's name, autoform verify, in the command check.
  • test (3.10) and test (3.13) pass at this head.

Posted by Claude Code (348 worker session).

#378 edited three skill tests. The one this branch deletes goes with
its edit, and the two it keeps take main's versions. #378 also reworded
Roadmap's commit sentence, so the safety pin now holds only its rule:
only after the final validation, and pushing needs a user request.
CHANGELOG.md takes main's: the released 0.6.0 notes already name
autoform-runtime/v4, so this branch's one-line changelog fix is no
longer needed.
@Deicyde

Deicyde commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Changes since the last head check (40a32c3), all merges with main plus fixes they needed:

The skill tests (36) and test_release (7) pass, run directly. CI is running at 6cce5e3. I'm marking this ready for review.

@Deicyde
Deicyde marked this pull request as ready for review October 22, 2026 07:10
@Deicyde

Deicyde commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Head check: nothing blocks merge (reviewed at 6cce5e3; last head check at f8028e4).

The two commits since f8028e4 are merges with main. Their remerge diffs:

The command check's skip covers only the inline autoform verify, the generated workflow's name. CI passes every job at this head.

Notes (optional):

  1. The Roadmap pin lost the commit. It now holds only "only after this final validation; pushing is outward-facing and requires a user request." (L921-L922). Retire generated Mermaid: a Markdown dependency summary and locked-down authored diagrams #378 reworded the sentence, and "Commit the vault" fell out of the fragment, so the pin no longer ties the timing rule to the commit. A second fragment, "Commit the vault", would restore it.
  2. Merge order. Add statement-review commands #284, also ready, conflicts with this PR in tests/test_skill_examples.py. Its test_review_skills_route_statement_review_through_the_cli_reference pins links in a skill, which this PR's rule forbids. Integrate mathematical book reading and dependency exploration #442 merges cleanly but adds sentence pins to the same file, for example assert "one full-viewport reading/map workspace" in cli. Whichever lands after this PR will need to drop or convert them.
  3. A stale comment. The allowlist comments at L869 and L904 say open PRs Add read-back cards and the testimony validator #216 and Add statement-review commands #284 ship the read-back rubric's tooling. Add read-back cards and the testimony validator #216 merged without it, and Add statement-review commands #284 does not add it. This predates f8028e4.
  4. The body is out of date. The file now goes from 1,763 to 947 lines and from 47 to 26 tests. The Overlap section still lists Deploy Pages only from the commit autoform verify passed on main #399 and Have Roadmap re-check retraction on the branch Formalize works from #407, both merged.

Posted by Claude Code (session jackmccarthy-da).

project new's staging, descriptor and lock mechanics move to create.py's
docstring, replaced by its error codes and their remedies; Setup links to
the reference for init's pin inference. Drop follow-up and removed-feature
notes, say that documented invocations are parse-checked instead of
claiming skills restate no flags, and state the library-citation warning's
handling once in the reference, with Roadmap keeping its own rules.
The reference keeps the purpose, trust and sandbox rule, freshness
requirement, flags, refusals, exit behavior, and what each hash does and
does not mean. Helper naming, printing options, folding, report tables,
parallelism, the drift-hash boundary and comment-stripping limits move to
the module docstring.
Keep the offer, cost, yes, list, retry and outside-catalog rules; leave flag
interactions to the CLI reference.
AGENTS.md keeps a one-line pointer and the no-blanket-ban rule; drop the copy
in develop-plugin.
Formalize keeps that Batteries' unusedArguments linter checks no theorem
on Lean v4.30.0 and v4.31.0, since projects may pin toolchains back to
v4.27.0. Human Review says the scoped percentage counts fully proved
leaf targets, Roadmap says an old pin still rejects a cycle newer refs
allow, and a long Setup line is rewrapped.
#446 and #449 edited two tests this branch deletes, so their edits go
with them; no kept test changed.
#449 documents `--module-scope SCOPE`, whose choices are fixed, and the
check filled every placeholder with "1". A placeholder after an option
with choices now takes its first choice.
No conflicts. The doc checks pass on the merged text, including #449's
documented --module-scope.
@Deicyde

Deicyde commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Head check: nothing blocks merge (reviewed at 399140b; last head check at 6cce5e3). It is ready once the skeleton suite, the only check still running, passes.

The two commits since 6cce5e3:

Posted by Claude Code (session jackmccarthy-da).

#450 edited two tests this branch deletes, so their edits go with them;
no kept test changed, and the doc checks pass on #450's new text.
autoform_cli/README.md: the condensed project new paragraph keeps #450's
new sentence on the artifact cache settings project new writes.
The cut MathJax paragraph kept "packages the site leaves off" but dropped
both package lists, and its list of commands a macro may not take lost
\mmlToken and \mathtoolsset. Name the loaded packages and the on-demand
ones that stay off, as mathjax.py's PAGE_PACKAGES comment has them, and
the two commands, which are in NEUTRALISED.
The skeleton passage says only a failed probe's reason quotes Lean, keeps
ambiguous records among the probe failures and imports among what rotates
the hash. Search's folding is back among what may change, with the ℝ
example. The byte-order-mark warning keeps only the warning, and the H1
failure follows the list. Formalize keeps the library carve-out for a
refusal, Setup says entries without offered: true are never offered, and
the Batteries placeholder clause reads correctly.
Cut repeated and internal prose from the CLI reference and skills
- tests/test_skill_examples.py keeps this branch's general checks and
  #284's new review-skill test.
- autoform_cli/README.md takes main's MathJax paragraph, which carries
  #217's read-back card typesetting.
- CONTRIBUTING.md keeps the condensed CI text and adds the MathJax job's
  local switches.
#284 documents autoform-review-policy/v1, the line in
blueprint/.autoform-review. The generated verify workflow checks that
line by its sha256 rather than spelling it, so the schema check now
counts the id as present when its line's hash is in the workflow.
@Deicyde

Deicyde commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Head check: nothing blocks merge (reviewed at 7e1324e; last head check at 399140b).

The four commits since 399140b:

CI passes all 9 checks.

Notes:

  1. Show a Mathlib article's mathlib_declaration on its page #454's Mathlib rows. Show a Mathlib article's mathlib_declaration on its page #454 (on main at 7a52246) added the mathlib_declaration and mathlib_file rows to the README's assertions table, after this branch's last main merge, so the branch does not have them yet. The next merge with main must keep them. Follow up #454: Mathlib row wording, example and test pins #459 rewords them, and Cut the docs agents read, split the CLI reference, and give them line budgets #458 is stacked here.
  2. The MathJax sentence. CONTRIBUTING's sentence no longer names tests/test_site_mathjax_node.py or the tarball's sha256 check. The skip and fail-in-CI rules are intact.
  3. A stale comment. tests/test_skill_examples.py L876 still calls Add statement-review commands #284 an open PR. The exemption is still right: no shipped code produces those ids.

Posted by Claude Code (session jackmccarthy-da).

@Deicyde
Deicyde marked this pull request as ready for review October 24, 2026 01:52
@Deicyde
Deicyde merged commit 63ed6bd into main Oct 24, 2026
9 checks passed
@Deicyde
Deicyde deleted the cleanup/test-behavior-not-wording branch October 24, 2026 01:52
Deicyde added a commit that referenced this pull request Oct 24, 2026
- The README keeps #454's mathlib_declaration and mathlib_file rows with
  #459's wording, and this branch's proved/fully_proved paragraph, which
  now names the Assumes row of the statement box as #459 does.
- #453's generator sentence, in a section this branch moved, goes to
  reference/search.md: tested on 4.34.1 and 4.35.0, CI runs its real
  tests on 4.35.0.
- CHANGELOG keeps this branch's Docs and Claims entries and adds main's
  Render entry.
- The README budget rises by the two table rows, to 1131.
Deicyde added a commit that referenced this pull request Oct 24, 2026
One conflict, in CONTRIBUTING.md: #424 condensed the CI paragraph, and this branch's sentence on the WebKit job's MathJax tarball moves into its wording.
Deicyde added a commit that referenced this pull request Oct 24, 2026
The claim contract moved to autoform_cli/reference/claims-and-revisions.md,
so this PR's README corrections now go there, within its line budget: the
timeout bounds the listing's Git commands, not removing its own refs, and
`claim list` and `claim cleanup` are named as the listings that stop Git
with everything it started. The detail the reference has no room for, the
dashboard's process group and terminal and the case-collision naming, goes
into claims.py's module docstring, which #458 gave the old README text.
Deicyde added a commit that referenced this pull request Oct 24, 2026
PR #442's newest engine is the base: 7587206 (cyclic connections
through facing card boundaries) was already in this branch with
3632246, and this brings in 98d4a28 (main), 34705b5 (paginated
Results and responsive reader navigation), a9f14c5 (compact global
search relations, transient menus close) and 7a29a56 (cooperative
index validation). The engine changes in blueprint-dag.js,
blueprint-navigation.js and blueprint-dag.css merged without conflict:
the cold mount adds bp-dag-app-page before layout, a restored checkpoint
keeps its Results page instead of resetting the list, applyRoute closes
the filter menu, setFilters returns focus to the summary when it closes
over a focused control, the filter popover is anchored left in the
narrow toolbar, and normalizeIndex yields every 512 nodes and 1024
relations. The restyle's copy, card meta, status bar and aria-busy
marking sit on top unchanged.

skills/human-review/SKILL.md: #442's rewritten paragraph (fully proved
share as the derived status defines it, catalogs have their own metric,
never whole-source completion), with the restyle's landing-page label
`Fully proved` in place of `Scoped roadmap`, which the landing page no
longer prints.

tests/test_skill_examples.py: #442 (via main's #424) deleted the test
that pinned the human-review paragraph's wording; the deletion stands,
so the restyle's one-word update to it goes with it. The restyle's
site-contract assertions ("Uses N · Used by N" summary, the `Fully
proved` figure and "5 of 7 articles") merged cleanly and are kept.

tests/test_graph_view_rendering.py: #442 added an assertion on the
reader's relation row reading "Prerequisites"; the restyle names it
"Uses", which is what the merged script says, so the assertion pins
"Uses".

tests/test_dag_viewer_browser.py:
- Topic status: #442 now checks each ring segment's colour against the
  published palette and its proportion of the 80 counts, instead of one
  browser's RGB text. The restyle replaced the conic ring with a linear
  bar drawn by the core's ::after in legend order. The merged test keeps
  the restyle's 1px frame and linear-gradient checks and applies #442's
  palette and proportion check to the bar: entries are sorted into the
  legend's order, as statusRing sorts them, and segments are read in
  percent instead of degrees.
- Phone selection: #442's full-sheet reading test, with the restyle's
  one-argument _load_search_index (it waits for aria-busy to clear, not
  a count).
- Links filter: #442's locator for the actual fieldset plus a check that
  its legend reads "Links"; #442's assertions that the filter menu stays
  open after a checkpoint and closes on selection and history moves,
  with the restyle's summaries ("Filter: all statuses · linked only",
  "Filter: all statuses", "Filter: N-1 of N statuses · linked only").
  The unchecked status follows #442's fixture change (the target is
  not_ready, not planned) by reading the target's status.

Decisions. No redesign item is duplicated by these commits, so none is
dropped. #442's _open_dependency helper opens the dependency disclosure
by element, not by its summary text, so it works with the restyle's
"Uses N · Used by N" summary unchanged.

The bundle is rebuilt from the merged sources (76,447 bytes; npm run
check:explorer matches).

These pass here: test_graph_view_rendering, test_explorer_asset_bundle,
test_integrated_dag_layout, test_integrated_projections,
test_integrated_navigation, test_integrated_reader_declutter,
test_pr411_light_contrast, test_status and test_search_index_transport
(232 passed, 6 Linux-only skips); test_render passes in full (130 +
152); test_skill_examples, test_integrated_publication,
test_integrated_publication_security, test_integrated_reader_focus,
test_hierarchy_render_regressions and test_graph_views pass (84).
Browser tests were updated by reading and not run here. test_skeleton,
which merged without conflict and runs Lean, was not run because machine
load was above the heavy-job limit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant