Skip to content

Refresh the market seed to each region's settled close, with per-row as-of - #8

Merged
DCLXAI merged 2 commits into
mainfrom
chore/seed-refresh-2026-08-07
Aug 7, 2026
Merged

Refresh the market seed to each region's settled close, with per-row as-of#8
DCLXAI merged 2 commits into
mainfrom
chore/seed-refresh-2026-08-07

Conversation

@DCLXAI

@DCLXAI DCLXAI commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Refreshes the market seed to the most recent settled close per region, and adds the per-row as-of that makes a partial refresh honest.

The two dates differ, and that is the finding

The request was "update everything to today," 2026-08-07. Research established that Friday's US session had not closed: every directly-fetched source timestamps the last close as Thursday 2026-08-06 16:00 EDT and shows 08-07 only as a ~4:20 AM EDT pre-market quote — before the jobs report, before the open.

KRX closes at 15:30 KST, so Korea does have a settled Friday 08-07 close.

anchor session
US 2026-08-06T16:00:00-04:00 Thursday close
KR 2026-08-07T15:30:00+09:00 Friday close

One session apart — the same relationship the seed already modelled, and why asOfISO and krAsOfISO are separate fields.

Worth recording: several aggregators label that same Thursday data as an "August 7 close." Those labels were found and refused. Taken at face value they would have shipped day-old figures stamped with today's date.

The problem a partial refresh creates

Research corroborated 21 of 187 US rows and 18 of 159 KR rows. Seed rows carried no date, and one snapshot as-of covered every row in a region — so moving the anchor forward would have made ~300 un-refreshed rows claim a close they do not have. That is precisely the defect P11 fixed, when Korean rows carried the US as-of and the stock page misstated when their data was from.

AssetMeta now takes an optional per-row asOfISO. Refreshed rows carry their own; un-refreshed rows fall back to US_PREV_ASOF_ISO / KR_PREV_ASOF_ISO — the previous anchor, not the bumped one. Bumping the snapshot therefore cannot silently relabel anything.

Visible on the stock page, verified in the running app:

symbol shows why
NVDA 기준 8월 6일 refreshed, US close
KO 기준 8월 4일 not refreshed, previous anchor
005930 기준 8월 7일 refreshed, KRX close
035720 기준 8월 5일 deliberately skipped

What was deliberately left alone

  • Kakao (035720) — its only figure carries a 16:30 KST timestamp, inside the 16:00–18:00 단일가 auction window, which can legitimately diverge ±10% from the close.
  • NAVER (035420) — a −7.08% move with no same-day explanatory story. A large unexplained move is the shape of a bad datum.
  • VIX — only a 2026-08-05 figure, low confidence.
  • ES/NQ/YM futures — not corroborated to any close.
  • The Dow had two conflicting figures: −464.02 → 53,885.10 (Yahoo, fetched directly) and −479 → 53,870 (a search synthesis). The directly-fetched figure is used and the choice is recorded in the code and the commit. Averaging them would have manufactured a number neither source reports.

Also refreshed

GENERAL_NEWS (8 US, Thursday) and KR_GENERAL_NEWS (7 KR, Friday), plus MARKET_SUMMARY and EXPLORE_CARDS in both regions — the last of those because review caught the summary still narrating the 08-04 session directly above a news feed reading 08-06, two trading days on one screen.

ARCHITECTURE.md documents the override, the fallback, and why the fallback points at the previous anchor rather than the bumped one.

Verification

npm run check exit 0 — 64 files / 289 tests, validate:tokens literals: 0, every gate PASS. Version stays 1.13.0.

All 47 refreshed figures were traced value-for-value against the research files in review, with zero mismatches, and each flagged trap was confirmed honoured. engine.asof-refresh.test.ts was proven a real guard by reverting the fallback to the bumped anchor and watching three of five tests fail with the correct diagnostics.

Known limits

10 of the 18 refreshed KR stocks rest on a single after-hours-close proxy with no independent cross-check of the exact won figure; finance.naver.com and m.finance.daum.net were both unreachable from this environment. Futures sit further above their refreshed cash indices than the seed's intended basis, since they were not re-derived.

336 of 383 rows still carry their previous close. Hand-refreshing a seed does not scale to a daily cadence — the app already ships the whole provider layer (Alpaca, Finnhub, Coinbase, quality gate, provenance, circuit breaker) in server/market/, unconfigured. One API key retires this workflow.

🤖 Generated with Claude Code

