Skip to content

Commit 0d7d17a

Browse files
committed
fix: remap vault URLs
1 parent 09527c2 commit 0d7d17a

168 files changed

Lines changed: 313 additions & 302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/docs/agent-tricks-and-troubleshooting.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,21 @@ codex exec --json --sandbox read-only "Review uncommitted changes for correctnes
116116

117117
Claude CLI is useful for independent second opinions, code reviews, background agents, and checking whether another agent's change makes sense.
118118

119+
### Review timeout policy
120+
121+
Every Claude CLI or Codex CLI review request must have an execution timeout of
122+
**at least 15 minutes**. Large diffs may take several minutes to inspect, and
123+
streaming output can remain quiet while the reviewer reads targeted files. Do
124+
not terminate a review merely because it has produced no final answer within a
125+
minute; check its stream or raw output file while allowing the full timeout.
126+
127+
For review tools that expose their own timeout option, pass a value of 15
128+
minutes or greater, for example:
129+
130+
```shell
131+
claude ultrareview master --timeout 15
132+
```
133+
119134
Common commands:
120135

121136
```shell
@@ -251,9 +266,9 @@ claude -p "Review .claude/plans/my-plan.md for correctness and completeness. Foc
251266
--verbose
252267
```
253268

254-
If a grounded review produces no output after roughly a minute, stop it and
255-
switch to the no-tools inline review unless fresh repository inspection is
256-
strictly required.
269+
If a grounded review has not produced output, inspect its stream or raw output
270+
file while allowing the required 15-minute timeout. Only then switch to the
271+
no-tools inline review unless fresh repository inspection is strictly required.
257272

258273
Notes:
259274

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ working on that area:
1919
## Agent review workflows
2020

2121
- **BLOCKING REQUIREMENT: before running ANY `codex` / `codex exec` or `claude` CLI command — reviews, sanity checks, or one-off runs — you MUST first read `.claude/docs/agent-tricks-and-troubleshooting.md`.** Do not invoke either CLI until you have read it in the current session. This is not optional and applies even when the call "looks trivial".
22-
- Follow its recommended invocation patterns for plan reviews, code reviews, PR reviews, tool restrictions, timeouts, and handling silent or hanging agent runs.
22+
- Follow its recommended invocation patterns for plan reviews, code reviews, PR reviews, tool restrictions, timeouts, and handling silent or hanging agent runs. Review requests must allow at least 15 minutes before being treated as timed out.
2323
- Always run non-interactive Codex reviews in **streaming mode** (`codex exec --json`) written to a raw file — never plain text mode piped through `tail`/`head`, which buffers output until completion and makes the run look hung.
2424
- `codex exec` selects the sandbox directly (`--sandbox read-only` for reviews) and does **not** accept `--ask-for-approval` (that flag is interactive-only).
2525
- Do not fall back to generic `claude --help`, plugin docs, or ad-hoc CLI flags until the local troubleshooting doc has been checked.

docs/cache-freshness-diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If those sources are refreshed at different times, the homepage and detail page
3030

3131
- Vault summary metrics come from the top-vaults feed
3232
- Loaded in [src/routes/strategies/[strategy=yamlStrategy]/+layout.ts](/Users/moo/code/frontend/src/routes/strategies/[strategy=yamlStrategy]/+layout.ts)
33-
- The chart fetches `/trading-view/vaults/:id/metrics` client-side after hydration
33+
- The chart fetches `/vaults/:id/metrics` client-side after hydration
3434
- Implemented in [src/lib/top-vaults/VaultPriceChart.svelte](/Users/moo/code/frontend/src/lib/top-vaults/VaultPriceChart.svelte)
3535
- The frontend app code does not add SWR caching to this chart request
3636

docs/chart-pages.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Chart pages
22

3-
This document describes chart pages and chart navigation in the Trading Strategy frontend. It focuses on vault chart pages under `src/routes/trading-view/vaults/`, but also notes the shared charting libraries used elsewhere.
3+
This document describes chart pages and chart navigation in the Trading Strategy frontend. It focuses on vault chart pages under `src/routes/vaults/`, but also notes the shared charting libraries used elsewhere.
44

55
## Vault chart pages
66

77
The vault chart pages linked from the top `Charts` menu are:
88

