Skip to content

RepoBeagle v1.181.0

Choose a tag to compare

@javierbits javierbits released this 26 Nov 07:45
· 9 commits to main since this release
v1.181.0

Rule packs: contribute regex rules without editing the scanner.

Highlights

  • Teams ship versioned packs at .repobeagle/rules/*.yml (version: 1): {id, paths, regex, severity, meaning, remediation, fixtures}. They compile into the same finding shape (tool: "rules", stable rule id, severity, meaning, remediation; capped at 20 matches per rule with a summary) and load automatically on scan and on the metadata head path; meta.rule_packs records the files and rule count.
  • repobeagle rules lint <pack-or-dir> validates schema/version/unique ids/severity/paths/meaning/remediation, regex compilation, anchoring (^/\b — rules match line by line, never a whole-file search) and catastrophic backtracking (nested quantifiers like (a+)+). Any error exits 1; nothing is skipped silently.
  • repobeagle rules test <pack-or-dir> lints first, places each fixture at a matching path, runs the real pipeline and requires every positive fixture to fire the exact rule id and every negative not to. CI can use the same command for contributed packs.
  • An invalid pack aborts a scan (exit 1). Explicit .repobeagle.yml rule overrides and persona deltas apply to pack ids like any other rule, and packs share the suppression namespace.
  • Packs are additive and regex-only: they cannot express context-sensitive logic (documented).

Verification

  • PR #93: offline 1 m 44 s (476 assertions incl. tests/test_rule_packs.py), compare 5 m 53 s, dedupe 8 s, image-toolchain 54 s, gate / gate 6 s, upload×2 — green. (One CI rerun: the batch timing assertion at <80% was too tight on a loaded 2-core runner; process startup dominates sub-second scans. The deterministic concurrency proof is the sleeping-scanner test; the batch equality/timing test now only requires "not slower than sequential".)
  • Acceptance from the released image (digest sha256:5405523a8b9571b5f82b00de21934be67af7d3836f6ac05a114bf96e790e9432, cosign verify VALID, stable identical):
$ repobeagle rules lint .repobeagle/rules        -> PASS 1 pack file(s), 2 rule(s)   exit=0
$ repobeagle rules test .repobeagle/rules        -> PASS ... exit=0
$ repobeagle rules lint /bad/.repobeagle/rules   -> exit=1
  rule 'unanchored-rule'.regex is unanchored: start it with ^ (per line) or \b
  rule 'catastrophic-rule'.regex has nested quantifiers (catastrophic backtracking risk), e.g. (a+)+
$ repobeagle scan tests/fixtures/rule-pack
  meta.rule_packs: {'files': ['.repobeagle/rules/pack.yml'], 'rules': 2}
  [('no-todo-fix', 'src/main.js', 3, 'medium', 'resolve or re-file the TODO'),
   ('no-console-log', 'src/main.js', 2, 'low', 'use the project logger')]

Upgrade

./install.sh, or repobeagle update. Light mode: pipx install . after pulling this tag.

Notes

  • Fixture paths are synthesized from the rule's first path glob; packs whose globs need real directory structure should use **/wildcards that the synthesizer can satisfy.
  • A pack id that collides with a built-in rule intentionally shares the suppression/override namespace.