Skip to content

Move the handover pass below the page server, with its check passed in - #7149

Merged
max-sixty merged 1 commit into
mainfrom
handover-pass-below-hosting
Nov 25, 2026
Merged

max-sixty merged 1 commit into
mainfrom
handover-pass-below-hosting

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

This PR moves the handover pass, which reads each version a page's claimant hands over and tells the agent what the render check newly found, from render_gate/handover_pass.py to leaf/handover_pass.py. In import-linter's order the module now sits directly below hosting. That ends two of src/leaf's allowed backward imports, so the count goes from 50 to 48. hosting imports the pass to start a page's server, and the pass's child reading imported validation.command for check_page. The pass imports nothing from render_gate, so nothing held it in that package.

The reading now takes the check it runs as an argument. leaf page _read in cli passes check_page in, and the tests hand their stand-in checks to read_and_tell directly instead of monkeypatching validation.command. Since validation no longer sits in a cycle with the pass, it now imports remember_reading at the top of the module.

One reference to the old path is left: the render-reading record's schema description in render_reading.py. Changing it would change that record's line in build/browser/protocol-baseline.json, and #7114, another session's open PR, changes the same line. I'll update it once #7114 lands.

Checks: pre-commit passes, import-linter included. tests/model/test_handover_pass.py, tests/model/test_render_gate.py and tests/process/test_interact_server.py pass (179 tests). git merge-tree against #7114's head reports no conflicts.

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

The handover pass watches what a page's claimant hands over and tells
the agent what its render check newly found. It sat in render_gate,
which stands above hosting in import-linter's order, though it imports
nothing from render_gate. That took two allowances: hosting, which
starts a page's server, importing the pass, and the pass's child reading
importing validation.command for check_page.

The pass is now leaf/handover_pass.py, directly below hosting. The
reading takes the check it runs as an argument: `leaf page _read` in
cli passes check_page in, and the tests pass their stand-in checks
directly rather than monkeypatching validation.command. validation
imports remember_reading at the top, since the import no longer closes
a cycle. Allowances: 50 to 48.
@max-sixty
max-sixty merged commit 379a3db into main Nov 25, 2026
6 checks passed
@max-sixty
max-sixty deleted the handover-pass-below-hosting branch November 25, 2026 09:37
max-sixty added a commit that referenced this pull request Nov 26, 2026
…ing thread's backward import (#7233)

Ends the backward import `agents.thread -> pages.render_gate.command`.
The thread writes imported the render gate's `message_check`, which runs
a message's widgets in a browser as a page of their own and refuses the
message where one doesn't draw; it needs `pages.hosting` and the page
snapshot, so it can't sit below `agents`.

Now the writes take the check from whoever calls them, as #7149 passed
the handover pass the check it runs and as `cmd_comment` already takes
`drawn` from the command. `cmd_comment`, `post_reply`, `post_response`
and `cmd_edit` each take `check: MessageCheck | None = None` and call it
where the import was, on the same normalized markup and before the page
lease. The command layer supplies it: the CLI's `thread create`, `reply`
and `edit`; `leaf codex run`, through `TaskConnection` and each
`TurnFold` to the App Server reply stream's opening and answer; and the
website's hosted Codex turn. A caller that passes none runs no browser
check, as on a host with no browser, where the message posts unrun and
reports a failure when its thread draws.

To weigh:
- **Default none, not required.** Every production caller that ran the
check still does; requiring it would put `check=None` on about 230 test
call sites and break base-arm evals whose `post_response` lacks the
keyword. The cost is that a future production caller that forgets it
gets the no-browser behaviour.
- **The line fork's working line passes none.** Its outcome can't
change: an ephemeral line holding any `lf-` element is refused
(`ephemeral-content`), and the check runs a browser only where markup
places a widget. Only the refusal's wording in the page's diagnostics
differs, for a line whose widget also failed to draw.

This is the last of the cuts the maintainer asked for to end
`src/leaf`'s backward imports. With #7223 landed, the layers contract
now lists none, so its `ignore_imports` key goes and the config's header
says neither contract takes exceptions.

Tests: `lint-imports`, pre-commit, 684 focused tests after the final
merge, and the check's own CLI test. A probe on `message_check` showed
no model or process test relied on the check running implicitly.

> _This was written by Claude Code on behalf of max-sixty_
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