9-
- `/trading-view/vaults/cumulative-tvl-apy` - cumulative vault TVL by annualised return, with benchmark lines.
10-
- `/trading-view/vaults/yield-risk` - vault annualised return by TVL, grouped by risk level.
11-
- `/trading-view/vaults/yield-protocol` - vault annualised return by TVL, grouped by protocol.
12-
- `/trading-view/vaults/yield-chain` - vault annualised return by TVL, grouped by chain.
13-
- `/trading-view/vaults/current-peak-tvl` - current TVL by peak TVL.
14-
- `/trading-view/vaults/core3-risk` - stablecoin vault returns and TVL by CORE3 Probability of Loss.
15-
- `/trading-view/vaults/historical-tvl-chain` - historical vault TVL grouped by chain.
16-
- `/trading-view/vaults/historical-tvl-stablecoin` - historical vault TVL grouped by stablecoin.
17-
- `/trading-view/vaults/historical-tvl-protocol` - historical vault TVL grouped by vault protocol.
18-
- `/trading-view/vaults/stablecoin-chain-heatmap` - current stablecoin vault TVL by stablecoin and chain.
9+
- `/vaults/cumulative-tvl-apy` - cumulative vault TVL by annualised return, with benchmark lines.
10+
- `/vaults/yield-risk` - vault annualised return by TVL, grouped by risk level.
11+
- `/vaults/yield-protocol` - vault annualised return by TVL, grouped by protocol.
12+
- `/vaults/yield-chain` - vault annualised return by TVL, grouped by chain.
13+
- `/vaults/current-peak-tvl` - current TVL by peak TVL.
14+
- `/vaults/core3-risk` - stablecoin vault returns and TVL by CORE3 Probability of Loss.
15+
- `/vaults/historical-tvl-chain` - historical vault TVL grouped by chain.
16+
- `/vaults/historical-tvl-stablecoin` - historical vault TVL grouped by stablecoin.
17+
- `/vaults/historical-tvl-protocol` - historical vault TVL grouped by vault protocol.
18+
- `/vaults/stablecoin-chain-heatmap` - current stablecoin vault TVL by stablecoin and chain.
1919

2020
Related vault list pages also include charts:
2121

22-
- `/trading-view/vaults/stablecoins`, `/chains`, `/protocols`, and `/curators` use `MarketSharePieChart.svelte`.
22+
- `/vaults/stablecoins`, `/chains`, `/protocols`, and `/curators` use `MarketSharePieChart.svelte`.
2323
- Group detail pages use `VaultGroupMiniChart.svelte`.
2424
- Vault detail pages use lightweight-charts components for share price, utilisation, and benchmark series.
2525

@@ -36,7 +36,7 @@ The common data sources are:
3636
- Route-local `chart-data/+server.ts` endpoints for heavier ECharts pages that need cached JSON payloads.
3737
- Client-side `fetch()` from `+page.svelte` for pages that opt out of SSR or need lazy chart data loading.
3838
- `+page.server.ts` for pages that can prepare their data during server rendering.
39-
- Vault detail metrics endpoints such as `/trading-view/vaults/[vault]/metrics` for time-series data.
39+
- Vault detail metrics endpoints such as `/vaults/[vault]/metrics` for time-series data.
4040

4141
Current cached chart-data endpoints include:
4242

@@ -98,7 +98,7 @@ Its `charts` array controls the `See charts:` link row displayed within chart pa
9898

9999
When adding or removing a chart page, update both arrays unless there is a deliberate reason for the page to appear in only one navigation surface. Also update integration tests that assert menu or selector counts:
100100

101-
- `tests/integration/trading-view/vaults/charts-dropdown.test.ts`
101+
- `tests/integration/vaults/charts-dropdown.test.ts`
102102
- chart-page tests that assert `.scatter-plot-selector a` counts
103103

104104
The dropdown and in-page selector can intentionally have different counts. For example, a page can be present in the in-page selector before it is added to the top dropdown, but this should be explicit in the change.
@@ -113,6 +113,6 @@ first so private env vars and the historical vault parquet cache are available t
113113
Useful checks:
114114

