Skip to content

v0.9.0

Latest

Choose a tag to compare

@github-actions github-actions released this 21 Nov 11:26
v0.9.0
74e5863

Release v0.9.0: OKF v0.3 Conformance, Write Protection, Change History & Git Freshness

Release v0.9.0 upgrades okf-agent-memory to full Open Knowledge Format (OKF) v0.3 conformance (while preserving v0.2 compatibility fallbacks), adds Programmatic Write Protection (x-okf-memory-protected: true and governance: hold downgrade protection), introduces Time-Range Change Queries (okf changes --since / MCP okf_changes) with optional change_note logging, closes the stale_after write lifecycle gap across CLI & MCP, and surfaces Computed Trust Tiers & Optional Git Freshness / Code-Drift Signals (--with-git-freshness, --drift-git). Because OKF v0.3 trust-tier semantics and file-relative path resolution for v0.3 bundles are breaking conformance changes, this is a minor release (v0.9.0).


1. Breaking Changes & Migration

  • OKF v0.3 Trust-Tier Semantics (verified.at >= generated.at).
    • Only current verifications (verified.at >= generated.at, or all if generated.at is absent) now qualify for active trust tiers (human-reviewed / machine-confirmed) and Scorecard Pillar 2 (Human Stewardship, 100 points).
    • Older verifications (verified.at < generated.at) remain in the file as audit history and no longer emit a GateFinding in okf validate --strict.
    • Impact: Existing bundles where an agent edited a concept after a human review will drop in trust tier and Scorecard Pillar 2 until re-verified by a human actor.
    • team: is now accepted as a valid actor scheme (IsValidActor) and yields machine-confirmed, never human-reviewed.
  • Unified File-Relative Path & Link Resolution for OKF v0.3 Bundles.
    • In bundles declaring okf_version: "0.3" (or later), both Markdown body links and frontmatter path fields (resource, superseded_by, sources[].resource, computation, executor.resource, attester.resource) resolve identically: RFC 3986 scheme = external URL, leading / = bundle root, otherwise relative to the containing file's directory.
    • v0.2 Compatibility Fallback: Existing bundles with okf_version: "0.2" or without okf_version continue to work via automatic bundle-root fallback if a file-relative lookup does not match.

2. Features

  • Full OKF v0.3 Conformance (epic-okf-v03).
    • Root index.md Metadata & v0.3 Default: Parses okf_version, title, description, and license into first-class Bundle metadata and preserves root index.md frontmatter verbatim across init, create, update, and sync. New bundles created via okf init and okf bootstrap now default to okf_version: "0.3" (v0.2 remains supported for backward compatibility), and this repository's own knowledge/ bundle has been migrated to okf_version: "0.3".
    • Collision-Free x- Extensions & Fault-Tolerant Parsing: Preserves unknown keys and x-<producer>-<name> extensions losslessly at root and nested levels (generated, verified, sources, parameters, executor, attester) across Parse -> Edit -> Serialize roundtrips. Cleanly skips non-OKF .md files without type: (README.md, AGENTS.md, CONTRIBUTING.md, SKILL.md), indexes non-Markdown files as linkable bundle assets, and handles null/empty/scalar-list inputs gracefully while surfacing validator warnings.
    • Lifecycle Forwarding (superseded_by): Parses and serializes superseded_by, indexes it as a directed graph edge (preventing false orphans), validates target existence and cycle safety, and forwards deprecated stubs cleanly in okf show and okf search.
  • Programmatic Write Protection for Critical Concepts.
    • Concepts declaring x-okf-memory-protected: true reject edits from non-human actors (!IsHumanIdentity(actor)) in mutate.go, including bypass attempts that strip or unset the flag.
    • Hold Downgrade Guard: Non-human actors cannot downgrade or clear an existing governance: hold on disk, even when x-okf-memory-protected: true is omitted.
    • CLI-Only Override: Human operators can override via okf update --allow-protected; no override parameter is exposed in MCP tools.
    • Validator Check: okf validate --strict flags protected concepts lacking human provenance (generated.by: human:... or a current human verified entry).
  • Time-Range Change History (okf changes --since / MCP okf_changes) & change_note.
    • Query created, updated, related, or deprecated/deleted concepts within [since, until] using ISO dates/timestamps or relative durations (1d, 2w), returning titles, descriptions, and timestamped operations without requiring Git.
    • Added optional --change-note / change_note on create, update, and relate, persisted in log.md while remaining 100% backward-compatible with legacy date-only entries and MergeLogContent.
  • stale_after Write Support (CLI & MCP).
    • Added --stale-after to okf create / okf update and stale_after to MCP okf_create / okf_update. Supports YYYY-MM-DD, ISO 8601 timestamps, relative durations (14d, 2w, 3m), and "" to remove the key; past dates succeed with a warning; changes are logged to log.md.
  • Computed Staleness Signals & Optional Git Freshness / Code Drift.
    • okf search --json, okf show, and MCP okf_search / okf_show now surface computed trust_tier and staleness (last_touched_at, optional commit, provider) without adding any new frontmatter keys.
    • Default mode uses frontmatter generated.at / file mtime (provider: "frontmatter") with zero subprocess overhead; opt-in --with-git-freshness / with_git_freshness enriches via a single batched git log (provider: "git").
    • Added okf validate --drift-git (and MCP okf_validate(drift_git=true)) to flag concepts whose code_refs files have newer Git commits than the concept's last_touched_at.

3. Security & Conformance Hardening

  • Enforced unified CWE-22 path-traversal confinement in (*Bundle).ResolvePath across body links and frontmatter path fields (rejecting .., %2e%2e, backslashes, Windows drives, and UNC paths).
  • Extended frontmatter smuggling defenses (frontmatterSmuggleRegex and sanitizeConceptMetadata) to cover stale_after, superseded_by, and x-okf-memory-protected.

4. Documentation & Knowledge


5. Community & Special Thanks

  • Thank you to delimitdev (Reddit) for the feedback and design inspiration behind progressive Git freshness (last_touched) and relative code_refs drift detection.

🌐 Discover & Share Knowledge: OKF Registry

Scale persistent memory across projects and agent sessions with the decentralized OKF Registry:

  • Browse & Share: Discover curated, quality-scored memory packages (e.g. framework best practices, architecture rules, compliance guidelines) at registry.okf-memory.dev.
  • Install in Seconds: Pull external knowledge directly into .okf/vendor/ with zero dependencies:
    okf pull <bundle-id>
  • Guaranteed Conformance: Every package is verifiable against Open Knowledge Quality Scorecards (--min-score) with atomic rollback to ensure deterministic agent consumption.

Pre-built Binaries & Verification

Release binaries are automatically built by GitHub Actions:

Full Changelog

Full Changelog: v0.8.0...v0.9.0