contextgit 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/bootstrap.d.ts +10 -0
  2. package/dist/bootstrap.d.ts.map +1 -0
  3. package/dist/bootstrap.js +43 -0
  4. package/dist/bootstrap.js.map +1 -0
  5. package/dist/commands/branch.d.ts +13 -0
  6. package/dist/commands/branch.d.ts.map +1 -0
  7. package/dist/commands/branch.js +52 -0
  8. package/dist/commands/branch.js.map +1 -0
  9. package/dist/commands/claim.d.ts +13 -0
  10. package/dist/commands/claim.d.ts.map +1 -0
  11. package/dist/commands/claim.js +50 -0
  12. package/dist/commands/claim.js.map +1 -0
  13. package/dist/commands/commit.d.ts +14 -0
  14. package/dist/commands/commit.d.ts.map +1 -0
  15. package/dist/commands/commit.js +71 -0
  16. package/dist/commands/commit.js.map +1 -0
  17. package/dist/commands/context.d.ts +9 -0
  18. package/dist/commands/context.d.ts.map +1 -0
  19. package/dist/commands/context.js +38 -0
  20. package/dist/commands/context.js.map +1 -0
  21. package/dist/commands/doctor.d.ts +6 -0
  22. package/dist/commands/doctor.d.ts.map +1 -0
  23. package/dist/commands/doctor.js +84 -0
  24. package/dist/commands/doctor.js.map +1 -0
  25. package/dist/commands/init.d.ts +10 -0
  26. package/dist/commands/init.d.ts.map +1 -0
  27. package/dist/commands/init.js +126 -0
  28. package/dist/commands/init.js.map +1 -0
  29. package/dist/commands/keygen.d.ts +10 -0
  30. package/dist/commands/keygen.d.ts.map +1 -0
  31. package/dist/commands/keygen.js +57 -0
  32. package/dist/commands/keygen.js.map +1 -0
  33. package/dist/commands/log.d.ts +13 -0
  34. package/dist/commands/log.d.ts.map +1 -0
  35. package/dist/commands/log.js +91 -0
  36. package/dist/commands/log.js.map +1 -0
  37. package/dist/commands/merge.d.ts +12 -0
  38. package/dist/commands/merge.d.ts.map +1 -0
  39. package/dist/commands/merge.js +29 -0
  40. package/dist/commands/merge.js.map +1 -0
  41. package/dist/commands/pull.d.ts +10 -0
  42. package/dist/commands/pull.d.ts.map +1 -0
  43. package/dist/commands/pull.js +123 -0
  44. package/dist/commands/pull.js.map +1 -0
  45. package/dist/commands/push.d.ts +10 -0
  46. package/dist/commands/push.d.ts.map +1 -0
  47. package/dist/commands/push.js +141 -0
  48. package/dist/commands/push.js.map +1 -0
  49. package/dist/commands/remote-show.d.ts +6 -0
  50. package/dist/commands/remote-show.d.ts.map +1 -0
  51. package/dist/commands/remote-show.js +71 -0
  52. package/dist/commands/remote-show.js.map +1 -0
  53. package/dist/commands/search.d.ts +11 -0
  54. package/dist/commands/search.d.ts.map +1 -0
  55. package/dist/commands/search.js +47 -0
  56. package/dist/commands/search.js.map +1 -0
  57. package/dist/commands/serve.d.ts +9 -0
  58. package/dist/commands/serve.d.ts.map +1 -0
  59. package/dist/commands/serve.js +51 -0
  60. package/dist/commands/serve.js.map +1 -0
  61. package/dist/commands/set-remote.d.ts +9 -0
  62. package/dist/commands/set-remote.d.ts.map +1 -0
  63. package/dist/commands/set-remote.js +26 -0
  64. package/dist/commands/set-remote.js.map +1 -0
  65. package/dist/commands/status.d.ts +6 -0
  66. package/dist/commands/status.d.ts.map +1 -0
  67. package/dist/commands/status.js +54 -0
  68. package/dist/commands/status.js.map +1 -0
  69. package/dist/commands/unclaim.d.ts +9 -0
  70. package/dist/commands/unclaim.d.ts.map +1 -0
  71. package/dist/commands/unclaim.js +22 -0
  72. package/dist/commands/unclaim.js.map +1 -0
  73. package/dist/config.d.ts +19 -0
  74. package/dist/config.d.ts.map +1 -0
  75. package/dist/config.js +58 -0
  76. package/dist/config.js.map +1 -0
  77. package/dist/git-hooks.d.ts +6 -0
  78. package/dist/git-hooks.d.ts.map +1 -0
  79. package/dist/git-hooks.js +58 -0
  80. package/dist/git-hooks.js.map +1 -0
  81. package/package.json +22 -19
  82. package/.claude/settings.local.json +0 -41
  83. package/.contextgit/config.json +0 -10
  84. package/.contextgit/system-prompt.md +0 -4
  85. package/.github/workflows/contextgit-ci.yml +0 -40
  86. package/CLAUDE.md +0 -123
  87. package/CLAUDE.md.next +0 -65
  88. package/docs/ContextGit_ARCHITECTURE_v3.md +0 -1141
  89. package/docs/ContextGit_DELTA.md +0 -84
  90. package/docs/ContextGit_PHASE1_PLAN.md +0 -177
  91. package/docs/ContextGit_PHASE2_PLAN.md +0 -535
  92. package/docs/ContextGit_PRD_v4.md +0 -488
  93. package/docs/decisions.md +0 -370
  94. package/packages/api/package.json +0 -25
  95. package/packages/api/src/bootstrap.ts +0 -64
  96. package/packages/api/src/config.ts +0 -45
  97. package/packages/api/src/index.ts +0 -17
  98. package/packages/api/src/middleware/auth.test.ts +0 -83
  99. package/packages/api/src/middleware/auth.ts +0 -41
  100. package/packages/api/src/remote-store.test.ts +0 -301
  101. package/packages/api/src/router.ts +0 -121
  102. package/packages/api/src/server-config.ts +0 -34
  103. package/packages/api/src/server.ts +0 -38
  104. package/packages/api/src/store-router.ts +0 -241
  105. package/packages/api/tsconfig.json +0 -8
  106. package/packages/cli/package.json +0 -29
  107. package/packages/cli/src/bootstrap.ts +0 -68
  108. package/packages/cli/src/commands/branch.ts +0 -58
  109. package/packages/cli/src/commands/claim.ts +0 -58
  110. package/packages/cli/src/commands/commit.ts +0 -79
  111. package/packages/cli/src/commands/context.ts +0 -46
  112. package/packages/cli/src/commands/doctor.ts +0 -99
  113. package/packages/cli/src/commands/init.ts +0 -141
  114. package/packages/cli/src/commands/keygen.ts +0 -65
  115. package/packages/cli/src/commands/log.ts +0 -103
  116. package/packages/cli/src/commands/merge.ts +0 -36
  117. package/packages/cli/src/commands/pull.ts +0 -145
  118. package/packages/cli/src/commands/push.ts +0 -158
  119. package/packages/cli/src/commands/remote-show.ts +0 -87
  120. package/packages/cli/src/commands/search.ts +0 -54
  121. package/packages/cli/src/commands/serve.ts +0 -61
  122. package/packages/cli/src/commands/set-remote.ts +0 -30
  123. package/packages/cli/src/commands/status.ts +0 -62
  124. package/packages/cli/src/commands/unclaim.ts +0 -28
  125. package/packages/cli/src/config.ts +0 -64
  126. package/packages/cli/src/git-hooks.ts +0 -61
  127. package/packages/cli/tsconfig.json +0 -9
  128. package/packages/core/package.json +0 -28
  129. package/packages/core/src/embeddings.test.ts +0 -58
  130. package/packages/core/src/embeddings.ts +0 -75
  131. package/packages/core/src/engine.ts +0 -274
  132. package/packages/core/src/index.ts +0 -6
  133. package/packages/core/src/snapshot.ts +0 -82
  134. package/packages/core/src/summarizer.test.ts +0 -120
  135. package/packages/core/src/summarizer.ts +0 -113
  136. package/packages/core/src/threads.ts +0 -29
  137. package/packages/core/src/types.ts +0 -240
  138. package/packages/core/tsconfig.json +0 -9
  139. package/packages/mcp/package.json +0 -31
  140. package/packages/mcp/src/auto-snapshot.ts +0 -83
  141. package/packages/mcp/src/config.ts +0 -53
  142. package/packages/mcp/src/git-sync.ts +0 -94
  143. package/packages/mcp/src/index.ts +0 -19
  144. package/packages/mcp/src/server.ts +0 -377
  145. package/packages/mcp/tsconfig.json +0 -9
  146. package/packages/store/package.json +0 -30
  147. package/packages/store/src/branch-merge.test.ts +0 -127
  148. package/packages/store/src/engine-integration.test.ts +0 -93
  149. package/packages/store/src/index.ts +0 -3
  150. package/packages/store/src/interface.ts +0 -62
  151. package/packages/store/src/local/claims.test.ts +0 -190
  152. package/packages/store/src/local/index.ts +0 -380
  153. package/packages/store/src/local/local-store.test.ts +0 -164
  154. package/packages/store/src/local/migrations.ts +0 -99
  155. package/packages/store/src/local/queries.ts +0 -760
  156. package/packages/store/src/local/schema.ts +0 -157
  157. package/packages/store/src/remote/index.ts +0 -300
  158. package/packages/store/tsconfig.json +0 -9
  159. package/pnpm-workspace.yaml +0 -2
  160. package/scripts/build.sh +0 -28
  161. package/tsconfig.base.json +0 -14
  162. package/vitest.config.ts +0 -15
  163. /package/{packages/cli/bin → bin}/run.js +0 -0
