release: v0.2.5817 — reader.md auto-prepend + perf + security#490
Conversation
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fd3dd6306
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const cached = explorer.getContent(path, allocator) catch null; | ||
| const content_owned = if (cached) |c| c else blk: { | ||
| break :blk std.Io.Dir.cwd().readFileAlloc(io, path, allocator, .limited(10 * 1024 * 1024)) catch { |
There was a problem hiding this comment.
Enforce path-safety checks before CLI file reads
The new codedb read branch reads arbitrary user-supplied paths without the safety gates used by codedb_read in MCP (isPathSafe + watcher.isSensitivePath), and the fallback uses std.Io.Dir.cwd() directly. This allows traversal/secret reads such as codedb read ../.env (or absolute paths if provided), which bypasses the repository boundary and sensitive-file protections expected by this codebase.
Useful? React with 👍 / 👎.
Bumps semver to 0.2.5816 and consolidates two follow-up fixes from the v0.2.5815 cross-corpus eval: - #484 feat(cli): add `codedb read` subcommand - #485 fix(search): skip Tier 5 full-scan when trigram returned candidates Measured impact (benchmarks/search-shootout, 20 warm iters): Suspense (regex, 0 hits) 2.82 ms → 0.14 ms (20× faster) useState (regex) p99 16.57 ms → 1.67 ms (10× p99) useState (flask) 0.66 ms → 0.18 ms (3.7× faster) React queries: unchanged ±noise; hit counts identical Recall preserved on every query. Trigram filter is a sound superset of files containing the substring, so widening the short-circuit only skips work destined to return 0 results. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… 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>
7fd3dd6 to
049786e
Compare
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
TL;DR
v0.2.5817 ships reader.md: a hash-stable, agent-authored codebase map auto-prepended to `codedb_context` responses. Plus all of v0.2.5816's fixes (perf + security), plus three new codedb_context enhancements (inline symbol bodies, callers section, task-length gate).
Bundled
From release/v0.2.5816:
codedb readsubcommand #484 `codedb read` CLI subcommand (with P1 path-safety guards)New on this branch:
Performance vs v0.2.5815 (Sonnet 4.6 sub-agents, n=3 each)
Deterministic microbench (PR #485):
Security fixes
codedb readsubcommand #484 P1: `codedb read` CLI now rejects absolute paths, `..` traversal, sensitive files (`.env`, `id_rsa`, etc.). Anchors fallback reads to project root, not cwd.Reader.md lifecycle
```
agent → codedb_context
↓
load .codedb/reader.md
↓
blake2b(source_files) match? → prepend body
↘ "stale, regenerate" hint
↘ silent (missing)
↓
(existing composer output follows)
```
Hash verification fires on every call (re-reads source files, recomputes blake2b — ~0.1 ms overhead).
Release artifacts
All 10 assets built locally, both macOS binaries notarized via Apple notary service (Accepted, gatekeeper source=Notarized Developer ID), linux smoke-tested via docker linux/amd64.
What's deferred (not blockers)
From the Sonnet 4.6 critical-review pass:
All P1 review findings closed. P2 follow-ups remain for v0.2.5818+.
Test plan
🤖 Generated with Claude Code