Harden compiler validation and reconcile schemas with the compile contract#12
Merged
Conversation
Validation now enforces the invariants the docs promise: - Every external invocation gets a timeout: programmatic checks default to timeout_sec 300 and cmd context sources to 60, both validated as positive integers (previously only host/council had timeouts). - Empty argv arrays are rejected at compile time instead of crashing a runner at execution time. - context_sources entries must have exactly one of file or cmd; null context_sources / gate criteria / gate members no longer raise bare TypeError tracebacks. - workspace.dir and context file paths must be relative and must not traverse out of the loop directory. - Budget values (usd, tokens, wall_clock_min) must be positive numbers. - Duplicate council member ids are rejected instead of silently collapsing; a gate's verdict_source judge must also be listed in that gate's members; host.cli and council cli are required. - register-model refuses invoke/notes values that look like credentials (the registry must never store secrets) and accepts a single quoted string for flag-bearing invocations (--invoke "claude -p"), which argparse could not express before. - JSON/YAML reads tolerate a UTF-8 BOM; all generated artifacts are written with LF newlines on every platform. Schemas reconciled with the real compile contract (workspace and verification optional, gate requires only verdict_policy, typed budget and context_sources, timeout_sec on programmatic criteria) so schema-aware editors agree with the compiler. Example artifacts recompiled with the new defaults. Co-Authored-By: Claude Fable 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.
Remediation batch 2 of 3 from the 2026-07-04 audit.
Compile-time invariants now actually enforced
cmdcontext sources (default 60s) now compile with validated timeouts — previously only host/council members had them, leaving the most-executed calls uncapped.invoke: []used to compile, then crash the runner).context_sourcesentries need exactly one offile/cmd; entries that had neither were silently dropped from RUN_IN_SESSION.md.context_sources:/criteria:/members:keys no longer produce rawTypeErrortracebacks.workspace.dirand contextfilepaths must be relative, no..(defense-in-depth with the runner-side check from Fix runner loop-control, consent, and redaction defects #11).usd/tokens/wall_clock_minmust be positive numbers (wall_clock_min: -5used to compile).verdict_sourcemust be listed in its gate'smembers;clirequired on host and members.Registry safety + usability
register-modelrefuses secret-shaped tokens in--invoke/--notes(sk-/ghp_/xox/AKIA/key=value patterns) —~/.looper/models.jsonmust never store credentials.--invoke "claude -p"(single quoted string, shell-split) now works; argparse previously made flag-bearing invocations impossible to register.Cross-platform
Schemas reconciled
The bundled JSON schemas drifted from what the compiler accepts (schema required
workspace/verification/five gate fields; code defaulted them). Schemas now describe the real contract, including the new typedbudget,context_sourcesone-of, and criteriontimeout_sec. Example artifacts recompiled with the new defaults.Tests
16/16 locally (4 new: invalid-spec rejection matrix via subtests, defaults/null-tolerance, BOM tolerance, registry secret guard + quoted invoke).
🤖 Generated with Claude Code