Skip to content

Wave #94/#95/#96/#97: indexer scheduling decision + sync.yml fixes, multi-asset docs, refund-preflight tests, scratch gitignore - #252

Draft
bade2brazy wants to merge 4 commits into
accensa:mainfrom
bade2brazy:feat/wave-94-95-96-97
Draft

Wave #94/#95/#96/#97: indexer scheduling decision + sync.yml fixes, multi-asset docs, refund-preflight tests, scratch gitignore#252
bade2brazy wants to merge 4 commits into
accensa:mainfrom
bade2brazy:feat/wave-94-95-96-97

Conversation

@bade2brazy

@bade2brazy bade2brazy commented Aug 26, 2026

Copy link
Copy Markdown

Draft. Authored without a local checkout — not yet run through pnpm lint / pnpm tsc --noEmit / pnpm test / pnpm build. Please treat the code as a proposal to verify, not verified work. Scope notes per issue below.

Four Stellar Wave issues, one branch.

#97 — remove body.txt / issues.json from the root ✅ mostly already done

Both files are already gone from the tree and db-setup.md is already folded into DEPLOYMENT.md (an earlier PR). This adds the missing recurrence guard: .gitignore entries for body.txt, issues.json and a .scratch/ directory, plus a CONTRIBUTING.md section pointing tooling residue there.

#94 — replace the sleep-looping Actions runner

DEPLOYMENT.md gains "Indexer scheduling — the options weighed": paid Vercel Cron (~$20/user/mo) vs an external scheduler (cron-job.org / EventBridge, $0) vs a long-running worker ($5/mo, re-opens the extraction that caused the original outage) vs keeping the loop. Decision: keep the loop with its defects fixed now; migrate to an external scheduler when the team wants the ~660 runner-min/day gone — that step needs an account + secret a maintainer must create, so it isn't in this PR.

sync.yml defects fixed:

  • concurrency.cancel-in-progress: true → false — an overlapping trigger no longer kills an in-flight sync.
  • loop window 55m → 65m so it overlaps the next hourly trigger (safe now that self-cancel is gone; costs one extra idempotent sync).
  • optional HEARTBEAT_URL pinged after every healthy sync and at clean exit → external dead-man's switch for scheduling cessation, the failure mode that cost 207 ledgers.

Every existing in-loop diagnostic (401 assertion, syncedTo check, drained / skippedLedgers warnings) is untouched. Deliberately breaking each to confirm the checks still fire, and wiring alerting on the warnings, are not done here (need the deployed environment).

#95 — prove the USDC / multi-asset path

DEPLOYMENT.md + README.md document ASSET_CONTRACT_IDS with a USDC example, the per-asset grouping rule (never sum across assets), the single-token RefundVault constraint + the deploy-a-vault-per-asset workaround, and the missing-trustline case that must read differently from "no payments".

Not done here (needs testnet/chain access): the real testnet USDC payment + tx hash, the captured USDC event fixtures in sac-transfer-events.json, the aggregation-code changes in revenue-analytics.ts, and trustline detection in the dashboard.

#96 — API route tests

Route tests for routes / verify(auth) / challenge / hook/settle / payments already landed (PR #234). This adds apps/web/src/app/api/refund/preflight/route.test.ts (validation paths + happy path + the float-to-i128 amount guard).

Not done here (needs the CI Postgres service + a local run): /api/sync scenarios (cold start, cursor resume, skippedLedgers, cursor-advances-across-empty-windows, cooldown/429, config errors), /api/verify disagreement flag, and reintroducing the filed route bugs to confirm the tests catch them.

Related Issues

Closes #97

Closes #94, Closes #95, Closes #96 — see the "not done here" notes above; each needs deploy/CI/chain access a checkout-less contribution can't reach.

…vention (accensa#97)

body.txt and issues.json were tracked at the repo root once. Ignore them and
any future PR-body / issue-dump / one-off-script residue under a .scratch/
directory, documented in CONTRIBUTING.md. (Both files are already removed
from the tree; this closes the recurrence path.)
…lind spot (accensa#94)

- concurrency.cancel-in-progress: true -> false, so an overlapping trigger
  no longer kills a sync mid-range (indexing is idempotent; the run was
  simply lost).
- loop window 55m -> 65m so it overlaps the next hourly trigger; with
  self-cancel gone the overlap costs one extra idempotent sync instead of
  leaving a gap when a trigger is dropped under load.
- optional HEARTBEAT_URL pinged after every healthy sync and at clean exit,
  for an external dead-man's switch. If scheduling stops entirely the pings
  stop and the monitor alerts - the signal that did not exist when the
  cursor fell 207 ledgers behind retention.

Every existing in-loop diagnostic (401 assertion, syncedTo check, drained /
skippedLedgers warnings) is unchanged.
…i-asset constraints (accensa#94, accensa#95)

- 'Indexer scheduling - the options weighed': paid Vercel Cron vs an
  external scheduler vs a long-running worker vs keeping the loop, compared
  on cost / reliability / failure modes. Decision: keep the loop with the
  defects fixed now (this PR), migrate to an external scheduler
  (cron-job.org / EventBridge, ~$0) when the team wants the runner cost
  gone - that step needs an account + secret a maintainer must create.
- 'Settling in USDC or multiple assets': ASSET_CONTRACT_IDS, per-asset
  grouping (never sum across assets), the single-token RefundVault
  constraint and the deploy-a-vault-per-asset workaround, and the
  missing-trustline case that must read differently from 'no payments'.
… vault (accensa#95)

Add a USDC example to the .env.local block and a 'Settling in USDC or
multiple assets' subsection pointing at the fuller DEPLOYMENT.md notes.
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@bade2brazy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@bade2brazy is attempting to deploy a commit to the ACCENSA Team on Vercel.

A member of the Team first needs to authorize it.

@mergekeeper

mergekeeper Bot commented Aug 26, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #97.
Verdict: clean

The changes correctly address issues 94 and 97 while documenting multi-asset configurations (issue 95) and adding route preflight tests (issue 96), fully matching the linked issues and instructions.

Reviewed commit: 6df69b3d0c467826555ad921e0f0d46eed849b44.
CI and merge eligibility are checked separately.

@mergekeeper

mergekeeper Bot commented Aug 26, 2026

Copy link
Copy Markdown

MergeKeeper review unavailable

AI provider review response did not contain valid JSON

No approval or merge action was taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant