rulereceipt 0.1.69 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -243,6 +243,11 @@ function isClaimEvidenceRule(rule) {
243
243
  return CLAIM_SHAPE.test(text) && EVIDENCE_NOUN.test(text);
244
244
  }
245
245
  const BRANCH_WORD = /\bbranch\b/i;
246
+ // A git ref-action verb. "Never push to `main`" / "don't commit to `master`"
247
+ // are branch rules even without the literal word "branch" — found missed in the
248
+ // 2026-09-29 full-tool validation. Paired with a backticked, branch-shaped
249
+ // literal (and NOT a file token), so a bare English "main" is not swept in.
250
+ const GIT_REF_ACTION = /\b(?:push(?:ing|es|ed)?|commit(?:ting|s|ted)?|merg(?:e|ing|es|ed)|rebas(?:e|ing|es|ed)|checkout)\b/i;
246
251
  /**
247
252
  * A literal that could actually be a git branch name.
248
253
  *
@@ -729,8 +734,10 @@ export function classifyRule(rule) {
729
734
  // Real rules here name exactly one branch ("the `demo` branch", "never
730
735
  // push to the `main` branch"), and a rule that mentions branches while
731
736
  // naming a command belongs to whichever checker handles that command.
732
- const branchName = [...patterns].find(isBranchName);
733
- if (BRANCH_WORD.test(text) && branchName !== undefined) {
737
+ // A branch name is a backticked, branch-shaped literal that is NOT a file
738
+ // token (`.env`, `dist/`) — those belong to fileLifecycle, not a ref check.
739
+ const branchName = [...patterns].find((p) => isBranchName(p) && !looksLikeFilePathToken(p));
740
+ if ((BRANCH_WORD.test(text) || GIT_REF_ACTION.test(text)) && branchName !== undefined) {
734
741
  return { kind: "gitBranchPolicy", rule, branchName, polarity, polarityInferred };
735
742
  }
736
743
  // A forbid scoped by a condition the literal checkers cannot evaluate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulereceipt",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "description": "Checks whether your AI coding agent followed your rules, with evidence. Works with Claude Code (Codex in testing); reads CLAUDE.md, AGENTS.md, Cursor, Copilot and Windsurf rules.",
5
5
  "repository": {
6
6
  "type": "git",