Repository navigation
Report capture and sample history problems as findings - #2709
Merged
Merged
Conversation
The tests in `test_interact_contract.py` that matched the words of a registry refusal now read its record: `page check --json` through `check_findings`, a direct validation through `registry_refusal`, and `page init` through `command_refusal`. They pin facts the words only suggested, such as both verbs that claim one record slot, the slot's kind and attribute, and the keyword of a schema complaint. No user-visible behaviour changed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A refused capture and a refused sample history now reach `page check` as coded records, where they reached it as one `capture-failed` or `sample-history` record holding the refusal's text. `ArtifactError` is a `findings.Rejected` carrying one finding, such as `dependency-unreadable` or `module-outside-page`, with the file and the reference in it as `values.file` and `values.specifier`. `initial_sample_events` raises a `Rejected` whose finding names the script (`values.reference`) and, for one of its events, which (`values.event`): `sample-json`, `fixture-ts`, `fixture-markup` holding the message gate's own findings, and so on. A refusal from the event contract or the anchor capture keeps its words as `fixture-refused`. The human output of `page check` is unchanged. The suite's `command_findings` replaces `command_refusal` and returns every finding a refused command carries, so the sample tests read the message door's refusal through it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 13, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The CSS capture findings still lose their source file. In _css_references, css-invalid, css-url, and css-import are raised without file; the exception reaches page check unchanged. With multiple stylesheets, page check --json gives a coded refusal but no way to identify which stylesheet needs repair. I reproduced css-invalid as {"code":"css-invalid","values":{"error":"EOF in URL"}}. Carry the source path through the CSS reference walk so these records identify the offending file, including /index.html for authored CSS.
`css-invalid`, `css-url` and `css-import` now carry the file whose CSS they read, `/index.html` for the page's own `<style>` and `style` attributes, so their words open with it as every other capture refusal's do: `/page/style.css: invalid CSS: bad URL token`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 13, 2026
Main now refuses events with findings (`EventRefused`, and `command_error` returns one), so a sample history's event-contract refusal is `fixture-event` holding those findings in `values.findings`, as `fixture-markup` holds the message gate's. `fixture-refused` keeps only the anchor capture's words. The printed words are unchanged. Main's `command_refusal` callers move to `command_findings`, which replaces it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #2698 (merged). Capture refusals and sample-history refusals now reach
page checkas coded records. Before, each was onecapture-failedorsample-historyrecord whose only value was the refusal's text. The tests that matched registry, capture and sample-history words now read the records.What changed
ArtifactErroris now afindings.Rejectedcarrying one finding. Its 24 raise sites callartifact_error(code, file, specifier, **values). The codes includedependency-unreadable,dependency-not-local,module-outside-page,module-type,dependency-symlink,css-importandmanifest-digest.values.fileis the file the problem was read in andvalues.specifieris the reference in it. The words are written infindings.py(_captured).page checkadds the refusal's findings to its errors.initial_sample_eventsraises aRejectedinstead of aValueErrorthat wrapped the inner refusal's text. Its finding names the script (values.reference) and, for a problem with one of its events, which one (values.event). The codes includesample-script,sample-json,sample-array,fixture-kind,fixture-tsandfixture-id-taken.fixture-markupholds the message gate's own findings invalues.findings, under its kind, andfixture-mediaholds the media check's findings the same way.fixture-event, holding the door's findings (EventRefused, orcommand_error's) invalues.findingsthe same way. An anchor-capture refusal keeps its words asfixture-refused(values.error).page checksets the template ids on each finding'ssamples, as it does for markup findings. The HTTP sample door catchesRejectedbesideValueErrorand answers with the same text.capture-failedandsample-historyno longer exist.command_findings(*args)replacescommand_refusal, and every caller moves to it. It returns every finding a refused command carries, or none when the command succeeds. The sample tests read the message door's refusal through it.Human output: before and after
One wording changed, for consistency. The three CSS refusals from the stylesheet walk (
css-invalid,css-url,css-import) used to name no file. They now carry and print the file whose CSS they read, as every other capture refusal does. For the page's own<style>andstyleattributes, that file is/index.html. Without it, a page with several stylesheets got a coded refusal with no way to tell which sheet to fix:I ran
leaf page checkfrom the merge base and from this branch on 33 pages. Three changed, all with the CSS wording above. On the other 30, stdout, stderr and exit status were byte-identical. They cover every sample-history case the suite exercises (including the three message-markup ones) and every module and stylesheet capture case. I filtered out theleaf-versionadvice line, because the two trees run as different Leafs.A page whose module imports a missing file:
A page whose sample history has a bad timestamp in its second event:
page check's JSON, before and after (textomitted):Tests
test_interact_contract.pynow read records: about 45 tests, throughcheck_findings,registry_refusaland, forpage init,command_findings. So doestest_a_layer_stamped_with_its_revision_still_names_the_revendor, which arrived from main. They pin facts the words only suggested, such as both verbs that claim one record slot, the slot's kind and attribute, and a schema complaint's keyword.test_interact_contract.py,test_interact_document.pyandtest_revision_delivery.pyassert codes and fields.activate_source. They now read the reason frompage check's findings, becauseActivation.erroris a joined string.test_check_validates_each_sample_documentlost itssample_holder_checkhelper. It asserts codes andsamplesfor both holders now.test_interact_contract,test_interact_layer,test_interact_document,test_revision_deliveryandtest_server_lifetimein full.test_interact_product,test_product_page,test_interact_preview,test_live_shell_artifact,test_todos,test_stop_guardandtest_render_gate. 917 of 919 passed. Both failures read a capture refusal's file name through text that is still a sentence: theRefusedthatpage stampraises fromActivation.error, and that same joined string.Left for follow-ups
Activation.error. It joinscheck_source's findings into one string, andthread,agent_state,samples,served_stateandrevisioningread it as text. Carrying the findings would let those consumers and their tests read fields.layer.incompatible_layer. Its refusal (Name the code's ask and to-do records asks and to-dos, as the interface does #2658) reachespage checkas the one remaininginvalid-registrytext record. The page servers, the event door and the website also read it as a sentence.