Add public check_source() and export the checker API#65
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check_agreement,CheckResult,Finding, andCheckerUnavailablefromliminate/__init__.py.check_source(source, *, domain_packs=None) -> CheckResult(inchecker.py), which runsrun(..., enter_phase2=False, auto_confirm_amber=True)for the symbol table and a corrected statement collector for the AST list, then callscheck_agreementdirectly — no wrapper type.run._collect_deontic_statements, not a shared helper: reusing that collector unmodified silently drops everyDefineNode(check 7 finds nothing) and never collects value-formrememberlines (nonlinearity reached through a name goes undetected).run._collect_deontic_statementsitself is untouched — its output still feedsdetect_contradictionsin the liverun()path.Origin
Halverson dry run (
liminate-devPR #89) hit theDefineNodetrap firsthand while reimplementing this collector by hand;case-studies/halverson/check-output/check_harness.pyonliminate-dev:mainwas the working prototype this build generalizes.Test plan
venv/bin/python3 -m pytest tests/test_checker.py -v— all 76 pass, including 7 newcheck_sourcetests (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 liminateverified to succeed with z3 import blocked (subprocess-isolated test).🤖 Generated with Claude Code