Repository navigation
Register keygen, sign and issue-approval as cohaera subcommands - #54
Merged
Merged
Conversation
A collector host now needs one command rather than a module path; `python -m cohaera.emit` still runs the same parser. The boundary the emitter was built around stays a runtime fact: cohaera.cli hands a producer command to its own parser before the scoring parser runs, through the only import of signing code in any verifier module, and that import is deferred. A full `cohaera score` in a fresh interpreter loads nothing from cohaera.emit. The test that forbade the string "cohaera.emit" in verifier sources is replaced by a syntax-tree check permitting exactly that one deferred import, plus a runtime check on the scoring path. The CH06 remedy now names `cohaera sign --close`; the local lab is regenerated for that text and nothing else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01As5wcUhETPg1K3ceCVrWew
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.
What this changes, and why
The producer commands from
cohaera.emitare now subcommands ofcohaera:cohaera keygen,cohaera signandcohaera issue-approval. A collector host needs one command rather than a module path, andpython -m cohaera.emitstill runs the same parser.The emitter was built on one boundary: a host that only scores never loads signing code. That boundary is kept, and is now checked as a runtime fact rather than inferred from the module layout.
cohaera.clichecks the first argument and hands a producer command to its own parser before the scoring parser runs. That hand-off contains the only import of signing code in any verifier module, and the import is deferred.cohaera --helplists all four commands.cohaera sign --helpprintsusage: cohaera sign.src/cohaera/emit/__main__.pymoved toemit/command.py, which also exports aCOMMANDStable.__main__.pyis now a two-line shim.Evidence
tests/test_emit.py:cohaera.emit, except one deferred import insidecli._producer;cohaera scorerun leaves nocohaera.emitmodule loaded;cohaera --helplists all four commands;keygen→sign --close→score --require-closed-streamsround trip throughcohaera.cli.main, ending inverified_complete.from .emit import commandadded tocli.pyfails 3 boundary tests.python -m pytest tests/ -qpasses: 1553 passed, 18 skipped.python tests/test_evasion.pypasses. Counts are unchanged: 29 constructed evasions (14 working, 13 half closed, 2 closed).ruff check src tests eval tools lab demopasses.mypypasses.python tools/readme_facts.py --checkpasses.The command sequence in
docs/EMITTING.mdsection 4 was re-run with the newcohaerasubcommands and printedverified_complete. Both lab--checks pass and the release gate passes.If this changes detection
python eval/run_eval.pyre-run. The card is byte-identical.cohaera sign --closeinstead of "the emit command's --close". The local lab was regenerated for that. The changed fields are the remedy text and theverdict_idvalues that hash it; nothing else changed.If this changes an evasion
n/a. Only E30's wording changes, to name
cohaera sign --close.Anything a reviewer should push back on
cohaera.emitanywhere in verifier sources. Its replacement is a syntax-tree check that allows exactly one deferred import and nothing at module level. It is paired with a runtime check on the scoring path. A help string or comment that mentions the package is no longer flagged; an actual import still is.cli.pyandemit/command.py, becausecli.pymust not import the emitter just to print help. A test holds the two tables equal.cohaera --helpshows the producer commands but does not show their flags; each command's own--helpdoes. That is the cost of not loading the emitter on the scoring path.🤖 Generated with Claude Code
https://claude.ai/code/session_01As5wcUhETPg1K3ceCVrWew
Generated by Claude Code