Skip to content

feat: add pkg/index metadata-only bolt-backed page index - #383

Merged
bborbe merged 3 commits into
masterfrom
feat/pkg-index
Nov 17, 2026
Merged

bborbe merged 3 commits into
masterfrom
feat/pkg-index

Conversation

@bborbe

@bborbe bborbe commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Implements approved spec specs/in-progress/068-pkg-index-metadata-page-index.md (implemented directly with TDD; the dark-factory agent route is blocked by an idle-loop bug).

New exported pkg/index: page index keeping only path, mtime, fingerprint, frontmatter and parsed open questions in RAM; ListPages returns pages with empty Content (so ops.NewListOperation works unchanged); ReadPage reads from disk; optional bolt store, format v2 with no Content field (bucket/identity names match vault-ui's, so its old store is discarded on first start). No glog/prometheus in the package (slog + injected metrics).

Why: vault-ui heap profile shows 514 of 677 MB in-use is gob-decoded page bodies; vault-api and vault-ui migrate onto this package next.

Three commits: types/readers, in-memory index + docs, bolt store. 150/150 specs green; make precommit green.

Task: 6152d188-25e0-49f7-947e-88506dd2b37f

@bborbe

bborbe commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Local review (independent subagent, targeted read of reader.go/store.go/store_codec.go; locking skimmed): approve, no Must-Fix. go test -race ./pkg/index/... ok. Body bytes: Content blanked (reader.go:47-49), open-question text strings.Clone'd (reader.go:78), gob decode rebuilds page with empty body. Store: version + parser check in one Update txn, discard falls back to discardedStore, dir 0700. Should-Fix follow-ups: discard paths drop underlying err (store.go:132-154); bolt file mode not explicit (store.go:136); confirm write-through encode failure is a warning not a failed list; nil vlogf in NewBoltStore.

@bborbe
bborbe marked this pull request as ready for review November 17, 2026 17:21
@bborbe
bborbe merged commit 555c14d into master Nov 17, 2026
9 checks passed
@bborbe
bborbe deleted the feat/pkg-index branch November 17, 2026 18:20
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