Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ADVANCED_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ For orientation and the productive-fast path, use the [GUIDE.md](./GUIDE.md).

## Graph-Native Doctrine

Think uses a "window-based" read model to ensure the TUI remains responsive even as your archive grows to thousands of entries.
Think uses bounded product read models to ensure recall and browse remain responsive as your archive grows.

- **No Whole-Graph Materialization**: Commands like `browse` and `remember` use `git-warp` read handles to query specific worldline slices.
- **Checkpoint-Backed Reuse**: The browse TUI uses checkpoints to avoid redundant traversal of chronological neighbors.
- **No Whole-Graph Materialization**: Default `browse`, `recent`, and `remember` paths read Think-owned latest/recent read-model facts. Recall uses self-contained fast capture records so it does not hydrate capture nodes just to score ambient project matches.
- **Runtime-Owned Acceleration**: `git-warp` owns checkpoints, state-cache, snapshots, and materialization; Think stores domain facts such as "latest capture" and "recent capture records."
- **Immutable Raw Layer**: The core Git repository is the system of record. Raw thoughts are never modified after capture.

## Derivation Pipeline
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ Release discipline:

## Unreleased

- added bounded Think read-model facts for latest/recent captures plus
self-contained fast capture records so default `--remember`, `--recent`, and
browse bootstrap avoid scanning `entry:*`
- added ratchet tests proving default ambient recall and explicit recall avoid
graph queries, keyword wildcard scans, and capture-node hydration when fast
capture records are available
- added a Hexagonal Boundary lint ratchet so product code cannot increase
direct substrate-layout or `git-warp` runtime leakage
- removed Think-managed `git-warp` cache/checkpoint reads, doctor checks, and
ref deletion from product runtime paths
- upgraded `@git-stunts/git-warp` to 18.2.1

## [0.7.2] - 2026-06-23

- added feature proposal packets for History product boundaries, Browse memory workbench, followthrough job queue, agent-native memory API, and evidence-bound enrichment
Expand Down
16 changes: 10 additions & 6 deletions docs/GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ Git handles the repository substrate. `git-warp` provides the graph layer on top

The primary application handle exposed by `git-warp`.

In `think`, product read paths begin from `WarpApp`.
`think` does not use `WarpApp` as a product read facade. Product reads open
public `git-warp` worldlines and let `git-warp` own internal checkpoint and
cache state.

### worldline

Expand All @@ -118,25 +120,27 @@ The normal product read handle in `git-warp`.

A narrower read aperture derived from a `worldline`.

In `think`, product reads use `WarpApp -> worldline() -> observer(...)` where that helps keep read scope honest.
In `think`, product reads open a public `git-warp` worldline and read through
that worldline. Think does not open `WarpApp` as a product read facade.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

### core

The whole-state inspection and admin-style `git-warp` surface.

In `think`, `core()` is reserved for:
In `think`, `core()` is reserved for explicit operator tooling such as:

- migration
- admin-style full-state inspection
- narrow content-attachment reads not available on `worldline` / `observer`

It should not be the default product read path.

### checkpoint

`git-warp` recovery state that makes reopening read handles much faster.
`git-warp` recovery state that can accelerate reopened read handles.

Enabling checkpoints was one of the major browse-performance fixes in M4.
Think product code does not inspect, delete, or repair checkpoint/state-cache
refs. Routine reads let `git-warp` own cache decisions; the only Think code that
names legacy checkpoint refs is the explicit v17 repair lane for old minds.

### history model version

Expand Down
13 changes: 13 additions & 0 deletions docs/INFRASTRUCTURE_DOCTRINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ Examples of capabilities that require ports:
- CLI, MCP, macOS, and browser I/O.
- Encoding, decoding, and content storage.

Product code must not know substrate layout. References to concrete
storage engines, `git-warp` runtime classes, WARP ref paths,
checkpoint/state-cache mechanics, materialization strategies, or repair
commands belong only in explicit adapter, repair, or benchmark boundaries.
Think diagnostics must not inspect or mutate `git-warp` cache refs; operators
should use `git-warp` diagnostics for that substrate. CLI, MCP, Browse,
Remember, Stats, and domain modules consume product ports and runtime-backed
domain facts, not storage internals.

This boundary is enforced by `npm run hexagonal-boundary:ratchet`, which
runs from `npm run lint`. Existing leaks are debt in the ratchet baseline;
new code must not increase them.

### 2. Dependency Injection

Dependencies are injected through constructors or semantically named
Expand Down
38 changes: 38 additions & 0 deletions docs/audit/hexagonal-boundary-ratchet-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"allowedBoundaryFiles": [
"scripts/hexagonal-boundary-ratchet.mjs",
"scripts/repair-v17-mind.mjs",
"src/browse-benchmark.js",
"src/browse/adapters/git-warp-worker.js",
"src/browse/adapters/git-warp.js",
"src/cli/commands/doctor.js",
"src/doctor.js",
"src/history/git-warp-read.js"
],
"generatedFrom": "scripts/hexagonal-boundary-ratchet.mjs",
"leaks": {
"byFile": {
"src/git.js": 1,
"src/store/annotate.js": 4,
"src/store/capture.js": 6,
"src/store/derivation.js": 3,
"src/store/enrichment/runner.js": 2,
"src/store/migrations.js": 6,
"src/store/reflect.js": 6,
"src/store/runtime.js": 11
},
"byTerm": {
"git-warp-package": 1,
"git-warp-runtime-symbol": 37,
"warp-ref-layout": 1
},
"total": 39
},
"substrateTermIds": [
"git-warp-package",
"git-warp-runtime-symbol",
"checkpoint-mechanic",
"warp-ref-layout"
],
"version": 1
}
50 changes: 12 additions & 38 deletions docs/audit/runtime-truth-ratchet-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"strictLimits": {
"byCategory": {
"benchmark": 5,
"source": 150,
"test": 45
"source": 142,
"test": 34
},
"byFile": {
"benchmarks/browse-bootstrap.js": {
Expand Down Expand Up @@ -158,12 +158,10 @@
},
"src/cli/commands/capture.js": {
"byRule": {
"complexity": 1,
"max-lines-per-function": 1,
"max-statements": 1
"max-lines-per-function": 1
},
"category": "source",
"total": 3
"total": 1
},
"src/cli/commands/read.js": {
"byRule": {
Expand Down Expand Up @@ -215,10 +213,10 @@
},
"src/mcp/service.js": {
"byRule": {
"max-lines-per-function": 2
"max-lines-per-function": 1
},
"category": "source",
"total": 2
"total": 1
},
"src/splash-shader.js": {
"byRule": {
Expand All @@ -231,13 +229,6 @@
"category": "source",
"total": 17
},
"src/store/checkpoint-product-read.js": {
"byRule": {
"complexity": 1
},
"category": "source",
"total": 1
},
"src/store/derivation.js": {
"byRule": {
"complexity": 2,
Expand Down Expand Up @@ -314,19 +305,10 @@
},
"src/store/runtime.js": {
"byRule": {
"complexity": 7,
"max-lines-per-function": 1
"complexity": 4
},
"category": "source",
"total": 8
},
"test/acceptance/graph-migration.test.js": {
"byRule": {
"complexity": 2,
"max-lines-per-function": 7
},
"category": "test",
"total": 9
"total": 4
},
"test/acceptance/json-output.test.js": {
"byRule": {
Expand Down Expand Up @@ -382,14 +364,6 @@
"category": "test",
"total": 2
},
"test/ports/checkpoint-read.test.js": {
"byRule": {
"max-lines-per-function": 1,
"max-statements": 1
},
"category": "test",
"total": 2
},
"test/ports/docs-consistency.test.js": {
"byRule": {
"max-lines-per-function": 1
Expand All @@ -407,14 +381,14 @@
}
},
"byRule": {
"complexity": 61,
"complexity": 54,
"max-depth": 11,
"max-lines": 1,
"max-lines-per-function": 96,
"max-lines-per-function": 86,
"max-params": 3,
"max-statements": 28
"max-statements": 26
},
"total": 200
"total": 181
},
"strictRuleIds": [
"complexity",
Expand Down
2 changes: 1 addition & 1 deletion docs/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Completed milestone and slice notes that still matter as historical context, but
- [`../retrospectives/m4-session-traversal.md`](../retrospectives/m4-session-traversal.md): closeout for the M4 slice that makes same-session movement a first-class browse behavior for both humans and agents.
- [`../retrospectives/m4-graph-migration-gating.md`](../retrospectives/m4-graph-migration-gating.md): closeout for the slice that makes migration explicit for graph-native commands while keeping raw capture migration-safe.
- [`../retrospectives/m4-v3-read-edge-substrate.md`](../retrospectives/m4-v3-read-edge-substrate.md): closeout for the narrower sub-slice that lands `v3` graph-native read edges without yet claiming the browse bootstrap performance win.
- [`../retrospectives/m4-graph-native-browse-read-refactor.md`](../retrospectives/m4-graph-native-browse-read-refactor.md): closeout for the slice that moves product reads onto `WarpApp -> worldline() -> observer(...)`, enables checkpoint-backed browse startup, and records the official `AFTER` benchmark.
- [`../retrospectives/m4-graph-native-browse-read-refactor.md`](../retrospectives/m4-graph-native-browse-read-refactor.md): historical closeout for the slice that first moved browse reads behind a runtime adapter and recorded the official `AFTER` benchmark.
- [`../retrospectives/m4-graph-migration-progress-ux.md`](../retrospectives/m4-graph-migration-progress-ux.md): closeout for the slice that makes the human interactive upgrade moment visibly in progress while keeping agent and capture behavior unchanged.
- [`../retrospectives/m4-remember-enhancements.md`](../retrospectives/m4-remember-enhancements.md): closeout for the slice that adds bounded and brief remember recall without changing the underlying ranking model.
- [`../retrospectives/m4-prompt-telemetry-read-surface.md`](../retrospectives/m4-prompt-telemetry-read-surface.md): closeout for the slice that turns recorded prompt telemetry into a factual CLI / JSON read surface without drifting into dashboards.
Expand Down
7 changes: 3 additions & 4 deletions docs/method/backlog/bad-code/CORE_boundary-codec-cutover.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ payload encoding directly in domain-adjacent modules.

Examples include `Buffer.from()` in `src/store/content.js`,
`parseJsonArray()` in `src/store/model.js`, JSON-string graph
properties in derivation flows, and content byte decoding in checkpoint
properties in derivation flows, and content byte decoding in runtime
read models.

## Acceptance Criteria

- Introduce named codec ports for text content, graph property payloads,
and checkpoint content reads.
and runtime content reads.
- Keep `Buffer`, `TextEncoder`, `TextDecoder`, JSON parsing, and future
CBOR work in adapters or codec modules only.
- Core store workflows receive validated domain objects, not raw decoded
transport shapes.
- Existing content and checkpoint-read tests pass through the new codec
ports.
- Existing content and runtime-read tests pass through the new codec ports.
21 changes: 9 additions & 12 deletions docs/method/backlog/bad-code/CORE_git-warp-dependency-truth.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ blocked_by:
- CORE_repair-v17-git-warp-minds
---

# git-warp dependency truth is split between package metadata and local v17 links
# git-warp dependency truth must stay anchored to package metadata

Think currently declares `@git-stunts/git-warp` as `15.0.0`, while local
development can resolve to a linked `17.0.0` checkout. That makes
`npm ls @git-stunts/git-warp` fail with `ELSPROBLEMS` and leaves runtime
compatibility depending on local workspace state rather than package truth.

The checkpoint read path now includes a public-reader compatibility bridge for
`createStateReader` vs `createStateReaderV5`. That bridge is acceptable as a
short-term guard, but it should not become permanent dependency sludge.
Think runtime compatibility must be proven against the published
`@git-stunts/git-warp` package declared in `package.json`, not against a linked
local checkout or private package internals. The current product runtime targets
the public worldline API in `@git-stunts/git-warp@18.2.1`; legacy checkpoint
repair remains quarantined in the v17 repair lane.

## Acceptance Criteria

- `npm ls @git-stunts/git-warp` exits cleanly in a normal checkout.
- `package.json` and `package-lock.json` match the intended git-warp version.
- The intended version is published or resolved through an explicit,
documented local/workspace dependency path.
- Checkpoint read tests pass from a clean install, not only from a local
- Product read/write tests pass from a clean install, not only from a local
linked git-warp checkout.
- The archived v17 repair acceptance fixture runs its full repair assertion in
clean CI instead of skipping when the v17 migration package is unavailable.
- The state-reader compatibility bridge is either documented as intentional
version support or removed after the dependency cutover.
- No production module imports private `node_modules/@git-stunts/git-warp/src`
paths or git-warp cache/checkpoint compatibility helpers.
10 changes: 10 additions & 0 deletions docs/method/backlog/bad-code/CORE_hexagonal-store-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on injected ports and runtime domain objects, not on concrete host APIs.

## Acceptance Criteria

- Add a lint ratchet that counts direct substrate-layout and `git-warp`
runtime leakage outside explicit adapter, diagnostic, repair, or
benchmark boundaries.
- Define explicit ports for graph persistence, content storage, clocks,
random IDs, host metadata, prompt metrics storage, and ambient project
context.
Expand All @@ -28,3 +31,10 @@ on injected ports and runtime domain objects, not on concrete host APIs.
`@git-stunts/*` concrete adapters directly.
- Add at least one browser-like unit test that runs core store logic
without Node filesystem, process, or Git globals.

## Progress

- [x] Hexagonal Boundary ratchet added to `npm run lint`.
- [x] Product runtime paths stopped inspecting, deleting, or reading through
`git-warp` checkpoint/state-cache refs.
- [ ] Existing substrate leaks moved behind product ports or adapters.
21 changes: 18 additions & 3 deletions docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ read-heavy paths such as `recent`, `stats`, and `doctor`. The Claude mind at
`~/.think/claude` was observed with roughly 43k loose Git objects and read
commands taking 14-21 seconds even after the raw capture path itself was fast.

Default recall also regressed when `remember` asked broad `entry:*` and
`keyword:*` questions, then sorted and sliced after the runtime had already
answered the broad query.

## Why It Matters

Capture can return after local raw save, but agents still need reliable re-entry
Expand All @@ -15,10 +19,21 @@ unavailable even when the underlying mind is intact.

## Acceptance Criteria

- [x] Route default `remember`, `recent`, and browse bootstrap through bounded
Think read-model facts instead of broad capture wildcard scans.
- [x] Add port-level ratchets proving default ambient and explicit remember do
not call `read.view.query()`.
- [x] Store self-contained fast capture records so default `remember` can score
ambient project matches without hydrating capture nodes.
- [ ] Add a deterministic large-mind fixture or synthetic benchmark for MCP read
timeout budgets.
- [ ] Add an explicit read-model backfill/repair command for existing minds so
old captures can enter the bounded indexes without default recall scanning
from genesis.
- [ ] Establish target budgets for `recent`, `stats`, `doctor`, and `remember`
against repaired checkpoint-backed minds.
against large repaired minds. Current `codex-think --remember --json`
smoke exits under a 20s timeout on `~/.think/codex`, but still spends
roughly 13-14s in one git-warp optic property read.
- [ ] Document and automate safe maintenance for high-loose-object minds.
- [ ] Prefer checkpoint-backed bounded reads where whole-graph observer startup is
not required.
- [ ] Prefer public worldline/optic bounded reads where broad transitional
queries are not required.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Document window-based read model

Add a "Window-Based Navigation" section to ADVANCED_GUIDE.md
explaining how git-warp read handles prevent whole-graph
materialization, how the browse TUI loads neighbors lazily, and
how checkpoint-backed reuse keeps navigation fast.
Add a "Window-Based Navigation" section to GUIDE.md or the design docs
explaining how public git-warp worldline/optic reads prevent unnecessary
whole-graph materialization, how the browse TUI loads neighbors lazily, and
where broad transitional queries still need caveats.

Source: documentation-quality audit 2026-04-11 §2.3.
Loading