chore(memory): R3 final checks recorded (BDR-056, BLK-012)
This commit is contained in:
1 parent
9bd9acaf58
commit
9bd612c062
8 files changed
+253
No files matched your search
@@ -0,0 +1,76 @@
|
||||
# CONTRACT — r3-final-checks
|
||||
- date: 2026-10-17 | flow: bugfix | branch: feature/rust-r3-anatomy-core
|
||||
- status: active
|
||||
- plan: .claude/tasks/plans/2026-10-17-r3-final-checks-0900.md (rev 2 + owner wording; owner-approved 2026-10-17)
|
||||
- base: 9464651 (run every CHECK from the repository root)
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
# Faunosteo — Derniers contrôles R3 avant validation humaine
|
||||
|
||||
J'approuve les corrections apportées après l'audit indépendant, notamment la protection des bilans non enregistrés, les messages d'erreur communs, le téléchargement de secours et la gestion des reprises du moteur.
|
||||
|
||||
Avant de clôturer R3, vérifie les points suivants :
|
||||
|
||||
1. **Copie JSON de secours** : prouve qu'elle conserve toutes les données nécessaires du bilan, qu'elle est exploitable et qu'une procédure réelle permet de restaurer le travail. Si aucun import compatible n'existe, ne présente pas ce téléchargement comme une restauration complète : identifie la solution minimale nécessaire ou le blocage.
|
||||
|
||||
2. **Boucle de rechargement** : reproduis ou écarte le cas d'un brouillon qui provoque systématiquement un plantage du moteur. Si la boucle est réelle, empêche les rechargements sans fin tout en préservant le brouillon original. Pas de suppression silencieuse.
|
||||
|
||||
3. **Modifications non enregistrées** : vérifie les changements de page, les retours à l'accueil et les autres actions susceptibles de perdre du travail. La protection actuelle limitée à l'éditeur est acceptable seulement si aucun autre parcours exposé ne permet cette perte.
|
||||
|
||||
4. **Erreur de nettoyage mémoire** : détermine si elle est réellement sans conséquence, sans fuite ou accumulation après les reprises. Conserve-la dans le suivi si elle est non bloquante.
|
||||
|
||||
5. **Tests finaux** : exécute `pnpm check:all`, les tests de récupération concernés et les vérifications utiles. Si tu modifies le code, soumets le delta à un contrôle indépendant ciblé.
|
||||
|
||||
Ne lance pas de refonte générale. Privilégie les corrections minimales et cohérentes avec l'architecture validée.
|
||||
|
||||
À la fin, présente :
|
||||
- Le résultat de ces vérifications.
|
||||
- Les éventuels blocages réels.
|
||||
- La méthode de restauration d'une copie JSON.
|
||||
- Le résultat de `check:all`.
|
||||
- La procédure finale de test LAN.
|
||||
|
||||
**R3 reste non fusionnée jusqu'à ma validation manuelle.**
|
||||
|
||||
Ne commence pas R4, ne publie pas la release 0.2.0 et ne déploie rien sur faunosteo.com.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: restore the JSON copy? / A: Home import also accepts the copy (.json, content-sniffed), read by the core's existing `draft.restore`. [gated 2026-10-17]
|
||||
Q: trapping draft? / A: existing resolution panel, row « Brouillon que le moteur de calcul n'arrive pas à ouvrir ({size}) », download / retry / discard after confirmation. [gated 2026-10-17]
|
||||
Q: replace confirmation? / A: always when a bilan is in progress (memory or draft slot); Annuler / Ouvrir le bilan en cours / Remplacer; copy button when unsaved. [gated 2026-10-17]
|
||||
Q: beforeunload guard? / A: every page while unsaved. [gated 2026-10-17]
|
||||
Q: exact wording? / A: the plan's "Owner wording" section, verbatim (import labels, error_invalid_copy, notice_engine, draft_engine_failure, held_blocked_engine, replace dialog texts and buttons). [gated 2026-10-17]
|
||||
Q: (internal, orchestrator, after confirm challenger) copy cap MAX_ATTACHMENT_BYTES, sniff first KiB, memory keyed on (draft, archive), test seam, wrapped-glue trap source? / A: adopted (rev 3). [gated 2026-10-17]
|
||||
Q: (internal, orchestrator, after verifier) floor ASSERT_DROP routes.coreStopped.test.tsx beforeunload test? / A: authorized: guard moved app-wide (owner choice 4), its 4 assertions moved to app.useUnsavedGuard.test.tsx (plan Tests 'guard test moved to the hook test'). [gated 2026-10-17]
|
||||
Q: plan approved? / A: yes. [gated 2026-10-17]
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. The new FR/EN keys exist in both dictionaries with the owner's FR text, and the import labels are reworded.
|
||||
CHECK: f=apps/app/src/i18n/fr.ts; e=apps/app/src/i18n/en.ts; for k in home.import.error_invalid_copy session.held.notice_engine session.held.draft_engine_failure session.held_blocked_engine session.replace.title session.replace.body session.replace.body_unloaded session.replace.unsaved session.replace.open session.replace.confirm; do grep -q "'$k'" $f && grep -q "'$k'" $e || exit 1; done; grep -q "Importer un PDF ou une copie de secours" $f && grep -q "Choisir un fichier" $f && grep -q "Brouillon que le moteur de calcul n'arrive pas à ouvrir" $f && grep -q "Ouvrir le bilan en cours" $f && echo I18N_OK
|
||||
EXPECT: I18N_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: I18N_OK
|
||||
2. The beforeunload guard lives in one app-level hook, no longer in EditorRoute.
|
||||
CHECK: test -f apps/app/src/app/useUnsavedGuard.ts && grep -q "useUnsavedGuard" apps/app/src/app/App.tsx && ! grep -q "beforeunload" apps/app/src/app/routes/EditorRoute.tsx && [ "$(grep -rl beforeunload apps/app/src | wc -l)" = 1 ] && echo GUARD_OK
|
||||
EXPECT: GUARD_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: GUARD_OK
|
||||
3. App suites, typecheck and lint pass.
|
||||
CHECK: ./node_modules/.bin/pnpm typecheck > /tmp/fc-tc.log 2>&1 && ./node_modules/.bin/pnpm test:run > /tmp/fc-test.log 2>&1 && ./node_modules/.bin/pnpm lint > /tmp/fc-lint.log 2>&1 && echo SUITES_OK
|
||||
EXPECT: SUITES_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SUITES_OK
|
||||
4. No golden, oracle, seed, Rust crate, frozen package or core-wasm source changed since the base.
|
||||
CHECK: n=$(git status --porcelain -- apps/app/tests/fixtures crates supabase packages | wc -l); m=$(git diff --stat 9464651 -- apps/app/tests/fixtures crates supabase packages | wc -l); [ "$n" = 0 ] && [ "$m" = 0 ] && echo FROZEN_OK
|
||||
EXPECT: FROZEN_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: FROZEN_OK
|
||||
5. Rescue copy: a JSON copy (downloaded format, `JSON.stringify(report)`) imported from Home reopens a report deep-equal to the original for the three golden reports, routed by content from the first KiB (also without a .json name; never reading a whole over-cap file); a PDF still goes the PDF path; invalid JSON, unsupported version, lone surrogate, invalid UTF-8 and over-cap (> MAX_ATTACHMENT_BYTES) files → `home.import.error_invalid_copy` with store and session slots untouched and no held side effect; non-content core kinds → the engine message path. Tested.
|
||||
6. Trapping draft: with a real poisoning runtime, the editor shows the resolution panel (engine_failure row + engine notice, never CoreUnavailable while the engine is not stopped); New report and Import show `session.held_blocked_engine` then the panel; the trapping (draft, archive) pair is not re-read by mount, New report, Import or remount (one trap total) — only the panel's Retry re-reads it; discard after confirmation removes only that text and clears the memory (draft or archive row); draft and archive are otherwise untouched. Tested.
|
||||
7. Replace confirmation: New report submit and Home file pick show ReplaceSessionDialog when a report is in memory or a draft is in the slot (named / unloaded / unsaved-with-copy variants); Annuler changes nothing; Ouvrir le bilan en cours → /editor; Remplacer proceeds (Home: picker opened inside the same click handler); an animal name containing `$&` renders literally; no dialog when nothing is in progress. Tested.
|
||||
8. Guard: unsaved → beforeunload prevented on every page (hook test + App mounts it), saved → not prevented. Tested.
|
||||
9. Existing suites adapted without weakening assertions (coreStopped New report tests, heldSession New report over a draft, state.quarantine `internal` → engine_failure); BDR-055's `internal` clause superseded consistently in code, tests, RUST.md §8.3 / §8.7 / §9.4, CHANGELOG and CLAUDE.md folder list.
|
||||
10. No merge, no R4, no release, no deploy, no change outside FILE SCOPE.
|
||||
|
||||
## FILE SCOPE
|
||||
apps/app/src/app/{App.tsx,useUnsavedGuard.ts (new)}, apps/app/src/app/routes/{HomeRoute,NewReportRoute,EditorRoute}.tsx,
|
||||
apps/app/src/state/reportStore.ts, apps/app/src/pdf/import.ts,
|
||||
apps/app/src/components/report/{HeldSessionPanel.tsx,CoreStoppedNotice.tsx,ReplaceSessionDialog.tsx (new)},
|
||||
apps/app/src/i18n/{fr,en}.ts, apps/app/tests/unit/** , apps/app/tests/helpers/**,
|
||||
docs/development/RUST.md, CHANGELOG.md, CLAUDE.md (folder list only)
|
||||
Reference in new issue
Block a user