Skip to content

refactor: serve live data or an honest error — remove demo-era fixture tiers - #21

Merged
cl-fi merged 3 commits into
mainfrom
chore/remove-demo-fixtures
Jul 27, 2026
Merged

refactor: serve live data or an honest error — remove demo-era fixture tiers#21
cl-fi merged 3 commits into
mainfrom
chore/remove-demo-fixtures

Conversation

@cl-fi

@cl-fi cl-fi commented Jul 27, 2026

Copy link
Copy Markdown
Owner

The competition live demo is over and the product now runs for real users, so
the demo-era stand-in data layers are removed. When data cannot be served the
app now returns an error and the UI shows its error/empty state — users are
never shown market data that is not live.

Recorded as ADR-0011.

What is removed

Demo Mode (NEXT_PUBLIC_ANKER_DEMO_MODE) — fixture market data, the
disabled-transaction kill-switch across all four transaction builders, the
disabled-CTA branches in the portfolio and subscribe flows, the top banner,
and the associated copy in both locales.

The Snapshot tier — the committed 2026-07-12 photograph of 4-16 Legacy
Oracle states that backed day browse when live markets were unreachable
(daySnapshot.*, legacyOracles.*, SnapshotBanner, the frozen-clock
pipeline, scripts/capture-day-snapshot.mjs, and source provenance
threaded through the curated-oracle API shape). ADR-0004 already called this
"a demo-era stopgap, hand-picked for presentation, not a long-term backstop,"
and the 4-16 oracles it captured expire for good at the end of July 2026.

SnapshotQuoteProvider — invented heuristic pricing when a market had no
SVI surface. Quote building now throws instead.

The Current USDsui APR endpoint (/api/current/usdsui-apr plus its server
builder and Current.finance client) — no in-app consumers: the client helper
was exported but never called, no cron or E2E test hit the route, and no doc
referenced it. Its failure path also returned a fabricated 8% APR body, which
is exactly what ADR-0011 forbids.

Behaviour changes

  • Day-market discovery failure propagates to the route's 502 instead of
    falling through to the photograph; the day group is absent rather than
    backfilled, and the client retries on its normal 15s cycle.
  • A market with no SVI surface shows an error state instead of
    non-executable "snapshot pricing".
  • The Benchmark Recorder only records live inputs.

What is deliberately kept

  • Deterministic Playwright fixtures, now gated solely on
    isDeterministicE2E() — never reachable in production, and the one
    sanctioned use of invented data.
  • 'snapshot' in the Postgres CHECK constraint and BenchmarkSampleSource,
    because historical Benchmark Sample rows recorded while the tier existed
    still carry that value.
  • The unit-test market fixture, moved to src/test/marketSnapshotFixture.ts
    so its scope is unambiguous.

Not touched

README.md is intentionally unchanged — judging is ongoing. Docs will be
synced after feature work lands, not during this cleanup.

Verification

Local: typecheck, lint:guardrails, 421 unit tests, next build, and
Playwright (35 passed / 15 skipped) all green. CI re-runs the full matrix
including the Move contract tests.

One deployment note: if NEXT_PUBLIC_ANKER_DEMO_MODE is still set in the
Vercel project, it is now an inert variable and can be deleted.

🤖 Generated with Claude Code

cl-fi and others added 3 commits July 23, 2026 17:31
- Removed obsolete design-sync files including build scripts, configuration, and documentation to streamline the project.
- Updated .gitignore to exclude transient build artifacts and unnecessary directories.
- Cleaned up package.json and package-lock.json by removing deprecated Storybook dependencies.
- Added a new skill entry in skills-lock.json for batch-grill-me to enhance project capabilities.
…e tiers

The competition live demo is over; the app now runs for real users. Remove
both stand-in data layers so unavailable data surfaces as an error state
instead of canned market data (ADR-0011):

- Demo Mode (NEXT_PUBLIC_ANKER_DEMO_MODE): fixture data routes, disabled
  transaction builders, demo banner, and all related copy/CSS
- Snapshot tier (ADR-0004): the committed 2026-07-12 day photograph,
  legacyOracles parsers, SnapshotBanner, TenorSource row provenance,
  frozen-clock plumbing, and the capture script
- SnapshotQuoteProvider: quoting without an SVI surface now throws
  instead of inventing non-executable prices
- Benchmark recorder records live inputs only; historical 'snapshot'
  sample rows remain valid in the schema

Deterministic Playwright fixtures stay, now gated solely by
isDeterministicE2E(); the unit-test market fixture moves to src/test/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…fallback

/api/current/usdsui-apr had no in-app consumers — fetchCurrentUsdsuiApr was
exported but never called by any component or hook, no E2E test or cron hits
the route, and no doc references it. Its failure path also returned a
fabricated FALLBACK_CURRENT_APR = 0.08 body, contradicting ADR-0011
(live data or an honest error). The whole module goes: route, server
response builder, Current.finance client, and their tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
anker-protocol Ready Ready Preview, Comment Jul 27, 2026 12:37pm

Request Review

@cl-fi
cl-fi merged commit 9d5361b into main Jul 27, 2026
3 checks passed
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.

1 participant