add(pro-docs): price feed id changelog page#3536
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 llms.txt Content ReviewAnalyzed documentation changes — no updates to curated content required. Products reviewed:
Files analyzed |
| if ( | ||
| !includeAllFieldDiffs && | ||
| change.changeType !== "went_live" && | ||
| change.statusBefore === change.statusAfter | ||
| ) { | ||
| return false | ||
| } |
There was a problem hiding this comment.
🔴 Default filter hides added and removed entries when state is null
The visibility filter at line 91-97 only exempts went_live entries from being hidden when statusBefore === statusAfter. But added entries have statusBefore: null and if the record has no state field (or state: null), statusAfter is also null, so null === null → the entry is hidden in default view. The same issue applies to removed entries where the record's state was null. This means newly added or removed price feeds with no explicit state are invisible in the default view, contradicting the intent of the changelog page which should always surface structural additions/removals.
Example scenario
A new record is added to the API with state: null. The generate script produces:
{ "changeType": "added", "statusBefore": null, "statusAfter": null, ... }In the UI filter:
!includeAllFieldDiffs→ true (default)change.changeType !== "went_live"→ true (it's "added")change.statusBefore === change.statusAfter→null === null→ true
Result: entry is filtered out and invisible to users unless they toggle "Include all property changes".
| if ( | |
| !includeAllFieldDiffs && | |
| change.changeType !== "went_live" && | |
| change.statusBefore === change.statusAfter | |
| ) { | |
| return false | |
| } | |
| if ( | |
| !includeAllFieldDiffs && | |
| change.changeType !== "went_live" && | |
| change.changeType !== "added" && | |
| change.changeType !== "removed" && | |
| change.statusBefore === change.statusAfter | |
| ) { | |
| return false | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5e1e81e12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const beforeValue = beforeObject[key] ?? null | ||
| const afterValue = afterObject[key] ?? null |
There was a problem hiding this comment.
Distinguish missing keys from explicit nulls in field diff
When an API field flips between omitted and explicitly null, the record is marked as changed (deepEqual sees different objects) but diffValues drops the actual field change because both sides are coerced with ?? null. This produces change entries with no meaningful changedFields (shown as -), so the "Include all property changes" view becomes inaccurate for optional fields that are intermittently present.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b70103432
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const result = symbolRecordSchema.safeParse(item); | ||
| if (result.success) { | ||
| records.push(sortKeys(result.data) as SymbolRecord); | ||
| } | ||
| } |
There was a problem hiding this comment.
Fail changelog generation when symbol records are invalid
fetchCurrentSymbols silently skips any API item that fails schema validation, which means a transient payload issue (for example one record with an unexpected pyth_lazer_id type) is treated as that feed disappearing from the snapshot; buildDailyRollup will then emit false removed/changed entries and publish incorrect changelog data instead of failing fast.
Useful? React with 👍 / 👎.
| } catch { | ||
| return { | ||
| generatedAt: new Date().toISOString(), |
There was a problem hiding this comment.
Do not swallow rollup parse errors
The broad catch in loadExistingRollup converts any read/parse failure into an empty rollup, so if daily-rollups.json is malformed the next successful write path will overwrite history with a fresh object and lose prior changelog days; this should only fall back on missing-file errors and otherwise surface invalid JSON.
Useful? React with 👍 / 👎.
Add a new Pyth Pro changelog docs page that summarizes daily UTC feed-id changes and supports status-focused vs all-field views. Include a snapshot/diff generator pipeline and initial data artifacts so docs can render deterministic daily rollups. Made-with: Cursor
…elog - Extract shared types to src/data/pro-price-feed-changelog/types.ts with Zod schemas for runtime validation (fixes type duplication between generator and component) - Move daily-rollups.json to public/ and fetch at runtime instead of static import (prevents unbounded client bundle growth) - Make generator incremental: only loads previous + current snapshot, prepends new day to existing rollup (O(1) memory vs O(n)) - Add 10-day snapshot retention with automatic pruning - Add Zod validation for API responses with AbortSignal.timeout - Add search debounce (300ms) and URL-synced search query param - Use matchSorter for search filtering (consistent with sibling components) - Switch to State machine pattern matching PriceFeedIdsProTable - Use compact JSON for snapshots, single shared pageSize state - Filter prototype pollution keys in sortKeys, add JSDoc headers - Add record count sanity check (>50k) as safety measure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fail fast when symbol records fail schema validation instead of silently skipping them, preventing false removed/changed entries - Only catch ENOENT in loadExistingRollup so JSON parse errors and permission issues propagate instead of silently losing history - Exempt added/removed change types from the status-unchanged filter so they always appear in the default view - Distinguish missing keys from explicit nulls in field diffs using a MISSING sentinel symbol Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the public Symbols API data source with the private pyth-lazer-governance repo. The generator now reads proposal directories from a local clone (GOVERNANCE_REPO_PATH), applies a strict field whitelist to ensure no sensitive data reaches the public output, and diffs consecutive dates to produce daily changelog entries. - Add shared lib with pure helpers and strict Zod schemas - Add CI workflow with sparse checkout + validation step - Add 25 fixture-based unit tests for all helper functions - Remove 83K-line snapshot file from git - Fix component: State.Failed→Error, use Next.js router for URL updates - Constrain FieldDiff.before/after to scalar types only Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
P1: Validate existing rollup with Zod instead of unsafe `as` cast. P1: Cache previous date's feeds across loop iterations to halve I/O. P2: Remove unsafe `as ScalarValue` casts via typed DIFFABLE_KEYS array. P2: Use strict equality in diffs — no more String() coercion. P2: Remove dead SAFE_METADATA_KEYS export. P2: Use Set for datesToProcess lookup (O(1) vs O(n)). P2: Expand sensitive patterns + add structural key-walking validation. P2: Tighten DIR_NAME_REGEX to prevent path traversal in suffixes. P2: Remove YAGNI endpoint-to-source migration code. P2: Fix useEffect re-render loop by removing searchParams from deps. P2: Extract errorToString to shared src/lib/error-to-string.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1ed061d to
06805cf
Compare
Summary
/price-feeds/pro/price-feed-id-changelogwith an Option C hybrid UX (daily rollups + expandable detail tables).generate:pro-price-feed-changelog) that fetcheshistory/v1/symbols, stores UTC snapshots, and emits deterministic daily changelog JSON artifacts.March 9, 2026 (UTC)).Test plan
pnpm --filter @pythnetwork/shared-lib buildpnpm --filter @pythnetwork/component-library buildpnpm run build(inapps/developer-hub)pnpm run generate:pro-price-feed-changelog(inapps/developer-hub)/price-feeds/pro/price-feed-id-changelog:Made with Cursor