Historical document from source revision 61e75e9. This implementation plan is archived for reference and is not current implementation guidance. Original source.

Technical specification: CLI okf for OKF v0.2

1. Goal

Make every CLI read and write interface version-aware, expose v0.2 signals, and integrate a single migration planner without domain logic in main.go.

Dependencies: task09.md–task15.md.

2. Architecture

Keep cmd/okf/main.go as the bootstrap. Move command orchestration into internal/okfcli:

Version resolution, trust, staleness, provenance, graph, and migration come from domain packages. The CLI does not traverse raw YAML.

3. Shared selector

For bundle commands:

--spec auto|0.1|0.2

The default is auto; resolution follows task09. An explicit selector that conflicts with the declaration is a failure/assertion mismatch, not a silent override.

4. Commands

version

Text reports the CLI version separately from the supported/default OKF specifications. Add --json:

{
  "cli_version": "vX.Y.Z",
  "okf_spec_default": "0.2",
  "okf_spec_supported": ["0.1", "0.2"]
}

validate

Preserve existing flags and output fields; add:

v0.2 must not produce false positives for timestamp/Citations.

info

Add deterministic counts:

parse

Typed text/JSON projection:

Bare and list forms of verified produce the same result.

fmt

Remain parsing plus canonical serialization:

index

graph

Pass an explicit projection profile and options to package graph; stdout contains only the selected graph payload. Preserve legacy --dot.

migrate

okf migrate <bundle> --to 0.2
  [--from auto|0.1]
  [--actor <actor>]
  [--write]
  [--format text|json]

Default to a dry run. Delegate to the task15 planner; do not perform independent YAML/file edits. Apply uses a revision/digest-bound atomic store commit.

5. stdout/stderr/exit

6. Tests

All tests follow AAA.

7. Acceptance criteria

8. Out of scope

Execution/attestation runtime, LLM conversion of arbitrary SQL/prose, and changes to custom relations.