Skip to content

fix: invalidate overlapping database build records - #29

Closed
peter-jerry-ye wants to merge 1 commit into
codex/bounded-db-compaction-v2from
codex/mechanical-db-compaction
Closed

fix: invalidate overlapping database build records#29
peter-jerry-ye wants to merge 1 commit into
codex/bounded-db-compaction-v2from
codex/mechanical-db-compaction

Conversation

@peter-jerry-ye

@peter-jerry-ye peter-jerry-ye commented Aug 17, 2026

Copy link
Copy Markdown

Why

An append-only database shared by partial graphs cannot use the currently loaded graph to decide which persisted records are obsolete. It needs a graph-independent definition of the latest build state before compaction can safely exist.

What changed

  • Track the latest owner of each dense output path ID while replaying the complete database log.
  • Treat a later build record sharing any output as invalidating the earlier record as a whole.
  • Load a record into the current graph only when its complete ordered output list matches a current build.
  • Defer committing discovered dependencies and hashes until replay has identified the records that remain live.

Why this is minimal

This PR is stacked on #28 and changes replay semantics only. It does not rewrite the database, add automatic compaction, change corruption handling, or introduce new dependencies. Mechanical compaction is left to #30.

@peter-jerry-ye
peter-jerry-ye force-pushed the codex/mechanical-db-compaction branch from 9198a0f to 4a13570 Compare August 17, 2026 04:22
@peter-jerry-ye
peter-jerry-ye force-pushed the codex/bounded-db-compaction-v2 branch from 966366f to 427b777 Compare August 17, 2026 04:22
@peter-jerry-ye peter-jerry-ye changed the title feat: compact shared build databases safely fix: invalidate overlapping database build records Aug 17, 2026
@peter-jerry-ye
peter-jerry-ye deleted the codex/mechanical-db-compaction branch August 18, 2026 02:47
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