DCLXAI and others added 2 commits August 7, 2026 17:53
Refreshes prices/changes/market caps for symbols corroborated in
.superpowers/refresh-2026-08-07-{us,kr}.md: 21 US mega-caps + 3 US
indices (Thu 2026-08-06 settled close — Friday's session hadn't closed
when the research ran) and 18 of 20 priority KR stocks + all 5 KR
index/FX benchmarks (Fri 2026-08-07 KRX close). Kakao (auction-window
timestamp, not verified equal to the close) and NAVER (unexplained
-7.08% move) were deliberately left alone. Dow uses the directly-fetched
Yahoo figure (-464.02 -> 53,885.10) over a search-synthesis figure that
disagreed. VIX, ES/NQ/YM futures, gold/oil, and crypto were not touched
(no settled-close or full-batch corroboration).

Adds a per-row `AssetMeta.asOfISO` override (types.ts) so a refreshed
seed row carries its own as-of instead of inheriting the region's bulk
snapshot. Un-refreshed rows resolve to a new `US_PREV_ASOF_ISO`/
`KR_PREV_ASOF_ISO` fallback in engine.ts, not the bumped
`SNAPSHOT.asOfISO`/`krAsOfISO` — otherwise moving those forward would
silently claim the new close for the ~85% of rows this pass didn't
re-verify, the same defect P11 fixed for KR-vs-US rows, reintroduced
per-row instead of per-region. Verified live: /#/stock/NVDA reads
"기준 8월 6일", /#/stock/KO (unrefreshed) still reads "기준 8월 4일".

Replaces GENERAL_NEWS/KR_GENERAL_NEWS with the sourced 08-06/08-07
stories. Updates SNAPSHOT's asOfISO/krAsOfISO/closeLabel*/todayISO and
sentiment (mild risk-off on the new US session vs. the prior optimistic
read). validate-data.ts's anchor assertion and a new per-row invariant
(a row's as-of must equal either its region's current or previous
anchor, never later) are added; a dedicated regression test
(engine.asof-refresh.test.ts) pins the override behavior and was
verified to fail when the fallback is reverted to the bumped snapshot.

npm run check passes end to end.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…on, document per-row as-of override

Review found two Minor gaps in the 2026-08-07 seed refresh:

1. MARKET_SUMMARY/EXPLORE_CARDS (content.ts) and KR_MARKET_SUMMARY/
   KR_EXPLORE_CARDS (content.kr.ts) still narrated the old 08-04/08-05
   sessions while GENERAL_NEWS/KR_GENERAL_NEWS directly beneath them on
   the same page already read 08-06/08-07 — two different trading days
   on one screen, undoing the provenance discipline the per-row as-of
   override exists to enforce. Rewrote both regions' summary items and
   explore cards against the same research files, corroborated-close
   figures only. US now covers 6 summary items / 7 explore cards from
   Thursday 2026-08-06 (fewer explore cards than before — 7 corroborated
   stories, not padded back to the old count of 10). KR covers 7 summary
   items / 6 explore cards from Friday 2026-08-07, matching the prior
   per-array counts. Verified live: the US market home no longer
   contains "Palantir Surges"/"ASML" and does contain the new Dow/Airbnb
   copy; the KR market home (?region=kr) no longer contains "3.76%
   급등" and does contain the new SK하이닉스/삼성전자 copy.

   Removing the old 'ms-btc' summary id leaves two existing `.find(id
   === 'ms-btc')` call sites (CryptoPage.tsx, answers.ts) resolving to
   undefined; both were already `if (x)`-guarded, so this is a graceful
   "nothing to show" rather than a regression — consistent with crypto
   staying out of scope for this refresh.

2. ARCHITECTURE.md's P11 section documented the pre-refresh anchors
   (2026-08-04/05) and said nothing about the per-row `AssetMeta.asOfISO`
   override added in the prior commit. Added three paragraphs: the
   updated anchors, why bumping SNAPSHOT.asOfISO/krAsOfISO for display
   would silently forward-date unrefreshed rows without the override,
   how US_PREV_ASOF_ISO/KR_PREV_ASOF_ISO fix that, and why crypto is
   deliberately excluded from the mechanism.

npm run check passes end to end (validate:tokens literals: 0).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DCLXAI
DCLXAI merged commit 7e91b9e into main Aug 7, 2026
6 checks passed
@DCLXAI
DCLXAI deleted the chore/seed-refresh-2026-08-07 branch August 7, 2026 09:15
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