Historical document. This plan is preserved from source revision
61e75e9; it is not current implementation guidance. Original source.
Establish an executable contract for Open Knowledge Format v0.2 support before changing public APIs. This task is the dependency root for the other migration tasks.
Source of truth:
okf/SPEC.md, commit
3fcbb9f828c2f23d109c855ee403c3a4c81f3a96;Do not rely solely on the current main: reproducible builds and tests must
reference the pinned specification revision.
Supported versions:
0.1 — legacy reading/validation and migration source;0.2 — current default reading/writing contract;okf_version value.Resolution policy:
okf_version in the root index.md sets the contract.0.2, with the legacy
fallbacks from §13 permitted.The resolution model must distinguish:
declared, default, explicit, future-best-effort;The Go module, CLI binary, and plugin package versions are not okf_version.
Create a versioned matrix: spec clause → implementation → diagnostics → tests.
Hard [ERROR] diagnostics remain limited to §11:
type;index.md and log.md files.Optional v0.2 field families do not become hard requirements:
sources, usage_window;generated, verified;status, stale_after;The strict/policy layer checks malformed field families when present; they must not break permissive loading. Unknown keys/types/runtimes remain consumable.
Support two fallbacks without implicit migration:
timestamp only when generated is entirely absent;# Citations only when sources is absent.A legacy representation alone is not a conformance failure.
Reading, fmt, index, and graph operations must not rewrite v0.1 documents.
Migration must be a separate preview/apply operation with an explicit actor and source mapping.
Record tooling policy decisions separately from the upstream specification:
sources[].author references the actor convention, but upstream examples use
the undocumented team:*; validate it as a non-empty string;sources[].id are undefined; uniqueness is a
toolkit strict policy for safe attribution joins;sources[].resource may be a scope descriptor rather than a path/URI;today >= stale_after is undefined; tooling accepts an
explicit reference date, and the CLI default is documented separately;usage_count is not a score;runtime requirement and
remain strict guidance;relations is a skosovsky/okf extension, not part of upstream v0.2.Reflect each decision consistently in bundle, validator, CLI, MCP, fixtures, and documentation.
Add one shared corpus:
type;verified;Reuse fixtures in package tests, CLI/MCP E2E tests, and documentation snippets.
Explicitly exclude:
store.CommitReceipt is unrelated to executor.receipt.
go test ./... and git diff --check pass after adding the contract corpus.Order:
bundle.validator, graph, mutation engine, store guardrails.