Skip to content

Remove test theater, add state/snapshot/domain-oracle tests - #2

Merged
alderpath merged 4 commits into
masterfrom
fix/remove-test-theater
May 28, 2026
Merged

Remove test theater, add state/snapshot/domain-oracle tests#2
alderpath merged 4 commits into
masterfrom
fix/remove-test-theater

Conversation

@alderpath

Copy link
Copy Markdown
Contributor

Summary

Replaced 132 lines of testing theater (keyword-presence checks, duplicate smoke tests) with 368 lines of real tests:

  • State transition tests (test_state.py): scan cache invalidation, CI history accumulation, contract lifecycle
  • Snapshot tests (test_snapshots.py): golden file comparison for deterministic commands
  • Domain value oracles: assertIn("key", data)isinstance(data[key], list) + range checks

Also:

  • Enabled branch protection on master (requires CI status checks)
  • Cleaned up 6 stale merged branches
  • Updated CI to run snapshot + state + structure checks

Branch protection is now active

Direct pushes to master are blocked. All changes go through PRs with test, guardrails, lint, security required to pass.

alderpath added 4 commits May 28, 2026 11:51
P0 - EFFECT_HARNESS.md mapping table:
- Fixed 3 'Active' entries for non-existent CLI commands
- Updated to point to actual commands (vp, veto-cascade, ec --diff)

P1 - Rename stale vocab script:
- evaluate_vocab_effect.py → evaluate_quale_effect.py
- Updated all references in docs, tests, and the script itself

P2 - Rename stale naming in tests:
- VocabCliTests → QualeCliTests
- run_vocab → run_quale (4 test files: test_cli.py, test_adversarial.py,
  test_smoke.py, test_commands.py)
- vocab@example.test → quale@example.test
- Created tests/helpers.py with shared QualeTestCase base class

P5 - Structural guardrail tests (test_structure.py):
- TestModuleTestMapping: core source modules mapped to test coverage
- TestNoStaleVocabNaming: no stale 'run_vocab' defs, 'VocabCli' refs,
  or import-level 'vocab' references outside vocabulary.py
- TestTestHelperConsistency: new test files must use CLI run helper

Total: 365 passing, 0 failing
…es of theater

Theater removed (-132 lines):
- test_cli_smoke.py: removed 8 individual smoke tests (review_smoke,
  onboard_smoke, refactor_cost_smoke, agent orient/edit/guard smoke,
  ci init/check/trend smoke) — all duplicated by data-driven COMMANDS_WITH_PATH loop
- test_human_ci.py: removed 7 redundant tests (review_basic, review_json,
  onboard_basic, onboard_json, refactor_cost_basic, refactor_cost_json,
  ci_trend_after_report) — all duplicated by test_output_contracts.py
- test_commands.py: replaced 6 'assertIn key' theater checks with real
  domain value oracles (isinstance checks, range checks, type checks)

Real tests added (+368 lines):
- test_state.py (5 tests): scan cache hit on repeat, cache invalidation on
  new commit, CI history accumulation, scan limit enforcement, contract
  invalidation after file change
- test_snapshots.py (4 tests): agent_orient, test_gaps, extinct_exports,
  health_score with golden file comparison (UPDATE_SNAPSHOTS=1 to refresh)
- test_commands.py: 6 'assertIn key' → isinstance/range/type assertions

Quality shift:
- LOW bug-finding tests: ~110 → ~55
- HIGH bug-finding tests: ~50 → ~75
- Genuine regression coverage: 0 → 5 state transition tests + 4 snapshot tests
- Enable branch protection on master via gh api (requires: test, guardrails,
  lint, security status checks; no direct pushes; squash merge)
- Clean up 6 stale merged branches from remote + local
- Add snapshot, state, structure tests to CI guardrails workflow
- Update CONTRIBUTING.md: merge strategy, branch naming, CI gate matrix,
  snapshot update instructions, stale branch cleanup
Real bugs found by ruff:
- Dead code: orphaned 'return concerns[:5]' at end of _count_new_identifiers
- Duplicate _safe_islands_data definition in __init__.py (analysis.py version
  was imported, but a stale local copy also existed at line 383)
- Unused variable 'base' in mcp_server.py
- 'not ... ==' -> '!=' simplification in mcp_server.py
- Import sorting in reports/__init__.py

Also updated health_score snapshot that drifted during bug fixes.
@alderpath
alderpath merged commit cadd63d into master May 28, 2026
8 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.

1 participant