chore(chore): R2 maintenance verify contract
This commit is contained in:
1 parent
3be827b02e
commit
eb741b62a6
1 file changed
+46
@@ -0,0 +1,46 @@
|
||||
# CONTRACT — R2 maintenance: rustls bump, session texts never overwritten, Supabase temp untracked
|
||||
- date: 2026-10-14 | flow: ad-hoc maintenance branch, verifier gate | branch: bugfix/r2-maintenance
|
||||
- status: dispatched after the code, test and doc commits
|
||||
- spec: owner brief 2026-10-14 §1 (A rustls, B full browser storage, C supabase/.temp) + owner answers 2026-10-14: B interface = resolution panel (download exact copy, delete permanently with confirmation, open adapted version with confirmation, retry; New report / Import refused while held, alert then panel), set-aside texts interface = follow-up (not in scope), refused draft write = storage-full banner in the editor
|
||||
- diff range: develop..HEAD (run every CHECK from the repository root; `. scripts/rust-env.sh` first for cargo)
|
||||
|
||||
## REQUEST (IMMUTABLE)
|
||||
A. Update rustls to a compatible version fixing the relevant RustSec advisories; check advisories, the dependency graph and behaviour changes; rerun Rust tests, worker tests and e2e:avatar; do not change the worker's network architecture without demonstrated need.
|
||||
B. Fix the case where an unreadable archive or draft cannot be quarantined for lack of space. Mandatory rule: no existing user data is deleted or overwritten implicitly when a save or quarantine operation fails. If quarantine is impossible: keep the original content in place while it is accessible; refuse the destructive operation that could replace it; show an understandable message; provide explicit resolution or abandonment by the user, with confirmation before permanent deletion; never empty browser storage automatically; never modify or delete other data without authorisation. Add tests covering quota errors, refused writes, corrupted data and later actions likely to overwrite the data. Targeted fix; significant interface change presented first (done: owner chose the panel).
|
||||
C. Remove `supabase/.temp/cli-latest` from git tracking while keeping the local copy; add the relevant .gitignore rules so Supabase temporary files are not tracked again; do not delete files needed for migrations or reproducibility.
|
||||
Document the fixes briefly.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. rustls is at 0.23.46 or later in the lock and the RustSec advisories check is clean.
|
||||
CHECK: grep -A1 'name = "rustls"' Cargo.lock | tail -1; . scripts/rust-env.sh && cargo deny check advisories 2>&1 | tail -1
|
||||
EXPECT: version = "0.23.46" (or later 0.23.x) / advisories ok
|
||||
2. Only the rustls entry changed in Cargo.lock and no Cargo.toml changed (worker network architecture untouched).
|
||||
CHECK: git diff develop..HEAD -- Cargo.lock | grep -E '^[+-][^+-]' ; git diff --stat develop..HEAD -- '*.toml' | wc -l
|
||||
EXPECT: exactly the two lines version 0.23.45→0.23.46 and the two checksum lines / 0
|
||||
3. The native Rust gate is green.
|
||||
CHECK: bash scripts/rust-check.sh > /tmp/maint-verify-rust.log 2>&1; echo "exit $?"
|
||||
EXPECT: exit 0
|
||||
4. `supabase/.temp` is untracked, the local copy is still on disk and is ignored.
|
||||
CHECK: git ls-files supabase/.temp | wc -l; test -f supabase/.temp/cli-latest && echo present; git check-ignore supabase/.temp/cli-latest
|
||||
EXPECT: 0 / present / supabase/.temp/cli-latest
|
||||
5. No migration, seed or test fixture changed in the range.
|
||||
CHECK: git diff --stat develop..HEAD -- supabase/migrations supabase/seed supabase/tests apps/app/tests/fixtures packages crates | wc -l
|
||||
EXPECT: 0
|
||||
6. The old "kept but unblocked" result is gone; a quarantine slot holding another text is never replaced; the draft mirror reacts to report changes only; both session edges (new report, import) go through the guard.
|
||||
CHECK: grep -rn "unreadable_kept" apps packages --include=*.ts --include=*.tsx | wc -l; grep -c "current !== null) return 'refused'" apps/app/src/state/persistence.ts; grep -c "state.report === prev.report" apps/app/src/state/reportStore.ts; grep -c "mayStartSession(index)" apps/app/src/state/reportStore.ts
|
||||
EXPECT: 0 / 1 / 1 / 2
|
||||
7. A held text is removed only from the confirmation of the panel.
|
||||
CHECK: grep -c "onDiscard(pending.text)" apps/app/src/components/report/HeldSessionPanel.tsx; grep -rn "discardSessionText\|removeSessionText" apps/app/src --include=*.ts --include=*.tsx | grep -v "^apps/app/src/state/" | wc -l
|
||||
EXPECT: 1 / 1 (the editor's onDiscard handler)
|
||||
8. The new strings exist in both dictionaries (19 `session.held*` keys + `editor.save_failed`), no em-dash in them.
|
||||
CHECK: printf "%s/%s\n" $(grep -c "^ 'session.held" apps/app/src/i18n/fr.ts) $(grep -c "^ 'session.held" apps/app/src/i18n/en.ts); grep -c "'editor.save_failed'" apps/app/src/i18n/fr.ts apps/app/src/i18n/en.ts; grep -A1 "'session.held\|'editor.save_failed'" apps/app/src/i18n/fr.ts apps/app/src/i18n/en.ts | grep -c "—"
|
||||
EXPECT: 19/19 / fr.ts:1 en.ts:1 / 0
|
||||
9. The tests cover quota errors, refused writes, an occupied slot, corrupted data (non-JSON, unknown version, lone surrogate), the pair rollback, the pre-rebase original, an orphan archive, later overwriting actions (new report, import, reset, unrelated store changes) and the panel flows.
|
||||
CHECK: grep -cE "^\s+it\(" apps/app/tests/unit/state.heldSession.test.ts apps/app/tests/unit/routes.heldSession.test.tsx; grep -c "expectEveryLaterActionRefused(before)" apps/app/tests/unit/state.heldSession.test.ts
|
||||
EXPECT: state.heldSession.test.ts:19 routes.heldSession.test.tsx:6 / ≥ 6
|
||||
10. The Node gate is green on the rebuilt module (typecheck, every suite, lint 0 warnings, build), the app at 345 tests.
|
||||
CHECK: bash scripts/wasm-build.sh > /dev/null 2>&1; ./node_modules/.bin/pnpm check > /tmp/maint-verify-check.log 2>&1; echo "exit $?"; grep "apps/app test:run: Tests" /tmp/maint-verify-check.log
|
||||
EXPECT: exit 0 / Tests 345 passed (345)
|
||||
11. The fixes are documented.
|
||||
CHECK: grep -c "maintenance after R2" CHANGELOG.md; grep -c "maintenance B" docs/development/RUST.md
|
||||
EXPECT: 2 / ≥ 2
|
||||
Reference in new issue
Block a user