@getbourdon/l5
v0.4.0
Published
Bourdon L5 agent-memory manifest: schema-generated types, ajv (2020-12) validation, the visibility model, and the byte-faithful to_dict() + atomic YAML writer. Python (pip install bourdon) is the oracle; this mirror asserts against @getbourdon/conformance
Readme
@getbourdon/l5
The L5 agent-memory manifest layer of Bourdon — the per-agent public memory glossary that L6 federation aggregates across agents.
Python (pip install bourdon) is the oracle. This TypeScript mirror is conformant iff it reproduces the
oracle's output on the shared @getbourdon/conformance fixtures.
What's in here
schema/L5_schema.json— the normative JSON Schema (draft 2020-12), copied byte-identical from the Python repo (spec/L5_schema.json).$id = https://bourdon.ai/schema/L5_manifest_v0.1.json.- Generated types (
src/types.gen.ts) — produced from the schema viajson-schema-to-typescript(pnpm --filter @getbourdon/l5 gen). Hand-writing the wire types is banned; regenerate instead. validateManifest— ajv (2020-12 + formats) compiled over the same schema. Returns{ valid, errors }where each error carrieskeyword+ ajv-styleinstancePath.applyVisibility/filterForFederation— the visibility model. Precedence (highest first):private_tags▸ explicitvisibility▸team_tags▸policy.default(orpublic). Private entities are dropped from federation.toDict— the byte-faithfulto_dict()port (the L6 change-detection hash key): dropsNone/undefinedand empty-array fields, keepsVisibilityas its lowercase value, and emits keys in dataclass field order.writeL5/writeL5Dict/readL5Dict— atomic YAML write (tmp +fsync+ rename) and lenient read.
import { makeManifest, toDict, validateManifest, writeL5 } from "@getbourdon/l5";
const manifest = makeManifest({
spec_version: "0.1",
agent: { id: "alpha-agent", type: "note-capture" },
last_updated: "2026-06-29T12:00:00+00:00",
});
const { valid, errors } = validateManifest(toDict(manifest));
writeL5(manifest, "/path/to/agents/alpha-agent.yaml");Determinism notes (parity-critical)
Entityemitsvalid_from/valid_toaftervisibility(they were appended later in the dataclass).- A present
visibility_policyalways emitsdefault(defaults to"public") even if the caller omits it. - Empty arrays are dropped;
null/undefinedfields are dropped — never serialized asnullor[].
License: Apache-2.0 (the wire-contract surface is permissive so third parties can build conformant implementations). The Bourdon engine packages are BUSL-1.1.
