Skip to content

test(python): pin all four enum sets, and the git_branch actions in use - #85

Closed
CMGS wants to merge 1 commit into
codex/close-repo-reviewfrom
test/python-enum-corpus
Closed

test(python): pin all four enum sets, and the git_branch actions in use#85
CMGS wants to merge 1 commit into
codex/close-repo-reviewfrom
test/python-enum-corpus

Conversation

@CMGS

@CMGS CMGS commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #81. Closes the Python half of a wire-corpus drift gap; the Rust half (Response encode paths are never fixture-verified) is left for its own change.

The gap

protocol/wire/fixtures/v1/enums.json is the shared anti-drift corpus. Go (TestEnumValueSetsMatchFixture) and Rust (enum_value_sets_match_fixture) both pin all four sets. Python pinned two: error_kind and event_kind.

Of the two missing, git_branch_action is load-bearing — sandbox.py:191,194,197,200 hardcodes "list", "checkout", "create", "delete" straight into the request. A rename on the silkd side would have reached users as a runtime rejection with nothing in the suite failing first.

What is added

  • test_enum_value_sets_match_corpus now covers file_kind and git_branch_action alongside the existing two.
  • test_git_branch_actions_come_from_the_corpus drives the four real verbs through a recording conn and asserts the actions they emit are exactly the corpus set — so the literals stay tied to the contract, not just the constant list.

Validation

  • pytest 152 passed, ruff check clean
  • mutation-tested: renaming action="checkout" to "switch" in sandbox.py fails the new test

The corpus check covered error_kind and event_kind only. git_branch_action is
the one Python hardcodes as literals at four call sites, so a rename on the
silkd side would have surfaced as a runtime rejection rather than a failing
test - Go and Rust both pin all four. The second test drives the real verbs
and asserts the actions they put on the wire are exactly the corpus set.
@CMGS

CMGS commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Squash-merged into main as a4c1c7d (the branch was stacked on #81, so only its own commit was cherry-picked — merging the branch would have dragged #81 in). pytest 152 passed and ruff clean on main.

@CMGS CMGS closed this Aug 13, 2026
@CMGS
CMGS deleted the test/python-enum-corpus branch August 13, 2026 19:22
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.

1 participant