rulereceipt 0.1.57 → 0.1.58

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.
package/README.md CHANGED
@@ -76,6 +76,7 @@ Published and live on npm, actively developed.
76
76
  ## Usage
77
77
 
78
78
  ```bash
79
+ rulereceipt audit # score your rules file for checkability — NO session needed
79
80
  rulereceipt check # check the latest session in this project
80
81
  rulereceipt check --markdown # same, formatted for pasting into a PR/Slack
81
82
  rulereceipt check --html # write a shareable single-file HTML report you can send
package/dist/audit.d.ts CHANGED
@@ -22,6 +22,11 @@ export interface RulesAudit {
22
22
  skipped: number;
23
23
  /** checkable / (checkable + judgment), whole %, 0 when there are no rules. */
24
24
  percentCheckable: number;
25
+ /** The highest-leverage rewrites — a concrete rule missing only its literal. */
26
+ topFixes: {
27
+ title: string;
28
+ suggestion: string;
29
+ }[];
25
30
  }
26
31
  export declare function auditRules(rules: Rule[]): RulesAudit;
27
32
  /** A short, readable audit. Never says "compliant" — it measures the file, not a session. */
package/dist/audit.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { classifyRules } from "./checks/classify.js";
2
+ import { adviseRules } from "./checkability.js";
2
3
  export function auditRules(rules) {
3
4
  let checkable = 0;
4
5
  let judgment = 0;
@@ -12,12 +13,17 @@ export function auditRules(rules) {
12
13
  checkable++;
13
14
  }
14
15
  const decided = checkable + judgment;
16
+ const topFixes = adviseRules(rules)
17
+ .filter((a) => a.actionable)
18
+ .slice(0, 5)
19
+ .map((a) => ({ title: a.ruleTitle, suggestion: a.suggestion }));
15
20
  return {
16
21
  total: checkable + judgment + skipped,
17
22
  checkable,
18
23
  judgment,
19
24
  skipped,
20
25
  percentCheckable: decided > 0 ? Math.round((checkable / decided) * 100) : 0,
26
+ topFixes,
21
27
  };
22
28
  }
23
29
  /** A short, readable audit. Never says "compliant" — it measures the file, not a session. */
@@ -39,6 +45,15 @@ export function renderAudit(a, md = false) {
39
45
  out.push(` ${String(a.skipped).padStart(4)} documentation — structure/notes, not scored as rules`);
40
46
  out.push("");
41
47
  out.push(`${a.percentCheckable}% of your rules can be checked mechanically.`);
42
- out.push("See which can't, and the smallest edit that would fix each: rulereceipt rules --advise");
48
+ out.push("");
49
+ if (a.topFixes.length > 0) {
50
+ out.push(H("Top fixes to unlock more checks"));
51
+ for (const f of a.topFixes) {
52
+ out.push(` • ${f.title.replace(/\s+/g, " ").trim().slice(0, 60)}`);
53
+ out.push(` ${f.suggestion}`);
54
+ }
55
+ out.push("");
56
+ }
57
+ out.push("Full advice, rule by rule: rulereceipt rules --advise");
43
58
  return out.join("\n");
44
59
  }
@@ -22,6 +22,14 @@ export interface RuleAdvice {
22
22
  kind: "judgment" | "notARule";
23
23
  /** One line: what is missing and the smallest edit that fixes it. */
24
24
  suggestion: string;
25
+ /**
26
+ * True when there is a concrete, high-leverage rewrite (name the command/
27
+ * file/branch in backticks) that would turn this into a real check — as
28
+ * opposed to a genuine judgment call or plain documentation, where the
29
+ * honest answer is "no edit makes it mechanical." `audit` surfaces the
30
+ * actionable ones as the top fixes.
31
+ */
32
+ actionable?: boolean;
25
33
  }
26
34
  /**
27
35
  * Advice for one rule, or null when the rule is already mechanically checked.
@@ -53,6 +53,7 @@ export function adviseRule(rule) {
53
53
  return {
54
54
  ruleTitle: rule.title,
55
55
  kind,
56
+ actionable: true, // a concrete, high-leverage rewrite: just add the literal
56
57
  suggestion: `mentions ${subject} but names no exact term to match. Put the concrete command, file or branch in backticks (e.g. ${exampleFor(subject)}) and it becomes a mechanical check.`,
57
58
  };
58
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulereceipt",
3
- "version": "0.1.57",
3
+ "version": "0.1.58",
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",