@@ -1,84 +0,0 @@
1
- # ContextGit — Scope Delta Log
2
-
3
- > This document records scope changes discovered during development.
4
- > It is a log, not a plan. Entries are append-only — never delete or rewrite history.
5
- > PRD and Architecture remain baseline truth. This doc explains how we deviated and why.
6
-
7
- ---
8
-
9
- ## 2026-03-12 — Phase 2 Delta: Coordination Primitives
10
-
11
- **Trigger:** Pre-launch testing revealed task collision problem.
12
-
13
- **The problem:**
14
- Two agents call `context_get` → both see the same "next task" in the snapshot → both start building it simultaneously. This produces duplicate implementations, wasted work, and conflicting code. Write conflicts (SQLite busy_timeout) were never the real problem — task collision was.
15
-
16
- This affects solo devs too. Two Claude Code windows on the same project hit the same issue.
17
-
18
- **Second problem discovered:**
19
- Phase 2 was marked complete in the snapshot. New scope was identified (claim primitive). Agent loading the snapshot would see "Phase 2 complete" and not know about the delta. No mechanism existed to propagate scope changes to other agents.
20
-
21
- **Decision — replan as a primitive: REJECTED**
22
-
23
- Initially proposed `contextgit replan <reason>` as a new command. Rejected because a regular `context_commit` with a `replan:` prefix achieves the same result:
24
-
25
- ```bash
26
- context_commit "replan: claim primitive added to Phase 2. Task collision discovered during testing. Phase 2 not complete."
27
- ```
28
-
29
- The `replan:` prefix in the message gives the semantic signal. The ledger entry updates the snapshot. No new command needed. Keep it simple.
30
-
31
- **CLAUDE.md instruction added instead:**
32
- ```markdown
33
- ## When scope changes mid-session
34
- Write a context_commit with replan: prefix before building new scope:
35
- context_commit "replan: <what changed and why>"
36
- This updates the snapshot so other agents see the scope change immediately.
37
- ```
38
-
39
- **New primitives — APPROVED:**
40
-
41
- ### `contextgit claim <task>`
42
- - Writes `{ task, agent, role, claimedAt, ttl: 2h, status: proposed|active }` to DB
43
- - `context_get` now includes `activeClaims` in snapshot
44
- - Other agents see claimed tasks and skip them
45
- - Claim lifecycle: `proposed → active → released`
46
- - Plan mode agents write `proposed` claims; user approval flips to `active`
47
- - TTL: 2 hours — expired claims auto-drop on next `context_get` call
48
-
49
- ### `contextgit unclaim <task>`
50
- - Manual release of a claim
51
- - Auto-release also fires on next `contextgit commit`
52
-
53
- **DB changes:**
54
- - New `claims` table: `{ id, projectId, branchId, task, agentId, role, claimedAt, status, ttl, releasedAt }`
55
- - No new commit types needed — use `replan:` prefix in message instead
56
-
57
- **Why not in original PRD:**
58
- Discovered during dogfooding Phase 2 on the contextgit project itself. Classic "you don't know what you need until you use it" problem. The PRD describes the vision — this doc describes reality.
59
-
60
- **Status:** Building — Phase 2 not formally closed until claim + replan ship and pass testing.
61
-
62
- ---
63
-
64
- ## 2026-03-11 — Phase 2 Delta: Thread Sync Deferred
65
-
66
- **Trigger:** Push/pull implementation revealed threads are embedded in CommitInput but not returned on Commit entity read.
67
-
68
- **Decision:** Thread sync deferred to post-launch. Commits sync correctly. Threads are MVP gap, acceptable for launch.
69
-
70
- **Status:** Documented as known limitation. Post-launch enhancement.
71
-
72
- ---
73
-
74
- ## 2026-03-11 — Rename: ContextHub → ContextGit
75
-
76
- **Trigger:** ContextHub name was taken / unclear. ContextGit better communicates the git-like mental model.
77
-
78
- **Changes:** npm package, repo, all docs updated to contextgit.
79
-
80
- **Status:** Complete.
81
-
82
- ---
83
-
84
- *Format: newest entries at top. Each entry must include trigger, problem, decision, and status.*
@@ -1,177 +0,0 @@
1
- # ContextGit — Phase 1 Implementation Plan
2
-
3
- ## Context
4
- ContextGit is a persistent memory layer for AI agent workflows, solving the "amnesia problem" where agents lose context across sessions. The repo is greenfield (only `Docs/` exists). We're planning Phase 1 (Weeks 1–4): the core engine, LocalStore, MCP server, CLI, and REST API.
5
-
6
- **Key decisions:**
7
- - Build from scratch (GCC/Aline = inspiration for COMMIT/BRANCH/MERGE/CONTEXT/SNAPSHOT concepts only)
8
- - MCP server is the priority integration (dogfood during development)
9
- - LLM-based rolling summaries from day 1 (`claude-haiku-4-5-20251001`)
10
- - LocalStore only (SQLite + sqlite-vec) — no RemoteStore in Phase 1
11
-
12
- ---
13
-
14
- ## Monorepo Structure
15
-
16
- ```
17
- contextgit/
18
- ├── package.json ← pnpm workspaces root
19
- ├── tsconfig.base.json
20
- ├── .contextgit/config.json ← bootstrapped on itself during dev
21
- ├── packages/
22
- │ ├── core/ ← Context Engine (pure business logic, no I/O)
23
- │ │ └── src/
24
- │ │ ├── types.ts ← ALL shared interfaces (define first, everything derives from this)
25
- │ │ ├── engine.ts ← ContextEngine: COMMIT, BRANCH, MERGE, CONTEXT, SNAPSHOT
26
- │ │ ├── summarizer.ts ← RollingSummarizer: Claude Haiku + graceful fallback
27
- │ │ ├── snapshot.ts ← SnapshotFormatter: agents-md / json / text
28
- │ │ ├── threads.ts ← ThreadManager: immune-to-compression guarantee
29
- │ │ └── embeddings.ts ← EmbeddingService: @xenova/transformers all-MiniLM-L6-v2
30
- │ ├── store/ ← Storage abstraction + LocalStore
31
- │ │ └── src/
32
- │ │ ├── interface.ts ← ContextStore interface (the contract)
33
- │ │ └── local/
34
- │ │ ├── index.ts ← LocalStore: better-sqlite3 + sqlite-vec
35
- │ │ ├── schema.ts ← DDL + indexes
36
- │ │ ├── migrations.ts
37
- │ │ └── queries.ts
38
- │ ├── mcp/ ← MCP Server
39
- │ │ └── src/
40
- │ │ ├── server.ts
41
- │ │ ├── tools/ ← context_get, context_commit, context_branch, context_merge
42
- │ │ ├── git-sync.ts ← branch detection + hook installer
43
- │ │ └── auto-snapshot.ts ← tool-call counter, fires at N=10
44
- │ ├── cli/ ← oclif CLI
45
- │ │ └── src/commands/ ← init, snapshot, commit, branch, search, status
46
- │ └── api/ ← Express REST API
47
- │ └── src/routes/ ← commits, snapshot, branches, search, threads
48
- └── scripts/
49
- ├── build.sh
50
- └── validate-e2e.sh
51
- ```
52
-
53
- **Dependency graph (strict, no circular deps):**
54
- - `core` → `@anthropic-ai/sdk`, `@xenova/transformers`, `nanoid`
55
- - `store` → `core` (types only), `better-sqlite3`, `sqlite-vec`
56
- - `mcp` → `core`, `store`, `@modelcontextprotocol/sdk`, `simple-git`
57
- - `cli` → `core`, `store`, `@oclif/core`
58
- - `api` → `core`, `store`, `express`
59
-
60
- ---
61
-
62
- ## Core Types (define in `packages/core/src/types.ts` before any implementation)
63
-
64
- ```typescript
65
- type AgentRole = 'orchestrator' | 'dev' | 'test' | 'review' | 'background' | 'ci' | 'solo'
66
- type WorkflowType = 'interactive' | 'ralph-loop' | 'ci' | 'background' | 'custom'
67
- type CommitType = 'manual' | 'auto' | 'merge' | 'branch-init'
68
- type BranchStatus = 'active' | 'merged' | 'abandoned'
69
- type SnapshotFormat = 'agents-md' | 'json' | 'text'
70
- type ContextScope = 'global' | 'branch' | 'search' | 'commit' | 'raw'
71
-
72
- // Key entities: Project, Branch, Commit, Thread, Agent
73
- // Commit carries full workflow attribution: agentRole, tool, workflowType, loopIteration, ciRunId
74
- // SessionSnapshot: projectSummary + branchSummary + recentCommits[3] + openThreads[]
75
- ```
76
-
77
- ---
78
-
79
- ## Week-by-Week Plan
80
-
81
- ### Week 1 — Foundation (Days 1–7)
82
- **Goal:** Monorepo scaffolded, COMMIT + CONTEXT returning real data from SQLite.
83
-
84
- 1. **Days 1–2:** Scaffold monorepo (pnpm workspaces). Write `types.ts` in full. Write `store/interface.ts` in full. Set up Vitest.
85
- 2. **Days 3–4:** `LocalStore` — DDL (`schema.ts`), migration runner, `better-sqlite3` implementation. Use sync API wrapped in `Promise.resolve()` at the interface boundary (fine for LocalStore; `ContextStore` interface already returns Promises so Phase 2 `RemoteStore` swap is clean — keep that discipline). IDs via `nanoid()`. DB path: `~/.contextgit/projects/<projectId>.db`.
86
- 3. **Days 5–7:** `ContextEngine.commit()` (with placeholder string truncation for summary), `ContextEngine.context('global')`, `SnapshotFormatter` (all 3 formats), `ThreadManager`.
87
-
88
- **Week 1 validation:** Create project → 2 commits (one with open thread) → `context('global')` → snapshot output shows thread + both commits.
89
-
90
- ---
91
-
92
- ### Week 2 — Rolling Summaries, BRANCH, MERGE, SNAPSHOT (Days 8–14)
93
- **Goal:** Full context engine with LLM summaries and branch operations.
94
-
95
- 1. **Days 8–9:** `RollingSummarizer` using `claude-haiku-4-5-20251001`. Budget: 2000 tokens (project), 500 tokens (branch). Graceful degradation: if API fails, fall back to string truncation. Never fail a COMMIT due to summarizer. Replace Week 1 placeholder.
96
- 2. **Days 10–11:** `engine.branch()` — creates branch, inherits parent summary via a `branch-init` commit. `engine.merge()` — synthesizes both summaries, carries forward open threads from source branch, sets source branch `status: 'merged'`.
97
- 3. **Days 12–13:** `engine.snapshot()` as first-class method. Harden ThreadManager with test: 20 commits through summarizer, open thread still present.
98
- 4. **Day 14:** Integration test — branch + merge + snapshot. Verify AGENTS.md output is immediately useful cold (no other file needed to understand project state).
99
-
100
- **Critical architecture decisions:**
101
- - Open threads stored in `threads` table, never passed to summarizer — guaranteed immune to compression
102
- - Project summary = head commit summary of `main` branch; branch summary = head commit summary of current branch
103
- - Summary history is implicit in the commit chain (every commit stores its summary snapshot)
104
-
105
- ---
106
-
107
- ### Week 3 — MCP Server, CLI, Git Hooks (Days 15–21)
108
- **Goal:** All integration surfaces connected. Begin dogfooding on the ContextGit repo itself.
109
-
110
- 1. **Days 15–16:** MCP Server — 4 tools: `context_get`, `context_commit`, `context_branch`, `context_merge`. Loads `.contextgit/config.json`, detects current git branch via `simple-git`, auto-resolves context branch.
111
- 2. **Day 17:** `GitSync` — `detectCurrentBranch()`, `ensureContextBranchExists()`, `installGitHooks()`. Hooks: `post-checkout` → `contextgit branch switch`, `post-merge` → `contextgit merge --auto`. Non-destructive: append to existing hooks.
112
- 3. **Days 18–19:** oclif CLI — `init`, `snapshot`, `commit`, `branch create/merge`, `search`, `status`. Single `bin/run.js` entry point: detects CLI command vs MCP stdio mode.
113
-
114
- **`contextgit init` must also output a system prompt fragment** — the instruction that tells the agent to call `context_get scope=global` at every session start and `context_commit` at milestones. Without this, Gate 1 fails because the agent won't call the tools reliably. Print it to stdout and write it to `.contextgit/system-prompt.md` for inclusion in MCP config. Minimal viable fragment:
115
- ```
116
- You have access to ContextGit memory tools. At the start of every session, call
117
- context_get with scope=global to load project state. After completing significant
118
- work, call context_commit with a message describing what was done and any open
119
- threads. Use context_branch before exploring risky changes.
120
- ```
121
- 4. **Days 20–21:** `AutoSnapshotManager` — fires auto-commit every N=10 non-context tool calls. **Start dogfooding:** run `contextgit init` on this repo, configure Claude Code MCP.
122
-
123
- **Week 3 validation:**
124
- - `npx contextgit init` → config + DB created, hooks installed
125
- - `context_get scope=global` works inside Claude Code
126
- - Git branch switch fires hook, active context branch updates
127
-
128
- ---
129
-
130
- ### Week 4 — REST API, Embeddings, Packaging, Validation (Days 22–28)
131
- **Goal:** REST API live, semantic search working, npx binary packaged, all three Phase 1 gates passed.
132
-
133
- 1. **Days 22–23:** Express REST API — routes: `POST /v1/projects/:id/commits`, `GET /v1/projects/:id/snapshot`, `POST /v1/projects/:id/branches`, `POST /v1/projects/:id/branches/:id/merge`, `POST /v1/projects/:id/search`, `GET /v1/projects/:id/threads`. Thin wrappers over `ContextEngine`. Supertest integration tests.
134
- 2. **Days 24–25:** `EmbeddingService` — `@xenova/transformers` `Xenova/all-MiniLM-L6-v2`, 384 dims, singleton with lazy init (pre-warm on MCP startup). Wire into `engine.commit()`. `semanticSearch` via sqlite-vec KNN query. FTS5 full-text search via migration v2.
135
- 3. **Day 26:** npx packaging — `contextgit` package.json `bin` entry, `scripts/build.sh`, test `npx contextgit init` in a clean temp dir.
136
- 4. **Days 27–28:** Run all three end-to-end validation gates (see below).
137
-
138
- **Version constraints:**
139
- - `@xenova/transformers`: pin to `^2.17.0` (v3 has breaking API changes)
140
- - `better-sqlite3` + `sqlite-vec`: verify Node.js ABI compatibility on Day 3 before writing SQL
141
-
142
- ---
143
-
144
- ## Phase 1 Validation Gates
145
-
146
- **Gate 1 — Interactive Session (MCP) [most important gate]:**
147
- - A cold agent reads the snapshot and immediately knows where to pick up — no other file needed
148
- - `context_get scope=global` called automatically at session start via injected system prompt fragment
149
- - Open threads persist across git branch switches
150
-
151
- **Gate 2 — Ralph Loop (CLI):**
152
- ```bash
153
- # 3 iterations: snapshot → AGENTS.md → commit --workflow-type ralph-loop
154
- # Verify all 4 sections present in AGENTS.md each iteration
155
- ```
156
-
157
- **Gate 3 — REST API (Simulated CI):**
158
- ```bash
159
- # GET /v1/projects/:id/snapshot?format=agents-md → returns PROJECT STATE section
160
- # POST /v1/projects/:id/commits with workflowType: ci → returns commitId
161
- ```
162
-
163
- **Additional checks:**
164
- - Snapshot stays under 600 tokens for a project with 20+ commits
165
- - Semantic search returns relevant commit for natural language query
166
- - Summarizer fallback path tested explicitly (mock API failure)
167
-
168
- ---
169
-
170
- ## Config Strategy
171
-
172
- - `.contextgit/config.json` — project-local, committed to repo (shared across team)
173
- - `~/.contextgit/projects/<projectId>.db` — machine-local, not committed
174
- - `ANTHROPIC_API_KEY` from env or config
175
-
176
- ## Agent Identity (Phase 1)
177
- Agent ID = `<hostname>-<agentRole>-<tool>` (deterministic, no auth needed until Phase 2)