115115
- Run unit tests for chart payload builders, e.g. `pnpm exec vitest run src/lib/echarts/core3-risk.test.ts`.
116-
- Run focused Playwright specs after navigation changes, e.g. `pnpm exec playwright test --config tests/integration tests/integration/trading-view/vaults/charts-dropdown.test.ts`.
116+
- Run focused Playwright specs after navigation changes, e.g. `pnpm exec playwright test --config tests/integration tests/integration/vaults/charts-dropdown.test.ts`.
117117
- Run `pnpm run build:test` before focused integration specs if `.svelte-kit-test/output/server` is missing.
118118
- Use Playwright browser checks to verify canvas count, tooltip content, and navigation when adding a new ECharts page.

docs/echarts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The front page adapter lives in:
2323

2424
The standalone page adapter lives in:
2525

26-
- `src/routes/trading-view/vaults/cumulative-tvl-apy/CumulativeTvlApyChart.svelte`
26+
- `src/routes/vaults/cumulative-tvl-apy/CumulativeTvlApyChart.svelte`
2727

2828
The diagnostics implementation lives here:
2929

@@ -185,7 +185,7 @@ The standalone page uses a larger preset so axis labels, tooltip text, and plot
185185
The ECharts migration is covered by integration tests in:
186186

187187
- `tests/integration/index.test.ts`
188-
- `tests/integration/trading-view/vaults/cumulative-tvl-apy.test.ts`
188+
- `tests/integration/vaults/cumulative-tvl-apy.test.ts`
189189

190190
The home page test checks that the page:
191191

@@ -257,8 +257,8 @@ If you change the front page widget, check these areas together:
257257

258258
If you change the standalone page, check these areas together:
259259

260-
- `src/routes/trading-view/vaults/cumulative-tvl-apy/CumulativeTvlApyChart.svelte` control logic and URL state
260+
- `src/routes/vaults/cumulative-tvl-apy/CumulativeTvlApyChart.svelte` control logic and URL state
261261
- `src/lib/scatter-plot/ScatterPlotShell.svelte` chart hosting behaviour
262-
- `tests/integration/trading-view/vaults/cumulative-tvl-apy.test.ts`
262+
- `tests/integration/vaults/cumulative-tvl-apy.test.ts`
263263

264264
If the change is primarily visual or experimental, prefer trying it on the diagnostics page first and then porting the result into the front page widget once the behaviour is stable.

docs/new-vault-chain.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ Vaults with `risk_numeric: null` (common for new chains without risk scoring) mu
5757
If the new chain's vaults need a different default TVL threshold, add an entry to:
5858

5959
- `CHAIN_TVL_THRESHOLD_OVERRIDES` map in `src/lib/top-vaults/helpers.ts` (affects `meetsDefaultTvl` used on the front page)
60-
- `chainOverrides` in the `tvlFilterOptions` array in the same file (affects the interactive filter on `/trading-view/vaults`)
60+
- `chainOverrides` in the `tvlFilterOptions` array in the same file (affects the interactive filter on `/vaults`)
6161

6262
## 6. Parquet data
6363

64-
Vault share price chart data is served from a locally cached `data/cleaned-vault-prices-1h.parquet` file. The server refreshes this cache from the configured Cloudflare source when the file has not been checked for over one hour. The metrics endpoint (`src/routes/trading-view/vaults/[vault=vaultId]/metrics/+server.ts`) queries this file by vault ID.
64+
Vault share price chart data is served from a locally cached `data/cleaned-vault-prices-1h.parquet` file. The server refreshes this cache from the configured Cloudflare source when the file has not been checked for over one hour. The metrics endpoint (`src/routes/vaults/[vault=vaultId]/metrics/+server.ts`) queries this file by vault ID.
6565

6666
Ensure the parquet file is updated to include rows for the new chain's vaults. Without this, the chart will render empty (no error shown to the user).
6767

@@ -70,7 +70,7 @@ Ensure the parquet file is updated to include rows for the new chain's vaults. W
7070
After adding a new chain, verify:
7171

