GeezerVison is showing github.com — console edge: direct cache index as one line per place (#14961) by developing-today-fleet[bot] · Pull Request #14977 · developing-today/code
Conversation
Follow-on fix from the #14865 write-amplification sweep. Refs #14961.
Before: the direct GitHub cache in pm-stack/console/edge/src/direct.ts kept its whole index under the single key gh:index (up to 240 entries) and rewrote it in full on every cache set, every delete, and every cache-hit read older than TOUCH_MS (6h) — a read path rewriting the entire index to refresh one at timestamp.
After: per-entry index lines under gh:index:<place> (each record carries its address) plus a lightweight membership list gh:index:ids (place numbers only, rewritten only when the set of places changes). Set/delete/touch each write O(1) index values — the affected line, plus the list only on a place change. Nothing was fixed by slowing write rates; the write shape changed.
Migration: a store still holding the one-value gh:index is read from it once; lines are written out per place (lines first, list after, the old value deleted last, so a store stopped mid-migration is re-read consistently and the next object retries). Once the list exists, the old value is ignored and deleted. Existing cached bodies remain reachable throughout — the migration test reads answers back before and after.
Eviction (oldest-first, room/most bounds, never the just-kept) is unchanged, as are the stopped-write guarantees: pieces first, line last, a half-kept answer reads as nothing kept.
Tests: layout-coupled assertions in pm-stack/console/test/direct.test.ts now read the index through a storedIndex helper (membership + lines, as a starting object sees them); two new tests pin (a) the exact per-change write volume by key via a counting store — set writes pieces+line+list, overwrite writes pieces+line, delete writes list + the line/piece deletes, a stale-read touch writes exactly its one line — and (b) the legacy migration. Verification running remotely (fleet-command run 45584222361: direct.test.ts, then the full console suite); results will be posted on #14961.
Head: 40bf508. Left unmerged for Felix's review.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-25T09:19:27Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": "/home/hatch",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/hatch",
"repo": "developing-today/code",
"branch": "main",
"sha": "c11f41086f57d626be7eb582763b721f8f557408"
},
"auth_subject": "felix",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The direct cache's index was one store value (gh:index) rewritten in
full on every set and delete, and on every stale read just to refresh
one entry's at timestamp (#14961, follow-on of the #14865 sweep).
The index is now one small record per place (gh:index:<place>,
carrying its address) under a lightweight membership list
(gh:index:ids, place numbers only). Set/delete/touch each write O(1)
index values: the affected line, plus the list only when the set of
places changes. Eviction (oldest-first, room/most bounds) is
unchanged. A store still holding the one-value index is read from it
once, its lines written out in the new shape (lines first, list
after, the old value let go last, so a stopped migration is retried
by the next object), and cached bodies stay reachable throughout.
Tests: the layout-coupled assertions in direct.test.ts read the
index back through a storedIndex helper (membership + lines, as a
starting object sees them); new tests pin the per-change write
volume by key and the legacy migration.
Refs #14961
Important
Review skipped
Bot user detected.
To trigger a single review, invoke the @coderabbitai review command.
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0573f256-72e3-4a8d-b1cf-b71668a5e300
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Verification (remote, fleet-command workflow): direct.test.ts 53 pass / 0 fail (run 45584222361); full console suite 675 pass / 1 fail across 676 tests / 27 files (run 45585790879) — the one failure (the platform's Workers are read at the edge from the repository's own list…, edge.test.ts) is pre-existing on unmodified main (baseline run 45587191374: 179 pass / 1 fail, same test; workers.json drift in #14941/PR #14971 territory). Full evidence on #14961, comment 7158685077. Ready for review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|