Repository navigation
aa feed: keep last good on failure + skip unchanged query; v_latest_import_batch rename - #3349
Merged
Merged
Conversation
…atest_import_batch (code#3332) A single transient Supabase Management API 403 blanked the AA explorer: the collector rebuilt the section from scratch every tick and emitted absent on any failure. It now keeps the last good section beside the feed (aa-last-good.json): a failed build degrades to that payload with a stale marker (the page shows a banner naming the failure and the good data's collection time), and absent is emitted only when no good build exists yet. A cheap batch probe runs first: while the ainventory import batch and the opencode config fingerprint are unchanged, the stored section is reused and the full payload query never runs — the every-5-minutes query pressure was itself causing intermittent 403s. Terminology (Drew, 2026-11-01): the ainventory view is renamed v_latest_workbook_batch -> v_latest_import_batch (new view created additively in Supabase; the old view remains until other consumers are audited), and workbook wording across the aggregator now says import where the database-resident data is meant. The sources.kind provenance value (drive-workbook) is data, not terminology, and is untouched. The explorer provenance card also drops its hardcoded v4.3.2 claim.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
dezren39
added a commit
that referenced
this pull request
Nov 1, 2026
The phantom writer blanking /aa is identified: the sandbox host still runs fleet-feed-collector.timer (systemd, system level), installed from the stale ~/git/pm-feed clone (HEAD 2026-10-29, pre-#3349) and restored on every sandbox boot by ~/tools/init.sh. Its collector defaults SUPABASE_PROJECT_REF to the retired muse-dev project (nltgxorqwxhgfzseiirt) while the bws management token (supabase.access-token-muse-cli) is muse-dev2-scoped, so its AA query fails HTTP 403 (verified directly: same token + retired ref = 403 "does not have the necessary privileges"; same token + muse-dev2 ref keihfchslgjetkmnmzra = 201 with the current ainventory batch). Every ~5 min it scp-pushed its AA-absent, session-poor feed over the laptop collector's good feed (~/pm-stack/aggregator symlinks into the aggregator state dir), racing the laptop collector that has owned the feed since the 2026-10-31 move (#3363/#3368). The collector lives on the laptop now (pm-stack NixOS module), so the sandbox-side units are deleted, not updated: remove systemd/fleet-feed-collector.{service,timer} and scripts/install-collector-units.sh, mark push-fleet-feed.sh manual-only, and correct the stale "sandbox collector / pushed feed" descriptions in README, src/feed.ts, src/topology.ts and src/watchdog.ts. The charges confirm-after-delivery contract stays: push-fleet-feed.sh + confirm-charges-surfaced.ts are untouched. Tests: bun test in pm-stack/aggregator — 870 pass, 2 fail, identical on pristine origin/main (pre-existing slice-3 routes failure).
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.
Implements code#3332 plus Drew's terminology ruling (2026-11-01), built directly tonight after the 403 wipe recurred three times in one evening.
Keep last good (code#3332): the collector stores the last good AA section beside the feed (aa-last-good.json, keyed by import batch + opencode-config fingerprint). Any build failure — Management API 403, unreachable, empty payload, structural check — now degrades to that payload with stale/staleReason markers instead of blanking the section; the explorer shows a banner naming the failure and the good data's collection time. Absent is emitted only when no good build exists yet (the absent banner text updated to say so).
Skip unchanged: a cheap batch probe (one small query) runs first; while the import batch and config fingerprint are unchanged, the stored section is reused and the full payload query never runs. The every-5-minutes giant-query pressure was itself causing intermittent 403s — this removes nearly all of it.
Terminology: AA_SQL + probe now read ainventory.v_latest_import_batch (created additively in Supabase muse-dev2 and verified to return the identical batch; the old v_latest_workbook_batch view stays until its other consumers — e.g. the ainventory append tooling — are audited and moved). Workbook wording across the aggregator now says 'import' where database-resident data is meant; the sources.kind provenance value 'drive-workbook' is data and is deliberately untouched. The provenance card drops its stale hardcoded 'v4.3.2' claim.
Verification: tsc — no errors in any touched file (8 pre-existing errors elsewhere, same family as the 7 pre-existing manifest test failures). bun test: 747 pass / 7 fail, identical to the clean-main baseline verified by stash earlier tonight. Forced-failure + reuse behavior will be verified live post-deploy against a bogus project ref before the issue closes.
Need help on this PR? Tag
@codesmith-botwith what you need.