@csark0812/skeleton 2.0.0 → 3.0.0
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 +7 -8
- package/dist/audit/config/types.d.ts +1 -8
- package/dist/audit/core/review-deps.d.ts +16 -0
- package/dist/audit/rules/index.d.ts +1 -1
- package/dist/audit/rules/review-deps.d.ts +9 -0
- package/dist/cli.js +657 -753
- package/dist/result-types.d.ts +0 -38
- package/package.json +1 -1
- package/schemas/config.schema.json +1 -12
- package/schemas/result.schema.json +4 -110
- package/templates/skeleton-init/skeleton.toml +1 -1
- package/dist/audit/core/code-fit.d.ts +0 -35
- package/dist/audit/rules/code-fit.d.ts +0 -13
package/dist/result-types.d.ts
CHANGED
|
@@ -32,41 +32,3 @@ export interface AuditResult {
|
|
|
32
32
|
reviewProof: ReviewProofResult;
|
|
33
33
|
successSuffix?: string;
|
|
34
34
|
}
|
|
35
|
-
export interface ValidateClassificationResult {
|
|
36
|
-
docs: string[];
|
|
37
|
-
code: string[];
|
|
38
|
-
skills: string[];
|
|
39
|
-
shell: string[];
|
|
40
|
-
json: string[];
|
|
41
|
-
policy: string[];
|
|
42
|
-
skipped: string[];
|
|
43
|
-
foreignSkills: string[];
|
|
44
|
-
missing: string[];
|
|
45
|
-
orphanPolicies: string[];
|
|
46
|
-
}
|
|
47
|
-
export type DocumentImpactReason = {
|
|
48
|
-
kind: "changed-document";
|
|
49
|
-
} | {
|
|
50
|
-
kind: "changed-code-target";
|
|
51
|
-
target: string;
|
|
52
|
-
};
|
|
53
|
-
export interface ImpactedDocument {
|
|
54
|
-
path: string;
|
|
55
|
-
codeTargets: string[];
|
|
56
|
-
reasons: DocumentImpactReason[];
|
|
57
|
-
}
|
|
58
|
-
export interface ValidateChangedResult {
|
|
59
|
-
schemaVersion: 1;
|
|
60
|
-
command: "validate-changed";
|
|
61
|
-
ok: boolean;
|
|
62
|
-
exitCode: 0 | 1;
|
|
63
|
-
input: {
|
|
64
|
-
paths: string[];
|
|
65
|
-
staged: boolean;
|
|
66
|
-
base?: string;
|
|
67
|
-
};
|
|
68
|
-
classification: ValidateClassificationResult;
|
|
69
|
-
impactedDocuments: ImpactedDocument[];
|
|
70
|
-
audits: AuditResult[];
|
|
71
|
-
diagnostics: Issue[];
|
|
72
|
-
}
|
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"docsLint": {
|
|
48
48
|
"type": "object",
|
|
49
49
|
"additionalProperties": false,
|
|
50
|
-
"description": "Near-duplicate
|
|
50
|
+
"description": "Near-duplicate and SSOT-summary lint tunables",
|
|
51
51
|
"properties": {
|
|
52
52
|
"nearDuplicateThreshold": {
|
|
53
53
|
"type": "number",
|
|
@@ -85,17 +85,6 @@
|
|
|
85
85
|
"type": "array",
|
|
86
86
|
"items": { "type": "string", "minLength": 1 },
|
|
87
87
|
"description": "Globs excluded from near-dupe / duplicate-SSOT"
|
|
88
|
-
},
|
|
89
|
-
"codeFitOverlapMin": {
|
|
90
|
-
"type": "number",
|
|
91
|
-
"minimum": 0,
|
|
92
|
-
"maximum": 1,
|
|
93
|
-
"description": "Min fraction of doc tokens that must also appear as code identifiers (default 0.03)"
|
|
94
|
-
},
|
|
95
|
-
"codeFitSurfaceCap": {
|
|
96
|
-
"type": "integer",
|
|
97
|
-
"minimum": 1,
|
|
98
|
-
"description": "Max auto-extracted surface names before surface= is required (default 25)"
|
|
99
88
|
}
|
|
100
89
|
}
|
|
101
90
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://github.com/csark0812/skeleton/schemas/result.schema.json",
|
|
4
|
-
"title": "Skeleton
|
|
5
|
-
"
|
|
4
|
+
"title": "Skeleton audit result",
|
|
5
|
+
"$ref": "#/$defs/auditResult",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"issue": {
|
|
8
8
|
"type": "object",
|
|
@@ -73,10 +73,7 @@
|
|
|
73
73
|
"warnings": { "type": "integer", "minimum": 0 }
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
"diagnostics": {
|
|
77
|
-
"type": "array",
|
|
78
|
-
"items": { "$ref": "#/$defs/issue" }
|
|
79
|
-
},
|
|
76
|
+
"diagnostics": { "type": "array", "items": { "$ref": "#/$defs/issue" } },
|
|
80
77
|
"catalog": {
|
|
81
78
|
"type": "object",
|
|
82
79
|
"additionalProperties": false,
|
|
@@ -93,115 +90,12 @@
|
|
|
93
90
|
"required": ["mode", "status"],
|
|
94
91
|
"properties": {
|
|
95
92
|
"mode": { "enum": ["date", "hash"] },
|
|
96
|
-
"status": {
|
|
97
|
-
"enum": ["not-enabled", "not-checked", "valid", "invalid"]
|
|
98
|
-
},
|
|
93
|
+
"status": { "enum": ["not-enabled", "not-checked", "valid", "invalid"] },
|
|
99
94
|
"lockfile": { "type": "string" }
|
|
100
95
|
}
|
|
101
96
|
},
|
|
102
97
|
"successSuffix": { "type": "string" }
|
|
103
98
|
}
|
|
104
|
-
},
|
|
105
|
-
"classification": {
|
|
106
|
-
"type": "object",
|
|
107
|
-
"additionalProperties": false,
|
|
108
|
-
"required": [
|
|
109
|
-
"docs",
|
|
110
|
-
"code",
|
|
111
|
-
"skills",
|
|
112
|
-
"shell",
|
|
113
|
-
"json",
|
|
114
|
-
"policy",
|
|
115
|
-
"skipped",
|
|
116
|
-
"foreignSkills",
|
|
117
|
-
"missing",
|
|
118
|
-
"orphanPolicies"
|
|
119
|
-
],
|
|
120
|
-
"properties": {
|
|
121
|
-
"docs": { "type": "array", "items": { "type": "string" } },
|
|
122
|
-
"code": { "type": "array", "items": { "type": "string" } },
|
|
123
|
-
"skills": { "type": "array", "items": { "type": "string" } },
|
|
124
|
-
"shell": { "type": "array", "items": { "type": "string" } },
|
|
125
|
-
"json": { "type": "array", "items": { "type": "string" } },
|
|
126
|
-
"policy": { "type": "array", "items": { "type": "string" } },
|
|
127
|
-
"skipped": { "type": "array", "items": { "type": "string" } },
|
|
128
|
-
"foreignSkills": { "type": "array", "items": { "type": "string" } },
|
|
129
|
-
"missing": { "type": "array", "items": { "type": "string" } },
|
|
130
|
-
"orphanPolicies": { "type": "array", "items": { "type": "string" } }
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"impactReason": {
|
|
134
|
-
"oneOf": [
|
|
135
|
-
{
|
|
136
|
-
"type": "object",
|
|
137
|
-
"additionalProperties": false,
|
|
138
|
-
"required": ["kind"],
|
|
139
|
-
"properties": { "kind": { "const": "changed-document" } }
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"type": "object",
|
|
143
|
-
"additionalProperties": false,
|
|
144
|
-
"required": ["kind", "target"],
|
|
145
|
-
"properties": {
|
|
146
|
-
"kind": { "const": "changed-code-target" },
|
|
147
|
-
"target": { "type": "string" }
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
},
|
|
152
|
-
"impactedDocument": {
|
|
153
|
-
"type": "object",
|
|
154
|
-
"additionalProperties": false,
|
|
155
|
-
"required": ["path", "codeTargets", "reasons"],
|
|
156
|
-
"properties": {
|
|
157
|
-
"path": { "type": "string" },
|
|
158
|
-
"codeTargets": { "type": "array", "items": { "type": "string" } },
|
|
159
|
-
"reasons": { "type": "array", "items": { "$ref": "#/$defs/impactReason" } }
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
"validateChangedResult": {
|
|
163
|
-
"type": "object",
|
|
164
|
-
"additionalProperties": false,
|
|
165
|
-
"required": [
|
|
166
|
-
"schemaVersion",
|
|
167
|
-
"command",
|
|
168
|
-
"ok",
|
|
169
|
-
"exitCode",
|
|
170
|
-
"input",
|
|
171
|
-
"classification",
|
|
172
|
-
"impactedDocuments",
|
|
173
|
-
"audits",
|
|
174
|
-
"diagnostics"
|
|
175
|
-
],
|
|
176
|
-
"properties": {
|
|
177
|
-
"schemaVersion": { "const": 1 },
|
|
178
|
-
"command": { "const": "validate-changed" },
|
|
179
|
-
"ok": { "type": "boolean" },
|
|
180
|
-
"exitCode": { "enum": [0, 1] },
|
|
181
|
-
"input": {
|
|
182
|
-
"type": "object",
|
|
183
|
-
"additionalProperties": false,
|
|
184
|
-
"required": ["paths", "staged"],
|
|
185
|
-
"properties": {
|
|
186
|
-
"paths": { "type": "array", "items": { "type": "string" } },
|
|
187
|
-
"staged": { "type": "boolean" },
|
|
188
|
-
"base": { "type": "string", "minLength": 1 }
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
"classification": { "$ref": "#/$defs/classification" },
|
|
192
|
-
"impactedDocuments": {
|
|
193
|
-
"type": "array",
|
|
194
|
-
"items": { "$ref": "#/$defs/impactedDocument" }
|
|
195
|
-
},
|
|
196
|
-
"audits": {
|
|
197
|
-
"type": "array",
|
|
198
|
-
"items": { "$ref": "#/$defs/auditResult" }
|
|
199
|
-
},
|
|
200
|
-
"diagnostics": {
|
|
201
|
-
"type": "array",
|
|
202
|
-
"items": { "$ref": "#/$defs/issue" }
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
99
|
}
|
|
206
100
|
}
|
|
207
101
|
}
|
|
@@ -16,7 +16,7 @@ exclude = [
|
|
|
16
16
|
paths = []
|
|
17
17
|
|
|
18
18
|
# Optional but recommended: make review claims verifiable against exact document
|
|
19
|
-
# and
|
|
19
|
+
# and review-dependency bytes. Commit the generated lockfile.
|
|
20
20
|
# [reviewProof]
|
|
21
21
|
# mode = "hash"
|
|
22
22
|
# lockfile = ".skeleton/review-lock.json"
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Docs↔code surface fit (no LLM): opt-in markers, public-name coverage, identifier overlap.
|
|
3
|
-
*/
|
|
4
|
-
export declare const DEFAULT_CODE_FIT_OVERLAP_MIN = 0.03;
|
|
5
|
-
export declare const DEFAULT_CODE_FIT_SURFACE_CAP = 25;
|
|
6
|
-
export interface CodeFitMarker {
|
|
7
|
-
targets: string[];
|
|
8
|
-
surface: string[] | null;
|
|
9
|
-
raw: string;
|
|
10
|
-
}
|
|
11
|
-
export interface CodeFitOptions {
|
|
12
|
-
overlapMin?: number;
|
|
13
|
-
surfaceCap?: number;
|
|
14
|
-
root: string;
|
|
15
|
-
}
|
|
16
|
-
export interface CodeFitIssue {
|
|
17
|
-
path: string;
|
|
18
|
-
message: string;
|
|
19
|
-
link?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Parse all code-fit HTML comment markers in a markdown body (fences + inline code stripped). */
|
|
22
|
-
export declare function parseCodeFitMarkers(content: string): CodeFitMarker[];
|
|
23
|
-
/** Strip // and /* *\/ comments and string literals for identifier harvest. */
|
|
24
|
-
export declare function stripCodeNoise(source: string): string;
|
|
25
|
-
/** Auto-extract public-ish names: export forms + case "…" dispatch labels. */
|
|
26
|
-
export declare function extractPublicSurface(source: string): string[];
|
|
27
|
-
/** Identifier tokens from source (for lexical overlap). */
|
|
28
|
-
export declare function codeIdentifiers(source: string): string[];
|
|
29
|
-
/**
|
|
30
|
-
* Fraction of unique doc content tokens that also appear as identifiers in the
|
|
31
|
-
* code file (doc grounded in module vocabulary). Separate from name coverage.
|
|
32
|
-
*/
|
|
33
|
-
export declare function identifierOverlap(docContent: string, codeSource: string): number;
|
|
34
|
-
/** Evaluate one markdown doc's code-fit markers. */
|
|
35
|
-
export declare function evaluateCodeFitDoc(docPath: string, docContent: string, options: CodeFitOptions): CodeFitIssue[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { AuditContext } from "../core/context.ts";
|
|
2
|
-
import { type Issue } from "../core/report.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Docs↔code surface fit. Always discovers marked docs across the full scan
|
|
5
|
-
* perimeter (ignores path-filtered ctx.files) so code drift is still caught.
|
|
6
|
-
*/
|
|
7
|
-
export declare function runCodeFitRule(ctx: AuditContext): Issue[];
|
|
8
|
-
/** Path-scoped suite membership, but alwaysRun so --paths does not skip it. */
|
|
9
|
-
export declare const codeFitRule: {
|
|
10
|
-
id: string;
|
|
11
|
-
alwaysRun: boolean;
|
|
12
|
-
run: typeof runCodeFitRule;
|
|
13
|
-
};
|