Repository navigation
v0.7.0
OKF 0.7.0
BREAKING CHANGE — Upgrade shared-bundle readers before adopting manifest v2. The
0.7 plugin requires a stable CLI in the range >=0.7.0, <0.8.0. Scripts that distinguish
usage errors from lock contention must handle exit 3 for a blocked working-tree read.
See the 0.7 migration guide.
Context compilation
People and agents using the OKF plugin can now ask for the evidence a particular decision
needs. In the meter-replacement example, the technician needs the Recovery instructions
and the Applicability section that says when they apply. The task declares those readings.
OKF can follow the declarations, return the relevant passages with their sources, and report
whether the handoff meets the team’s requirements.
Choose how to find the material
| When | What to use | What comes back |
|---|---|---|
| You know the concepts, headings, or metadata fields you need. | An exact batch with okf read --from @reads.yaml. Give each request a key and mark optional readings explicitly. |
An outcome for each key. Two requests for the same passage can share its text and retain their separate purposes. |
| The readings depend on the task and its relationships. | A version 2 saved query with okf query. Its author defines which relationships to follow, which passages to select, and which requirements to check. |
Selected evidence and the outcome of each requirement. The same rule can prepare a handoff for a different task without hard-coding that task’s reading list. |
Exact batches work with standalone bundles and manifest v1 or v2. Versioned saved queries
require manifest v2. Unversioned queries retain their existing behavior in either supported
manifest version. The OKF document format remains v0.2.
See what the evidence supports
In the worked example, rerunning the query after the review expires still retrieves the
instructions. The result reports acquisition: complete, but current-review-evidence
fails and the command exits 1. The agent can identify the material that needs review before
the technician relies on it. Freshness and verification are checked when the query author
declares those requirements.
A required heading that was examined and found missing produces a failed obligation.
An unavailable source can leave the obligation unknown. A missing optional reading remains
visible alongside the usable passages. These distinctions let the recipient decide which
step to pause and what to investigate. Coverage applies to the declared relationships and
the bundles actually examined.
Render the handoff for a person or an agent
A version 2 query can return a Markdown report directly with okf query … --format md.
To render the same acquisition later, retain its complete --json stream. Both exact reads and
version 2 query streams work with okf render --from @result.ndjson: choose --format md
for a human-readable report or --format agent for an agent handoff. Both preserve the captured
passages, original evaluation time, and failed or unknown requirements without rereading sources.
See the rendering example.
Supply current task guidance separately. Follow the worked handoff
or inspect its exact-read request.
Validate references to specific headings
A file can still exist after someone renames its Recovery heading. An ordinary file check
can therefore succeed while a task’s link to operations.md#recovery has lost its target.
OKF 0.7 adds an opt-in heading-reference rule to okf lint for this case.
In a v2 manifest, set settings.lint.heading_reference to warn or error (default: off).
Lint reports missing or ambiguous headings and invalid or unsupported selectors. It reports
unavailable or out-of-scope targets as unchecked, so readers can distinguish a broken
reference from one the run could not examine.
Before renaming a heading, use okf affected with --changed and --heading-consumers
to find concept references and saved-query selections that depend on sections in that concept.
For queries that start from a concept, supply known IDs with --consumer-start and inspect
any reported gaps. See section selectors
and the heading lint migration instructions.
Build Rust utilities with OKF Core
Until 0.7, the OKF CLI was the only consumer of okf-core. This release gives engineers
a typed Rust API for embedding the context compiler in their own tools. For example, a review
bot can evaluate a team’s saved query, flag a missing or expired reading in its UI, and attach
the supporting passages to the review. The bot calls the library directly and receives Rust
values it can inspect without launching the CLI or parsing its NDJSON output.
| In your utility | Use the API |
|---|---|
| Choose what to read | Open a ReadSession with the bundle selection and examination scope. Set revisions, evaluation time, or resource limits when the task calls for them. |
| Acquire the evidence | Pass a QueryRequest to session.evaluate: use exact for known passages, named for a bundle’s v2 query, or inline for a definition supplied by your application. |
| Decide what to do | Inspect the owned QueryResult. Use outcome().satisfaction() and requirements() to decide whether to proceed, and passages() to show the evidence. Evaluation can succeed while a requirement fails. |
| Deliver or reuse the result | Call render_query for agent text, Markdown, or HTML. Choose full or summary output and optionally map rendered byte ranges back to evidence. Encode a result for storage, decode it with validation, or compare a later evaluation against its baseline. |
Start with the tested Rust example, which opens a
standalone bundle, requests a heading, and inspects both its acquisition status and text.
The evidence API covers retained results and
baselines. For manifest inspection and typed error handling, see the
0.7 API migration notes.
Working-tree read contention
changeset digest now uses shared read locks across its requested bundle scope. It can run
alongside other readers and returns the same guarded baseline value as changeset plan for
the same inputs.
When an exclusive lock blocks changeset digest or an ordinary working-tree read, the command
exits 3. Scripts that handled the previous usage exit 2 or the scoped digest's incomplete-gate
exit 1 should use the lock-busy reason and retryable: true in the NDJSON completion record.
A pending transaction journal still requires changeset recover. Permission errors and invalid
lock paths carry their own diagnostics.