Commit graph

87 commits

Author SHA1 Message Date
sknr
ec9780b650 feat(mcp): support multi-scope search and cross-scope show in MCP server and schema 2026-10-01 12:20:29 +02:00
sknr
57469137ba feat(scope): implement --scope flag and ensure external links never fail validation 2026-10-01 11:44:59 +02:00
sknr
d72f5de743 feat(scope): standardize vendor references on clean @bundle syntax without legacy vendor prefix 2026-10-01 11:23:04 +02:00
sknr
28f82706a2 fix(registry): support scoped packages with leading @ and server fallback 2026-10-01 10:46:26 +02:00
sknr
11074749c0 feat(vendor): add okf restore, argless pull, and harden vendor remove
- Add 'okf restore' command to reinstall vendor bundles from okf.lock
- Allow 'okf pull' without arguments to restore from okf.lock
- Skip already installed bundles during restore unless --force is specified
- Harden 'okf vendor remove' to require exact bundle ID match and index.md
- Prevent deletion of parent namespace directories on prefix remove
- Automatically clean up empty okf.lock when last vendor bundle is uninstalled
- Mitigate G110 (decompression bomb) and G304 (path traversal) in package unpacker
- Fix errcheck and staticcheck lint warnings across CLI and test suites
2026-09-30 23:21:34 +02:00
sknr
cdf7321cd1 refactor(pull): stream-filter knowledge directory on-the-fly without disk churn 2026-09-30 21:37:48 +02:00
sknr
75d897aeb7 feat(pull): add knowledge/ directory promotion for standard DMAA repo archives 2026-09-30 21:12:10 +02:00
sknr
8ebc7d5faf fix(registry): allow optional 'v' prefix when resolving versions 2026-09-28 21:25:51 +02:00
sknr
14924662f4 feat(pull): support @tag and @version resolution and floating branch warning 2026-09-28 19:12:49 +02:00
sknr
c1b8d702cd feat(pull): add post-install validation, rollback on invalid bundle, and github archive root flattening 2026-09-28 18:57:42 +02:00
sknr
a9c10f8646 style: format octal literals via gofmt 2026-09-28 18:28:38 +02:00
sknr
a6ae0d6364 feat(search): implement multi-scope composite BM25 indexing and okf:// URI parsing 2026-09-28 18:06:52 +02:00
sknr
de7f1726e3 feat(registry): add client with scoped and top-level ID resolution 2026-09-28 18:02:28 +02:00
sknr
fb79d514c9 feat(lock): implement okf.lock parser and serializer without dependencies 2026-09-28 18:01:26 +02:00
sknr
91461383ac
fix(validator): resolve parent index links in drift validation (#41)
- Resolve index links via b.ResolveLink instead of naive substring matching
- Support bundle-absolute, dot-relative, and anchored links in parent indexes
- Add regression test for parent index link resolution variants
- Credit Alvise (@alvistar) for issue #41 report in CONTRIBUTORS.md
- Record fix in knowledge/log.md
2026-09-27 22:07:17 +02:00
sknr
7cd556fb9f
fix(mcp,cli): constrain tag length to 50 chars, refactor flag visit, and update docs (#38)
- Cap MCP tag length to 50 characters in tools.json schemas and handler
- Replace repeated fsPassed FlagSet visits with local passed map in cmdUpdate
- Add upfront non-empty type validation to cmdCreate
- Link requirements/mutation-metadata in root knowledge/index.md
- Document update flags and MCP tag length limit in docs/guides/CLI.md
- Credit Rogelio (@rogeliodh) for issue #38 report and analysis in CONTRIBUTORS.md
- Record knowledge updates in knowledge/log.md
2026-09-27 21:46:15 +02:00
Denis Samatov
5c29a6ca15
feat: expose concept metadata mutation in CLI and MCP (#38) (#39)
Reported-by: Rogelio (@rogeliodh)
Co-authored-by: Rogelio <110125+rogeliodh@users.noreply.github.com>
2026-09-27 21:24:23 +02:00
sknr
651bd04ec7
feat(core): decouple MCP server and hub sync, add query filters and staleness engine
- Move MCP server implementation and tool schemas from cmd/okf into pkg/okf
- Move hub vault operations and lifecycle management from cmd/okf into pkg/sync
- Implement generic frontmatter --filter AST evaluation in pkg/okf/filter.go
- Implement --stale-within temporal horizon staleness engine in pkg/okf
- Introduce okf.SaveOptions and HubOp structures for clean API ergonomics
2026-09-25 12:53:43 +02:00
sknr
d5c832edec
docs(search): add scoring refinement to roadmap and in-code TODO 2026-09-25 11:00:41 +02:00
sknr
7e6fba7d92 fix(security): sanitize multi-line frontmatter blocks and broaden Jules discovery (#36) 2026-09-23 21:06:25 +02:00
sknr
5b5c114abd merge: incorporate Jules cross-platform absolute path evasion fix (PR #37) 2026-09-23 21:05:01 +02:00
sknr
eab108dedf
fix(cli): separate validate findings taxonomy and reconcile summary counts
In non-strict mode, all printed diagnostic lines (warnings, gate findings,
broken links, orphans) are prefixed with 'warn  ' and reconciled 1:1 into
the headline warning(s) counter.

In strict mode (--strict), gate-failing findings are prefixed with 'gate  '
and tracked under a dedicated 'gate finding(s)' summary counter, cleanly
separating them from non-gating advisory 'warn  ' lines and 'error ' spec
violations.

Resolves #35
Reported-by: mattgdrums-cloud <mattgdrums-cloud@users.noreply.github.com>
2026-09-23 20:52:06 +02:00
google-labs-jules[bot]
f9265e05bb fix(security): prevent absolute path traversal evasion cross-platform
* Introduced IsAbsPath helper to securely detect cross-platform absolute paths
* Patched resolveInBundle to explicitly reject absolute paths early before
  they can be evaluated by path.Clean and Join as relative on POSIX systems
* Patched validate method and others to also use IsAbsPath
* Verified with rigorous testing of absolute paths evasion in mutation flow

Co-authored-by: sknr <11868275+sknr@users.noreply.github.com>
2026-09-23 04:29:37 +00:00
sknr
a75869de8a
fix(security): enforce directory depth limit and reject hidden dotfiles in concept IDs 2026-09-19 14:56:07 +02:00
sknr
164750874c
fix(security): prevent frontmatter smuggling in concept markdown body 2026-09-19 14:51:05 +02:00
sknr
a7d0bbe0c0
fix(security): block zero-width and bidi override characters in concept IDs while preserving unicode internationalization 2026-09-19 14:50:12 +02:00
sknr
573c86ed77
fix(security): sanitize Windows-style backslashes across validator and search 2026-09-19 14:26:47 +02:00
sknr
01d8e8c5b7
merge: incorporate Jules security remediation (jules-audit-fix-path-traversal-14703784320229980277) 2026-09-19 14:24:31 +02:00
sknr
624ef532b9
fix(bootstrap): rely strictly on BEGIN delimiter for smart append in AGENTS.md 2026-09-18 11:20:45 +02:00
google-labs-jules[bot]
53be021b76 fix: harden path resolution against cross-platform backslash traversal
Replaces `filepath.ToSlash` with explicit `strings.ReplaceAll(path, "\\", "/")` when normalizing incoming path inputs and concept IDs. `filepath.ToSlash` is a no-op on POSIX operating systems, which allowed an attacker to bypass directory boundary confinement (CWE-22) using Windows-style backslashes (e.g. `..\..\etc\passwd`). This ensures cross-platform defensive behavior regardless of the host OS executing the agent. Includes negative security test cases.

Co-authored-by: sknr <11868275+sknr@users.noreply.github.com>
2026-09-18 09:03:50 +00:00
sknr
c78622c5a2
test(okf): modernize BenchmarkSearchUnicode using b.Loop() 2026-09-18 09:25:29 +02:00
sknr
3bbf0aec94
fix(okf): harden crash consistency with atomic writes, index link checks, and drift validation 2026-09-18 09:25:08 +02:00
sknr
c8eaa2b226
feat(sync): add optimistic retry loop and append-only log auto-merge
- Wrap Engine.Sync reconcile and commit phases in a retry loop (DefaultMaxSyncRetries = 5) with exponential backoff and jitter on concurrent 409 head conflicts
- Implement MergeLogContent to automatically union divergent entries in log.md by ISO date heading while preserving ordering and deduplicating
- Prevent spurious collision forking for log.md during parallel agent sync cycles
2026-09-17 16:11:09 +02:00
sknr
b7180e2598
Merge branch 'develop' into feat/vault-crypto 2026-09-16 09:23:03 +02:00
sknr
ae4c7e05cf fix(cli): add subcommand help handlers and reject hyphenated concept IDs 2026-09-16 09:19:03 +02:00
sknr
e15f66168f feat(skill): refactor okf-memory skill to AAG v0.1 and align workflow guides 2026-09-16 09:19:03 +02:00
Stephan Knauer
312ff2677e
Merge pull request #29 from okf-memory/fix/types-test-coverage-13208749482949882366
🧪 Add missing test file types_test.go for types.go
2026-09-16 09:18:46 +02:00
Stephan Knauer
9bf1c13d99
Merge pull request #28 from okf-memory/develop-11812802365659913745
⚡ Optimize `RelateConcepts` by using pre-compiled `strings.Replacer`
2026-09-16 09:18:40 +02:00
sknr
f394fdd75f merge: sync develop v0.3.0 into feat/vault-crypto 2026-09-15 15:31:34 +02:00
sknr
aacfb64a9b fix(symlink): normalize symlink relative target path comparison cross-platform 2026-09-15 14:56:26 +02:00
sknr
6146735f93 Merge branch 'develop' into feat/vault-crypto 2026-09-15 14:51:30 +02:00
sknr
d24f3faa4a fix(bundle): auto-resolve knowledge/ subdirectory and ignore root AGENTS.md in LoadBundle 2026-09-15 14:51:21 +02:00
sknr
6a243451e1 fix(security): add nosec annotations and harden http server timeouts in hub and sync engine 2026-09-15 14:47:07 +02:00
sknr
26107066d9 merge: incorporate develop (AAG, DMAA, SSoT symlinks, Jules security hardening) 2026-09-15 14:46:14 +02:00
sknr
de991025ca merge: incorporate Jules security hardening PR (jules-14861611321268232439-f34d0d97) 2026-09-15 14:39:05 +02:00
sknr
d2f9ac016e test(security): add sanitization and path safety checks for domains and linter
- Sanitize projectName against newline header injection in GenerateAgentsMarkdown
- Add filepath.Clean and gosec annotation for LintFile path reading
- Add unit tests verifying injection resistance and symlink directory validation
2026-09-15 14:35:55 +02:00
sknr
4942eba1fc
fix(ci): strictly enforce golangci-lint in Makefile and resolve static analysis findings
- Fix Makefile lint target so golangci-lint failure exit code is not swallowed
- Address errcheck in defer os.RemoveAll across test suites
- Replace deprecated filepath.HasPrefix with strings.Contains
- Fix staticcheck QF1012 string formatting in pkg/okf/domains.go
- Remove unused variables in pkg/okf/aag/linter.go
2026-09-15 14:32:13 +02:00
sknr
f5f92fec3b feat(agents): implement SSoT symlink engine and multi-domain codex scaffolding
- Add symlink creation and drift checking for Claude Code, Cursor, Windsurf, and Copilot
- Add multi-domain codex generator (software, research, legal, coaching, books)
- Add symlink engine unit tests in pkg/okf
2026-09-15 14:17:58 +02:00
sknr
50f2229813 feat(aag): implement AAG linter engine and token estimator
- Add linter rules for AAG-001 (AsciiOnly), AAG-002 (ExplicitModal), AAG-003 (ToolSignature), AAG-004 (MermaidAssertion), and AAG-005 (TokenBudgetGate)
- Enforce strict ASCII invariance in canonical AGENTS.md files
- Add comprehensive unit tests in pkg/okf/aag
2026-09-15 14:17:56 +02:00
sknr
a9bf6c60d5 refactor(agents): streamline AGENTS.md codex and synchronize Mermaid rules across examples and templates
- Eliminate redundancy between Section 0 Domain Codex and Sections 1-3 OKF Memory Bridge
- Enforce strict Mermaid diagram syntax assertion across all domain templates and examples
2026-09-15 12:58:13 +02:00