validate(prices): Phase B smoke run once /v1/prices is live #161

Closed
opened 2026-04-27 00:15:37 +00:00 by maximus · 0 comments
Owner

Contexte

maximus-api 0.3.0 est LIVE en prod depuis 2026-05-05 (GET /v1/prices repond 401 sans token, contrat respecte). Les blockers initiaux ont disparu : Phase A scaffold (#173) et release 0.9.0 (#160) deja shipped, double-gating actif (useIsPremium=false cote client + serveur 401/403). Ne reste qu'une validation runtime contre prod + patch CHANGELOG.

Status courant (2026-05-10)

  • Prod live : GET /v1/prices?... repond 401 missing_token sans header (contrat OK)
  • /healthz 200
  • maximus-api main deploye via Coolify (commit e662171, version 0.3.0)
  • Mirror server-side maximus-api#25 toujours ouvert (smoke serveur en attente du meme token)

Travail a faire

1. Smoke prod

  • SSH sur VPS maximus-api (vps-b0826277.tail3c811f.ts.net)
  • Emettre un activation token Ed25519 tier=premium via le script CLI serveur (avec la cle privee qui vit sur le VPS)
  • Lancer ./tests/smoke/prices.sh contre https://api.lacompagniemaximus.com :
    export MAXIMUS_API_TEST_TOKEN=<token-premium>
    ./tests/smoke/prices.sh
    
  • 4 cas attendus :
    • AAPL → HTTP 200, .price > 0
    • BTC → HTTP 200, .price > 0
    • NOTREAL_XYZ → HTTP 404, .error.code == "symbol_not_found"
    • sans Authorization → HTTP 401, .error.code == "missing_token"
  • Revoquer le token via POST /v1/admin/tokens/revoke apres le smoke

2. E2e manuel

  • En dev build local, creer une categorie priced + 4 comptes (AAPL, MSFT stocks ; BTC, ETH cryptos)
  • Sur /balance/snapshot, cliquer Fetch prices avec consent
  • Verifier que les prix arrivent dans le rate-limit budget
  • 2e appel sur meme date+symbole : cache hit confirme via devtools network panel ou cached: true dans le payload

3. CHANGELOG patch (commit follow-up, pas de re-tag)

Patch retroactif sous [0.9.0] ligne 36 (FR + EN) :

CHANGELOG.md :

- - **Price-fetching premium for stocks (best-effort) and crypto (direct exchanges)** ... privacy toggle in Settings to revoke consent. (#160)
+ - **Price-fetching premium for stocks (best-effort) and crypto (direct exchanges)** ... privacy toggle in Settings to revoke consent (server activation pending — feature dormant until maximus-api /v1/prices ships). (#160)

CHANGELOG.fr.md : meme suffixe traduit ((activation serveur en attente — fonctionnalite dormante jusqu'a la mise en ligne de maximus-api /v1/prices)).

Nouvelle entree sous [Unreleased] / [Non publie] :

  • EN sous ### Changed : Price-fetching activated — maximus-api /v1/prices live in production since 2026-05-05.
  • FR sous ### Modifie : Recuperation de prix activee — /v1/prices de maximus-api en production depuis 2026-05-05.

4. Hors-scope (delegue)

  • 403 premium_required cote client : skip, couvert par les tests d'integration de maximus-api (responsabilite serveur)

Fichiers concernes

  • tests/smoke/prices.sh — execute tel quel, pas de modif
  • CHANGELOG.md ligne 36 + section [Unreleased] ligne 3
  • CHANGELOG.fr.md ligne 36 + section [Non publie] ligne 3
  • VPS maximus-api (hors-repo) — script d'emission/revocation token

Surface de test

  • Existants suffisants (aucun ajout) :
    • src-tauri/src/commands/balance_commands.rs:375-531 — 7 mockito tests (200, 401, 403, 404, 429 retry-after, 502, header privacy)
    • src/services/balance.service.test.ts — rate-limit + dedup + retry
    • src/components/balance/PriceFetchControl.test.tsx — 12 UI guard tests
  • Le smoke prices.sh est le gate integration ; l'e2e manuel couvre cache hit + UI flow non couverts par les unit/component tests

Criteres d'acceptation

  • ./tests/smoke/prices.sh exit 0 contre prod avec token premium issu via VPS
  • Token de test revoque apres smoke
  • E2e manuel : prix stocks + cryptos visibles, 2e appel cache hit
  • CHANGELOG.md + CHANGELOG.fr.md patches (2 endroits chacun) et merges sur main

Complexite

Simple — runtime validation + amend CHANGELOG (4 lignes). Pas de code applicatif touche.

Decisions retenues (analyse 2026-05-10)

  • Token premium : SSH VPS pour emission ad-hoc + revocation post-smoke (pas de token long-lived qui traine, pas de dependance sur l'admin endpoint POST /admin/licenses non encore implemente)
  • CHANGELOG : double patch — historique sous [0.9.0] (documente l'etat au release time) + nouvelle entree sous [Unreleased] (documente l'activation 2026-05-05)
  • Token free-tier 403 : skip cote client, couvert cote serveur

References

  • ADR 0011 (docs/adr/0011-providers-best-effort-yahoo.md) — best-effort Yahoo + exchanges crypto
  • docs/api-contract-prices.md — response shape + error codes
  • PR #173 — Phase A scaffold (merge 2026-04-28)
  • Release v0.9.0 (commit 5836760, 2026-04-29)
  • maximus-api 0.3.0 deploye 2026-05-05 (commit e662171)
  • maximus-api milestone : overnight-2026-04-30-prices-api (#42, 20/21 closed)
  • Mirror server-side : maximus-api#25 test(prod): smoke test post-deploy /v1/prices avec activation_token premium
## Contexte `maximus-api` 0.3.0 est LIVE en prod depuis 2026-05-05 (`GET /v1/prices` repond 401 sans token, contrat respecte). Les blockers initiaux ont disparu : Phase A scaffold (#173) et release 0.9.0 (#160) deja shipped, double-gating actif (`useIsPremium=false` cote client + serveur 401/403). Ne reste qu'une validation runtime contre prod + patch CHANGELOG. ### Status courant (2026-05-10) - Prod live : `GET /v1/prices?...` repond 401 `missing_token` sans header (contrat OK) - `/healthz` 200 - maximus-api `main` deploye via Coolify (commit `e662171`, version 0.3.0) - Mirror server-side `maximus-api#25` toujours ouvert (smoke serveur en attente du meme token) ## Travail a faire ### 1. Smoke prod - [ ] SSH sur VPS maximus-api (`vps-b0826277.tail3c811f.ts.net`) - [ ] Emettre un activation token Ed25519 `tier=premium` via le script CLI serveur (avec la cle privee qui vit sur le VPS) - [ ] Lancer `./tests/smoke/prices.sh` contre `https://api.lacompagniemaximus.com` : ```bash export MAXIMUS_API_TEST_TOKEN=<token-premium> ./tests/smoke/prices.sh ``` - [ ] 4 cas attendus : - AAPL → HTTP 200, `.price > 0` - BTC → HTTP 200, `.price > 0` - `NOTREAL_XYZ` → HTTP 404, `.error.code == "symbol_not_found"` - sans `Authorization` → HTTP 401, `.error.code == "missing_token"` - [ ] Revoquer le token via `POST /v1/admin/tokens/revoke` apres le smoke ### 2. E2e manuel - [ ] En dev build local, creer une categorie priced + 4 comptes (AAPL, MSFT stocks ; BTC, ETH cryptos) - [ ] Sur `/balance/snapshot`, cliquer *Fetch prices* avec consent - [ ] Verifier que les prix arrivent dans le rate-limit budget - [ ] 2e appel sur meme date+symbole : cache hit confirme via devtools network panel ou `cached: true` dans le payload ### 3. CHANGELOG patch (commit follow-up, pas de re-tag) **Patch retroactif sous [0.9.0] ligne 36** (FR + EN) : `CHANGELOG.md` : ```diff - - **Price-fetching premium for stocks (best-effort) and crypto (direct exchanges)** ... privacy toggle in Settings to revoke consent. (#160) + - **Price-fetching premium for stocks (best-effort) and crypto (direct exchanges)** ... privacy toggle in Settings to revoke consent (server activation pending — feature dormant until maximus-api /v1/prices ships). (#160) ``` `CHANGELOG.fr.md` : meme suffixe traduit (`(activation serveur en attente — fonctionnalite dormante jusqu'a la mise en ligne de maximus-api /v1/prices)`). **Nouvelle entree sous [Unreleased] / [Non publie]** : - EN sous `### Changed` : `Price-fetching activated — maximus-api /v1/prices live in production since 2026-05-05.` - FR sous `### Modifie` : `Recuperation de prix activee — /v1/prices de maximus-api en production depuis 2026-05-05.` ### 4. Hors-scope (delegue) - 403 `premium_required` cote client : skip, couvert par les tests d'integration de maximus-api (responsabilite serveur) ## Fichiers concernes - `tests/smoke/prices.sh` — execute tel quel, pas de modif - `CHANGELOG.md` ligne 36 + section [Unreleased] ligne 3 - `CHANGELOG.fr.md` ligne 36 + section [Non publie] ligne 3 - VPS `maximus-api` (hors-repo) — script d'emission/revocation token ## Surface de test - Existants suffisants (aucun ajout) : - `src-tauri/src/commands/balance_commands.rs:375-531` — 7 mockito tests (200, 401, 403, 404, 429 retry-after, 502, header privacy) - `src/services/balance.service.test.ts` — rate-limit + dedup + retry - `src/components/balance/PriceFetchControl.test.tsx` — 12 UI guard tests - Le smoke `prices.sh` est le gate integration ; l'e2e manuel couvre cache hit + UI flow non couverts par les unit/component tests ## Criteres d'acceptation - [ ] `./tests/smoke/prices.sh` exit 0 contre prod avec token premium issu via VPS - [ ] Token de test revoque apres smoke - [ ] E2e manuel : prix stocks + cryptos visibles, 2e appel cache hit - [ ] `CHANGELOG.md` + `CHANGELOG.fr.md` patches (2 endroits chacun) et merges sur `main` ## Complexite **Simple** — runtime validation + amend CHANGELOG (4 lignes). Pas de code applicatif touche. ## Decisions retenues (analyse 2026-05-10) - **Token premium** : SSH VPS pour emission ad-hoc + revocation post-smoke (pas de token long-lived qui traine, pas de dependance sur l'admin endpoint `POST /admin/licenses` non encore implemente) - **CHANGELOG** : double patch — historique sous [0.9.0] (documente l'etat au release time) + nouvelle entree sous [Unreleased] (documente l'activation 2026-05-05) - **Token free-tier 403** : skip cote client, couvert cote serveur ## References - ADR 0011 (`docs/adr/0011-providers-best-effort-yahoo.md`) — best-effort Yahoo + exchanges crypto - `docs/api-contract-prices.md` — response shape + error codes - PR #173 — Phase A scaffold (merge 2026-04-28) - Release `v0.9.0` (commit `5836760`, 2026-04-29) - maximus-api 0.3.0 deploye 2026-05-05 (commit `e662171`) - maximus-api milestone : `overnight-2026-04-30-prices-api` (#42, 20/21 closed) - Mirror server-side : `maximus-api#25 test(prod): smoke test post-deploy /v1/prices avec activation_token premium`
maximus added this to the spec-price-fetching milestone 2026-04-27 00:15:37 +00:00
maximus added the
type:feature
source:human
labels 2026-04-27 00:15:37 +00:00
maximus added the
status:ready
label 2026-04-29 01:28:58 +00:00
maximus added
status:blocked
and removed
status:ready
labels 2026-04-29 10:25:38 +00:00
maximus changed title from feat(prices): production wiring + smoke test + release to validate(prices): Phase B smoke run once /v1/prices is live 2026-05-04 00:38:30 +00:00
maximus added
status:ready
and removed
status:blocked
labels 2026-05-06 01:36:58 +00:00
maximus added
status:approved
and removed
status:ready
labels 2026-05-10 19:25:13 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#161
No description provided.