You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(context): close long-lived incremental local context service for #682 (#750)
Add process locking, incremental rebuilds, CLI/MCP service ops, session-scoped queries, and UAT-INDEX coverage so agents can share a fresh local index without stale evidence or network binds.
Copy file name to clipboardExpand all lines: docs/context-service.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,4 +10,32 @@ The local context service is an incremental, repository-scoped wrapper around Co
10
10
11
11
The service serializes rebuilds, coalesces watcher events, exposes invalidated paths and reasons, and labels every query as `current`, `refreshing`, or `stale`. A bounded query may wait for an active update, but old context is never returned as current. Corrupted or incompatible service state is quarantined and rebuilt without changing repository source files.
12
12
13
-
The initial implementation deliberately does not claim million-line scale. Benchmark fixtures and budgets, process locking, crash-safe atomic writes, and CLI/MCP transports remain required before the long-lived service is considered complete.
13
+
The initial implementation uses Chokidar for watching, inspectable JSON graph
14
+
artifacts, process locking via `.codedecay/local/context-service.lock`, and
15
+
atomic state writes to `.codedecay/local/context-service.json`.
"Build an inspectable task-scoped context packet from existing CodeDecay evidence: requirements, impact graph nodes, route/API evidence, symbols, tests, memory, docs/ADRs, CODEOWNERS, config, package manifests, and verification evidence.",
49
-
"Use this before or during implementation when an agent needs the smallest relevant set of repository facts and historical context instead of a whole-repo dump."
52
+
"Service subcommands start/query a long-lived local incremental context index (no network bind, no model/network/telemetry calls)."
50
53
],
51
54
options: [
52
-
{flag: "--task <text>",description: "Required task/change description used for deterministic retrieval"},
55
+
{flag: "--task <text>",description: "Required for one-shot retrieval; optional for service query sessions"},
56
+
{flag: "serve|health|query|rebuild|reset|stop",description: "Local context service operations"},
57
+
{flag: "--session-id <id>",description: "Isolate task state for concurrent agent sessions over a shared index"},
58
+
{flag: "--wait-budget-ms <n>",description: "Max wait for an in-flight index update during query"},
"Context retrieval is deterministic lexical plus graph-neighbor ranking. It does not call models, embeddings, hosted services, network APIs, or telemetry.",
68
-
"The command refreshes local analysis artifacts but does not execute configured project commands or tool adapters.",
69
-
"Memory and documents are shown with trust class and limitations; they cannot become trusted proof without current-revision evidence.",
75
+
"The local context service reuses knowledge-graph artifacts, process-locks updates, and never returns stale evidence labeled as current.",
70
76
"The inspectable artifact is written to `.codedecay/local/task-context.json`."
0 commit comments