Repository navigation
Conversation
The README carried about 25 hand-typed counts, and the corpus grew from 80 to 87 records in a week. scripts/sync_record_counts.py measures the AVE corpus and the scanner's own rule files and writes each value into an inline <!-- count:NAME --> marker. HTML comments are invisible when rendered and work inside table cells and sentences. The corpus is pinned by commit in the README, so --check fails when a rule or the README changes, not whenever AVE publishes a record. --update-ref moves the pin. Rule files are parsed, not imported: PATTERN_RULES is followed through its V1 and V2 lists, and an unrecognized layout fails closed instead of miscounting. Standard library only; not packaged in the wheel. Counts inside the README's code diagrams are dropped, because a comment in a code fence prints literally; the tables carry them. A Record Counts CI job runs --check. Closes #120 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: chaksaray <chaksaray@gmail.com>
| raise CountsError(f"not an https URL: {url}") | ||
| headers = {"User-Agent": USER_AGENT, "Accept": accept} | ||
| token = os.environ.get("GITHUB_TOKEN") | ||
| if token and parts.netloc.endswith("github.com"): |
6 tasks done
This branch has not been deployed
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.
Closes #120
What and why
The README carried about 25 hand-typed counts, and the corpus grew from 80 to 87 records in a week.
scripts/sync_record_counts.pynow measures them and writes them in place, so a count can no longer be typed wrong.<!-- count:published -->87<!-- /count -->. HTML comments are invisible when rendered and work inside table cells and sentences, so the prose is unchanged. The README now has 23 markers: record totals and id range, detected and uncovered counts, runtime stages, schema and AIVSS versions, rules per engine, chains, and the badge<!-- counts:corpus ref=<40 hex> -->.--checkreads the corpus at that commit, so it fails when a rule file or the README changes, not whenever AVE publishes a record.--update-refmoves the pin to the head of AVEmainand rewritesPATTERN_RULESis followed through its V1 and V2 lists, and a layout the script does not recognize exits 2 instead of miscounting--corpus <path|https URL>reads a local snapshot with no network.BAWBEL_AVE_CORPUS_URLsets the same thing, the name bawbel-mcp already uses. Exit 0 current, 1 stale (--check), 2 unreadable, and nothing is written on 2Record CountsCI job runs--check. Actions pinned by SHA, no installsFound by dry-running before editing the README:
PATTERN_RULESholds 15 rules andPATTERN_RULES_V2another 25, joined at pattern_engine.py:1065. Reading the first list gave 15 and a detection count of 40. The resolver follows list assignments anda + bin source order, and a test compares it with the module's runtime list.Output contract impact
Fields added: none
Fields renamed: none
Fields removed: none
README, a script, a test, and a CI job. No scanner code changed.
Checks
findings 7 max CRITICAL risk 9.8707 passed in 316.32s(71 are new)exit=0, 14 hooks passed (black, flake8, bandit, the self-scan, and the full test suite among them). The first run caught three flake8 findings in the script, fixed hereThe README's hand-typed numbers were all correct against the corpus at the pinned commit, so this PR changes no number.
Measured against the independent figures from the claims register's verifier (bawbel/.github, run 2026-10-20): 87 published, 43 detected (42 static plus Magika), 8 metadata-only, 44 uncovered (27 static, 17 runtime), 40 + 39 + 41 rules, 12 chains. They agree.
Can the check fail? Mutation runs:
The tests compare the parsing with the scanner's own objects (
PATTERN_RULES,FLOW_DEFINITIONS,AVE_META), and with realyaraandyamlparses when those are installed (importorskip, as the engine tests do).Not in this PR
scanner/ave_meta.py: 51 hand-typed entries, synced from the retired host on 2026-06-21. The README counts do not depend on it beyond the "metadata only" figure--update-refdoes it by hand for nowMerging with #117 and #119
The README merges cleanly with both.
CHANGELOG.mdconflicts with each, because all three add an entry under[Unreleased]. I will rebase the later ones after the first merges.Found, not changed
scripts/sync_records.pystill syncs from the retiredbawbel/averepo into PiranhaDB (PIR-2)pyproject.tomllists"AVE Standard" = "https://github.com/bawbel/ave", and CONTRIBUTING.md lines 107 and 108 name the retired repository URLs as checklist text. Both belong to the scanner ECO-3 pass, after fix: AVE record URLs from one config setting; add ave_url #117🤖 Generated with Claude Code
https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P