Skip to content

docs(design): ACE × codedb integration spec — design only, no impl#486

Merged
justrach merged 1 commit into
mainfrom
docs/ace-integration-spec
May 21, 2026
Merged

docs(design): ACE × codedb integration spec — design only, no impl#486
justrach merged 1 commit into
mainfrom
docs/ace-integration-spec

Conversation

@justrach
Copy link
Copy Markdown
Owner

Summary

Adds `docs/design/ace-integration.md` — a design draft for how codedb_context could grow a per-project Skillbook (path boost/penalty globs + keyword synonyms) learned by an external system like kayba-ai/agentic-context-engine, without codedb itself absorbing trace reflection or LLM clients.

Why

The question came up: should codedb compete with ACE? Answer: no — they're different categories (ACE is agent memory, codedb is code search). But there's a real opportunity to let codedb consume learned skills as a deterministic read/write surface, while ACE owns the slow reflection loop.

Filing the spec so the option stays open, future implementers have a concrete starting shape, and future rejectors can point at this specific proposal instead of re-arguing "what if learning."

Shape

  • Per-project `~/.codedb/projects//skillbook.json`
  • Three skill kinds: `path_boost`, `path_penalty`, `keyword_synonym`
  • Read path: `handleContext` consults the skillbook after static heuristics
  • Write path: `codedb_skillbook_update` MCP tool (called by ACE or any learner)
  • Trace collection: extend existing `logQuery` WAL to capture selection signal (which file:line snippets the agent subsequently used)

Estimated v0 implementation cost: 4-6 engineering days. This PR commits to none of it.

What this PR does NOT do

  • No code changes (it's a markdown design doc)
  • No commitment to building the skillbook
  • No vector store / RAG / embeddings
  • No LLM client in codedb

Test plan

  • Doc renders cleanly on GitHub
  • Cross-references valid (`README.md` link)

🤖 Generated with Claude Code

Design draft sketching how codedb_context's ranking could benefit from
a per-project Skillbook (boost/penalty path globs + keyword synonyms)
learned by an external loop, without absorbing ACE's reflection
machinery into codedb itself.

Headline shape:
- codedb owns deterministic, sub-ms read/write of a per-project
  skillbook.json
- ACE (or any other learner) owns trace reflection + skill synthesis
- Interface: `codedb_skillbook_update` MCP tool

Three skill kinds for v0: path_boost, path_penalty, keyword_synonym.

The doc commits to nothing yet — it preserves the option and gives
future implementers/rejectors a concrete shape to work against rather
than re-arguing "what if learning."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 508286 516580 +1.63% +8294 OK
codedb_changes 54105 55286 +2.18% +1181 OK
codedb_deps 9204 10739 +16.68% +1535 NOISE
codedb_edit 6371 6282 -1.40% -89 OK
codedb_find 63059 62362 -1.11% -697 OK
codedb_hot 98957 104486 +5.59% +5529 OK
codedb_outline 299361 307077 +2.58% +7716 OK
codedb_read 94347 97676 +3.53% +3329 OK
codedb_search 142097 144935 +2.00% +2838 OK
codedb_snapshot 285519 284424 -0.38% -1095 OK
codedb_status 13172 13143 -0.22% -29 OK
codedb_symbol 60873 60212 -1.09% -661 OK
codedb_tree 84637 80174 -5.27% -4463 OK
codedb_word 85091 87283 +2.58% +2192 OK

justrach added a commit that referenced this pull request May 21, 2026
@justrach justrach merged commit eac58d0 into main May 21, 2026
1 check passed
justrach added a commit that referenced this pull request May 21, 2026
… security

Bumps semver to 0.2.5817. Bundles the v0.2.5816 perf+security release
(PRs #484, #485, #483, #486, #487) with the experiment/reader-md feature
that auto-prepends a hash-verified codebase map to codedb_context.

Highlights vs v0.2.5815:

  Performance (PR #485, deterministic microbenchmarks):
    Suspense regex p50:    2.82 ms → 0.18 ms  (15.6× faster)
    useState regex p99:   16.57 ms → 2.04 ms  (8.1× p99 reduction)

  CLI surface (PR #484):
    + codedb read <path> [-L FROM-TO] [--compact]
    + path-safety + sensitive-file guards
    + project-root anchoring (uses configured root, not cwd)

  codedb_context (NEW in 0.2.5817):
    + auto-prepends .codedb/reader.md when source_hash matches
    + inline ~6 lines of body for ≤3 symbol_definitions
    + new "## Callers" section pre-surfaces execution sites
    + skip-on-short-task gate (≤80 chars) to avoid overhead on narrow lookups

  reader.md security (this branch):
    + path-traversal blocked (no absolute / .. in source_files)
    + source_files capped at 20 (DoS guard)
    + loc_actual capped at 240 (body bloat guard)
    + golden blake2b roundtrip test

Eval (Sonnet 4.6, n=3 per task, vs v0.2.5815 main lineage):
  T1 flask median:   5 → 4  (-1)
  T2 regex median:  13 → 7  (-6)
  T3 react median:  13 → 10 (-3)

All 9 runs across the matrix returned correct answers. Branch wins on
median, mode, and best-case for every task.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@justrach justrach deleted the docs/ace-integration-spec branch May 21, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant