Skip to content

Stop Think from managing git-warp cache#28

Merged
flyingrobots merged 9 commits into
mainfrom
git-warp-cache-boundary
Jul 8, 2026
Merged

Stop Think from managing git-warp cache#28
flyingrobots merged 9 commits into
mainfrom
git-warp-cache-boundary

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Upgrade the git-warp boundary work to @git-stunts/git-warp@18.2.1 and enforce the hexagonal boundary ratchet.
  • Remove Think-owned git-warp checkpoint/state-cache runtime code, tests, doctor checks, Browse fallback paths, and Stats fast paths.
  • Move product writes and reads back to the public worldline surface: openWarpWorldline(), WarpWorldline.commit(), and worldline.live().
  • Keep legacy v17 checkpoint handling quarantined in the explicit repair script instead of normal product/runtime diagnostics.

Why

Think was treating git-warp internals as part of its own data plane: probing WARP refs, deleting cache refs on open errors, reading checkpoint/state-cache materializations, and surfacing cache state in doctor. That violates the current git-warp contract, where application code should use worldlines and let git-warp own cache/checkpoint behavior.

Validation

  • npm run test:fast passed locally before commit: lint plus 142/142 port tests.
  • node ./bin/think.js --doctor --json passed and no longer emits a checkpoint/cache check.
  • Pre-commit lint passed.
  • Pre-push npm run test:fast passed again before publishing the branch.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 716609c9-a61d-4f2f-815a-540b10ba784a

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe1944 and cc0ef30.

📒 Files selected for processing (6)
  • src/browse-tui/panels.js
  • src/store/constants.js
  • src/store/read-model.js
  • src/store/runtime.js
  • test/ports/browse-tui.test.js
  • test/ports/recent-runtime.test.js

Walkthrough

This PR adds a hexagonal-boundary ratchet, migrates product reads and writes to think-worldline/read-model APIs, removes checkpoint-specific product paths, and updates docs, baselines, and tests to match the new boundary rules.

Changes

Checkpoint Removal and Hexagonal Boundary Ratchet

