v3 : relecture de cd7e683 — coquilles, objections et retraits
ci/woodpecker/push/app Pipeline was successful
ci/woodpecker/push/maquette Pipeline was successful

- Le revirement de l'auteur sur une coquille (reprendre une correction appliquée,
  valider une correction refusée) ne s'écrit que sur une version encore ouverte :
  Settle porte while_open ; et la garde de statut de write_text marche enfin
  (?9 restait NULL, le statut est le 8e paramètre).
- 0008 lève les signalements debout dont un côté est déjà retiré.
- Une seule objection debout par personne et par paire (index unique partiel) ;
  envoyée plusieurs fois à la fois, les autres reçoivent objection_exists.
- Un retrait relance l'adoption : la version que l'objection retenait entre aussitôt.

Tests vus rouges d'abord. Boucle : 230 tests Rust, svelte-check 0, 55 vitest,
e2e 35 / 35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-10-31 10:00:29 +01:00
co-authored by Claude Opus 5.5
parent 033b331228
commit 4d4adcc281
8 changed files with 220 additions and 20 deletions
@@ -24,6 +24,14 @@ UPDATE signals SET phase = 'lifted', lift = CASE
ELSE 'admin' END
WHERE lifted_at IS NOT NULL;
-- A standing one whose other side left (withdrawn, or never submitted) ends: a
-- withdrawal ends the objection, which the rule of before did not do.
UPDATE signals SET phase = 'lifted', lift = 'withdrawn', lifted_by = 'withdrawn',
lifted_at = strftime('%Y-%m-%dT%H:%M:%SZ', 'now')
WHERE lifted_at IS NULL AND EXISTS (
SELECT 1 FROM proposals p
WHERE p.id IN (signals.proposal_id, signals.target_proposal_id) AND p.status NOT IN ('open', 'in_force'));
-- The standing ones wait for the author of the version they now hold back: the
-- latest arrival of the two (submitted last; the same instant: written last),
-- unless it is in force — then the other. Both in force: none is held.
@@ -41,6 +49,11 @@ UPDATE signals SET held_id = (
CREATE INDEX signals_proposal ON signals(proposal_id);
CREATE INDEX signals_target ON signals(target_proposal_id);
CREATE INDEX signals_due ON signals(phase, due_at);
-- One person, one standing objection on a pair, whichever way it was written
-- (relecture of cd7e683: sent four times at once, four stood).
CREATE UNIQUE INDEX signals_one_standing
ON signals(author_id, min(proposal_id, target_proposal_id), max(proposal_id, target_proposal_id))
WHERE lifted_at IS NULL;
-- A proposal written to answer an objection (« modifier l'article visé »).
ALTER TABLE proposals ADD COLUMN objection_id TEXT;