rulereceipt 0.1.32 → 0.1.34
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/dist/checks/claimEvidence.d.ts +12 -0
- package/dist/checks/claimEvidence.js +334 -0
- package/dist/checks/classify.d.ts +20 -1
- package/dist/checks/classify.js +158 -12
- package/dist/checks/codeContent.js +13 -9
- package/dist/checks/deterministicChecks.js +19 -3
- package/dist/checks/fileLifecycle.js +35 -9
- package/dist/checks/gitBranchPolicy.js +28 -9
- package/dist/checks/ifEditThenTest.js +37 -1
- package/dist/checks/judgmentChecks.js +70 -8
- package/dist/checks/projectPaths.d.ts +16 -0
- package/dist/checks/projectPaths.js +18 -0
- package/dist/checks/testCommands.d.ts +23 -0
- package/dist/checks/testCommands.js +32 -0
- package/dist/cli.js +3 -0
- package/dist/report/generateReport.js +60 -11
- package/dist/types.d.ts +71 -0
- package/dist/types.js +22 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,32 @@ export interface TranscriptToolResultEvent {
|
|
|
26
26
|
}
|
|
27
27
|
export type TranscriptEvent = TranscriptTextEvent | TranscriptToolUseEvent | TranscriptToolResultEvent;
|
|
28
28
|
export type CheckStatus = "PASS" | "FAIL" | "UNCLEAR";
|
|
29
|
+
/**
|
|
30
|
+
* Five outcomes, not three.
|
|
31
|
+
*
|
|
32
|
+
* From anthropics/claude-code#90542. The failure that started this was not a
|
|
33
|
+
* bad matcher — it was vocabulary reuse. With no API key the tool printed
|
|
34
|
+
* "13 couldn't tell", a phrase this codebase defines as "the tool looked and
|
|
35
|
+
* the evidence was ambiguous", about thirteen rules it had never examined.
|
|
36
|
+
* Once `not_run` is its own outcome that lie has nowhere to sit, however
|
|
37
|
+
* good or bad the matcher is.
|
|
38
|
+
*
|
|
39
|
+
* `not_applicable` earns its place the same way. A session that never
|
|
40
|
+
* touched git cannot have violated a git rule, and calling that "followed"
|
|
41
|
+
* is how an empty transcript produced 2,770 green ticks across the 559-file
|
|
42
|
+
* corpus — every one of them true and none of them meaning anything.
|
|
43
|
+
*/
|
|
44
|
+
export type CheckOutcome = "pass" | "fail"
|
|
45
|
+
/** It looked, and the evidence did not settle it. */
|
|
46
|
+
| "inconclusive"
|
|
47
|
+
/** No check happened: no key, an error, no ratified reading. */
|
|
48
|
+
| "not_run"
|
|
49
|
+
/** The trigger never fired, so there was nothing to judge. */
|
|
50
|
+
| "not_applicable";
|
|
51
|
+
/** How a verdict was reached. A verdict with no method is a verdict with no standing. */
|
|
52
|
+
export type CheckMethod = "text_scan" | "file_events" | "git_events" | "code_content" | "edit_test_pairing" | "claim_vs_evidence" | "model_judgment"
|
|
53
|
+
/** Nothing ran. */
|
|
54
|
+
| "none";
|
|
29
55
|
export interface CheckResult {
|
|
30
56
|
ruleId: string;
|
|
31
57
|
ruleTitle: string;
|
|
@@ -48,4 +74,49 @@ export interface CheckResult {
|
|
|
48
74
|
* not blur them.
|
|
49
75
|
*/
|
|
50
76
|
needsHuman?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The outcome in the five-value vocabulary. Optional while the checkers
|
|
79
|
+
* are migrated one at a time; `status` remains the fallback.
|
|
80
|
+
*/
|
|
81
|
+
outcome?: CheckOutcome;
|
|
82
|
+
/** How this verdict was reached. */
|
|
83
|
+
method?: CheckMethod;
|
|
84
|
+
/**
|
|
85
|
+
* What this method is ALLOWED to claim.
|
|
86
|
+
*
|
|
87
|
+
* A text scan may say "no occurrence of these spellings in this scope".
|
|
88
|
+
* It may not say "the act did not happen" — that PASS shipped for six
|
|
89
|
+
* versions and passed a session that ran `git push -f`. The ceiling
|
|
90
|
+
* travels with the verdict so the report cannot overclaim on its behalf.
|
|
91
|
+
*/
|
|
92
|
+
ceiling?: string;
|
|
93
|
+
/** Why an inconclusive or not_run outcome came out that way, e.g. scope_incomplete. */
|
|
94
|
+
reason?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Set when the rule's direction was inferred rather than read from an
|
|
97
|
+
* explicit signal word — a bare imperative like "Use `npm`" taken as a
|
|
98
|
+
* requirement.
|
|
99
|
+
*
|
|
100
|
+
* Named on the verdict so a measurement can split inferred rows from
|
|
101
|
+
* explicit ones and settle whether the leftover is coverage or noise,
|
|
102
|
+
* rather than the question being argued. Suggested on
|
|
103
|
+
* anthropics/claude-code#90542.
|
|
104
|
+
*/
|
|
105
|
+
polarityInferred?: boolean;
|
|
51
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* A FAIL may only be constructed from a forbidding rule.
|
|
109
|
+
*
|
|
110
|
+
* This is the "cannot accuse" property as a compile-time invariant rather
|
|
111
|
+
* than a convention. It held by inspection — every `status: "FAIL"` sat
|
|
112
|
+
* inside a `polarity === "forbid"` branch — and inspection is exactly what
|
|
113
|
+
* stops holding the day someone adds a require-FAIL path. Passing the
|
|
114
|
+
* polarity in means a require branch cannot call this: `"require"` is not
|
|
115
|
+
* assignable to `"forbid"`, and the build fails rather than a user being
|
|
116
|
+
* accused of not doing something the tool guessed they had to do.
|
|
117
|
+
*/
|
|
118
|
+
export declare function violation(rule: {
|
|
119
|
+
id: string;
|
|
120
|
+
title: string;
|
|
121
|
+
source: "global" | "project";
|
|
122
|
+
}, polarity: "forbid", evidence: string, extra?: Partial<CheckResult>): CheckResult;
|
package/dist/types.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A FAIL may only be constructed from a forbidding rule.
|
|
3
|
+
*
|
|
4
|
+
* This is the "cannot accuse" property as a compile-time invariant rather
|
|
5
|
+
* than a convention. It held by inspection — every `status: "FAIL"` sat
|
|
6
|
+
* inside a `polarity === "forbid"` branch — and inspection is exactly what
|
|
7
|
+
* stops holding the day someone adds a require-FAIL path. Passing the
|
|
8
|
+
* polarity in means a require branch cannot call this: `"require"` is not
|
|
9
|
+
* assignable to `"forbid"`, and the build fails rather than a user being
|
|
10
|
+
* accused of not doing something the tool guessed they had to do.
|
|
11
|
+
*/
|
|
12
|
+
export function violation(rule, polarity, evidence, extra = {}) {
|
|
13
|
+
return {
|
|
14
|
+
ruleId: rule.id,
|
|
15
|
+
ruleTitle: rule.title,
|
|
16
|
+
ruleSource: rule.source,
|
|
17
|
+
status: "FAIL",
|
|
18
|
+
outcome: "fail",
|
|
19
|
+
evidence,
|
|
20
|
+
...extra,
|
|
21
|
+
};
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulereceipt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"description": "Checks whether a Claude Code session actually followed your CLAUDE.md / AGENTS.md rules, with evidence.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@anthropic-ai/sdk": "^0.32.0",
|
|
50
50
|
"commander": "^15.0.0",
|
|
51
|
-
"nodemailer": "^9.
|
|
51
|
+
"nodemailer": "^9.1.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.4.0",
|