@selfauth/conformance 0.1.0 → 0.2.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.
@@ -0,0 +1,118 @@
1
+ import { type Requirement } from "@selfauth/spec";
2
+ import { z } from "zod";
3
+ import type { DriverFactory } from "./runner/driver.js";
4
+ import { type ConformanceCase, type VerificationEntry, LEVELS } from "./schema.js";
5
+ /** Compliance levels, lowest first (specs/CONFORMANCE.md, "Compliance levels"). */
6
+ export type Level = (typeof LEVELS)[number];
7
+ export declare const LEVEL_TITLES: Record<Level, string>;
8
+ /**
9
+ * The behaviour areas the plan names (Phase 9). Every requirement belongs to exactly one,
10
+ * by ID prefix, so each area reports how many of its mandatory requirements are covered.
11
+ */
12
+ export interface Category {
13
+ id: string;
14
+ title: string;
15
+ prefixes: string[];
16
+ }
17
+ export declare const CATEGORIES: readonly Category[];
18
+ export declare const requirementPrefix: (id: string) => string;
19
+ export declare const categoryOf: (id: string) => Category | undefined;
20
+ export interface CaseResult {
21
+ id: string;
22
+ title: string;
23
+ category: string;
24
+ level: Level;
25
+ passed: boolean;
26
+ error?: string;
27
+ }
28
+ /**
29
+ * Runs every case against a driver, at most `concurrency` at a time (each case may open its own
30
+ * database connections). Never throws: a failing case is a result. Results keep the case order.
31
+ */
32
+ export declare function runSuite(cases: readonly ConformanceCase[], createDriver: DriverFactory, options?: {
33
+ concurrency?: number;
34
+ }): Promise<CaseResult[]>;
35
+ export declare const signoffSchema: z.ZodObject<{
36
+ requirement: z.ZodString;
37
+ method: z.ZodEnum<{
38
+ "schema-test": "schema-test";
39
+ "adapter-test": "adapter-test";
40
+ "code-review": "code-review";
41
+ documentation: "documentation";
42
+ "static-analysis": "static-analysis";
43
+ "migration-test": "migration-test";
44
+ }>;
45
+ evidence: z.ZodArray<z.ZodString>;
46
+ finding: z.ZodString;
47
+ }, z.core.$strict>;
48
+ export type Signoff = z.infer<typeof signoffSchema>;
49
+ export declare const adapterRecordSchema: z.ZodObject<{
50
+ $comment: z.ZodOptional<z.ZodString>;
51
+ adapter: z.ZodString;
52
+ title: z.ZodString;
53
+ specVersion: z.ZodString;
54
+ claims: z.ZodRecord<z.ZodString, z.ZodEnum<{
55
+ core: "core";
56
+ authorization: "authorization";
57
+ production: "production";
58
+ }>>;
59
+ supports: z.ZodArray<z.ZodObject<{
60
+ kind: z.ZodEnum<{
61
+ database: "database";
62
+ backend: "backend";
63
+ frontend: "frontend";
64
+ }>;
65
+ id: z.ZodString;
66
+ title: z.ZodString;
67
+ store: z.ZodOptional<z.ZodString>;
68
+ }, z.core.$strict>>;
69
+ independentAudit: z.ZodBoolean;
70
+ limitations: z.ZodArray<z.ZodString>;
71
+ signoffs: z.ZodArray<z.ZodObject<{
72
+ requirement: z.ZodString;
73
+ method: z.ZodEnum<{
74
+ "schema-test": "schema-test";
75
+ "adapter-test": "adapter-test";
76
+ "code-review": "code-review";
77
+ documentation: "documentation";
78
+ "static-analysis": "static-analysis";
79
+ "migration-test": "migration-test";
80
+ }>;
81
+ evidence: z.ZodArray<z.ZodString>;
82
+ finding: z.ZodString;
83
+ }, z.core.$strict>>;
84
+ }, z.core.$strict>;
85
+ export type AdapterRecord = z.infer<typeof adapterRecordSchema>;
86
+ export declare function loadAdapterRecord(file: string): Promise<AdapterRecord>;
87
+ export interface LevelStatus {
88
+ met: boolean;
89
+ /** What is still missing, in the order to fix it. */
90
+ missing: string[];
91
+ }
92
+ export interface LevelReport {
93
+ levels: Record<Level, LevelStatus>;
94
+ /** Highest level met, or `none`. */
95
+ achieved: Level | "none";
96
+ }
97
+ /**
98
+ * A level is met when its cases pass and its verification items have a recorded sign-off.
99
+ * Higher levels include everything below: core, then authorization, then production (all cases
100
+ * plus every item, including reviews, documentation and static analysis).
101
+ */
102
+ export declare function evaluateLevels(input: {
103
+ cases: readonly ConformanceCase[];
104
+ results: readonly CaseResult[];
105
+ verification: readonly VerificationEntry[];
106
+ signoffs: readonly Signoff[];
107
+ }): LevelReport;
108
+ /** Problems with the sign-offs themselves; empty when the record is trustworthy. */
109
+ export declare function checkSignoffs(record: AdapterRecord, verification: readonly VerificationEntry[], repositoryRoot: string): string[];
110
+ export interface CategoryCoverage {
111
+ category: Category;
112
+ mandatory: number;
113
+ byCases: number;
114
+ byOtherVerification: number;
115
+ cases: number;
116
+ }
117
+ export declare function categoryCoverage(requirements: readonly Requirement[], cases: readonly ConformanceCase[], verification: readonly VerificationEntry[]): CategoryCoverage[];
118
+ //# sourceMappingURL=compliance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance.d.ts","sourceRoot":"","sources":["../src/compliance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,mFAAmF;AACnF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAI9C,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EA+CzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,IAAI,MAAM,KAAG,MAAmC,CAAC;AACnF,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,KAAG,QAAQ,GAAG,SACiB,CAAC;AAErE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;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oF;AACpF,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,SAAS,iBAAiB,EAAE,EAC1C,cAAc,EAAE,MAAM,GACrB,MAAM,EAAE,CAkBV;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,YAAY,EAAE,SAAS,iBAAiB,EAAE,GACzC,gBAAgB,EAAE,CAgBpB"}
@@ -0,0 +1,201 @@
1
+ import { existsSync } from "node:fs";
2
+ import { readFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { isMandatory } from "@selfauth/spec";
5
+ import { z } from "zod";
6
+ import { runCase } from "./runner/run.js";
7
+ import { VERIFICATION_METHODS, LEVELS, } from "./schema.js";
8
+ export const LEVEL_TITLES = {
9
+ core: "Core compliant",
10
+ authorization: "Authorization compliant",
11
+ production: "Production-profile compliant",
12
+ };
13
+ export const CATEGORIES = [
14
+ {
15
+ id: "registration",
16
+ title: "Registration and identity",
17
+ prefixes: [
18
+ "AUTHN-REG",
19
+ "IDENT-ID",
20
+ "IDENT-EMAIL",
21
+ "IDENT-STATE",
22
+ "IDENT-PROFILE",
23
+ "IDENT-DELETE",
24
+ ],
25
+ },
26
+ { id: "login", title: "Login and logout", prefixes: ["AUTHN-LOGIN", "AUTHN-LOGOUT", "AUTHN-ME"] },
27
+ { id: "passwords", title: "Password storage", prefixes: ["SEC-HASH", "SEC-PWPOLICY"] },
28
+ {
29
+ id: "sessions",
30
+ title: "Session expiration and revocation",
31
+ prefixes: ["AUTHN-SESS", "SEC-COOKIE"],
32
+ },
33
+ {
34
+ id: "recovery",
35
+ title: "Password recovery and change",
36
+ prefixes: ["AUTHN-RESET", "AUTHN-PWCHG", "SEC-TOKEN"],
37
+ },
38
+ { id: "verification", title: "Email verification", prefixes: ["AUTHN-VERIFY"] },
39
+ { id: "rbac", title: "RBAC", prefixes: ["AUTHZ-RBAC", "AUTHZ-PERM", "AUTHZ-ADMIN"] },
40
+ {
41
+ id: "enforcement",
42
+ title: "Permission enforcement",
43
+ prefixes: ["AUTHZ-CORE", "AUTHZ-AUDIT"],
44
+ },
45
+ { id: "ownership", title: "Resource ownership", prefixes: ["AUTHZ-RES"] },
46
+ {
47
+ id: "browser",
48
+ title: "CSRF and browser safety",
49
+ prefixes: ["SEC-CSRF", "SEC-CORS", "SEC-REDIRECT", "SEC-HTTP"],
50
+ },
51
+ { id: "rate-limits", title: "Rate limiting", prefixes: ["SEC-RATE"] },
52
+ {
53
+ id: "redaction",
54
+ title: "Secret and log redaction",
55
+ prefixes: ["SEC-SECRET", "SEC-LOG", "SEC-AUDIT"],
56
+ },
57
+ { id: "errors", title: "Errors and enumeration safety", prefixes: ["ERR-FORMAT", "SEC-ENUM"] },
58
+ { id: "migrations", title: "Migration safety", prefixes: ["DATA-MODEL"] },
59
+ { id: "config", title: "Configuration", prefixes: ["CONF-FILE"] },
60
+ ];
61
+ export const requirementPrefix = (id) => id.replace(/-\d{3}$/, "");
62
+ export const categoryOf = (id) => CATEGORIES.find((c) => c.prefixes.includes(requirementPrefix(id)));
63
+ /**
64
+ * Runs every case against a driver, at most `concurrency` at a time (each case may open its own
65
+ * database connections). Never throws: a failing case is a result. Results keep the case order.
66
+ */
67
+ export async function runSuite(cases, createDriver, options = {}) {
68
+ const results = new Array(cases.length);
69
+ let next = 0;
70
+ const worker = async () => {
71
+ for (let i = next++; i < cases.length; i = next++) {
72
+ const c = cases[i];
73
+ const base = { id: c.id, title: c.title, category: c.category, level: c.level };
74
+ try {
75
+ await runCase(c, createDriver);
76
+ results[i] = { ...base, passed: true };
77
+ }
78
+ catch (error) {
79
+ results[i] = { ...base, passed: false, error: error.message };
80
+ }
81
+ }
82
+ };
83
+ const workers = Math.max(1, Math.min(options.concurrency ?? 4, cases.length));
84
+ await Promise.all(Array.from({ length: workers }, worker));
85
+ return results;
86
+ }
87
+ // ---------------------------------------------------------------------------------------------
88
+ // Adapter record: what an adapter claims and the evidence behind every non-case requirement.
89
+ // ---------------------------------------------------------------------------------------------
90
+ export const signoffSchema = z.strictObject({
91
+ requirement: z.string(),
92
+ method: z.enum(VERIFICATION_METHODS),
93
+ /** Repository paths (tests, source, docs, workflows) that carry out or document the check. */
94
+ evidence: z.array(z.string().min(1)).min(1),
95
+ /** What was checked. Required: a sign-off without a finding is not a review. */
96
+ finding: z.string().min(20),
97
+ });
98
+ export const adapterRecordSchema = z.strictObject({
99
+ $comment: z.string().optional(),
100
+ adapter: z.string(),
101
+ title: z.string(),
102
+ specVersion: z.string(),
103
+ /** Level each store must reach in CI; the test fails if a run measures anything else. */
104
+ claims: z.record(z.string(), z.enum(LEVELS)),
105
+ supports: z.array(z.strictObject({
106
+ kind: z.enum(["backend", "database", "frontend"]),
107
+ id: z.string(),
108
+ title: z.string(),
109
+ store: z.string().optional(),
110
+ })),
111
+ /** True only when someone outside the project has audited the code. */
112
+ independentAudit: z.boolean(),
113
+ limitations: z.array(z.string()),
114
+ signoffs: z.array(signoffSchema),
115
+ });
116
+ export async function loadAdapterRecord(file) {
117
+ return adapterRecordSchema.parse(JSON.parse(await readFile(file, "utf8")));
118
+ }
119
+ /** Methods an automated test carries out; the rest need a person to review. */
120
+ const AUTOMATED = new Set(["adapter-test", "schema-test", "migration-test"]);
121
+ /** `AUTHZ-*` items gate the authorization level; everything else gates core. */
122
+ const itemLevel = (requirement) => requirement.startsWith("AUTHZ-") ? "authorization" : "core";
123
+ /**
124
+ * A level is met when its cases pass and its verification items have a recorded sign-off.
125
+ * Higher levels include everything below: core, then authorization, then production (all cases
126
+ * plus every item, including reviews, documentation and static analysis).
127
+ */
128
+ export function evaluateLevels(input) {
129
+ const result = new Map(input.results.map((r) => [r.id, r]));
130
+ const signed = new Set(input.signoffs.map((s) => `${s.requirement}:${s.method}`));
131
+ const caseProblems = (level) => input.cases
132
+ .filter((c) => c.level === level)
133
+ .flatMap((c) => {
134
+ const r = result.get(c.id);
135
+ return r?.passed
136
+ ? []
137
+ : [r ? `case ${c.id} fails: ${r.error ?? ""}` : `case ${c.id} not run`];
138
+ });
139
+ const itemProblems = (include) => input.verification.flatMap((v) => v.methods
140
+ .filter((m) => include(v, m) && !signed.has(`${v.requirement}:${m}`))
141
+ .map((m) => `${v.requirement} ${m}: no sign-off`));
142
+ const core = [
143
+ ...caseProblems("core"),
144
+ ...itemProblems((v, m) => AUTOMATED.has(m) && itemLevel(v.requirement) === "core"),
145
+ ];
146
+ const authorization = [
147
+ ...core,
148
+ ...caseProblems("authorization"),
149
+ ...itemProblems((v, m) => AUTOMATED.has(m) && itemLevel(v.requirement) === "authorization"),
150
+ ];
151
+ const production = [
152
+ ...authorization,
153
+ ...caseProblems("production"),
154
+ ...itemProblems((_v, m) => !AUTOMATED.has(m)),
155
+ ];
156
+ const levels = {
157
+ core: { met: core.length === 0, missing: core },
158
+ authorization: { met: authorization.length === 0, missing: authorization },
159
+ production: { met: production.length === 0, missing: production },
160
+ };
161
+ const achieved = LEVELS.filter((l) => levels[l].met).at(-1) ?? "none";
162
+ return { levels, achieved };
163
+ }
164
+ /** Problems with the sign-offs themselves; empty when the record is trustworthy. */
165
+ export function checkSignoffs(record, verification, repositoryRoot) {
166
+ const problems = [];
167
+ const required = new Set(verification.flatMap((v) => v.methods.map((m) => `${v.requirement}:${m}`)));
168
+ const seen = new Set();
169
+ for (const s of record.signoffs) {
170
+ const key = `${s.requirement}:${s.method}`;
171
+ if (!required.has(key))
172
+ problems.push(`${key}: not a verification item`);
173
+ if (seen.has(key))
174
+ problems.push(`${key}: signed off twice`);
175
+ seen.add(key);
176
+ for (const path of s.evidence) {
177
+ if (!existsSync(join(repositoryRoot, path)))
178
+ problems.push(`${key}: evidence '${path}' not found`);
179
+ }
180
+ }
181
+ for (const key of required)
182
+ if (!seen.has(key))
183
+ problems.push(`${key}: no sign-off`);
184
+ return problems;
185
+ }
186
+ export function categoryCoverage(requirements, cases, verification) {
187
+ const verified = new Set(verification.map((v) => v.requirement));
188
+ return CATEGORIES.map((category) => {
189
+ const mandatory = requirements.filter((r) => isMandatory(r) && categoryOf(r.id)?.id === category.id);
190
+ const cased = (id) => cases.some((c) => c.requirements.includes(id));
191
+ return {
192
+ category,
193
+ mandatory: mandatory.length,
194
+ byCases: mandatory.filter((r) => cased(r.id)).length,
195
+ byOtherVerification: mandatory.filter((r) => !cased(r.id) && verified.has(r.id)).length,
196
+ cases: cases.filter((c) => c.requirements.some((id) => categoryOf(id)?.id === category.id))
197
+ .length,
198
+ };
199
+ });
200
+ }
201
+ //# sourceMappingURL=compliance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compliance.js","sourceRoot":"","sources":["../src/compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EACL,oBAAoB,EAGpB,MAAM,GACP,MAAM,aAAa,CAAC;AAIrB,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,IAAI,EAAE,gBAAgB;IACtB,aAAa,EAAE,yBAAyB;IACxC,UAAU,EAAE,8BAA8B;CAC3C,CAAC;AAWF,MAAM,CAAC,MAAM,UAAU,GAAwB;IAC7C;QACE,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,2BAA2B;QAClC,QAAQ,EAAE;YACR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C,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;YACvF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,QAAQ,CAAC,EAAE,CAAC,CAAC;iBACxF,MAAM;SACV,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -4,4 +4,6 @@ export * from "./coverage.js";
4
4
  export * from "./runner/driver.js";
5
5
  export * from "./runner/run.js";
6
6
  export { checkAssertions, resolvePath } from "./runner/assertions.js";
7
+ export * from "./compliance.js";
8
+ export * from "./render.js";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -4,4 +4,6 @@ export * from "./coverage.js";
4
4
  export * from "./runner/driver.js";
5
5
  export * from "./runner/run.js";
6
6
  export { checkAssertions, resolvePath } from "./runner/assertions.js";
7
+ export * from "./compliance.js";
8
+ export * from "./render.js";
7
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type AdapterRecord, type CategoryCoverage } from "./compliance.js";
2
+ import { type ConformanceCase } from "./schema.js";
3
+ export interface ConformanceDocInput {
4
+ record: AdapterRecord;
5
+ cases: readonly ConformanceCase[];
6
+ coverage: readonly CategoryCoverage[];
7
+ /** Tested dependency ranges, read from the reference implementation's package.json files. */
8
+ compatibility: readonly {
9
+ name: string;
10
+ range: string;
11
+ note?: string;
12
+ }[];
13
+ }
14
+ /**
15
+ * docs/conformance.md. Generated, never hand-edited; apps/playground/test/conformance/report.test.ts
16
+ * fails when the committed copy differs (run it with UPDATE_CONFORMANCE_DOC=1 to rewrite it).
17
+ */
18
+ export declare function renderConformanceDoc({ record, cases, coverage, compatibility, }: ConformanceDocInput): string;
19
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,6FAA6F;IAC7F,aAAa,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1E;AAOD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,GACd,EAAE,mBAAmB,GAAG,MAAM,CA4F9B"}
package/dist/render.js ADDED
@@ -0,0 +1,20 @@
1
+ import { LEVEL_TITLES, } from "./compliance.js";
2
+ import {} from "./schema.js";
3
+ /** Escapes backslashes first, then pipes, so a cell cannot end early or swallow the next one. */
4
+ const escape = (text) => text.replace(/\\/g, "\\\\").replace(/\|/g, "\\|");
5
+ const levelCount = (cases, level) => cases.filter((c) => c.level === level).length;
6
+ /**
7
+ * docs/conformance.md. Generated, never hand-edited; apps/playground/test/conformance/report.test.ts
8
+ * fails when the committed copy differs (run it with UPDATE_CONFORMANCE_DOC=1 to rewrite it).
9
+ */
10
+ export function renderConformanceDoc({ record, cases, coverage, compatibility, }) {
11
+ const lines = [];
12
+ const out = (...l) => lines.push(...l);
13
+ out("<!-- Generated by apps/playground/test/conformance/report.test.ts from conformance/adapters/express.json. Do not edit. -->", "", "# Conformance and support matrix", "", `What the SelfAuth ${record.title} is tested against, which compliance level each`, `store reaches, and what is not supported. Specification version: **${record.specVersion}**.`, "", "A generator that runs is not a conformant adapter. A level is claimed only", "when the cases for it pass in CI and every non-case requirement has a recorded", "sign-off with evidence (`conformance/adapters/express.json`).", "", "## Compliance levels", "", "| Level | Needs | Cases |", "| --- | --- | --- |", `| ${LEVEL_TITLES.core} | all core cases pass; every automated check for core requirements (adapter, schema, migration tests) is signed off | ${levelCount(cases, "core")} |`, `| ${LEVEL_TITLES.authorization} | core, plus the authorization cases and the authorization checks | ${levelCount(cases, "authorization")} |`, `| ${LEVEL_TITLES.production} | all cases, plus every review, documentation and static-analysis item signed off | ${levelCount(cases, "production")} |`, "", `The suite has ${cases.length} cases in total.`, "", "## Result", "", "| Store | Published level |", "| --- | --- |", ...Object.entries(record.claims)
14
+ .sort(([a], [b]) => a.localeCompare(b))
15
+ .map(([store, level]) => `| ${store} | ${LEVEL_TITLES[level]} |`), "", record.independentAudit
16
+ ? "The code has been audited by an independent party."
17
+ : "**No independent security audit has been done.** Production-profile status is self-assessed from the sign-offs below. An outside review is required before 1.0.", "", "CI runs the whole suite against the in-memory store and against PostgreSQL, and fails if either measures below its published level.", "", "## Support matrix", "", "| Kind | Supported | Notes |", "| --- | --- | --- |", ...record.supports.map((s) => `| ${s.kind} | \`${s.id}\` | ${s.title}${s.store ? ` (store \`${s.store}\`)` : ""} |`), "", "Not supported yet: see [Known limitations](#known-limitations).", "", "## Version compatibility", "", "| Component | Tested range | Notes |", "| --- | --- | --- |", ...compatibility.map((c) => `| ${c.name} | \`${c.range}\` | ${c.note ?? ""} |`), "", "## Coverage by area", "", "| Area | Mandatory requirements | By cases | By other checks | Cases touching it |", "| --- | ---: | ---: | ---: | ---: |", ...coverage.map((c) => `| ${c.category.title} | ${c.mandatory} | ${c.byCases} | ${c.byOtherVerification} | ${c.cases} |`), "", "Every mandatory requirement is covered by a case or by another check; the build fails otherwise.", "", "## Known limitations", "", ...record.limitations.map((l) => `- ${l}`), "", "## Sign-offs", "", "Requirements proven by something other than a conformance case, and how.", "", "| Requirement | Method | Finding | Evidence |", "| --- | --- | --- | --- |", ...record.signoffs.map((s) => `| ${s.requirement} | ${s.method} | ${escape(s.finding)} | ${s.evidence.map((e) => `\`${e}\``).join(", ")} |`), "", "## Reproduce", "", "```bash", "pnpm build", "pnpm --filter @selfauth/conformance coverage:report", "pnpm --filter @selfauth/playground test # runs every case; set TEST_DATABASE_URL for PostgreSQL", "```", "");
18
+ return lines.join("\n");
19
+ }
20
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAwB,MAAM,aAAa,CAAC;AAUnD,iGAAiG;AACjG,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACnF,MAAM,UAAU,GAAG,CAAC,KAAiC,EAAE,KAAY,EAAE,EAAE,CACrE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,MAAM,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,GACO;IACpB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,GAAG,GAAG,CAAC,GAAG,CAAW,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,GAAG,CACD,4HAA4H,EAC5H,EAAE,EACF,kCAAkC,EAClC,EAAE,EACF,qBAAqB,MAAM,CAAC,KAAK,iDAAiD,EAClF,sEAAsE,MAAM,CAAC,WAAW,KAAK,EAC7F,EAAE,EACF,4EAA4E,EAC5E,gFAAgF,EAChF,+DAA+D,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfauth/conformance",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Language-neutral SelfAuth conformance cases and requirement-coverage tooling.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "zod": "^4.6.7",
44
- "@selfauth/spec": "0.1.0"
44
+ "@selfauth/spec": "0.2.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public",