Conversation
When immutable inspection is skipped — a stranded graph.db-wal, an unreadable sidecar, a containment failure or a failed invariant audit — mex graph status printed the placeholder values in the same shape as measurements: "Last successful index: never", "Sources: 0 changed" and "Parse health: 0 ok", all false for an intact store. Add an additive inspected flag to GraphStatus, set false on every early return that fills parseHealth with an empty placeholder, and render those three lines as "not inspected" in the text output. parseHealth and changes keep their shape so no consumer changes. Fixes mex-memory#204
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Fixes #204.
When
inspectGraphStatusskips immutable inspection — a strandedgraph.db-wal, an unreadable sidecar, a containment failure, a failed quick-check or invariant audit — it still filledlastSuccessfulIndexAt,parseHealthandchangeswith placeholders, andprintStatusrendered them in the same shape as measurements:Last successful index: never,Sources: 0 changed,Parse health: 0 ok. All three are false for an intact store.Why
Per the issue, the JSON contract keeps
parseHealthandchangesnon-nullable (~160 references, invariant checks inread-session.ts), so this is the additive-flag option:GraphStatus.inspected?: boolean— optional, additive.graphStatus()defaults it totrue; every early return that fillsparseHealthwith the empty placeholder passesfalse(15 sites). TheGRAPH_INDEX_MISSINGpath staystrue: there is no store, andSources: N addedis a real live-tree measurement there.printStatusprintsLast successful index: not inspected/Sources: not inspected/Parse health: not inspectedwheninspected === false; the diagnostic line andNext:remediation are unchanged.--jsongains"inspected": falseon those paths;parseHealthandchangeskeep their shape.Text output on the stranded-WAL repro now reads:
Tests
src/graph/__tests__/status.test.ts:inspectedisfalseon the corrupt and active-WAL paths, andtrue(with a realparseHealth.total) once the WAL is checkpointed.src/graph/__tests__/cli-graph.test.ts: builds a store, strands agraph.db-wal, runsrunGraphStatusand asserts the threenot inspectedlines, the sidecar warning, no0 ok/never, andinspected: falseunder--json.Both new tests fail on
main(expected undefined to be false,expected […] to include 'Last successful index: not inspected') and pass with the change.Ran locally:
A full
npx vitest runon my box hit the 15 s per-test timeout on unrelated Relay/hub tests under load, so I relied on the targeted runs above plus CI.Changelog entry added under
[0.8.2] → Fixed.