@getbourdon/conformance 0.1.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/LICENSE +157 -0
- package/README.md +26 -0
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +36 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/fixtures/README.md +61 -0
- package/fixtures/fed_seed_library/agents/claude-code.l5.yaml +63 -0
- package/fixtures/fed_seed_library/agents/codex.l5.yaml +35 -0
- package/fixtures/l5_manifests/invalid/bad-agent-type-enum.json +8 -0
- package/fixtures/l5_manifests/invalid/bad-spec-version-pattern.json +8 -0
- package/fixtures/l5_manifests/invalid/entity-bad-visibility-enum.json +14 -0
- package/fixtures/l5_manifests/invalid/entity-missing-name.json +13 -0
- package/fixtures/l5_manifests/invalid/missing-required-last_updated.json +7 -0
- package/fixtures/l5_manifests/invalid/reasons.json +75 -0
- package/fixtures/l5_manifests/valid/full.json +60 -0
- package/fixtures/l5_manifests/valid/minimal.json +8 -0
- package/fixtures/l5_manifests/valid/team-and-private.json +51 -0
- package/fixtures/l5_schema.json +209 -0
- package/fixtures/l5_todict.json +253 -0
- package/fixtures/leak_cases.json +229 -0
- package/fixtures/manifest.json +304 -0
- package/fixtures/mcp_snapshots/_normalizer.json +134 -0
- package/fixtures/mcp_snapshots/commit_to_federation.req.json +19 -0
- package/fixtures/mcp_snapshots/commit_to_federation.res.json +12 -0
- package/fixtures/mcp_snapshots/compile_codex_turn.req.json +7 -0
- package/fixtures/mcp_snapshots/compile_codex_turn.res.json +5 -0
- package/fixtures/mcp_snapshots/export_agents.req.json +4 -0
- package/fixtures/mcp_snapshots/export_agents.res.json +73 -0
- package/fixtures/mcp_snapshots/find_entity.req.json +7 -0
- package/fixtures/mcp_snapshots/find_entity.res.json +24 -0
- package/fixtures/mcp_snapshots/get_cross_agent_summary.req.json +7 -0
- package/fixtures/mcp_snapshots/get_cross_agent_summary.res.json +42 -0
- package/fixtures/mcp_snapshots/get_deeper_context.req.json +7 -0
- package/fixtures/mcp_snapshots/get_deeper_context.res.json +7 -0
- package/fixtures/mcp_snapshots/list_agents.req.json +4 -0
- package/fixtures/mcp_snapshots/list_agents.res.json +6 -0
- package/fixtures/mcp_snapshots/list_recent_work.req.json +8 -0
- package/fixtures/mcp_snapshots/list_recent_work.res.json +38 -0
- package/fixtures/mcp_snapshots/prepare_recognition_context.req.json +7 -0
- package/fixtures/mcp_snapshots/prepare_recognition_context.res.json +19 -0
- package/fixtures/mcp_snapshots/query_agent_memory.req.json +8 -0
- package/fixtures/mcp_snapshots/query_agent_memory.res.json +25 -0
- package/fixtures/mcp_snapshots/seed_library.json +24 -0
- package/fixtures/native_stores/README.json +24 -0
- package/fixtures/native_stores/claude_code/expected_l5.json +72 -0
- package/fixtures/native_stores/claude_code/store/auto_memory/MEMORY.md +3 -0
- package/fixtures/native_stores/claude_code/store/auto_memory/clyde.md +7 -0
- package/fixtures/native_stores/claude_code/store/auto_memory/ry-guy.md +6 -0
- package/fixtures/native_stores/claude_code/store/brain/LOG/2026-06-28-pc.md +3 -0
- package/fixtures/native_stores/claude_code/store/brain/PROJECTS/Bourdon/OVERVIEW.md +3 -0
- package/fixtures/native_stores/claude_code/store/brain/PROJECTS/OldThing/OVERVIEW.md +5 -0
- package/fixtures/native_stores/claude_code/store/knowledge_graph/memory.jsonl +3 -0
- package/fixtures/native_stores/github_copilot/cache/github-copilot/payload.json +21 -0
- package/fixtures/native_stores/github_copilot/expected_l5.json +67 -0
- package/fixtures/native_stores/hermes/expected_l5.json +108 -0
- package/fixtures/native_stores/hermes/store/.hermes/memories/memory.md +2 -0
- package/fixtures/native_stores/hermes/store/.hermes/memories/user.md +2 -0
- package/fixtures/native_stores/hermes/store/.hermes/state.db +0 -0
- package/fixtures/on_disk/audit.jsonl +5 -0
- package/fixtures/on_disk/auth_vectors.json +55 -0
- package/fixtures/on_disk/federation.yaml +22 -0
- package/fixtures/recognition_golden_v1.yaml +106 -0
- package/fixtures/recognition_vectors.json +448 -0
- package/fixtures/redaction_battery.json +473 -0
- package/fixtures/tier_matrix.json +398 -0
- package/fixtures/turn_compiler_vectors.json +645 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work; and
|
|
103
|
+
|
|
104
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
105
|
+
distribution, then any Derivative Works that You distribute must
|
|
106
|
+
include a readable copy of the attribution notices contained
|
|
107
|
+
within such NOTICE file.
|
|
108
|
+
|
|
109
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
110
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
111
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
112
|
+
this License, without any additional terms or conditions.
|
|
113
|
+
|
|
114
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
115
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
116
|
+
except as required for reasonable and customary use in describing the
|
|
117
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
118
|
+
|
|
119
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed
|
|
120
|
+
to in writing, Licensor provides the Work (and each Contributor
|
|
121
|
+
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES
|
|
122
|
+
OR CONDITIONS OF ANY KIND, either express or implied, including,
|
|
123
|
+
without limitation, any warranties or conditions of TITLE,
|
|
124
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
125
|
+
|
|
126
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
127
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
128
|
+
unless required by applicable law (such as deliberate and grossly
|
|
129
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
130
|
+
liable to You for damages, including any direct, indirect, special,
|
|
131
|
+
incidental, or consequential damages of any character arising as a
|
|
132
|
+
result of this License or out of the use or inability to use the
|
|
133
|
+
Work.
|
|
134
|
+
|
|
135
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
136
|
+
the Work or Derivative Works thereof, You may choose to offer, and
|
|
137
|
+
charge a fee for, acceptance of support, warranty, indemnity, or
|
|
138
|
+
other liability obligations and/or rights consistent with this
|
|
139
|
+
License. However, in accepting such obligations, You may act only
|
|
140
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
141
|
+
of any other Contributor.
|
|
142
|
+
|
|
143
|
+
END OF TERMS AND CONDITIONS
|
|
144
|
+
|
|
145
|
+
Copyright 2026 RADLAB LLC
|
|
146
|
+
|
|
147
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
148
|
+
you may not use this file except in compliance with the License.
|
|
149
|
+
You may obtain a copy of the License at
|
|
150
|
+
|
|
151
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
152
|
+
|
|
153
|
+
Unless required by applicable law or agreed to in writing, software
|
|
154
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
155
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
156
|
+
See the License for the specific language governing permissions and
|
|
157
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @getbourdon/conformance
|
|
2
|
+
|
|
3
|
+
Language-neutral **cross-implementation parity fixtures** for [Bourdon](https://bourdon.ai).
|
|
4
|
+
|
|
5
|
+
Python (`pip install bourdon`) is the **oracle**. The `@getbourdon/*` TypeScript mirror is conformant iff it
|
|
6
|
+
reproduces the oracle's output on these exact fixtures — byte-for-byte where the contract is bytes (redaction,
|
|
7
|
+
recognition strings, MCP wire), value-for-value where it's structured (F1, schema validity, tool I/O).
|
|
8
|
+
|
|
9
|
+
The fixtures are generated by the Python repo's `tools/gen_conformance.py` (the single writer) and consumed by
|
|
10
|
+
both the Python test suite and the TS `vitest` suite. This package ships them with typed loaders.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { loadRedactionBattery, assembleSecret } from "@getbourdon/conformance";
|
|
14
|
+
|
|
15
|
+
const battery = loadRedactionBattery();
|
|
16
|
+
for (const secret of battery.secrets) {
|
|
17
|
+
// a faithful TS redaction port must produce battery's expected output:
|
|
18
|
+
expect(redactText(assembleSecret(secret))).toBe(secret.expect_redacted);
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Resolution (Phase 0–1):** `BOURDON_CONFORMANCE_DIR`, else the sibling Python checkout
|
|
23
|
+
`../bourdon/conformance`. Once published, the fixtures ship inside this package.
|
|
24
|
+
|
|
25
|
+
License: Apache-2.0 (the wire-contract surface is permissive so third parties can build conformant
|
|
26
|
+
implementations). The Bourdon engine is BUSL-1.1.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
assembleSecret: () => assembleSecret,
|
|
24
|
+
conformanceDir: () => conformanceDir,
|
|
25
|
+
loadManifest: () => loadManifest,
|
|
26
|
+
loadRedactionBattery: () => loadRedactionBattery
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
var import_node_fs = require("fs");
|
|
30
|
+
var import_node_path = require("path");
|
|
31
|
+
var import_node_url = require("url");
|
|
32
|
+
var import_meta = {};
|
|
33
|
+
function moduleDir() {
|
|
34
|
+
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
35
|
+
return (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
36
|
+
}
|
|
37
|
+
return typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
38
|
+
}
|
|
39
|
+
function conformanceDir() {
|
|
40
|
+
const override = process.env.BOURDON_CONFORMANCE_DIR;
|
|
41
|
+
if (override) return override;
|
|
42
|
+
const bundled = (0, import_node_path.resolve)(moduleDir(), "..", "fixtures");
|
|
43
|
+
if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(bundled, "manifest.json"))) return bundled;
|
|
44
|
+
return (0, import_node_path.resolve)(process.cwd(), "..", "..", "bourdon", "conformance");
|
|
45
|
+
}
|
|
46
|
+
function loadJson(name) {
|
|
47
|
+
return JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.resolve)(conformanceDir(), name), "utf8"));
|
|
48
|
+
}
|
|
49
|
+
function loadManifest() {
|
|
50
|
+
return loadJson("manifest.json");
|
|
51
|
+
}
|
|
52
|
+
function loadRedactionBattery() {
|
|
53
|
+
return loadJson("redaction_battery.json");
|
|
54
|
+
}
|
|
55
|
+
function assembleSecret(secret) {
|
|
56
|
+
return secret.fragments.join("");
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
assembleSecret,
|
|
61
|
+
conformanceDir,
|
|
62
|
+
loadManifest,
|
|
63
|
+
loadRedactionBattery
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { 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 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,qBAAyC;AACzC,uBAAiC;AACjC,sBAA8B;AAF9B;AAyBA,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;AAkCO,SAAS,iBAAyB;AACvC,QAAM,WAAW,QAAQ,IAAI;AAC7B,MAAI,SAAU,QAAO;AAErB,QAAM,cAAU,0BAAQ,UAAU,GAAG,MAAM,UAAU;AACrD,UAAI,+BAAW,0BAAQ,SAAS,eAAe,CAAC,EAAG,QAAO;AAE1D,aAAO,0BAAQ,QAAQ,IAAI,GAAG,MAAM,MAAM,WAAW,aAAa;AACpE;AAEA,SAAS,SAAY,MAAiB;AACpC,SAAO,KAAK,UAAM,iCAAa,0BAAQ,eAAe,GAAG,IAAI,GAAG,MAAM,CAAC;AACzE;AAEO,SAAS,eAAoC;AAClD,SAAO,SAA8B,eAAe;AACtD;AAEO,SAAS,uBAAyC;AACvD,SAAO,SAA2B,wBAAwB;AAC5D;AAGO,SAAS,eAAe,QAAqC;AAClE,SAAO,OAAO,UAAU,KAAK,EAAE;AACjC;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface RedactionSecretCase {
|
|
2
|
+
/** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */
|
|
3
|
+
fragments: string[];
|
|
4
|
+
expect_redacted: string;
|
|
5
|
+
expect_contains_secret: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface RedactionBenignCase {
|
|
8
|
+
text: string;
|
|
9
|
+
expect_redacted: string;
|
|
10
|
+
expect_contains_secret: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface RedactionBattery {
|
|
13
|
+
redacted_sentinel: string;
|
|
14
|
+
benign_limit: number;
|
|
15
|
+
secrets: RedactionSecretCase[];
|
|
16
|
+
benign: RedactionBenignCase[];
|
|
17
|
+
}
|
|
18
|
+
interface ConformanceFixtureMeta {
|
|
19
|
+
path: string;
|
|
20
|
+
sha256: string;
|
|
21
|
+
producer: string;
|
|
22
|
+
}
|
|
23
|
+
interface ConformanceManifest {
|
|
24
|
+
conformance_version: string;
|
|
25
|
+
produced_against: {
|
|
26
|
+
bourdon_version: string;
|
|
27
|
+
};
|
|
28
|
+
fixtures: ConformanceFixtureMeta[];
|
|
29
|
+
}
|
|
30
|
+
declare function conformanceDir(): string;
|
|
31
|
+
declare function loadManifest(): ConformanceManifest;
|
|
32
|
+
declare function loadRedactionBattery(): RedactionBattery;
|
|
33
|
+
/** Reconstruct a secret case's runtime string from its fragments. */
|
|
34
|
+
declare function assembleSecret(secret: RedactionSecretCase): string;
|
|
35
|
+
|
|
36
|
+
export { type ConformanceFixtureMeta, type ConformanceManifest, type RedactionBattery, type RedactionBenignCase, type RedactionSecretCase, assembleSecret, conformanceDir, loadManifest, loadRedactionBattery };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface RedactionSecretCase {
|
|
2
|
+
/** Joined at load (`assembleSecret`) so no contiguous secret literal lands in git. */
|
|
3
|
+
fragments: string[];
|
|
4
|
+
expect_redacted: string;
|
|
5
|
+
expect_contains_secret: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface RedactionBenignCase {
|
|
8
|
+
text: string;
|
|
9
|
+
expect_redacted: string;
|
|
10
|
+
expect_contains_secret: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface RedactionBattery {
|
|
13
|
+
redacted_sentinel: string;
|
|
14
|
+
benign_limit: number;
|
|
15
|
+
secrets: RedactionSecretCase[];
|
|
16
|
+
benign: RedactionBenignCase[];
|
|
17
|
+
}
|
|
18
|
+
interface ConformanceFixtureMeta {
|
|
19
|
+
path: string;
|
|
20
|
+
sha256: string;
|
|
21
|
+
producer: string;
|
|
22
|
+
}
|
|
23
|
+
interface ConformanceManifest {
|
|
24
|
+
conformance_version: string;
|
|
25
|
+
produced_against: {
|
|
26
|
+
bourdon_version: string;
|
|
27
|
+
};
|
|
28
|
+
fixtures: ConformanceFixtureMeta[];
|
|
29
|
+
}
|
|
30
|
+
declare function conformanceDir(): string;
|
|
31
|
+
declare function loadManifest(): ConformanceManifest;
|
|
32
|
+
declare function loadRedactionBattery(): RedactionBattery;
|
|
33
|
+
/** Reconstruct a secret case's runtime string from its fragments. */
|
|
34
|
+
declare function assembleSecret(secret: RedactionSecretCase): string;
|
|
35
|
+
|
|
36
|
+
export { type ConformanceFixtureMeta, type ConformanceManifest, type RedactionBattery, type RedactionBenignCase, type RedactionSecretCase, assembleSecret, conformanceDir, loadManifest, loadRedactionBattery };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
function moduleDir() {
|
|
6
|
+
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
7
|
+
return dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
}
|
|
9
|
+
return typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
10
|
+
}
|
|
11
|
+
function conformanceDir() {
|
|
12
|
+
const override = process.env.BOURDON_CONFORMANCE_DIR;
|
|
13
|
+
if (override) return override;
|
|
14
|
+
const bundled = resolve(moduleDir(), "..", "fixtures");
|
|
15
|
+
if (existsSync(resolve(bundled, "manifest.json"))) return bundled;
|
|
16
|
+
return resolve(process.cwd(), "..", "..", "bourdon", "conformance");
|
|
17
|
+
}
|
|
18
|
+
function loadJson(name) {
|
|
19
|
+
return JSON.parse(readFileSync(resolve(conformanceDir(), name), "utf8"));
|
|
20
|
+
}
|
|
21
|
+
function loadManifest() {
|
|
22
|
+
return loadJson("manifest.json");
|
|
23
|
+
}
|
|
24
|
+
function loadRedactionBattery() {
|
|
25
|
+
return loadJson("redaction_battery.json");
|
|
26
|
+
}
|
|
27
|
+
function assembleSecret(secret) {
|
|
28
|
+
return secret.fragments.join("");
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
assembleSecret,
|
|
32
|
+
conformanceDir,
|
|
33
|
+
loadManifest,
|
|
34
|
+
loadRedactionBattery
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { 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 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,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;AAkCO,SAAS,iBAAyB;AACvC,QAAM,WAAW,QAAQ,IAAI;AAC7B,MAAI,SAAU,QAAO;AAErB,QAAM,UAAU,QAAQ,UAAU,GAAG,MAAM,UAAU;AACrD,MAAI,WAAW,QAAQ,SAAS,eAAe,CAAC,EAAG,QAAO;AAE1D,SAAO,QAAQ,QAAQ,IAAI,GAAG,MAAM,MAAM,WAAW,aAAa;AACpE;AAEA,SAAS,SAAY,MAAiB;AACpC,SAAO,KAAK,MAAM,aAAa,QAAQ,eAAe,GAAG,IAAI,GAAG,MAAM,CAAC;AACzE;AAEO,SAAS,eAAoC;AAClD,SAAO,SAA8B,eAAe;AACtD;AAEO,SAAS,uBAAyC;AACvD,SAAO,SAA2B,wBAAwB;AAC5D;AAGO,SAAS,eAAe,QAAqC;AAClE,SAAO,OAAO,UAAU,KAAK,EAAE;AACjC;","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# `conformance/` — cross-implementation parity fixtures
|
|
2
|
+
|
|
3
|
+
**Python is the oracle.** These language-neutral fixtures are the contract that the
|
|
4
|
+
TypeScript mirror (`getbourdon/bourdon-js`, published as `@bourdon/*`) must reproduce
|
|
5
|
+
exactly. The TS mirror is *conformant* iff it produces the same output as Python on
|
|
6
|
+
these fixtures — byte-for-byte where the contract is bytes (redaction, recognition
|
|
7
|
+
strings, MCP wire), value-for-value where it's structured (F1, schema validity, tool I/O).
|
|
8
|
+
|
|
9
|
+
This directory is **generated** by `tools/gen_conformance.py` (the single writer) — it
|
|
10
|
+
imports the live oracle modules and emits their actual output, so expectations can never
|
|
11
|
+
be hand-typed out of sync with the code. Two mechanical suites assert against the *same
|
|
12
|
+
bytes*: `tests/test_redaction.py` (Python, characterization) and the TS `vitest`
|
|
13
|
+
conformance suite (parity). A CI drift gate runs the generator and fails on an
|
|
14
|
+
uncommitted diff (`git diff --exit-code -- conformance/`).
|
|
15
|
+
|
|
16
|
+
## Regenerate
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
python tools/gen_conformance.py # rewrites conformance/ + manifest.json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
After changing a pattern in `core.redaction` (or any oracle), regenerate, review the
|
|
23
|
+
diff, and bump `conformance_version` in `tools/gen_conformance.py` (patch = added cases,
|
|
24
|
+
minor = new family, major = a changed expected-output = a reviewed behavior change).
|
|
25
|
+
|
|
26
|
+
## Contents
|
|
27
|
+
|
|
28
|
+
| File | Family | Source (extracted from) | Phase |
|
|
29
|
+
|------|--------|-------------------------|-------|
|
|
30
|
+
| `redaction_battery.json` | redaction | `tests/test_redaction.py` SECRETS/BENIGN | ✅ wired |
|
|
31
|
+
| `manifest.json` | index | (generated) | ✅ |
|
|
32
|
+
| `recognition_vectors.json` | recognition | `test_recognition_{contract,parity}.py` | ✅ wired |
|
|
33
|
+
| `l5_schema.json` + `l5_manifests/` | schema | `spec/L5_schema.json` | ✅ wired |
|
|
34
|
+
| `tier_matrix.json` | trust (D4) | `create_l6_server` enforcement over the seed | ✅ wired |
|
|
35
|
+
| `fed_seed_library/agents/*.l5.yaml` | seed input | 2-agent library, public/team/private | ✅ wired |
|
|
36
|
+
| `on_disk/federation.yaml` + `audit.jsonl` + `auth_vectors.json` | on-disk trust state | real `FederationRegistry` + `FederationAudit` | ✅ wired |
|
|
37
|
+
| `mcp_snapshots/` | wire | live `create_l6_server` tool closures over `fed_seed_library` | ✅ wired |
|
|
38
|
+
|
|
39
|
+
The L6 **federation** families are the cross-machine trust boundary. `tier_matrix.json` drives
|
|
40
|
+
the live `create_l6_server` enforcement (a quarantined `openclaw` granted only `claude-code`) and
|
|
41
|
+
pins, per `tool x trust-tier x granted`, the allow/deny decision plus the verbatim structured-denial
|
|
42
|
+
dict. `on_disk/` holds Python-written artifacts the TS side must parse identically: a registry with
|
|
43
|
+
**sha256-only** rows for **synthetic** `bdn_` tokens (stored as fragment arrays in `auth_vectors.json`,
|
|
44
|
+
never a contiguous literal), and an append-only audit log produced by the real `record()` with frozen
|
|
45
|
+
timestamps. Both pytest (`tests/test_federation_conformance.py`) and the TS vitest suite assert these.
|
|
46
|
+
|
|
47
|
+
The `mcp_snapshots/` family pins the **JSON-in-TextContent wire contract** for all 10 L6
|
|
48
|
+
MCP tools. Each `*.res.json` is the live tool's payload (as `RemoteL6Client` recovers it:
|
|
49
|
+
`json.loads` of the single `TextContent.text` = `json.dumps(payload)`) run through one codified
|
|
50
|
+
NORMALIZER — sort object keys, round floats to 4dp, drop null/empty-list fields (to_dict
|
|
51
|
+
omission), freeze `last_updated`/`generated_at`/`generated_from`/`path`, drop latency fields,
|
|
52
|
+
and decode base64 `next_cursor` to its `{offset}` payload. The normalizer is itself fixture-tested
|
|
53
|
+
in `mcp_snapshots/_normalizer.json`. `compile_codex_turn` is the **deferred P7 stub** (its brief is
|
|
54
|
+
environment-bound — live cwd + git repo identity — so it is not a portable parity fixture yet).
|
|
55
|
+
|
|
56
|
+
Token-shaped secrets are stored as **fragment arrays** joined at load time, so no
|
|
57
|
+
contiguous secret literal ever lands in git (GitHub push-protection scans literals).
|
|
58
|
+
Both loaders `"".join(fragments)`.
|
|
59
|
+
|
|
60
|
+
See the master plan: `claude-brain/PROJECTS/NEUROLAYER/PLAN_TS_MIRROR_2026-06-29.md` and
|
|
61
|
+
the `bourdon-parity-fixture-harness` / `bourdon-py-to-ts-port` skills.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
spec_version: '0.1'
|
|
2
|
+
agent:
|
|
3
|
+
id: claude-code
|
|
4
|
+
type: code-assistant
|
|
5
|
+
instance: pc-threadripper
|
|
6
|
+
role_narrative: Lead code-assistant on the federation substrate.
|
|
7
|
+
last_updated: '2026-06-29T12:00:00+00:00'
|
|
8
|
+
capabilities:
|
|
9
|
+
- code-read
|
|
10
|
+
- code-write
|
|
11
|
+
known_entities:
|
|
12
|
+
- name: Bourdon
|
|
13
|
+
type: project
|
|
14
|
+
aliases:
|
|
15
|
+
- NeuroLayer
|
|
16
|
+
- Continuo
|
|
17
|
+
summary: Cross-agent memory federation (granted side).
|
|
18
|
+
tags:
|
|
19
|
+
- infra
|
|
20
|
+
visibility: public
|
|
21
|
+
- name: Roadmap
|
|
22
|
+
type: concept
|
|
23
|
+
summary: Phase 1.7 federation roadmap.
|
|
24
|
+
tags:
|
|
25
|
+
- team
|
|
26
|
+
visibility: team
|
|
27
|
+
- name: Quarterly Revenue
|
|
28
|
+
type: concept
|
|
29
|
+
summary: Q2 numbers.
|
|
30
|
+
tags:
|
|
31
|
+
- financial
|
|
32
|
+
visibility: private
|
|
33
|
+
recent_sessions:
|
|
34
|
+
- date: '2026-06-08'
|
|
35
|
+
cwd: /c/Users/cumul/repos/bourdon
|
|
36
|
+
project_focus:
|
|
37
|
+
- Bourdon
|
|
38
|
+
key_actions:
|
|
39
|
+
- wired tier matrix fixtures
|
|
40
|
+
files_touched:
|
|
41
|
+
- tools/gen_conformance.py
|
|
42
|
+
visibility: public
|
|
43
|
+
- date: '2026-06-07'
|
|
44
|
+
cwd: /c/Users/cumul/repos/bourdon
|
|
45
|
+
project_focus:
|
|
46
|
+
- Roadmap
|
|
47
|
+
key_actions:
|
|
48
|
+
- team planning
|
|
49
|
+
visibility: team
|
|
50
|
+
- date: '2026-06-06'
|
|
51
|
+
cwd: /c/Users/cumul/repos/bourdon
|
|
52
|
+
project_focus:
|
|
53
|
+
- Quarterly Revenue
|
|
54
|
+
key_actions:
|
|
55
|
+
- private review
|
|
56
|
+
visibility: private
|
|
57
|
+
visibility_policy:
|
|
58
|
+
default: public
|
|
59
|
+
private_tags:
|
|
60
|
+
- financial
|
|
61
|
+
- personal
|
|
62
|
+
team_tags:
|
|
63
|
+
- team
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
spec_version: '0.1'
|
|
2
|
+
agent:
|
|
3
|
+
id: codex
|
|
4
|
+
type: code-assistant
|
|
5
|
+
last_updated: '2026-06-29T12:00:00+00:00'
|
|
6
|
+
known_entities:
|
|
7
|
+
- name: SecretProj
|
|
8
|
+
type: project
|
|
9
|
+
summary: Known only by codex (ungranted namespace).
|
|
10
|
+
visibility: public
|
|
11
|
+
- name: Bourdon
|
|
12
|
+
type: project
|
|
13
|
+
summary: Federation, codex view.
|
|
14
|
+
visibility: public
|
|
15
|
+
- name: Internal Notes
|
|
16
|
+
type: concept
|
|
17
|
+
summary: codex private.
|
|
18
|
+
tags:
|
|
19
|
+
- personal
|
|
20
|
+
visibility: private
|
|
21
|
+
recent_sessions:
|
|
22
|
+
- date: '2026-06-08'
|
|
23
|
+
cwd: /y
|
|
24
|
+
project_focus:
|
|
25
|
+
- SecretProj
|
|
26
|
+
key_actions:
|
|
27
|
+
- codex work
|
|
28
|
+
visibility: public
|
|
29
|
+
- date: '2026-06-05'
|
|
30
|
+
cwd: /y
|
|
31
|
+
project_focus:
|
|
32
|
+
- Internal Notes
|
|
33
|
+
key_actions:
|
|
34
|
+
- codex private
|
|
35
|
+
visibility: team
|