260 Commits
Author SHA1 Message Date
Martin Vogel 6ab3653b85 Merge origin/main into feat/index-resource-worker
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-03 18:09:48 +01:00
Martin Vogel 140e2998a1 Merge origin/main into feat/index-resource-worker
Brings the branch up to main 9c19b5dd.

Two same-spot insertion conflicts, each resolved as the main version
of the file plus the own diff of this branch:
- src/daemon/application.c: the job struct gained watch_owners on main
  and request_started_ms plus the request facts here; both kept.
- tests/test_daemon_application.c: main added the #1818
  autoindex-skipped helpers where this branch added the worker resource
  failure test; both kept, the test placed after the doc_candidates
  test.

Everything else merged cleanly. src/main.c changed on both sides: main
(#2838) lowers the worker CPU priority inside the worker role block,
and this branch strips the publication fence flag before that block
and installs the fence after the worker role options; the hunks are
disjoint and both are kept. tests/test_pipeline.c gained the Next.js
route tests (#2747) on main and the publication gate test here, also
disjoint. No call site needed adapting: no new main code calls a
function this branch re-signed, and main re-signed none that this
branch calls.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-02 18:15:55 +01:00
Martin Vogel 1976986f4b Merge origin/main into fm/cbm-worktree-ignore-1
Brings the branch up to main a5b248f47. Eight files conflicted, each a
same-spot insertion where main and this branch added lines next to the
same anchor. Each resolves to the main version plus the change of this
branch:

- src/cli/cli.h, src/cli/cli.c: CBM_CONFIG_IGNORE_WORKTREES and its
  CONFIG_KEYS row next to the new doc_candidates key.
- src/mcp/mcp.c: the index_worktree schema property next to the new
  doc_candidates property.
- README.md, docs/CONFIGURATION.md: the ignore_worktrees line and table
  row next to the rewritten auto_watch entries and the new
  doc_candidates and watch_non_git rows.
- src/git/git_context.c: the env-isolation comment after the new debug
  stage marker, directly above cbm_popen_git.
- src/cli/hook_augment.c: the new SubagentStart cli_hint ahead of the
  parent-graph check of this branch.
- tests/test_mcp.c: both RUN_TEST blocks; main already includes
  str_util.h.

Per file, the lines changed against main equal the changes of this
branch against the merge-base.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-02 02:07:22 +01:00
Martin Vogel 384e730744 Merge origin/main into docs/contributor-check-prerequisites
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 19:38:17 +01:00
Martin Vogel 587f134e5c Merge pull request #2385 from HazielMagallanes/fix/opencode-v2-setup-hooks
fix(cli): register OpenCode 2 hooks via the setup context
2026-11-01 14:27:30 +01:00
Martin Vogel fb88365dc0 fix(cli): add no OpenCode 2 compaction note until one has run on a real host
The V2 compaction hook pushed a plain object into the compaction request's
event.messages. OpenCode's Message is a schema class at v2.2.5, and nobody has
run this path on a real 2.x host. The try/catch only guards the array push,
which cannot throw. If OpenCode rejects the object, that happens inside its own
compaction, out of the plugin's reach, so an untested note could break
compaction for every OpenCode 2 user. Losing the note costs far less.

Remove the V2 compaction registration and the sessionHooksRegistered flag it
needed. The V2 tool hook, proven on OpenCode 2.2.5, stays, and so does the
1.18.x experimental.session.compacting path. OpenCode 2 sessions still get the
session note on the first tool result of a session. A later change can add a
note after compaction together with a real 2.x run.

The replacement test pins that the generated module registers no session hook
and touches neither event.messages, a system property nor an instruction entry.

Refs #2204

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 12:55:46 +01:00
Martin Vogel 01ac4fe6a9 Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 05:25:28 +01:00
Martin Vogel 12920dae15 Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 03:03:02 +01:00
Martin Vogel b3c6becee7 Merge origin/main into codex/fix-2816-trace-recursion
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 02:08:20 +01:00
Martin Vogel 6d33c27ae7 Merge origin/main into codex/fix-2816-trace-recursion
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:40:26 +01:00
Martin Vogel 8cef96dd88 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:38:41 +01:00
Martin Vogel ecd2eab93d Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 16:38:29 +01:00
Martin Vogel dd96a98494 Merge origin/main into codex/fix-2816-trace-recursion
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-31 01:00:09 +01:00
Martin Vogel b33a645e47 Merge origin/main into fix/permanent-daemon-watch
test_daemon_application.c: the new auto-watch test passes false for the approve_broad parameter that #2017 added to cbm_workspace_grant_add, the same value the existing callers use; the merged tree did not compile without it.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:37:40 +01:00
Martin Vogel 9cbc350720 Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:30:12 +01:00
Martin Vogel 359bd2f3ff Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-30 22:29:41 +01:00
Pcristin f8dfaca12a Merge branch 'main' into codex/fix-2816-trace-recursion 2026-10-29 22:25:35 +00:00
pcristin ab8f68a169 fix(mcp): expose recursion metadata in trace_path
Report stored recursion signals and the static self-call omission policy
alongside graph reachability totals. Preserve the metadata across cursor
pages and output-budget fallback responses, and document unknown legacy
metadata without changing CALLS indexing or traversal counts.

Fixes #2816

Signed-off-by: pcristin <xxxokzxxx@protonmail.com>
2026-10-29 22:21:48 +00:00
Martin Vogel 7abfb0d847 Merge branch 'main' into feat/claude-code-plugin-marketplace 2026-10-29 07:07:36 +01:00
Martin Vogel ed17097e34 Merge origin/main into fix/permanent-daemon-watch
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-29 04:07:49 +01:00
Martin Vogel 9f707646a8 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-29 03:29:37 +01:00
Martin Vogel 848975f635 Merge origin/main into feat/codex-skill-location-compat
README agent table: keep main's Claude Code row (drift note) and this
branch's Codex CLI row (skill path + PreToolUse).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 18:29:56 +01:00
Martin Vogel 8fae39e294 Merge origin/main into fix/adr-reindex-race
tests/test_pipeline.c: main and this branch added tests at the same spot;
both are kept unchanged.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 18:29:56 +01:00
Martin Vogel 97f8aef644 Merge branch 'main' into feat/claude-code-plugin-marketplace 2026-10-28 18:16:38 +01:00
Martin Vogel 545c1bd519 Merge origin/main into fix/permanent-daemon-watch
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 18:15:03 +01:00
Martin Vogel 5d97172b89 Merge origin/main into docs/windows-troubleshooting
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 18:12:53 +01:00
Martin Vogel 70d6d5017c docs(watcher): describe the watch lifetime under daemon start
A daemon started with `daemon start` now keeps a project watched after its
last owning MCP session closes, until the daemon stops, the project is
deleted, its directory disappears, or auto_watch is set to false. README
(the watcher paragraph and the index_repository row), the watcher_enabled
row of docs/CONFIGURATION.md and the comment above the index_status watch
provider still said every watch ends with its last session.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 00:51:48 +01:00
Martin Vogel 994432f068 Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-27 20:05:45 +01:00
Martin Vogel 57d641bfeb Merge branch 'main' into feat/claude-code-plugin-marketplace 2026-10-27 19:18:22 +01:00
Martin Vogel 04cb937236 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-27 19:17:15 +01:00
Martin Vogel 86136c4064 Merge origin/main into docs/contributor-check-prerequisites
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-27 19:16:59 +01:00
Martin Vogel 402617555c feat(cli): note when a Claude Code session keeps searching without the graph
The search hook gives each Grep, Glob or Bash search the matching graph
symbols, but a session can keep searching text for questions the graph answers
in one call (#509). Once a session has run three searches with no
codebase-memory-mcp tool call, the next augmentation now adds one factual line
saying so. The next note comes after six searches, then twelve, and any graph
tool call resets the count.

- State: a per-session counter in the process that runs hook requests (the
  daemon), keyed by the payload's session_id, in a bounded 64-slot table that
  evicts the least recently used session, behind a spin lock. Only searches
  that reach the graph lookup count. A search without an augmentation still
  counts, and the note waits for the next augmentation.
- Reset: Claude's managed PostToolUse entry now matches
  "Read|mcp__.*codebase-memory-mcp__.*", covering plain and plugin server
  names. The previous Read-only entry, as installs up to v0.12 wrote it, is
  recognized as owned, so install replaces it in place and uninstall removes
  either.
- Scope: Claude Code only. Codex sends the same event payload with a turn_id
  but has no reset hook, so its sessions are not tracked, and payloads without
  a session_id are not tracked either.
- Cost: a graph tool call now runs one hook round-trip to the daemon for the
  reset, about 130 ms on a local build.

Refs #509

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-27 19:04:47 +01:00
Martin Vogel 762a6e47d8 Merge origin/main into feat/codex-skill-location-compat
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-26 02:20:26 +01:00
Martin Vogel 7153cc900a Merge origin/main into docs/contributor-check-prerequisites
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-26 00:44:28 +01:00
Martin Vogel 8cfefa6d38 Merge origin/main into fix/adr-reindex-race
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-25 20:14:53 +01:00
Martin Vogel d0937940a9 docs(readme): name the Codex PreToolUse and Copilot PostToolUse search hooks
The Codex CLI row still listed only SessionStart and SubagentStart after the
PreToolUse Bash hook landed (#2719), and the hook section described only
Claude Code's search context. The row now names the Codex search hook, and the
section says how Codex, Copilot CLI and VS Code's Copilot runtime get search
context.

Refs #509

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-25 20:03:40 +01:00
Martin Vogel a18b4a4574 feat(cli): give Copilot searches graph context through a PostToolUse hook
Copilot CLI's preToolUse output can only decide permissions, and its command
hooks fail closed on errors, so the graph context that Claude Code and Codex
searches get could not ride a pre-tool hook there. postToolUse
additionalContext is appended to the tool result the model sees on the same
turn (github/docs content/copilot/reference/hooks-reference.md). VS Code's
agent mode shares the Copilot harness and reads the same ~/.copilot/hooks
manifest.

- Manifest: $COPILOT_HOME/hooks/codebase-memory-mcp.json adds a PascalCase
  PostToolUse entry, matcher "Bash|Grep|Glob|bash|powershell|grep|rg|glob",
  running hook-augment --event PostToolUse --dialect copilot. The previous
  lifecycle-only manifest, as installs up to v0.12 wrote it, stays recognized
  as owned: install upgrades it in place and uninstall removes either
  generation. A foreign manifest still fails closed.
- hook-augment: the Copilot dialect reads either payload form
  (tool_name/tool_input or toolName/toolArgs), maps runtime tool names to the
  Claude names (bash/powershell to Bash, grep/rg to Grep, glob to Glob),
  parses arguments passed as a JSON string, and answers with top-level
  additionalContext.
- Fast path: Copilot's forced PostToolUse goes through the no-op gate before
  executable-identity hashing. The gate also skips tools the augmenter does
  not read, because VS Code's local hook parser ignores matchers, so a
  non-search shell call or an edit exits in about 20 ms instead of paying the
  full round-trip of about 130 ms.
- The context header no longer says the search results are "below": after a
  post-tool hook they are above it.
- Tests: the three Copilot foreign-manifest tests now create
  .copilot/mcp-config.json. Without it Copilot CLI was never detected, so
  install and uninstall never reached the manifest, and the tests also passed
  with the ownership checks removed.

Refs #509

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-25 19:50:35 +01:00
0xb007ab1eandClaude Opus 4.8 001fbe269a fix(adr): store ADRs in a per-project sidecar DB, untouched by reindex
Reworks the ADR-loss-across-reindex fix to Alternative 1 (per the PR review):
remove the race rather than narrow it. ADRs live in a per-project sidecar SQLite
DB ("<graph_db>.adr.db"), separate from the graph DB a reindex rebuilds or
deletes, so there is no capture, re-read, re-apply, or lock — and no sleeps,
polling, or timeout deciding an outcome.

store.c:
- ADR writes (store/delete/update_sections) use a cached read-write handle opened
  SQLITE_OPEN_READWRITE|CREATE and configured like the graph store (PRAGMA
  busy_timeout=10000 + journal_mode=WAL) so cross-process access waits rather
  than failing SQLITE_BUSY. A :memory: store keeps ADRs in the graph DB.
- Reads never write: cbm_store_adr_get uses the cached RW handle if open, else
  opens the sidecar SQLITE_OPEN_READONLY (with the same busy timeout) when the
  file exists, else reads the legacy graph row without creating anything. When
  the sidecar exists but is NOT marked migrated (half-created), it falls back to
  the legacy graph row so a partial sidecar never hides an ADR.
- One-time migration is atomic: adr_copy_legacy_once wraps the marker check,
  legacy copy, and marker insert in a single BEGIN IMMEDIATE...COMMIT
  (re-checking the marker under the lock; ROLLBACK->ERR on failure). New public
  cbm_store_adr_migrate_once. Sidecar path via cbm_path_for_file_api (Windows
  long-path). Dropped the write-only adr_db_path field.

pipeline.c: migrate a legacy ADR into the sidecar BEFORE the format-change and
forced-full routes unlink the old generation; preserve-and-abort on failure, and
do NOT fail open — a query-open returning NULL preserves unless the final DB
genuinely does not exist. Migration targets the FINAL path (staging suffix
stripped). The early-capture/re-apply machinery and its test hook are gone.

artifact.c: the exported artifact carries the ADR — snapshot_inject_adr always
DELETEs project_summaries first, then injects only when an ADR is present, so a
deleted ADR never resurrects through a lingering legacy row. Import restores the
ADR into the destination sidecar via cbm_store_adr_restore_from_graph_if_absent:
it copies the artifact's ADR (INSERT OR IGNORE — never clobbers a local one)
regardless of the migrated marker, so a teammate who already indexed the project
(marked sidecar, no ADR) still receives the shared decision record. store.c
factors the row copy into adr_copy_rows, shared by the one-time legacy migration
and the ungated restore.

mcp.c: delete_project removes "<db>.adr.db" (+ -wal/-shm/-journal) only after the
graph unlink succeeds; is_project_db_file skips *.adr.db. cli.c: exclude
*.adr.db from index listing/counting. README + memory-core baselines updated.

Tests (file-based): ADR written mid-reindex survives on BOTH the full and delta
routes (route-pinned FORCED_FULL / CLOSURE_REPAIR); a legacy row migrates before
a forced-full/format reindex with no prior read; migration failure (a directory
at <db>.adr.db) preserves-and-aborts with the old generation intact;
delete_project via the MCP handler removes the sidecar + journals; the artifact
export->import round trip keeps the ADR; a deleted ADR does not resurrect on
import; an import does not clobber a local ADR; an import into an already-indexed
destination (marked sidecar, no ADR) restores the artifact's ADR; a half-created
sidecar falls back to the legacy row. The import tests remove the destination
graph DB (keeping the sidecar + marker) before importing, matching production
(try_artifact_bootstrap imports only when the graph DB is missing) so the rename
succeeds on Windows, not only on POSIX.

Closes #516

Signed-off-by: 0xb007ab1e <134006168+0xb007ab1e@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-22 04:45:43 -05:00
wargloom 0325d6a3fa fix: watch explicit MCP index targets
Signed-off-by: wargloom <wargloom@gmail.com>
2026-10-21 14:03:07 +03:00
Martin VogelandKody 4c09f7c70c feat(plugin): Claude Code plugin marketplace, discovery slice
Make this repository a Claude Code plugin marketplace so users can find
and add the server from inside Claude Code:

  claude plugin marketplace add DeusData/codebase-memory-mcp
  claude plugin install codebase-memory@codebase-memory

This is slice 1 of #1188: discovery only. The plugin registers the MCP
server and nothing else; the skill, the graph agents and the context
hooks still come from `codebase-memory-mcp install`.

- .claude-plugin/marketplace.json: one plugin, sourced from ./plugin.
- plugin/.claude-plugin/plugin.json: version pinned to the current
  release. Without a pinned version every commit to main would be a new
  plugin version for installed users.
- plugin/.mcp.json: stdio server `npx -y codebase-memory-mcp@0.12.1`.
  The pin keeps main from advertising a server version npm does not
  have; the npm package downloads the release binary on first start and
  verifies it against the release checksums.
- .gitignore: the root .mcp.json stays ignored; plugin/.mcp.json is
  published.
- README: install section, and "use one or the other": with both the
  plugin and `install`, Claude Code runs the server twice under two tool
  namespaces.
- tests/test_version_metadata_contract.sh: both plugin files are
  release-tracking surfaces; a new claim form reads the npm package spec
  (`codebase-memory-mcp@X.Y.Z`), and the unregistered-surface sweep now
  covers plugin/ and .claude-plugin/. The post-release sync that bumps
  server.json must bump these pins too, or this contract goes red.

No language count is stated anywhere in the plugin metadata, so the
language-count contract has nothing new to track.

Refs #1188

Co-authored-by: Kody <kaidi.shi.1121@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-21 00:34:29 +02:00
Martin Vogel 13c38feeff docs: refresh Lens recordings and correct README claims
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 22:39:10 +02:00
Martin Vogel e81b6599a8 docs: center the MCP server while keeping Lens visuals up front
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 20:02:47 +02:00
Martin Vogel 912dae61c9 docs: add Lens walkthroughs and restore GitHub star badge
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 19:57:57 +02:00
Martin Vogel e77b494b3e docs: improve site discovery and invite the Discord community
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 19:53:16 +02:00
Martin Vogel 8c1fc27f79 Merge branch 'main' into docs/contributor-check-prerequisites 2026-10-20 19:45:42 +02:00
Martin Vogel 2a7da82a04 docs: fix contributor prerequisites paragraph break and lint wording
Replace the literal "\n\n" in CONTRIBUTING.md with a real paragraph
break; Markdown rendered it as text in the middle of the sentence.

A plain scripts/lint.sh run is the full mode and needs clang-tidy as
well as cppcheck and clang-format; scripts/lint.sh --ci, which is what
CI runs, skips clang-tidy. Say it that way round in README.md and
CONTRIBUTING.md.

The curl entry stays: since 6c00f96311 (#2480) Step 0y3 of
scripts/test.sh runs the setup-script contract, which downloads a
local fixture release through scripts/setup.sh with curl.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 19:31:31 +02:00
Martin Vogel dd357a7c97 docs: refresh project messaging and Lens website
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-20 19:08:27 +02:00
Oscar Madera d1ab2426ee Merge branch 'main' into docs/windows-troubleshooting 2026-10-20 08:40:03 -05:00
Martin Vogel cad8169697 Merge branch 'main' into feat/codex-skill-location-compat 2026-10-20 05:34:50 +02:00
Oscarbol09 a933d5318c docs(troubleshooting): add Windows troubleshooting guide
Centralize recurring Windows-specific troubleshooting entries in a dedicated document linked from README.md. Each entry includes confirmed symptoms, affected version ranges, current workarounds, and canonical tracking issue references, updated to reflect v0.10.x and v0.11.0 status.

Refs #1170

Signed-off-by: Oscarbol09 <omaderabolano@correo.unicordoba.edu.co>
2026-10-19 18:45:28 -05:00