@getcirrus/space-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.
- package/dist/cli.js +11 -79243
- package/dist/cli.js.map +1 -1
- package/dist/{coverage-zCMup3Nb.js → coverage-cK1NBo-P.js} +13 -8
- package/dist/coverage-cK1NBo-P.js.map +1 -0
- package/dist/{descriptors-YEk3XoDL.js → descriptors-BUCV_BuG.js} +1 -1
- package/dist/{descriptors-YEk3XoDL.js.map → descriptors-BUCV_BuG.js.map} +1 -1
- package/dist/full-CKsHg6ox.js +852 -0
- package/dist/full-CKsHg6ox.js.map +1 -0
- package/dist/full.d.ts +1 -0
- package/dist/full.d.ts.map +1 -1
- package/dist/full.js +2 -2
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/lexicons/MANIFEST.json +4 -4
- package/lexicons/space/defs.json +2 -1
- package/lexicons/space/notifyRepoUpdate.json +2 -1
- package/package.json +8 -6
- package/dist/coverage-zCMup3Nb.js.map +0 -1
- package/dist/full-Bomm2urj.js +0 -12285
- package/dist/full-Bomm2urj.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//#region src/alpha.ts
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* commit. Runners stamp it on every report.
|
|
3
|
+
* The `@atproto/space` release the suite's verifiers and vendored lexicons
|
|
4
|
+
* are calibrated against: the spaces beta. Runners stamp it on every report.
|
|
5
|
+
* The name predates the beta and is kept for compatibility.
|
|
7
6
|
*/
|
|
8
|
-
const ALPHA_BUILD = "0.
|
|
7
|
+
const ALPHA_BUILD = "0.1.0";
|
|
9
8
|
|
|
10
9
|
//#endregion
|
|
11
10
|
//#region src/runner.ts
|
|
@@ -642,7 +641,10 @@ var defs_default$1 = {
|
|
|
642
641
|
"type": "string",
|
|
643
642
|
"format": "tid"
|
|
644
643
|
},
|
|
645
|
-
"data": {
|
|
644
|
+
"data": {
|
|
645
|
+
"type": "bytes",
|
|
646
|
+
"description": "SHA-256 digest of the repo's LtHash state."
|
|
647
|
+
},
|
|
646
648
|
"spaceRev": {
|
|
647
649
|
"type": "string",
|
|
648
650
|
"format": "tid",
|
|
@@ -1549,7 +1551,10 @@ var notifyRepoUpdate_default = {
|
|
|
1549
1551
|
"type": "string",
|
|
1550
1552
|
"format": "tid"
|
|
1551
1553
|
},
|
|
1552
|
-
"data": {
|
|
1554
|
+
"data": {
|
|
1555
|
+
"type": "bytes",
|
|
1556
|
+
"description": "SHA-256 digest of the repo's LtHash state."
|
|
1557
|
+
}
|
|
1553
1558
|
}
|
|
1554
1559
|
}
|
|
1555
1560
|
},
|
|
@@ -2242,4 +2247,4 @@ function coverageReport(catalog, docs = lexicons, exemptions = coverageExemption
|
|
|
2242
2247
|
|
|
2243
2248
|
//#endregion
|
|
2244
2249
|
export { renderReport as a, lexicons as i, coverageReport as n, runChecks as o, coverageRequirements as r, ALPHA_BUILD as s, coverageExemptions as t };
|
|
2245
|
-
//# sourceMappingURL=coverage-
|
|
2250
|
+
//# sourceMappingURL=coverage-cK1NBo-P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-cK1NBo-P.js","names":["logs: string[]","ctx: CheckContext","results: CheckResult[]","checkCtx: CheckContext","id","lines: string[]","lexicons: LexiconDoc[]","space_applyWrites","space_authorizeSpaceSync","space_clearRecords","space_confirmRegistration","space_createRecord","space_createSpace","space_defs","space_deleteRecord","space_deleteSpace","space_exportSpaceMeta","space_getBlob","space_getDelegationToken","space_getLatestCommit","space_getRecord","space_getRepo","space_getSpace","space_importRepo","space_importSpaceMeta","space_listBlobs","space_listRecords","space_listRepoOps","space_listSpaces","space_listWriters","space_notifyCredentialsRevoked","space_notifyRepoUpdate","space_notifySpaceUpdate","space_policy","space_putRecord","space_removeWriter","space_updateSpace","memberspace_defs","memberspace_listMembers","memberspace_member","memberspace_policy","memberspace_putMembers","memberspace_removeMembers","personalspace_policy","managedspace_checkAccess","managedspace_policy","coverageExemptions: CoverageExemption[]","requirements: CoverageRequirement[]","dangling: CoverageReport[\"danglingCitations\"]","exempt: CoverageReport[\"exempt\"]","gaps: CoverageRequirement[]"],"sources":["../src/alpha.ts","../src/runner.ts","../lexicons/space/applyWrites.json","../lexicons/space/authorizeSpaceSync.json","../lexicons/space/clearRecords.json","../lexicons/space/confirmRegistration.json","../lexicons/space/createRecord.json","../lexicons/space/createSpace.json","../lexicons/space/defs.json","../lexicons/space/deleteRecord.json","../lexicons/space/deleteSpace.json","../lexicons/space/exportSpaceMeta.json","../lexicons/space/getBlob.json","../lexicons/space/getDelegationToken.json","../lexicons/space/getLatestCommit.json","../lexicons/space/getRecord.json","../lexicons/space/getRepo.json","../lexicons/space/getSpace.json","../lexicons/space/importRepo.json","../lexicons/space/importSpaceMeta.json","../lexicons/space/listBlobs.json","../lexicons/space/listRecords.json","../lexicons/space/listRepoOps.json","../lexicons/space/listSpaces.json","../lexicons/space/listWriters.json","../lexicons/space/notifyCredentialsRevoked.json","../lexicons/space/notifyRepoUpdate.json","../lexicons/space/notifySpaceUpdate.json","../lexicons/space/policy.json","../lexicons/space/putRecord.json","../lexicons/space/removeWriter.json","../lexicons/space/updateSpace.json","../lexicons/memberspace/defs.json","../lexicons/memberspace/listMembers.json","../lexicons/memberspace/member.json","../lexicons/memberspace/policy.json","../lexicons/memberspace/putMembers.json","../lexicons/memberspace/removeMembers.json","../lexicons/personalspace/policy.json","../lexicons/managedspace/checkAccess.json","../lexicons/managedspace/policy.json","../src/lexicons.ts","../src/coverage.ts"],"sourcesContent":["/**\n * The `@atproto/space` release the suite's verifiers and vendored lexicons\n * are calibrated against: the spaces beta. Runners stamp it on every report.\n * The name predates the beta and is kept for compatibility.\n */\nexport const ALPHA_BUILD = \"0.1.0\";\n","/**\n * The core runner: executes a filtered catalog against one target and\n * produces a report. Transport- and environment-agnostic — the vitest\n * adapter, the CLI and the web checker all call this.\n */\n\nimport type { Check, CheckContext, CheckResult, Target } from \"./model.js\";\nimport type { FilteredCatalog } from \"./registry.js\";\n\nexport interface RunReport {\n\tsuite: { name: string; version: string };\n\t/** The alpha build the suite's verifiers are pinned to. */\n\talphaBuild: string;\n\ttarget: Target;\n\tstartedAt: string;\n\tfinishedAt: string;\n\tresults: CheckResult[];\n\tlogs: string[];\n\tsummary: {\n\t\tpass: number;\n\t\tfail: number;\n\t\tmustFail: number;\n\t\t/**\n\t\t * must-tier checks that errored (threw or timed out). A CI gate must\n\t\t * treat these as failures too: an unreachable or hung target errors\n\t\t * its checks rather than failing them, and must not exit 0.\n\t\t */\n\t\tmustError: number;\n\t\tskipped: number;\n\t\terror: number;\n\t};\n}\n\nexport interface RunOptions {\n\tcatalog: FilteredCatalog;\n\tcontext: Omit<CheckContext, \"state\" | \"log\">;\n\tsuiteVersion: string;\n\talphaBuild: string;\n\t/** Per-check timeout; a hung target must not hang the run. */\n\tcheckTimeoutMs?: number;\n\t/**\n\t * Called with each result as it is determined, in run order — so a UI\n\t * can render progress live instead of waiting for the whole report.\n\t * Skipped results are delivered too (at the end). A throwing callback\n\t * is contained: it must not be able to abort the run.\n\t */\n\tonResult?: (result: CheckResult) => void;\n}\n\nexport async function runChecks(options: RunOptions): Promise<RunReport> {\n\tconst logs: string[] = [];\n\tconst state = new Map<string, unknown>();\n\tconst ctx: CheckContext = {\n\t\t...options.context,\n\t\tstate,\n\t\tlog: (message) => logs.push(message),\n\t};\n\tconst timeoutMs = options.checkTimeoutMs ?? 30_000;\n\tconst startedAt = new Date().toISOString();\n\tconst results: CheckResult[] = [];\n\tconst emit = (result: CheckResult) => {\n\t\tresults.push(result);\n\t\ttry {\n\t\t\toptions.onResult?.(result);\n\t\t} catch {\n\t\t\t// The callback is an observer; its bugs must not abort the run.\n\t\t}\n\t};\n\n\t// Sequential on purpose: checks share probe state, and hammering a\n\t// live target in parallel makes failures racy and reports unreadable.\n\tfor (const check of options.catalog.runnable) {\n\t\tconst began = Date.now();\n\t\t// A per-check abort so a timed-out check's in-flight requests are\n\t\t// cancelled rather than continuing to fetch and mutate shared state\n\t\t// alongside the next check (the sequential invariant above).\n\t\tconst controller = new AbortController();\n\t\tconst checkCtx: CheckContext = {\n\t\t\t...ctx,\n\t\t\tfetch: (input, init) =>\n\t\t\t\tctx.fetch(input, {\n\t\t\t\t\t...init,\n\t\t\t\t\tsignal: init?.signal ?? controller.signal,\n\t\t\t\t}),\n\t\t};\n\t\ttry {\n\t\t\tconst outcome = await withTimeout(\n\t\t\t\tcheck.run(checkCtx),\n\t\t\t\tMath.max(timeoutMs, check.timeoutMs ?? 0),\n\t\t\t\tcheck.id,\n\t\t\t\tcontroller,\n\t\t\t);\n\t\t\temit({\n\t\t\t\tid: check.id,\n\t\t\t\ttier: check.tier,\n\t\t\t\tstatus: outcome.status,\n\t\t\t\tdetail: outcome.detail,\n\t\t\t\tcitations: check.citations,\n\t\t\t\t...(outcome.evidence !== undefined\n\t\t\t\t\t? { evidence: outcome.evidence }\n\t\t\t\t\t: {}),\n\t\t\t\tdurationMs: Date.now() - began,\n\t\t\t});\n\t\t} catch (err) {\n\t\t\t// A thrown error means the CHECK broke (or the target hung) —\n\t\t\t// reported distinctly from a failing target so suite bugs don't\n\t\t\t// masquerade as non-conformance.\n\t\t\temit({\n\t\t\t\tid: check.id,\n\t\t\t\ttier: check.tier,\n\t\t\t\tstatus: \"error\",\n\t\t\t\tdetail: err instanceof Error ? err.message : String(err),\n\t\t\t\tcitations: check.citations,\n\t\t\t\tdurationMs: Date.now() - began,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const { check, reason } of options.catalog.skipped) {\n\t\temit({\n\t\t\tid: check.id,\n\t\t\ttier: check.tier,\n\t\t\tstatus: \"skipped\",\n\t\t\tdetail: reason,\n\t\t\tcitations: check.citations,\n\t\t});\n\t}\n\n\tconst summary = {\n\t\tpass: results.filter((r) => r.status === \"pass\").length,\n\t\tfail: results.filter((r) => r.status === \"fail\").length,\n\t\tmustFail: results.filter((r) => r.status === \"fail\" && r.tier === \"must\")\n\t\t\t.length,\n\t\tmustError: results.filter((r) => r.status === \"error\" && r.tier === \"must\")\n\t\t\t.length,\n\t\tskipped: results.filter((r) => r.status === \"skipped\").length,\n\t\terror: results.filter((r) => r.status === \"error\").length,\n\t};\n\n\treturn {\n\t\tsuite: {\n\t\t\tname: \"@getcirrus/space-conformance\",\n\t\t\tversion: options.suiteVersion,\n\t\t},\n\t\talphaBuild: options.alphaBuild,\n\t\ttarget: options.context.target,\n\t\tstartedAt,\n\t\tfinishedAt: new Date().toISOString(),\n\t\tresults,\n\t\tlogs,\n\t\tsummary,\n\t};\n}\n\nfunction withTimeout<T>(\n\tpromise: Promise<T>,\n\tms: number,\n\tid: string,\n\tcontroller: AbortController,\n): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tconst timer = setTimeout(() => {\n\t\t\t// Abort the check's in-flight requests so it stops touching shared\n\t\t\t// state before the next check begins.\n\t\t\tcontroller.abort();\n\t\t\treject(new Error(`check ${id} timed out after ${ms}ms`));\n\t\t}, ms);\n\t\tpromise.then(\n\t\t\t(value) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(value);\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\treject(err);\n\t\t\t},\n\t\t);\n\t});\n}\n\n/** Render a compact human-readable summary of a report. */\nexport function renderReport(report: RunReport): string {\n\tconst lines: string[] = [];\n\tconst icon = { pass: \"✓\", fail: \"✗\", skipped: \"-\", error: \"!\" } as const;\n\tlines.push(\n\t\t`# ${report.suite.name}@${report.suite.version} vs ${report.target.implementation ?? report.target.origin}`,\n\t);\n\tlines.push(`alpha build: ${report.alphaBuild}`);\n\tfor (const result of report.results) {\n\t\tlines.push(\n\t\t\t`${icon[result.status]} [${result.tier}] ${result.id} — ${result.detail}`,\n\t\t);\n\t}\n\tconst s = report.summary;\n\tlines.push(\n\t\t`${s.pass} pass, ${s.fail} fail (${s.mustFail} must), ${s.skipped} skipped, ${s.error} errored`,\n\t);\n\treturn lines.join(\"\\n\");\n}\n","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","/**\n * Vendored lexicon access. Generated by scripts/vendor-lexicons.mjs whenever\n * lexicons/ is re-vendored — imports are explicit so bundlers carry the\n * documents without filesystem access at runtime.\n */\n\nimport space_applyWrites from \"../lexicons/space/applyWrites.json\" with { type: \"json\" };\nimport space_authorizeSpaceSync from \"../lexicons/space/authorizeSpaceSync.json\" with { type: \"json\" };\nimport space_clearRecords from \"../lexicons/space/clearRecords.json\" with { type: \"json\" };\nimport space_confirmRegistration from \"../lexicons/space/confirmRegistration.json\" with { type: \"json\" };\nimport space_createRecord from \"../lexicons/space/createRecord.json\" with { type: \"json\" };\nimport space_createSpace from \"../lexicons/space/createSpace.json\" with { type: \"json\" };\nimport space_defs from \"../lexicons/space/defs.json\" with { type: \"json\" };\nimport space_deleteRecord from \"../lexicons/space/deleteRecord.json\" with { type: \"json\" };\nimport space_deleteSpace from \"../lexicons/space/deleteSpace.json\" with { type: \"json\" };\nimport space_exportSpaceMeta from \"../lexicons/space/exportSpaceMeta.json\" with { type: \"json\" };\nimport space_getBlob from \"../lexicons/space/getBlob.json\" with { type: \"json\" };\nimport space_getDelegationToken from \"../lexicons/space/getDelegationToken.json\" with { type: \"json\" };\nimport space_getLatestCommit from \"../lexicons/space/getLatestCommit.json\" with { type: \"json\" };\nimport space_getRecord from \"../lexicons/space/getRecord.json\" with { type: \"json\" };\nimport space_getRepo from \"../lexicons/space/getRepo.json\" with { type: \"json\" };\nimport space_getSpace from \"../lexicons/space/getSpace.json\" with { type: \"json\" };\nimport space_importRepo from \"../lexicons/space/importRepo.json\" with { type: \"json\" };\nimport space_importSpaceMeta from \"../lexicons/space/importSpaceMeta.json\" with { type: \"json\" };\nimport space_listBlobs from \"../lexicons/space/listBlobs.json\" with { type: \"json\" };\nimport space_listRecords from \"../lexicons/space/listRecords.json\" with { type: \"json\" };\nimport space_listRepoOps from \"../lexicons/space/listRepoOps.json\" with { type: \"json\" };\nimport space_listSpaces from \"../lexicons/space/listSpaces.json\" with { type: \"json\" };\nimport space_listWriters from \"../lexicons/space/listWriters.json\" with { type: \"json\" };\nimport space_notifyCredentialsRevoked from \"../lexicons/space/notifyCredentialsRevoked.json\" with { type: \"json\" };\nimport space_notifyRepoUpdate from \"../lexicons/space/notifyRepoUpdate.json\" with { type: \"json\" };\nimport space_notifySpaceUpdate from \"../lexicons/space/notifySpaceUpdate.json\" with { type: \"json\" };\nimport space_policy from \"../lexicons/space/policy.json\" with { type: \"json\" };\nimport space_putRecord from \"../lexicons/space/putRecord.json\" with { type: \"json\" };\nimport space_removeWriter from \"../lexicons/space/removeWriter.json\" with { type: \"json\" };\nimport space_updateSpace from \"../lexicons/space/updateSpace.json\" with { type: \"json\" };\nimport memberspace_defs from \"../lexicons/memberspace/defs.json\" with { type: \"json\" };\nimport memberspace_listMembers from \"../lexicons/memberspace/listMembers.json\" with { type: \"json\" };\nimport memberspace_member from \"../lexicons/memberspace/member.json\" with { type: \"json\" };\nimport memberspace_policy from \"../lexicons/memberspace/policy.json\" with { type: \"json\" };\nimport memberspace_putMembers from \"../lexicons/memberspace/putMembers.json\" with { type: \"json\" };\nimport memberspace_removeMembers from \"../lexicons/memberspace/removeMembers.json\" with { type: \"json\" };\nimport personalspace_policy from \"../lexicons/personalspace/policy.json\" with { type: \"json\" };\nimport managedspace_checkAccess from \"../lexicons/managedspace/checkAccess.json\" with { type: \"json\" };\nimport managedspace_policy from \"../lexicons/managedspace/policy.json\" with { type: \"json\" };\n\nexport interface LexiconDoc {\n\tlexicon: number;\n\tid: string;\n\tdefs: Record<string, unknown>;\n}\n\nexport const lexicons: LexiconDoc[] = [\n\tspace_applyWrites as LexiconDoc,\n\tspace_authorizeSpaceSync as LexiconDoc,\n\tspace_clearRecords as LexiconDoc,\n\tspace_confirmRegistration as LexiconDoc,\n\tspace_createRecord as LexiconDoc,\n\tspace_createSpace as LexiconDoc,\n\tspace_defs as LexiconDoc,\n\tspace_deleteRecord as LexiconDoc,\n\tspace_deleteSpace as LexiconDoc,\n\tspace_exportSpaceMeta as LexiconDoc,\n\tspace_getBlob as LexiconDoc,\n\tspace_getDelegationToken as LexiconDoc,\n\tspace_getLatestCommit as LexiconDoc,\n\tspace_getRecord as LexiconDoc,\n\tspace_getRepo as LexiconDoc,\n\tspace_getSpace as LexiconDoc,\n\tspace_importRepo as LexiconDoc,\n\tspace_importSpaceMeta as LexiconDoc,\n\tspace_listBlobs as LexiconDoc,\n\tspace_listRecords as LexiconDoc,\n\tspace_listRepoOps as LexiconDoc,\n\tspace_listSpaces as LexiconDoc,\n\tspace_listWriters as LexiconDoc,\n\tspace_notifyCredentialsRevoked as LexiconDoc,\n\tspace_notifyRepoUpdate as LexiconDoc,\n\tspace_notifySpaceUpdate as LexiconDoc,\n\tspace_policy as LexiconDoc,\n\tspace_putRecord as LexiconDoc,\n\tspace_removeWriter as LexiconDoc,\n\tspace_updateSpace as LexiconDoc,\n\tmemberspace_defs as LexiconDoc,\n\tmemberspace_listMembers as LexiconDoc,\n\tmemberspace_member as LexiconDoc,\n\tmemberspace_policy as LexiconDoc,\n\tmemberspace_putMembers as LexiconDoc,\n\tmemberspace_removeMembers as LexiconDoc,\n\tpersonalspace_policy as LexiconDoc,\n\tmanagedspace_checkAccess as LexiconDoc,\n\tmanagedspace_policy as LexiconDoc,\n];\n","/**\n * Coverage is computed, not remembered.\n *\n * The vendored lexicons define what a conforming implementation exposes:\n * every method, and every error it declares. Each of those wants at least\n * one `must` check citing it. When the weekly sync re-vendors a changed\n * lexicon, new methods and error names surface here as gaps the moment\n * they land — no human has to notice that an endpoint grew.\n *\n * A requirement no black-box harness can exercise is exempted explicitly,\n * with the reason, in {@link coverageExemptions}. An exemption is a\n * reviewed statement, not a silencer: one that names no requirement, or a\n * requirement a check now covers, is reported as stale so the list cannot\n * quietly outgrow its reasons.\n */\n\nimport type { Check } from \"./model.js\";\nimport { lexicons, type LexiconDoc } from \"./lexicons.js\";\n\nexport interface CoverageRequirement {\n\t/** `<nsid>` for the method itself, `<nsid>@error:<Name>` for an error. */\n\tref: string;\n\tkind: \"method\" | \"error\";\n}\n\n/**\n * A requirement the suite deliberately does not cover. `ref` is an exact\n * requirement, or `*@error:Name` for that error on every method declaring\n * it.\n */\nexport interface CoverageExemption {\n\tref: string;\n\treason: string;\n}\n\nconst TAKEDOWN_REASON =\n\t\"Needs a moderation or account-status action on the target (a takedown, suspension or deactivation of the account being read), which only the host's administrator can take. No black-box harness can arrange it without admin authority, and deactivating the operator's own account would end the session the run depends on.\";\n\nconst READ_SPACE_NOT_FOUND_REASON =\n\t\"Declared on the repo-host reads, but neither the lexicons nor proposal 0016 name a condition under which a repo host answers it: reads are answered from the repo, and an empty or never-written repo is equivalent to a nonexistent one (proposal, Repo lifecycle). A must check would be the suite's own reading. The 1105 deleteSpace description said reads of a deleted space fail with SpaceNotFound; 1112 dropped that sentence, and the check that relied on it with it.\";\n\nconst INVALID_CURSOR_REASON =\n\t\"Cursors are opaque, host-issued strings. Neither the lexicons nor the proposal define a value every host must reject, so which cursors are invalid is the host's choice. The should check request.garbage-cursor-rejected calibrates what the reference does.\";\n\nexport const coverageExemptions: CoverageExemption[] = [\n\t{ ref: \"*@error:RepoTakendown\", reason: TAKEDOWN_REASON },\n\t{ ref: \"*@error:RepoSuspended\", reason: TAKEDOWN_REASON },\n\t{ ref: \"*@error:RepoDeactivated\", reason: TAKEDOWN_REASON },\n\t{ ref: \"*@error:InvalidCursor\", reason: INVALID_CURSOR_REASON },\n\t...[\n\t\t\"getRecord\",\n\t\t\"listRecords\",\n\t\t\"getLatestCommit\",\n\t\t\"listRepoOps\",\n\t\t\"getRepo\",\n\t\t\"listBlobs\",\n\t\t\"getBlob\",\n\t].map((method) => ({\n\t\tref: `com.atproto.space.${method}@error:SpaceNotFound`,\n\t\treason: READ_SPACE_NOT_FOUND_REASON,\n\t})),\n];\n\nexport interface CoverageReport {\n\trequirements: CoverageRequirement[];\n\tcovered: Array<{ ref: string; by: string[] }>;\n\t/** Requirements no `must` check covers and no exemption explains. */\n\tgaps: CoverageRequirement[];\n\t/** Requirements excused by an exemption, with its reason. */\n\texempt: Array<{ ref: string; reason: string }>;\n\t/**\n\t * Exemptions that excuse nothing: they match no requirement, or every\n\t * requirement they match is covered by a check after all.\n\t */\n\tstaleExemptions: CoverageExemption[];\n\t/** Lexicon citations on checks that match no requirement (typo guard). */\n\tdanglingCitations: Array<{ checkId: string; ref: string }>;\n}\n\n/** Extract the coverage requirements from the vendored lexicons. */\nexport function coverageRequirements(\n\tdocs: LexiconDoc[] = lexicons,\n): CoverageRequirement[] {\n\tconst requirements: CoverageRequirement[] = [];\n\tfor (const doc of docs) {\n\t\tconst main = doc.defs.main as\n\t\t\t| { type?: string; errors?: Array<{ name: string }> }\n\t\t\t| undefined;\n\t\tif (!main || (main.type !== \"query\" && main.type !== \"procedure\")) {\n\t\t\tcontinue;\n\t\t}\n\t\trequirements.push({ ref: doc.id, kind: \"method\" });\n\t\tfor (const error of main.errors ?? []) {\n\t\t\trequirements.push({\n\t\t\t\tref: `${doc.id}@error:${error.name}`,\n\t\t\t\tkind: \"error\",\n\t\t\t});\n\t\t}\n\t}\n\treturn requirements;\n}\n\n/**\n * A citation covers a requirement when it names the method (which covers\n * the method requirement) or the exact `@error:` form. A citation with a\n * `#def` fragment covers its method.\n */\nfunction citationRefs(check: Check): string[] {\n\treturn check.citations\n\t\t.filter((c) => c.source === \"lexicon\")\n\t\t.map((c) => c.ref);\n}\n\nfunction exemptionMatches(exemption: CoverageExemption, ref: string): boolean {\n\tif (exemption.ref.startsWith(\"*@error:\")) {\n\t\treturn ref.endsWith(exemption.ref.slice(1)) && ref.includes(\"@error:\");\n\t}\n\treturn exemption.ref === ref;\n}\n\nexport function coverageReport(\n\tcatalog: Check[],\n\tdocs: LexiconDoc[] = lexicons,\n\texemptions: CoverageExemption[] = coverageExemptions,\n): CoverageReport {\n\tconst requirements = coverageRequirements(docs);\n\tconst known = new Set(requirements.map((r) => r.ref));\n\tconst methodIds = new Set(\n\t\trequirements.filter((r) => r.kind === \"method\").map((r) => r.ref),\n\t);\n\t// Every vendored lexicon id, so a citation to a non-method document\n\t// (e.g. `com.atproto.space.defs`, the commit shape) is\n\t// recognised as real rather than flagged as a typo.\n\tconst knownDocIds = new Set(docs.map((d) => d.id));\n\n\tconst coveredBy = new Map<string, string[]>();\n\tconst dangling: CoverageReport[\"danglingCitations\"] = [];\n\tconst credit = (ref: string, checkId: string) =>\n\t\tcoveredBy.set(ref, [...(coveredBy.get(ref) ?? []), checkId]);\n\n\tfor (const check of catalog) {\n\t\tif (check.tier !== \"must\") continue;\n\t\tfor (const ref of citationRefs(check)) {\n\t\t\tconst methodRef = ref.split(\"@\")[0]!.split(\"#\")[0]!;\n\n\t\t\t// An `@error:` citation covers ONLY the exact error requirement.\n\t\t\t// It must never fall back to crediting the method: doing so would\n\t\t\t// silently absorb an error-name typo (or an upstream rename) and\n\t\t\t// falsely mark the method covered — defeating the typo guard this\n\t\t\t// report exists to provide.\n\t\t\tif (ref.includes(\"@error:\")) {\n\t\t\t\tif (known.has(ref)) {\n\t\t\t\t\tcredit(ref, check.id);\n\t\t\t\t} else {\n\t\t\t\t\tdangling.push({ checkId: check.id, ref });\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// A method (or `#def`) citation.\n\t\t\tif (methodIds.has(methodRef)) {\n\t\t\t\tcredit(methodRef, check.id);\n\t\t\t} else if (!knownDocIds.has(methodRef)) {\n\t\t\t\t// Names no vendored document at all — a typo.\n\t\t\t\tdangling.push({ checkId: check.id, ref });\n\t\t\t}\n\t\t\t// else: a `#def` reference to a real non-method document (e.g.\n\t\t\t// defs) — valid, contributes no method coverage, not dangling.\n\t\t}\n\t}\n\n\tconst uncovered = requirements.filter((r) => !coveredBy.has(r.ref));\n\tconst exempt: CoverageReport[\"exempt\"] = [];\n\tconst gaps: CoverageRequirement[] = [];\n\tconst used = new Set<CoverageExemption>();\n\tfor (const requirement of uncovered) {\n\t\tconst exemption = exemptions.find((e) =>\n\t\t\texemptionMatches(e, requirement.ref),\n\t\t);\n\t\tif (exemption) {\n\t\t\tused.add(exemption);\n\t\t\texempt.push({ ref: requirement.ref, reason: exemption.reason });\n\t\t} else {\n\t\t\tgaps.push(requirement);\n\t\t}\n\t}\n\treturn {\n\t\trequirements,\n\t\tcovered: Array.from(coveredBy, ([ref, by]) => ({ ref, by })),\n\t\tgaps,\n\t\texempt,\n\t\tstaleExemptions: exemptions.filter((e) => !used.has(e)),\n\t\tdanglingCitations: dangling,\n\t};\n}\n"],"mappings":";;;;;;AAKA,MAAa,cAAc;;;;AC4C3B,eAAsB,UAAU,SAAyC;CACxE,MAAMA,OAAiB,EAAE;CACzB,MAAM,wBAAQ,IAAI,KAAsB;CACxC,MAAMC,MAAoB;EACzB,GAAG,QAAQ;EACX;EACA,MAAM,YAAY,KAAK,KAAK,QAAQ;EACpC;CACD,MAAM,YAAY,QAAQ,kBAAkB;CAC5C,MAAM,6BAAY,IAAI,MAAM,EAAC,aAAa;CAC1C,MAAMC,UAAyB,EAAE;CACjC,MAAM,QAAQ,WAAwB;AACrC,UAAQ,KAAK,OAAO;AACpB,MAAI;AACH,WAAQ,WAAW,OAAO;UACnB;;AAOT,MAAK,MAAM,SAAS,QAAQ,QAAQ,UAAU;EAC7C,MAAM,QAAQ,KAAK,KAAK;EAIxB,MAAM,aAAa,IAAI,iBAAiB;EACxC,MAAMC,WAAyB;GAC9B,GAAG;GACH,QAAQ,OAAO,SACd,IAAI,MAAM,OAAO;IAChB,GAAG;IACH,QAAQ,MAAM,UAAU,WAAW;IACnC,CAAC;GACH;AACD,MAAI;GACH,MAAM,UAAU,MAAM,YACrB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,WAAW,MAAM,aAAa,EAAE,EACzC,MAAM,IACN,WACA;AACD,QAAK;IACJ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AE7D,MAAK,MAAM,SAAS,SAAS;AAC5B,MAAI,MAAM,SAAS,OAAQ;AAC3B,OAAK,MAAM,OAAO,aAAa,MAAM,EAAE;GACtC,MAAM,YAAY,IAAI,MAAM,IAAI,CAAC,GAAI,MAAM,IAAI,CAAC;AAOhD,OAAI,IAAI,SAAS,UAAU,EAAE;AAC5B,QAAI,MAAM,IAAI,IAAI,CACjB,QAAO,KAAK,MAAM,GAAG;QAErB,UAAS,KAAK;KAAE,SAAS,MAAM;KAAI;KAAK,CAAC;AAE1C;;AAID,OAAI,UAAU,IAAI,UAAU,CAC3B,QAAO,WAAW,MAAM,GAAG;YACjB,CAAC,YAAY,IAAI,UAAU,CAErC,UAAS,KAAK;IAAE,SAAS,MAAM;IAAI;IAAK,CAAC;;;CAO5C,MAAM,YAAY,aAAa,QAAQ,MAAM,CAAC,UAAU,IAAI,EAAE,IAAI,CAAC;CACnE,MAAMC,SAAmC,EAAE;CAC3C,MAAMC,OAA8B,EAAE;CACtC,MAAM,uBAAO,IAAI,KAAwB;AACzC,MAAK,MAAM,eAAe,WAAW;EACpC,MAAM,YAAY,WAAW,MAAM,MAClC,iBAAiB,GAAG,YAAY,IAAI,CACpC;AACD,MAAI,WAAW;AACd,QAAK,IAAI,UAAU;AACnB,UAAO,KAAK;IAAE,KAAK,YAAY;IAAK,QAAQ,UAAU;IAAQ,CAAC;QAE/D,MAAK,KAAK,YAAY;;AAGxB,QAAO;EACN;EACA,SAAS,MAAM,KAAK,YAAY,CAAC,KAAK,SAAS;GAAE;GAAK;GAAI,EAAE;EAC5D;EACA;EACA,iBAAiB,WAAW,QAAQ,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;EACvD,mBAAmB;EACnB"}
|
|
@@ -4425,4 +4425,4 @@ function descriptorToStub(d) {
|
|
|
4425
4425
|
|
|
4426
4426
|
//#endregion
|
|
4427
4427
|
export { toBase64 as $, spaceUri as A, SPACE_CREDENTIAL_SCHEME as B, operatorCreateRecord as C, requestCredential as D, publicRead as E, serviceEndpoint as F, isP256DidKey as G, credentialSigMembers as H, verificationMethodDidKey as I, decodeJwt as J, spaceSigHeaders as K, COMMIT_MAC_PROFILE as L, DEFAULT_PLC_DIRECTORY as M, didDocumentUrl as N, spaceAuthority as O, resolveDidDocument as P, tidNow as Q, MAC_COVERED_HEADER as R, obtainPublicCredential as S, probeSkey as T, encapsulate as U, createCredentialKey as V, formatMacRequest as W, lexBytes as X, isTid as Y, tidAt as Z, describe as _, operatorChecks as a, xrpcGet as at, mustCreateRecord as b, fakeDid as c, xrpcUrl as ct, FOREIGN_DID as d, filterCatalog as dt, toBase64Url as et, POST as f, fail as ft, deleteProbeSpace as g, credentialGet as h, createSyncerInbox as i, operatorHeaders as it, unknownSpaceUri as j, spaceRecordUri as k, putMembers as l, buildCatalog as lt, credentialCall as m, descriptor as n, asOperator as nt, listWriters as o, xrpcPost as ot, createProbeSpace as p, pass as pt, bytesEqual as q, descriptorToStub as r, operatorFetch as rt, ACCOUNT_REFUSALS$1 as s, xrpcPostBytes as st, cryptoCheckDescriptors as t, utf8 as tt, baseChecks as u, defineCheck as ut, managedspace as v, personalspace as w, obtainCredentialViaDelegation as x, memberspace as y, RECORD_MAC_PROFILE as z };
|
|
4428
|
-
//# sourceMappingURL=descriptors-
|
|
4428
|
+
//# sourceMappingURL=descriptors-BUCV_BuG.js.map
|