Skip to content

feat(core): wire journal backfill and audit cleanup as system changes - #985

Open
davidfrigolet wants to merge 5 commits into
feat/journal-backfillfrom
feat/wire-audit-system-changes
Open

davidfrigolet wants to merge 5 commits into
feat/journal-backfillfrom
feat/wire-audit-system-changes

Conversation

@davidfrigolet

@davidfrigolet davidfrigolet commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Contributes JournalBackfillChange and AuditCleanupChange unconditionally from core's annotation processor (CoreSystemChangeProvider), ordered after the Mongock importer (00100 < 00200 < 00300), resolved against the reserved audit-store target-system alias.
  • Adds CoreSystemChangeFilter to exclude both changes from the runtime pipeline while JOURNAL_EVENTS is disabled — gating has to happen at runtime, in the same process the flag actually lives in, since registration happens at compile time inside javac.
  • Fixes a FlamingockMetadataMerger prune bug that wrongly dropped both system changes in any module whose own compile classpath lacks flamingock-core (e.g. a module that only declares changes while another assembles the runner).
  • Fixes the non-blocking review comment on this branch's own JournalBackfillChange (the initial history read bypassing the per-stage persistence cache).
  • Merges in fix(core): share journal sequencers per stream #986 (shared journal sequencer per stream) and fix(mongock): import historical entries through audit appender #981 (Mongock importer uses the legacy append path, no journal event) — both needed together to close the journal-sequencer collision below.

Depends on

Based on feat/journal-backfill (#982), with #986 and #981 merged in on top.

bercianor and others added 3 commits October 14, 2026 22:59
Contributes the journal-backfill and audit-cleanup system changes
unconditionally from core's annotation processor (CoreSystemChangeProvider),
ordered after the Mongock importer (00100 < 00200 < 00300), resolved against
the reserved audit-store target-system alias.

- CoreSystemChangeProvider (flamingock-processor): builds both CodePreviewChange
  entries via fully-qualified string names rather than class literals, keeping
  flamingock-processor free of a compile dependency on flamingock-core - that
  dependency would otherwise leak onto every consuming project's
  annotation-processor classpath.
- CoreSystemChangeFilter (flamingock-core): excludes both changes from the
  runtime pipeline while JOURNAL_EVENTS is disabled. Registration happens at
  compile time, in a different process from where the runtime feature flag
  lives, so gating has to happen here instead - and exclusion (not letting the
  change run and throw) matters because the flag is off by default, and every
  application reaching that throw would turn an internal, not-yet-released
  flag into a hard startup failure.
- FlamingockMetadataMerger: fixes a prune bug that wrongly dropped both system
  changes in any module whose own compile classpath lacks flamingock-core
  (common in multi-module projects where one module declares changes and
  another assembles the runner) - their source class was never resolvable
  from that module, so the deletion-prune step treated them as deleted on
  every round.
- JournalBackfillChange: routes its initial history read through the same
  per-stage persistence cache used for every other lookup, fixing the
  inefficiency flagged on PR #982's review (a second, independently-seeded
  persistence instance for the same stage).

Known follow-up, intentionally not included here: a journal-sequencer
collision when Mongock history import and JOURNAL_EVENTS are both exercised
in the same run (DynamoDBImporterJournalTest). Root-caused but unresolved -
needs a design decision between re-reading the sequence on every write,
sharing one sequencer instance per stream per stage run, or having backfill
check for an existing journal event before copying.
@davidfrigolet
davidfrigolet marked this pull request as draft October 26, 2026 19:10
bercianor and others added 2 commits October 27, 2026 18:31
@davidfrigolet
davidfrigolet marked this pull request as ready for review October 28, 2026 09: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.

2 participants