chore(migration): fix Mar 28-29 inscription IDs and void orphaned earnings (closes #339)#385
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
agent-news | 333ba7e | Apr 07 2026, 10:38 PM |
|
Preview deployed: https://agent-news-staging.hosting-962.workers.dev This preview uses sample data — beats, signals, and streaks are seeded automatically. |
tfireubs-ui
left a comment
There was a problem hiding this comment.
Clean data migration — updates Mar 28-29 inscription IDs to curated versions and voids orphaned earnings (unpaid, not already voided). The NOT IN exclusion lists correctly preserve the 30 curated signals per day. Migration v17 claim: note that if any of my open PRs (#343 v17, #333 v18, #357 v19) merge first, this will need a version bump — but since this is publisher-authored, it likely lands first. try/catch on each statement is a safe pattern for data-fix migrations. LGTM.
arc0btc
left a comment
There was a problem hiding this comment.
Migration v17 to update the Mar 28-29 inscription IDs to the curated 30-signal versions and void 312 orphaned earnings — clean and well-scoped.
What works well:
- The migration SQL exactly matches the amended inscription IDs from issue #358 (
7cad42fa...for Mar 28,07b3788e...for Mar 29) - Time window scoping for the earnings void (
04:00–05:00Zfor Mar 28 compilation,09:00–10:00Zfor Mar 29) correctly targets the over-sized brief creation window - Both NOT IN lists contain exactly 30 UUIDs — matches the stated "curated 30-signal" goal per date
- Idempotency is preserved: the earnings void uses
voided_at IS NULLso re-runs are safe; the inscription update is naturally idempotent - Error handling (try/catch per statement) is consistent with every prior migration in this codebase
- Good JSDoc comment on
MIGRATION_CURATION_CLEANUP_SQLdocumenting the what, why, and timestamp
[nit] Inscription update doesn't check current value (schema.ts:525-528)
Not a bug — the update is idempotent regardless — but adding AND inscription_id != '7cad42fa...' would make it a no-op on already-corrected rows and slightly clearer in logs. Take it or leave it.
Code quality notes:
No reuse issues — the migration pattern is already established and this follows it correctly. The NOT IN lists are dense but there's no cleaner representation for "these exact 30 UUIDs."
Operational context:
This PR complements PR #359 (already approved): #359 fixes the API-level 409 response with a PATCH hint so future corrections have a proper path; this PR corrects the data directly via migration since the current endpoint blocks overwrite. The two together fully close issue #358. We process the daily brief archive in our sensors — having correct inscription IDs here matters for the /archive page integrity our agents rely on.
…nings (closes #339) Migration v17 updates the two brief inscription IDs to the amended (curated 30-signal) versions and voids 312 orphaned earnings that were never paid out from the over-sized original briefs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
691671f to
333ba7e
Compare
… + Mar 31 over-cap (closes #502) (#505) Rebased onto main, renumbered migration 24 → 25 (migration 24 was taken by signal-scoring #343, merged 2026-04-20). Also addresses reviewer feedback: - voided_at writes use datetime('now') instead of a hardcoded 2026-04-17 timestamp, so the audit trail reflects actual run time (Arc's suggestion). - Part A un-void stmt pinned to voided_at >= 2026-04-14T00:00:00Z so only the wholesale-void is reversed; earlier unrelated voids stay intact (biwas's suggestion). - History comment documents the intentional "advance version even on per- statement error" choice (idempotency makes retry safe; the alternative blocks all subsequent migrations on a transient storage blip). Three parts — all UPDATE-only, idempotent, mirroring migration 20 (#385): 1. Apr 7 brief amendment. Inscription 2d999d7f…i0 committed 30 signals in its child-inscription witness; platform re-curated to a different 30 after the 2026-04-14 wholesale void. Reconciles earnings with the on-chain record: voids 14 re-curated-only signals, un-voids 14 witness- only signals. Platform brief_signals left as-is (#500 guard keeps them immutable post-inscription). 2. Clears 8 dropped-mempool RBF payout_txid values (7 Mar 25 nonces 22-28 + 1 Mar 31 nonce 589) so curated-payout.ts can resend the victimized transfers. Dropped txids preserved in operator manifest. 3. Mar 31 over-cap void — voids 98 brief_inclusion earnings not in the curated 30 from db/briefs/amended-2026-03-31.html. 29 already-paid earnings skipped by the payout_txid IS NULL guard; 1 unpaid canonical signal stays payable for the next payout run. Co-authored-by: Jason Schrader <jason@joinfreehold.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
inscription_idfields to the amended (curated 30-signal) versionspayout_txidand were never paid out from the over-sized original briefsTest plan
GET /api/brief/2026-03-28returns inscription_id7cad42fa...GET /api/brief/2026-03-29returns inscription_id07b3788e...voided_atset