feat: implement OKF v0.2 spec (provenance, trust, lifecycle, attested computations) - #15
Merged
Conversation
… computations) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream updated the OKF spec to v0.2 (SPEC.md last touched 2026-07-24). This PR closes the delta between the CLI (which implemented v0.1) and the current spec. Built test-first: every rule below landed as a failing test before its implementation.
Parsing (internal/concept)
sourceswith credibility signals (author,usage_count,last_modified) andusage_windowincl. per-entry override (§5.1);generated/verified(§5.2);status/stale_after(§5.4-5.5); Attested Computation contractruntime,parameters,computation,executor,attester(§10.2)verifiedmapping is treated as a one-element list, as §5.2/§11 require; malformed shapes are tolerated as empty so one bad concept cannot kill a bundle loadEffectiveStatusdefaulting to stable,IsStale(today >= stale_after), andGeneratedAtwith legacytimestampfallback (§13.1)tagsnow tolerates the comma-separated scalar form found in upstream's own generated bundles (consumers MUST NOT reject, §11) - previously this failed the whole bundle loadValidation (internal/validate)
Errors (MUST / REQUIRED-within-family violations): missing
runtimeon Attested Computation,generatedwithoutby,sourcesentry withoutresource, invalidstatusvalue, malformedstale_after, non-ISO log.md date headings (§9), frontmatter in a non-root index.md (§8).Warnings (SHOULD / legacy): legacy
timestampand# Citations(§13.1), stale concepts, actor-convention violations,verifiedentries missing by/at,usage_countwithout a framingusage_window, footnote labels that do not join intosources[].id(§5.1), missing computation (no inline section and nocomputationpath) or both provided (§10.3), contract paths pointing at files that do not exist (§6.2), unknownokf_version(§12), extra root-index frontmatter keys.Graph
Path-valued fields (§6.2) now produce derivation edges when they resolve to concepts:
sources[].resource(§5.1 lineage),computation,executor.resource,attester.resource. Bare root-relative paths (the form used by the spec's §10.2 example and upstream bundles) resolve via a bundle-root fallback.index / init / CLI surface
okf initdeclaresokf_version: "0.2"in the root index.md;okf indexpreserves an existing declaration when regenerating (and never adds one implicitly)okf showsurfaces status, trust_tier, stale, generated, verified, stale_after, sources, usage_window, and the full computation contractokf listadds status and trust_tier per concept;okf schemadescriptions updatedVerification
🤖 Generated with Claude Code