Skip to content

Assert page check's markup findings by code and field - #2692

Merged
max-sixty merged 2 commits into
mainfrom
markup-findings-tests
Oct 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
markup-findings-tests

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#2686 made the markup checks report records. This PR switches the tests that matched page check's words for those findings to read the records. interact_support.check_findings runs page check --json in process and returns the exit status and the findings. found selects them by code, by element, and by values.

The assertions now pin facts that the words only suggested:

  • the reserved markers each element wears, which replaces a count of a phrase and a hand-written negative check for (note);
  • the line and body of each split pane;
  • the template ids a sample child's error was read in;
  • the allowed values for an allocation;
  • the layer's known words for an unknown tone;
  • exactly which threads activation would move.

That last one now includes the reaction mark that follows its subject. The text assertion it replaced never excluded it.

Some assertions still match words, because what they read is not a record yet:

  • a registry contract's RegistryError (the invalid-registry finding's error);
  • capture's ArtifactError (capture-failed);
  • a sample history's event refusal (sample-history);
  • a page that was never initialized, which page check refuses before it checks anything;
  • refusals at the thread and comment commands, which have no --json.

No user-visible behaviour changed.

I ran the model files test_interact_contract, test_interact_document, test_interact_anchors and test_interact_product in full. I ran each changed journeys test by node ID, in journeys/test_interact_document.py, test_interact_contract.py and test_interact_anchors.py.

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

Tests that matched `page check`'s words for a markup finding now read
`page check --json` through `check_findings` and select records by code,
element and values. They pin the facts a finding carries, such as the
reserved markers each element wears, the lines of a pane's split bodies, the
sample a child's error was read in, and the threads activation would move.

The checks that still match words read words that are not yet records: a
registry contract's `RegistryError`, capture's `ArtifactError`, a sample
history's event refusal, and refusals at the thread commands' CLI.

No user-visible behaviour changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@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 two delivery-asset cases now accept an unrelated capture failure. The inline suggestion restores the specific refusals these cases protect.

Comment thread tests/model/test_interact_document.py Resolved
@max-sixty
max-sixty merged commit 0036239 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the markup-findings-tests branch October 12, 2026 23:37
max-sixty added a commit that referenced this pull request Oct 13, 2026
Every gate at the event log's append door now refuses on a `Finding`
record (#2662, #2686, #2692 built the type) instead of a sentence. Each
refusal has a stable code and the values the gate read: the refused
event's `kind`, the identity or field it concerns, and, where a value
was refused, what was offered and what would have been admitted. The
words for each code are written once, in `findings._TEXT`.

- **Gates** in `event_contracts`, `events.UndoReading`,
`tasks.task_error`, `work.widget_seat_error`, `read_state` and `layer`
return `Finding | None`. `EventRefused` and `AttemptConflict` carry that
one finding. A schema refusal (`invalid-event`, `invalid-detail`) names
the JSON pointer of its `field` and the schema `rule` it breaks
(`registry.schema.schema_complaint`).
- **Layer refusals**: `layer.incompatible_layer` and
`incompatible_revision` return findings too (`foreign-layer`,
`retired-layer`, `foreign-revision`, `retired-revision`), so serving,
admission and `page check --json` report the same record. `page check
--json` reports the layer's own code where it used `invalid-registry`.
- **User words**: `refusals.Refusal`, the string that carried separate
words for the browser, is gone. The two codes that have their own user
words (`stale-move`, `stale-edit`) get them from `findings._USER`,
through `Rejected.user`.
- **Transports**: the event door's 400/409 answer carries `findings`
beside `error`, which is still the text the browser shows.
`Refused.json()` is the one JSON shape of a refusal. A failed thread
title records the refusal's code.
- **Hook weight**: `findings` imports `registry.schema` only when it
writes words. The event log raises findings, and the Codex tool hook
reads a quiet page without importing jsonschema
(`test_codex_tool_hook_reads_a_quiet_page_without_the_page_model`).

No user-visible behaviour changed: every refusal reads as it did, in the
browser and on the command line.

Tests that matched admission refusal text in-process, or in the door's
answer, now read the code and fields through `refused_on`. A heuristic
count of test assertions that match the original refusal words fell from
63 to 31. Most of the 31 match the CLI's printed output, and a follow-up
PR moves them to a `--json` refusal shape. The rest assert the
user-facing words or text that does not come from the append door.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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