@suss/checker-intent 0.0.2 → 0.1.1
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 +8 -8
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ fails to satisfy what the team declared.
|
|
|
6
6
|
## What this package is
|
|
7
7
|
|
|
8
8
|
The intent half of suss's checking, separate from `@suss/checker` (the
|
|
9
|
-
|
|
9
|
+
behavioral peer checker) by design. The inputs differ (`IntentSummary`
|
|
10
10
|
(from `@suss/contract-intent`) on one side, `BehavioralSummary` on the
|
|
11
|
-
other
|
|
11
|
+
other), and so does the output: an `IntentFinding` is one-sided coverage
|
|
12
12
|
("the team declared X; does the code do it?"), not a symmetric
|
|
13
13
|
provider↔consumer mismatch.
|
|
14
14
|
|
|
@@ -21,20 +21,20 @@ const findings = checkIntentAgreement(intentSummaries, codeSummaries);
|
|
|
21
21
|
For each boundary intent, it pairs against the code summaries sharing the
|
|
22
22
|
same boundary key and emits:
|
|
23
23
|
|
|
24
|
-
- `unimplementedBoundary
|
|
25
|
-
- `uncoveredOutcome
|
|
26
|
-
- `outcomeShapeMismatch
|
|
27
|
-
- `undeclaredOutcome
|
|
24
|
+
- `unimplementedBoundary`: the intent declares a boundary no code produces.
|
|
25
|
+
- `uncoveredOutcome`: a declared outcome (response / return / throw) the code never produces.
|
|
26
|
+
- `outcomeShapeMismatch`: a matched outcome whose body shape disagrees with intent.
|
|
27
|
+
- `undeclaredOutcome`: code produces a REST status the intent doesn't declare (info; intent under-specifies).
|
|
28
28
|
|
|
29
29
|
v0 checks system intent (`kind: boundary`). PRD outcome intent
|
|
30
|
-
(`kind: prd`)
|
|
30
|
+
(`kind: prd`), scenario and link coverage, is a separate pass.
|
|
31
31
|
|
|
32
32
|
## Where it sits in suss
|
|
33
33
|
|
|
34
34
|
Depends on `@suss/intent-ir` (intent shapes + `IntentFinding`),
|
|
35
35
|
`@suss/behavioral-ir` (code summaries), and `@suss/ir-core` for the
|
|
36
36
|
shared comparison primitives (`boundaryKey`, `bodyShapesMatch`) it must
|
|
37
|
-
agree on with the
|
|
37
|
+
agree on with the behavioral checker. It does **not** depend on
|
|
38
38
|
`@suss/checker`. The full design is in
|
|
39
39
|
[`docs/internal/proposals/intent-specs.md`](../../docs/internal/proposals/intent-specs.md).
|
|
40
40
|
|
package/dist/index.cjs
CHANGED
|
@@ -111,7 +111,7 @@ function checkBoundaryIntent(intent, codeByBoundary) {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
function codeRef(impl) {
|
|
114
|
-
return
|
|
114
|
+
return (0, import_behavioral_ir.summaryRef)(impl);
|
|
115
115
|
}
|
|
116
116
|
function checkPrdCoverage(prd, boundaryByName) {
|
|
117
117
|
const findings = [];
|
|
@@ -245,7 +245,7 @@ function applyIntentSuppressions(findings, rules, opts = {}) {
|
|
|
245
245
|
findings,
|
|
246
246
|
rules,
|
|
247
247
|
(rule, finding) => {
|
|
248
|
-
if (rule.consumer !== void 0) {
|
|
248
|
+
if (rule.consumer !== void 0 || rule.provider !== void 0) {
|
|
249
249
|
return false;
|
|
250
250
|
}
|
|
251
251
|
return rule.boundary === void 0 || (0, import_ir_core.ruleBoundaryMatchesKey)(rule.boundary, finding.boundary);
|
package/dist/index.d.cts
CHANGED
|
@@ -75,8 +75,8 @@ declare function checkIntentAgreement(intents: IntentSummary[], code: Behavioral
|
|
|
75
75
|
* behavioural checker's `applySuppressions`). Rule discriminators map
|
|
76
76
|
* as: `kind` → the intent finding kind; `boundary` → the finding's
|
|
77
77
|
* boundary key (exact for `fn:` / `gql:` keys, path-normalized for
|
|
78
|
-
* REST). A rule that specifies `consumer` never matches
|
|
79
|
-
* finding —
|
|
78
|
+
* REST). A rule that specifies `consumer` or `provider` never matches
|
|
79
|
+
* an intent finding — it has neither side.
|
|
80
80
|
*/
|
|
81
81
|
declare function applyIntentSuppressions(findings: IntentFinding[], rules: SuppressionRule[], opts?: {
|
|
82
82
|
keepHidden?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -75,8 +75,8 @@ declare function checkIntentAgreement(intents: IntentSummary[], code: Behavioral
|
|
|
75
75
|
* behavioural checker's `applySuppressions`). Rule discriminators map
|
|
76
76
|
* as: `kind` → the intent finding kind; `boundary` → the finding's
|
|
77
77
|
* boundary key (exact for `fn:` / `gql:` keys, path-normalized for
|
|
78
|
-
* REST). A rule that specifies `consumer` never matches
|
|
79
|
-
* finding —
|
|
78
|
+
* REST). A rule that specifies `consumer` or `provider` never matches
|
|
79
|
+
* an intent finding — it has neither side.
|
|
80
80
|
*/
|
|
81
81
|
declare function applyIntentSuppressions(findings: IntentFinding[], rules: SuppressionRule[], opts?: {
|
|
82
82
|
keepHidden?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { BOUNDARY_ROLE } from "@suss/behavioral-ir";
|
|
2
|
+
import { BOUNDARY_ROLE, summaryRef } from "@suss/behavioral-ir";
|
|
3
3
|
import {
|
|
4
4
|
applySuppressionsToFindings,
|
|
5
5
|
bodyShapesMatch,
|
|
@@ -91,7 +91,7 @@ function checkBoundaryIntent(intent, codeByBoundary) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
function codeRef(impl) {
|
|
94
|
-
return
|
|
94
|
+
return summaryRef(impl);
|
|
95
95
|
}
|
|
96
96
|
function checkPrdCoverage(prd, boundaryByName) {
|
|
97
97
|
const findings = [];
|
|
@@ -225,7 +225,7 @@ function applyIntentSuppressions(findings, rules, opts = {}) {
|
|
|
225
225
|
findings,
|
|
226
226
|
rules,
|
|
227
227
|
(rule, finding) => {
|
|
228
|
-
if (rule.consumer !== void 0) {
|
|
228
|
+
if (rule.consumer !== void 0 || rule.provider !== void 0) {
|
|
229
229
|
return false;
|
|
230
230
|
}
|
|
231
231
|
return rule.boundary === void 0 || ruleBoundaryMatchesKey(rule.boundary, finding.boundary);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/checker-intent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pair team-authored intent (IntentSummary) against derived code (BehavioralSummary) and report where they diverge.",
|
|
6
6
|
"keywords": [
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"zod": "^4.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@suss/behavioral-ir": "0.
|
|
51
|
-
"@suss/intent-ir": "0.
|
|
52
|
-
"@suss/ir-core": "0.
|
|
50
|
+
"@suss/behavioral-ir": "0.1.1",
|
|
51
|
+
"@suss/intent-ir": "0.1.1",
|
|
52
|
+
"@suss/ir-core": "0.1.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"tsup": "*",
|