Discovered while working #28. Three related facts, in increasing order of importance.
1. test_schema_expansion fails on main
At 286650f, clean tree:
tests/test_workbench.py::test_schema_expansion
assert 'COMMITTEE' in ['PARTY', 'CONTRACT', 'OBLIGATION', 'DEADLINE', 'COST', 'VENUE', ...]
FAILED
The test asserts that the contracts schema contains entity types COMMITTEE, PERSON, EVENT, STAGE, ROOM and relation types CHAIRED_BY, RESPONSIBLE_FOR, HOSTED_AT, REQUIRES, SCHEDULED, "per D-20".
domains/contracts/domain.yaml actually has:
- entity_types (9):
PARTY, CONTRACT, OBLIGATION, DEADLINE, COST, VENUE, SERVICE, INSURANCE, PENALTY
- relation_types (9):
OBLIGATED_TO, HAS_DEADLINE, COSTS, SIGNED_BY, PROVIDES_SERVICE, HELD_AT, REQUIRES_INSURANCE, CROSS_REFERENCES, PENALIZES
So either the D-20 expansion was never applied, or it was reverted and the test was left behind. Someone who knows the D-20 intent should decide whether to apply the schema change or delete the stale assertions — I did not want to guess which.
2. An entire test file never runs under make test
Makefile:test is python -m pytest tests/ -m unit -v. Marker selection across the workbench tests:
$ pytest tests/ -m unit --collect-only | grep test_workbench
tests/test_workbench_security.py::test_xss_sanitization
tests/test_workbench_security.py::test_path_traversal_blocked
tests/test_workbench_security.py::test_role_validation
tests/test_workbench_security.py::test_sri_hashes_present
tests/test_workbench_security.py::test_cors_restricted
tests/test_workbench_security.py::test_sidebar_xss_dom_api
tests/test_workbench_security.py is marked. tests/test_workbench.py is not — none of its 29 tests carry a marker, so make test selects zero of them.
That is the actual reason a red test sat on main unnoticed. It also means the 29 workbench API tests provide no signal in the project's default test command.
Worth auditing every test file for the same gap, not just this one.
3. Docs drift on the contracts domain
CLAUDE.md states:
contracts — 11 entity types, 11 relation types for event/vendor contract analysis
The schema has 9 and 9 (listed above). Either the doc predates a trim, or it describes the unapplied D-20 state. Same root question as item 1.
Suggested resolution order
- Decide the D-20 question — apply the expansion, or delete the stale assertions.
- Mark
tests/test_workbench.py (and audit the other test files) so make test actually covers them.
- Reconcile the CLAUDE.md counts with whatever the schema ends up being.
Item 2 is the one that prevents recurrence.
Discovered while working #28. Three related facts, in increasing order of importance.
1.
test_schema_expansionfails onmainAt 286650f, clean tree:
The test asserts that the contracts schema contains entity types
COMMITTEE,PERSON,EVENT,STAGE,ROOMand relation typesCHAIRED_BY,RESPONSIBLE_FOR,HOSTED_AT,REQUIRES,SCHEDULED, "per D-20".domains/contracts/domain.yamlactually has:PARTY,CONTRACT,OBLIGATION,DEADLINE,COST,VENUE,SERVICE,INSURANCE,PENALTYOBLIGATED_TO,HAS_DEADLINE,COSTS,SIGNED_BY,PROVIDES_SERVICE,HELD_AT,REQUIRES_INSURANCE,CROSS_REFERENCES,PENALIZESSo either the D-20 expansion was never applied, or it was reverted and the test was left behind. Someone who knows the D-20 intent should decide whether to apply the schema change or delete the stale assertions — I did not want to guess which.
2. An entire test file never runs under
make testMakefile:testispython -m pytest tests/ -m unit -v. Marker selection across the workbench tests:tests/test_workbench_security.pyis marked.tests/test_workbench.pyis not — none of its 29 tests carry a marker, somake testselects zero of them.That is the actual reason a red test sat on
mainunnoticed. It also means the 29 workbench API tests provide no signal in the project's default test command.Worth auditing every test file for the same gap, not just this one.
3. Docs drift on the contracts domain
CLAUDE.mdstates:The schema has 9 and 9 (listed above). Either the doc predates a trim, or it describes the unapplied D-20 state. Same root question as item 1.
Suggested resolution order
tests/test_workbench.py(and audit the other test files) somake testactually covers them.Item 2 is the one that prevents recurrence.