Skip to content

Assert bare Path encoding uses its declared text boundary - #2956

Merged
trissim merged 1 commit into
mainfrom
fix/bare-path-codec-assertion
Oct 23, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/bare-path-codec-assertion

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

_PathDecoder deliberately registers Path origins, so bare paths now encode through PathText. The scalar-capability test still expected TypeError, contradicting the declaration and keeping main red since #2469.

Replace only that obsolete refusal with the exact declared value:

-    with pytest.raises(TypeError):
-        FieldCodec.encode(value.path)
+    assert FieldCodec.encode(value.path) == "/saved/history"

No src changes. No tests or ratchets run by this unit. The commander reported its independent proof on main 3593a631e: 121 passed, 1 skipped across test_field_codec.py, test_turn_record.py and test_declarations.py.

Required lint: ruff check tests/test_field_codec.py reports 14 findings on existing lines outside this hunk; none on the changed assertion. No formatting sweep or unrelated edit.

Reviewer #2943 touches other hunks in this file; this branch will merge main if required by its landing.

Assumed: bare Path encoding through _PathDecoder is intentional, as its declaration and test_field_codec_comparison.py already require; the exact output remains /saved/history.

The Path decoder deliberately registers Path origins. Assert the exact encoded
path instead of requiring the obsolete TypeError. No production source changes.
@trissim
trissim marked this pull request as ready for review October 23, 2026 23:31
@trissim
trissim enabled auto-merge October 23, 2026 23:31
Copilot AI balanced review requested due to automatic review settings October 23, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 8bc4d20 into main Oct 23, 2026
14 checks passed
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