Skip to content

test(tools): table-drive description contract checks - #1406

Merged
yyjeqhc merged 1 commit into
mainfrom
codex/table-drive-tool-description-tests
Nov 9, 2026
Merged

yyjeqhc merged 1 commit into
mainfrom
codex/table-drive-tool-description-tests

Conversation

@swjnxyf

@swjnxyf swjnxyf commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

The coding-loop description contract test repeated per-tool lookup, lowercasing and assertion loops. Replace those loops with named tables of tools, required phrases and forbidden phrases, sharing assertion messages that identify the tool/schema field, phrase and actual description. Keep registered tools and exact-manifest specialists in separate tables backed by their original inventories.

Preserve all 274 phrase checks (257 required, 17 forbidden), including shared Cargo validation expectations. Move the existing Git diff paging budget/cursor checks and persistent-shell result/resource schema checks into two focused tests. Production descriptions and all following tests remain unchanged. Only registry_specs.rs changes, with a net reduction of 66 lines.

Validation:

  • cargo test --locked -p webcodex-tool-contracts --lib tests::registry_specs -- --quiet — 10 passed.
  • cargo test --locked -p webcodex-tool-contracts --lib --all-features tests::registry_specs -- --quiet — 10 passed.
  • Before the refactor, the same focused module passed 8 tests in each configuration; the increase comes from splitting out the two existing schema checks.
  • A one-off comparison verified exact multisets of inventory/tool/field/polarity/phrase for all 274 checks, retention of the 4 structural schema assertions, and byte-identical following tests.
  • Temporary mutations of the test's in-memory specs verified that removing never replay effects from work_on_project and inserting a forbidden phrase into read_files both fail with the exact tool/phrase diagnostic. Probe edits were restored before the final passing runs.
  • Package formatting and git diff --check passed.

@yyjeqhc
yyjeqhc merged commit 31a7393 into main Nov 9, 2026
18 checks passed
@yyjeqhc
yyjeqhc deleted the codex/table-drive-tool-description-tests branch November 9, 2026 10:14
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