Layer / File(s) Summary
Boundary ratchet and policy docs
scripts/hexagonal-boundary-ratchet.mjs, scripts/lint.mjs, scripts/runtime-truth-ratchet.mjs, package.json, docs/audit/*, docs/INFRASTRUCTURE_DOCTRINE.md, docs/GLOSSARY.md, docs/method/backlog/*, docs/design/README.md, CHANGELOG.md, ADVANCED_GUIDE.md
Adds the leak scan, wires it into lint and package scripts, updates audit baselines, and rewrites boundary/read-model doctrine, glossary, changelog, and backlog guidance.
Read-model and runtime primitives
src/store/constants.js, src/store/read-model.js, src/store/runtime.js, src/errors.js
Adds capture and ambient read-model helpers, new read-model constants, runtime cache/read-handle changes, and the new content-unavailable error.
Store writes moved to think-worldline commits
src/store/annotate.js, src/store/capture.js, src/store/derivation.js, src/store/enrichment/runner.js, src/store/migrations.js, src/store/reflect.js
Switches store write flows from WarpApp and checkpoint plumbing to think-worldline commits and read-model patching.
Query paths and checkpoint cleanup
src/store/queries.js, src/browse/adapters/git-warp.js, src/cli/commands/doctor.js, src/doctor.js, src/mcp/service.js, src/cli/graph-gate.js, src/cli/commands/read.js, src/cli/commands/capture.js, src/store/checkpoint-product-read.js, src/store/checkpoint-read.js, src/store/checkpoint-state.js, src/store/content-reader.js, test/ports/private-imports.test.js
Reworks remember, stats, recent, and browse paths around bounded read models, and removes checkpoint-specific store, doctor, and browse fallback behavior.
Tests and fixtures
test/acceptance/mcp.test.js, test/ports/*
Updates acceptance and port tests to expect bounded read-model behavior, new session resolution, worldline commits, and removed checkpoint paths.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant runtime as runtime.js
  participant readModel as read-model.js
  participant worldline as openThinkWorldline
  participant lint as scripts/lint.mjs
  participant ratchet as scripts/hexagonal-boundary-ratchet.mjs

  runtime->>worldline: openProductReadHandle(repoDir)
  runtime->>readModel: readCaptureReadModel(read)
  readModel-->>runtime: refs and capture totals

  lint->>ratchet: run hexagonal-boundary-ratchet.mjs
  ratchet->>docs/audit/hexagonal-boundary-ratchet-baseline.json: load baseline
  ratchet-->>lint: exit status
Loading

Possibly related PRs

  • flyingrobots/think#15: Both PRs wire ratchet execution through scripts/lint.mjs, and this change adds the new hexagonal-boundary ratchet beside the runtime-truth ratchet.

Poem

Checkpoints packed their bags at dawn,
Worldlines kept the reads moving on.
A ratchet clicked, the boundary held,
Old cache-fog quietly repelled.
🛠️✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly captures the main refactor: Think stops managing git-warp cache internals.
Description check ✅ Passed The description matches the change set and accurately summarizes the cache, boundary, and worldline refactor.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/store/runtime.js (1)

147-192: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Two hand-copied CAS-retry loops will rot out of sync. Collapse them.

commitThinkWorldline and commitThinkWorldlineWithWriter differ only in (a) how the worldline is opened and (b) whether the cache is cleared on conflict. Duplicating the while (true) + isWriterCasConflict + maxAttempts machinery invites divergence in exactly the code path that guards data integrity.

♻️ Extract a single retry primitive
+async function commitWithRetry(open, patcher, maxAttempts, onConflict) {
+  let attempt = 1;
+  /* eslint-disable no-await-in-loop -- retry attempts must run sequentially against a refreshed worldline */
+  while (true) {
+    const worldline = await open();
+    try {
+      await worldline.commit(patcher);
+      return worldline;
+    } catch (error) {
+      if (!isWriterCasConflict(error) || attempt >= maxAttempts) {
+        throw error;
+      }
+      onConflict?.();
+      attempt += 1;
+    }
+  }
+  /* eslint-enable no-await-in-loop */
+}
+
+export function commitThinkWorldline(repoDir, patcher, { maxAttempts = DEFAULT_PATCH_MAX_ATTEMPTS } = {}) {
+  return commitWithRetry(() => openThinkWorldline(repoDir), patcher, maxAttempts, () => clearWarpRuntimeCache(repoDir));
+}
+
+export function commitThinkWorldlineWithWriter(repoDir, writerId, patcher, { maxAttempts = DEFAULT_PATCH_MAX_ATTEMPTS } = {}) {
+  return commitWithRetry(() => openThinkWorldlineOnce(repoDir, writerId), patcher, maxAttempts);
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/store/runtime.js` around lines 147 - 192, The CAS retry logic in
commitThinkWorldline and commitThinkWorldlineWithWriter is duplicated and will
drift, so extract a single retry primitive that owns the while-loop,
isWriterCasConflict check, attempt/maxAttempts handling, and commit flow. Keep
the differences configurable by passing in the worldline opener
(openThinkWorldline vs openThinkWorldlineOnce) and an optional conflict hook for
clearWarpRuntimeCache, then have both exported functions delegate to that shared
helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/GLOSSARY.md`:
- Around line 121-122: The `WarpApp` glossary entry is now contradictory with
the new `think`/observer wording and still describes product read paths starting
from `WarpApp`. Update the `WarpApp` entry in `docs/GLOSSARY.md` so it matches
the worldline-based read path described by `observer`, and remove any statement
that `think` begins product reads from `WarpApp`. Use the `WarpApp` and `think`
glossary entries to keep the terminology consistent across the document.

---

Outside diff comments:
In `@src/store/runtime.js`:
- Around line 147-192: The CAS retry logic in commitThinkWorldline and
commitThinkWorldlineWithWriter is duplicated and will drift, so extract a single
retry primitive that owns the while-loop, isWriterCasConflict check,
attempt/maxAttempts handling, and commit flow. Keep the differences configurable
by passing in the worldline opener (openThinkWorldline vs
openThinkWorldlineOnce) and an optional conflict hook for clearWarpRuntimeCache,
then have both exported functions delegate to that shared helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a64c2d5f-b5c4-41c6-8f2f-14337ce07984

📥 Commits

Reviewing files that changed from the base of the PR and between 098a823 and 9da574c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (40)
  • CHANGELOG.md
  • docs/GLOSSARY.md
  • docs/INFRASTRUCTURE_DOCTRINE.md
  • docs/audit/hexagonal-boundary-ratchet-baseline.json
  • docs/audit/runtime-truth-ratchet-baseline.json
  • docs/design/README.md
  • docs/method/backlog/bad-code/CORE_boundary-codec-cutover.md
  • docs/method/backlog/bad-code/CORE_git-warp-dependency-truth.md
  • docs/method/backlog/bad-code/CORE_hexagonal-store-boundary.md
  • docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
  • docs/method/backlog/cool-ideas/SURFACE_document-window-based-read-model.md
  • package.json
  • scripts/hexagonal-boundary-ratchet.mjs
  • scripts/lint.mjs
  • scripts/runtime-truth-ratchet.mjs
  • src/browse/adapters/git-warp.js
  • src/cli/commands/doctor.js
  • src/cli/graph-gate.js
  • src/doctor.js
  • src/mcp/service.js
  • src/store/annotate.js
  • src/store/capture.js
  • src/store/checkpoint-product-read.js
  • src/store/checkpoint-read.js
  • src/store/checkpoint-state.js
  • src/store/constants.js
  • src/store/content-reader.js
  • src/store/derivation.js
  • src/store/enrichment/runner.js
  • src/store/migrations.js
  • src/store/queries.js
  • src/store/reflect.js
  • src/store/runtime.js
  • test/acceptance/mcp.test.js
  • test/ports/browse-appshell.test.js
  • test/ports/capture-context.test.js
  • test/ports/checkpoint-read.test.js
  • test/ports/content-reader.test.js
  • test/ports/doctor.test.js
  • test/ports/private-imports.test.js
💤 Files with no reviewable changes (11)
  • src/store/content-reader.js
  • test/ports/content-reader.test.js
  • src/store/checkpoint-product-read.js
  • src/mcp/service.js
  • src/store/constants.js
  • src/store/checkpoint-read.js
  • src/store/checkpoint-state.js
  • test/ports/checkpoint-read.test.js
  • src/store/queries.js
  • src/cli/commands/doctor.js
  • test/ports/doctor.test.js
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: test (22)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

**: # AGENTS

This guide is for AI agents and human operators recovering context in the Think repository.

Git Rules

  • NEVER amend commits.
  • NEVER rebase or force-push.
  • NEVER push to main without explicit permission.
  • Always use standard commits and regular pushes.

Documentation & Planning Map

Do not audit the repository by recursively walking the filesystem. Follow the authoritative manifests:

1. The Entrance

  • README.md: Public front door, core value prop, and quick start.
  • GUIDE.md: Orientation, fast path, and system orchestration.

2. The Bedrock

  • ARCHITECTURE.md: The authoritative structural reference (Git, WARP, Minds).
  • docs/INFRASTRUCTURE_DOCTRINE.md: The runtime-first engineering standards (MANDATORY).
  • docs/VISION.md: Core tenets and the capture doctrine.
  • docs/method/process.md: Repo work doctrine (Backlog lanes, Cycle loop).

3. The Direction

  • docs/BEARING.md: Current execution gravity and active tensions.
  • docs/design/ROADMAP.md: Broad strategic horizon and phase targets.
  • docs/method/backlog/: The active source of truth for pending work.

4. The Proof

  • CHANGELOG.md: Historical truth of merged behavior.
  • docs/audit/: Structural health and due diligence reports.

Context Recovery Protocol

When starting a new session or recovering from context loss:

  1. Read docs/BEARING.md to find the current execution gravity.
  2. Read docs/method/process.md to understand the work doctrine.
  3. Check docs/method/backlog/asap/ for imminent work.
  4. Check git log -n 5 and git status to verify the current branch state.

End of Turn Checklist

After altering files:

  1. Verify Truth: Ensure documentation is updated if behavior or structure changed.
  2. Log Debt: Add follow-on backlog items to bad-code/ or cool-ideas/.
  3. Commit: Use focused, conventional commit messages. Propose a draft before executing.
  4. **...

Files:

  • docs/design/README.md
  • docs/method/backlog/bad-code/CORE_boundary-codec-cutover.md
  • src/cli/graph-gate.js
  • test/acceptance/mcp.test.js
  • docs/method/backlog/bad-code/CORE_git-warp-dependency-truth.md
  • CHANGELOG.md
  • docs/method/backlog/cool-ideas/SURFACE_document-window-based-read-model.md
  • docs/INFRASTRUCTURE_DOCTRINE.md
  • docs/method/backlog/bad-code/CORE_hexagonal-store-boundary.md
  • docs/audit/hexagonal-boundary-ratchet-baseline.json
  • docs/GLOSSARY.md
  • scripts/lint.mjs
  • src/store/derivation.js
  • src/store/annotate.js
  • src/store/migrations.js
  • src/store/enrichment/runner.js
  • scripts/runtime-truth-ratchet.mjs
  • test/ports/private-imports.test.js
  • test/ports/capture-context.test.js
  • src/store/capture.js
  • docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
  • test/ports/browse-appshell.test.js
  • scripts/hexagonal-boundary-ratchet.mjs
  • src/store/reflect.js
  • src/doctor.js
  • src/browse/adapters/git-warp.js
  • package.json
  • docs/audit/runtime-truth-ratchet-baseline.json
  • src/store/runtime.js
🪛 LanguageTool
docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md

[grammar] ~23-~23: Use a hyphen to join words.
Context: ...nds. - [ ] Prefer public worldline/optic bounded reads where broad transitional ...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (31)
CHANGELOG.md (1)

15-20: LGTM!

docs/GLOSSARY.md (1)

124-141: LGTM!

docs/INFRASTRUCTURE_DOCTRINE.md (1)

63-75: LGTM!

docs/audit/runtime-truth-ratchet-baseline.json (1)

11-12: LGTM!

Also applies to: 161-164, 216-219, 232-232, 308-311, 367-367, 384-391

test/ports/browse-appshell.test.js (1)

82-94: LGTM!

Also applies to: 146-146, 190-190, 372-372, 383-383

test/ports/capture-context.test.js (1)

3-3: LGTM!

Also applies to: 87-88, 107-108, 130-133, 142-143, 159-164

test/ports/private-imports.test.js (1)

8-28: LGTM!

docs/design/README.md (1)

71-71: LGTM!

docs/method/backlog/bad-code/CORE_boundary-codec-cutover.md (1)

16-27: LGTM!

docs/method/backlog/bad-code/CORE_git-warp-dependency-truth.md (1)

8-27: LGTM!

docs/method/backlog/bad-code/CORE_hexagonal-store-boundary.md (1)

20-22: LGTM!

Also applies to: 37-40

docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md (1)

21-24: LGTM!

docs/method/backlog/cool-ideas/SURFACE_document-window-based-read-model.md (1)

3-6: LGTM!

test/acceptance/mcp.test.js (1)

164-164: LGTM!

scripts/hexagonal-boundary-ratchet.mjs (1)

1-254: LGTM!

src/store/capture.js (1)

9-9: LGTM!

Also applies to: 65-82

src/store/derivation.js (1)

22-22: LGTM!

Also applies to: 94-94, 158-158

src/store/migrations.js (1)

9-9: LGTM!

Also applies to: 171-171

src/browse/adapters/git-warp.js (1)

86-89: 🩺 Stability & Availability

Verify caller handles propagated errors from loadLiveHistoryWindow.

The checkpoint try/catch fallback was removed. If loadLiveHistoryWindow throws (e.g., openHistoryReadHandle fails on repo corruption), the error now propagates through the generator and loadGitWarpHistoryWindow uncaught. Previously, a checkpoint-derived stale window was yielded as a fallback. Confirm that all callers of loadGitWarpHistoryWindow have appropriate error handling for this new failure mode.

src/cli/graph-gate.js (1)

32-32: LGTM!

src/doctor.js (1)

23-35: LGTM!

Also applies to: 63-82, 84-89

scripts/lint.mjs (1)

15-20: LGTM!

package.json (2)

34-34: LGTM!


46-46: 🗄️ Data Integrity & Integration

No issue with the @git-stunts/git-warp bump.

docs/audit/hexagonal-boundary-ratchet-baseline.json (1)

1-38: LGTM!

scripts/runtime-truth-ratchet.mjs (1)

104-106: LGTM!

Also applies to: 225-225

src/store/runtime.js (2)

1-1: LGTM!

Also applies to: 115-124, 142-145, 198-218


171-192: 🗄️ Data Integrity & Integration

No cache invalidation needed here. worldline.live() reads the current admitted state, so commitThinkWorldlineWithWriter does not need to clear warpWorldlineCache for readers to see its writes.

			> Likely an incorrect or invalid review comment.
src/store/annotate.js (1)

8-20: LGTM!

Also applies to: 32-34

src/store/enrichment/runner.js (1)

4-7: LGTM!

Also applies to: 20-20, 236-236, 330-330

src/store/reflect.js (1)

16-34: LGTM!

Also applies to: 43-43, 82-82, 103-120

Comment thread docs/GLOSSARY.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9da574cd54

ℹ️ 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".

Comment thread src/store/runtime.js Outdated
Comment on lines +213 to +215
contentCore: null,
blobStorage,
readContent: resolveProductContentReader(checkpointRead, app),
readContent: null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore a content reader when blob storage is missing

When running against a GitGraphAdapter that does not expose the optional createRuntimeBlobStorage helper (the code still feature-detects this below), getRuntimeBlobStorage() returns null and this read handle now also has no readContent/contentCore fallback. In that case readNodeText() falls through to readContent() and returns '' for every attached capture/annotation/reflect body, whereas the previous path populated an app content reader or failed loudly. Please keep a public fallback reader or surface an error instead of silently emptying text reads.

Useful? React with 👍 / 👎.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/mcp/service.js (1)

198-198: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore the remember migration gate

rememberThoughts only reads the product read model. On an unmigrated repo, it will silently return empty matches because readCaptureRecords() finds no read-model data and listRecentStoredEntries() bails out as soon as readNodeProp exists. Keep assertGraphReady('remember') here or add a real legacy fallback.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mcp/service.js` at line 198, The remember flow in service.js is missing
the migration gate, so `rememberThoughts` can silently return empty results on
unmigrated repos. Restore the `assertGraphReady('remember')` check in the
`remember` path, or implement a true legacy fallback before calling
`rememberThoughts`, so the code does not rely only on read-model data when
`readCaptureRecords` and `listRecentStoredEntries` may be unavailable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/browse-tui/panels.js`:
- Around line 105-114: Guard the current entry lookup in the panel rendering
flow: `resolveCurrentSessionId(...)` may succeed even when `currentEntry(model)`
returns undefined, so accessing `entry.id` in `panels.js` can crash. Update the
logic around `currentEntry(model)` and `sessionEntries.findIndex(...)` to first
check whether `entry` exists, and return the same dimmed fallback used for
missing session context when it does not.

In `@src/store/read-model.js`:
- Line 36: The EXACT_READ_UNAVAILABLE symbol is defined separately in read-model
and runtime, which risks the reader and writer paths drifting. Move the
Symbol.for('think.exactReadUnavailable') definition to a single shared module
and export it, then update both read-model and runtime to import that shared
constant instead of redefining it. Use the EXACT_READ_UNAVAILABLE symbol name
and the existing read-model/runtime modules to locate the duplicate definitions.

In `@src/store/runtime.js`:
- Around line 229-250: The worldline exact reader is caching the optic basis
twice: createWorldlineExactPropReader keeps a local basisPromise while
prepareCachedOpticBasis already memoizes via opticBasisCache. Remove the local
basisPromise from createWorldlineExactPropReader and always await
prepareCachedOpticBasis(worldline) directly so retries aren’t blocked by a
permanently rejected promise. Keep the existing EXACT_READ_UNAVAILABLE and
isMissingBoundedOpticBasis handling intact.

---

Outside diff comments:
In `@src/mcp/service.js`:
- Line 198: The remember flow in service.js is missing the migration gate, so
`rememberThoughts` can silently return empty results on unmigrated repos.
Restore the `assertGraphReady('remember')` check in the `remember` path, or
implement a true legacy fallback before calling `rememberThoughts`, so the code
does not rely only on read-model data when `readCaptureRecords` and
`listRecentStoredEntries` may be unavailable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1f4987ad-0782-4ec8-ad9f-3cc037fe0d47

📥 Commits

Reviewing files that changed from the base of the PR and between 9e30788 and 5fe1944.

📒 Files selected for processing (18)
  • ADVANCED_GUIDE.md
  • CHANGELOG.md
  • docs/GLOSSARY.md
  • docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
  • scripts/repair-v17-mind.mjs
  • src/browse-tui/panels.js
  • src/browse-tui/resolve.js
  • src/browse-tui/view.js
  • src/cli/commands/capture.js
  • src/cli/commands/read.js
  • src/errors.js
  • src/mcp/service.js
  • src/store/capture.js
  • src/store/queries.js
  • src/store/read-model.js
  • src/store/runtime.js
  • test/ports/no-full-materialization.test.js
  • test/ports/recent-runtime.test.js
💤 Files with no reviewable changes (1)
  • src/cli/commands/read.js
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: test (22)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

**: # AGENTS

This guide is for AI agents and human operators recovering context in the Think repository.

Git Rules

  • NEVER amend commits.
  • NEVER rebase or force-push.
  • NEVER push to main without explicit permission.
  • Always use standard commits and regular pushes.

Documentation & Planning Map

Do not audit the repository by recursively walking the filesystem. Follow the authoritative manifests:

1. The Entrance

  • README.md: Public front door, core value prop, and quick start.
  • GUIDE.md: Orientation, fast path, and system orchestration.

2. The Bedrock

  • ARCHITECTURE.md: The authoritative structural reference (Git, WARP, Minds).
  • docs/INFRASTRUCTURE_DOCTRINE.md: The runtime-first engineering standards (MANDATORY).
  • docs/VISION.md: Core tenets and the capture doctrine.
  • docs/method/process.md: Repo work doctrine (Backlog lanes, Cycle loop).

3. The Direction

  • docs/BEARING.md: Current execution gravity and active tensions.
  • docs/design/ROADMAP.md: Broad strategic horizon and phase targets.
  • docs/method/backlog/: The active source of truth for pending work.

4. The Proof

  • CHANGELOG.md: Historical truth of merged behavior.
  • docs/audit/: Structural health and due diligence reports.

Context Recovery Protocol

When starting a new session or recovering from context loss:

  1. Read docs/BEARING.md to find the current execution gravity.
  2. Read docs/method/process.md to understand the work doctrine.
  3. Check docs/method/backlog/asap/ for imminent work.
  4. Check git log -n 5 and git status to verify the current branch state.

End of Turn Checklist

After altering files:

  1. Verify Truth: Ensure documentation is updated if behavior or structure changed.
  2. Log Debt: Add follow-on backlog items to bad-code/ or cool-ideas/.
  3. Commit: Use focused, conventional commit messages. Propose a draft before executing.
  4. **...

Files:

  • CHANGELOG.md
  • ADVANCED_GUIDE.md
  • src/errors.js
  • docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
  • src/cli/commands/capture.js
  • src/browse-tui/view.js
  • src/browse-tui/panels.js
  • docs/GLOSSARY.md
  • scripts/repair-v17-mind.mjs
  • src/mcp/service.js
  • src/browse-tui/resolve.js
  • src/store/capture.js
  • test/ports/no-full-materialization.test.js
  • test/ports/recent-runtime.test.js
  • src/store/queries.js
  • src/store/read-model.js
  • src/store/runtime.js
🔇 Additional comments (22)
ADVANCED_GUIDE.md (1)

11-12: LGTM!

CHANGELOG.md (1)

15-26: LGTM!

docs/GLOSSARY.md (1)

109-111: LGTM!

Also applies to: 123-143

docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md (1)

10-13: LGTM!

Also applies to: 22-39

src/store/queries.js (1)

115-140: LGTM!

Also applies to: 144-176, 179-181, 420-424, 465-478

src/cli/commands/capture.js (1)

13-13: LGTM!

src/browse-tui/view.js (1)

26-26: LGTM!

Also applies to: 278-286

test/ports/no-full-materialization.test.js (1)

54-72: LGTM!

Also applies to: 74-98, 100-113, 115-127, 129-155, 157-183, 185-192, 194-201, 203-209, 211-217

test/ports/recent-runtime.test.js (1)

4-9: LGTM!

Also applies to: 18-18, 28-29, 31-57, 59-67, 69-78, 80-95, 97-116

src/mcp/service.js (1)

42-42: LGTM!

src/browse-tui/resolve.js (1)

88-109: LGTM!

scripts/repair-v17-mind.mjs (2)

539-565: LGTM!


503-537: 🩺 Stability & Availability

No issue here@git-stunts/git-warp@18.2.1 exposes the referenced paths and exports, so this warning doesn’t apply.

			> Likely an incorrect or invalid review comment.
src/store/runtime.js (3)

118-118: Duplicate of the sentinel-ownership concern already raised on src/store/read-model.js:36. This is the second copy of Symbol.for('think.exactReadUnavailable').


450-464: 🩺 Stability & Availability

Need to check the readNodeText call path
I need the surrounding code for src/store/runtime.js:319 and any top-level ContentUnavailableError handling to tell whether this is an intentional fail-fast path or a regression in browse/read flows.


513-515: 🎯 Functional Correctness

No issue: the excludeIds lookup runs after the full read model is written. getLatestStoredEntry(..., { excludeIds }) is only called from ensureCaptureReadEdges and deriveSessionAttribution, both of which run after patchCaptureReadModel(...) commits recentCaptureRecordsJson; the fast pending model is only used for unconditional latest reads.

			> Likely an incorrect or invalid review comment.
src/store/read-model.js (2)

133-164: LGTM!

Also applies to: 284-292, 415-431, 433-486


244-253: 🎯 Functional Correctness

No ambient-key filter needed here readAmbientReadModel fetches the node by ambientReadModelId(key, value), and readAmbientCaptureRefs only passes descriptors from ambientScopeDescriptors(scope), so the model is already scoped by key/value; normalizeAmbientReadModel just shapes the stored payload.

			> Likely an incorrect or invalid review comment.
src/errors.js (1)

51-56: LGTM!

src/store/capture.js (3)

96-104: 🚀 Performance & Scalability | 💤 Low value

Four sequential openProductReadHandle reopens per finalize — justify the churn or collapse it.

finalizeCapturedThought reopens the product read handle after each commit (Lines 97, 101, 103). It is defensible if each intervening commit invalidates the live view, but that is not obvious from the code. Confirm the reopen is required for view freshness after commitThinkWorldline; if the worldline is cached and the view reflects commits, several of these are wasted round-trips on the capture hot path.


45-53: LGTM!


55-68: 🗄️ Data Integrity & Integration

No provenance loss here. getStoredEntry hydrates captureProvenance from the node props, and patchCaptureReadModel rewrites the read-model from that hydrated entry during finalize, so the indexed/read-model paths carry provenance.

			> Likely an incorrect or invalid review comment.

Comment thread src/browse-tui/panels.js Outdated
Comment thread src/store/read-model.js Outdated
Comment thread src/store/runtime.js
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 8, 2026
@flyingrobots
flyingrobots merged commit 9dbcf98 into main Jul 8, 2026
1 of 2 checks passed
@flyingrobots
flyingrobots deleted the git-warp-cache-boundary branch July 8, 2026 17:09
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