Add accepted callable REVIEW ratchets - #135
Merged
Merged
Conversation
stef-k
marked this pull request as ready for review
October 4, 2026 08:28
This was referenced Oct 4, 2026
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.
Human-reviewed callable REVIEWs currently recur unchanged on subsequent checks. This adds one independent, source-controlled reviewed ceiling for callable size, nesting, and complexity: ordinary thresholds and measurements remain unchanged, values within an accepted ceiling pass, and growth reviews again.
The runner applies the shared ratchet using its existing single
AnalysisFactspass. Durable identity is normalized root-relative physical path + embedded language + lexical callable identity + guard, without persistedSourceRange. Active ambiguous matches fail closed; renamed, moved, disappeared, or coordinate-qualified callbacks can become stale and require explicit pruning/re-review. Filesystem safety and atomic writes reusebaseline_files; LOC and Markdown schemas/lifecycles remain independent.Acceptance targets one current REVIEW in one explicit file with
--accept-callable-review GUARD LANGUAGE CALLABLE --reason TEXT. It records the exact measurement and cannot replace/increase an existing ceiling. Separate--update-callable-review-baselinemaintenance only lowers/removes existing entries;--prune-stale-callable-reviewsexplicitly enables stale pruning. Writes reject Git selectors, CI/JSON analysis, and other baseline modes. Normal analysis stays read-only and preserves incomplete-provider evidence. CLI/storage canonically usecyclomaticComplexity, explicitly mapped to the existingcomplexityresult/policy ID; the alternative spelling is rejected.Full/debug findings add accepted measurement, ratchet status, and reason; compact omits accepted PASS noise and human growth output shows current versus accepted values. README, configuration/usage/workflow/design decisions, changelog, and bundled skill/callable policies document the settled contract and anti-gaming rules.
Implements #132 only; candidate issues #133 and #134 remain outside scope. This PR stays draft and unmerged for independent review.
Validation
148 relevant baseline/identity/guard/lifecycle/output/scope/provider regression tests passed, including 24 new focused tests.
Full repository suite: 357 tests passed on Python 3.12/Linux.
16 baseline-free human/full/debug/compact, CI, and mixed incomplete invocations were byte-identical to current
main(1af5ce0c01ee1e070f335acd69d3b6451ba7d8fe).python -m compileall -q src skills research testsandgit diff --check origin/mainpassed.Wheel and sdist built;
twine checkpassed for both. Fresh installed artifacts passed analysis, targeted acceptance, read-only compact output, growth rejection, maintenance lowering/removal, and bundled-skill checks.Installed Code Guard over the complete branch scope (
--base-ref origin/main --json --json-mode compact): REVIEW, 16 selected/analyzed files, no FAIL/INCOMPLETE.Exact-head CI passed for
d7e52096026dd6af87f086735a6d66d7e455f2b8: Linux/macOS/Windows production analysis, Python 3.10–3.14 compatibility and its required aggregate, CodeQL, and package build/validation. PyPI publishing was correctly skipped for a draft PR.Code Guard review judgments
src/agent_code_guard/code_guard.pyfile LOCcode_guard.parsercallable sizecode_guard.run_analysiscallable sizecode_guard.run_analysiscomplexityThese REVIEWs were inspected under the existing LOC, callable-size, and complexity policies. No allowances, thresholds, exclusions, or exceptions were added or relaxed for this repository to silence them. Independent review remains outstanding.