feat(dashboard): reconcile local state against core snapshot after webhook gaps - #276
Merged
Lakes41 merged 2 commits intoJul 24, 2026
Merged
Conversation
added 2 commits
July 24, 2026 00:40
…bhook gaps Adds the recovery path for missed webhook events (Adamantine-guild#262): a manual reconciliation pass that pulls a point-in-time guild snapshot from GuildPass core, diffs it against local state, and applies corrections tagged source: "reconciliation" in the activity feed. - integration-client: getGuildSnapshot() (GET /v1/guilds/:id/snapshot, 404 -> null so unsupported cores degrade gracefully) + GuildSnapshot types + "reconciliation" activity source - dashboard: lib/reconciliation/core-sync.ts (wallet-keyed member diff, id/name pass diff, conservative local-only pass handling, dry-run and apply modes, deterministic event ids through the webhook idempotent write path) - POST /api/integrations/reconcile (settings:write) + Integrations page trigger panel with report rendering - activity feed: reconciliation source filter + badge - docs/core-reconciliation.md: the snapshot contract core needs to implement, matching rules, idempotency guarantees - tests: no-drift no-op, partial drift (dry-run purity, apply, re-run idempotency), full resync, wallet-less members, unsupported cores; integration-client snapshot client tests
This was referenced Jul 24, 2026
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.
Closes #262.
Webhooks being best-effort means a deploy or an idempotency-store outage can permanently drop events and local state drifts with no recovery path. This adds the reconciliation pass the issue asks for: pull core's authoritative state, diff, apply only the deltas, tag everything so admins can tell corrected data from live webhooks.
The core contract (the coordination the issue asked me to call out): the dashboard needs one new core endpoint,
GET /v1/guilds/:guildId/snapshot, returning the complete member list, core-managed passes, and guild metadata at a point in time.guildpass-coreis a separate repo and doesn't have it yet, soIntegrationClient.getGuildSnapshot()maps 404 tonulland the job reportssupported: falseinstead of failing. The dashboard side is complete and tested against stubbed snapshots; it lights up the moment core ships the endpoint. Full contract is indocs/core-reconciliation.md. I went with a state snapshot over an event-log range because it can't replay history incorrectly and stays useful even if core adds an event log later.Design notes:
source: "reconciliation"through the webhook idempotent write path, with deterministic event ids. No drift means zero writes and zero activity entries; a second apply run is a no-op.POST /api/integrations/reconcile(settings:write) or the new panel on the Integrations page. An interval trigger is a cron line away once core's endpoint exists.lib/reconciliation/so eslint passes on the touched directory.Acceptance criteria: manual trigger with diff report (dry-run) ✓, reconciliation changes visually distinct in
/activity✓, no duplicate activity for unchanged state ✓, core dependency documented + stubbed partial implementation ✓, tests for no-drift / partial drift / full resync against a stubbed core ✓.Verified:
tsx --testover the full dashboard suite, 559/559 pass (7 new).integration-client14/14 (4 new). eslint clean on all touched files. tsc shows only the pre-existing TS6baseUrlconfig deprecation.Stacked on #273 — main still has unresolved conflict markers in 7 files, so this won't build from main until the repair lands.