Repository navigation
Release v0.8.0: Bundle Scope Isolation, Concurrent Write Protection & Multi-Writer Sync Hardening
Release v0.8.0 introduces declarative Bundle Scope Isolation via scopes in the root knowledge/index.md frontmatter, adds Two-Stage Concurrent Local Write Protection (WithBundleLock and ErrConcurrentModification), hardens multi-writer Hub Sync conflict forks (#60, PR #66), wires automatic SSoT tool symlinks into okf bootstrap, and removes the legacy bundle alias for --scope across the CLI and MCP server. Because removing the --scope bundle alias is a breaking CLI/MCP schema change, this is a minor release (v0.8.0).
1. Breaking Changes & Migration
- Removed the legacy
bundlealias for--scope(okf searchand MCPokf_search).--scopenow accepts only the canonical scope names:all,project,vendor,user, andsystem.- Passing
--scope bundle(or"scope": "bundle"in MCPokf_search) now returns an invalid-scope error. - Migration: Replace
--scope bundlewith--scope project. The--bundle <dir>flag and the MCP"bundle"directory parameter remain unchanged.
2. Features
-
Declarative Bundle Scope Isolation (
scopesin rootknowledge/index.md).- Projects (such as client repositories, open-source projects, or isolated domains) can now restrict which memory layers are active by declaring an explicit
scopeslist in the rootknowledge/index.mdfrontmatter (both flow lists and block lists are supported):--- okf_version: "0.2" scopes: [project, vendor] ---
- Default Behavior: When
scopesis omitted, all four canonical scopes (project,vendor,user,system) remain active. - Implicit Filtering: Disabled scopes (e.g.
userandsystemin the example above) are automatically skipped during--scope allsearches (SearchLayered) and bare-IDokf show/okf_showfallback (ResolveScopedConcept). - Strict Enforcement: Explicit queries targeting a disabled scope (e.g.
okf search --scope user,okf show user:secret, orokf://user/secret) are rejected with an error:scope "user" is disabled by bundle configuration in index.md (allowed: project, vendor). - Fail-Closed Validation: Declaring an empty
scopeskey (scopes: []orscopes:) or any non-canonical value (such asall,bundle, or a typo) immediately fails bundle loading andokf validate.
- Projects (such as client repositories, open-source projects, or isolated domains) can now restrict which memory layers are active by declaring an explicit
-
Two-Stage Concurrent Local Write Protection (
WithBundleLock& Optimistic Concurrency Check).- Stage 1 – Cross-Process Bundle Write Lock (
.okf-write.lock):InitBundle,SaveConcept,UpdateConcept,RelateConcepts,UpdateParentIndex, andAppendLogEntrynow serialize local Read-Modify-Write transactions across concurrent processes and goroutines (e.g. parallel subagents or multiple IDE MCP servers sharingknowledge/or~/.okf/) using an atomicO_CREATE|O_EXCLbundle lockfile with bounded backoff and automatic stale-lock recovery. - Stage 2a – Transactional RMW Serialization (
UpdateConcept&RelateConcepts): CLIokf update, MCPokf_update, CLIokf relate, and MCPokf_relatenow acquire the bundle write lock before loading and mutating the target concept, preventing concurrent field updates or link insertions on the same concept from overwriting each other. - Stage 2b – Optimistic Concurrency Check (
ErrConcurrentModification):LoadBundlerecords the on-disk SHA-256 content digest of each concept; if a caller mutates a pre-loadedConceptstruct and callsSaveConceptafter an external write modified that file on disk,SaveConceptdetects the digest mismatch inside the lock and rejects the stale overwrite withErrConcurrentModification.
- Stage 1 – Cross-Process Bundle Write Lock (
-
Automatic SSoT Tool Symlinks in
okf bootstrap.okf bootstrapnow automatically creates the canonical SSoT tool symlinks (CLAUDE.md,.cursorrules,.windsurfrules, and.github/copilot-instructions.mdpointing toAGENTS.md) wheneverAGENTS.mdis installed, so freshly bootstrapped repositories passokf validate --agentsandokf agents checkout of the box. Can be skipped via--no-symlinks.
3. Bug Fixes
- Distinct Conflict Fork Paths for Multi-Writer Hub Sync (Fixes #60, PR #66).
ApplyConflictFailsafeandHubSyncnow compute conflict fork paths viaConflictForkPath, appending the first 8 hex characters of the local entry'splaintext_hash(<name>.conflict-local-<hash8>.<ext>). When three or more devices edit the same concept from the same base and sync sequentially, a later conflicting writer no longer overwrites an earlier device's committed conflict fork.
4. Documentation & Knowledge
- Updated README.md, docs/guides/CLI.md, and docs/spec/OKF-COMPATIBILITY.md to document root
index.mdscope isolation (scopes: [...]), canonical--scopevalues, andokf bootstrap --no-symlinks. - Updated architecture/registry-and-vendor-layering, architecture/security-boundaries, architecture/zero-knowledge-vault-sync, convention/security-audit, roadmap/milestones, and knowledge/log.md.
5. Community & Special Thanks
- A huge thank you to Cordero Core (@cdcore09) for reporting and isolating the three-writer conflict fork overwrite in
okf hub sync(#60). - A huge thank you to fchengyan (@fcy222fcy) for implementing distinct plaintext-hash conflict fork paths (
ConflictForkPath) and three-writer regression tests (#66).
🌐 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:
- Download: v0.8.0 Release Binaries
Full Changelog
Full Changelog: v0.7.2...v0.8.0