@getbourdon/conformance 0.9.0 → 0.10.0-rc.2
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/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js.map +1 -1
- package/fixtures/leak_cases.json +2 -0
- package/fixtures/manifest.json +4 -4
- package/fixtures/redaction_battery.json +17 -0
- package/fixtures.pin.json +2 -2
- package/package.json +2 -2
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Typed loaders for the language-neutral parity fixtures produced by the Python\n * oracle (`~/repos/bourdon/tools/gen_conformance.py`). Python is the source of\n * truth; the @getbourdon/* TypeScript mirror asserts against these exact bytes.\n *\n * Resolution order:\n * 1. `BOURDON_CONFORMANCE_DIR` env var — the oracle checkout (parity tests +\n * oracle dev use this; highest priority so a build always asserts against\n * the live oracle).\n * 2. the fixtures BUNDLED in this package (`<pkg>/fixtures`, shipped in the\n * tarball) — what an installed `@getbourdon/conformance` consumer gets.\n * 3. the sibling Python checkout `../../bourdon/conformance` — dev fallback.\n *\n * The bundled copy is a vendored snapshot refreshed from the oracle by\n * `pnpm --filter @getbourdon/conformance sync-fixtures` (and in the release\n * workflow before publish), so the published package is self-contained.\n */\n\n// `import.meta.url` in ESM; esbuild empties it in the CJS bundle, where the\n// native `__dirname` global is the real directory — fall back to it.\ndeclare const __dirname: string | undefined;\nfunction moduleDir(): string {\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return dirname(fileURLToPath(import.meta.url));\n }\n return typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n}\n\nexport interface RedactionSecretCase {\n /** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */\n fragments: string[];\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBenignCase {\n text: string;\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBattery {\n redacted_sentinel: string;\n benign_limit: number;\n secrets: RedactionSecretCase[];\n benign: RedactionBenignCase[];\n}\n\nexport interface ConformanceFixtureMeta {\n path: string;\n sha256: string;\n producer: string;\n}\n\nexport interface ConformanceManifest {\n conformance_version: string;\n produced_against: { bourdon_version: string };\n fixtures: ConformanceFixtureMeta[];\n}\n\nexport function conformanceDir(): string {\n const override = process.env.BOURDON_CONFORMANCE_DIR;\n if (override) return override;\n // Bundled snapshot: <pkg>/fixtures, one level up from src/ or dist/.\n const bundled = resolve(moduleDir(), \"..\", \"fixtures\");\n if (existsSync(resolve(bundled, \"manifest.json\"))) return bundled;\n // Dev fallback: the sibling Python oracle checkout.\n return resolve(process.cwd(), \"..\", \"..\", \"bourdon\", \"conformance\");\n}\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(resolve(conformanceDir(), name), \"utf8\")) as T;\n}\n\nexport function loadManifest(): ConformanceManifest {\n return loadJson<ConformanceManifest>(\"manifest.json\");\n}\n\nexport interface FixturePin {\n conformance_version: string;\n manifest_sha256: string;\n}\n\n/** The recorded fixture pin committed beside this package: which contract\n * version the vendored snapshot is, and the sha256 the manifest must hash to. */\nexport function loadPin(): FixturePin {\n return JSON.parse(\n readFileSync(resolve(moduleDir(), \"..\", \"fixtures.pin.json\"), \"utf8\"),\n ) as FixturePin;\n}\n\n/** sha256 hex of one file's raw bytes. */\nexport function sha256File(path: string): string {\n return createHash(\"sha256\").update(readFileSync(path)).digest(\"hex\");\n}\n\nexport interface FixtureMismatch {\n path: string;\n expected: string;\n actual: string;\n}\n\n/** Verify every fixture in `dir` against the sha256 its manifest stamps.\n * Returns the mismatches — an empty array is the only passing result. The\n * same routine backs the parity gate AND its mutation test, so the check\n * that guards releases is itself provably able to fail. */\nexport function verifyFixtureHashes(dir: string = conformanceDir()): FixtureMismatch[] {\n const manifest = JSON.parse(\n readFileSync(resolve(dir, \"manifest.json\"), \"utf8\"),\n ) as ConformanceManifest;\n const mismatches: FixtureMismatch[] = [];\n for (const fixture of manifest.fixtures) {\n const actual = sha256File(resolve(dir, fixture.path));\n if (actual !== fixture.sha256) {\n mismatches.push({ path: fixture.path, expected: fixture.sha256, actual });\n }\n }\n return mismatches;\n}\n\nexport function loadRedactionBattery(): RedactionBattery {\n return loadJson<RedactionBattery>(\"redaction_battery.json\");\n}\n\n/** Reconstruct a secret case's runtime string from its fragments. */\nexport function assembleSecret(secret: RedactionSecretCase): string {\n return secret.fragments.join(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA2B;AAC3B,qBAAyC;AACzC,uBAAiC;AACjC,sBAA8B;AAJ9B;AA2BA,SAAS,YAAoB;AAC3B,MAAI,OAAO,gBAAgB,eAAe,YAAY,KAAK;AACzD,eAAO,8BAAQ,+BAAc,YAAY,GAAG,CAAC;AAAA,EAC/C;AACA,SAAO,OAAO,cAAc,cAAc,YAAY,QAAQ,IAAI;AACpE;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Typed loaders for the language-neutral parity fixtures produced by the Python\n * oracle (`~/repos/bourdon/tools/gen_conformance.py`). Python is the source of\n * truth; the @getbourdon/* TypeScript mirror asserts against these exact bytes.\n *\n * Resolution order:\n * 1. `BOURDON_CONFORMANCE_DIR` env var — the oracle checkout (parity tests +\n * oracle dev use this; highest priority so a build always asserts against\n * the live oracle).\n * 2. the fixtures BUNDLED in this package (`<pkg>/fixtures`, shipped in the\n * tarball) — what an installed `@getbourdon/conformance` consumer gets.\n * 3. the sibling Python checkout `../../bourdon/conformance` — dev fallback.\n *\n * The bundled copy is a vendored snapshot refreshed from the oracle by\n * `pnpm --filter @getbourdon/conformance sync-fixtures` (and in the release\n * workflow before publish), so the published package is self-contained.\n */\n\n// `import.meta.url` in ESM; esbuild empties it in the CJS bundle, where the\n// native `__dirname` global is the real directory — fall back to it.\ndeclare const __dirname: string | undefined;\nfunction moduleDir(): string {\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return dirname(fileURLToPath(import.meta.url));\n }\n return typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n}\n\nexport interface RedactionSecretCase {\n /** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */\n fragments: string[];\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBenignCase {\n text: string;\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBattery {\n redacted_sentinel: string;\n benign_limit: number;\n secrets: RedactionSecretCase[];\n benign: RedactionBenignCase[];\n truncation_cases: { text: string; limit: number; expect_redacted: string }[];\n}\n\nexport interface ConformanceFixtureMeta {\n path: string;\n sha256: string;\n producer: string;\n}\n\nexport interface ConformanceManifest {\n conformance_version: string;\n produced_against: { bourdon_version: string };\n fixtures: ConformanceFixtureMeta[];\n}\n\nexport function conformanceDir(): string {\n const override = process.env.BOURDON_CONFORMANCE_DIR;\n if (override) return override;\n // Bundled snapshot: <pkg>/fixtures, one level up from src/ or dist/.\n const bundled = resolve(moduleDir(), \"..\", \"fixtures\");\n if (existsSync(resolve(bundled, \"manifest.json\"))) return bundled;\n // Dev fallback: the sibling Python oracle checkout.\n return resolve(process.cwd(), \"..\", \"..\", \"bourdon\", \"conformance\");\n}\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(resolve(conformanceDir(), name), \"utf8\")) as T;\n}\n\nexport function loadManifest(): ConformanceManifest {\n return loadJson<ConformanceManifest>(\"manifest.json\");\n}\n\nexport interface FixturePin {\n conformance_version: string;\n manifest_sha256: string;\n}\n\n/** The recorded fixture pin committed beside this package: which contract\n * version the vendored snapshot is, and the sha256 the manifest must hash to. */\nexport function loadPin(): FixturePin {\n return JSON.parse(\n readFileSync(resolve(moduleDir(), \"..\", \"fixtures.pin.json\"), \"utf8\"),\n ) as FixturePin;\n}\n\n/** sha256 hex of one file's raw bytes. */\nexport function sha256File(path: string): string {\n return createHash(\"sha256\").update(readFileSync(path)).digest(\"hex\");\n}\n\nexport interface FixtureMismatch {\n path: string;\n expected: string;\n actual: string;\n}\n\n/** Verify every fixture in `dir` against the sha256 its manifest stamps.\n * Returns the mismatches — an empty array is the only passing result. The\n * same routine backs the parity gate AND its mutation test, so the check\n * that guards releases is itself provably able to fail. */\nexport function verifyFixtureHashes(dir: string = conformanceDir()): FixtureMismatch[] {\n const manifest = JSON.parse(\n readFileSync(resolve(dir, \"manifest.json\"), \"utf8\"),\n ) as ConformanceManifest;\n const mismatches: FixtureMismatch[] = [];\n for (const fixture of manifest.fixtures) {\n const actual = sha256File(resolve(dir, fixture.path));\n if (actual !== fixture.sha256) {\n mismatches.push({ path: fixture.path, expected: fixture.sha256, actual });\n }\n }\n return mismatches;\n}\n\nexport function loadRedactionBattery(): RedactionBattery {\n return loadJson<RedactionBattery>(\"redaction_battery.json\");\n}\n\n/** Reconstruct a secret case's runtime string from its fragments. */\nexport function assembleSecret(secret: RedactionSecretCase): string {\n return secret.fragments.join(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA2B;AAC3B,qBAAyC;AACzC,uBAAiC;AACjC,sBAA8B;AAJ9B;AA2BA,SAAS,YAAoB;AAC3B,MAAI,OAAO,gBAAgB,eAAe,YAAY,KAAK;AACzD,eAAO,8BAAQ,+BAAc,YAAY,GAAG,CAAC;AAA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ist/index.d.cts
CHANGED
|
@@ -14,6 +14,11 @@ interface RedactionBattery {
|
|
|
14
14
|
benign_limit: number;
|
|
15
15
|
secrets: RedactionSecretCase[];
|
|
16
16
|
benign: RedactionBenignCase[];
|
|
17
|
+
truncation_cases: {
|
|
18
|
+
text: string;
|
|
19
|
+
limit: number;
|
|
20
|
+
expect_redacted: string;
|
|
21
|
+
}[];
|
|
17
22
|
}
|
|
18
23
|
interface ConformanceFixtureMeta {
|
|
19
24
|
path: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export interface RedactionBattery {
|
|
|
14
14
|
benign_limit: number;
|
|
15
15
|
secrets: RedactionSecretCase[];
|
|
16
16
|
benign: RedactionBenignCase[];
|
|
17
|
+
truncation_cases: {
|
|
18
|
+
text: string;
|
|
19
|
+
limit: number;
|
|
20
|
+
expect_redacted: string;
|
|
21
|
+
}[];
|
|
17
22
|
}
|
|
18
23
|
export interface ConformanceFixtureMeta {
|
|
19
24
|
path: string;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Typed loaders for the language-neutral parity fixtures produced by the Python\n * oracle (`~/repos/bourdon/tools/gen_conformance.py`). Python is the source of\n * truth; the @getbourdon/* TypeScript mirror asserts against these exact bytes.\n *\n * Resolution order:\n * 1. `BOURDON_CONFORMANCE_DIR` env var — the oracle checkout (parity tests +\n * oracle dev use this; highest priority so a build always asserts against\n * the live oracle).\n * 2. the fixtures BUNDLED in this package (`<pkg>/fixtures`, shipped in the\n * tarball) — what an installed `@getbourdon/conformance` consumer gets.\n * 3. the sibling Python checkout `../../bourdon/conformance` — dev fallback.\n *\n * The bundled copy is a vendored snapshot refreshed from the oracle by\n * `pnpm --filter @getbourdon/conformance sync-fixtures` (and in the release\n * workflow before publish), so the published package is self-contained.\n */\n\n// `import.meta.url` in ESM; esbuild empties it in the CJS bundle, where the\n// native `__dirname` global is the real directory — fall back to it.\ndeclare const __dirname: string | undefined;\nfunction moduleDir(): string {\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return dirname(fileURLToPath(import.meta.url));\n }\n return typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n}\n\nexport interface RedactionSecretCase {\n /** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */\n fragments: string[];\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBenignCase {\n text: string;\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBattery {\n redacted_sentinel: string;\n benign_limit: number;\n secrets: RedactionSecretCase[];\n benign: RedactionBenignCase[];\n}\n\nexport interface ConformanceFixtureMeta {\n path: string;\n sha256: string;\n producer: string;\n}\n\nexport interface ConformanceManifest {\n conformance_version: string;\n produced_against: { bourdon_version: string };\n fixtures: ConformanceFixtureMeta[];\n}\n\nexport function conformanceDir(): string {\n const override = process.env.BOURDON_CONFORMANCE_DIR;\n if (override) return override;\n // Bundled snapshot: <pkg>/fixtures, one level up from src/ or dist/.\n const bundled = resolve(moduleDir(), \"..\", \"fixtures\");\n if (existsSync(resolve(bundled, \"manifest.json\"))) return bundled;\n // Dev fallback: the sibling Python oracle checkout.\n return resolve(process.cwd(), \"..\", \"..\", \"bourdon\", \"conformance\");\n}\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(resolve(conformanceDir(), name), \"utf8\")) as T;\n}\n\nexport function loadManifest(): ConformanceManifest {\n return loadJson<ConformanceManifest>(\"manifest.json\");\n}\n\nexport interface FixturePin {\n conformance_version: string;\n manifest_sha256: string;\n}\n\n/** The recorded fixture pin committed beside this package: which contract\n * version the vendored snapshot is, and the sha256 the manifest must hash to. */\nexport function loadPin(): FixturePin {\n return JSON.parse(\n readFileSync(resolve(moduleDir(), \"..\", \"fixtures.pin.json\"), \"utf8\"),\n ) as FixturePin;\n}\n\n/** sha256 hex of one file's raw bytes. */\nexport function sha256File(path: string): string {\n return createHash(\"sha256\").update(readFileSync(path)).digest(\"hex\");\n}\n\nexport interface FixtureMismatch {\n path: string;\n expected: string;\n actual: string;\n}\n\n/** Verify every fixture in `dir` against the sha256 its manifest stamps.\n * Returns the mismatches — an empty array is the only passing result. The\n * same routine backs the parity gate AND its mutation test, so the check\n * that guards releases is itself provably able to fail. */\nexport function verifyFixtureHashes(dir: string = conformanceDir()): FixtureMismatch[] {\n const manifest = JSON.parse(\n readFileSync(resolve(dir, \"manifest.json\"), \"utf8\"),\n ) as ConformanceManifest;\n const mismatches: FixtureMismatch[] = [];\n for (const fixture of manifest.fixtures) {\n const actual = sha256File(resolve(dir, fixture.path));\n if (actual !== fixture.sha256) {\n mismatches.push({ path: fixture.path, expected: fixture.sha256, actual });\n }\n }\n return mismatches;\n}\n\nexport function loadRedactionBattery(): RedactionBattery {\n return loadJson<RedactionBattery>(\"redaction_battery.json\");\n}\n\n/** Reconstruct a secret case's runtime string from its fragments. */\nexport function assembleSecret(secret: RedactionSecretCase): string {\n return secret.fragments.join(\"\");\n}\n"],"mappings":";AACA,SAAS,kBAAkB;AAC3B,SAAS,YAAY,oBAAoB;AACzC,SAAS,SAAS,eAAe;AACjC,SAAS,qBAAqB;AAuB9B,SAAS,YAAoB;AAC3B,MAAI,OAAO,gBAAgB,eAAe,YAAY,KAAK;AACzD,WAAO,QAAQ,cAAc,YAAY,GAAG,CAAC;AAAA,EAC/C;AACA,SAAO,OAAO,cAAc,cAAc,YAAY,QAAQ,IAAI;AACpE;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Typed loaders for the language-neutral parity fixtures produced by the Python\n * oracle (`~/repos/bourdon/tools/gen_conformance.py`). Python is the source of\n * truth; the @getbourdon/* TypeScript mirror asserts against these exact bytes.\n *\n * Resolution order:\n * 1. `BOURDON_CONFORMANCE_DIR` env var — the oracle checkout (parity tests +\n * oracle dev use this; highest priority so a build always asserts against\n * the live oracle).\n * 2. the fixtures BUNDLED in this package (`<pkg>/fixtures`, shipped in the\n * tarball) — what an installed `@getbourdon/conformance` consumer gets.\n * 3. the sibling Python checkout `../../bourdon/conformance` — dev fallback.\n *\n * The bundled copy is a vendored snapshot refreshed from the oracle by\n * `pnpm --filter @getbourdon/conformance sync-fixtures` (and in the release\n * workflow before publish), so the published package is self-contained.\n */\n\n// `import.meta.url` in ESM; esbuild empties it in the CJS bundle, where the\n// native `__dirname` global is the real directory — fall back to it.\ndeclare const __dirname: string | undefined;\nfunction moduleDir(): string {\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return dirname(fileURLToPath(import.meta.url));\n }\n return typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n}\n\nexport interface RedactionSecretCase {\n /** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */\n fragments: string[];\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBenignCase {\n text: string;\n expect_redacted: string;\n expect_contains_secret: boolean;\n}\n\nexport interface RedactionBattery {\n redacted_sentinel: string;\n benign_limit: number;\n secrets: RedactionSecretCase[];\n benign: RedactionBenignCase[];\n truncation_cases: { text: string; limit: number; expect_redacted: string }[];\n}\n\nexport interface ConformanceFixtureMeta {\n path: string;\n sha256: string;\n producer: string;\n}\n\nexport interface ConformanceManifest {\n conformance_version: string;\n produced_against: { bourdon_version: string };\n fixtures: ConformanceFixtureMeta[];\n}\n\nexport function conformanceDir(): string {\n const override = process.env.BOURDON_CONFORMANCE_DIR;\n if (override) return override;\n // Bundled snapshot: <pkg>/fixtures, one level up from src/ or dist/.\n const bundled = resolve(moduleDir(), \"..\", \"fixtures\");\n if (existsSync(resolve(bundled, \"manifest.json\"))) return bundled;\n // Dev fallback: the sibling Python oracle checkout.\n return resolve(process.cwd(), \"..\", \"..\", \"bourdon\", \"conformance\");\n}\n\nfunction loadJson<T>(name: string): T {\n return JSON.parse(readFileSync(resolve(conformanceDir(), name), \"utf8\")) as T;\n}\n\nexport function loadManifest(): ConformanceManifest {\n return loadJson<ConformanceManifest>(\"manifest.json\");\n}\n\nexport interface FixturePin {\n conformance_version: string;\n manifest_sha256: string;\n}\n\n/** The recorded fixture pin committed beside this package: which contract\n * version the vendored snapshot is, and the sha256 the manifest must hash to. */\nexport function loadPin(): FixturePin {\n return JSON.parse(\n readFileSync(resolve(moduleDir(), \"..\", \"fixtures.pin.json\"), \"utf8\"),\n ) as FixturePin;\n}\n\n/** sha256 hex of one file's raw bytes. */\nexport function sha256File(path: string): string {\n return createHash(\"sha256\").update(readFileSync(path)).digest(\"hex\");\n}\n\nexport interface FixtureMismatch {\n path: string;\n expected: string;\n actual: string;\n}\n\n/** Verify every fixture in `dir` against the sha256 its manifest stamps.\n * Returns the mismatches — an empty array is the only passing result. The\n * same routine backs the parity gate AND its mutation test, so the check\n * that guards releases is itself provably able to fail. */\nexport function verifyFixtureHashes(dir: string = conformanceDir()): FixtureMismatch[] {\n const manifest = JSON.parse(\n readFileSync(resolve(dir, \"manifest.json\"), \"utf8\"),\n ) as ConformanceManifest;\n const mismatches: FixtureMismatch[] = [];\n for (const fixture of manifest.fixtures) {\n const actual = sha256File(resolve(dir, fixture.path));\n if (actual !== fixture.sha256) {\n mismatches.push({ path: fixture.path, expected: fixture.sha256, actual });\n }\n }\n return mismatches;\n}\n\nexport function loadRedactionBattery(): RedactionBattery {\n return loadJson<RedactionBattery>(\"redaction_battery.json\");\n}\n\n/** Reconstruct a secret case's runtime string from its fragments. */\nexport function assembleSecret(secret: RedactionSecretCase): string {\n return secret.fragments.join(\"\");\n}\n"],"mappings":";AACA,SAAS,kBAAkB;AAC3B,SAAS,YA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F;AACA,SAAO;AACT;AAEO,SAAS,uBAAyC;AACvD,SAAO,SAA2B,wBAAwB;AAC5D;AAGO,SAAS,eAAe,QAAqC;AAClE,SAAO,OAAO,UAAU,KAAK,EAAE;AACjC;","names":[]}
|
package/fixtures/leak_cases.json
CHANGED
package/fixtures/manifest.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_doc": "Index of cross-impl parity fixtures. conformance_version bumps on any fixture change (patch=added cases, minor=new family, major=changed expected-output = a reviewed behavior change). Python is the oracle; this file is generated by tools/gen_conformance.py.",
|
|
3
|
-
"conformance_version": "6.
|
|
3
|
+
"conformance_version": "6.1.1",
|
|
4
4
|
"produced_against": {
|
|
5
|
-
"bourdon_version": "0.
|
|
5
|
+
"bourdon_version": "0.26.0"
|
|
6
6
|
},
|
|
7
7
|
"fixtures": [
|
|
8
8
|
{
|
|
9
9
|
"path": "redaction_battery.json",
|
|
10
|
-
"sha256": "
|
|
10
|
+
"sha256": "0c8f9f8b9e9d1991f66d1408b160970cc8cc9e47b13143cd04a9de340f798531",
|
|
11
11
|
"producer": "tools/gen_conformance.py::redaction_battery"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"path": "leak_cases.json",
|
|
15
|
-
"sha256": "
|
|
15
|
+
"sha256": "fe7c5981072ca93005745f96676067bb1ab69f4d4aaa2d254e6375b531167b65",
|
|
16
16
|
"producer": "tools/gen_conformance.py::leak_cases"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
@@ -266,6 +266,23 @@
|
|
|
266
266
|
"expect_contains_secret": false
|
|
267
267
|
}
|
|
268
268
|
],
|
|
269
|
+
"truncation_cases": [
|
|
270
|
+
{
|
|
271
|
+
"text": "aaa😀bbb",
|
|
272
|
+
"limit": 7,
|
|
273
|
+
"expect_redacted": "aaa😀bbb"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"text": "aaa😀bbb",
|
|
277
|
+
"limit": 6,
|
|
278
|
+
"expect_redacted": "aaa..."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"text": "a😀bcdef",
|
|
282
|
+
"limit": 6,
|
|
283
|
+
"expect_redacted": "a😀b..."
|
|
284
|
+
}
|
|
285
|
+
],
|
|
269
286
|
"case_variants": [
|
|
270
287
|
{
|
|
271
288
|
"pattern": "stripe_sk",
|
package/fixtures.pin.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_doc": "The recorded fixture pin. CI and the package tests assert the vendored fixtures/manifest.json hashes to exactly this value, so the fixture set in any build is provably the reviewed one. Refresh via the re-pin ritual in README.md.",
|
|
3
|
-
"conformance_version": "6.
|
|
4
|
-
"manifest_sha256": "
|
|
3
|
+
"conformance_version": "6.1.1",
|
|
4
|
+
"manifest_sha256": "832191de44c915a867c28955b16bf1ec268bbab78cf9cf7626a60a0e3f48ab9c"
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getbourdon/conformance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-rc.2",
|
|
4
4
|
"description": "Language-neutral cross-implementation parity fixtures for Bourdon. Python (pip install bourdon) is the oracle; the @getbourdon/* TypeScript mirror asserts against these exact bytes.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"LICENSE"
|
|
22
22
|
],
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=24.0.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public",
|