7272
- [ ] Chain logo appears on the blockchains page (`/trading-view/blockchains`)
73-
- [ ] Vaults appear in the listing (`/trading-view/vaults`) — try the search box and lower TVL filters
74-
- [ ] Vault detail page loads (`/trading-view/vaults/{slug}`)
73+
- [ ] Vaults appear in the listing (`/vaults`) — try the search box and lower TVL filters
74+
- [ ] Vault detail page loads (`/vaults/{slug}`)
7575
- [ ] Share price chart shows data on the vault detail page
76-
- [ ] Chain appears in the "by chain" vault grouping (`/trading-view/vaults/chains`)
76+
- [ ] Chain appears in the "by chain" vault grouping (`/vaults/chains`)

docs/tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ tailscale ip -4
120120
Example:
121121

122122
```text
123-
http://brian.tail71b97.ts.net:5173/trading-view/vaults/stablecoins/frax
123+
http://brian.tail71b97.ts.net:5173/vaults/stablecoins/frax
124124
```
125125

126126
The Vite config allows `.ts.net` hosts so agent-hosted remote dev previews work without disabling host validation globally.

docs/vault-data-optimisation-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The landing page vault data was optimised in PR #1171 by pre-computing aggregate
1212

1313
## Candidates for optimisation
1414

15-
### 1. `/trading-view/vaults/+layout.ts` (highest impact)
15+
### 1. `/vaults/+layout.ts` (highest impact)
1616

1717
Central hub for all vault listing pages (~15 child routes). Currently fetches full `VaultInfo[]` (80+ fields per vault) and passes it to every child.
1818

docs/vault-data-source.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ R2 downloads stream the object body via the AWS SDK (`getR2Object`) and pipe it
6363

6464
### Treasury benchmark (FRED DTB3)
6565

66-
**Code:** `src/routes/trading-view/vaults/treasury-benchmark/+server.ts` (server proxy) and `src/lib/top-vaults/treasury-benchmark.ts` (client fetcher)
66+
**Code:** `src/routes/vaults/treasury-benchmark/+server.ts` (server proxy) and `src/lib/top-vaults/treasury-benchmark.ts` (client fetcher)
6767

6868
The US 3-month Treasury bill rate is used as a risk-free benchmark on non-perpetual-futures vault charts. FRED blocks browser CORS and rate-limits aggressively, so the data is proxied through a server endpoint.
6969

70-
**Server endpoint** (`/trading-view/vaults/treasury-benchmark?cosd=YYYY-MM-DD&coed=YYYY-MM-DD`):
70+
**Server endpoint** (`/vaults/treasury-benchmark?cosd=YYYY-MM-DD&coed=YYYY-MM-DD`):
7171

7272
1. Validates and clamps date range (rejects future `cosd`, clamps to DTB3 series bounds)
7373
2. Checks file cache at `~/.cache/ts-frontend/fred-DTB3-{cosd}-{coed}.json` (24h TTL)
@@ -96,11 +96,11 @@ The US 3-month Treasury bill rate is used as a risk-free benchmark on non-perpet
9696

9797
### Datasets download endpoint
9898

99-
**Code:** `src/routes/trading-view/vaults/datasets/download/[datasetId]/+server.ts`
99+
**Code:** `src/routes/vaults/datasets/download/[datasetId]/+server.ts`
100100

101101
This public-facing endpoint proxies downloads through a separate Vault API service (`TS_PUBLIC_VAULT_API_URL`), not through R2 or the local cache. It is used by the datasets listing page for user-facing downloads.
102102

103-
The datasets listing page (`src/routes/trading-view/vaults/datasets/+page.server.ts`) requires R2 to be configured for displaying file metadata (size, last modified), even though the actual download goes through the Vault API.
103+
The datasets listing page (`src/routes/vaults/datasets/+page.server.ts`) requires R2 to be configured for displaying file metadata (size, last modified), even though the actual download goes through the Vault API.
104104

105105
## Data flow diagram
106106

scripts/benchmark-historical-tvl-chain.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

33
// Benchmark the same aggregation used by
4-
// `/trading-view/vaults/historical-tvl-chain/chart-data`
5-
// for the page at `/trading-view/vaults/historical-tvl-chain`.
4+
// `/vaults/historical-tvl-chain/chart-data`
5+
// for the page at `/vaults/historical-tvl-chain`.
66
//
77
// Local benchmark baseline from 2026-03-21 on this checkout after
88
// weekly daily-close averaging and dropping the current partial week:

0 commit comments

Comments
 (0)