Skip to content

Add public check_source() and export the checker API#65

Merged
rmichaelthomas merged 1 commit into
mainfrom
feat/check-source-public-api
Jul 21, 2026
Merged

Add public check_source() and export the checker API#65
rmichaelthomas merged 1 commit into
mainfrom
feat/check-source-public-api

Conversation

@rmichaelthomas

Copy link
Copy Markdown
Owner

Summary

  • Exports check_agreement, CheckResult, Finding, and CheckerUnavailable from liminate/__init__.py.
  • Adds check_source(source, *, domain_packs=None) -> CheckResult (in checker.py), which runs run(..., enter_phase2=False, auto_confirm_amber=True) for the symbol table and a corrected statement collector for the AST list, then calls check_agreement directly — no wrapper type.
  • The collector is a deliberate duplicate of run._collect_deontic_statements, not a shared helper: reusing that collector unmodified silently drops every DefineNode (check 7 finds nothing) and never collects value-form remember lines (nonlinearity reached through a name goes undetected). run._collect_deontic_statements itself is untouched — its output still feeds detect_contradictions in the live run() path.

Origin

Halverson dry run (liminate-dev PR #89) hit the DefineNode trap firsthand while reimplementing this collector by hand; case-studies/halverson/check-output/check_harness.py on liminate-dev:main was the working prototype this build generalizes.

Test plan

  • venv/bin/python3 -m pytest tests/test_checker.py -v — all 76 pass, including 7 new check_source tests (one is the DefineNode regression test — verified it actually fails without the fix; one doubles as the RememberValueNode-collection regression test).
  • venv/bin/python3 -m pytest tests/ -q — 1782 passed, zero regressions against the 1775 baseline.
  • import liminate verified to succeed with z3 import blocked (subprocess-isolated test).

🤖 Generated with Claude Code

check_agreement requires (statements, symbol_table); nothing public
produced both, so external callers (the Halverson dry run against
liminate-dev PR #89) had to reimplement the statement collector. Doing
so on top of run._collect_deontic_statements silently breaks two of
the seven checks: it drops DefineNode entirely (check 7 finds
nothing) and never collects value-form remember lines (nonlinearity
reached through a name goes undetected). check_source wires run() +
a corrected collector together as one public entry point so that trap
isn't there to walk into a second time.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rmichaelthomas
rmichaelthomas merged commit 5b68773 into main Jul 21, 2026
2 checks passed
@rmichaelthomas
rmichaelthomas deleted the feat/check-source-public-api branch July 21, 2026 17:37
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