Skip to content

Move validation's checks below their callers, leaving page check in validation - #7116

Merged
max-sixty merged 1 commit into
mainfrom
agent-a193be2185e44cfb9
Nov 25, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-a193be2185e44cfb9

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Splits src/leaf/validation so the checks lower modules call stand below them, and only page check stays with the page commands. This is one step of moving src/leaf's children into layer subpackages: 15 of the 95 import-linter allowances were imports reaching up into validation.

  • markup_checks/: markup.py and instances.py, the rules a document's markup meets, checked from the document and registry given. Event admission imports it downward now.
  • authored_checks/: admission.py, source.py, source_history.py and declarations.py (formerly composition.py), the checks of a page's saved source, an agent's messages and a layer's declarations. It stands just below every module that calls it.
  • validation/command.py stays in place and now stands above the render gate it runs.
  • unanswered_media moves into revision_artifact, which validation.md makes the owner of a /media/ file the page won't answer; text_media_errors into authored_checks.admission, beside checked_text, which runs it; incoming_registry into registry.validation.
  • In the order, anchor_capture moves below authored_checks, and revisioning above it, since activation runs the source check.

Allowances go from 95 to 77.

What to check: the two allowances that still name these modules, in .config/importlinter.ini. Both are new lines, and each replaces a crossing the other way on an existing cycle:

  • authored_checks.source -> sample_content: a sample's history and the message gate check each other recursively. sample_content admits fixture events, so it stays above event admission (formerly sample_content -> validation.admission and -> validation.markup).
  • render_gate.handover_pass -> validation.command: replaces the three validation.command -> render_gate.* allowances. Moving check_page into render_gate would remove it, after List the parts a thread can name in each visual in leaf page state #7109 lands.

#7109 will hit a one-line import-block conflict in tests/model/test_handover_pass.py; validation/command.py itself auto-merges.

Tests: 1,162 model tests covering validation, admission, revisioning, layers, delivery and the clerk, two process tests for page check and check_source, lint-imports, and pre-commit on the changed files all pass.

This was written by Claude Code on behalf of max-sixty

… validation

`src/leaf`'s children are moving into layer subpackages, each importing only
itself and the layers below it. `validation` sits with the page commands,
because `validation/command.py` runs `page check` and the render gate. But
its other modules are checks that lower modules call: event admission,
thread replies, revision activation, the capture, layer composition, the
clerk, the agent's state and sample histories. So 15 of the import-linter
allowances were imports reaching up into `validation`.

This splits the package by what each module needs:

- `markup_checks/` holds `markup.py` and `instances.py`: the rules a
  document's markup meets, checked from the document and registry given.
- `authored_checks/` holds `admission.py`, `source.py`, `source_history.py`
  and `declarations.py` (formerly `composition.py`): the checks of what an
  author hands in, which read the page directory and log around the markup
  rules.
- `validation/` keeps `command.py`, and now stands above the render gate it
  runs.

Three functions moved to the owners of what they check, which their callers
already stand above. `unanswered_media` joins `revision_artifact`, since
`validation.md` makes the capture the owner of a `/media/` file the page
won't answer. `text_media_errors` joins the message gate in
`authored_checks.admission`, beside `checked_text`, which runs it.
`incoming_registry` joins `registry.validation`, beside `validate_registry`.

In `.config/importlinter.ini`, `authored_checks` stands below every module
that calls it, such as `thread`, `clerk` and `vendoring`, and `markup_checks`
just above `gesture_words`.
Two modules move to where their imports put them: `anchor_capture` below
`authored_checks`, which imports it, and `revisioning` above it, since
activation runs the source check; that also frees `revisioning`'s
allowances into `page_view` and `revision_artifact`. The allowances go from
95 to 77. Two still name these modules, each on an import cycle, and each
replaces a crossing the other way:

- `authored_checks.source` -> `sample_content`: a sample's history is
  checked with the message gate, whose samples are checked the same way.
  `sample_content` admits fixture events, so it stays above event admission,
  and the source check that calls it stands below.
- `render_gate.handover_pass` -> `validation.command`: the server's render
  pass runs `check_page`, which hands its reading back to that pass. This
  replaces the three imports the other way.

No behaviour changes; every caller and test imports the new paths.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 261d2ad into main Nov 25, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a193be2185e44cfb9 branch November 25, 2026 05:17
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