Compare commits
559
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
826e5fbcaa | ||
|
|
6211046537 | ||
|
|
ba8e766fe8 | ||
|
|
463e0a2621 | ||
|
|
e01d8519ea | ||
|
|
44de465c6d | ||
|
|
91e94952f0 | ||
|
|
2882821661 | ||
|
|
8cd1bda6c2 | ||
|
|
9d03e0675c | ||
|
|
7a45f1d885 | ||
|
|
1deb037fac | ||
|
|
b2d78f9621 | ||
|
|
35e4a4c75a | ||
|
|
08d266c89f | ||
|
|
5ca2b7e3ad | ||
|
|
56c75b12ef | ||
|
|
838ae42a51 | ||
|
|
8c5a8871e5 | ||
|
|
31d0c415ec | ||
|
|
6de5e56e33 | ||
|
|
29073a956b | ||
|
|
272a7b54e4 | ||
|
|
8bdb23ab0f | ||
|
|
bc19481b93 | ||
|
|
c42c65509b | ||
|
|
b6408f177f | ||
|
|
8224edad65 | ||
|
|
fbf5a0e096 | ||
|
|
2c9d837e7b | ||
|
|
83f2d8bede | ||
|
|
04b723cc54 | ||
|
|
e79118cecf | ||
|
|
3bea19f16b | ||
|
|
1e5058577f | ||
|
|
2930f4919f | ||
|
|
b378cf066f | ||
|
|
4a7919c763 | ||
|
|
e1cdd9d25c | ||
|
|
dadd8e5d29 | ||
|
|
6ad8d8347c | ||
|
|
f061111e25 | ||
|
|
7575c67c47 | ||
|
|
b895ecf136 | ||
|
|
dc67c4aaca | ||
|
|
5774d52144 | ||
|
|
a50796b89f | ||
|
|
ca701787ce | ||
|
|
7a129dc763 | ||
|
|
c25a994c0e | ||
|
|
d3b8292aaf | ||
|
|
6d2ba0dbf2 | ||
|
|
9efc7b7647 | ||
|
|
5014a45053 | ||
|
|
a8ab6689e8 | ||
|
|
bcdacbbb9a | ||
|
|
ea5512af02 | ||
|
|
8bb2486a34 | ||
|
|
1758276087 | ||
|
|
374e300895 | ||
|
|
72ec758278 | ||
|
|
b9e5d32918 | ||
|
|
a86020d6e3 | ||
|
|
73ed37546f | ||
|
|
1adb19b479 | ||
|
|
b4a5254068 | ||
|
|
2326e1cb15 | ||
|
|
de2424f519 | ||
|
|
856667d070 | ||
|
|
423125c18f | ||
|
|
a950e403c2 | ||
|
|
f3b58abe70 | ||
|
|
d5852f5f8e | ||
|
|
d9a5846d0d | ||
|
|
f5e92dc5a9 | ||
|
|
2bf219f2f4 | ||
|
|
21c9a81e0c | ||
|
|
f3712b2baa | ||
|
|
a76a54dbb7 | ||
|
|
e3495df088 | ||
|
|
2277e41b09 | ||
|
|
98178dea26 | ||
|
|
4942be4336 | ||
|
|
54e09a76ce | ||
|
|
55f1abc6c8 | ||
|
|
6de88bbb7c | ||
|
|
8681e66ec9 | ||
|
|
52d5613fe5 | ||
|
|
3e94f732c7 | ||
|
|
c93787c947 | ||
|
|
ee7912768c | ||
|
|
1d119c3684 | ||
|
|
70eb2fcbb4 | ||
|
|
8c3fcca0b9 | ||
|
|
240c2ba0e7 | ||
|
|
ae02f48853 | ||
|
|
ebd1d6ddbe | ||
|
|
5059641c04 | ||
|
|
6c0f913104 | ||
|
|
7a5684aace | ||
|
|
82bdf8de71 | ||
|
|
11c2b0c5ee | ||
|
|
8c420d4b53 | ||
|
|
2579d4c7ae | ||
|
|
3dc5820e3a | ||
|
|
d9dbcf1609 | ||
|
|
da755f9768 | ||
|
|
2c4c771269 | ||
|
|
abc781df52 | ||
|
|
ff21b0315e | ||
|
|
b41c24b29d | ||
|
|
be0f6d8beb | ||
|
|
ee86a3a659 | ||
|
|
f8be0ad01a | ||
|
|
50256b19f1 | ||
|
|
96e301ab69 | ||
|
|
254ad2b4aa | ||
|
|
55608b2200 | ||
|
|
ec314af009 | ||
|
|
0ea94602d1 | ||
|
|
dca80cb006 | ||
|
|
bb35e86dbb | ||
|
|
08fab77d0e | ||
|
|
28e298ac56 | ||
|
|
7ecaf1998e | ||
|
|
2ad720b34e | ||
|
|
526aecb40e | ||
|
|
685a96741b | ||
|
|
791fc03a0d | ||
|
|
579d8afff4 | ||
|
|
07bebbc855 | ||
|
|
4018344ffc | ||
|
|
085c56877c | ||
|
|
270444e2ec | ||
|
|
f0e49fd447 | ||
|
|
afc1051313 | ||
|
|
3a7ffa2f8b | ||
|
|
021685f6b3 | ||
|
|
baae13ce3a | ||
|
|
d6e501ef04 | ||
|
|
6bf9290da7 | ||
|
|
ce171427c0 | ||
|
|
89acdfd4fd | ||
|
|
dfc8965844 | ||
|
|
ca5804a8b7 | ||
|
|
8a60128311 | ||
|
|
3bb3603115 | ||
|
|
8b42816270 | ||
|
|
7a64daf251 | ||
|
|
8031e0078f | ||
|
|
e2d020bd3d | ||
|
|
af300de04c | ||
|
|
20905adf72 | ||
|
|
b703333b20 | ||
|
|
c893dec60b | ||
|
|
4731a3376a | ||
|
|
18085cecf8 | ||
|
|
8e4f02620a | ||
|
|
792394d3b2 | ||
|
|
69e225ca7a | ||
|
|
553a0e57b2 | ||
|
|
36c6eb3fea | ||
|
|
538ce275ce | ||
|
|
cb1ad47cb0 | ||
|
|
58228ab522 | ||
|
|
346a8fd8f1 | ||
|
|
94f8a8bf27 | ||
|
|
78fb2d076e | ||
|
|
c0da36da36 | ||
|
|
b919cf8522 | ||
|
|
f7f0aa675d | ||
|
|
776692922e | ||
|
|
817f74ba18 | ||
|
|
969a5f360f | ||
|
|
b1fd8962ff | ||
|
|
c8109af719 | ||
|
|
d1779928a9 | ||
|
|
1e19479853 | ||
|
|
3303530717 | ||
|
|
52aac41472 | ||
|
|
cd47979352 | ||
|
|
1bf27014b3 | ||
|
|
2182307c62 | ||
|
|
4b7d2542fd | ||
|
|
8db6f4287f | ||
|
|
3baac4dbb5 | ||
|
|
c21995b3fb | ||
|
|
4499bc740c | ||
|
|
fc3fec7654 | ||
|
|
65a8fd37b8 | ||
|
|
49867bad19 | ||
|
|
f078b1eb96 | ||
|
|
f873e06413 | ||
|
|
2cdee42fe1 | ||
|
|
da298cfab1 | ||
|
|
ebd0cce80d | ||
|
|
a1d4084011 | ||
|
|
c54ba5d62f | ||
|
|
dca33b0047 | ||
|
|
00936c8c54 | ||
|
|
927537b343 | ||
|
|
9f092ec1e2 | ||
|
|
17c21a62cc | ||
|
|
9852e4e5bc | ||
|
|
6ef5223f0e | ||
|
|
b8dda1bc9e | ||
|
|
58d432d953 | ||
|
|
a180b9e291 | ||
|
|
9807ed217a | ||
|
|
6ed90efb3a | ||
|
|
132756eecd | ||
|
|
90a5e7aa35 | ||
|
|
0d1edac39a | ||
|
|
0849e54bc0 | ||
|
|
2327d61d8e | ||
|
|
ab823f4191 | ||
|
|
a1ee194725 | ||
|
|
bbdfd27311 | ||
|
|
bbb1668406 | ||
|
|
7dda61d2ae | ||
|
|
5803854860 | ||
|
|
4923edefc0 | ||
|
|
541706cba9 | ||
|
|
7a6eccf824 | ||
|
|
3189a1917d | ||
|
|
45d74536f5 | ||
|
|
0573d66864 | ||
|
|
6ceced5c06 | ||
|
|
5f63d2229c | ||
|
|
c6c984b954 | ||
|
|
255dd67f2c | ||
|
|
953ae41b86 | ||
|
|
f2cbf6814f | ||
|
|
d3bdbbe0ba | ||
|
|
a78da9f4e2 | ||
|
|
f7bf0c85cb | ||
|
|
3b687a218e | ||
|
|
b85614aa09 | ||
|
|
1a7b952f2f | ||
|
|
9f60d841eb | ||
|
|
60087bab30 | ||
|
|
b682f78209 | ||
|
|
b215b89cf9 | ||
|
|
9bfc5a1567 | ||
|
|
a8c9b8377e | ||
|
|
9e676bb811 | ||
|
|
45f1cce460 | ||
|
|
84aba41b7d | ||
|
|
95009069ca | ||
|
|
3d64146164 | ||
|
|
8cb681e2fa | ||
|
|
b1045088c5 | ||
|
|
da95b846e4 | ||
|
|
0467885527 | ||
|
|
942d52a835 | ||
|
|
81fba4631a | ||
|
|
606f7ba268 | ||
|
|
a474ddaa40 | ||
|
|
0bb150f860 | ||
|
|
9c03cf2413 | ||
|
|
23900f31d9 | ||
|
|
925d843521 | ||
|
|
62fb8dc7b8 | ||
|
|
580ff28214 | ||
|
|
89da8d3f55 | ||
|
|
99b669bf8f | ||
|
|
ab51ea764d | ||
|
|
cf9c300c80 | ||
|
|
7cca88592f | ||
|
|
6131225288 | ||
|
|
51fd3db608 | ||
|
|
c57af6441f | ||
|
|
9d89daed19 | ||
|
|
79a09f8b25 | ||
|
|
6689827a8d | ||
|
|
ca184da4d9 | ||
|
|
bc2dba7c14 | ||
|
|
95b1b7e461 | ||
|
|
9ec232ac22 | ||
|
|
2c8b606be3 | ||
|
|
c834fe933a | ||
|
|
4692b27959 | ||
|
|
049d5146b4 | ||
|
|
10fb2d84d4 | ||
|
|
ed6fb0d313 | ||
|
|
1ed5c96e1b | ||
|
|
7defed1c55 | ||
|
|
13dee0908b | ||
|
|
a43145a03f | ||
|
|
604f502b44 | ||
|
|
567da677d7 | ||
|
|
00aaccfc79 | ||
|
|
212126c6ce | ||
|
|
2e46c14697 | ||
|
|
846994b4ab | ||
|
|
439cabd09e | ||
|
|
452a346f17 | ||
|
|
d9e3e34aff | ||
|
|
a505b24bfd | ||
|
|
bd444d6906 | ||
|
|
e10f167a6d | ||
|
|
871c8a6b45 | ||
|
|
14fb527552 | ||
|
|
f58cf2308f | ||
|
|
d11cb5a44b | ||
|
|
b5058b3417 | ||
|
|
7bc3d6544e | ||
|
|
7722433a1c | ||
|
|
d21ffcc5dc | ||
|
|
9f420d329d | ||
|
|
46ea996a61 | ||
|
|
37c9fdf6eb | ||
|
|
9b86f54336 | ||
|
|
70c34bff5e | ||
|
|
9e68bdd1fa | ||
|
|
fe724b263e | ||
|
|
72b742f9d3 | ||
|
|
b2941ebcb2 | ||
|
|
5a3ed97d7c | ||
|
|
8531dd30d8 | ||
|
|
671a1bde40 | ||
|
|
be1a5c0173 | ||
|
|
5207f87e66 | ||
|
|
060ee50464 | ||
|
|
fb95255759 | ||
|
|
25bdac4dd7 | ||
|
|
2057b0ecbb | ||
|
|
d74c54ed05 | ||
|
|
a69eba569b | ||
|
|
f1175bb3a1 | ||
|
|
924930a098 | ||
|
|
c2237a2f2f | ||
|
|
a09e24d952 | ||
|
|
57a0690d7b | ||
|
|
6f0fa41c29 | ||
|
|
5e0aa625a8 | ||
|
|
6471b25812 | ||
|
|
c5fd3c3df6 | ||
|
|
086d6e939b | ||
|
|
46fd861224 | ||
|
|
9c21fd3f86 | ||
|
|
3776a33b79 | ||
|
|
4ab85adeb0 | ||
|
|
bd4ba338af | ||
|
|
8b6adcb7df | ||
|
|
be4f468790 | ||
|
|
b42c6ae844 | ||
|
|
18d8863c74 | ||
|
|
67480b2fc2 | ||
|
|
283e459077 | ||
|
|
7a4ce9eb58 | ||
|
|
2b10471b0a | ||
|
|
697cefa2dd | ||
|
|
3831a49f46 | ||
|
|
5bd12261a5 | ||
|
|
05c9b3e10b | ||
|
|
5979cd59ec | ||
|
|
0764eb122b | ||
|
|
653706fad5 | ||
|
|
d10ba5d5dd | ||
|
|
9ba6d2b66c | ||
|
|
f73980c952 | ||
|
|
071b58a5f6 | ||
|
|
de644925e9 | ||
|
|
4cc27a8231 | ||
|
|
bb99edd2dd | ||
|
|
0d167df271 | ||
|
|
5097fd7484 | ||
|
|
7bbd096a16 | ||
|
|
ac5fbfbc44 | ||
|
|
aa5c10d73c | ||
|
|
3d589e1556 | ||
|
|
4f223e04cd | ||
|
|
2a54fa4c78 | ||
|
|
b4eddee7a3 | ||
|
|
3f15762d95 | ||
|
|
447d0a4272 | ||
|
|
877bad0021 | ||
|
|
91d06c9817 | ||
|
|
26097852ff | ||
|
|
92c595caa1 | ||
|
|
66663dc0ca | ||
|
|
7ea9619aa0 | ||
|
|
1bbf97e65b | ||
|
|
7bf1404946 | ||
|
|
8343528be9 | ||
|
|
d163b2ce9a | ||
|
|
6aba9711f0 | ||
|
|
b14509f221 | ||
|
|
7f1d44065b | ||
|
|
f7e7bf4ee1 | ||
|
|
cfd49c7b5b | ||
|
|
bc43a1b86b | ||
|
|
173be5949a | ||
|
|
2f824a947c | ||
|
|
2571978780 | ||
|
|
f34381c242 | ||
|
|
ee6decbe4e | ||
|
|
4657abf1e3 | ||
|
|
7f618d05a2 | ||
|
|
b4415a382f | ||
|
|
431999e45c | ||
|
|
f5456f330d | ||
|
|
dcb1a94ee4 | ||
|
|
0499a39389 | ||
|
|
51225cacf6 | ||
|
|
4111efa1d1 | ||
|
|
14ff890761 | ||
|
|
5db85ff19f | ||
|
|
cea0f1cfec | ||
|
|
e39f69ee6d | ||
|
|
f04bfdd040 | ||
|
|
02625a76b6 | ||
|
|
3d2b5a5f1c | ||
|
|
c12702bac1 | ||
|
|
4f6c0ba407 | ||
|
|
a897dd8876 | ||
|
|
d6a772818e | ||
|
|
ff9d5c4a3d | ||
|
|
0176b3184d | ||
|
|
9f7824dc08 | ||
|
|
ffefb91204 | ||
|
|
4744e28986 | ||
|
|
99488d71d9 | ||
|
|
c9ace9aff2 | ||
|
|
a79e1f0af7 | ||
|
|
bbab0e61cb | ||
|
|
b0a4cbe588 | ||
|
|
78791bfb6b | ||
|
|
a701b04210 | ||
|
|
3d80812cdb | ||
|
|
994b04ee73 | ||
|
|
410025715c | ||
|
|
567f27e37d | ||
|
|
74aa8f6099 | ||
|
|
27e5727cca | ||
|
|
c2a3147293 | ||
|
|
f9fc13c110 | ||
|
|
9adbd3ac34 | ||
|
|
fdf0f7f023 | ||
|
|
7979506f35 | ||
|
|
1a68cd8351 | ||
|
|
98e8403f8b | ||
|
|
a15c35ca66 | ||
|
|
c434e0e944 | ||
|
|
108604acf4 | ||
|
|
ab9cb8d5f3 | ||
|
|
09595ed977 | ||
|
|
bbc0627f8a | ||
|
|
8191e3a42c | ||
|
|
34a49f5769 | ||
|
|
9c4603755e | ||
|
|
53cedf2499 | ||
|
|
f00d8b4e4c | ||
|
|
8db62b43e2 | ||
|
|
f924ad056d | ||
|
|
57b93afae6 | ||
|
|
093083da07 | ||
|
|
bb8acbe663 | ||
|
|
3c141c942b | ||
|
|
2762ad2aba | ||
|
|
a5844b9d56 | ||
|
|
c98a9c8f82 | ||
|
|
e4c8e2aac3 | ||
|
|
efc9bedd9c | ||
|
|
cdd43ac431 | ||
|
|
26e4b1b0ee | ||
|
|
550a785c38 | ||
|
|
bd65b81c41 | ||
|
|
ff1b4959d7 | ||
|
|
3bfd6c87aa | ||
|
|
5adad3709f | ||
|
|
e967ce6736 | ||
|
|
a6de7d6b94 | ||
|
|
2a84e3702e | ||
|
|
96b19e5a87 | ||
|
|
6b40a00477 | ||
|
|
a48aaf7499 | ||
|
|
eb94b1b309 | ||
|
|
6aa85fe7e4 | ||
|
|
7043d39ae0 | ||
|
|
5afb34ed0f | ||
|
|
13fe98ca0d | ||
|
|
31fbb0317f | ||
|
|
345dde59e6 | ||
|
|
1cd4344363 | ||
|
|
1593305875 | ||
|
|
5eca08688a | ||
|
|
0edef2f66d | ||
|
|
e190dfc794 | ||
|
|
c73415abef | ||
|
|
86dce16b09 | ||
|
|
03be75beed | ||
|
|
8dd2d78d38 | ||
|
|
de2dfb392e | ||
|
|
76ead9567c | ||
|
|
96b99784b5 | ||
|
|
9c606aa567 | ||
|
|
e67715025c | ||
|
|
4f52f5e1c4 | ||
|
|
f1bb19b30b | ||
|
|
9e49ed1b4d | ||
|
|
587cbb2b5d | ||
|
|
faa53c7956 | ||
|
|
0c87c7f6c3 | ||
|
|
958228a9de | ||
|
|
a095ea0e1b | ||
|
|
d8562f60f5 | ||
|
|
81f7639c75 | ||
|
|
6ed4d21eb3 | ||
|
|
08efd9a792 | ||
|
|
2f1f0764bf | ||
|
|
f976f33307 | ||
|
|
7d9ab8cf2f | ||
|
|
98060d74a3 | ||
|
|
05de816962 | ||
|
|
f1ef6a466f | ||
|
|
a678faaa23 | ||
|
|
5281337412 | ||
|
|
93e4e81bda | ||
|
|
661212a852 | ||
|
|
bb5efa0f00 | ||
|
|
e823655f09 | ||
|
|
17d919971e | ||
|
|
ca31b787b6 | ||
|
|
8294d5471c | ||
|
|
741c25c464 | ||
|
|
8ae756534c | ||
|
|
cf37aa265a | ||
|
|
64a43840ce | ||
|
|
ac71c5b662 | ||
|
|
532c61e087 | ||
|
|
9350366913 | ||
|
|
1f9fa8b835 | ||
|
|
2379d28d9b | ||
|
|
f9e40ba6aa | ||
|
|
538d10369f | ||
|
|
7c4bf124f4 | ||
|
|
5620399492 | ||
|
|
3eba6d89b2 | ||
|
|
12816671e4 | ||
|
|
7eca44167b | ||
|
|
b1de87b5d0 | ||
|
|
2af61e72cc | ||
|
|
b9470b4d2d | ||
|
|
f80f325fd6 | ||
|
|
961995804a | ||
|
|
4a829416c6 | ||
|
|
a21866e25c | ||
|
|
ef1f4b593f | ||
|
|
d05f75da84 | ||
|
|
3914eaa866 | ||
|
|
77e5fa4cf5 | ||
|
|
9c13bae4bc | ||
|
|
41d3b09120 | ||
|
|
7fec2ce86f | ||
|
|
397d6007b4 | ||
|
|
78636d0bd5 | ||
|
|
9135d73cfa |
No files matched your search
@@ -0,0 +1,161 @@
|
||||
# V1-2.1 corrections after the independent audit: evidence
|
||||
|
||||
Owner brief 2026-10-28 « V1-2.1 : corrections après audit indépendant » (verdict CHANGES
|
||||
REQUIRED on 3914eaa). Every run below used the isolated `pnpm db:sandbox` stack only
|
||||
(containers `faunosteo_dbsandbox_*`, ports 57xxx); DEV was not read or written.
|
||||
|
||||
## 1. Defects F1-F19 on the old schema (before M4)
|
||||
|
||||
Script `2026-10-28-v1-2-1-repro-old-schema.sql` (one rolled-back transaction) on a sandbox of
|
||||
the 12 base migrations of develop, run during the first V1-2.1 pass. Output:
|
||||
|
||||
```
|
||||
F1 plain account created a personal PUBLIC sheet for species other
|
||||
F5 an account with an UNCONFIRMED email created a sheet
|
||||
F6 set_sheet_visibility changes visibility with no gate
|
||||
F15 another plain account reads the public personal sheet: 1 row
|
||||
F9 editor rewrote draft content / renamed the sheet by direct UPDATE
|
||||
F4 version published with a drawing never confirmed
|
||||
F2 the draft of an ARCHIVED sheet was published; create_sheet_draft opened a draft on it
|
||||
F8 after archiving, another account reads 0 published versions
|
||||
F13 a DEPRECATED version was deleted physically
|
||||
F3 copied asset rows not confirmed
|
||||
F14 a platform admin at aal1 published an official sheet
|
||||
F19 grant_platform_role(owner) accepted at aal1; the new owner holds 0 verified factors
|
||||
F7 upload confirmed with no object in Storage
|
||||
F12 service_role published a draft by direct UPDATE
|
||||
F17 service_role inserted an owner row directly into profile_roles
|
||||
F16 sha256 of an asset used by a published version changed
|
||||
```
|
||||
|
||||
Re-run on 2026-10-28 for the final decisions pass, raw psql output committed as
|
||||
`2026-10-28-v1-2-1-repro-old-schema.out` (sandbox `up fresh` from a copy holding only the 12
|
||||
migrations before M4; the same NOTICE lines, `repro exit 0`, the transaction rolled back).
|
||||
|
||||
F18 (last-owner race) was reproduced with two sessions; its test is
|
||||
`packages/supabase/tests/sandbox/sheets.sandbox.ts`.
|
||||
|
||||
## 2. service_role effective table privileges (§16.2 prerequisite)
|
||||
|
||||
Measured on the M7 rehearsal stack (DEV path), before and after M4+M5:
|
||||
|
||||
- before: ALL (DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE) on
|
||||
`species`, `anatomical_sheets`, `anatomical_sheet_versions`, `anatomical_sheet_assets`,
|
||||
`profiles`, `profile_roles`;
|
||||
- after: none on those six tables (pgTAP 005 and 018 assert it, with the EXECUTE census).
|
||||
|
||||
## 3. New tests red on 3914eaa, green on the corrected HEAD
|
||||
|
||||
Stack built from the base migrations plus the M4/M5 of 3914eaa, then the new and changed
|
||||
files of this pass:
|
||||
|
||||
| File | On 3914eaa | On the corrected HEAD |
|
||||
|---|---|---|
|
||||
| 006 | 2 not ok: another editor uploads a pending key it did not register (L5) | 16/16 |
|
||||
| 016 | 1 not ok: a draft from a deprecated version takes it as base (M2) | 50/50 |
|
||||
| 017 | M1 approval on an archived sheet succeeds; M2 base from a deprecated version; the file aborts there | 85/85 (111/111 after the final decisions pass, §4) |
|
||||
| 018 | 93 not ok of 337: capability holders at aal1 get `rights.capability` instead of `rights.mfa` (§6.7); `delete_sheet_asset` answers a raw code | 337/337 |
|
||||
| 019 | 38/38 (lost coverage of behaviour that was already correct) | 38/38 |
|
||||
| sheets-concurrency | 5 failed of 15: publish against withdraw (no version lock), two deprecations (no sheet lock), archive against approve (no sheet lock) | 15/15 |
|
||||
|
||||
## 4. Real-stack results on the corrected HEAD
|
||||
|
||||
Final decisions pass (owner brief « V1-2.1 : décisions finales du propriétaire »), code at
|
||||
`2379d28` (M6 option A, text size measure with the bounded, linear number walk, pgTAP
|
||||
015/017/020; only `.claude/` differs at the final HEAD). Earlier figures (1 333 pgTAP) were the `2af61e7`
|
||||
state; intermediate passes at `7eca441` (1 352) and `5620399` (1 807) preceded the review findings below.
|
||||
|
||||
| Run | Fresh stack | Upgraded stack (M3 + Git fixture, then M4+M5) |
|
||||
|---|---|---|
|
||||
| pgTAP (`test-db`, 18 files) | 1 808/1 808 | 1 808/1 808 |
|
||||
| sandbox suite, run 1 | 87/87 | 87/87 |
|
||||
| sandbox suite, run 2 (same stack) | 87/87 | 87/87 |
|
||||
| of which two-session concurrency (`sheets-concurrency`) | 16/16 each run | 16/16 each run |
|
||||
| pgTAP again after both suite runs | 1 808/1 808 | 1 808/1 808 |
|
||||
| `types --check` | types match | types match |
|
||||
|
||||
PGlite: 128/128 (packages/supabase: the 18 pgTAP files and the closed-code census).
|
||||
|
||||
New in this pass:
|
||||
|
||||
- 017 M6: owner self-grants `sheet_reviewer`; owner-reviewer acknowledges and approves a version
|
||||
written by E, E publishes; owner refused on a round it authored (`review.separation`);
|
||||
publication after an author's approval refused (`publish.approval.invalid`).
|
||||
- 017 size: cap − 1 and cap saved and measured exactly; cap + 1 refused; a 2 MiB document of
|
||||
3-byte characters saved; cap + 1 in 4-byte characters refused; a dense document within the cap
|
||||
as text and over it as binary jsonb saved whole; creation over the cap refused; numbers that
|
||||
JavaScript prints with an exponent stored and measured in plain form; a document under the cap
|
||||
in compact JavaScript form but over it as measured refused; 9 000 numbers of 131 072 digits
|
||||
refused with the closed code; 600 000 small numbers within the cap saved (the number walk is
|
||||
linear); the table CHECK definition. Every refusal answers
|
||||
`document.too_large` (23514), never a raw error.
|
||||
- 017 `publish.species.other` refused alone.
|
||||
- 020 (449): the AR-1 B matrix of §15 in full (6 caller classes × aal1/aal2 × grant/revoke × 4
|
||||
roles × self/other, each refusal with « nothing written »), the regression chain on the real
|
||||
owner and admin at aal1, and the rights RPCs (`grant_catalog_right` on itself and on another,
|
||||
`revoke_catalog_right`, `lookup_catalog_account`, `list_catalog_grants`) refused to every
|
||||
non-owner class at aal2 (`rights.owner`) and at aal1 (`rights.mfa`).
|
||||
|
||||
Number walk, linear (security gate on `7c4bf12`: `jsonb_path_query` row by row is quadratic on
|
||||
PostgreSQL 17). Raw psql timings on the sandbox, committed as
|
||||
`2026-10-28-v1-2-1-number-walk.out` (one transaction ending in `rollback`; script in its header line below): row by row 138 / 506 / 2 172 ms for 50k /
|
||||
100k / 200k numbers; the shipped walk (one `jsonb_path_query_array` call) 69 / 135 / 267 / 421 ms
|
||||
for 100k / 200k / 400k / 600k. Over
|
||||
HTTP on both stacks, each run (lines extracted in `2026-10-28-v1-2-1-sandbox-timings.out`): 600 000 numbers (1 801 760 bytes of text) saved in 677-695 ms;
|
||||
1 000 000 numbers answered `document.too_large` in 1 019-1 078 ms (budget 2 000 ms).
|
||||
|
||||
Number bomb on the real image (sandbox, re-run on `2379d28`): the shipped function answers
|
||||
`document.too_large`; the same payload under the previous body (`octet_length(p_doc::text)`
|
||||
alone, rolled back) fails with `out of memory` after a 1 GiB buffer.
|
||||
|
||||
## 5. Timing at the caps (§15, budget 2 000 ms for save, submit, publish)
|
||||
|
||||
Synthetic document: 64 views, 1 024 annotations, 8 192 finding nodes (depth 8), 1 089 review
|
||||
groups, 4 drawings of 2 000 000 bytes. The labels are calibrated on the contract's text measure
|
||||
alone: text 2 076 707 bytes (cap 2 097 152), binary jsonb 2 346 648 bytes, over the cap and
|
||||
accepted, as the measure requires. HTTP wall-clock through PostgREST on the development machine,
|
||||
code `2379d28`, milliseconds (min / median / max):
|
||||
|
||||
| Stack, run | save (7) | submit (5) | approve (3) | publish (3) |
|
||||
|---|---|---|---|---|
|
||||
| fresh, 1 | 127 / 137 / 155 | 4 / 5 / 6 | 190 / 285 / 292 | 195 / 288 / 303 |
|
||||
| fresh, 2 | 130 / 142 / 155 | 4 / 7 / 13 | 196 / 284 / 297 | 205 / 302 / 306 |
|
||||
| upgraded, 1 | 135 / 139 / 148 | 5 / 6 / 6 | 192 / 282 / 294 | 196 / 292 / 296 |
|
||||
| upgraded, 2 | 127 / 137 / 151 | 5 / 5 / 7 | 199 / 286 / 295 | 220 / 292 / 299 |
|
||||
|
||||
The core's at-caps fixture is V1-2.2 work; the contract fixes the budgets at the V1-2.3
|
||||
checkpoint and measures verification (120 s) there.
|
||||
|
||||
## 6. M7: upgrade rehearsal with a Git fixture of the drawing object
|
||||
|
||||
Accepted by the owner for V1-2.1 (brief « V1-2.1 : décisions finales du propriétaire »,
|
||||
2026-10-28; contract §12.3, §17.3). What this rehearsal is, and is not:
|
||||
|
||||
- It uses a representative Git fixture, not a copy of the DEV object: the committed file
|
||||
`supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg` (132 997 bytes), whose sha256
|
||||
`0ea5202f…08541` equals the sha256 referenced by the DEV metadata (the asset row
|
||||
`7f767f74…` of the historical sheet, seeded from `equine_draft.sql`).
|
||||
- Its bytes, its Storage metadata and its relations (asset row, historical sheet, version) are
|
||||
compared before and after the migration.
|
||||
- No file was read from the real Storage of DEV, and nothing on DEV was read or written in
|
||||
V1-2.1. The current integrity of the live DEV object is therefore **not demonstrated**; it is
|
||||
checked when the owner applies M4 to M6 on DEV (contract §16.11).
|
||||
|
||||
DEV path: `up upgrade 20261028100000` from a copy whose migrations stop at M3, the fixture
|
||||
placed as the operator tool placed the drawing on DEV (service-key upload, pre-M4 confirmation
|
||||
RPC), then M4+M5 by `supabase migration up`.
|
||||
|
||||
- `storage.objects` row (id, owner, metadata, version, timestamps), the asset row, the
|
||||
historical sheet row and its version (content md5, updated_at): identical before and after.
|
||||
- Changed, as M4/M5 intend: bucket limit 20 971 520 → 2 097 152; service_role privileges
|
||||
ALL → none.
|
||||
- Bytes through the Storage API before and after: identical to the Git file.
|
||||
- After M4+M5, through the Storage API with real tokens: an editor at aal2 reads the 132 997
|
||||
bytes (sha256 equal to the key); the same editor at aal1, a catalogue reader and an anonymous
|
||||
caller are refused (the historical sheet has no published version).
|
||||
|
||||
The rehearsal is reproducible from the repository, re-run on `7eca441`, `5620399` and `2379d28` (final decisions pass)
|
||||
with the same results, the only diff lines being the bucket limit and the service_role
|
||||
privileges: `bash .claude/audits/2026-10-28-v1-2-1-m7/m7-rehearsal.sh [work dir]` (sandbox only; it applies
|
||||
M4+M5 with `supabase migration up --db-url` on the sandbox port, a step `scripts/db-sandbox.sh`
|
||||
has no subcommand for) and `m7-read.mjs` (the reads with real tokens).
|
||||
@@ -0,0 +1,66 @@
|
||||
// M7 rehearsal, after M4+M5: reads the historical drawing object through the
|
||||
// Storage API with real GoTrue tokens (sandbox only, ports 57xxx). An editor at
|
||||
// aal2 must get the exact bytes; a catalogue reader and an anonymous caller get
|
||||
// nothing (the historical sheet has no published version). Prints one JSON line.
|
||||
// Keys come from the environment (the sandbox secrets file), never argv.
|
||||
import { createHash, createHmac } from 'node:crypto'
|
||||
import { execFileSync } from 'node:child_process'
|
||||
|
||||
const AUTH = 'http://127.0.0.1:57999'
|
||||
const STORAGE = 'http://127.0.0.1:57500'
|
||||
const KEY = process.argv[2]
|
||||
const anon = process.env.SB_ANON_KEY
|
||||
const service = process.env.SB_SERVICE_KEY
|
||||
const psql = (script) => execFileSync('docker', ['exec', '-i', '-e', 'PGPASSWORD', 'faunosteo_dbsandbox_db', 'psql', '-X', '-q', '-t', '-A',
|
||||
'-h', '127.0.0.1', '-U', 'postgres', '-d', 'postgres', '-v', 'ON_ERROR_STOP=1'],
|
||||
{ input: script, env: { ...process.env, PGPASSWORD: process.env.SB_PW } }).toString().trim()
|
||||
|
||||
const json = async (res) => { const t = await res.text(); try { return JSON.parse(t) } catch { return t } }
|
||||
const auth = (path, body, bearer = anon) => fetch(AUTH + path, { method: 'POST',
|
||||
headers: { apikey: anon, Authorization: `Bearer ${bearer}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body) })
|
||||
|
||||
function base32(text) {
|
||||
const A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; const out = []; let buf = 0; let bits = 0
|
||||
for (const c of text.replace(/=+$/, '').toUpperCase()) { buf = (buf << 5) | A.indexOf(c); bits += 5; if (bits >= 8) { bits -= 8; out.push((buf >> bits) & 0xff) } }
|
||||
return Buffer.from(out)
|
||||
}
|
||||
function totp(secret) {
|
||||
const counter = Buffer.alloc(8); counter.writeBigUInt64BE(BigInt(Math.floor(Date.now() / 30000)))
|
||||
const mac = createHmac('sha1', base32(secret)).update(counter).digest(); const o = mac[mac.length - 1] & 0x0f
|
||||
return ((mac.readUInt32BE(o) & 0x7fffffff) % 1_000_000).toString().padStart(6, '0')
|
||||
}
|
||||
|
||||
async function account(tag) {
|
||||
const email = `m7-${tag}-${Date.now()}@sandbox.local`
|
||||
const user = await json(await auth('/admin/users', { email, password: 'Sandbox-only-pw-1', email_confirm: true }, service))
|
||||
const session = await json(await auth('/token?grant_type=password', { email, password: 'Sandbox-only-pw-1' }))
|
||||
return { id: user.id, token: session.access_token }
|
||||
}
|
||||
async function stepUp(token) {
|
||||
const call = (method, path, body) => fetch(AUTH + path, { method, headers: { apikey: anon, Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body) }).then(json)
|
||||
const factor = await call('POST', '/factors', { factor_type: 'totp', friendly_name: 'm7' })
|
||||
const challenge = await call('POST', `/factors/${factor.id}/challenge`, {})
|
||||
const verified = await call('POST', `/factors/${factor.id}/verify`, { challenge_id: challenge.id, code: totp(factor.totp.secret) })
|
||||
return verified.access_token
|
||||
}
|
||||
const read = async (token) => {
|
||||
const res = await fetch(`${STORAGE}/object/authenticated/anatomical-sheet-assets/${KEY}`, { headers: token ? { Authorization: `Bearer ${token}` } : {} })
|
||||
const bytes = Buffer.from(await res.arrayBuffer())
|
||||
return { status: res.status, bytes: res.ok ? bytes.length : 0, sha256: res.ok ? createHash('sha256').update(bytes).digest('hex') : null }
|
||||
}
|
||||
|
||||
const editor = await account('editor')
|
||||
const editorAal2 = await stepUp(editor.token)
|
||||
psql(`select private.assign_platform_role(null, '${editor.id}', 'admin');
|
||||
insert into public.anatomical_catalog_grants (user_id, grant_kind, reason, verification_note, granted_by)
|
||||
values ('${editor.id}', 'sheet_editor', 'm7 rehearsal', 'sandbox', '${editor.id}');`)
|
||||
const reader = await account('reader')
|
||||
psql(`insert into public.anatomical_catalog_grants (user_id, grant_kind, reason, granted_by)
|
||||
values ('${reader.id}', 'catalog_reader', 'm7 rehearsal', '${editor.id}');`)
|
||||
const result = {
|
||||
editor_aal2: await read(editorAal2),
|
||||
editor_aal1: await read(editor.token),
|
||||
reader: await read(reader.token),
|
||||
anonymous: await read(null),
|
||||
}
|
||||
console.log(JSON.stringify(result))
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env bash
|
||||
# M7 rehearsal on the isolated db:sandbox stack only (containers faunosteo_dbsandbox_*,
|
||||
# ports 57xxx; never the DEV stack). Builds the DEV state (migrations up to M3 through
|
||||
# `up upgrade`, seeds, GoTrue accounts), places the historical drawing object the way the
|
||||
# operator tool did on DEV (Git bytes, service-key upload, pre-M4 confirmation RPC),
|
||||
# snapshots bytes and metadata, applies M4+M5 with the CLI, snapshots again, compares.
|
||||
set -uo pipefail
|
||||
# Usage: bash .claude/audits/2026-10-28-v1-2-1-m7/m7-rehearsal.sh [work dir]
|
||||
# The work dir (default: a new mktemp directory) receives the base copy and the logs.
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
WT="$(cd "$HERE/../../.." && pwd)"
|
||||
WORK="${1:-$(mktemp -d)}"
|
||||
BASE=$WORK/base-$(date +%s)
|
||||
OUT=$WORK/logs
|
||||
STATE="$HOME/.cache/faunosteo-db-sandbox"
|
||||
mkdir -p "$OUT"
|
||||
|
||||
# 1. A scratch copy of the repository pieces db-sandbox.sh reads, migrations stopped at M3.
|
||||
mkdir "$BASE" # a new directory per run: nothing is ever deleted
|
||||
mkdir -p "$BASE/scripts" "$BASE/supabase/migrations"
|
||||
cp "$WT/scripts/db-sandbox.sh" "$WT/scripts/dev-env.sh" "$BASE/scripts/"
|
||||
cp "$WT/supabase/config.toml" "$WT/supabase/seed.sql" "$BASE/supabase/"
|
||||
ln -s "$WT/supabase/seed" "$BASE/supabase/seed"
|
||||
ln -s "$WT/node_modules" "$BASE/node_modules"
|
||||
for f in "$WT"/supabase/migrations/*.sql; do
|
||||
[ "$(basename "$f" | cut -d_ -f1)" \< 20261028100000 ] && cp "$f" "$BASE/supabase/migrations/"
|
||||
done
|
||||
ls "$BASE/supabase/migrations" > "$OUT/base-migrations.txt"
|
||||
|
||||
# 2. The DEV state: base migrations, seeds, the two GoTrue accounts.
|
||||
(cd "$WT" && bash scripts/db-sandbox.sh down >/dev/null)
|
||||
(cd "$BASE" && bash scripts/db-sandbox.sh up upgrade 20261028100000) > "$OUT/up-base.log" 2>&1
|
||||
set -a; . "$STATE/secrets.sh"; set +a
|
||||
export PGPASSWORD="$SB_PW"
|
||||
q() { docker exec -i -e PGPASSWORD faunosteo_dbsandbox_db psql -X -q -t -A -h 127.0.0.1 -U postgres -d postgres -v ON_ERROR_STOP=1; }
|
||||
|
||||
ASSET=7f767f74-3b36-51a7-8465-52dd7e2ead4a
|
||||
SVG="$WT/supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg"
|
||||
SHA=$(sha256sum "$SVG" | cut -d' ' -f1)
|
||||
KEY="$SHA.svg"
|
||||
echo "git file: $(stat -c %s "$SVG") bytes, sha256 $SHA" > "$OUT/fixture.txt"
|
||||
echo "row sha256: $(echo "select sha256 || ' ' || byte_size from public.anatomical_sheet_assets where id = '$ASSET'" | q)" >> "$OUT/fixture.txt"
|
||||
|
||||
# 3. The operator path of R5.5 on DEV: object written with the service key, row confirmed by the pre-M4 RPC.
|
||||
curl -sS -o "$OUT/upload.json" -w '%{http_code}\n' -X POST -H @"$STATE/service-header" -H 'Content-Type: image/svg+xml' \
|
||||
--data-binary @"$SVG" "http://127.0.0.1:57500/object/anatomical-sheet-assets/$KEY" > "$OUT/upload.status"
|
||||
curl -sS -o "$OUT/confirm.json" -w '%{http_code}\n' -X POST -H @"$STATE/service-header" -H 'Content-Type: application/json' \
|
||||
-d "{\"asset_id\":\"$ASSET\"}" "http://127.0.0.1:57300/rpc/confirm_sheet_asset_upload" > "$OUT/confirm.status"
|
||||
|
||||
snapshot() { # label
|
||||
{
|
||||
echo "== object row"
|
||||
echo "select row_to_json(o) from (select id, bucket_id, name, owner, owner_id, metadata, user_metadata, version, created_at, updated_at, last_accessed_at, path_tokens from storage.objects where bucket_id = 'anatomical-sheet-assets' and name = '$KEY') o" | q
|
||||
echo "== bucket"
|
||||
echo "select row_to_json(b) from (select id, public, file_size_limit, allowed_mime_types from storage.buckets where id = 'anatomical-sheet-assets') b" | q
|
||||
echo "== asset row"
|
||||
echo "select row_to_json(a) from (select * from public.anatomical_sheet_assets where id = '$ASSET') a" | q
|
||||
echo "== historical sheet and version"
|
||||
echo "select row_to_json(s) from (select id, status, current_version_id, last_version_number, updated_at, slug from public.anatomical_sheets where id = '503dc301-a8b1-50d4-9e44-0919b2fc2916') s" | q
|
||||
echo "select id || ' ' || status || ' ' || version_number || ' ' || md5(content::text) || ' ' || updated_at from public.anatomical_sheet_versions where sheet_id = '503dc301-a8b1-50d4-9e44-0919b2fc2916'" | q
|
||||
echo "== service_role table privileges on the catalogue tables"
|
||||
echo "select coalesce(string_agg(table_name || ':' || privilege_type, ',' order by table_name, privilege_type), 'none') from information_schema.role_table_grants where grantee = 'service_role' and table_schema = 'public' and table_name in ('species', 'anatomical_sheets', 'anatomical_sheet_versions', 'anatomical_sheet_assets', 'profiles', 'profile_roles')" | q
|
||||
echo "== bytes through the Storage API (service key)"
|
||||
curl -sS -H @"$STATE/service-header" "http://127.0.0.1:57500/object/anatomical-sheet-assets/$KEY" | tee "$OUT/bytes-$1.svg" | sha256sum
|
||||
stat -c '%s bytes' "$OUT/bytes-$1.svg"
|
||||
} > "$OUT/snapshot-$1.txt"
|
||||
}
|
||||
snapshot before
|
||||
|
||||
# 4. M4 + M5 with the CLI, as the owner will apply them on DEV (migration up).
|
||||
(cd "$WT" && node_modules/.bin/supabase --workdir . migration up \
|
||||
--db-url "postgresql://postgres@127.0.0.1:57432/postgres?sslmode=disable") > "$OUT/migrate.log" 2>&1
|
||||
echo "notify pgrst, 'reload schema'" | q
|
||||
sleep 2
|
||||
snapshot after
|
||||
|
||||
# 5. Reads through the migrated policies with real tokens.
|
||||
node "$HERE/m7-read.mjs" "$KEY" > "$OUT/reads.json"
|
||||
# 6. The comparison: everything but the bucket limit identical.
|
||||
diff "$OUT/snapshot-before.txt" "$OUT/snapshot-after.txt" > "$OUT/snapshot.diff" || true
|
||||
cmp "$OUT/bytes-before.svg" "$SVG" && cmp "$OUT/bytes-after.svg" "$SVG" && echo "bytes identical to the Git file before and after" > "$OUT/bytes.result"
|
||||
echo "m7 done"
|
||||
# 7. The upgraded stack under the whole test set: pgTAP, the sandbox suite twice, the types.
|
||||
cd "$WT"
|
||||
bash scripts/db-sandbox.sh test-db > "$OUT/testdb.log" 2>&1; echo "test-db exit $?" >> "$OUT/testdb.log"
|
||||
bash scripts/db-sandbox.sh test > "$OUT/sandbox-run1.log" 2>&1; echo "run1 exit $?" >> "$OUT/sandbox-run1.log"
|
||||
bash scripts/db-sandbox.sh test > "$OUT/sandbox-run2.log" 2>&1; echo "run2 exit $?" >> "$OUT/sandbox-run2.log"
|
||||
bash scripts/db-sandbox.sh test-db > "$OUT/testdb-after.log" 2>&1; echo "test-db-after exit $?" >> "$OUT/testdb-after.log"
|
||||
bash scripts/db-sandbox.sh types --check > "$OUT/types.log" 2>&1; echo "types exit $?" >> "$OUT/types.log"
|
||||
echo "m7 all done"
|
||||
@@ -0,0 +1,82 @@
|
||||
1f9fa8b
|
||||
-- script:
|
||||
-- -- Number walk timings on the sandbox (rolled back). shipped = private.check_document_structure as committed;
|
||||
-- -- per_row = the same sum over jsonb_path_query row by row (the 3eba6d8 form).
|
||||
-- \timing on
|
||||
-- begin;
|
||||
-- create function pg_temp.per_row(p jsonb) returns bigint language plpgsql as $f$
|
||||
-- declare v jsonb; t bigint := 0;
|
||||
-- begin
|
||||
-- for v in select jsonb_path_query(p, 'strict $.** ? (@.type() == "number")') loop t := t + octet_length(v::text); end loop;
|
||||
-- return t;
|
||||
-- end $f$;
|
||||
-- create temp table d as select n, (select content from public.anatomical_sheet_versions order by version_number limit 1)
|
||||
-- || jsonb_build_object('pad', (select jsonb_agg(0) from generate_series(1, n))) as doc from unnest(array[50000,100000,200000,400000,600000]) n;
|
||||
-- \echo per_row 50000
|
||||
-- select pg_temp.per_row(doc) from d where n = 50000;
|
||||
-- \echo per_row 100000
|
||||
-- select pg_temp.per_row(doc) from d where n = 100000;
|
||||
-- \echo per_row 200000
|
||||
-- select pg_temp.per_row(doc) from d where n = 200000;
|
||||
-- \echo shipped 100000
|
||||
-- select private.check_document_structure(doc) from d where n = 100000;
|
||||
-- \echo shipped 200000
|
||||
-- select private.check_document_structure(doc) from d where n = 200000;
|
||||
-- \echo shipped 400000
|
||||
-- select private.check_document_structure(doc) from d where n = 400000;
|
||||
-- \echo shipped 600000
|
||||
-- select private.check_document_structure(doc) from d where n = 600000;
|
||||
-- rollback;
|
||||
Time: 0.086 ms
|
||||
Time: 1.163 ms
|
||||
Time: 603.977 ms
|
||||
per_row 50000
|
||||
per_row
|
||||
---------
|
||||
50692
|
||||
(1 row)
|
||||
|
||||
Time: 137.844 ms
|
||||
per_row 100000
|
||||
per_row
|
||||
---------
|
||||
100692
|
||||
(1 row)
|
||||
|
||||
Time: 506.026 ms
|
||||
per_row 200000
|
||||
per_row
|
||||
---------
|
||||
200692
|
||||
(1 row)
|
||||
|
||||
Time: 2172.483 ms (00:02.172)
|
||||
shipped 100000
|
||||
check_document_structure
|
||||
--------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
Time: 68.834 ms
|
||||
shipped 200000
|
||||
check_document_structure
|
||||
--------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
Time: 134.571 ms
|
||||
shipped 400000
|
||||
check_document_structure
|
||||
--------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
Time: 267.344 ms
|
||||
shipped 600000
|
||||
check_document_structure
|
||||
--------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
Time: 421.337 ms
|
||||
Time: 0.498 ms
|
||||
@@ -0,0 +1,105 @@
|
||||
assign_platform_role
|
||||
--------------------------------------
|
||||
634abb88-1ccb-4bb5-9424-a384b5c31e74
|
||||
(1 row)
|
||||
|
||||
assign_platform_role
|
||||
--------------------------------------
|
||||
d4de6c72-8e49-40a9-a012-4dfbab54e8b3
|
||||
(1 row)
|
||||
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F1 observed: plain account created a personal PUBLIC sheet for species other: creator=t official=f visibility=public species=other
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F5 observed: an account with an UNCONFIRMED email created a sheet
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F6 observed: set_sheet_visibility changes visibility with no gate
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F15 observed: another plain account reads the public personal sheet: 1 row(s)
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F9 observed: editor rewrote draft content by direct UPDATE (no RPC): change_note=direct
|
||||
NOTICE: F9 observed: sheet renamed by direct UPDATE: Renamed directly
|
||||
publish_sheet_version
|
||||
--------------------------------------
|
||||
a45915a7-1677-4560-abe9-72d7d0c018e8
|
||||
(1 row)
|
||||
|
||||
NOTICE: F4 observed: version published with a drawing never confirmed: uploaded_at null = t
|
||||
archive_anatomical_sheet
|
||||
--------------------------------------
|
||||
f2411a8d-0f70-4bac-8e4c-cc7084977f42
|
||||
(1 row)
|
||||
|
||||
NOTICE: F2 observed: the draft of an ARCHIVED sheet was published
|
||||
NOTICE: F2 observed: create_sheet_draft opened a draft on an ARCHIVED sheet
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F8 observed: after archiving, another account reads 0 published version(s) of the sheet
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
restore_anatomical_sheet
|
||||
--------------------------------------
|
||||
f2411a8d-0f70-4bac-8e4c-cc7084977f42
|
||||
(1 row)
|
||||
|
||||
deprecate_sheet_version
|
||||
--------------------------------------
|
||||
a45915a7-1677-4560-abe9-72d7d0c018e8
|
||||
(1 row)
|
||||
|
||||
NOTICE: F13 observed: a DEPRECATED (once published) version was deleted physically: rows left 0
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F3 observed: source drawing confirmed, copied rows confirmed: false
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F14 observed: a platform admin at aal1 (claims carry no aal) published an official sheet
|
||||
as_user
|
||||
---------
|
||||
|
||||
(1 row)
|
||||
|
||||
NOTICE: F19 observed: grant_platform_role(owner) accepted at aal1 (claims: {"sub": "a1000000-0000-0000-0000-000000000001", "role": "authenticated"})
|
||||
NOTICE: F19 observed: the new owner holds 0 verified factor(s); active owner rows now 1
|
||||
set_config
|
||||
-------------------------
|
||||
{"role":"service_role"}
|
||||
(1 row)
|
||||
|
||||
NOTICE: F7 observed: upload confirmed with no object in Storage: objects=0 uploaded_at set=t
|
||||
NOTICE: F12 observed: service_role published a draft by direct UPDATE: published
|
||||
NOTICE: F17 observed: service_role inserted an owner row directly into profile_roles
|
||||
NOTICE: F16 observed: sha256 of an asset used by a published version changed: 00000000
|
||||
repro exit 0
|
||||
@@ -0,0 +1,158 @@
|
||||
-- V1-2.1 phase A: reproduce F1-F9, F12-F17, F19 on the OLD schema (develop, 12 migrations)
|
||||
-- of the throwaway sandbox. One transaction, rolled back: nothing persists.
|
||||
\set ON_ERROR_STOP 1
|
||||
begin;
|
||||
set local client_min_messages = notice;
|
||||
|
||||
insert into auth.users (id, email, email_confirmed_at) values
|
||||
('a1000000-0000-0000-0000-000000000001', 'repro-owner@sandbox.local', now()),
|
||||
('a1000000-0000-0000-0000-00000000000a', 'repro-alice@sandbox.local', now()),
|
||||
('a1000000-0000-0000-0000-00000000000b', 'repro-bob@sandbox.local', now()),
|
||||
('a1000000-0000-0000-0000-00000000000c', 'repro-unconfirmed@sandbox.local', null),
|
||||
('a1000000-0000-0000-0000-00000000000d', 'repro-admin@sandbox.local', now());
|
||||
select private.assign_platform_role(null, 'a1000000-0000-0000-0000-000000000001', 'owner');
|
||||
select private.assign_platform_role(null, 'a1000000-0000-0000-0000-00000000000d', 'admin');
|
||||
|
||||
create function pg_temp.doc(p_species text, p_asset uuid) returns jsonb language sql as $$
|
||||
select jsonb_build_object(
|
||||
'schema_version', 2, 'species_id', p_species,
|
||||
'name', jsonb_build_object('fr', 'Repro', 'en', 'Repro'),
|
||||
'description', '{}'::jsonb, 'scope_disclaimer', '{}'::jsonb,
|
||||
'attribution', jsonb_build_object('authors', '[]'::jsonb, 'license', null, 'notes', null),
|
||||
'vertebral_config', jsonb_build_object('regions', '[]'::jsonb),
|
||||
'references', '[]'::jsonb,
|
||||
'categories', jsonb_build_array(jsonb_build_object('id', 'c', 'name', jsonb_build_object('fr', 'C', 'en', 'C'), 'color', null)),
|
||||
'views', jsonb_build_array(jsonb_build_object('id', 'main', 'kind', 'main',
|
||||
'name', jsonb_build_object('fr', 'V', 'en', 'V'), 'svg_asset_id', p_asset, 'view_box', null)),
|
||||
'annotations', '[]'::jsonb, 'finding_zones', '[]'::jsonb);
|
||||
$$;
|
||||
grant execute on function pg_temp.doc(text, uuid) to authenticated, service_role;
|
||||
create table pg_temp.ids (key text primary key, id uuid);
|
||||
grant all on pg_temp.ids to authenticated, service_role;
|
||||
create function pg_temp.id(k text) returns uuid language sql as $$ select id from pg_temp.ids where key = k $$;
|
||||
grant execute on function pg_temp.id(text) to authenticated, service_role;
|
||||
create function pg_temp.as_user(p uuid) returns void language sql as $$
|
||||
select set_config('request.jwt.claims', jsonb_build_object('sub', p, 'role', 'authenticated')::text, true);
|
||||
$$;
|
||||
grant execute on function pg_temp.as_user(uuid) to authenticated, service_role;
|
||||
|
||||
-- F1, F5, F6, F15 ------------------------------------------------------------
|
||||
set local role authenticated;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000a');
|
||||
insert into pg_temp.ids select 'f1', public.create_anatomical_sheet('other', 'Perso', 'perso-other', pg_temp.doc('other', null), '', 'public');
|
||||
do $$ begin raise notice 'F1 observed: plain account created a personal PUBLIC sheet for species other: %',
|
||||
(select format('creator=%s official=%s visibility=%s species=%s', creator_user_id is not null, is_official, visibility, species_id)
|
||||
from public.anatomical_sheets where id = pg_temp.id('f1')); end $$;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000c');
|
||||
do $$ begin
|
||||
perform public.create_anatomical_sheet('equine', 'Unconfirmed', 'unconfirmed-sheet', pg_temp.doc('equine', null));
|
||||
raise notice 'F5 observed: an account with an UNCONFIRMED email created a sheet';
|
||||
exception when others then raise notice 'F5 not reproduced: %', sqlerrm; end $$;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000a');
|
||||
do $$ begin
|
||||
perform public.set_sheet_visibility(pg_temp.id('f1'), 'private');
|
||||
perform public.set_sheet_visibility(pg_temp.id('f1'), 'public');
|
||||
raise notice 'F6 observed: set_sheet_visibility changes visibility with no gate';
|
||||
exception when others then raise notice 'F6 not reproduced: %', sqlerrm; end $$;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000b');
|
||||
do $$ begin raise notice 'F15 observed: another plain account reads the public personal sheet: % row(s)',
|
||||
(select count(*) from public.anatomical_sheets where id = pg_temp.id('f1')); end $$;
|
||||
|
||||
-- F2, F4, F8, F9, F13: alice publishes v1 with an UNCONFIRMED drawing, archives, publishes v2
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000a');
|
||||
insert into pg_temp.ids select 's', public.create_anatomical_sheet('equine', 'Repro', 'repro-sheet', pg_temp.doc('equine', null), '', 'public');
|
||||
insert into pg_temp.ids select 'asset', public.register_sheet_asset(pg_temp.id('s'), repeat('e', 64), 100, 'r.svg');
|
||||
insert into pg_temp.ids select 'v1', id from public.anatomical_sheet_versions where sheet_id = pg_temp.id('s');
|
||||
update public.anatomical_sheet_versions set content = pg_temp.doc('equine', pg_temp.id('asset')), change_note = 'direct'
|
||||
where id = pg_temp.id('v1');
|
||||
do $$ begin raise notice 'F9 observed: editor rewrote draft content by direct UPDATE (no RPC): change_note=%',
|
||||
(select change_note from public.anatomical_sheet_versions where id = pg_temp.id('v1')); end $$;
|
||||
update public.anatomical_sheets set name = 'Renamed directly' where id = pg_temp.id('s');
|
||||
do $$ begin raise notice 'F9 observed: sheet renamed by direct UPDATE: %',
|
||||
(select name from public.anatomical_sheets where id = pg_temp.id('s')); end $$;
|
||||
select public.publish_sheet_version(pg_temp.id('v1'));
|
||||
do $$ begin raise notice 'F4 observed: version published with a drawing never confirmed: uploaded_at null = %',
|
||||
(select uploaded_at is null from public.anatomical_sheet_assets where id = pg_temp.id('asset')); end $$;
|
||||
insert into pg_temp.ids select 'v2', public.create_sheet_draft(pg_temp.id('s'), null, 'v2');
|
||||
select public.archive_anatomical_sheet(pg_temp.id('s'));
|
||||
do $$ begin
|
||||
perform public.publish_sheet_version(pg_temp.id('v2'));
|
||||
raise notice 'F2 observed: the draft of an ARCHIVED sheet was published';
|
||||
exception when others then raise notice 'F2 not reproduced: %', sqlerrm; end $$;
|
||||
do $$ begin
|
||||
perform public.create_sheet_draft(pg_temp.id('s'), null, 'v3 on archived');
|
||||
raise notice 'F2 observed: create_sheet_draft opened a draft on an ARCHIVED sheet';
|
||||
exception when others then raise notice 'F2 (draft) not reproduced: %', sqlerrm; end $$;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000b');
|
||||
do $$ begin raise notice 'F8 observed: after archiving, another account reads % published version(s) of the sheet',
|
||||
(select count(*) from public.anatomical_sheet_versions where sheet_id = pg_temp.id('s') and status <> 'draft'); end $$;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000a');
|
||||
select public.restore_anatomical_sheet(pg_temp.id('s'));
|
||||
select public.deprecate_sheet_version(pg_temp.id('v1'), 'old');
|
||||
do $$ begin
|
||||
perform public.delete_sheet_version(pg_temp.id('v1'));
|
||||
raise notice 'F13 observed: a DEPRECATED (once published) version was deleted physically: rows left %',
|
||||
(select count(*) from public.anatomical_sheet_versions where id = pg_temp.id('v1'));
|
||||
exception when others then raise notice 'F13 not reproduced: %', sqlerrm; end $$;
|
||||
|
||||
-- F3: bob forks alice's public sheet; copied asset rows lack uploaded_at
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000b');
|
||||
insert into pg_temp.ids select 'fork', public.fork_anatomical_sheet(pg_temp.id('v2'), 'Copie', 'copie-repro');
|
||||
reset role;
|
||||
update public.anatomical_sheet_assets set uploaded_at = now() where id = pg_temp.id('asset');
|
||||
do $$ begin raise notice 'F3 observed: source drawing confirmed, copied rows confirmed: %',
|
||||
(select string_agg((uploaded_at is not null)::text, ',') from public.anatomical_sheet_assets where sheet_id = pg_temp.id('fork')); end $$;
|
||||
|
||||
-- F14: a platform admin, no capability, no MFA claim, creates and publishes an official sheet
|
||||
set local role authenticated;
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-00000000000d');
|
||||
insert into pg_temp.ids select 'off', public.create_anatomical_sheet('equine', 'Off', 'off-repro', pg_temp.doc('equine', null), '', 'public', true);
|
||||
insert into pg_temp.ids select 'off-asset', public.register_sheet_asset(pg_temp.id('off'), repeat('f', 64), 100, 'o.svg');
|
||||
update public.anatomical_sheet_versions set content = pg_temp.doc('equine', pg_temp.id('off-asset')) where sheet_id = pg_temp.id('off');
|
||||
do $$ begin
|
||||
perform public.publish_sheet_version((select id from public.anatomical_sheet_versions where sheet_id = pg_temp.id('off')));
|
||||
raise notice 'F14 observed: a platform admin at aal1 (claims carry no aal) published an official sheet';
|
||||
exception when others then raise notice 'F14 not reproduced: %', sqlerrm; end $$;
|
||||
|
||||
-- F19: an owner session with NO aal claim grants owner to another account that has no factor
|
||||
select pg_temp.as_user('a1000000-0000-0000-0000-000000000001');
|
||||
do $$ begin
|
||||
perform public.grant_platform_role('a1000000-0000-0000-0000-00000000000b', 'owner');
|
||||
raise notice 'F19 observed: grant_platform_role(owner) accepted at aal1 (claims: %)', current_setting('request.jwt.claims');
|
||||
exception when others then raise notice 'F19 not reproduced: %', sqlerrm; end $$;
|
||||
|
||||
-- F7, F12, F17: the service_role session
|
||||
reset role;
|
||||
do $$ begin raise notice 'F19 observed: the new owner holds % verified factor(s); active owner rows now %',
|
||||
(select count(*) from auth.mfa_factors where user_id = 'a1000000-0000-0000-0000-00000000000b' and status = 'verified'),
|
||||
(select count(*) from public.profile_roles where user_id = 'a1000000-0000-0000-0000-00000000000b' and role = 'owner' and revoked_at is null); end $$;
|
||||
insert into pg_temp.ids select 'pending', public.register_sheet_asset(pg_temp.id('off'), repeat('9', 64), 100, 'p.svg')
|
||||
from (select pg_temp.as_user('a1000000-0000-0000-0000-00000000000d')) x;
|
||||
select set_config('request.jwt.claims', '{"role":"service_role"}', true);
|
||||
set local role service_role;
|
||||
do $$ begin
|
||||
perform public.confirm_sheet_asset_upload(pg_temp.id('pending'));
|
||||
raise notice 'F7 observed: upload confirmed with no object in Storage: objects=% uploaded_at set=%',
|
||||
(select count(*) from storage.objects where bucket_id = 'anatomical-sheet-assets' and name = repeat('9', 64) || '.svg'),
|
||||
(select uploaded_at is not null from public.anatomical_sheet_assets where id = pg_temp.id('pending'));
|
||||
exception when others then raise notice 'F7 not reproduced: %', sqlerrm; end $$;
|
||||
do $$ begin
|
||||
update public.anatomical_sheet_versions set status = 'published', published_at = now()
|
||||
where sheet_id = pg_temp.id('f1') and status = 'draft';
|
||||
raise notice 'F12 observed: service_role published a draft by direct UPDATE: %',
|
||||
(select status from public.anatomical_sheet_versions where sheet_id = pg_temp.id('f1'));
|
||||
exception when others then raise notice 'F12 not reproduced: %', sqlerrm; end $$;
|
||||
do $$ begin
|
||||
insert into public.profile_roles (user_id, role) values ('a1000000-0000-0000-0000-00000000000c', 'owner');
|
||||
raise notice 'F17 observed: service_role inserted an owner row directly into profile_roles';
|
||||
exception when others then raise notice 'F17 not reproduced: %', sqlerrm; end $$;
|
||||
|
||||
-- F16: privileged session rewrites a drawing row's sha256 under a published version
|
||||
reset role;
|
||||
do $$ begin
|
||||
update public.anatomical_sheet_assets set sha256 = repeat('0', 64) where id = pg_temp.id('off-asset');
|
||||
raise notice 'F16 observed: sha256 of an asset used by a published version changed: %',
|
||||
(select left(sha256, 8) from public.anatomical_sheet_assets where id = pg_temp.id('off-asset'));
|
||||
exception when others then raise notice 'F16 not reproduced: %', sqlerrm; end $$;
|
||||
|
||||
rollback;
|
||||
@@ -0,0 +1,17 @@
|
||||
# Sandbox suite timing lines at 2379d28 (pnpm db:sandbox test, four runs), extracted from the run logs
|
||||
== fresh/sandbox-run1.log
|
||||
AT-CAPS TIMING {"document":{"textBytes":2076707,"jsonbBytes":2346648,"cap":2097152,"labelLength":29,"views":64,"annotations":1024,"findingNodes":8192,"depth":8,"groups":1089,"drawings":4,"drawingBytes":2000000},"budgetMs":2000,"save":{"n":7,"min":127,"median":137,"max":155},"submit":{"n":5,"min":4,"median":5,"max":6},"approve":{"n":3,"min":190,"median":285,"max":292},"publish":{"n":3,"min":195,"median":288,"max":303}}
|
||||
NUMBER WALK {"within":{"numbers":600000,"textBytes":1801760,"ms":683},"over":{"numbers":1000000,"status":400,"ms":1026}}
|
||||
Tests 87 passed (87)
|
||||
== fresh/sandbox-run2.log
|
||||
AT-CAPS TIMING {"document":{"textBytes":2076707,"jsonbBytes":2346648,"cap":2097152,"labelLength":29,"views":64,"annotations":1024,"findingNodes":8192,"depth":8,"groups":1089,"drawings":4,"drawingBytes":2000000},"budgetMs":2000,"save":{"n":7,"min":130,"median":142,"max":155},"submit":{"n":5,"min":4,"median":7,"max":13},"approve":{"n":3,"min":196,"median":284,"max":297},"publish":{"n":3,"min":205,"median":302,"max":306}}
|
||||
NUMBER WALK {"within":{"numbers":600000,"textBytes":1801760,"ms":681},"over":{"numbers":1000000,"status":400,"ms":1062}}
|
||||
Tests 87 passed (87)
|
||||
== m7/logs/sandbox-run1.log
|
||||
AT-CAPS TIMING {"document":{"textBytes":2076707,"jsonbBytes":2346648,"cap":2097152,"labelLength":29,"views":64,"annotations":1024,"findingNodes":8192,"depth":8,"groups":1089,"drawings":4,"drawingBytes":2000000},"budgetMs":2000,"save":{"n":7,"min":135,"median":139,"max":148},"submit":{"n":5,"min":5,"median":6,"max":6},"approve":{"n":3,"min":192,"median":282,"max":294},"publish":{"n":3,"min":196,"median":292,"max":296}}
|
||||
NUMBER WALK {"within":{"numbers":600000,"textBytes":1801760,"ms":695},"over":{"numbers":1000000,"status":400,"ms":1019}}
|
||||
Tests 87 passed (87)
|
||||
== m7/logs/sandbox-run2.log
|
||||
AT-CAPS TIMING {"document":{"textBytes":2076707,"jsonbBytes":2346648,"cap":2097152,"labelLength":29,"views":64,"annotations":1024,"findingNodes":8192,"depth":8,"groups":1089,"drawings":4,"drawingBytes":2000000},"budgetMs":2000,"save":{"n":7,"min":127,"median":137,"max":151},"submit":{"n":5,"min":5,"median":5,"max":7},"approve":{"n":3,"min":199,"median":286,"max":295},"publish":{"n":3,"min":220,"median":292,"max":299}}
|
||||
NUMBER WALK {"within":{"numbers":600000,"textBytes":1801760,"ms":677},"over":{"numbers":1000000,"status":400,"ms":1078}}
|
||||
Tests 87 passed (87)
|
||||
@@ -0,0 +1,383 @@
|
||||
# Security gate, V1-2.2 owner arbitrations (diff 17d9199..HEAD)
|
||||
|
||||
Mode: audit. Branch `feature/v1-2-anatomical-sheets`, worktree `v1-2`. Date 2026-10-29.
|
||||
|
||||
```
|
||||
SECURITY — VERDICT: BLOCK(1)
|
||||
TOOL: semgrep 1.168.0 present but NOT RUN (p/security-audit, p/secrets, p/owasp-top-ten are fetched from the registry at run time and the brief forbids network) — effectively DEGRADED: checklist + guardrails scanner + manual attack review + probes on the built wasm module and on headless browsers
|
||||
SCOPE: 40 files
|
||||
BLOCKING:
|
||||
1. [HIGH] url-reference-spelling-mismatch (reader and composer read fewer `url(#…)` spellings than browsers resolve) — crates/core/src/anatomy/svg/sanitize.rs:488 (url_targets), :502 (scope_url_targets), :523 (urls_are_local), :528 (calls_only_local_url); crates/core/src/anatomy/svg/refs.rs:115 (reference_ids); crates/core/src/anatomy/compose.rs:98 (scope_ids) — `fill="url(#%66v.main.g)"` (also `url(#%61)`, and in Chromium `url('#<TAB>a')`) passes the sanitiser, is invisible to `check_targets`, `check_references` and `scope_url_targets`, and is resolved by Chromium and Firefox after percent-decoding: it defeats B1 (dangling check), B2 (view scoping, it reaches another view's `fv.main.g`) and the expansion budget (a 5 KB drawing hangs Chromium for 45 s) — hint: refuse in `urls_are_local` any `url(` whose target is not `#` + `[A-Za-z_][\w.:-]*` followed by optional space or the closing quote then `)` (so `url(#)`, `%`, tab, `/`, non-ASCII after `#` are refused as active), so the sanitiser admits exactly what `url_targets` reads; add a fail-closed check in `compose_canvas` that every composed `url(` target starts with the view scope
|
||||
REPORTED (non-blocking):
|
||||
- [MEDIUM] scope-key-is-view-id-only — crates/core/src/anatomy/compose.rs:92 — two documents that share a view id (every sheet has `main`) and are inlined in one page share the scope `fv.main.`; the first element in tree order wins, so §10 "never in another view" holds inside one document only
|
||||
- [LOW] colour-function-not-whole-value — crates/core/src/anatomy/svg/sanitize.rs:547 — strict `rgb()` is stripped wherever it sits in the value, so `rgb(1,2,3)rgb(4,5,6)` and `url(#a rgb(1,2,3))` (refused before) now pass; invalid CSS the browser drops, no fetch found in 19 hostile values
|
||||
- [LOW] test-oracle-shares-the-blind-spot — crates/core/tests/svg_scope.rs:107, apps/app/tests/helpers/svgTree.ts:112 — the oracles read references with `url_targets` / `replaceAll('url(#'`, so they cannot see a reader/browser divergence; no test uses `%`, tab or a non-id first character
|
||||
- [LOW] new-lint-allow (context, not a security suppression) — crates/core/tests/svg_scope.rs:6 — `#![allow(clippy::disallowed_methods, clippy::unwrap_used, clippy::expect_used)]`, same header as 49 other test files
|
||||
- [LOW] mutation-script-rewrites-sources — .claude/audits/2026-10-29-v1-2-2-mutations-arbitrations.py — edits source files in place and restores them in `finally`; a SIGKILL leaves a mutant in the tree (read only, not run)
|
||||
PROOF: semgrep 0 rules on 0 files (not run, no network) → 0 findings; checklist 9 checks (secrets, SQL concatenation, unsanitised render, authz, error surfaces, logging, tracked .env, guardrails scanner, new suppressions) → 1 context finding; manual attack review of 12 files + 3 probe families (built wasm module, Chromium 1248, Firefox 1555) → 1 HIGH, 1 MEDIUM, 3 LOW
|
||||
```
|
||||
|
||||
REPORT_WRITTEN: .claude/audits/2026-10-29-v1-2-2-arbitrations-security.md
|
||||
|
||||
## 1. The blocking finding
|
||||
|
||||
### What the code does
|
||||
|
||||
`sanitize::value_acceptable` (sanitize.rs:417) lets a `url(` through when the text after the
|
||||
opening, the CSS space and the optional quote starts with `#` (`urls_are_local`, :523), and
|
||||
when no other `(` remains (`calls_only_local_url`, :528). It does not look at what follows
|
||||
the `#`.
|
||||
|
||||
Three readers then work on the same value, each with its own idea of "the id":
|
||||
|
||||
- `url_targets` (:488) takes the longest run of `[A-Za-z0-9_.:-]` after `#`, and drops an
|
||||
empty one.
|
||||
- `scope_url_targets` (:502) writes the view scope after `#` only when the next character is
|
||||
in that set.
|
||||
- `refs::reference_ids` (refs.rs:115), which feeds `check_targets` (B1) and
|
||||
`check_references` (cycle and expansion budget), calls `url_targets`.
|
||||
|
||||
When the first character after `#` is outside the set, all three see "no reference" and the
|
||||
value is stored and composed byte for byte. A browser does not: it percent-decodes the
|
||||
fragment (Chromium and Firefox, measured below), and Chromium also drops a tab inside a
|
||||
quoted CSS string (URL Standard: tab and newline are removed from the input).
|
||||
|
||||
### Probes (all throwaway, in the session scratchpad, nothing written in the worktree)
|
||||
|
||||
1. Built wasm module of the worktree (`packages/core-wasm/pkg`, built 16:28, after the last
|
||||
source edit at 16:18), `clean_svg` on a one-rect drawing:
|
||||
- `fill="url(#nope)"` gives `rejected dangling_reference`.
|
||||
- `fill="url(#%6eope)"` gives `clean`. The dangling check is bypassed.
|
||||
- `fill="url(#%66v.main.g)"` with a local `<linearGradient id="g"/>` gives `clean`.
|
||||
2. Same module, `PreviewBuilder` on the equine draft document with that drawing as the
|
||||
horse asset, `view.canvas`:
|
||||
- view `main`: `<linearGradient id="fv.main.g"/>` and `<rect fill="url(#%66v.main.g)">`.
|
||||
- view `head`: `<linearGradient id="fv.head.g"/>` and `<rect fill="url(#%66v.main.g)">`.
|
||||
The reference is not rewritten. In the page the `head` rectangle resolves into the
|
||||
`main` canvas.
|
||||
3. Browsers, inline SVG in an HTML page, `fill="url(#a)"` control painted red:
|
||||
|
||||
| spelling | Chromium 1248 | Firefox 1555 |
|
||||
|---|---|---|
|
||||
| `url(#a)` | resolves | resolves |
|
||||
| `url(#%61)` | resolves | resolves |
|
||||
| `style="fill:url(#%61)"` | resolves | resolves |
|
||||
| `url(#%66v.other.x)` (another view's scoped id) | resolves | resolves |
|
||||
| `url('#<TAB>a')` (`	`) | resolves | does not |
|
||||
| `url(#nope)` | none | none |
|
||||
|
||||
WebKit was not tested.
|
||||
4. Budget bypass, Chromium 1248, nested masks written with `url(#%6dN)`, fan-out 10 per
|
||||
level, one root rectangle masked by level 0:
|
||||
|
||||
| levels | size | render time |
|
||||
|---|---|---|
|
||||
| 5 | 3.3 KB page | 0.5 s |
|
||||
| 6 | 4.1 KB page | 4.6 s |
|
||||
| 7 | 4.8 KB page | 44.8 s |
|
||||
|
||||
Each level costs ten times more. The same structure with plain `url(#mN)` is refused by
|
||||
`expanded_size` (10^7 against 50,000). In the core, a value of 250k `url(#a)` gives
|
||||
`too_complex` in 58 ms, the same value with `url(#%61)` gives `clean` in 107 ms.
|
||||
Firefox timing was not measured.
|
||||
|
||||
### Impact
|
||||
|
||||
- B2 is not met: a drawing can resolve into another view of the page (paint servers,
|
||||
filters, masks, clip paths). Into the page itself the reach is theoretical today: no
|
||||
page-level SVG resource with an id exists in `apps/app/src` (the brand logos are loaded
|
||||
as `<img>` or rasterised, not inlined). Visual only, no fetch, no script.
|
||||
- B1 is not met: a reference to an id the drawing does not define is accepted when spelled
|
||||
this way.
|
||||
- The R3 expansion budget is bypassed. An editor uploads under 5 KB, the verdict and the
|
||||
preview say `ok`, the reviewer's or any practitioner's tab freezes when the view draws.
|
||||
The PDF export rasterises the same view.
|
||||
- The budget bypass exists at 17d9199 (the old `urls_are_local` is the same). The diff does
|
||||
not create it, but B1 and B2 are written to close exactly this class and rest on the same
|
||||
reader, so they ship with the hole.
|
||||
|
||||
### Fix direction (no code written, report only)
|
||||
|
||||
1. Make the sanitiser the authority. In `urls_are_local` (or a new check called first in
|
||||
`value_acceptable`), require for every `url(`: CSS space, optional quote, `#`, one id
|
||||
that satisfies `is_reference_name` (first character `[A-Za-z_]`), then space, the same
|
||||
quote if one was opened, and `)`. Anything else is non-local and therefore active
|
||||
(rejected), which also removes `url(#)`. Then the set the sanitiser admits and the set
|
||||
`url_targets` reads are the same by construction.
|
||||
2. Fail closed in the composer: after `scope_ids`, walk the composed tree and refuse the
|
||||
canvas (`ComposeError`) when a `url(` target does not start with the view scope, or an
|
||||
`href` does not start with `#fv.<view>.`. A future reader divergence then cannot produce
|
||||
an unscoped reference silently.
|
||||
3. Tests with an independent oracle: for every accepted value, normalise the way the URL
|
||||
Standard does (strip tab and newline, percent-decode the fragment) and assert it equals
|
||||
the `url_targets` list; cases `url(#%61)`, `url(#%66v.x.g)`, `url('#<TAB>a')`, `url(#)`,
|
||||
`url(#é)`, `url(#a%2Eb)` (allowed only if the first character rule holds).
|
||||
4. After the fix, correct the statements that are false today: docs/development/
|
||||
V1-2_ANATOMICAL_SHEETS.md §9.2 and §10 ("a reference resolves only inside its own view"),
|
||||
docs/development/RUST.md, docs/ANNOTATION-RENDERING.md.
|
||||
|
||||
## 2. Reported findings
|
||||
|
||||
- MEDIUM, scope key. `id_scope` (compose.rs:92) is `fv.<view id>.`. View ids are unique inside
|
||||
one document, not across sheets. A catalogue grid, a comparison or a preview next to the
|
||||
editor puts two `main` canvases in one page; ids collide and `getElementById` takes the
|
||||
first. Sheet B can then draw with sheet A's gradient or mask. Not verified against the
|
||||
V1-2.3+ screens (they are not in this diff). Add a per-handle token, or state in §10 that
|
||||
one sheet is mounted at a time.
|
||||
- LOW, colour function. `without_colour_functions` (:547) removes a strict `rgb()` anywhere in
|
||||
the text. Probed: 19 hostile values around a colour (`url(http://…)`, `expression(`,
|
||||
`image-set(`, `src(`, `cross-fade(`, `\72`, `/**/url(//…)`, `behavior:`, `@import`, `var(`,
|
||||
`attr(`, `element(`, `-moz-element(`, `paint(`, `RGB(`, nested `url(#a)` as an argument) are
|
||||
all refused or removed. The remaining looseness is cosmetic: `rgb(1,2,3)rgb(4,5,6)` and
|
||||
`url(#a rgb(1,2,3))` pass and are invalid CSS (bad-url token), dropped by the browser.
|
||||
- LOW, test oracle. See table line above.
|
||||
- LOW, lint allow and mutation script. See table lines above.
|
||||
|
||||
## 3. What was attacked and held
|
||||
|
||||
- Colour exception, `smuggle url(`, `expression(`, escape, `image-set(`, fetch: a backslash is
|
||||
refused for every attribute before the colour code runs; `style_forbidden` runs on the
|
||||
original text; a `(` that is neither a local `url(#` nor a strict colour function stays and
|
||||
refuses the value. The colour parser admits only ASCII digits, `.`, `%`, comma, CSS space
|
||||
and `)` between `rgb(` and the end, so nothing can hide inside it. `glued` blocks `xrgb(`,
|
||||
`-rgb(`, `\rgb(`. Uppercase is refused (safe side). No index can leave the slice
|
||||
(`digits(end + 1)` only after a `.` at `end`; `index += 1` only after a matched separator).
|
||||
Probe table: 17 `fill` and 5 `style` values (19 hostile, 3 valid controls), all as expected.
|
||||
- Parsing cost, measured through the built module, attribute values near 2 MiB: `rgb(1,2,3)`
|
||||
x150k 132 ms, `rgb(` x400k 35 ms, `rgb(1,` x300k 37 ms, `rgb(` plus 1.9M spaces 26 ms, plus
|
||||
1.9M digits 23 ms, mixed spacing 84 ms, `url(#` x400k 97 ms, `url(` x400k 15 ms. By reading:
|
||||
each failed colour attempt scans one run of digits and spaces that cannot contain `rgb`,
|
||||
and `from` always advances at least 3.
|
||||
- `check_targets`, `scope_ids`, `references_resolve`: one pass, recursion bounded by the
|
||||
prescan depth cap 64, one `HashSet`. Scoped output is bounded by the budget (50,000
|
||||
references) plus 20,000 ids, then by `MAX_COMPOSED_BYTES` (4 MiB) after serialisation.
|
||||
- Scoping, spellings: `url( '#x')`, `URL(#x)`, newline and tab before `#` or the quote,
|
||||
and `.` in ids all go through the same `url_openings` / `skip_url_prefix` for the checker
|
||||
and the composer, so they agree with each other (the unit test at sanitize.rs:715 covers it).
|
||||
`href` and `xlink:href` are strict (`#` + reference name after ASCII trim), so a `%`, a tab or
|
||||
an odd prefix cannot be kept: a prefixed `x:href` is not on the allowlist and the
|
||||
`xlink:href` must be in the xlink namespace. View ids match `[a-z0-9][a-z0-9_-]{0,63}`
|
||||
(js.rs:158, enforced at deserialisation), so no `.` in a view id and one scope is never the
|
||||
start of another's. The layer has no `id`, `href` or `url(`.
|
||||
- Checker versus composer, same reading: `reference_ids` (all attributes through `url_targets`,
|
||||
`href` / `xlink:href` apart) and `scope_ids` (same set, `id` added) differ only on `id`,
|
||||
which cannot hold `(`. No attribute is rewritten and unread, or read and unrewritten.
|
||||
The one divergence is browser against both (finding 1).
|
||||
- Stored form: verdict (verdict.rs:323) and preview (preview.rs:119) compare the whole text
|
||||
with `stored_form(root)` after a removal-free read, so a comment, CDATA, entity, PI, BOM,
|
||||
another declaration or spacing cannot reach a round; the sha256 is checked first. The
|
||||
upload tool (upload.rs) and `clean_svg` do the same. Compose works on the sanitised tree,
|
||||
never on stored text. The `xmlns:xlink` value is unchecked but inert (a rebinding drops the
|
||||
xlink attributes that depend on it).
|
||||
- `sheet.edit remove` (edit.rs:570): `dependents` runs after `locate`, before any mutation,
|
||||
so a refusal leaves the document unchanged; it is a client rule, no authorisation change.
|
||||
- Checklist greps on the added lines (secrets, SQL built by concatenation, innerHTML / eval /
|
||||
raw, logging, tracked `.env`): nothing. Guardrails scanner: 0 FAIL, 28 WARN, all in
|
||||
migrations the diff does not touch, so none kept (gate rule).
|
||||
|
||||
## 4. Not done, and limits
|
||||
|
||||
- semgrep did not run. The three packs come from the registry and the brief says no network.
|
||||
The Rust surface of those packs is thin; the manual review above is the substitute, it is
|
||||
not equivalent.
|
||||
- WebKit was not probed; the Firefox DoS time was not measured; the `<TAB>` form is
|
||||
Chromium only.
|
||||
- Probes ran headless browsers on local files and Node on the built module. No cargo, wasm or
|
||||
Docker build was started (the `check:all` in the worktree was left alone). The probe files
|
||||
(HTML pages, screenshots, two Node scripts, a Firefox profile) sit in the session
|
||||
scratchpad `/tmp/claude-1000/-home-bchanot-Documents-faunosteo/0cee2841-f2bb-4081-9e59-3e6fe9cc8112/scratchpad/probe-audit`;
|
||||
the `rm -rf` that would have removed them was refused by the permission rules and was not
|
||||
retried by another route. Nothing was written in the worktree besides this report; `git
|
||||
status` there shows only this file and the owner's `exports/owner/README.md`.
|
||||
- The verdict runs in the core, client or worker side; the SQL side cannot check the stored
|
||||
form. That trust boundary is outside this diff.
|
||||
|
||||
## 5. Delta review (5281337..HEAD, commit a678faa)
|
||||
|
||||
Fresh scan of the delta, mode audit, 2026-10-29. The report above was read first, as the brief
|
||||
required; nothing else from the earlier round was used.
|
||||
|
||||
```
|
||||
SECURITY — VERDICT: PASS
|
||||
TOOL: semgrep 1.168.0 present but NOT RUN (p/security-audit, p/secrets, p/owasp-top-ten are registry packs fetched at run time and the brief forbids network) — effectively DEGRADED: checklist + guardrails scanner + manual attack review + the two named cargo suites + a model fuzz (section 5.7)
|
||||
SCOPE: 13 files (5 Rust: compose.rs, sanitize.rs, ops.rs, svg_clean.rs, svg_scope.rs; 8 docs, fixtures and audit files)
|
||||
BLOCKING:
|
||||
(none)
|
||||
REPORTED (non-blocking):
|
||||
- [MEDIUM] scope-key-is-view-id-only (carried from 5281337; now a written requirement, still not enforced by code or test) — crates/core/src/anatomy/compose.rs:99 — two documents inlined in one page share `fv.main.`, first in tree order wins; recorded in contract §10 and RUST.md §12.7; no screen inlines two documents today (consumers: apps/app/src/core/sheetOps.ts, services/sheetIndex.ts, anatomy/drawing.ts)
|
||||
- [LOW] composer-check-shares-the-reader-parser — crates/core/src/anatomy/compose.rs:105 — `references_scoped` calls `urls_are_local` and `url_targets`, the same `url_openings` / `local_url_target` as the sanitiser: it catches a `scope_ids` miss, it cannot see a future reader/browser divergence in those two functions; none today (5.7)
|
||||
- [LOW] tests-deliver-a-space-not-a-tab — crates/core/tests/svg_clean.rs:356, :357, :381; crates/core/tests/svg_scope.rs:338 — a raw TAB or LF inside an XML attribute is normalised to a space by the XML parser (roxmltree parse.rs:1364), so Chromium's `	` spelling of the first HIGH reaches `local_url_target` in no test; hint: rows written `	` and ` `, or a value-level unit test next to sanitize.rs:710
|
||||
- [LOW] ts-oracle-plain-spelling-only (carried) — apps/app/tests/helpers/svgTree.ts:112 — still `replaceAll('url(#'`; it mirrors the core's rewrite for the product drawing, and the sanitiser now refuses every other spelling, so the blind spot has no reachable input
|
||||
- [LOW] mutation-script-rewrites-sources (carried) — .claude/audits/2026-10-29-v1-2-2-mutations-arbitrations.py — five mutants added (A13 to A17); it still edits sources in place and restores in `finally`; not run here, so their kill results are not verified by this gate
|
||||
PROOF: semgrep 0 rules on 0 files (not run, no network) → 0 findings; checklist 9 checks (secrets, SQL concatenation, unsanitised render, authz, error surfaces, logging, tracked .env, guardrails scanner, new suppressions) → 0 findings in the delta; cargo test svg_clean + svg_scope 21 passed, lib anatomy::svg 24 passed; model fuzz 8.4M strings in fill and style contexts + 2,400-case slot sweep + control run → 0 dangerous mismatches; manual attack review of 5 code files → 0 HIGH, 1 MEDIUM, 4 LOW
|
||||
```
|
||||
|
||||
REPORT_WRITTEN: .claude/audits/2026-10-29-v1-2-2-arbitrations-security.md
|
||||
|
||||
### 5.1 Status of the previous findings
|
||||
|
||||
| Previous finding | Now |
|
||||
|---|---|
|
||||
| HIGH url-reference-spelling-mismatch | Closed. One reading of `url(` (`local_url_target`, sanitize.rs:487) feeds `urls_are_local`, `url_targets`, `scope_url_targets` and `calls_only_local_url`, so the set the sanitiser admits, the set the dangling check and the budget count, and the set the composer rewrites are the same by construction. Fix directions 1, 2, 3 and 4 of section 1 are all done. |
|
||||
| MEDIUM scope key | Recorded as a requirement (contract §10, RUST.md §12.7). Open as a rule, see the reported list. |
|
||||
| LOW colour function not whole value | Closed: `colour_function_end` now requires end of text, CSS space, `;`, `,` or `!` after the `)`. `rgb(1,2,3)rgb(4,5,6)` is removed, `url(#a rgb(1,2,3))` is refused at the `url(`. |
|
||||
| LOW test oracle shares the blind spot | Closed in the core: `browser_references` (svg_scope.rs) reads `href="…"` and every `url(…)` on its own, trims quotes and CSS space, strips tab and newline, percent-decodes. The TS helper is carried, see above. |
|
||||
| LOW lint allow | Nothing new: the delta adds no lint attribute and no scanner, linter or type-checker silencing comment of any kind (grep on the added lines). |
|
||||
| LOW mutation script | Carried. |
|
||||
|
||||
### 5.2 What the delta reads like
|
||||
|
||||
`local_url_target` accepts only: CSS space, an optional quote, `#`, a run of `[A-Za-z0-9_.:-]`
|
||||
that satisfies `is_reference_name` (first character `[A-Za-z_]`), the same quote, CSS space,
|
||||
`)`. `url_openings` skips a `url(` glued to a longer name (`continues_identifier`: ASCII
|
||||
alphanumeric, `_`, `-`, `\`, anything above U+007F). Every `urls_are_local` false is an active
|
||||
removal, so the file is refused, never cleaned. After a strict `url(...)` is cut out and the
|
||||
strict colour functions are removed, `calls_only_local_url` keeps a value only if no `(` is
|
||||
left. In the composer, `references_scoped` runs after `scope_ids` and before the layer is
|
||||
added, and `ops.rs:480` maps its failure to `svg_rejected` / `unscoped_reference`.
|
||||
|
||||
### 5.3 Re-attack, item by item
|
||||
|
||||
Everything below was thrown at the strict reader and compared with a browser model (5.7).
|
||||
|
||||
- Percent escapes, quoted and unquoted: `url(#%61)`, `url('#%61')`, `url(#a%61)`, `url(#a.%2e)`,
|
||||
`%23`, `%00`, `%20`. The id run stops at `%`, which is not followed by a quote, a space or
|
||||
`)`, so the value is not local and the file is refused. Same for `href="#%61"` and
|
||||
`xlink:href` (strict `#` + name).
|
||||
- Every C0 control and Unicode space, inside and around the quotes: an exhaustive sweep of
|
||||
8 positions (before `url(`, after `url(`, after the quote, between `#` and the id, inside the
|
||||
id, at the id end, after the closing quote, before `)`) x 3 quote modes x 100 characters
|
||||
(U+0001 to U+0020, U+007F, U+0080 to U+00A0, U+1680, U+180E, U+2000 to U+200F, U+2028,
|
||||
U+2029, U+202F, U+205F, U+3000, U+FEFF, U+FFFD, `/**/`, `/*x*/`, `%`-forms, fullwidth `#`
|
||||
and `'`) = 2,400 values. 163 are accepted; every one has only CSS space (space, tab, LF,
|
||||
CR, FF) at the four legal slots, or a character before `url(` that is not part of the
|
||||
reference; 0 differ from the browser model. A NBSP or U+3000 after the quote or before the
|
||||
closing quote is refused, which is the Chromium/Firefox divergence of the first round.
|
||||
Controls other than tab, LF and CR cannot be carried by XML 1.0 at all.
|
||||
- CSS comments inside `url(`: `url(/**/#a)` is, in a browser, an unquoted URL whose text is
|
||||
`/**/#a` (a relative fetch); the reader refuses it (`/` is neither a quote nor `#`). `url(#a/**/)`,
|
||||
`url('#a'/**/)`, `url(/**/'#a')` are refused. `/**/url(#%61)` has a non-name character in
|
||||
front and is read as an opening, then refused on the `%`.
|
||||
- Escapes: a backslash still refuses the value for every attribute, before anything else runs
|
||||
(`value_acceptable`, `value_is_active`); unchanged.
|
||||
- `URL(`, `Url(`: ASCII-lowercase scan with identical byte offsets; no non-ASCII character
|
||||
folds to `url`.
|
||||
- Nested or repeated: `url(url(#a))`, `url(#a)url(#a)`, `url(#a) url(x)`: every opening must
|
||||
be strict. The 25,000-reference `%61` flood is refused as active content
|
||||
(`svg_clean.rs:346` test); the plain flood is `too_complex` as before.
|
||||
- `url(` inside a colour: `rgb(1,url(#a),3)` and `url(#a rgb(1,2,3))` leave a `(` or fail the
|
||||
strict window and are refused.
|
||||
- `)` inside quotes: `url(')')`, `url('#a)')` are refused (id then wrong closer).
|
||||
- `xlink:href` against `href`: both need `#` + a reference name after an ASCII trim (space, tab,
|
||||
LF, CR, FF); NBSP does not trim; `#a\tb`, `#a%61`, `# a` are refused. The composer demands
|
||||
`#fv.<view>.` on both. A prefixed `x:href` is not on the allowlist; `xlink:href` must sit in
|
||||
the xlink namespace.
|
||||
- Ids with `.` or `:`: `url(#a.b:c-d_e)` is accepted, scoped as `fv.main.a.b:c-d_e`, and a browser
|
||||
reads the same string. `svgView(` and `xpointer(` need `(`, which the id grammar excludes.
|
||||
`url(#-a)`, `url(#1a)`, `url(#é)` are refused.
|
||||
- Glued names with non-ASCII letters: `érgb(1,2,3)`, `éurl(#%61)`, ` url(`. A browser reads
|
||||
every code point above U+007F as part of the name, so these are single longer function names;
|
||||
the reader agrees and leaves the `(` in place, which refuses the value on a presentation
|
||||
attribute. A digit in front (`1url(`) is a dimension plus a block in a browser, never a fetch;
|
||||
the reader treats it as glued as well. A non-name character in front (`%`, `+`, `,`, `"`, `#`,
|
||||
`@`) keeps the `url(` an opening, so it must be strict.
|
||||
- A `(` surviving in a kept value: none. After the strict `url(...)` cut and the strict
|
||||
`rgb(`/`rgba(` removal, any remaining `(` refuses the value. In 2.5 million mutated accepted
|
||||
values (fill and style), the browser model saw only `url` tokens equal to a reader target
|
||||
and no function other than `rgb` or `rgba`.
|
||||
|
||||
### 5.4 The composer check
|
||||
|
||||
`references_scoped` (compose.rs:105) walks the whole tree once, root included, and demands
|
||||
`#fv.<view>.` on every `href` and `xlink:href`, and for every other attribute whose
|
||||
lowercased value contains `url(`: `urls_are_local` and every target starting with the scope.
|
||||
Anything a sanitised drawing can still carry as a reference is one of those: the presentation
|
||||
attributes and `style` are the only CSS-parsed attributes on the allowlist that take a `<url>`
|
||||
(`fill`, `stroke`, `filter`, `mask`, `clip-path`), `d`, `transform` and the rest are not read
|
||||
as CSS fetches, and no other attribute names an element. The layer is added afterwards and
|
||||
carries no `id`, `href` or `url(`: its colours are validated as hex at deserialisation
|
||||
(schema.rs:89, `js::is_hex_color`). It cannot be bypassed by a value the reader accepts. Its
|
||||
limit is that it shares the parser: it is a guard on `scope_ids`, not a second opinion on the
|
||||
reader (reported, LOW).
|
||||
|
||||
### 5.5 Cost
|
||||
|
||||
No new quadratic walk. `references_scoped` is one pass with one lowercase copy per attribute
|
||||
value. `url_openings` searches forward from the last match; each opening's space and id runs
|
||||
end before the next opening's `(`, so runs do not overlap; `colour_function_end` adds one byte
|
||||
test. Slice indexes sit on ASCII boundaries (`#`, `)`, `u`, `r`), so no panic path appeared.
|
||||
Measured on a transliteration (5.7): 11 adversarial families (`url(#a) ` x N, `xurl(` x N,
|
||||
`url(` plus N spaces, `url(#aaa…`, `url(#a` x N overlapping, `rgb(1,2,3) ` x N, `rgb(1,url(#a),3)`
|
||||
x N, and others) doubled from 50k to 200k units: every ratio between 1.85 and 2.13. A first run
|
||||
showed a 4.5x ratio on the `rgb(1,2,3) ` family; that was the Python slice copy `text[at:]`, which
|
||||
the Rust `&text[at..]` does not make, and an offset-based port is linear.
|
||||
|
||||
### 5.6 Reported findings, detail
|
||||
|
||||
- MEDIUM, scope key (carried). The requirement is written in two places and nothing enforces it.
|
||||
Today it has no victim: the only users of `view.canvas` in the app are the editor canvas and
|
||||
its detail modal, which draw views of one document, with different view ids and therefore
|
||||
different scopes. It becomes a defect on the first page that inlines two documents or two
|
||||
versions at once. Keep it as an entry criterion of that page (a per-handle token in
|
||||
`id_scope`, or a test that mounts two canvases with the same view id and fails).
|
||||
- LOW, composer shares the parser. A coarse second opinion would not share the code: after
|
||||
scoping, count the case-insensitive `url(` substrings of each value and require the count to
|
||||
equal `url_targets(...).len()`. It would also fail closed on a glued `xurl(` kept on a
|
||||
non-presentation attribute, which is harmless but unwanted in a drawing.
|
||||
- LOW, tests deliver a space. roxmltree turns a raw TAB, LF or CR in attribute text into a space
|
||||
(parse.rs:1364), so the rows `url('#\ta')`, `url('#a\tb')`, `url(\n#a)` and the hostile loop's
|
||||
`url('#\tg')` test a space. A character reference (`	`) stays a tab per XML 1.0 §3.3.3; I
|
||||
could not read that branch of the parser (see 5.8). The reader is right on a tab (the model
|
||||
and the slot sweep refuse it), but a regression that skipped only tabs would pass the suite.
|
||||
- LOW, carried: TS oracle and mutation script, see the block.
|
||||
- Not a finding, product note: a reference to an id the grammar rejects (`url(#1a)`, `url(#é)`,
|
||||
for example an Illustrator export that keeps accented layer names as ids) now refuses the whole
|
||||
file with `svg_active_content`, where it used to pass unread. That is the owner's strict
|
||||
rule (§9.2), but the label tells the admin "active content" for what is only an unsupported id.
|
||||
|
||||
### 5.7 Method and what the probes are
|
||||
|
||||
- Run for real: `cargo test -p faunosteo-core --test svg_clean --test svg_scope` (21 passed,
|
||||
0.73 s) and `cargo test -p faunosteo-core --lib anatomy::svg` (24 passed), in the worktree.
|
||||
- The built wasm module cannot serve this round: `packages/core-wasm/pkg` is dated 16:28 and the
|
||||
delta's sources 16:46 and 16:48, so it still holds the first-round code. No build was started.
|
||||
- The fuzz and the sweeps ran on a Python transliteration of `url_openings`,
|
||||
`local_url_target`, `url_targets`, `scope_url_targets`, `urls_are_local`,
|
||||
`calls_only_local_url`, `colour_function_end`, `without_colour_functions` and the value rules
|
||||
of `value_acceptable`, typed in from sanitize.rs at a678faa, fed on stdin (no file written).
|
||||
Before use it was checked against the repo's own assertions (the 14 refused and 4 accepted
|
||||
`url` rows of svg_clean, the 5 glued or loose colour rows, the colour accepted and refused
|
||||
lists, the scoping unit test): all passed. It is not the compiled code.
|
||||
- The oracle is a second, independent piece: a CSS Syntax Level 3 tokenizer (comments, strings,
|
||||
numbers and dimensions, name code points above U+007F, `url(` unquoted token versus function,
|
||||
bad-url) plus the URL Standard reading of a reference (strip C0 and space at the ends, remove
|
||||
tab and newline, percent-decode the fragment). The property checked, per accepted value in a
|
||||
`fill` and in a `style` context: every URL the browser model resolves is exactly `#id` with
|
||||
the id one of the reader's targets, nothing external, no function other than `rgb` or `rgba`.
|
||||
After scoping, the same holds with the `fv.main.` prefix and `references_scoped` passes.
|
||||
- Volume: 400,000 grammar-generated strings, 3,000,000 and 2 x 2,500,000 mutants of 10 to 11
|
||||
valid seeds (inserting, deleting or replacing from a 60-fragment vocabulary that includes
|
||||
`%61`, tabs, controls, Unicode spaces, comments, quotes, `url(`, `rgb(`, backslash), each in
|
||||
both contexts: 0 dangerous mismatches. About 543,000 accepted values carried a browser URL.
|
||||
10,582 accepted values had a reference inside a comment or a string that the reader counts and
|
||||
the browser ignores: the safe direction (over-counting for the dangling check and the budget).
|
||||
- Control: the same harness on the pre-delta rules (`skip_url_prefix` plus longest id run)
|
||||
reported 52,752 divergent values out of 177,587 accepted (`url(#éa)`, `url(#a%'6)`, `url(#g'-h%2e)`),
|
||||
so the harness does detect the class the first round found.
|
||||
- Not run: any browser. The first round's Chromium and Firefox results are the only browser
|
||||
evidence; this round's browser behaviour comes from the specifications as modelled. WebKit was
|
||||
never probed. semgrep did not run (registry packs, no network). The guardrails scanner ran:
|
||||
0 FAIL, 28 WARN, none in the delta's files.
|
||||
|
||||
### 5.8 Commands refused
|
||||
|
||||
- A scratch cargo crate (path dependency on the worktree's core, own target directory, to run
|
||||
the real functions on the new spellings) was refused by the permission rules: "Permission to
|
||||
use Bash with command … has been denied", no rule named. My contract also forbids writing a
|
||||
code file outside this report, so I did not retry it by another tool or route; the Python
|
||||
transliteration above is the substitute and is weaker than running the Rust.
|
||||
- A `sed` on `parse.rs` of roxmltree in the cargo registry after a `cd` with a glob was refused
|
||||
with the deny rule `**/secrets/**`; not retried. The raw-whitespace normalisation at
|
||||
parse.rs:1364 had been read earlier through a `grep`; the character-reference branch was not.
|
||||
- Nothing else was written: `git status` in the worktree showed a clean tree before this
|
||||
section, and this file is the only one touched.
|
||||
@@ -0,0 +1,117 @@
|
||||
# V1-2.2 evidence (2026-10-29)
|
||||
|
||||
Owner brief « Autorisation de démarrer V1-2.2 », V1-2.1 VERIFIED at `ac71c5b`. Worktree
|
||||
`feature/v1-2-anatomical-sheets`. Code commits `64a4384`, `cf37aa2`, `8ae7565`, docs `741c25c`.
|
||||
Contract `docs/development/V1-2_ANATOMICAL_SHEETS.md` §16.3; verifier contract
|
||||
`.claude/tasks/contracts/2026-10-29-v1-2-2-core.md`; record `docs/development/RUST.md` §12.
|
||||
|
||||
## 1. Owner answers taken before the code (contract §17.4)
|
||||
|
||||
| Question | Answer |
|
||||
|---|---|
|
||||
| No Inkscape, Illustrator, Figma or Affinity on the machine: how to get real editor exports | the owner supplies them (`crates/core/tests/fixtures/svg/exports/owner/`); cairo and ImageMagick exports committed meanwhile |
|
||||
| Strict-parse failure code (§6.5 vs §6.7) | `verification.integrity.document` |
|
||||
| Draft preview with caps excess or missing drawings | reported for drafts, refused for published and deprecated versions |
|
||||
|
||||
## 2. Gates on the working tree before the commits
|
||||
|
||||
| Gate | Result |
|
||||
|---|---|
|
||||
| `pnpm rust:check` | exit 0; 201 cargo result lines, 1 849 passed, 0 failed, 3 ignored (every feature run of the script); clippy `-D warnings` clean; `cargo deny`: bans, licenses, sources ok |
|
||||
| `pnpm wasm:build` | 1 771 003 B raw, 582 722 B gzip -9 (script); core-wasm proofs green |
|
||||
| `pnpm check` | exit 0; core-wasm 16 files 65 tests, supabase 11 files 128 tests, app 65 files 566 tests; lint clean; app build done |
|
||||
| size budget (`packages/core-wasm/tests/size.test.ts`) | 592 136 B by Node's gzip ≤ 600 000 B (531 715 B before V1-2.2) |
|
||||
|
||||
The first build was 635 654 B gzip (over budget): serde's tagged readers for `EditCommand` /
|
||||
`NewElement` and an owned-`Value` read of the document each compiled a second copy of the
|
||||
schema's reader. Reading both through `&Value` gave 606 750 B, then 582 722 B.
|
||||
|
||||
## 3. New suites (cargo, debug)
|
||||
|
||||
| Suite | Tests | Notes |
|
||||
|---|---|---|
|
||||
| `sheet_size` | 6 | 17 PostgreSQL vectors (PGlite 17.5, `oracles/v1-2-2/size.json`); seed 184 105 B = the real image's value |
|
||||
| `sheet_review` | 9 | equine 188 / 31 / 620 over 839 elements, 30 groups |
|
||||
| `sheet_verdict` | 13 | at every cap: 493 ms debug, 107 ms release, document 1 165 850 B |
|
||||
| `sheet_preview` | 8 | index tables and canvases equal to the bundled `LoadedSheet` |
|
||||
| `sheet_edit` | 11 | 400 random commands on two documents |
|
||||
| `svg_clean` | 8 | 42 hostile files; 3 000 generated: 123 clean, 2 697 cleanable (fixpoint), 180 cycles refused |
|
||||
| `packages/core-wasm/tests/preview.test.ts` | 5 | shipped module; `clean_svg` slowest 0.4 ms over 45 inputs |
|
||||
|
||||
## 4. Mutation run
|
||||
|
||||
Script: `.claude/audits/2026-10-29-v1-2-2-mutations.py` (run from the repository root: each mutant applied, its suite run, the file restored).
|
||||
|
||||
| Mutant | Suite | Result |
|
||||
|---|---|---|
|
||||
| caps `>` → `>=` | sheet_verdict | killed |
|
||||
| digest without its group key | sheet_review | killed by `a_removal_digest_is_bound_to_its_group_key`, written for it before the run |
|
||||
| event handlers not active | svg_clean | killed |
|
||||
| drawing hash unchecked | sheet_verdict | killed |
|
||||
| content update keeps `reviewed` | sheet_edit | killed |
|
||||
| fingerprint unchecked at load | sheet_preview | killed |
|
||||
| `inherited` counted as read | sheet_review | survived the first run; killed once `an_inherited_element_alone_keeps_its_group_uncoverable` was added |
|
||||
| redrawn views ignored | sheet_edit | killed |
|
||||
| numeric scale ignored | sheet_size | killed |
|
||||
| removal groups never made | sheet_review | killed |
|
||||
|
||||
## 5. DEV and protected branches
|
||||
|
||||
- No Supabase CLI call, no SQL, no migration, no seed, no worker start in this step. The DEV
|
||||
containers (`supabase_*_faunosteo`) were read with `docker ps` / `docker inspect` only: started
|
||||
2026-10-28 14:45 UTC, before this session (`supabase_auth_faunosteo` restarts=3 already then).
|
||||
Snapshot before the gate: `scratchpad/docker-inspect-before.txt`; after: section 6.
|
||||
- No merge, no checkout of `develop`, `main` or `release/*`; commits only on
|
||||
`feature/v1-2-anatomical-sheets`, pushed by the post-commit hook.
|
||||
|
||||
## 6. Gates on the committed branch and reviews
|
||||
|
||||
| Commit | `pnpm check:all` | Reviews |
|
||||
|---|---|---|
|
||||
| `741c25c` | exit 0, every stage, e2e:ui PASSED | verifier ECARTS(6); security PASS (2 MEDIUM, 2 LOW) — fixed in `8294d54` |
|
||||
| `8294d54` | exit 0 | verifier ECARTS(3) (A6 owner exports, A12 outside its commands, helper unrecorded); security PASS (4 MEDIUM, 8 LOW) — fixed in `ca31b78` except the owner decisions of RUST.md §12.6 |
|
||||
| `ca31b78` | exit 0; cargo 1 879 passed 0 failed; vitest core-wasm 65, supabase 128, app 566; e2e:ui PASSED; module 596 671 B (Node gzip) ≤ 600 000 | — |
|
||||
|
||||
The first two reviewers (Fable 5.1) stopped at once on exhausted usage credits and produced nothing; they ran again on Opus.
|
||||
`e2e:shell` not run (needs the sandbox stack; no screen changed).
|
||||
|
||||
Containers after the gates (`docker inspect`, read-only): identical to the snapshot of section 5 (DEV
|
||||
`supabase_*_faunosteo` and the V1-2.1 sandbox: same start times and restart counts).
|
||||
|
||||
Known: commit `64a4384` alone does not build (`facade::clean_svg` names the module of `cf37aa2`); the branch head does.
|
||||
|
||||
## 7. Owner arbitrations at the checkpoint (brief « V1-2.2 : arbitrages du propriétaire et finalisation », on 17d9199)
|
||||
|
||||
Owner answers (2026-10-29, contract §17.4 last six rows): references refused when dangling and canvas ids scoped per
|
||||
view, implemented in V1-2.2 (not deferred); one stored form for every upload, verdict and preview refusing another;
|
||||
strict numeric colours kept; `remove` refused atomically while named; Inkscape fetched for real exports; the wasm debug
|
||||
`name` section dropped. Commits: `e823655` (SVG), `bb5efa0` (removal), `661212a` (build flag), `93e4e81` (docs),
|
||||
`5281337` (contract criteria B1-B8, mutation script), `a678faa` (strict `url(` after the security review), then the
|
||||
review LOWs and this evidence.
|
||||
|
||||
| Gate | Result |
|
||||
|---|---|
|
||||
| `pnpm check:all` on `5281337` | exit 0; cargo 1 949 passed, 0 failed, 3 ignored; core-wasm 65, supabase 128, app 566; e2e:ui 26 passed; app image, worker test stage, worker runtime image |
|
||||
| `pnpm check:all` on `a678faa` | exit 0; cargo 1 959 passed, 0 failed, 3 ignored; same suites green; module 1 512 071 B raw, 558 793 B gzip -9, 568 625 B by Node's gzip (budget 600 000, margin 31 375 B) |
|
||||
| first run on the working tree | stopped at the committed-types guard only (`DrawingResult.ts`, `SvgCleaning.ts` regenerated, not yet committed); every stage before it green |
|
||||
| mutations (`2026-10-29-v1-2-2-mutations-arbitrations.py`) | A1-A12 on 5281337: 12 killed (A11 first written so it did not compile, rewritten, killed); A13-A17 after a678faa: 4 killed, A17 (`%` taken into the id run) survives as an equivalent mutant, `is_reference_name` refusing `%` either way (A14 kills the grammar check itself) |
|
||||
| protected readers, N-1 copies, frozen oracles, goldens, `supabase/` | no file changed (`git diff --name-only 17d9199`) |
|
||||
| DEV and sandbox containers | `docker inspect` identical before and after every gate (start times, restart counts) |
|
||||
|
||||
Reviews (fresh; the pinned Fable 5.1 had no credits left and the Opus alias answered `model_not_found`, so both ran on
|
||||
Sonnet):
|
||||
|
||||
| Round | Verifier | Security |
|
||||
|---|---|---|
|
||||
| `17d9199..5281337` | ECARTS(2): B4 LOW (`érgb(`, `rgurl(#b(` passed the colour exception), A6 open; doc drift | BLOCK(1) HIGH: `url(#%61)` (and Chromium's `url('#<TAB>a')`) passed the dangling check, the scoping and the expansion budget, resolving in Chromium 1248 and Firefox 1555 (budget hole pre-existing since R3); MEDIUM scope unique per document only; 3 LOW |
|
||||
| `5281337..a678faa` | ECARTS(2): A6 open; B10 LOW (stale size figures, one wording in ANNOTATION-RENDERING); owner procedure not precise enough | PASS; MEDIUM carried as a written requirement; LOWs: composer check shares the reader's parser, no test delivers a real tab, TS helper oracle, mutation script |
|
||||
| `pnpm check:all` on `f1ef6a4` (final code) | exit 0; cargo 1 959 passed, 0 failed; core-wasm 65, supabase 128, app 566; e2e:ui 26; Docker stages; module 1 512 413 B raw, 558 859 B gzip -9, 568 696 B by Node's gzip (margin 31 304 B) | — |
|
||||
| after | the LOWs fixed in `f1ef6a4`: sizes, wording and counts in RUST.md; a coarse `url(` count in the composer check that shares no parser; `	`, ` `, ` ` spellings in `svg_clean`; the owner procedure rewritten (same source file, live-text variants, `--nocapture`, date in the name, Affinity) | — |
|
||||
|
||||
Inkscape provenance: not installed; inkscape.org 504 then timeout; `apt-get download` of `inkscape_1.4.3-0ubuntu2_amd64.deb`
|
||||
(sha256 `24a2e9225c2cdcaad8f3e36a8b7a0f5a68db58ed67fc6f67455395fdd918326e`, equal to `apt-cache show`) and 22 library
|
||||
packages into the session scratch folder, `dpkg-deb -x`, run with `LD_LIBRARY_PATH` (no install, no sudo).
|
||||
|
||||
Open at the checkpoint: A6 (Illustrator, Figma, Affinity exports from the owner); the MEDIUM (a page inlining two
|
||||
documents needs a per-document prefix); the probe folder of the first security review, whose deletion the permission
|
||||
rules refused (`scratchpad/probe-audit` of session 0cee2841), to be removed by the owner.
|
||||
@@ -0,0 +1,35 @@
|
||||
# V1-2.2 owner arbitrations, mutation run (evidence .claude/audits/2026-10-29-v1-2-2-evidence.md §7 (A1-A12 on 5281337, A13-A17 after the security review)): each
|
||||
# mutant is applied to its source file, its cargo suite runs (`lib` = the crate's unit tests), the file is
|
||||
# restored. Run from the repo root.
|
||||
import subprocess
|
||||
muts=[
|
||||
('A1 reader accepts dangling','crates/core/src/anatomy/svg/mod.rs',' refs::check_targets(&sanitized.root)?;\n','','svg_scope'),
|
||||
('A2 cleaning accepts dangling','crates/core/src/anatomy/svg/clean.rs','check_targets(&read.root)','Ok::<(), super::tree::SvgRejection>(())','svg_clean'),
|
||||
('A3 canvas ids not scoped','crates/core/src/anatomy/compose.rs',' scope_ids(&mut root, &id_scope(view_id));\n','','svg_scope'),
|
||||
('A4 url() references not scoped','crates/core/src/anatomy/compose.rs'," _ if attr.value.contains('(') => scope_url_targets(&attr.value, scope),"," _ if false => scope_url_targets(&attr.value, scope),",'svg_scope'),
|
||||
('A5 verdict ignores the stored form','crates/core/src/domain/sheet/verdict.rs',' Ok(read) if stored_form(&read.root) != text =>',' Ok(read) if false && stored_form(&read.root) != text =>','sheet_verdict'),
|
||||
('A6 preview ignores the stored form','crates/core/src/domain/sheet/preview.rs',' if stored_form(&root) != text {',' if false {','sheet_preview'),
|
||||
('A7 cleaning uploads the original bytes','crates/core/src/anatomy/svg/clean.rs',' accepted(outcome, stored, preview, read.removed)',' accepted(outcome, String::from_utf8_lossy(bytes).into_owned(), preview, read.removed)','svg_clean'),
|
||||
('A8 removal ignores dependents','crates/core/src/domain/sheet/edit.rs',' if named_elsewhere {',' if false && named_elsewhere {','sheet_edit'),
|
||||
('A9 colour bound unchecked','crates/core/src/anatomy/svg/sanitize.rs',' if value > limit || bytes.get(index) != Some(&separator) {',' if bytes.get(index) != Some(&separator) {','svg_clean'),
|
||||
('A10 glued name accepted','crates/core/src/anatomy/svg/sanitize.rs',' _ if glued => return None,',' _ if false && glued => return None,','lib'),
|
||||
('A11 mixed units accepted','crates/core/src/anatomy/svg/sanitize.rs',' _ if *percentages.get_or_insert(percent) != percent => return None,',' _ if *percentages.get_or_insert(percent) != percent && false => return None,','lib'),
|
||||
('A12 rgba with three components','crates/core/src/anatomy/svg/sanitize.rs',' _ if rest.starts_with("rgba(") => (4, 5),',' _ if rest.starts_with("rgba(") => (3, 5),','svg_clean'),
|
||||
('A13 quote left unmatched','crates/core/src/anatomy/svg/sanitize.rs',' if bytes.get(index) != Some("e) {\n return None;\n }\n index += 1;',' if bytes.get(index) == Some("e) {\n index += 1;\n }','svg_clean'),
|
||||
('A14 any id after #','crates/core/src/anatomy/svg/sanitize.rs',' if !is_reference_name(&value[id_start..id_end]) {',' if false {','svg_clean'),
|
||||
('A15 glued url( read as url(','crates/core/src/anatomy/svg/sanitize.rs',' if !glued {\n return Some(from);',' if true || !glued {\n return Some(from);','svg_clean'),
|
||||
('A16 colour glued to what follows','crates/core/src/anatomy/svg/sanitize.rs',' ends.then_some(at + index)',' Some(at + index)','svg_clean'),
|
||||
('A17 percent-escaped id read as local','crates/core/src/anatomy/svg/sanitize.rs'," .take_while(|b| b.is_ascii_alphanumeric() || matches!(b, b'_' | b'.' | b':' | b'-'))"," .take_while(|b| b.is_ascii_alphanumeric() || matches!(b, b'_' | b'.' | b':' | b'-' | b'%'))",'svg_scope'),
|
||||
]
|
||||
for name,path,old,new,suite in muts:
|
||||
src=open(path).read()
|
||||
if src.count(old)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',src.count(old)); continue
|
||||
open(path,'w').write(src.replace(old,new))
|
||||
target='--lib' if suite=='lib' else f'--test {suite}'
|
||||
try:
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core {target} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
@@ -0,0 +1,28 @@
|
||||
# V1-2.2 mutation run (evidence .claude/audits/2026-10-29-v1-2-2-evidence.md §4): each mutant is
|
||||
# applied to its source file, its cargo suite runs, the file is restored. Run from the repo root.
|
||||
import subprocess, shutil, sys
|
||||
root='.'
|
||||
muts=[
|
||||
('M1 caps off by one','crates/core/src/domain/sheet/caps.rs','.filter(|&(_, value, limit)| value > count(limit))','.filter(|&(_, value, limit)| value >= count(limit))','sheet_verdict'),
|
||||
('M2 digest without key','crates/core/src/domain/sheet/review.rs',' object.insert("group".to_owned(), Value::String(key.to_owned()));\n','','sheet_review'),
|
||||
('M3 no active class','crates/core/src/anatomy/svg/sanitize.rs',' if local.starts_with("on") {\n return true;\n }',' if local.starts_with("on") {\n return false;\n }','svg_clean'),
|
||||
('M4 hash unchecked','crates/core/src/domain/sheet/verdict.rs',' if sha256_hex(bytes) != row.sha256 {',' if false && sha256_hex(bytes) != row.sha256 {','sheet_verdict'),
|
||||
('M5 update keeps reviewed','crates/core/src/domain/sheet/edit.rs',' if changed {\n set_annotation_status(&mut next, ReviewStatus::ToConfirm);\n }','','sheet_edit'),
|
||||
('M6 fingerprint unchecked','crates/core/src/domain/sheet/preview.rs',' if stored.is_none() || stored != self.fingerprint.as_deref() {',' if false {','sheet_preview'),
|
||||
('M7 inherited not counted unread','crates/core/src/domain/sheet/review.rs',' self.to_confirm == 0 && self.inherited == 0',' self.to_confirm == 0','sheet_review'),
|
||||
('M8 redrawn views ignored','crates/core/src/domain/sheet/edit.rs',' reconfirm_redrawn_views(&mut next, &drawn_before);\n','','sheet_edit'),
|
||||
('M9 numeric scale ignored','crates/core/src/domain/sheet/size.rs','if scale > 0 {','if false {','sheet_size'),
|
||||
('M10 removal never made','crates/core/src/domain/sheet/review.rs',' if !groups.iter().any(|g| g.key == key) {',' if false {','sheet_review'),
|
||||
]
|
||||
for name,path,old,new,suite in muts:
|
||||
src=open(path).read()
|
||||
if src.count(old)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',src.count(old)); continue
|
||||
open(path,'w').write(src.replace(old,new))
|
||||
try:
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core --test {suite} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
killed=('FAILED' in out) or ('error' in out.lower() and 'could not compile' in out)
|
||||
print(f"{name}: {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}")
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,45 @@
|
||||
# V1-2.2 reserved ids and root visibility (owner briefs 2026-10-30), mutation run (evidence
|
||||
# .claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md §4 and §7; K = reserved ids, V = root visibility): each mutant is applied to its source
|
||||
# file, its cargo suite runs (`features` set when the suite needs them), the file is restored. Run
|
||||
# from the repo root.
|
||||
import subprocess
|
||||
PDF='--features pdf-read,pdf-write'
|
||||
muts=[
|
||||
('K1 reader skips the reserved check','crates/core/src/anatomy/svg/mod.rs',' refs::check_reserved_ids(&sanitized.root)?;\n','','svg_reserved_ids',''),
|
||||
('K2 cleaning skips the reserved check','crates/core/src/anatomy/svg/clean.rs','.and_then(|()| check_reserved_ids(&read.root))','','svg_reserved_ids',''),
|
||||
('K3 exact case only','crates/core/src/anatomy/svg/refs.rs','.any(|reserved| id.eq_ignore_ascii_case(reserved))','.any(|reserved| id == *reserved)','svg_reserved_ids',''),
|
||||
('K4 prefix instead of exact name','crates/core/src/anatomy/svg/refs.rs','.any(|reserved| id.eq_ignore_ascii_case(reserved))','.any(|reserved| id.to_ascii_lowercase().starts_with("osteo-"))','svg_reserved_ids',''),
|
||||
('K5 root id not checked','crates/core/src/anatomy/svg/refs.rs',' element.attr("id").is_some_and(is_reserved_id)\n || element',' element','svg_reserved_ids',''),
|
||||
('K6 descendants not checked','crates/core/src/anatomy/svg/refs.rs',' || element.element_children().any(holds_reserved_id)',' || false','svg_reserved_ids',''),
|
||||
('K7 highlight composes a reserved id','crates/core/src/anatomy/compose.rs',' if holds_reserved_id(&asset) {\n return Err(ComposeError::ReservedId);\n }\n','','svg_reserved_ids',''),
|
||||
('K8 canvas composes a reserved id','crates/core/src/anatomy/compose.rs',' if holds_reserved_id(asset) {\n return Err(ComposeError::ReservedId);\n }\n','','svg_reserved_ids',''),
|
||||
('K9 pre-fix composer restored (no guard, halo skipped when the drawing has one)','crates/core/src/anatomy/compose.rs',' if holds_reserved_id(&asset) {\n return Err(ComposeError::ReservedId);\n }\n','','svg_reserved_ids','',
|
||||
(' if !append_to_first_defs(root) {',' if holds_reserved_id(root) {\n return;\n }\n if !append_to_first_defs(root) {')),
|
||||
('K10 halo not written','crates/core/src/anatomy/compose.rs',' add_halo_filter(&mut asset);','','pdf_session',PDF),
|
||||
('K11 reason renamed','crates/core/src/anatomy/svg/tree.rs','Self::ReservedId => "reserved_id"','Self::ReservedId => "dangling_reference"','svg_reserved_ids',''),
|
||||
('V1 reader skips the root visibility check','crates/core/src/anatomy/svg/mod.rs',' sanitize::check_root_visibility(&sanitized.root)?;\n','','svg_root_visibility',''),
|
||||
('V2 cleaning skips the root visibility check','crates/core/src/anatomy/svg/clean.rs','\n .and_then(|()| check_root_visibility(&read.root))','','svg_root_visibility',''),
|
||||
('V3 exact case only','crates/core/src/anatomy/svg/sanitize.rs',' .eq_ignore_ascii_case("visible")',' .eq("visible")','svg_root_visibility',''),
|
||||
('V4 whitespace not trimmed','crates/core/src/anatomy/svg/sanitize.rs',' .trim_matches(is_css_space)\n','','svg_root_visibility',''),
|
||||
('V5 denylist of hidden only','crates/core/src/anatomy/svg/sanitize.rs',' .eq_ignore_ascii_case("visible")',' .ne("hidden")','svg_root_visibility',''),
|
||||
('V6 canvas composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''),
|
||||
('V7 highlight composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(&asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''),
|
||||
('V8 PDF gate accepts a hidden root','crates/core/src/anatomy/svg/mod.rs',' sanitize::check_root_visibility(&sanitized.root)?;\n','','pdf_session',PDF),
|
||||
('V9 reason renamed','crates/core/src/anatomy/svg/tree.rs','Self::RootVisibility => "root_visibility"','Self::RootVisibility => "reserved_id"','svg_root_visibility',''),
|
||||
]
|
||||
for name,path,old,new,suite,features,*more in muts:
|
||||
src=open(path).read()
|
||||
mutant=src
|
||||
for o,n in [(old,new)]+list(more):
|
||||
if mutant.count(o)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',mutant.count(o)); mutant=None; break
|
||||
mutant=mutant.replace(o,n)
|
||||
if mutant is None:
|
||||
continue
|
||||
open(path,'w').write(mutant)
|
||||
try:
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core {features} --test {suite} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
@@ -0,0 +1,56 @@
|
||||
# V1-2.2 three MEDIUM (owner brief « arbitrages propriétaire sur les trois MEDIUM », 2026-10-30),
|
||||
# mutation run: F = frame (defect 3), I = isolation and hitbox (defects 1, 2), K/V = the reserved-id
|
||||
# and root-visibility protections re-checked on the new composer. Each mutant is applied to its
|
||||
# source file, its cargo suite runs, the file is restored. Run from the repo root.
|
||||
import subprocess
|
||||
PDF='--features pdf-read,pdf-write'
|
||||
muts=[
|
||||
('F1 every bound in frame','crates/core/src/anatomy/frame.rs',' bounds.min_x >= self.min_x - slack\n',' true || bounds.min_x >= self.min_x - slack\n','sheet_frame',''),
|
||||
('F2 right edge unchecked','crates/core/src/anatomy/frame.rs',' && bounds.max_x <= self.min_x + self.width + slack\n','','sheet_frame',''),
|
||||
('F3 bottom edge unchecked','crates/core/src/anatomy/frame.rs',' && bounds.max_y <= self.min_y + self.height + slack\n','','sheet_frame',''),
|
||||
('F4 view_box ignored, drawing frame always','crates/core/src/anatomy/frame.rs',' match view.view_box() {',' match None::<&crate::domain::sheet::ViewBox> {','sheet_frame',''),
|
||||
('F5 zero width accepted','crates/core/src/anatomy/frame.rs',' && width > 0.0\n','','sheet_frame',''),
|
||||
('F6 trailing numbers accepted','crates/core/src/anatomy/frame.rs',' [min_x, min_y, width, height] =>',' [min_x, min_y, width, height, ..] =>','sheet_frame',''),
|
||||
('F7 circle radius ignored','crates/core/src/anatomy/frame.rs',' min_x: c.cx - c.r,',' min_x: c.cx,','sheet_frame',''),
|
||||
('F8 unreadable path accepted','crates/core/src/anatomy/frame.rs',' None => Placement::Unreadable,',' None => Placement::InFrame,','sheet_frame',''),
|
||||
('F9 cubic extremes skipped','crates/core/src/anatomy/path.rs',' let a = -p0 + 3.0 * p1 - 3.0 * p2 + p3;\n',' return [None, None];\n let a = -p0 + 3.0 * p1 - 3.0 * p2 + p3;\n','sheet_frame',''),
|
||||
('F9b quadratic extreme skipped','crates/core/src/anatomy/path.rs',' let denominator = p0 - 2.0 * p1 + p2;\n',' return None;\n let denominator = p0 - 2.0 * p1 + p2;\n','sheet_frame',''),
|
||||
('F10 arc extremes skipped','crates/core/src/anatomy/path.rs',' if ellipse.sweeps(angle) {',' if false && ellipse.sweeps(angle) {','sheet_frame',''),
|
||||
('F11 trailing garbage accepted','crates/core/src/anatomy/path.rs',' if !cursor.done() {\n return None;\n }\n pen.bounds',' pen.bounds','sheet_frame',''),
|
||||
('F12 missing drawing frame not reported','crates/core/src/anatomy/frame.rs',' faults.push(FrameFault::NoFrame { view_index });\n','','sheet_frame',''),
|
||||
('F13 verdict ignores frame issues','crates/core/src/domain/sheet/verdict.rs',' .chain(frame_failures(&report))\n','','sheet_frame',''),
|
||||
('F14 verdict measures nothing','crates/core/src/domain/sheet/verdict.rs',' report\n .issues\n .extend(frame_issues(&document.typed, |id| roots.get(id).copied()));\n','','sheet_frame',''),
|
||||
('F15 preview measures nothing','crates/core/src/domain/sheet/preview.rs',' report.issues.extend(frame_issues(&self.document, |id| {\n self.drawing(id).and_then(|d| d.as_ref().ok())\n }));\n','','sheet_frame',''),
|
||||
('F16 frame faults as rules failure','crates/core/src/domain/sheet/verdict.rs',' let rule =\n |code: &str| ![super::report::GEOMETRY_MISSING, OUT_OF_FRAME, NO_FRAME].contains(&code);',' let rule = |code: &str| code != super::report::GEOMETRY_MISSING;','sheet_frame',''),
|
||||
('F17 slack follows the offset','crates/core/src/anatomy/frame.rs',' let slack = EDGE_TOLERANCE * self.width.max(self.height);',' let slack = EDGE_TOLERANCE * (self.width.max(self.height) + self.min_x.abs());','sheet_frame',''),
|
||||
('I1 drawing attributes back on the root','crates/core/src/anatomy/compose.rs',' .partition(|a| a.qname == "xmlns" || a.qname == "xmlns:xlink");',' .partition(|_| true);','svg_marker_isolation',''),
|
||||
('I2 layer inside the drawing group (canvas)','crates/core/src/anatomy/compose.rs',' let layer = render_composed_layer(document, view_id, &HashSet::new())?;\n root.children.push(Node::Element(checked(layer)?));\n Ok(root)\n}\n\n/// Root attributes',' let layer = render_composed_layer(document, view_id, &HashSet::new())?;\n if let Some(Node::Element(group)) = root.children.first_mut() {\n group.children.push(Node::Element(checked(layer)?));\n }\n Ok(root)\n}\n\n/// Root attributes','svg_marker_isolation',''),
|
||||
('I3 halo in the drawing group','crates/core/src/anatomy/compose.rs',' root.children.push(Node::Element(defs));',' if let Some(Node::Element(group)) = root.children.first_mut() {\n group.children.insert(0, Node::Element(defs));\n }','svg_marker_isolation',''),
|
||||
('I4 hitbox stroke not declared','crates/core/src/anatomy/layer.rs',' hitbox.push(("stroke", "none".to_owned()));\n','','svg_marker_isolation',''),
|
||||
('I5 hitbox captures on all','crates/core/src/anatomy/layer.rs',' hitbox.push(("pointer-events", "visibleFill".to_owned()));',' hitbox.push(("pointer-events", "all".to_owned()));','svg_marker_isolation',''),
|
||||
('I6 composers draw the R3 layer','crates/core/src/anatomy/layer.rs',' layer(document, view_id, states, true)',' layer(document, view_id, states, false)','svg_marker_isolation',''),
|
||||
('I7 R3 layer gets the declared hitbox (seed review drawings would change)','crates/core/src/anatomy/layer.rs',' layer(document, view_id, states, false)',' layer(document, view_id, states, true)','anatomy_layer',''),
|
||||
('K1 reader skips the reserved check','crates/core/src/anatomy/svg/mod.rs',' refs::check_reserved_ids(&sanitized.root)?;\n','','svg_reserved_ids',''),
|
||||
('K7 highlight composes a reserved id','crates/core/src/anatomy/compose.rs',' if holds_reserved_id(&asset) {\n return Err(ComposeError::ReservedId);\n }\n','','svg_reserved_ids',''),
|
||||
('K8 canvas composes a reserved id','crates/core/src/anatomy/compose.rs',' if holds_reserved_id(asset) {\n return Err(ComposeError::ReservedId);\n }\n','','svg_reserved_ids',''),
|
||||
('K10 halo not written','crates/core/src/anatomy/compose.rs',' root.children.push(Node::Element(defs));','','pdf_session',PDF),
|
||||
('V1 reader skips the root visibility check','crates/core/src/anatomy/svg/mod.rs',' sanitize::check_root_visibility(&sanitized.root)?;\n','','svg_root_visibility',''),
|
||||
('V6 canvas composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''),
|
||||
('V7 highlight composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(&asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''),
|
||||
]
|
||||
for name,path,old,new,suite,features,*more in muts:
|
||||
src=open(path).read()
|
||||
mutant=src
|
||||
for o,n in [(old,new)]+list(more):
|
||||
if mutant.count(o)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',mutant.count(o)); mutant=None; break
|
||||
mutant=mutant.replace(o,n)
|
||||
if mutant is None:
|
||||
continue
|
||||
open(path,'w').write(mutant)
|
||||
try:
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core {features} --test {suite} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out else 'SURVIVED')}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
@@ -0,0 +1,91 @@
|
||||
# V1-2.2 reserved ids: evidence (2026-10-30)
|
||||
|
||||
Owner brief « V1-2.2 : correction de sécurité PDF et poursuite A6 » on `2f1f076`. Contract
|
||||
`.claude/tasks/contracts/2026-10-30-v1-2-2-reserved-ids.md`; docs RUST.md §12.9.
|
||||
|
||||
## 1. Audit
|
||||
|
||||
- Written by the engine next to the drawing's ids: `osteo-halo` only (`compose::compose_highlight`, PDF view,
|
||||
rasterised as a document of its own, drawing ids kept). Before the fix `ensure_halo_filter` returned early when
|
||||
the drawing held a `filter#osteo-halo`; otherwise the filter went into the first `<defs>` (or a new one placed first),
|
||||
so an element holding the id earlier in document order won `url(#osteo-halo)`.
|
||||
- Not colliding: the canvas scopes every drawing id to `fv.<view>.` (page ids never start with `fv.`); the annotation
|
||||
layer writes no `id`, and its `data-*` cannot be forged (the reader removes every `data-*`); the filter's `result`
|
||||
names `haloWide` / `haloTight` resolve inside their filter only; `class="detail-zone"` styles nothing in the app CSS.
|
||||
- Historical drawings: 75 committed SVG files; `osteo-overlays` in 11 of them (legacy editor group), among them
|
||||
`supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg` (sha256 `0ea5202f…`, the DEV object). `osteo-halo` in
|
||||
none but the hostile fixture `crates/core/tests/fixtures/svg/hostile/osteo-halo-id.svg`. Hence an exact reserved set,
|
||||
not an `osteo-*` namespace.
|
||||
|
||||
## 2. Pixel proof (Chromium 156.0.8078.4, Image + canvas as `browserRasterizer.ts`, 1200 × 943, main view, `hip` selected, halo on)
|
||||
|
||||
Composed SVG written by a throwaway integration test (never committed) from the equine drawing with a body injected
|
||||
after the root's opening tag; pixels within ±24 per channel of `#b85a3f` counted.
|
||||
|
||||
| Drawing | Before (`2f1f076`) | After |
|
||||
|---|---|---|
|
||||
| equine, unchanged | composed, 1602 px | composed, 1602 px, SVG byte-identical |
|
||||
| + `<filter id="osteo-halo"><feColorMatrix values="0 …0"/></filter>` | composed, **0 px** (marker erased) | refused `reserved_id` |
|
||||
| + `<g id="osteo-halo"/><defs/>` | composed, 825 px (halo lost) | refused `reserved_id` |
|
||||
|
||||
## 3. Tests
|
||||
|
||||
`svg_reserved_ids` 9 tests; `pdf_session` + 1 (`the_pdf_refuses_a_reserved_id_and_keeps_its_own_halo`);
|
||||
`anatomy_compose` R5.7 test renamed (`the_halo_filter_is_written_once_and_a_composed_root_is_refused`, ledger row
|
||||
updated); `svg_clean` corpus line and `svg_sanitiser` declared divergence for `osteo-halo-id.svg`; core-wasm
|
||||
`preview.test.ts` three spellings on the shipped module.
|
||||
|
||||
## 4. Mutations (`2026-10-30-v1-2-2-mutations-reserved-ids.py`)
|
||||
|
||||
11 of 11 killed: reader check removed, cleaning check removed, exact case only, `osteo-` prefix, root id unchecked,
|
||||
descendants unchecked, highlight guard removed, canvas guard removed, pre-fix composer restored (guard removed and halo
|
||||
skipped when the drawing holds one), halo not written, reason renamed. A first K9 (« skip the halo when the root has an
|
||||
id ») survived: no tested drawing has a root id, a mutant with no meaning for the fix; replaced by the pre-fix restore.
|
||||
|
||||
## 5. Gates
|
||||
|
||||
- `pnpm rust:check`: green (fmt, clippy `-D warnings` on every feature set, 2032 tests summed over the feature passes,
|
||||
ts-rs export, cargo deny).
|
||||
- `pnpm check`: green (typecheck, core-wasm 65, supabase 128, app 566, lint, build). First run failed on
|
||||
`r5.census.test.ts`: the ledger still named the renamed cargo test; row updated.
|
||||
- Module: 559 360 → 560 015 B gzip -9 (+655 B), 1 513 522 → 1 513 968 B raw; Node's gzip 569 350 B (budget 600 000).
|
||||
- `pnpm check:all` on the working tree (code as committed): green, e2e:ui PASSED, app image, worker sandbox tests and
|
||||
runtime image; e2e:shell not run (needs the isolated stack, no change in its scope).
|
||||
|
||||
## 6. Independent reviews (fresh, Opus: the pinned Fable model was out of credits)
|
||||
|
||||
- Verifier: ECARTS(1) LOW, C8: a doc comment in the new `pdf_session.rs` helper held the shell expansion of `id` (an
|
||||
unquoted heredoc while writing it), leaking the local uid and groups; fixed before any commit, the diff scanned for
|
||||
other expansions (none). C1-C7, C9, C10 met; floor guard clean on the diff.
|
||||
- Security: PASS, no regression or weakened control. Reported, pre-existing, owner decision: MEDIUM root `visibility`
|
||||
(a drawing `<svg visibility="hidden">` with `visibility="visible"` children reads clean and the appended marker layer
|
||||
inherits `hidden`: 0 highlight pixels in the PDF, markers gone in the canvas too); LOW root `stroke*` inheritance onto
|
||||
the point hitbox; LOW the drawing chooses which `<defs>` receives the halo (sRGB vs linearRGB, cosmetic); LOW intended
|
||||
behaviour change (re-export of an archive or a logo holding the id refused).
|
||||
|
||||
## 7. Root visibility (brief « V1-2.2 : arbitrage définitif A6 et correction visibility », on `81f7639`)
|
||||
|
||||
- Red first: error names added, no check wired: `svg_root_visibility` 2 of 6 failed (reader accepted `hidden`,
|
||||
composers composed it), `pdf_session` 1 failed (export accepted it); a third failure was a fixture of mine (a literal
|
||||
tab is not the stored form) and the test now checks the cleaned stored form. Green once the check is wired.
|
||||
- Browser proof: RUST.md §12.10 table. Composed SVG by the core at `81f7639` (stash) and with the fix, throwaway
|
||||
integration test never committed; measured with Playwright Chromium 156, Firefox 157, WebKit 27.2 from the local cache
|
||||
(no install, every request outside about:/blob:/data: aborted). The accepted variants' SVG are byte-identical before
|
||||
and after; the three hiding roots are refused after.
|
||||
- Mutations: same script, V1 to V9 added; 20 of 20 killed (K rerun, so the reserved-id protections stay effective).
|
||||
- Gates on the working tree: `pnpm check:all` green (cargo 2065 passed / 0 failed summed over the feature passes, ts-rs
|
||||
types unchanged, wasm, core-wasm 65, supabase 128, app 566, lint, build, e2e:ui PASSED, app image, worker sandbox
|
||||
tests and runtime image; e2e:shell not run). First run stopped on an unused import in the new suite (clippy
|
||||
`-D warnings`), fixed. Fixtures: cairo, Figma, Inkscape, ImageMagick and owner-folder tests green.
|
||||
- Module: 560 015 → 560 377 B gzip -9 (+362 B); Node's gzip 569 817 B (budget 600 000).
|
||||
- Independent reviews of the working tree (fresh, Opus). Verifier ECARTS(3), all LOW: R3 the stroke properties no
|
||||
marker sets were argued harmless without proof (docs corrected, now an open finding); R7 TODO J / J6 still waited on
|
||||
Illustrator (closed by BDR-090); floor guard: assertions moved into `common/sheet_readers.rs` (clarification added to
|
||||
the contract). R1, R2, R4-R6, R8, R9 met. Security PASS (semgrep 352 rules, 0 findings), no regression, `osteo-halo`
|
||||
protections intact; three pre-existing MEDIUM marker-hiding vectors reported for the owner: root `viewBox` framing a
|
||||
view without `view_box` (all 19 equine main-view markers out of frame, horse pixel-identical, accepted Clean);
|
||||
inherited `stroke-opacity` / `stroke-dasharray` (canvas outlines gone, detail trigger 0 px in the three engines);
|
||||
inherited `stroke-width` on the point hitbox (13 of 19 equine markers send their click to the last hitbox in
|
||||
Chromium and WebKit). LOW: halo placement in a drawing-chosen `<defs>` (Firefox, WebKit lose the halo), root
|
||||
`systemLanguage` / `display` canvas-PDF divergence (whole view), colour camouflage (inherent). Not built: the class fix
|
||||
changes the R3 highlight oracle and the R4 digests (owner brief: stop before such a change).
|
||||
@@ -0,0 +1,82 @@
|
||||
# V1-2.2 three MEDIUM: evidence (2026-10-30)
|
||||
|
||||
Owner brief « V1-2.2 : arbitrages propriétaire sur les trois MEDIUM » on `958228a`. Contract
|
||||
`.claude/tasks/contracts/2026-10-30-v1-2-2-three-medium.md`. Lot A (defect 3, frame) committed `0c87c7f`, `faa53c7`,
|
||||
`587cbb2`. Lot B (defects 1 and 2, isolation and hitbox) NOT committed: it changes what frozen R3 references compare;
|
||||
patch `2026-10-30-v1-2-2-lot-b-isolation.patch` (against `587cbb2`), docs RUST.md §12.11 (lot A) and §12.12 (lot B, in
|
||||
the patch).
|
||||
|
||||
## 1. Audit
|
||||
|
||||
- Reaching the layer before: the root's presentation attributes the reader keeps. Inherited: `stroke*`, `fill*`,
|
||||
`visibility`, `color`, `clip-rule`, `color-interpolation-filters` (the halo filter sat in the drawing's first
|
||||
`<defs>`), font properties. Whole subtree, no child can undo: `opacity`, `display`, `systemLanguage`. Already removed
|
||||
on the root by the reader: `class`, `style`, `transform`, `filter`, `mask`, `clip-path`; no `pointer-events`,
|
||||
`cursor` or `<style>` survives anywhere; root `visibility` refused (`root_visibility`).
|
||||
- Markers: point hitbox `fill` transparent, `pointer-events` all, no stroke (inherits it, and under `all` the stroke
|
||||
area is hit even unpainted); visible twin `pointer-events` none; zones and trigger declare `stroke-width` 2, not
|
||||
`stroke-opacity`, `stroke-dasharray` (zones), `stroke-linejoin`, `fill-rule`.
|
||||
- Frame: canvas = view box, else drawing `viewBox` verbatim, else `0 0 100 100`; PDF = view box, else the drawing's;
|
||||
root `preserveAspectRatio` kept (a `slice` crops where the PDF raster aspect is clamped to [0.2, 2] or the canvas box
|
||||
differs).
|
||||
- Equine: all 28 annotations in frame, minimum margin 34 units; each point centre hit by its own marker in Chromium.
|
||||
|
||||
## 2. Lot A, frame (committed)
|
||||
|
||||
- `sheet_frame` 12 tests: on `958228a` 9 fail, 3 accept-only pass; green after. Reported drawing (horse `viewBox` +10 000,
|
||||
content translated back, read clean) refused with its 19 main-view annotations, failures exactly
|
||||
`["verification.validation.out_of_frame"]`, document text unchanged.
|
||||
- `path.rs` unit tests: 500 random cubics, 500 random arcs against 20 001 samples; grammars.
|
||||
- Mutations F1-F16 (+F9b): 17/17 killed after pinning the failure list (F16 survived the first run).
|
||||
- Oracles: none changed. `check:all` green on the lot A tree (cargo 2 145 passed summed over the feature passes, ts-rs
|
||||
types unchanged, core-wasm 65, supabase 128, app 566, lint, build, e2e:ui 26, app image, worker tests and image;
|
||||
e2e:shell not run).
|
||||
- Module: 560 377 → 572 993 B gzip -9; Node's gzip level 9 582 919 B (budget 600 000, margin 17 081 B).
|
||||
|
||||
## 3. Lot B, isolation and hitbox (proposal)
|
||||
|
||||
- `svg_marker_isolation` 5 tests, all red on `958228a`, green with lot B.
|
||||
- Pixels (Playwright Chromium 156, Firefox 157, WebKit 27.2; PDF = sized SVG → Image → white canvas as
|
||||
`browserRasterizer`, canvas = inline SVG 1000 × 786; equine main view, `hock`, `hip`, `lumbar`, `head-trigger`
|
||||
selected, halo on). Plain equine: 0 px difference in both forms, three engines. Markers alone (drawing removed) vs the
|
||||
plain markers, old / new, Chromium PDF: `stroke-width` 132 851 / 0; `stroke-opacity` 41 393 / 0; `dasharray`
|
||||
22 528 / 0; `color-interpolation-filters` (halo) 66 271 / 0; `linejoin` 19 / 0; `opacity` markers absent / 0;
|
||||
`display`, `fill`, `fill-opacity`, `fill-rule` 0 / 0. Same pattern in Firefox and WebKit, canvas and PDF; new = 0
|
||||
in every case. Side effect: root `opacity="0"` / `display="none"` now hide the drawing alone, the same in every engine.
|
||||
- Real PDF exports (demo.fr.logos, v2full.fr.logos, v2unresolved.fr.nologos; every view rasterised by Chromium):
|
||||
byte-identical to `958228a`; 15 pages identical at 100 dpi.
|
||||
- Clicks (`apps/app/e2e/ui/canvas-clicks.spec.ts`, harness `e2e/harness/canvas.{html,tsx}`; projects chromium-desktop,
|
||||
chromium-375 touch, firefox-desktop, webkit-desktop, webkit-375 touch): lot B 67 passed, 5 fixme; `958228a` 45 failed
|
||||
(Chromium and WebKit every stroke case; Firefox 3). Full `e2e:ui` on lot B: 93 passed, 5 skipped.
|
||||
- Mutations I1-I7 killed; K1, K7, K8, K10, V1, V6, V7 rerun killed.
|
||||
- References compared differently (not edited): R3 `highlight.json` (36 cases) and R3 canvas goldens
|
||||
(`canvas.{main,head}.json`, `.layers.json`): equal under the declared transforms `with_isolated_layer`,
|
||||
`withIsolatedLayer`, `withDeclaredHitboxes` (included in the patch, uncommitted). R4.1 `pdf/r3/real/manifest.json`
|
||||
call 1 `svgSha256` (`a9a3155c…` → `45fd4aaf…`): a byte digest, the core-wasm test fails until the owner decides.
|
||||
Unchanged: R3 `layer.json`, `sanitiser.json`, R4 PDF digests, step6 goldens, N-1 copies, seed review drawings
|
||||
(R3 layer kept for them), equine drawing (sha256 `0ea5202f…`) and fingerprint.
|
||||
- Module with lot B: 573 088 B gzip -9.
|
||||
|
||||
## 4. Pre-existing finding: junction points
|
||||
|
||||
Zones are painted and hit after the points. Share of each visible disc recorded by its own marker (plain equine,
|
||||
identical in the three engines): `c7-t1` 51 %, `l6-s1` 56 %, `t18-l1` 72 %, fore fetlock 92 %. In Firefox and WebKit
|
||||
the centre of `c7-t1` records « thoracic ». Prototype orders (DOM reordering, not built): points above zones → discs
|
||||
100 % (fore fetlock 92 %), zones lose 2 to 10 % to the point hitboxes; hitboxes, then zones, then capturing twins
|
||||
(« visible wins ») → discs 99-100 %, zones lose only what the discs cover (3 %). Owner decision.
|
||||
|
||||
## 5. Independent reviews (fresh, Opus: the pinned Fable model was out of credits)
|
||||
|
||||
- Security: PASS, semgrep 163 rules 0 findings. MEDIUM scale bypass, reproduced: `viewBox` × 1 000 with the content
|
||||
scaled back keeps the horse identical, every marker sub-pixel, verdict green (defect 3 by another route; owner
|
||||
decision, not built). MEDIUM offset and precision: slack grew with the offset (fixed `9e49ed1`, test + mutant F17);
|
||||
absolute 1e-12 epsilons in the curve extremes and f64 reading where browsers use f32 (needs coordinate range bounds,
|
||||
owner decision). LOW NaN dropped by `min`/`max` (fixed `9e49ed1`: non-finite bounds unreadable). LOW test lint allows
|
||||
(project convention).
|
||||
- Verifier: ECARTS(2). C8 unverifiable inside its brief (docker, mutations); FLOOR `test.skip` on the tap test, not
|
||||
authorised (removed: the desktop projects already leave `@phone` out). C1-C7, C9 met; declared transforms judged
|
||||
faithful (they only rewrite the frozen side, strict comparison kept). F16 anchor broken by rustfmt (fixed). Proof
|
||||
scripts were not in the repo: now `2026-10-30-v1-2-2-three-medium-tools/` (pixel probe, real PDF export, junction
|
||||
probe). Residual: a root `systemLanguage` now sits on the drawing's group (drawing only, markers unaffected).
|
||||
- After the fixes: mutations 32/32 killed; module 573 134 B gzip -9, Node 583 018 B; `e2e:ui` 93 passed, 5 fixme;
|
||||
app 566. `check:all` last ran in full on `faa53c7` (lot A before `9e49ed1`), not rerun after `9e49ed1`.
|
||||
@@ -0,0 +1,47 @@
|
||||
// THROWAWAY: pixel proof of composed views, old (958228a) vs new, three engines; metrics in page.
|
||||
import { createRequire } from 'node:module'
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
const require = createRequire(process.argv[2] + '/apps/app/package.json')
|
||||
const pw = require('@playwright/test')
|
||||
const DIR = process.argv[3]
|
||||
const engines = process.argv[4].split(',')
|
||||
const variants = [...new Set(readdirSync(DIR + '/new').map((f) => f.split('.')[0]))].sort()
|
||||
const read = (side, v, form, part) => readFileSync(`${DIR}/${side}/${v}.${form}.${part}.svg`, 'utf8')
|
||||
|
||||
const LIB = `
|
||||
window.store = {}
|
||||
window.keep = async (key, img) => { const c = document.createElement('canvas'); c.width = img.width; c.height = img.height; const x = c.getContext('2d'); x.fillStyle='#fff'; x.fillRect(0,0,c.width,c.height); x.drawImage(img, 0, 0, c.width, c.height); window.store[key] = x.getImageData(0, 0, c.width, c.height).data }
|
||||
window.pdf = async (key, svg) => { const root = new DOMParser().parseFromString(svg, 'image/svg+xml').documentElement; const vb = root.getAttribute('viewBox').split(/[\\s,]+/).map(Number); const w = 1200, h = Math.round(1200 * vb[3] / vb[2]); root.setAttribute('width', String(w)); root.setAttribute('height', String(h)); const url = URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(root)], { type: 'image/svg+xml;charset=utf-8' })); const img = new Image(); img.width = w; img.height = h; img.src = url; await img.decode(); await window.keep(key, img) }
|
||||
window.png = async (key, b64) => { const img = new Image(); img.src = 'data:image/png;base64,' + b64; await img.decode(); await window.keep(key, img) }
|
||||
window.diff = (a, b) => { a = window.store[a]; b = window.store[b]; let n = 0; for (let i = 0; i < a.length; i += 4) if (a[i] !== b[i] || a[i+1] !== b[i+1] || a[i+2] !== b[i+2]) n++; return n }
|
||||
window.ink = (a) => { a = window.store[a]; let n = 0; for (let i = 0; i < a.length; i += 4) if (a[i] < 250 || a[i+1] < 250 || a[i+2] < 250) n++; return n }
|
||||
window.hl = (a) => { a = window.store[a]; let n = 0; for (let i = 0; i < a.length; i += 4) if (Math.abs(a[i]-0xb8) <= 24 && Math.abs(a[i+1]-0x5a) <= 24 && Math.abs(a[i+2]-0x3f) <= 24) n++; return n }
|
||||
`
|
||||
for (const name of engines) {
|
||||
const browser = await pw[name].launch()
|
||||
const work = await browser.newPage()
|
||||
const shot = await browser.newPage({ viewport: { width: 1100, height: 900 } })
|
||||
await work.setContent('<html><body></body></html>'); await work.addScriptTag({ content: LIB })
|
||||
console.log(`== ${name} ${browser.version()}`)
|
||||
const load = async (key, form, svg) => {
|
||||
if (form === 'pdf') return work.evaluate(([k, s]) => window.pdf(k, s), [key, svg])
|
||||
await shot.setContent(`<html><body style="margin:0;background:#fff"><div id="h" style="width:1000px;height:786px">${svg.replace(/^<svg /, '<svg width="1000" height="786" ')}</div></body></html>`)
|
||||
const b64 = (await shot.locator('#h').screenshot()).toString('base64')
|
||||
return work.evaluate(([k, b]) => window.png(k, b), [key, b64])
|
||||
}
|
||||
for (const form of ['pdf', 'canvas']) {
|
||||
await load('base', form, read('new', 'plain', form, 'layer'))
|
||||
for (const v of variants) {
|
||||
for (const side of ['old', 'new']) for (const part of ['full', 'layer']) await load(`${side}.${part}`, form, read(side, v, form, part))
|
||||
const row = await work.evaluate(() => ({
|
||||
full_old_vs_new: window.diff('old.full', 'new.full'),
|
||||
markers_old_vs_plain: window.diff('old.layer', 'base'),
|
||||
markers_new_vs_plain: window.diff('new.layer', 'base'),
|
||||
marker_ink_old: window.ink('old.layer'), marker_ink_new: window.ink('new.layer'),
|
||||
highlight_old: window.hl('old.full'), highlight_new: window.hl('new.full'),
|
||||
}))
|
||||
console.log(form.padEnd(6), v.padEnd(15), JSON.stringify(row))
|
||||
}
|
||||
}
|
||||
await browser.close()
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// THROWAWAY (never committed): capture of each visible shape under three layer orders.
|
||||
import { test } from '../support/browser'
|
||||
test('junction options @phone', async ({ page }, info) => {
|
||||
await page.goto('/e2e/harness/canvas.html?drawing=plain')
|
||||
await page.locator('[data-anno-id="hock"]').first().waitFor({ state: 'attached' })
|
||||
for (const option of ['current', 'points-above-zones', 'visible-wins']) {
|
||||
const out = await page.evaluate((option) => {
|
||||
const svg = document.querySelector('[data-testid="anatomy-canvas"] svg') as SVGSVGElement
|
||||
const layer = svg.lastElementChild as SVGGElement
|
||||
const kids = Array.from(layer.children) as SVGGeometryElement[]
|
||||
const hit = kids.filter((k) => k.getAttribute('fill') === 'transparent')
|
||||
const twins = kids.filter((k) => k.getAttribute('pointer-events') === 'none')
|
||||
const shapes = kids.filter((k) => !hit.includes(k) && !twins.includes(k))
|
||||
if (option === 'points-above-zones') {
|
||||
const points = kids.filter((k) => hit.includes(k) || twins.includes(k))
|
||||
layer.replaceChildren(...shapes, ...points)
|
||||
}
|
||||
if (option === 'visible-wins') {
|
||||
twins.forEach((t) => t.setAttribute('pointer-events', 'visibleFill'))
|
||||
layer.replaceChildren(...hit, ...shapes, ...twins)
|
||||
}
|
||||
const ctm = svg.getScreenCTM()!
|
||||
const who = (x: number, y: number) => { const p = new DOMPoint(x, y).matrixTransform(ctm); return document.elementFromPoint(p.x, p.y)?.closest('[data-anno-id]')?.getAttribute('data-anno-id') ?? '-' }
|
||||
const rows: Record<string, string> = {}
|
||||
for (const t of twins) {
|
||||
const id = t.getAttribute('data-anno-id')!
|
||||
const cx = +t.getAttribute('cx')!, cy = +t.getAttribute('cy')!, r = +t.getAttribute('r')!
|
||||
let n = 0, own = 0
|
||||
for (let dx = -r; dx <= r; dx += 2) for (let dy = -r; dy <= r; dy += 2) { if (Math.hypot(dx, dy) > r) continue; n++; if (who(cx + dx, cy + dy) === id) own++ }
|
||||
if (own < n) rows[id] = `disc ${own}/${n}`
|
||||
}
|
||||
for (const z of shapes) {
|
||||
const id = z.getAttribute('data-anno-id')!
|
||||
const b = z.getBBox()
|
||||
let n = 0, own = 0
|
||||
for (let x = b.x; x <= b.x + b.width; x += 6) for (let y = b.y; y <= b.y + b.height; y += 6) { if (!z.isPointInFill(new DOMPoint(x, y))) continue; n++; if (who(x, y) === id) own++ }
|
||||
if (own < n) rows[id] = `area ${own}/${n}`
|
||||
}
|
||||
return rows
|
||||
}, option)
|
||||
console.log(`JUNCTION ${info.project.name} ${option} ${JSON.stringify(out)}`)
|
||||
await page.reload(); await page.locator('[data-anno-id="hock"]').first().waitFor({ state: 'attached' })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,59 @@
|
||||
// THROWAWAY (never committed): a real PDF export, every view rasterised by Chromium as
|
||||
// apps/app/src/pdf/browserRasterizer.ts does, written to REAL_PDF_OUT.
|
||||
import { createRequire } from 'node:module'
|
||||
import { readFileSync, writeFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { openExportSession } from '../src/index'
|
||||
import { nodeCoreRuntime } from '../src/node'
|
||||
import { readAttachedDocument } from './n-1/scanner/attachment/read'
|
||||
|
||||
const ROOT = fileURLToPath(new URL('../../../', import.meta.url))
|
||||
const FIXTURES = join(ROOT, 'apps/app/tests/fixtures')
|
||||
const OUT = process.env.REAL_PDF_OUT
|
||||
|
||||
function unwrap<T>(o: { ok: true; value: T } | { ok: false; kind: string; detail?: string }, what: string): T {
|
||||
if (!o.ok) throw new Error(`${what}: ${o.kind} ${o.detail ?? ''}`)
|
||||
return o.value
|
||||
}
|
||||
|
||||
it.runIf(OUT)('real pdf', async () => {
|
||||
const require = createRequire(join(ROOT, 'apps/app/package.json'))
|
||||
const { chromium } = require('@playwright/test')
|
||||
const browser = await chromium.launch()
|
||||
const page = await browser.newPage()
|
||||
await page.setContent('<html><body></body></html>')
|
||||
const runtime = await nodeCoreRuntime('pkg')
|
||||
for (const name of ['demo.fr.logos', 'v2full.fr.logos', 'v2unresolved.fr.nologos']) {
|
||||
const env = (await readAttachedDocument(new Uint8Array(readFileSync(join(FIXTURES, `pdf/r3/${name}.pdf`))))) as Record<string, unknown>
|
||||
const input = JSON.stringify({ report: env.report, sheetSnapshot: env.sheetSnapshot, branding: env.branding, labels: env.labels, locale: env.locale, exportedAt: env.exportedAt })
|
||||
const session = unwrap(openExportSession(runtime, input), name)
|
||||
const svgs: string[] = []
|
||||
try {
|
||||
for (;;) {
|
||||
const step = unwrap(session.next(), 'next')
|
||||
if (step.step === 'done') break
|
||||
for (const r of step.requests) {
|
||||
svgs.push(r.svg)
|
||||
const b64: string = await page.evaluate(async ([svg, w, h]: [string, number, number]) => {
|
||||
const root = new DOMParser().parseFromString(svg, 'image/svg+xml').documentElement
|
||||
if (root.namespaceURI !== 'http://www.w3.org/2000/svg') root.setAttribute('xmlns', 'http://www.w3.org/2000/svg')
|
||||
root.setAttribute('width', String(w)); root.setAttribute('height', String(h))
|
||||
const url = URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(root)], { type: 'image/svg+xml;charset=utf-8' }))
|
||||
const img = new Image(); img.decoding = 'sync'; img.src = url; await img.decode()
|
||||
const c = document.createElement('canvas'); c.width = w; c.height = h
|
||||
const ctx = c.getContext('2d')!; ctx.fillStyle = '#ffffff'; ctx.fillRect(0, 0, w, h); ctx.drawImage(img, 0, 0, w, h)
|
||||
return c.toDataURL('image/png').split(',')[1]
|
||||
}, [r.svg, r.widthPx, r.heightPx])
|
||||
unwrap(session.addRaster(r.key, new Uint8Array(Buffer.from(b64, 'base64'))), r.key)
|
||||
}
|
||||
}
|
||||
const parts = unwrap(session.finish(), 'finish')
|
||||
writeFileSync(join(OUT!, `${name}.pdf`), Buffer.concat(parts))
|
||||
writeFileSync(join(OUT!, `${name}.views.json`), JSON.stringify(svgs.length))
|
||||
} finally {
|
||||
session.free()
|
||||
}
|
||||
}
|
||||
await browser.close()
|
||||
}, 600_000)
|
||||
@@ -0,0 +1,59 @@
|
||||
# Incident report: two unauthorised read-only runs against DEV (2026-11-01)
|
||||
|
||||
Scope rule broken: the owner's briefs forbid any operation on DEV, read-only included. Evidence is
|
||||
what was collected right after each event, read-only: Docker start times of the eight DEV containers,
|
||||
the DEV Kong access log and the DEV Storage request log (`docker logs`). No new connection to DEV was
|
||||
made to write this report.
|
||||
|
||||
## Events
|
||||
|
||||
| | Event 1 | Event 2 |
|
||||
|---|---|---|
|
||||
| Time (UTC) | 2026-11-01 23:03:49 | 2026-11-01 23:10:59 |
|
||||
| Origin | feater sub-agent securing `e2e:sheet-assets` (V1-2.3 closure, brief 2026-11-02 §3) | the orchestrator |
|
||||
| Cause | `cd <worktree> && python3 … &` backgrounded the whole list, so the next command ran in the shell's directory, the main checkout `/home/bchanot/Documents/faunosteo` (branch `feature/v1-1-clients-animals`), where the old script still targets DEV | an unquoted heredoc (`python3 - <<EOF`) writing a TODO line: bash ran the command substitution of the backticked text `pnpm e2e:sheet-assets` in the session directory, the same main checkout |
|
||||
| Command really run | `pnpm e2e:sheet-assets` → old `scripts/sheet-assets-e2e.sh`: release build of `upload-sheet-assets`, `scripts/supabase.sh status -o json` (DEV service and anon keys read from the local CLI), then its 11 checks | the same |
|
||||
| Environment reached | DEV: the local Supabase CLI stack, through Kong `http://127.0.0.1:54321` (Storage and PostgREST) | the same |
|
||||
| Requests observed (Kong) | 13, all GET (detail below) | 13, all GET, same detail |
|
||||
| Writes observed | none: no POST, PUT, PATCH or DELETE in the Kong log; Storage log shows only `GET` (`storage.bucket.get`, `storage.object.get_authenticated`) | none, same evidence |
|
||||
| DEV containers | not restarted (start times equal to the snapshot of 2026-10-28) | same |
|
||||
|
||||
## The 13 requests of each event (reconciled)
|
||||
|
||||
| Requests | Count | Status |
|
||||
|---|---|---|
|
||||
| `GET /storage/v1/object/anatomical-sheet-assets/0ea5202f…08541.svg` (equine drawing; `last_modified` 2026-10-23, unchanged) | 5 | 200 |
|
||||
| `GET /storage/v1/bucket/anatomical-sheet-assets` | 3 | 200 |
|
||||
| `GET /storage/v1/bucket/anatomical-sheet-assets` (anon key and wrong key, the expected refusals) | 2 | 400 |
|
||||
| `GET /rest/v1/anatomical_sheet_assets` | 3 | 200 |
|
||||
| **Total** | **13** | |
|
||||
|
||||
The checkpoint of 2026-11-02 said « 4 lectures du bucket » plus « 2 refus », which sums to 14: wrong.
|
||||
The log has 3 bucket reads answered 200 and 2 answered 400, five bucket requests in all; the total
|
||||
is 13. The four refusal checks of the script that name another destination (https, a non-local host,
|
||||
no port, port 9) sent nothing to DEV: the upload tool refuses the first three before any request,
|
||||
and port 9 is closed.
|
||||
|
||||
## What the evidence proves, and what it does not
|
||||
|
||||
Proved: no write request reached DEV through Kong, the only route the tool uses (the URL was
|
||||
`http://127.0.0.1:54321`); the drawing object kept its 2026-10-23 modification date; no DEV container
|
||||
restarted. Not proved: the state of DEV's database rows (no query was run, by rule); PostgREST and
|
||||
PostgreSQL logs were not read. The DEV service key was read from the local CLI config and held in the
|
||||
process environment of those runs; it was never printed (the script's grep guard) and is the local
|
||||
demo key (`ENVIRONMENTS.md` §3.6).
|
||||
|
||||
## Confinement and prevention
|
||||
|
||||
- Stopped all work at once after the second event and reported it (checkpoint of 2026-11-02).
|
||||
- V1-2 branch: `pnpm e2e:sheet-assets` is an alias of `pnpm db:sandbox sheet-assets-e2e` (`f924ad0`);
|
||||
the runner refuses any URL but `http://127.0.0.1:57800` and any key not issued by the sandbox,
|
||||
before building or any request (`34a49f5` for the branch-neutral message).
|
||||
- develop: bugfix `bugfix/sheet-assets-e2e-sandbox-only` (owner authorisation of 2026-11-02): the same
|
||||
runner, byte for byte; on develop it always refuses (no sandbox runner there yet).
|
||||
- Remaining vulnerable entry points (not fixed here; owner authorisation needed): see the census in
|
||||
the checkpoint (develop `scripts/avatar-e2e.sh`; the main checkout on `feature/v1-1-clients-animals`
|
||||
and the worktree `old-958228a` hold both old scripts on disk).
|
||||
- Memory: LRN-110 (supersedes LRN-102): quoted heredocs, absolute verified directories, environment
|
||||
validated inside scripts, the same rules in every sub-agent brief; agents and sub-agents are
|
||||
forbidden to run those old commands from other worktrees.
|
||||
@@ -0,0 +1,78 @@
|
||||
# V1-2.2 owner decisions of 2026-11-01: evidence
|
||||
|
||||
Owner brief « V1-2.2 : décisions et poursuite des corrections » on `f1bb19b`. Owner answers during the
|
||||
run: threshold 4 CSS px at 320 × 568 (the proposed 6 px refused the validated equine); « the visible
|
||||
wins » on the editor canvas only. Contract `.claude/tasks/contracts/2026-11-01-v1-2-2-decisions.md`.
|
||||
Commits `4f52f5e` (lot B), `e677150` (R4.1 manifest), `9c606aa` (junctions), `96b9978` (visible size,
|
||||
frame range). Tools `.claude/audits/2026-11-01-v1-2-2-decisions-tools/`. Details RUST.md §12.12, §12.13.
|
||||
|
||||
## 1. Lot B as approved, isolation re-checked
|
||||
|
||||
- Working tree before commit = `.claude/audits/2026-10-30-v1-2-2-lot-b-isolation.patch`, identical
|
||||
(index lines aside).
|
||||
- Census `nothing_the_reader_keeps_changes_the_layer_or_the_halo`: the reader's 77 allowed attributes
|
||||
(structural ones aside) on the root and a descendant group, 17 descendant `style` values; layer and halo
|
||||
byte-identical to a plain drawing, root = namespaces + frame.
|
||||
- Browser probe, full-frame opaque magenta rectangle (last drawing child) with 21 candidate styles (15 kept
|
||||
by the reader, 6 removed for a function call), Chromium 156 / Firefox 157 / WebKit 27.2, canvas and PDF:
|
||||
magenta count equal to the unstyled control inside the frame, 13/13 point hits; positive control (rectangle
|
||||
after the layer) 100 % magenta, 0/13 hits.
|
||||
- Correction to the 2026-10-30 evidence: a descendant `style` may set `pointer-events` or `cursor` (the
|
||||
attributes are not kept); it acts on the drawing only, below the layer.
|
||||
|
||||
## 2. References
|
||||
|
||||
| Reference | Change |
|
||||
|---|---|
|
||||
| R3 `highlight.json` (36), R3 canvas goldens, `canvas.*.layers.json` | frozen files unedited; compared under `with_isolated_layer` / `withIsolatedLayer` / `withDeclaredHitboxes`, plus `with_canvas_passes` / `withCanvasPasses` for the canvas only (junctions) |
|
||||
| R4.1 `pdf/r3/real/manifest.json` call 1 `svgSha256` | edited `a9a3155c…2c11` → `45fd4aaf…fc7f` (`e677150`); call 2 unchanged; `pdf-export.session.test.ts` 5/5 |
|
||||
| R4 PDF digests, step6 goldens, N-1 copies, seed review drawings, equine drawing + fingerprint, R3 `layer.json`, `sanitiser.json` | unchanged: `git diff --stat f1bb19b..96b9978` over `crates/core/tests/{oracles,conformance,fixtures,pdf}`, `apps/app/tests/fixtures`, `packages/core-wasm/tests/n-1`, `supabase/seed` lists the manifest's one line only |
|
||||
|
||||
## 3. Junctions, « the visible wins » (canvas only)
|
||||
|
||||
- Click spec, 6 projects (Chromium 1280 / 375 touch / 320 touch, Firefox 1280, WebKit 1280 / 375 touch):
|
||||
99 passed, 0 fixme. On `e677150` the junction and disc tests fail in all 6 (12 failures).
|
||||
- Junction test: `c7-t1`, `l6-s1`, `t18-l1`, fore fetlock, centre + 4 points towards the disc edge, real
|
||||
clicks or taps. Disc test: every twin of main and head, 100 % of samples inside 95 % of the radius record
|
||||
the topmost disc. Zone test: every zone and the trigger, 100 % of samples 2 px inside, away from discs.
|
||||
- WebKit snaps taps and clicks to whole CSS px (measured: tap at 100.1 lands right of an edge at 100.4,
|
||||
click at 100.9 left of it); a real press keeps 1.5 px of margin, below it the browser's hit test answers.
|
||||
- The five `fixme` = one test × five projects; now unmarked in six.
|
||||
|
||||
## 4. Scale bypass and frame range
|
||||
|
||||
- Measured editor at 320 × 568 (Chromium): main box 286 × 310, detail 254.9 × 191.1. Equine at 320:
|
||||
junctions 4.97 px, other main points 6.07, head 15.1, smallest zone side 13.1. 6 px refused at 320, 360,
|
||||
375 px.
|
||||
- `sheet_marker_visibility` 9 tests: equine accepted; horse `viewBox` × 100 refused with its 19 main markers
|
||||
(`marker_too_small`); × 1 000 no usable frame; threshold × 1.24 accepted, × 1.25 the 3 junctions,
|
||||
× 1.52 the 13 points; disc vs hitbox; detail box; curves and arcs; every range bound at its limit and past;
|
||||
view_box; drawing transforms never change the measure. `sheet_frame` 13, frame unit test (NaN, ∞).
|
||||
- Rust vs browsers (hitbox layout): equine and thresholds ≤ 8.2e-5 relative, ≤ 0.014 px (Chromium,
|
||||
WebKit); Firefox ≤ 0.4 % (1/60 px app units); far edge 10⁵ / 10⁶ spans drawn raw: 0.14 / 11 px centre
|
||||
error (why the 256 ratio). Painted pixels by span: WebKit nothing from 2⁻⁷, Chromium 0.46 px at 2⁻¹⁴ and
|
||||
nothing at 2⁻²⁰, Firefox exact; floor set at 1 unit (first value 2⁻²⁰ withdrawn on this measure).
|
||||
|
||||
## 5. Gates on the final HEAD `76ead95`
|
||||
|
||||
- Mutations: on `96b9978`, `2026-11-01-v1-2-2-mutations-decisions.py` 29 killed + F5 survived (equivalent: the aspect
|
||||
rule refuses a zero span), `2026-10-30-v1-2-2-mutations-three-medium.py` 26 killed, 6 anchors moved (re-anchored in
|
||||
the new script, killed): 55 killed. N8 (path number bound, `76ead95`) killed. Total 56 killed, 1 equivalent.
|
||||
- `pnpm check:all` on `76ead95` passed (01:49 → 01:57): cargo 2 289 passed (worker 49 in Docker), 0 failed, 3 ignored;
|
||||
clippy -D warnings; ts-rs no drift; cargo-deny; RustSec ok; wasm; typecheck; core-wasm 65, supabase 128, app 566;
|
||||
lint; build; e2e:ui 125; app image; worker:test; worker:image `run --check`. Also passed on `96b9978`.
|
||||
- `pnpm e2e:shell` on the isolated sandbox stack (never DEV): 86 passed on `96b9978` and on `76ead95`.
|
||||
- WASM 574 233 B gzip -9 (budget 600 000, margin 25 767 B, 4.3 %); Vite gzip 584.84 kB.
|
||||
|
||||
## 6. Independent reviews (fresh, Opus)
|
||||
|
||||
- Verifier on `96b9978`: ECARTS(4). D1, D3, D4, D5 met. D2 and D7: §12.12 transform table rows 1 and 3 stale (fixed in
|
||||
`76ead95`). D6 unverifiable inside its brief (gates above). FLOOR `.skip(1)` = `Iterator::skip` (contract clarification
|
||||
added). Former MEDIUMs (1) root property, (2) hitbox stroke, (3) frame and scale bypass, (4) offset slack: closed.
|
||||
MEDIUM path numbers past f32 (fixed `76ead95`). LOW: lot B commit carried the RUST.md probe and reference passages.
|
||||
- Security on `96b9978`: PASS, semgrep 0. MEDIUM path numbers past f32 (fixed `76ead95`, re-review on the fix: PASS,
|
||||
LOWs informational: rotation reduced in f32, relative commands accumulated in f64, sub-normal arc radius).
|
||||
MEDIUM open, owner decision: zone without interior (zero-winding path, near-collinear polygon) passes the 4 px rule
|
||||
and is hit only on its 2-unit stroke. LOW: twin fully covering an earlier twin (no rule), NaN inside `Bounds::add`
|
||||
(unreachable since the bound), 1e-12 epsilons sound through the span floor, frame walk before the caps
|
||||
(pre-existing).
|
||||
@@ -0,0 +1,21 @@
|
||||
# V1-2.2 decisions (2026-11-01): throwaway proof tools
|
||||
|
||||
Not part of any suite. Run from a worktree of the branch, Playwright engines from the user cache.
|
||||
|
||||
- `iso_probe_generator.rs.txt`: copy to `crates/core/tests/zz_probe_iso.rs`, run
|
||||
`ISO_OUT=<empty dir> cargo test -p faunosteo-core --test zz_probe_iso -- --nocapture`, delete it.
|
||||
Writes the equine main view (canvas and PDF forms) with a full-frame opaque magenta rectangle,
|
||||
last child of the drawing, carrying each candidate style; plus the positive control (the
|
||||
rectangle after the layer).
|
||||
- `iso.mjs <worktree> <dir> chromium,firefox,webkit`: magenta pixel count and point hits per file.
|
||||
- `measure.mjs <worktree>`: needs Vite on 127.0.0.1:5197 (`VITE_SUPABASE_URL= VITE_SUPABASE_ANON_KEY=
|
||||
node_modules/.bin/vite --host 127.0.0.1 --port 5197 --strictPort` in apps/app); the editor's SVG box,
|
||||
scale and visible disc sizes at 320, 360, 375, 390 and 1280 px, main view and head detail.
|
||||
- `frame_probe_generator.rs.txt`: copy to `crates/core/tests/zz_frame_probe.rs`, run
|
||||
`FRAME_OUT=<empty dir> cargo test -p faunosteo-core --test zz_frame_probe`, delete it. Writes one JSON per
|
||||
limit case: the composed canvas, the preview box, the core's f64 expectation of each disc and hitbox, the
|
||||
core's verdict on the frame (refused frames are written with their raw `viewBox`).
|
||||
- `frame-probe.mjs <worktree> <dir> chromium,firefox,webkit`: the browser's layout of each hitbox against the
|
||||
core (relative size gap, centre gap in px).
|
||||
- `span-pixels.mjs <worktree> chromium,firefox,webkit`: painted pixels of one disc for spans 1 000 to 2^-20
|
||||
(area and centroid gaps): where each engine stops drawing faithfully.
|
||||
@@ -0,0 +1,32 @@
|
||||
// Rust vs browser on the frame limits (owner brief 2026-11-01): each case is a composed canvas
|
||||
// (`frame_probe_generator.rs.txt`) with the core's f64 expectation of every visible disc (size and
|
||||
// centre in CSS px on the smallest preview box). The browser draws it in a box of that size, CSS as
|
||||
// AnatomyCanvas (svg max-width/max-height 100 %, centred); answers the largest size and centre gaps.
|
||||
import { createRequire } from 'node:module'
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
const require = createRequire(process.argv[2] + '/apps/app/package.json')
|
||||
const pw = require('@playwright/test')
|
||||
const DIR = process.argv[3]
|
||||
const cases = readdirSync(DIR).filter((f) => f.endsWith('.json')).sort().map((f) => JSON.parse(readFileSync(`${DIR}/${f}`, 'utf8')))
|
||||
for (const engine of process.argv[4].split(',')) {
|
||||
const browser = await pw[engine].launch()
|
||||
const page = await browser.newPage({ viewport: { width: 600, height: 600 } })
|
||||
console.log(`== ${engine} ${browser.version()}`)
|
||||
for (const c of cases) {
|
||||
const [bw, bh] = c.box
|
||||
await page.setContent(`<html><body style="margin:0"><div id="b" style="width:${bw}px;height:${bh}px">${c.svg.replace(/^<svg /, '<svg style="max-width:100%;max-height:100%;display:block;margin:0 auto" ')}</div></body></html>`)
|
||||
const got = await page.evaluate((markers) => {
|
||||
const svg = document.querySelector('#b svg'); const s = svg.getBoundingClientRect()
|
||||
// The hitbox (stroke none): Firefox counts a stroke in an element's client rect, the others do not.
|
||||
const boxes = [...svg.querySelectorAll('circle[pointer-events="visibleFill"]')]
|
||||
return markers.map((m) => { const t = boxes.find((e) => e.getAttribute('data-anno-id') === m.id); if (!t) return null
|
||||
const r = t.getBoundingClientRect(); return { size: r.width, cx: r.x + r.width / 2 - s.x, cy: r.y + r.height / 2 - s.y } })
|
||||
}, c.markers)
|
||||
let size = 0, centre = 0
|
||||
c.markers.forEach((m, i) => { const g = got[i]; if (!g) { size = Infinity; return }
|
||||
size = Math.max(size, Math.abs(g.size - m.hitbox) / m.hitbox); centre = Math.max(centre, Math.hypot(g.cx - m.cx, g.cy - m.cy)) })
|
||||
const disc = Math.min(...c.markers.map((m) => m.size))
|
||||
console.log(c.name.padEnd(30), c.core.padEnd(12), JSON.stringify({ core_disc_px: +disc.toPrecision(4), hitbox_size_gap_rel: +size.toPrecision(2), max_centre_gap_px: +centre.toPrecision(2) }))
|
||||
}
|
||||
await browser.close()
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// THROWAWAY (not committed as a test): copy to crates/core/tests/zz_frame_probe.rs, run
|
||||
// `FRAME_OUT=<empty dir> cargo test -p faunosteo-core --test zz_frame_probe -- --nocapture`, delete it.
|
||||
// Each case: the composed canvas, the preview box, the core's f64 expectation of every visible disc
|
||||
// (size and centre in CSS px relative to the svg box), and the core's verdict on the frame.
|
||||
#![allow(clippy::disallowed_methods, clippy::unwrap_used, clippy::expect_used)]
|
||||
mod common;
|
||||
use common::sheet_readers::{OPEN, document};
|
||||
use faunosteo_core::anatomy::compose::compose_canvas;
|
||||
use faunosteo_core::anatomy::frame::{DETAIL_PREVIEW_PX, MAIN_PREVIEW_PX, frame_faults, view_frame, FrameFault, Placement};
|
||||
use faunosteo_core::anatomy::layer::twin_radius;
|
||||
use faunosteo_core::anatomy::svg::{Element, read_svg, serialize::serialize};
|
||||
use faunosteo_core::domain::sheet::{AnatomicalSheetDocument, Annotation, Geometry};
|
||||
use serde::Deserialize;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
fn doc_of(text: &str) -> AnatomicalSheetDocument {
|
||||
AnatomicalSheetDocument::deserialize(serde_json::from_str::<Value>(text).unwrap()).unwrap()
|
||||
}
|
||||
|
||||
fn write(name: &str, doc: &AnatomicalSheetDocument, view: &str, root: &Element, raw: Option<[f64; 4]>) {
|
||||
let out = std::env::var("FRAME_OUT").unwrap();
|
||||
let v = doc.views.iter().find(|v| v.id() == view).unwrap();
|
||||
let frame = raw.unwrap_or_else(|| { let f = view_frame(v, root).unwrap(); [f.min_x, f.min_y, f.width, f.height] });
|
||||
let (bw, bh) = if v.is_main() { MAIN_PREVIEW_PX } else { DETAIL_PREVIEW_PX };
|
||||
let scale = (bw / frame[2]).min(bh / frame[3]);
|
||||
let faults = frame_faults(doc, |_| Some(root));
|
||||
let core = if faults.iter().any(|f| matches!(f, FrameFault::NoFrame { .. })) { "no_frame" }
|
||||
else if faults.iter().any(|f| matches!(f, FrameFault::Annotation { placement: Placement::TooSmall, .. })) { "too_small" }
|
||||
else if faults.is_empty() { "accepted" } else { "out_of_frame" };
|
||||
let mut svg = serialize(&compose_canvas(doc, view, root).unwrap());
|
||||
if let Some(r) = raw {
|
||||
let vb = svg[..svg.find('>').unwrap()].to_owned();
|
||||
let start = vb.find("viewBox=\"").unwrap() + 9;
|
||||
let end = start + vb[start..].find('"').unwrap();
|
||||
svg.replace_range(start..end, &format!("{} {} {} {}", r[0], r[1], r[2], r[3]));
|
||||
}
|
||||
let markers: Vec<Value> = doc.annotations.iter().filter(|a| a.view_id() == view).filter_map(|a| match a {
|
||||
Annotation::Observable(o) => match o.geometry.as_ref()? { Geometry::Circle(c) => Some(json!({
|
||||
"id": o.id, "size": 2.0 * twin_radius(c.r) * scale, "hitbox": 2.0 * c.r * scale,
|
||||
"cx": (c.cx - frame[0]) * scale, "cy": (c.cy - frame[1]) * scale })), _ => None },
|
||||
_ => None }).collect();
|
||||
std::fs::write(format!("{out}/{name}.json"), json!({ "name": name, "box": [bw, bh], "core": core, "svg": svg, "markers": markers }).to_string()).unwrap();
|
||||
}
|
||||
|
||||
fn shared(view_box: &str, cx: f64, cy: f64, r: f64) -> (AnatomicalSheetDocument, Element) {
|
||||
let mut doc: Value = serde_json::from_str(&document()).unwrap();
|
||||
doc["annotations"][0]["geometry"] = json!({ "type": "circle", "cx": cx, "cy": cy, "r": r });
|
||||
let text = OPEN.replace("0 0 10 10", view_box) + "<path d=\"M0 0h1\"/></svg>";
|
||||
(doc_of(&doc.to_string()), read_svg(&text).unwrap().root)
|
||||
}
|
||||
|
||||
fn scaled_horse(factor: f64) -> Element {
|
||||
let horse = common::repo_file("supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg");
|
||||
let text = horse.replacen("viewBox=\"0 0 2073.4 1629.4\">", &format!("viewBox=\"0 0 {} {}\"><g transform=\"scale({factor})\">", 2073.4 * factor, 1629.4 * factor), 1).replacen("</svg>", "</g></svg>", 1);
|
||||
read_svg(&text).unwrap().root
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn write_cases() {
|
||||
let equine = doc_of(&common::repo_file("supabase/seed/anatomical-sheets/equine/draft/document.json"));
|
||||
for (name, factor) in [("a-equine-main", 1.0), ("b-equine-x1.24", 1.24), ("c-equine-x1.25", 1.25), ("c2-equine-x100", 100.0)] {
|
||||
write(name, &equine, "main", &scaled_horse(factor), None);
|
||||
}
|
||||
write("d-equine-head-detail-box", &equine, "head", &scaled_horse(1.0), None);
|
||||
let m = 1_048_576.0 - 8192.0;
|
||||
let (d, r) = shared(&format!("{m} 0 8192 8192"), m + 4096.37, 4100.63, 200.0);
|
||||
write("e-edge-magnitude-2^20", &d, "main", &r, None);
|
||||
let (d, r) = shared("2550 0 10 10", 2555.37, 5.63, 1.0);
|
||||
write("f-offset-ratio-256", &d, "main", &r, None);
|
||||
let (d, r) = shared("1000000 0 10 10", 1_000_005.37, 5.63, 1.0);
|
||||
write("g-offset-ratio-1e5-refused", &d, "main", &r, Some([1e6, 0.0, 10.0, 10.0]));
|
||||
let (d, r) = shared("10000000 0 10 10", 10_000_005.37, 5.63, 1.0);
|
||||
write("h-offset-ratio-1e6-refused", &d, "main", &r, Some([1e7, 0.0, 10.0, 10.0]));
|
||||
let s = 1.0 / 1_048_576.0;
|
||||
let (d, r) = shared(&format!("0 0 {s} {s}"), s * 0.537, s * 0.463, s / 4.0);
|
||||
write("i-span-2^-20", &d, "main", &r, None);
|
||||
let (d, r) = shared("0 0 1e-30 1e-30", 0.537e-30, 0.463e-30, 0.25e-30);
|
||||
write("j-span-1e-30-refused", &d, "main", &r, Some([0.0, 0.0, 1e-30, 1e-30]));
|
||||
// Span series, the point's hitbox a quarter of the span (its disc stays 4 units across).
|
||||
for (label, span) in [("1", 1.0), ("2^-3", 0.125), ("2^-5", 0.03125), ("2^-7", 0.0078125), ("2^-10", 1.0 / 1024.0), ("2^-14", 1.0 / 16384.0)] {
|
||||
let (d, r) = shared(&format!("0 0 {span} {span}"), span * 0.537, span * 0.463, span / 4.0);
|
||||
write(&format!("m-span-{label}"), &d, "main", &r, None);
|
||||
}
|
||||
let (d, r) = shared("0 0 1000 1000", 500.37, 499.63, 20.0);
|
||||
write("k-threshold-4.58px", &d, "main", &r, None);
|
||||
let (d, r) = shared("0 0 1000 1000", 500.37, 499.63, 18.0);
|
||||
write("l-threshold-3.43px", &d, "main", &r, None);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Sibling-CSS isolation probe: a full-frame opaque magenta rect, last child of the drawing, carries each candidate style.
|
||||
// Metric: pure-magenta pixel count (equal to control-none = no marker covered) and, in the canvas, the hit at each point centre.
|
||||
import { createRequire } from 'node:module'
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
const require = createRequire(process.argv[2] + '/apps/app/package.json')
|
||||
const pw = require('@playwright/test')
|
||||
const DIR = process.argv[3]
|
||||
const doc = JSON.parse(readFileSync(process.argv[2] + '/supabase/seed/anatomical-sheets/equine/draft/document.json', 'utf8'))
|
||||
const points = doc.annotations.filter((a) => a.view_id === 'main' && a.geometry.type === 'circle').map((a) => [a.id, a.geometry.cx, a.geometry.cy])
|
||||
const names = [...new Set(readdirSync(DIR).map((f) => f.split('.')[0]))].sort()
|
||||
const W = 1000, H = Math.round(1000 * 1629.4 / 2073.4)
|
||||
const LIB = `window.mag = (d) => { let n = 0; for (let i = 0; i < d.length; i += 4) if (d[i] === 255 && d[i+1] === 0 && d[i+2] === 255) n++; return n }
|
||||
window.pdf = async (svg) => { const root = new DOMParser().parseFromString(svg, 'image/svg+xml').documentElement; root.setAttribute('width', '${W}'); root.setAttribute('height', '${H}');
|
||||
const url = URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(root)], { type: 'image/svg+xml' })); const img = new Image(); img.width = ${W}; img.height = ${H}; img.src = url; await img.decode();
|
||||
const c = document.createElement('canvas'); c.width = ${W}; c.height = ${H}; const x = c.getContext('2d'); x.fillStyle = '#fff'; x.fillRect(0, 0, ${W}, ${H}); x.drawImage(img, 0, 0, ${W}, ${H}); return window.mag(x.getImageData(0, 0, ${W}, ${H}).data) }
|
||||
window.png = async (b64) => { const img = new Image(); img.src = 'data:image/png;base64,' + b64; await img.decode(); const c = document.createElement('canvas'); c.width = img.width; c.height = img.height; const x = c.getContext('2d'); x.drawImage(img, 0, 0); return window.mag(x.getImageData(0, 0, c.width, c.height).data) }`
|
||||
for (const engine of process.argv[4].split(',')) {
|
||||
const browser = await pw[engine].launch()
|
||||
const work = await browser.newPage(); await work.setContent('<html><body></body></html>'); await work.addScriptTag({ content: LIB })
|
||||
const shot = await browser.newPage({ viewport: { width: 1100, height: 900 } })
|
||||
console.log(`== ${engine} ${browser.version()}`)
|
||||
for (const name of names) {
|
||||
const pdf = await work.evaluate((s) => window.pdf(s), readFileSync(`${DIR}/${name}.pdf.svg`, 'utf8'))
|
||||
const svg = readFileSync(`${DIR}/${name}.canvas.svg`, 'utf8').replace(/^<svg /, `<svg width="${W}" height="${H}" `)
|
||||
await shot.setContent(`<html><body style="margin:0;background:#fff"><div id="h" style="width:${W}px;height:${H}px">${svg}</div></body></html>`)
|
||||
const canvas = await work.evaluate((b) => window.png(b), (await shot.locator('#h').screenshot()).toString('base64'))
|
||||
const s = W / 2073.4
|
||||
const hits = await shot.evaluate(([pts, s]) => pts.filter(([id, cx, cy]) => document.elementFromPoint(cx * s, cy * s)?.closest('[data-anno-id]')?.getAttribute('data-anno-id') === id).length, [points, s])
|
||||
console.log(name.padEnd(16), JSON.stringify({ pdf_magenta: pdf, canvas_magenta: canvas, point_hits: `${hits}/${points.length}` }))
|
||||
}
|
||||
await browser.close()
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// THROWAWAY (not committed): composed views for the sibling-CSS browser probe.
|
||||
#![allow(clippy::disallowed_methods, clippy::unwrap_used, clippy::expect_used)]
|
||||
mod common;
|
||||
use std::collections::HashSet;
|
||||
use faunosteo_core::anatomy::compose::{compose_canvas, compose_highlight};
|
||||
use faunosteo_core::anatomy::svg::{read_svg, serialize::serialize};
|
||||
use faunosteo_core::domain::sheet::AnatomicalSheetDocument;
|
||||
use serde::Deserialize;
|
||||
|
||||
const RECT: &str = r##"<rect x="0" y="0" width="2073.4" height="1629.4" fill="#ff00ff" STYLE/>"##;
|
||||
const CANDIDATES: [(&str, &str); 22] = [
|
||||
("control-none", ""),
|
||||
("z-index", "position:relative;z-index:2147483647"),
|
||||
("transform-3d", "transform:translateZ(1000px);will-change:transform"),
|
||||
("mix-blend", "mix-blend-mode:normal;isolation:isolate"),
|
||||
("view-transition", "view-transition-name:hijack"),
|
||||
("outline-small", "OUTLINE"),
|
||||
("contain", "contain:strict;content-visibility:visible"),
|
||||
("filter-css", "filter:drop-shadow(0 0 40px #ff00ff)"),
|
||||
("backdrop", "backdrop-filter:blur(40px)"),
|
||||
("position-fixed", "position:fixed;inset:0;z-index:9999"),
|
||||
("paint-order", "paint-order:markers stroke fill"),
|
||||
("stroke-huge", "stroke:#ff00ff;stroke-width:100000"),
|
||||
("pointer", "pointer-events:all;cursor:pointer"),
|
||||
("opacity", "opacity:1"),
|
||||
("clip-css", "clip-path:inset(-9999px)"),
|
||||
("mask-css", "mask-image:linear-gradient(#000,#000)"),
|
||||
("display", "display:block"),
|
||||
("visibility", "visibility:visible"),
|
||||
("transform-scale", "transform:scale(10);transform-origin:50% 50%"),
|
||||
("translate", "translate:0 0 9999px"),
|
||||
("order", "order:-1;float:right"),
|
||||
("anchor", "anchor-name:--x;position-anchor:--x"),
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn write_probe() {
|
||||
let out = std::env::var("ISO_OUT").unwrap();
|
||||
let horse = common::repo_file("supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg");
|
||||
let text = common::repo_file("supabase/seed/anatomical-sheets/equine/draft/document.json");
|
||||
let doc = AnatomicalSheetDocument::deserialize(serde_json::from_str::<serde_json::Value>(&text).unwrap()).unwrap();
|
||||
let ids: HashSet<&str> = doc.annotations.iter().filter(|a| a.view_id() == "main").map(|a| a.id()).collect();
|
||||
for (name, style) in CANDIDATES {
|
||||
let rect = if style == "OUTLINE" {
|
||||
r##"<rect x="10" y="10" width="5" height="5" fill="#ff00ff" style="outline:4000px solid #ff00ff;outline-offset:0"/>"##.to_owned()
|
||||
} else if style.is_empty() {
|
||||
RECT.replace(" STYLE", "")
|
||||
} else {
|
||||
RECT.replace("STYLE", &format!("style=\"{style}\""))
|
||||
};
|
||||
let pos = horse.rfind("</svg>").unwrap();
|
||||
let drawing = format!("{}{}{}", &horse[..pos], rect, &horse[pos..]);
|
||||
let read = read_svg(&drawing).unwrap();
|
||||
// A style with a function call (`filter:`, `clip-path:`, `transform:scale(`…) is removed by the reader.
|
||||
eprintln!("{name}: removed {:?}", read.removed);
|
||||
let canvas = compose_canvas(&doc, "main", &read.root).unwrap();
|
||||
let pdf = compose_highlight(&doc, "main", read.root.clone(), &ids, false).unwrap();
|
||||
std::fs::write(format!("{out}/{name}.canvas.svg"), serialize(&canvas)).unwrap();
|
||||
std::fs::write(format!("{out}/{name}.pdf.svg"), serialize(&pdf)).unwrap();
|
||||
}
|
||||
let canvas = compose_canvas(&doc, "main", &read_svg(&horse).unwrap().root).unwrap();
|
||||
let mut s = serialize(&canvas);
|
||||
let pos = s.rfind("</svg>").unwrap();
|
||||
s.insert_str(pos, &RECT.replace(" STYLE", ""));
|
||||
std::fs::write(format!("{out}/control-above.canvas.svg"), &s).unwrap();
|
||||
let pdf = compose_highlight(&doc, "main", read_svg(&horse).unwrap().root, &ids, false).unwrap();
|
||||
let mut s = serialize(&pdf);
|
||||
let pos = s.rfind("</svg>").unwrap();
|
||||
s.insert_str(pos, &RECT.replace(" STYLE", ""));
|
||||
std::fs::write(format!("{out}/control-above.pdf.svg"), &s).unwrap();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { createRequire } from 'node:module'
|
||||
const require = createRequire(process.argv[2] + '/apps/app/package.json')
|
||||
const pw = require('@playwright/test')
|
||||
const sizes = [[320,568],[360,640],[375,667],[390,844],[1280,800]]
|
||||
const browser = await pw.chromium.launch()
|
||||
for (const [w,h] of sizes) {
|
||||
const ctx = await browser.newContext({ viewport: { width: w, height: h }, locale: 'fr-FR', hasTouch: w < 500, isMobile: w < 500 })
|
||||
const page = await ctx.newPage()
|
||||
await page.goto('http://127.0.0.1:5197/new')
|
||||
await page.getByLabel('Nom complet').first().fill('P F')
|
||||
await page.getByLabel("Nom de l'animal").first().fill('A F')
|
||||
await page.getByLabel('Nom du propriétaire').first().fill('O F')
|
||||
await page.getByRole('button',{name:'Démarrer le bilan'}).click()
|
||||
await page.waitForURL(/editor/)
|
||||
const dlg = page.getByRole('dialog'); if (await dlg.count()) { await page.keyboard.press('Escape') }
|
||||
await page.locator('[data-anno-id="hock"]').first().waitFor({ state: 'attached' })
|
||||
const m = await page.evaluate(() => {
|
||||
const svg = document.querySelector('.svg-canvas svg'); const r = svg.getBoundingClientRect()
|
||||
const vb = svg.viewBox.baseVal
|
||||
const twins = [...svg.querySelectorAll('circle[pointer-events="none"]')].map(c => c.getBoundingClientRect().width)
|
||||
return { svgW: r.width, svgH: r.height, vbW: vb.width, vbH: vb.height, scale: Math.min(r.width / vb.width, r.height / vb.height), twinMin: Math.min(...twins), twinMax: Math.max(...twins) }
|
||||
})
|
||||
// detail modal
|
||||
await page.locator('[data-anno-id="head-trigger"]').first().dispatchEvent('click')
|
||||
let d = null
|
||||
try { await page.locator('dialog [data-anno-id="atm"]').first().waitFor({ state: 'attached', timeout: 5000 })
|
||||
d = await page.evaluate(() => { const svg = document.querySelector('dialog .svg-canvas svg'); const r = svg.getBoundingClientRect(); const vb = svg.viewBox.baseVal
|
||||
const twins = [...svg.querySelectorAll('circle[pointer-events="none"]')].map(c => c.getBoundingClientRect().width)
|
||||
return { svgW: r.width, svgH: r.height, vbW: vb.width, vbH: vb.height, scale: Math.min(r.width / vb.width, r.height / vb.height), twinMin: Math.min(...twins) } }) } catch (e) { d = String(e).slice(0,100) }
|
||||
console.log(w, h, JSON.stringify(m), 'detail', JSON.stringify(d))
|
||||
await ctx.close()
|
||||
}
|
||||
await browser.close()
|
||||
@@ -0,0 +1,25 @@
|
||||
// Painted pixels of one disc (r = span / 4, centre 0.537, 0.463 of the frame) in a 286 x 286 box,
|
||||
// for frame spans from 1 000 down to 2^-20: area and centroid against the f64 expectation.
|
||||
import { createRequire } from 'node:module'
|
||||
const require = createRequire(process.argv[2] + '/apps/app/package.json')
|
||||
const pw = require('@playwright/test')
|
||||
const spans = [[1000, '1000'], [10, '10'], [1, '1'], [0.125, '2^-3'], [0.03125, '2^-5'], [1 / 128, '2^-7'], [1 / 1024, '2^-10'], [1 / 16384, '2^-14'], [1 / 1048576, '2^-20']]
|
||||
const want = { area: Math.PI * 71.5 * 71.5, cx: 0.537 * 286, cy: 0.463 * 286 }
|
||||
for (const engine of process.argv[3].split(',')) {
|
||||
const browser = await pw[engine].launch()
|
||||
const page = await browser.newPage({ viewport: { width: 400, height: 400 } })
|
||||
console.log(`== ${engine} ${browser.version()} (expected area ${want.area.toFixed(0)} px, centroid ${want.cx.toFixed(2)}, ${want.cy.toFixed(2)})`)
|
||||
for (const [s, label] of spans) {
|
||||
await page.setContent(`<html><body style="margin:0;background:#fff"><div id="b" style="width:286px;height:286px"><svg viewBox="0 0 ${s} ${s}" style="max-width:100%;max-height:100%;display:block"><circle cx="${0.537 * s}" cy="${0.463 * s}" r="${s / 4}" fill="#ff00ff"/></svg></div></body></html>`)
|
||||
const png = (await page.locator('#b').screenshot()).toString('base64')
|
||||
const m = await page.evaluate(async (b64) => {
|
||||
const img = new Image(); img.src = 'data:image/png;base64,' + b64; await img.decode()
|
||||
const c = document.createElement('canvas'); c.width = img.width; c.height = img.height; const x = c.getContext('2d'); x.drawImage(img, 0, 0)
|
||||
const d = x.getImageData(0, 0, c.width, c.height).data; let a = 0, sx = 0, sy = 0
|
||||
for (let i = 0; i < d.length; i += 4) { const w = (255 - d[i + 1]) / 255; if (d[i] > 200 && d[i + 2] > 200 && w > 0) { const p = i / 4; a += w; sx += w * (p % c.width); sy += w * Math.floor(p / c.width) } }
|
||||
return { area: a, cx: sx / a + 0.5, cy: sy / a + 0.5 }
|
||||
}, png)
|
||||
console.log(label.padEnd(6), JSON.stringify({ area_gap_rel: +((m.area - want.area) / want.area).toPrecision(2), centroid_gap_px: +Math.hypot(m.cx - want.cx, m.cy - want.cy).toPrecision(2) }))
|
||||
}
|
||||
await browser.close()
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
# V1-2.2 last MEDIUM, zone without interior: evidence
|
||||
|
||||
Owner brief « V1-2.2 : fermeture du dernier MEDIUM » (2026-11-01) on `de2dfb3`. Contract
|
||||
`.claude/tasks/contracts/2026-11-01-v1-2-2-interior.md`. Commits `8dd2d78` (rule), `03be75b` (review 1: tiny arc radius), `86dce16` (review 2: f32 endpoints, arc spread),
|
||||
`c73415a` (review 3 LOW: sampling skipped where unused). Final code HEAD `c73415a`.
|
||||
Details RUST.md §12.14. Tools `.claude/audits/2026-11-01-v1-2-2-interior-tools/` (touch tap grid and its results).
|
||||
|
||||
## Rule
|
||||
|
||||
Polygon or path zone/trigger must fill a disc of 4 CSS px on the 320 × 568 preview (main 286 × 310, detail 254 × 191),
|
||||
nonzero (the layer's rule), stroke out. Conservative widest-disc search (disc crossing no edge, chord deviation taken
|
||||
off, arcs add an f32 drift bound), refuses in doubt (0.03 px band measured). Caps: 4 096 vertices, 4 096 cells, 2²⁵ edge
|
||||
distances per sheet, over them refused. Arcs as browsers store them: nonzero radius below 2⁻²⁰ unreadable, endpoints equal in f32 draw no arc, the spread of
|
||||
one-ulp variants added to the deviation and their extremes to the bounds. Codes
|
||||
`annotation.geometry.interior_too_small` / `verification.validation.marker_interior_too_small` (approved by the owner 2026-11-01).
|
||||
|
||||
## Threshold
|
||||
|
||||
Equine at 320 widest disc: caudal 4.951 px, sacral 11.30, thoracic 11.47, cervical 12.17, lumbar 14.15, trigger 29.13.
|
||||
4 px = the approved point threshold; equine accepted; caudal falls first past × 1.2378.
|
||||
|
||||
## Proofs
|
||||
|
||||
- cargo: `sheet_marker_visibility` (hostile refused, small legit accepted, threshold edge, projection, transforms, caps,
|
||||
equine), `interior_probe` (fixture drift), interior and path unit tests (random polygons both rules, 300 random curves
|
||||
within deviation, tiny and large arc radii).
|
||||
- Browsers, 6 projects: `interior-clicks.spec.ts` 102 passed, `canvas-clicks.spec.ts` 99 passed. 16 probes: core never
|
||||
over the browser's fill; 10 refused fill no 4 px disc; 6 accepted take real presses at the core's centre and the hit
|
||||
test on a 90 % ring, fill only and as shipped; equine zones take a real press.
|
||||
- Chromium touch adjustment: a tap up to ~10 px around a point's disc goes to the point (chromium-320/375, not
|
||||
webkit-375); every equine zone keeps a tappable interior (320: caudal 18/21 … cervical 195/195).
|
||||
- Mutations, rerun on the final code `c73415a` (closure): 29 killed, 2 equivalent (Z22 prune, Z25 unreachable); see Closure.
|
||||
- References: no frozen oracle, golden, N-1 copy, seed or PDF digest touched; app 566 incl. PDF suites pass.
|
||||
- Ignored cargo tests: one timing test (`pdf_serialize::l_report_with_real_rasters_costs_what_it_costs`) × 3 feature
|
||||
runs; passed in release (5.2 s).
|
||||
|
||||
## Reviews
|
||||
|
||||
- Verifier on `8dd2d78`: ECARTS(3), all documentation, fixed in `03be75b`; I1–I4, I6 met; I5/I7 gates run here.
|
||||
- Security on `8dd2d78`: PASS, MEDIUM sub-f32 arc radius (fixed `03be75b`), LOWs fixed (arc f32 drift, trace past cap,
|
||||
fail-open default) or informational (libm ulp native/wasm at the exact threshold).
|
||||
- Security on `03be75b`: PASS, two sibling MEDIUMs (f32-equal endpoints, ill-conditioned arc), fixed `86dce16`.
|
||||
- Security on `86dce16`: PASS, no MEDIUM; LOW sampling cost fixed `c73415a`; LOWs open: arc tangent to a frame edge
|
||||
refused (spread in bounds), spread an estimate (≤ 0.13 units measured on a model), refused needle hairline past the
|
||||
frame, arc cost bounded by document size only (~1.8 s worst native).
|
||||
|
||||
## Gates on `c73415a`
|
||||
|
||||
check:all passed: cargo 2 350 passed, 0 failed, 3 ignored (one timing test × 3 runs); core-wasm 65, supabase 128, app 566;
|
||||
e2e:ui 227 (incl. canvas-clicks 99 and interior-clicks 102, six projects); Docker app image, worker test and image.
|
||||
e2e:shell 86 on the isolated sandbox. WASM 580 428 B gzip -9 native, 580 522 in the app image (margin 19 478 B).
|
||||
|
||||
## Closure (owner brief « Validation définitive V1-2.2 », 2026-11-01)
|
||||
|
||||
- Owner verdict: VERIFIED on `c73415a` (BDR-092, V1-2 contract §17.7). Codes `interior_too_small` /
|
||||
`marker_interior_too_small` approved. Six LOWs accepted and still tracked (TODO V1-2 section), never declared fixed.
|
||||
- Verifier history: on `8dd2d78` ECARTS(3), three documentation gaps fixed in `03be75b` (the earlier result is not a
|
||||
conformity). Fresh verifier on the closed state (`de2dfb3..e190dfc`): I1-I6 and I8 MET, I7 ECARTS(1): Z7, Z19, Z24
|
||||
of the mutation script anchored on code that left with `03be75b` / `86dce16`, so the recorded count was not
|
||||
reproducible on the final HEAD. Fixed: anchors moved to the final code, whole script rerun on `c73415a`: 29 killed,
|
||||
Z22 and Z25 equivalent. Z23 survived its integration suite there (the `f32` spread of `86dce16` refuses those arcs on
|
||||
its own) and is killed by the unit test `a_tiny_arc_radius_is_not_read`; the script now runs it on `--lib`. The
|
||||
final conformity therefore rests on this rerun plus the verifier's other findings (cargo 17 + 19 tests, Playwright
|
||||
interior-clicks 102 on six projects, WASM 580 428 B native, references diff empty).
|
||||
- Security: three passes PASS, no MEDIUM open on `86dce16`; `c73415a` = one LOW fix (sampling skipped).
|
||||
- Gates on `c73415a`: check:all passed; e2e:shell 86 on the isolated sandbox; WASM 580 522 B gzip in the app image.
|
||||
- Memory: LRN-108 (Chromium touch adjustment, observation only, never a selection contract).
|
||||
- Delta verifier on `5eca086` (I7 only, code diff `c73415a..HEAD` empty): CONFORME. 31/31 anchors found once, baseline
|
||||
green (lib 66, `sheet_frame` 13, `sheet_marker_visibility` 16), Z22 and Z25 equivalence confirmed by reading, the one
|
||||
ignored test × 3 feature runs confirmed. Final conformity of the closed state: I1-I6 and I8 MET (full pass), I7 MET
|
||||
(delta pass). Note: the V1-2.3 contract was committed with the closure (planning only, no V1-2.3 code then).
|
||||
@@ -0,0 +1,20 @@
|
||||
chromium-320 caudal: 21 geometric hits, taps {"caudal":18,"-":3}
|
||||
chromium-320 sacral: 67 geometric hits, taps {"sacral":51,"l6-s1":11,"-":2,"sacroiliac":2,"hip":1}
|
||||
chromium-320 lumbar: 104 geometric hits, taps {"lumbar":87,"t18-l1":9,"l6-s1":8}
|
||||
chromium-320 thoracic: 97 geometric hits, taps {"-":1,"thoracic":72,"c7-t1":18,"t18-l1":6}
|
||||
chromium-320 cervical: 195 geometric hits, taps {"cervical":195}
|
||||
chromium-320 head-trigger: 284 geometric hits, taps {"head-trigger":278,"-":6}
|
||||
chromium-375 caudal: 30 geometric hits, taps {"caudal":30}
|
||||
chromium-375 sacral: 97 geometric hits, taps {"sacral":77,"-":3,"l6-s1":15,"sacroiliac":2}
|
||||
chromium-375 lumbar: 144 geometric hits, taps {"lumbar":120,"t18-l1":13,"l6-s1":11}
|
||||
chromium-375 thoracic: 141 geometric hits, taps {"thoracic":121,"c7-t1":13,"t18-l1":7}
|
||||
chromium-375 cervical: 275 geometric hits, taps {"cervical":269,"-":6}
|
||||
chromium-375 head-trigger: 403 geometric hits, taps {"head-trigger":399,"-":4}
|
||||
webkit-375 caudal: 30 geometric hits, taps {"caudal":29,"-":1}
|
||||
webkit-375 sacral: 97 geometric hits, taps {"l6-s1":4,"-":2,"sacral":91}
|
||||
webkit-375 lumbar: 144 geometric hits, taps {"lumbar":142,"t18-l1":1,"-":1}
|
||||
webkit-375 thoracic: 141 geometric hits, taps {"-":10,"thoracic":130,"c7-t1":1}
|
||||
webkit-375 cervical: 275 geometric hits, taps {"cervical":270,"-":5}
|
||||
webkit-375 head-trigger: 403 geometric hits, taps {"-":7,"head-trigger":396}
|
||||
|
||||
[exited with code 0]
|
||||
@@ -0,0 +1,38 @@
|
||||
import { test } from '../support/browser'
|
||||
test('probe zone taps', async ({ page }, info) => {
|
||||
test.setTimeout(1_800_000)
|
||||
await page.goto('/e2e/harness/canvas.html')
|
||||
await page.locator('[data-anno-id="caudal"]').waitFor({ state: 'attached' })
|
||||
const zones = ['caudal', 'sacral', 'lumbar', 'thoracic', 'cervical', 'head-trigger']
|
||||
const out: string[] = []
|
||||
for (const id of zones) {
|
||||
const pts = await page.evaluate((id) => {
|
||||
const svg = document.querySelector('[data-testid="anatomy-canvas"] svg') as SVGSVGElement
|
||||
const ctm = svg.getScreenCTM()!
|
||||
const z = svg.querySelector(`[data-anno-id="${id}"]`) as SVGGeometryElement
|
||||
const b = z.getBBox()
|
||||
const step = 2 / ctm.a
|
||||
const res: { x: number; y: number; hit: string }[] = []
|
||||
for (let x = b.x; x <= b.x + b.width; x += step) for (let y = b.y; y <= b.y + b.height; y += step) {
|
||||
if (!z.isPointInFill(new DOMPoint(x, y))) continue
|
||||
const p = new DOMPoint(x, y).matrixTransform(ctm)
|
||||
const hit = document.elementFromPoint(p.x, p.y)?.closest('[data-anno-id]')?.getAttribute('data-anno-id') ?? '-'
|
||||
res.push({ x: p.x, y: p.y, hit })
|
||||
}
|
||||
return res
|
||||
}, id)
|
||||
const tally: Record<string, number> = {}
|
||||
let n = 0
|
||||
for (const p of pts) {
|
||||
if (p.hit !== id) continue
|
||||
n++
|
||||
const before = ((await page.getByTestId('clicks').textContent()) ?? '').split(' ').filter(Boolean).length
|
||||
await page.touchscreen.tap(p.x, p.y)
|
||||
await page.waitForTimeout(400)
|
||||
const got = ((await page.getByTestId('clicks').textContent()) ?? '').split(' ').filter(Boolean).slice(before).join(',') || '-'
|
||||
tally[got] = (tally[got] ?? 0) + 1
|
||||
}
|
||||
out.push(`${info.project.name} ${id}: ${n} geometric hits, taps ${JSON.stringify(tally)}`)
|
||||
}
|
||||
console.log(out.join('\n'))
|
||||
})
|
||||
@@ -0,0 +1,58 @@
|
||||
# V1-2.2 owner decisions (brief « décisions et poursuite des corrections », 2026-11-01), mutation
|
||||
# run: J = junctions « the visible wins » (canvas passes), S = visible size on the phone preview,
|
||||
# N = frame range rules (f32), plus the frame and isolation mutants of 2026-10-30 whose anchors
|
||||
# moved (F5, I2, I6, I7). Each mutant is applied to its source file, its cargo suite runs, the
|
||||
# file is restored. Run from the repo root; the 2026-10-30 script runs the other mutants as is.
|
||||
import subprocess
|
||||
F='crates/core/src/anatomy/frame.rs'
|
||||
L='crates/core/src/anatomy/layer.rs'
|
||||
C='crates/core/src/anatomy/compose.rs'
|
||||
R='crates/core/src/domain/sheet/report.rs'
|
||||
V='crates/core/src/domain/sheet/verdict.rs'
|
||||
VIS='sheet_marker_visibility'
|
||||
muts=[
|
||||
('J1 canvas draws the PDF layer (document order)',C,' let layer = render_canvas_layer(document, view_id, &HashSet::new())?;',' let layer = render_composed_layer(document, view_id, &HashSet::new())?;','svg_marker_isolation'),
|
||||
('J2 canvas twins never capture',L,' Form::Canvas => "visiblePainted",',' Form::Canvas => "none",','svg_marker_isolation'),
|
||||
('J3 shapes before hitboxes',L,' passes[pass as usize].push(Node::Element(element));',' passes[[1, 0, 2][pass as usize]].push(Node::Element(element));','svg_marker_isolation'),
|
||||
('J4 PDF view in canvas passes',L,' layer(document, view_id, states, Form::Highlight)',' layer(document, view_id, states, Form::Canvas)','anatomy_compose'),
|
||||
('J5 canvas passes, frozen canvas compared',L,' let children = if form == Form::Canvas {',' let children = if false {','anatomy_canvas_op'),
|
||||
('S1 size never checked',F,' if shown >= MIN_VISIBLE_PX {',' if true || shown >= MIN_VISIBLE_PX {',VIS),
|
||||
('S2 point measured on its hitbox',F,' Geometry::Circle(c) if annotation.trigger().is_none() => 2.0 * twin_radius(c.r),',' Geometry::Circle(c) if annotation.trigger().is_none() => 2.0 * c.r,',VIS),
|
||||
('S3 every view on the main box',F,' let (w, h) = if main_view {',' let (w, h) = if true || main_view {',VIS),
|
||||
('S4 width-only scale',F,' (w / self.width).min(h / self.height)',' w / self.width',VIS),
|
||||
('S5 shapes measured on their larger side',F,' _ => (bounds.max_x - bounds.min_x).min(bounds.max_y - bounds.min_y),',' _ => (bounds.max_x - bounds.min_x).max(bounds.max_y - bounds.min_y),',VIS),
|
||||
('S6 too small reported as out of frame',R,' Placement::TooSmall => (TOO_SMALL, "shows too small on the phone preview"),',' Placement::TooSmall => (OUT_OF_FRAME, "shows too small on the phone preview"),',VIS),
|
||||
('S7 verdict ignores too small',V,' if found(&[TOO_SMALL]) {\n out.push(codes::MARKER_TOO_SMALL);\n }\n','',VIS),
|
||||
('S8 too small counted as a rules failure',V,' NO_FRAME,\n TOO_SMALL,\n ]',' NO_FRAME,\n ]',VIS),
|
||||
('S9 threshold 3 px',F,'pub const MIN_VISIBLE_PX: f64 = 4.0;','pub const MIN_VISIBLE_PX: f64 = 3.0;',VIS),
|
||||
('S10 threshold 5 px',F,'pub const MIN_VISIBLE_PX: f64 = 4.0;','pub const MIN_VISIBLE_PX: f64 = 5.0;',VIS),
|
||||
('N1 magnitude unchecked',F,' && reach <= MAX_FRAME_MAGNITUDE\n','',VIS),
|
||||
('N2 span floor unchecked',F,' && short >= MIN_FRAME_SPAN\n',' && short > 0.0\n',VIS),
|
||||
('N3 aspect unchecked',F,' && long <= short * MAX_FRAME_ASPECT\n','',VIS),
|
||||
('N4 offset ratio unchecked',F,' && reach <= short * MAX_FRAME_OFFSET_RATIO;',' ;',VIS),
|
||||
('N5 reach on the near edges only',F,' let reach = [min_x, min_y, min_x + width, min_y + height]',' let reach = [min_x, min_y]',VIS),
|
||||
('N6 reach without abs',F,' .fold(0.0_f64, |m, v| m.max(v.abs()));',' .fold(0.0_f64, |m, v| m.max(*v));',VIS),
|
||||
('N8 path numbers past 2^20 read',"crates/core/src/anatomy/path.rs",' .filter(|n| n.abs() <= super::frame::MAX_FRAME_MAGNITUDE)',' .filter(|n| n.is_finite())',VIS),
|
||||
('N7 non-finite accepted',F,' let usable = finite\n',' let usable = true\n','--lib'),
|
||||
# Equivalent: the aspect rule (long <= short * 100) refuses a zero or negative span already.
|
||||
('F5 zero width accepted (moved, equivalent)',F,' && short >= MIN_FRAME_SPAN\n',' && short >= -1.0\n','sheet_frame'),
|
||||
('F8 unreadable path accepted (moved)',F,' None => (Placement::Unreadable, None),',' None => (Placement::InFrame, None),','sheet_frame'),
|
||||
('F16 frame faults as rules failure (moved)',V,' let rule = |code: &str| {\n ![\n super::report::GEOMETRY_MISSING,\n OUT_OF_FRAME,\n NO_FRAME,\n TOO_SMALL,\n ]\n .contains(&code)\n };',' let rule = |code: &str| code != super::report::GEOMETRY_MISSING;','sheet_frame'),
|
||||
('F17 slack follows the offset (rerun, test tightened)',F,' let slack = EDGE_TOLERANCE * self.width.max(self.height);',' let slack = EDGE_TOLERANCE * (self.width.max(self.height) + self.min_x.abs());','sheet_frame'),
|
||||
('I2 layer inside the drawing group (canvas, moved)',C,' let layer = render_canvas_layer(document, view_id, &HashSet::new())?;\n root.children.push(Node::Element(checked(layer)?));',' let layer = render_canvas_layer(document, view_id, &HashSet::new())?;\n if let Some(Node::Element(group)) = root.children.first_mut() {\n group.children.push(Node::Element(checked(layer)?));\n }','svg_marker_isolation'),
|
||||
('I6 PDF view draws the R3 layer (moved)',L,' layer(document, view_id, states, Form::Highlight)',' layer(document, view_id, states, Form::Review)','anatomy_compose'),
|
||||
('I7 R3 layer gets the declared hitbox (moved)',L,' layer(document, view_id, states, Form::Review)',' layer(document, view_id, states, Form::Highlight)','anatomy_layer'),
|
||||
('C1 census: a root attribute reaches the layer',C,' let mut root = Element {\n qname: "svg".to_owned(),\n namespace: asset.namespace,\n attrs: namespaces,',' let mut root = Element {\n qname: "svg".to_owned(),\n namespace: asset.namespace,\n attrs: namespaces.into_iter().chain(std::iter::once(super::svg::tree::Attribute { qname: "stroke-width".to_owned(), namespace: None, value: "9".to_owned() })).collect(),','svg_marker_isolation'),
|
||||
]
|
||||
for name,path,old,new,suite in muts:
|
||||
src=open(path).read()
|
||||
if src.count(old)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',src.count(old), flush=True); continue
|
||||
open(path,'w').write(src.replace(old,new))
|
||||
try:
|
||||
target = suite if suite.startswith('--') else f'--test {suite}'
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && cargo test -q -p faunosteo-core {target} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out or 'error[' in out else 'SURVIVED')}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
@@ -0,0 +1,63 @@
|
||||
# V1-2.2 last MEDIUM (brief « fermeture du dernier MEDIUM », 2026-11-01), mutation run: Z = the
|
||||
# interior rule (anatomy::interior, path outline, frame placement, codes), plus the 2026-11-01
|
||||
# decision mutants whose anchors this change moved (S1, S8, F16). Z23-Z25 cover the fixes after the
|
||||
# security review of 8dd2d78. Z7, Z19, Z24 re-anchored on the final code c73415a (verifier
|
||||
# 2026-11-01: their first anchors left with 03be75b and 86dce16); Z23 run on the unit suite since 86dce16, whose
|
||||
# f32 spread refuses the same arcs on its own in sheet_marker_visibility. Each mutant is applied to its
|
||||
# source file, its cargo suite runs, the file is restored. Run from the repo root.
|
||||
import subprocess
|
||||
F='crates/core/src/anatomy/frame.rs'
|
||||
I='crates/core/src/anatomy/interior.rs'
|
||||
P='crates/core/src/anatomy/path.rs'
|
||||
R='crates/core/src/domain/sheet/report.rs'
|
||||
V='crates/core/src/domain/sheet/verdict.rs'
|
||||
VIS='sheet_marker_visibility'
|
||||
muts=[
|
||||
('Z1 interior never checked',F,' } else {\n interior_placement(geometry, scale, budget)\n }',' } else {\n Placement::InFrame\n }',VIS),
|
||||
('Z2 any disc found accepted',F,' Some(disc) if disc.radius >= radius => Placement::InFrame,',' Some(_) => Placement::InFrame,',VIS),
|
||||
('Z3 layer rule evenodd',I,'pub const LAYER_FILL_RULE: FillRule = FillRule::NonZero;','pub const LAYER_FILL_RULE: FillRule = FillRule::EvenOdd;',VIS),
|
||||
('Z4 every point inside',I,' if inside { nearest } else { -nearest }',' if inside || true { nearest } else { -nearest }',VIS),
|
||||
('Z5 closing edge dropped',I,' for (&a, &b) in closing.zip(subpath.iter()) {',' for (&a, &b) in closing.skip(1).zip(subpath.iter().skip(1)) {','--lib'),
|
||||
('Z6 deviation not taken off',I,' let radius = clearance(outline, rule, centre) - outline.deviation;',' let radius = clearance(outline, rule, centre);','--lib'),
|
||||
('Z7 chord deviation not recorded',P,' self.outline.deviation = self.outline.deviation.max(deviation);\n','','--lib'),
|
||||
('Z8 one chord per curve',P,' let count = wanted.clamp(1.0, MAX_CURVE_CHORDS as f64) as usize;',' let count = wanted.clamp(1.0, 1.0) as usize;',VIS),
|
||||
('Z9 budget never spent',I,' budget.work -= evaluated * edges;\n','','--lib'),
|
||||
('Z10 vertex overflow ignored',I,' !outline.overflow && self.cells(edge_count(outline)) > 0',' self.cells(edge_count(outline)) > 0',VIS),
|
||||
('Z11 path vertex cap ignored',P,' if self.vertices == self.max_vertices {',' if false {',VIS),
|
||||
('Z12 reported as too small',R,' Placement::InteriorTooSmall => (\n INTERIOR_TOO_SMALL,',' Placement::InteriorTooSmall => (\n TOO_SMALL,',VIS),
|
||||
('Z13 verdict ignores the interior',V,' if found(&[INTERIOR_TOO_SMALL]) {\n out.push(codes::MARKER_INTERIOR_TOO_SMALL);\n }\n','',VIS),
|
||||
('Z14 interior counted as a rules failure',V,' TOO_SMALL,\n INTERIOR_TOO_SMALL,\n ]',' TOO_SMALL,\n ]',VIS),
|
||||
('Z15 evenodd as nonzero',I,' FillRule::EvenOdd => winding % 2 != 0,',' FillRule::EvenOdd => winding != 0,','--lib'),
|
||||
('Z16 tolerance in units, not px',F,' let tolerance = INTERIOR_TOLERANCE_PX / scale;',' let tolerance = INTERIOR_TOLERANCE_PX;',VIS),
|
||||
('Z17 closepath keeps the subpath',P,' self.quadratic_control = None;\n self.open_subpath();\n }',' self.quadratic_control = None;\n }','--lib'),
|
||||
('Z18 cubic bend underestimated',P,' let bend = 6.0\n',' let bend = 1.0\n','--lib'),
|
||||
('Z19 arc bend on the smaller radius',P,' let radius = ellipse.rx.max(ellipse.ry);\n let spread',' let radius = ellipse.rx.min(ellipse.ry);\n let spread','--lib'),
|
||||
('Z20 unmeasured accepted',F,' return Placement::InteriorUnmeasured;',' return Placement::InFrame;',VIS),
|
||||
('Z21 cells past the cap',I,' || evaluated + 4 > affordable\n','','--lib'),
|
||||
# Security review of 8dd2d78 (MEDIUM tiny arc radius, LOWs), fixed after the first run.
|
||||
('Z23 tiny arc radius read',P,' if tiny(arc.rx) || tiny(arc.ry) {\n return None;\n }\n','','--lib'),
|
||||
('Z24 arc f32 drift dropped',P,' radius * ARC_F32_DRIFT + spread,',' spread,','--lib'),
|
||||
# Equivalent: bounds and outline share one reader, a path with bounds always has an outline.
|
||||
('Z25 path without outline accepted (equivalent)',F,' _ => Placement::InteriorUnmeasured,',' _ => Placement::InFrame,',VIS),
|
||||
# Second security review (03be75b): f32 endpoint equality, arc f32 spread.
|
||||
('Z26 endpoints compared in f64',P,' if stored(arc.to) == stored(self.at) {',' if arc.to == self.at {','--lib'),
|
||||
('Z27 arc spread dropped',P,' radius * ARC_F32_DRIFT + spread,',' radius * ARC_F32_DRIFT,','--lib'),
|
||||
('Z28 variants out of the bounds',P,' for angle in other.extreme_angles() {\n if other.sweeps(angle) {\n self.add(other.at(angle));\n }\n }\n','','--lib'),
|
||||
# Pruning only: a cell that cannot reach the floor never holds an accepted disc (equivalent).
|
||||
('Z22 floor prune removed (equivalent)',I,' || cell.reach() < search.floor\n','',VIS),
|
||||
('S1 size never checked (moved)',F,' if visible_size(annotation, geometry, &bounds) * scale < MIN_VISIBLE_PX {',' if false {',VIS),
|
||||
('S8 too small counted as a rules failure (moved)',V,' NO_FRAME,\n TOO_SMALL,\n INTERIOR_TOO_SMALL,\n ]',' NO_FRAME,\n INTERIOR_TOO_SMALL,\n ]',VIS),
|
||||
('F16 frame faults as rules failure (moved)',V,' let rule = |code: &str| {\n ![\n super::report::GEOMETRY_MISSING,\n OUT_OF_FRAME,\n NO_FRAME,\n TOO_SMALL,\n INTERIOR_TOO_SMALL,\n ]\n .contains(&code)\n };',' let rule = |code: &str| code != super::report::GEOMETRY_MISSING;','sheet_frame'),
|
||||
]
|
||||
for name,path,old,new,suite in muts:
|
||||
src=open(path).read()
|
||||
if src.count(old)!=1:
|
||||
print(name,'ANCHOR NOT FOUND x',src.count(old), flush=True); continue
|
||||
open(path,'w').write(src.replace(old,new))
|
||||
try:
|
||||
target = suite if suite.startswith('--') else f'--test {suite}'
|
||||
r=subprocess.run(['bash','-c',f'. scripts/rust-env.sh && timeout 600 cargo test -q -p faunosteo-core {target} 2>&1 | tail -3'],capture_output=True,text=True)
|
||||
out=r.stdout
|
||||
print(f"{name} ({suite}): {'KILLED' if 'FAILED' in out else ('COMPILE-ERR' if 'could not compile' in out or 'error[' in out else ('TIMEOUT' if r.returncode == 124 else 'SURVIVED'))}", flush=True)
|
||||
finally:
|
||||
open(path,'w').write(src)
|
||||
@@ -0,0 +1,16 @@
|
||||
# V1-2 test reductions found by the floor guard (develop..HEAD), 2026-11-01
|
||||
|
||||
Owner brief « Validation V1-2.3 (M6) et derniers ajustements » §5: keep the four historical test
|
||||
reductions identifiable, with scope and justification; report any one hiding a missing security
|
||||
coverage before V1-2.4. Found by `floor-guard.sh develop -- .` during the V1-2.3 reserves
|
||||
verification; none has a commit in V1-2.3.
|
||||
|
||||
| # | Finding | Commit | Scope | Justification | Security coverage |
|
||||
|---|---|---|---|---|---|
|
||||
| 1 | `crates/core/tests/sheet_conformance.rs` assertion lines 5 → 0 (counted at line 1) | 77e5fa4 (V1-2.1 M4/M5) | the two SQL-mirror tests `the_sql_expectations_are_the_mirrored_error_codes` and `the_pgtap_file_is_generated_from_the_fixtures`, and the generated `supabase/tests/011_sheet_conformance.sql` | owner decision O22 (V1-2 contract §12.2): the SQL business mirror `private.sheet_document_*` removed, the Rust core the only authority on business rules; the Rust-side test `the_rust_rules_report_what_the_typescript_rules_reported` stays with its three assertions over every fixture (the guard's count is a line-1 artefact) | none lost: publication requires an approved round whose passed verdict is current, computed by the core in the worker (M6) and checked by SQL; pgTAP 016, 017, 021 and sandbox `verify-e2e` case d |
|
||||
| 2 | `crates/core/tests/curation/LEDGER.tsv:123` assertion lines 27 → 26 | 77e5fa4, a21866e, 08efd9a | ledger rows: the 26 conformance rows retargeted to the remaining Rust test (same O22); the halo row retargeted to `the_halo_filter_is_written_once_and_a_composed_root_is_refused` | the ledger follows the tests it names; the halo test is stronger (one filter and a composed root refused, V1-2.2 reserved halo id, owner brief) | none lost; the TS « has no stale fixture file » check is now implicit: every file in `tests/conformance` is read and asserted |
|
||||
| 3 | `crates/core/tests/svg_marker_isolation.rs:248` `.skip(1)` | 4f52f5e, 9c606aa (V1-2.2) | an iterator `.skip(1)` in `layer_and_defs` (the composed root's first child, the drawing group, left out of the comparison) | not a test skip: false positive of the guard's pattern | n/a |
|
||||
| 4 | `packages/supabase/tests/anatomical-sheets.test.ts` deleted | 77e5fa4 (V1-2.1) | the client-side publish gate test (`publishSheetVersion` calling the RPC only for a publishable document) | the client gate was deleted with it: publication is the server's `publish_sheet_version(review_id)` on the stored verdict (V1-2 contract §6.8); a client check is not a security control | server gate covered: pgTAP 017 (19 calls, `publish.review.missing` while not approved), 016, 018 matrix, sandbox `verify-e2e` case d and case j (publication after a current passed verdict) |
|
||||
|
||||
Conclusion: no reduction hides a missing security coverage. Only #1 and #4 remove tests, both with
|
||||
the owner decision O22 and the server-side replacement already tested.
|
||||
@@ -0,0 +1,249 @@
|
||||
# V1-2.5 new FR/EN labels: proposals for the checkpoint
|
||||
|
||||
Ratified wordings used verbatim (V1-2 contract §3, §17.9, REVUE.md): Fiches anatomiques / Anatomical sheets;
|
||||
Administration; Accès non autorisé / Access denied, its explanation and « Retour au tableau de bord » / « Back to
|
||||
dashboard » (L32); Fiches officielles / Official sheets; Espèces / Species; Accès et habilitations / Access and
|
||||
permissions (L14). Everything below is a proposal, not ratified: the owner (2026-11-02) did not approve the roughly 350 new labels of V1-2.5, which get a separate review. Ratified at that checkpoint: « Relecteur ou relectrice »; the EN `catalogue.failure.drawing_hash_mismatch` « The illustration file's contents do not match its recorded SHA-256 hash. » (= `object_conflict` EN); the MFA factor name limit of 64 characters; no Copy button for the setup key.
|
||||
|
||||
## Slices E and F (shell, step-up, MFA)
|
||||
|
||||
| Key | FR | EN |
|
||||
|---|---|---|
|
||||
| admin.sheets.new | Nouvelle fiche (§11.1) | New sheet |
|
||||
| admin.step_up.title | Double authentification requise | Two-factor authentication required |
|
||||
| admin.step_up.body | L'administration demande une session renforcée : saisissez le code à 6 chiffres de votre application d'authentification. | Administration needs a strengthened session: enter the 6-digit code from your authenticator app. |
|
||||
| admin.step_up.no_factor | L'administration demande la double authentification. Ajoutez d'abord un facteur dans Mon compte, Sécurité. | Administration requires two-factor authentication. First add a factor in My account, Security. |
|
||||
| admin.step_up.to_security | Ouvrir Mon compte, Sécurité | Open My account, Security |
|
||||
| auth.failure.aal2_required | Votre compte est protégé par la double authentification : saisissez d'abord un code de votre application d'authentification. | Your account is protected by two-factor authentication: enter a code from your authenticator app first. |
|
||||
| mfa.description | Un code à 6 chiffres d'une application d'authentification, en plus du mot de passe. Exigée pour l'administration. | A 6-digit code from an authenticator app, on top of your password. Required for administration. |
|
||||
| mfa.factor.* | Chargement des facteurs… · Aucun facteur pour le moment. · Facteurs d'authentification · Facteur sans nom · Vérifié · Non vérifié · Ajouté le {date} · Supprimer · Facteur supprimé. | Loading factors… · No factor yet. · Authentication factors · Unnamed factor · Verified · Not verified · Added on {date} · Remove · Factor removed. |
|
||||
| mfa.remove.* | Supprimer ce facteur ? · « {name} » ne servira plus à renforcer votre session. Supprimer un facteur vérifié demande une session renforcée. · Supprimer | Remove this factor? · “{name}” will no longer strengthen your session. Removing a verified factor needs a strengthened session. · Remove |
|
||||
| mfa.enrol.* | Ajouter un facteur · Nom du facteur · Pour le reconnaître dans la liste, par exemple « Téléphone personnel ». · Continuer · Création… · Scannez ce QR code avec votre application d'authentification, puis saisissez le code qu'elle affiche. · QR code à scanner avec votre application d'authentification · Clé de configuration manuelle · Si vous ne pouvez pas scanner le QR code. Elle n'est affichée qu'une fois : ne la conservez pas ailleurs. · Facteur ajouté et vérifié. | Add a factor · Factor name · To recognise it in the list, for example “Personal phone”. · Continue · Creating… · Scan this QR code with your authenticator app, then enter the code it shows. · QR code to scan with your authenticator app · Setup key for manual entry · If you cannot scan the QR code. It is shown only once: do not keep it anywhere else. · Factor added and verified. |
|
||||
| mfa.code.* | Code de vérification · Les 6 chiffres affichés par votre application d'authentification. · Vérifier · Vérification… | Verification code · The 6 digits shown by your authenticator app. · Verify · Verifying… |
|
||||
| mfa.step_up.* | Facteur · Cette action demande une session renforcée : saisissez un code de votre application d'authentification. | Factor · This action needs a strengthened session: enter a code from your authenticator app. |
|
||||
| mfa.error.* | Le code comporte 6 chiffres. · Donnez un nom au facteur. · Nom trop long ({max} caractères maximum). | The code has 6 digits. · Give the factor a name. · Name too long ({max} characters maximum). |
|
||||
| mfa.failure.* | aal2_required: Cette action demande une session renforcée par la double authentification. · invalid_code: Code incorrect ou expiré. Saisissez le code affiché maintenant. · factor_not_found: Ce facteur n'existe plus. Rechargez la page. · challenge_expired: La vérification a expiré. Saisissez un nouveau code. · too_many_factors: Nombre maximal de facteurs atteint. Supprimez-en un avant d'en ajouter un autre. · name_taken: Un facteur porte déjà ce nom. Choisissez-en un autre. · unavailable: La double authentification est momentanément indisponible. Réessayez plus tard. · rate_limited, session_expired, network: as auth.failure.* | same keys, EN as in en.ts |
|
||||
|
||||
Choices to confirm: factor name limit 64 characters (no GoTrue limit documented); no copy button for the setup key.
|
||||
|
||||
## Permissions unavailable (checkpoint 2026-11-02)
|
||||
|
||||
| Key | FR | EN |
|
||||
|---|---|---|
|
||||
| permissions_unavailable.title | Impossible de vérifier vos autorisations (owner wording) | Unable to verify your permissions (proposal) |
|
||||
| permissions_unavailable.body | La vérification n'a pas abouti, probablement à cause d'un problème de connexion. Cette erreur ne modifie pas vos droits. | The check did not complete, probably because of a connection problem. This error does not change your permissions. |
|
||||
| common.retry (existing key, reused) | Réessayer (owner wording) | Retry |
|
||||
|
||||
## Slices G and H (administration): 203 keys, all proposals
|
||||
|
||||
Ratified wordings reused verbatim: §3 round and version statuses, grant kind labels, Fiche historique, Copie de travail, Créer une copie de travail, BDR-095 outcome titles, « Brouillons, revues, versions. », « Espèces du catalogue, actives ou non. », « Une copie de travail active existe déjà (une seule à la fois). » (board annotation « §14.3 » dropped). Choices to confirm: expiry = end of the chosen day Europe/Paris (23:59:59.999, strictly after today in Paris); species order 0 to 9999, checked in SQL (M7); « relecteur ou relectrice » (ratified 2026-11-02) inside the permissions list; « rôle propriétaire » and « aucune » in that line (not drawn on board 10).
|
||||
|
||||
| Key | FR | EN |
|
||||
|---|---|---|
|
||||
| admin.home.permissions | Vos habilitations : {list} | Your permissions: {list} |
|
||||
| admin.home.permissions_none | aucune | none |
|
||||
| admin.home.capability.sheet_editor | éditeur de fiches | sheet editor |
|
||||
| admin.home.capability.sheet_reviewer | relecteur ou relectrice | reviewer |
|
||||
| admin.home.capability.sheet_publisher | responsable de publication | publisher |
|
||||
| admin.home.owner_role | rôle propriétaire | owner role |
|
||||
| admin.home.session | session renforcée (double authentification) active | strengthened session (two-factor authentication) active |
|
||||
| admin.home.sheets_body | Brouillons, revues, versions. | Drafts, reviews, versions. |
|
||||
| admin.home.species_body | Espèces du catalogue, actives ou non. | Catalogue species, active or not. |
|
||||
| admin.home.access_body | Accès au catalogue et habilitations : attribution, échéance, révocation. | Catalogue access and permissions: grant, expiry, revocation. |
|
||||
| admin.home.open | Ouvrir | Open |
|
||||
| admin.home.all_sheets | Toutes les fiches officielles | All official sheets |
|
||||
| admin.badge.historical | Fiche historique | Historical sheet |
|
||||
| admin.badge.working_copy | Copie de travail | Working copy |
|
||||
| admin.badge.to_review | {count} à relire | {count} awaiting review |
|
||||
| admin.working_copy.create | Créer une copie de travail | Create a working copy |
|
||||
| admin.working_copy.active | Une copie de travail active existe déjà (une seule à la fois). | An active working copy already exists (one at a time). |
|
||||
| admin.working_copy.body | Un nouveau brouillon reprend le contenu et les illustrations de la fiche historique, sans la modifier. Choisissez l'identifiant de la copie. | A new draft takes the historical sheet's content and drawings, without changing it. Choose the copy's identifier. |
|
||||
| admin.working_copy.confirm | Créer la copie | Create the copy |
|
||||
| admin.working_copy.pending | Création… | Creating… |
|
||||
| admin.sheet_status.active | Active | Active |
|
||||
| admin.sheet_status.archived | Archivée | Archived |
|
||||
| admin.sheet_status.deleted | Supprimée | Deleted |
|
||||
| admin.version_status.draft | Brouillon | Draft |
|
||||
| admin.version_status.published | Publiée | Published |
|
||||
| admin.version_status.deprecated | Retirée | Withdrawn |
|
||||
| admin.round_status.verifying | Vérification en cours | Verifying |
|
||||
| admin.round_status.open | À relire | Awaiting review |
|
||||
| admin.round_status.approved | Approuvée | Approved |
|
||||
| admin.round_status.changes_requested | Modifications demandées | Changes requested |
|
||||
| admin.round_status.withdrawn | Soumission retirée | Submission withdrawn |
|
||||
| admin.round_status.verification_failed | Vérification échouée | Verification failed |
|
||||
| admin.outcome.failed.title | Vérification échouée | Verification failed |
|
||||
| admin.outcome.failed.body | La fiche ne passe pas la vérification. | The sheet did not pass verification. |
|
||||
| admin.outcome.unavailable.title | Vérification indisponible | Verification unavailable |
|
||||
| admin.outcome.unavailable.body | La vérification n'a pas pu aboutir. | Verification could not complete. |
|
||||
| admin.person.unnamed | Compte sans nom | Unnamed account |
|
||||
| admin.grant_kind.catalog_reader | Accès au catalogue | Catalogue access |
|
||||
| admin.grant_kind.sheet_editor | Éditeur de fiches | Sheet editor |
|
||||
| admin.grant_kind.sheet_reviewer | Relecteur ou relectrice (ratified, owner 2026-11-02) | Reviewer |
|
||||
| admin.grant_kind.sheet_publisher | Responsable de publication | Publisher |
|
||||
| admin.grant_state.active | En vigueur | In force |
|
||||
| admin.grant_state.expiring | Expire sous 30 jours | Expires within 30 days |
|
||||
| admin.grant_state.expired | Expiré | Expired |
|
||||
| admin.grant_state.revoked | Révoqué | Revoked |
|
||||
| admin.access.lede | Attribuer et révoquer l'accès au catalogue et les habilitations. Chaque droit porte un motif et reste tracé. | Grant and revoke catalogue access and permissions. Every right carries a reason and stays on record. |
|
||||
| admin.access.loading | Chargement des droits… | Loading rights… |
|
||||
| admin.access.grant_title | Attribuer un droit | Grant a right |
|
||||
| admin.access.lookup.email | Adresse e-mail du compte | Account e-mail address |
|
||||
| admin.access.lookup.hint | L'adresse exacte avec laquelle la personne se connecte. | The exact address the person signs in with. |
|
||||
| admin.access.lookup.submit | Rechercher | Find |
|
||||
| admin.access.lookup.pending | Recherche… | Searching… |
|
||||
| admin.access.lookup.not_found | Aucun compte avec cette adresse. | No account with this address. |
|
||||
| admin.access.account.inactive | Compte désactivé | Account deactivated |
|
||||
| admin.access.account.confirmed | E-mail confirmé | E-mail confirmed |
|
||||
| admin.access.account.unconfirmed | E-mail non confirmé | E-mail not confirmed |
|
||||
| admin.access.account.factor | Facteur vérifié | Verified factor |
|
||||
| admin.access.account.no_factor | Aucun facteur vérifié | No verified factor |
|
||||
| admin.access.account.roles | Rôles de plateforme : {roles} | Platform roles: {roles} |
|
||||
| admin.access.account.no_role | Aucun rôle de plateforme | No platform role |
|
||||
| admin.access.form.kind | Droit | Right |
|
||||
| admin.access.form.reason | Motif | Reason |
|
||||
| admin.access.form.reason_hint | Pourquoi ce droit est attribué, 1 000 caractères au plus. | Why this right is granted, 1,000 characters at most. |
|
||||
| admin.access.form.note | Note de vérification | Verification note |
|
||||
| admin.access.form.note_hint | Obligatoire pour une habilitation : la qualification déclarée et ce que vous avez vérifié, jamais une certification. | Required for a permission: the qualification declared and what you checked, never a certification. |
|
||||
| admin.access.form.note_hint_reader | Facultative pour l'accès au catalogue. | Optional for catalogue access. |
|
||||
| admin.access.form.expiry | Échéance | Expiry |
|
||||
| admin.access.form.expiry_hint | Le droit prend fin à la fin de ce jour. Sans date, il dure jusqu'à sa révocation. | The right ends at the end of this day. Without a date, it lasts until revoked. |
|
||||
| admin.access.form.submit | Attribuer | Grant |
|
||||
| admin.access.form.pending | Attribution… | Granting… |
|
||||
| admin.access.error.kind | Choisissez un droit. | Choose a right. |
|
||||
| admin.access.error.expiry | Choisissez une date postérieure à aujourd'hui. | Choose a date after today. |
|
||||
| admin.access.granted | Droit attribué. | Right granted. |
|
||||
| admin.access.ineligible_detail | Conditions : compte actif et e-mail confirmé pour tout droit ; facteur d'authentification vérifié pour une habilitation ; rôle de plateforme propriétaire ou administrateur pour Éditeur de fiches et Responsable de publication. | Conditions: an active account with a confirmed e-mail for every right; a verified authentication factor for a permission; the owner or admin platform role for Sheet editor and Publisher. |
|
||||
| admin.access.list.title | Droits attribués | Granted rights |
|
||||
| admin.access.list.filter | État | State |
|
||||
| admin.access.list.all | Tous | All |
|
||||
| admin.access.list.empty | Aucun droit attribué pour le moment. | No right granted yet. |
|
||||
| admin.access.list.no_match | Aucun droit dans cet état. | No right in this state. |
|
||||
| admin.access.list.granted | Attribué le {date} par {name} | Granted on {date} by {name} |
|
||||
| admin.access.list.expires | échéance le {date} | expires on {date} |
|
||||
| admin.access.list.no_expiry | sans échéance | no expiry |
|
||||
| admin.access.list.revoked_on | Révoqué le {date} | Revoked on {date} |
|
||||
| admin.access.list.suspended | Suspendu : conditions non remplies | Suspended: conditions not met |
|
||||
| admin.access.revoke.action | Révoquer | Revoke |
|
||||
| admin.access.revoke.title | Révoquer ce droit ? | Revoke this right? |
|
||||
| admin.access.revoke.body | {subject}. La révocation prend effet à la prochaine requête du compte et ne s'annule pas ; un nouveau droit pourra être attribué plus tard. | {subject}. Revocation takes effect at the account's next request and cannot be undone; a new right can be granted later. |
|
||||
| admin.access.revoke.reason | Motif de la révocation | Reason for revocation |
|
||||
| admin.access.revoke.confirm | Révoquer | Revoke |
|
||||
| admin.access.revoke.pending | Révocation… | Revoking… |
|
||||
| admin.access.revoke.done | Droit révoqué. | Right revoked. |
|
||||
| admin.sheets.loading | Chargement des fiches… | Loading sheets… |
|
||||
| admin.sheets.empty | Aucune fiche officielle pour le moment. | No official sheet yet. |
|
||||
| admin.sheets.no_match | Aucune fiche ne correspond à ces filtres. | No sheet matches these filters. |
|
||||
| admin.sheets.results_label | Liste des fiches officielles | Official sheet list |
|
||||
| admin.sheets.filter.species | Espèce | Species |
|
||||
| admin.sheets.filter.sheet_status | État de la fiche | Sheet status |
|
||||
| admin.sheets.filter.version_status | Statut de version | Version status |
|
||||
| admin.sheets.filter.round_status | État de la dernière revue | Latest review status |
|
||||
| admin.sheets.filter.all | Tous | All |
|
||||
| admin.sheets.current_version | version publiée {number} | published version {number} |
|
||||
| admin.sheets.no_published | aucune version publiée | no published version |
|
||||
| admin.sheets.draft | brouillon version {number} | draft version {number} |
|
||||
| admin.sheets.latest_round | revue n° {round} : {status} | review no. {round}: {status} |
|
||||
| admin.sheet_form.lede | La fiche démarre vide : vues, annotations et constats se saisissent ensuite dans l'éditeur. | The sheet starts empty: views, annotations and findings are entered later in the editor. |
|
||||
| admin.sheet_form.species | Espèce | Species |
|
||||
| admin.sheet_form.species_hint | Active ou non. Créer une fiche n'active pas l'espèce. | Active or not. Creating a sheet does not activate the species. |
|
||||
| admin.sheet_form.species_choose | Choisir une espèce | Choose a species |
|
||||
| admin.sheet_form.species_inactive | {name} (inactive) | {name} (inactive) |
|
||||
| admin.sheet_form.name_fr | Nom (français) | Name (French) |
|
||||
| admin.sheet_form.name_en | Nom (anglais) | Name (English) |
|
||||
| admin.sheet_form.slug | Identifiant (slug) | Identifier (slug) |
|
||||
| admin.sheet_form.slug_hint | Lettres minuscules sans accent, chiffres et tirets, 2 à 80 caractères ; unique parmi les fiches officielles. | Lower-case letters without accents, digits and hyphens, 2 to 80 characters; unique among official sheets. |
|
||||
| admin.sheet_form.submit | Créer la fiche | Create the sheet |
|
||||
| admin.sheet_form.creating | Création… | Creating… |
|
||||
| admin.sheet_form.error.species | Choisissez une espèce. | Choose a species. |
|
||||
| admin.sheet_form.error.slug | Lettres minuscules sans accent, chiffres et tirets, 2 à 80 caractères, sans tiret au début. | Lower-case letters without accents, digits and hyphens, 2 to 80 characters, not starting with a hyphen. |
|
||||
| admin.overview.loading | Chargement de la fiche… | Loading the sheet… |
|
||||
| admin.overview.not_found_title | Fiche introuvable | Sheet not found |
|
||||
| admin.overview.not_found_body | Cette fiche n'existe pas ou n'est pas accessible avec vos habilitations. | This sheet does not exist or is not available with your permissions. |
|
||||
| admin.overview.back | Retour aux fiches officielles | Back to official sheets |
|
||||
| admin.overview.copy_of | copie de la version {number} de la fiche historique | copy of version {number} of the historical sheet |
|
||||
| admin.overview.to_catalogue | Voir dans le catalogue | View in the catalogue |
|
||||
| admin.overview.versions | Versions | Versions |
|
||||
| admin.overview.rounds | Revues | Reviews |
|
||||
| admin.overview.no_versions | Aucune version. | No version. |
|
||||
| admin.overview.no_rounds | Aucune revue pour le moment. | No review yet. |
|
||||
| admin.overview.version | Version {number} | Version {number} |
|
||||
| admin.overview.revision | révision {revision} | revision {revision} |
|
||||
| admin.overview.round | Revue n° {round} | Review no. {round} |
|
||||
| admin.overview.created_on | créée le {date} | created on {date} |
|
||||
| admin.overview.published_on | publiée le {date} | published on {date} |
|
||||
| admin.overview.deprecated_on | retirée le {date} | withdrawn on {date} |
|
||||
| admin.overview.source | issue de la version {number} | based on version {number} |
|
||||
| admin.overview.authors | auteurs : {names} | authors: {names} |
|
||||
| admin.overview.submitted_on | soumise le {date} | submitted on {date} |
|
||||
| admin.overview.submitted_on_by | soumise le {date} par {name} | submitted on {date} by {name} |
|
||||
| admin.overview.decided_on | décidée le {date} | decided on {date} |
|
||||
| admin.overview.decided_on_by | décidée le {date} par {name} | decided on {date} by {name} |
|
||||
| admin.overview.withdrawn_on | retirée le {date} | withdrawn on {date} |
|
||||
| admin.species.lede | Les espèces du catalogue des fiches. Une espèce inactive n'apparaît pas dans les formulaires des animaux. | The species of the sheet catalogue. An inactive species does not appear in the animal forms. |
|
||||
| admin.species.loading | Chargement des espèces… | Loading species… |
|
||||
| admin.species.empty | Aucune espèce. | No species. |
|
||||
| admin.species.new | Nouvelle espèce | New species |
|
||||
| admin.species.state.active | Active | Active |
|
||||
| admin.species.state.inactive | Inactive | Inactive |
|
||||
| admin.species.order_value | ordre {order} | order {order} |
|
||||
| admin.species.edit | Modifier | Edit |
|
||||
| admin.species.edit_named | Modifier {name} | Edit {name} |
|
||||
| admin.species.rename | Renommer | Rename |
|
||||
| admin.species.rename_named | Renommer {name} | Rename {name} |
|
||||
| admin.species.activate.action | Activer | Activate |
|
||||
| admin.species.activate.action_named | Activer {name} | Activate {name} |
|
||||
| admin.species.activate.title | Activer « {name} » ? | Activate “{name}”? |
|
||||
| admin.species.activate.body | Les formulaires des animaux proposeront ensuite cette espèce à tous les comptes. Une espèce activée ne peut pas être désactivée. | The animal forms will then offer this species to every account. An activated species cannot be deactivated. |
|
||||
| admin.species.activate.confirm | Activer | Activate |
|
||||
| admin.species.activate.pending | Activation… | Activating… |
|
||||
| admin.species.activate.done | Espèce activée. | Species activated. |
|
||||
| admin.species.created | Espèce créée, inactive. | Species created, inactive. |
|
||||
| admin.species.saved | Espèce enregistrée. | Species saved. |
|
||||
| admin.species.dialog.create_title | Nouvelle espèce | New species |
|
||||
| admin.species.dialog.edit_title | Modifier l'espèce | Edit the species |
|
||||
| admin.species.dialog.rename_title | Renommer l'espèce | Rename the species |
|
||||
| admin.species.dialog.create_body | Créée inactive : les formulaires des animaux ne la proposent qu'après son activation par le propriétaire. Son identifiant ne change plus ensuite. | Created inactive: the animal forms offer it only once the owner activates it. Its identifier never changes afterwards. |
|
||||
| admin.species.field.id | Identifiant | Identifier |
|
||||
| admin.species.field.id_hint | Lettres minuscules sans accent, chiffres, tirets et soulignés, 64 caractères au plus ; « other » est réservé. | Lower-case letters without accents, digits, hyphens and underscores, 64 characters at most; “other” is reserved. |
|
||||
| admin.species.field.id_value | Identifiant : {id} | Identifier: {id} |
|
||||
| admin.species.field.name_fr | Nom (français) | Name (French) |
|
||||
| admin.species.field.name_en | Nom (anglais) | Name (English) |
|
||||
| admin.species.field.order | Ordre d'affichage | Display order |
|
||||
| admin.species.field.order_hint | Un nombre de 0 à 9999, les plus petits en premier. | A number from 0 to 9999, smaller first. |
|
||||
| admin.species.error.id | Identifiant invalide : lettres minuscules sans accent, chiffres, tirets et soulignés ; « other » est réservé. | Invalid identifier: lower-case letters without accents, digits, hyphens and underscores; “other” is reserved. |
|
||||
| admin.species.error.order | Un nombre entier de 0 à 9999. | A whole number from 0 to 9999. |
|
||||
| admin.failure.authentication_required | Connectez-vous pour continuer. | Sign in to continue. |
|
||||
| admin.failure.mfa_required | Cette action demande une session renforcée par la double authentification. | This action needs a session strengthened by two-factor authentication. |
|
||||
| admin.failure.forbidden | Action non autorisée. | Action not allowed. |
|
||||
| admin.failure.rights.account | Votre compte doit être actif, avec un e-mail confirmé, pour cette action. | Your account must be active, with a confirmed e-mail, for this action. |
|
||||
| admin.failure.rights.capability | Vos habilitations ne permettent pas cette action. | Your permissions do not allow this action. |
|
||||
| admin.failure.rights.mfa | Cette action demande une session renforcée par la double authentification. | This action needs a session strengthened by two-factor authentication. |
|
||||
| admin.failure.rights.owner | Action réservée au propriétaire de la plateforme. | Only the platform owner can do this. |
|
||||
| admin.failure.not_found | Élément introuvable ou non accessible. Rechargez la page. | Item not found or not available. Reload the page. |
|
||||
| admin.failure.grant.active | Ce compte détient déjà ce droit. | This account already holds this right. |
|
||||
| admin.failure.grant.ineligible | Ce compte ne remplit pas les conditions de ce droit. | This account does not meet the conditions of this right. |
|
||||
| admin.failure.grant.revoked | Ce droit est déjà révoqué. | This right is already revoked. |
|
||||
| admin.failure.grant.target_invalid | Ce compte n'existe plus. | This account no longer exists. |
|
||||
| admin.failure.document.shape | Le serveur n'a pas accepté le document de la fiche. | The server did not accept the sheet document. |
|
||||
| admin.failure.document.schema_version | Le serveur n'accepte pas cette version du format de fiche. | The server does not accept this sheet format version. |
|
||||
| admin.failure.document.species | L'espèce du document ne correspond pas à celle de la fiche. | The document's species does not match the sheet's. |
|
||||
| admin.failure.document.too_large | Le document de la fiche dépasse la taille autorisée. | The sheet document exceeds the allowed size. |
|
||||
| admin.failure.sheet.species_invalid | Cette espèce ne peut pas recevoir de fiche officielle. | This species cannot have an official sheet. |
|
||||
| admin.failure.sheet.slug_taken | Une autre fiche officielle utilise déjà cet identifiant. | Another official sheet already uses this identifier. |
|
||||
| admin.failure.species.exists | Une espèce porte déjà cet identifiant. | A species already has this identifier. |
|
||||
| admin.failure.species.not_active | Cette espèce n'est pas active : modifiez-la au lieu de la renommer. | This species is not active: edit it instead of renaming it. |
|
||||
| admin.failure.species.not_inactive | Cette espèce est déjà active : seul le propriétaire peut la renommer. | This species is already active: only the owner can rename it. |
|
||||
| admin.failure.working_copy.source_invalid | Seule une version de la fiche historique peut être copiée. | Only a version of the historical sheet can be copied. |
|
||||
| admin.failure.working_copy.exists | Une copie de travail active existe déjà (une seule à la fois). | An active working copy already exists (one at a time). |
|
||||
| admin.failure.working_copy.assets_missing | Des illustrations de la fiche historique manquent dans le stockage : aucune copie n'a été créée. Elles doivent d'abord être téléversées. | Some drawings of the historical sheet are missing from storage: no copy was created. They must be uploaded first. |
|
||||
| admin.failure.invalid_input | Une valeur n'a pas été acceptée. Vérifiez les champs. | A value was not accepted. Check the fields. |
|
||||
| admin.failure.rate_limited | Trop d'actions en peu de temps. Réessayez dans quelques minutes. | Too many actions in a short time. Try again in a few minutes. |
|
||||
| admin.failure.conflict_retry | Une autre action était en cours. Réessayez. | Another action was in progress. Retry. |
|
||||
| admin.failure.session_expired | Votre session a expiré. Reconnectez-vous. | Your session has expired. Sign in again. |
|
||||
| admin.failure.network | Connexion impossible. Vérifiez votre réseau, puis réessayez. | No connection. Check your network, then retry. |
|
||||
| admin.failure.unavailable | Le service ne répond pas pour le moment. Réessayez. | The service is not answering right now. Retry. |
|
||||
|
||||
## Slice I (catalogue): 53 keys
|
||||
|
||||
Ratified reused: Publiée / Retirée (§3, L1), Consulter / View (L26), Ouvrir dans l'administration (L25), Rechercher une fiche (board 01), Ajuster (board 03); `catalogue.failure.drawing_hash_mismatch` reuses the ratified FR wording of `object_conflict` (EN proposed). All other `catalogue.*` keys in fr.ts / en.ts (block at the end) are proposals: lede, search, filters, card counts (« N vues, N zones de constats »), version lines, versions list, canvas help and keyboard help, zoom buttons, zone panel, references, failure messages. Not built from the boards: the desktop « Sélection : … » tag over the canvas (02) and the folded « Références › » on mobile (03); the zone panel and a plain card carry them.
|
||||
@@ -0,0 +1,539 @@
|
||||
# V1-2.6 new FR/EN labels: proposals for the checkpoint
|
||||
|
||||
Ratified wordings used verbatim (REVUE.md, V1-2 contract §17.9, §17.11, L15). Wordings fixed by the owner on
|
||||
2026-11-03: « Restaurer la copie », « Ignorer la copie » (local recovery offer); « Recharger », « Réessayer »,
|
||||
« Garder ma version » (conflict dialog). Everything below is a proposal, not ratified: it goes to the owner's
|
||||
separate review and is never declared approved.
|
||||
|
||||
Each lot appends its rows to its own section (key, FR, EN, where it shows).
|
||||
|
||||
## Lot E (draft route, header, tabs, modes, recovery offer, conflict dialog)
|
||||
|
||||
Status column: `ratified` = REVUE.md wording; `plan wording` = quoted in the plan (FR verbatim, EN proposed unless noted); `proposal` = new.
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `admin.overview.open_draft` | Ouvrir le brouillon | Open the draft | Overview header, edit possible | plan wording |
|
||||
| `admin.overview.view_draft` | Consulter le brouillon | View the draft | Overview header, read-only | plan wording |
|
||||
| `admin.failure.draft.frozen` | Une revue est en cours sur ce brouillon : il ne peut plus être modifié. | A review is under way on this draft: it can no longer be edited. | Header notice after a refused save | proposal |
|
||||
| `admin.failure.draft.not_a_draft` | Cette version n'est plus un brouillon. | This version is no longer a draft. | Header notice after a refused save | proposal |
|
||||
| `admin.failure.sheet.inactive` | Cette fiche est archivée : son brouillon ne peut plus être modifié. | This sheet is archived: its draft can no longer be edited. | Header notice after a refused save | proposal |
|
||||
| `admin.failure.sheet.state` | L'état de la fiche ne permet pas cette action. Rechargez la page. | The sheet's state does not allow this action. Reload the page. | Header notice after a refused save | proposal |
|
||||
| `admin.failure.sheet.historical_read_only` | La fiche historique ne se modifie pas : créez une copie de travail. | The historical sheet cannot be edited: create a working copy. | Header notice after a refused save | proposal |
|
||||
| `editor.tab.list` | Sections du brouillon | Draft sections | Tab list accessible name | proposal |
|
||||
| `editor.tab.general` | Général | General | Tab | ratified (board 04) |
|
||||
| `editor.tab.views` | Vues et illustrations | Views and drawings | Tab | ratified (board 04) |
|
||||
| `editor.tab.annotations` | Annotations | Annotations | Tab | ratified (board 04) |
|
||||
| `editor.tab.findings` | Constats | Findings | Tab | ratified (board 04) |
|
||||
| `editor.tab.references` | Références | References | Tab | ratified (board 04) |
|
||||
| `editor.tab.vertebrae` | Vertèbres | Vertebrae | Tab | ratified (board 04) |
|
||||
| `editor.tab.verification` | Vérification | Verification | Tab | ratified FR (board 04); EN proposal |
|
||||
| `editor.tab.more` | Plus | More | Narrow tab disclosure | ratified FR (board 05); EN proposal |
|
||||
| `editor.draft.loading` | Chargement du brouillon… | Loading the draft… | Route, while loading | proposal |
|
||||
| `editor.draft.none` | Cette fiche n'a pas de brouillon. | This sheet has no draft. | Route, no draft | plan wording (notice + link) |
|
||||
| `editor.draft.overview_link` | Voir la fiche | View the sheet | Link to the overview (no draft, frozen) | proposal |
|
||||
| `editor.draft.title` | Brouillon, version {number} | Draft, version {number} | Header title | ratified FR (board 04); EN proposal |
|
||||
| `editor.draft.read_only` | Lecture seule | Read-only | Header badge with the lock icon | ratified (L16) |
|
||||
| `editor.draft.discard` | Annuler les modifications | Discard changes | Header button and its dialog title | ratified FR (board 04); EN proposal |
|
||||
| `editor.draft.discard_ask` | Abandonner les modifications non enregistrées ? Le brouillon reprendra la dernière révision enregistrée sur le serveur. | Discard the unsaved changes? The draft will return to the last revision saved on the server. | Discard confirmation | proposal |
|
||||
| `editor.draft.discard_confirm` | Abandonner les modifications | Discard changes | Discard confirmation button | proposal |
|
||||
| `editor.draft.status.revision` | Révision {revision} | Revision {revision} | Header status | ratified FR (board 04); EN proposal |
|
||||
| `editor.draft.status.unsaved` | modifications non enregistrées | unsaved changes | Header status | ratified FR (board 04); EN proposal |
|
||||
| `editor.draft.status.saving` | Enregistrement… | Saving… | Header status while a save runs | proposal |
|
||||
| `editor.draft.status.copy_quota` | Copie locale impossible (stockage plein) | Local copy impossible (storage full) | Header status, write failure | plan wording |
|
||||
| `editor.draft.status.copy_cap` | Copie locale impossible : deux autres brouillons ont déjà une copie dans cet onglet | Local copy impossible: two other drafts already have a copy in this tab | Header status, cap reached | plan wording |
|
||||
| `editor.draft.copy_kept` | Une copie locale temporaire existe dans cet onglet. | A temporary local copy exists in this tab. | Appended to a refusal that promises kept work, copy written | plan wording |
|
||||
| `editor.draft.copy_not_kept` | Les modifications non enregistrées ne peuvent pas être conservées. | The unsaved changes cannot be kept. | Appended to such a refusal, copy not written | plan wording (meaning); sentence proposal |
|
||||
| `editor.draft.mode.narrow` | L'édition nécessite une largeur d'écran d'au moins 1 024 px. | Editing requires a screen at least 1,024 px wide. | Mode notice, narrow screen | ratified (L15, title alone) |
|
||||
| `editor.draft.mode.rights` | Vos habilitations ne permettent pas de modifier ce brouillon. Il reste consultable. | Your permissions do not allow editing this draft. It remains readable. | Mode notice, rights | proposal |
|
||||
| `editor.draft.mode.frozen_verifying` | {round} · vérification en cours | {round} · verification in progress | Mode notice, round verifying ({round} = « Revue n° N ») | plan wording |
|
||||
| `editor.draft.mode.frozen_generic` | Une revue est en cours : le brouillon ne peut plus être modifié. | A review is under way: the draft can no longer be edited. | Mode notice, frozen without a known round (after a refused save) | proposal |
|
||||
| `editor.draft.mode.historical` | La fiche historique ne se modifie pas : créez-en une copie de travail pour l'éditer. | The historical sheet cannot be edited: create a working copy to edit it. | Mode notice, historical sheet | proposal |
|
||||
| `editor.draft.mode.inactive` | Cette fiche est archivée : son brouillon ne se modifie plus. | This sheet is archived: its draft can no longer be edited. | Mode notice, archived sheet | proposal |
|
||||
| `editor.draft.mode.unusable_copy` | Une copie locale non enregistrée de ce brouillon existe dans cet onglet ; elle ne peut pas être utilisée dans cet état. | An unsaved local copy of this draft exists in this tab; it cannot be used in this state. | Mode notice addition | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.offer` | Une copie locale temporaire de ce brouillon existe dans cet onglet (révision {revision}, {time}). Elle n'est pas enregistrée sur le serveur. Choisissez avant de modifier le brouillon. | A temporary local copy of this draft exists in this tab (revision {revision}, {time}). It is not saved on the server. Choose before editing the draft. | Recovery offer | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.older` | Elle est basée sur la révision {revision} ; le serveur est à la révision {server}. | It is based on revision {revision}; the server is at revision {server}. | Recovery offer, older base | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.unreadable` | Une copie locale de ce brouillon existe dans cet onglet mais ne peut pas être lue. Elle n'est pas enregistrée sur le serveur. L'ignorer la supprime de cet onglet : son contenu sera perdu. | A local copy of this draft exists in this tab but cannot be read. It is not saved on the server. Ignoring it deletes it from this tab: its content will be lost. | Unreadable copy notice (C34) | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.refused` | La copie locale ne passe pas le contrôle du document : {kind}. Elle est conservée. | The local copy does not pass the document check: {kind}. It is kept. | Copy refused by the core ({kind} = the core's closed kind) | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.restore` | Restaurer la copie | Restore the copy | Recovery offer button | ratified (owner 2026-11-03); EN proposal |
|
||||
| `editor.draft.recovery.ignore` | Ignorer la copie | Ignore the copy | Recovery offer button and dialog title | ratified (owner 2026-11-03); EN proposal |
|
||||
| `editor.draft.recovery.ignore_body` | Abandonner la copie locale non enregistrée (révision {revision}, {time}) ? Elle sera supprimée de cet onglet. | Abandon the unsaved local copy (revision {revision}, {time})? It will be deleted from this tab. | Ignore / abandon confirmation | plan wording FR; EN proposal |
|
||||
| `editor.draft.recovery.ignore_unreadable_body` | Abandonner la copie locale illisible ? Elle sera supprimée de cet onglet et son contenu sera perdu. | Abandon the unreadable local copy? It will be deleted from this tab and its content will be lost. | Ignore confirmation, unreadable copy | proposal |
|
||||
| `editor.draft.recovery.ignore_confirm` | Abandonner la copie | Abandon the copy | Confirmation button | plan wording FR; EN proposal |
|
||||
| `editor.draft.copy_issue.cap` | Deux autres brouillons ont déjà une copie locale dans cet onglet. Les modifications de celui-ci ne sont pas conservées tant que vous n'en abandonnez pas une. | Two other drafts already have a local copy in this tab. The changes to this one are not kept until you abandon one. | Cap notice | proposal |
|
||||
| `editor.draft.copy_issue.quota` | Le stockage de cet onglet est plein : les modifications non enregistrées de ce brouillon ne sont pas conservées. Enregistrez le brouillon ou abandonnez une copie ci-dessous. | This tab's storage is full: the unsaved changes to this draft are not kept. Save the draft or abandon a copy below. | Quota notice | proposal |
|
||||
| `editor.draft.copy.open` | Ouvrir ce brouillon | Open this draft | Other copy of the account | plan wording FR; EN proposal |
|
||||
| `editor.draft.copy.abandon` | Abandonner cette copie | Abandon this copy | Other copy of the account, and dialog title | plan wording FR; EN proposal |
|
||||
| `editor.draft.copy.revision` | révision {revision} | revision {revision} | Other copy line | plan wording |
|
||||
| `editor.draft.copy.unreadable` | Copie illisible | Unreadable copy | Other copy line, no readable name | proposal |
|
||||
| `editor.draft.conflict.reading_title` | Conflit d'enregistrement | Save conflict | Conflict dialog title while the server draft is read | proposal |
|
||||
| `editor.draft.conflict.reading` | Lecture de la révision du serveur… | Reading the server revision… | Conflict dialog, reading | proposal |
|
||||
| `editor.draft.conflict.known` | Une autre session a enregistré la révision {revision} | Another session saved revision {revision} | Conflict dialog title, N known | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.unknown` | Une autre session a enregistré une version plus récente de ce brouillon. | Another session saved a newer version of this draft. | Conflict dialog title, N unknown; header notice after dismissal | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.by_other` | par {name}, le {date} | by {name}, on {date} | Conflict dialog, author known | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.by_you` | depuis une autre session de votre compte, le {date} | from another session of your account, on {date} | Conflict dialog, saved by the caller | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.by_you_short` | une autre session de votre compte | another session of your account | Conflict confirmation, saved by the caller | proposal |
|
||||
| `editor.draft.conflict.reload` | Recharger | Reload | Conflict dialog button | ratified (owner 2026-11-03); EN proposal |
|
||||
| `editor.draft.conflict.retry` | Réessayer | Retry | Conflict dialog button, failed read | ratified (owner 2026-11-03); EN proposal |
|
||||
| `editor.draft.conflict.keep` | Garder ma version | Keep my version | Conflict dialog button | ratified (owner 2026-11-03); EN proposal |
|
||||
| `editor.draft.conflict.keep_hint` | Révision du serveur inconnue : rechargez ou réessayez. | Server revision unknown: reload or retry. | Hint under the disabled « Garder ma version » | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.reload_ask` | Abandonner vos modifications et recharger la révision {revision} ? | Abandon your changes and reload revision {revision}? | Reload confirmation | plan wording FR; EN proposal |
|
||||
| `editor.draft.conflict.reload_unknown_ask` | Abandonner vos modifications et recharger la version du serveur ? | Abandon your changes and reload the server version? | Reload confirmation, N unknown | proposal |
|
||||
| `editor.draft.conflict.keep_ask` | Remplacer la révision {revision} par votre version ? | Replace revision {revision} with your version? | Keep confirmation, author and date unknown | plan wording FR (author omitted); EN proposal |
|
||||
| `editor.draft.conflict.keep_ask_by` | Remplacer la révision {revision} ({who}, {date}) par votre version ? | Replace revision {revision} ({who}, {date}) with your version? | Keep confirmation, author and date known | plan wording FR; EN proposal |
|
||||
|
||||
## Lot F (Général, Références, Vertèbres, delete with dependents)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.action.delete` | Supprimer | Delete | Row delete button | plan wording |
|
||||
| `editor.action.remove` | Retirer | Remove | Remove an author | proposal |
|
||||
| `editor.action.move_up` | Monter | Move up | Reorder button label (↑) | proposal |
|
||||
| `editor.action.move_down` | Descendre | Move down | Reorder button label (↓) | proposal |
|
||||
| `editor.field.required` | Ce champ est obligatoire. | This field is required. | Blank required field | proposal |
|
||||
| `editor.field.required_names` | Renseignez le nom en français et en anglais. | Fill in the name in French and in English. | Creation form, names missing | proposal |
|
||||
| `editor.field.integer` | Indiquez un nombre entier. | Enter a whole number. | Count field not a whole number | proposal |
|
||||
| `editor.field.choose` | Choisir… | Choose… | Empty option of a required choice | proposal |
|
||||
| `editor.refusal.blocked` | La modification n'a pas été appliquée. | The change was not applied. | Command blocked by the store | proposal |
|
||||
| `editor.refusal.recovery` | Répondez d'abord à la copie locale proposée en haut de page. | First answer the local copy offered at the top of the page. | Command blocked by a pending recovery offer | proposal |
|
||||
| `editor.refusal.core.unknown_key` | Cet élément n'existe plus dans le brouillon. | This element no longer exists in the draft. | Core refusal unknown_key | proposal |
|
||||
| `editor.refusal.core.duplicate_key` | Un élément porte déjà cet identifiant. | An element already has this identifier. | Core refusal duplicate_key | proposal |
|
||||
| `editor.refusal.core.invalid_target` | Cette modification ne s'applique pas à cet élément. | This change does not apply to this element. | Core refusal invalid_target | proposal |
|
||||
| `editor.refusal.core.id_changed` | L'identifiant ou le code d'un élément ne se modifie pas. | An element's identifier or code cannot be changed. | Core refusal id_changed | proposal |
|
||||
| `editor.refusal.core.invalid_position` | Cette position n'existe pas dans la liste. | This position does not exist in the list. | Core refusal invalid_position | proposal |
|
||||
| `editor.refusal.core.too_deep` | L'arbre est trop profond (8 niveaux au plus). | The tree is too deep (8 levels at most). | Core refusal too_deep | plan wording (depth 8) |
|
||||
| `editor.refusal.core.has_dependents` | D'autres éléments utilisent encore celui-ci. | Other elements still use this one. | Core refusal has_dependents | proposal |
|
||||
| `editor.refusal.core.other` | Le contrôle du document refuse cette valeur ({kind}). | The document check refuses this value ({kind}). | Any other core refusal; {kind} = the core's closed kind | proposal |
|
||||
| `editor.element.sheet` | Fiche | Sheet | Dependents list, element kind | proposal |
|
||||
| `editor.element.reference` | Référence | Reference | Dependents list, element kind | proposal |
|
||||
| `editor.element.region` | Région vertébrale | Vertebral region | Dependents list, element kind | proposal |
|
||||
| `editor.element.category` | Catégorie | Category | Dependents list, element kind | proposal |
|
||||
| `editor.element.view` | Vue | View | Dependents list, element kind | proposal |
|
||||
| `editor.element.annotation` | Annotation | Annotation | Dependents list, element kind | proposal |
|
||||
| `editor.element.zone` | Zone de constats | Finding zone | Dependents list, element kind | proposal |
|
||||
| `editor.element.finding` | Constat | Finding | Dependents list, element kind | proposal |
|
||||
| `editor.relation.drawn_in` | dessinée dans cette vue | drawn in this view | Dependents list, relation | proposal |
|
||||
| `editor.relation.child_view` | vue de détail de cette vue | detail view of this view | Dependents list, relation | proposal |
|
||||
| `editor.relation.opens` | ouvre cette vue | opens this view | Dependents list, relation | proposal |
|
||||
| `editor.relation.uses_category` | utilise cette catégorie | uses this category | Dependents list, relation | proposal |
|
||||
| `editor.relation.links_zone` | est liée à cette zone de constats | is linked to this finding zone | Dependents list, relation | proposal |
|
||||
| `editor.relation.cites` | cite cette référence | cites this reference | Dependents list, relation | proposal |
|
||||
| `editor.relation.uses_region` | utilise cette région vertébrale | uses this vertebral region | Dependents list, relation | proposal |
|
||||
| `editor.relation.descendant` | fait partie de cet élément | is part of this element | Dependents list, relation | proposal |
|
||||
| `editor.delete.title` | Supprimer « {name} » ? | Delete "{name}"? | Delete dialog title | proposal |
|
||||
| `editor.delete.ask` | Supprimer « {name} » du brouillon ? | Delete "{name}" from the draft? | Delete dialog, no dependents | proposal |
|
||||
| `editor.delete.descendants` | Les éléments suivants seront aussi supprimés : | These elements will be deleted too: | Delete dialog, descendants listed | plan wording (meaning) |
|
||||
| `editor.delete.blocked` | « {name} » ne peut pas être supprimé : les éléments suivants l'utilisent encore. | "{name}" cannot be deleted: the following elements still use it. | Delete dialog, refusal with dependents | plan wording (meaning) |
|
||||
| `editor.delete.lookup_failed` | Impossible de vérifier ce qui utilise cet élément. Réessayez. | Could not check what uses this element. Try again. | Delete dialog, dependents lookup failed | proposal |
|
||||
| `editor.delete.confirm` | Supprimer | Delete | Delete dialog, confirm button | proposal |
|
||||
| `editor.delete.cancel` | Annuler | Cancel | Delete dialog, cancel button | proposal |
|
||||
| `editor.delete.close` | Fermer | Close | Delete dialog, close button | proposal |
|
||||
| `editor.general.texts` | Fiche | Sheet | Général, section title | proposal |
|
||||
| `editor.general.name_fr` | Nom (FR) | Name (FR) | Général, sheet name | plan wording FR; EN proposal |
|
||||
| `editor.general.name_en` | Nom (EN) | Name (EN) | Général, sheet name | plan wording FR; EN proposal |
|
||||
| `editor.general.description_fr` | Description (FR) | Description (FR) | Général | proposal |
|
||||
| `editor.general.description_en` | Description (EN) | Description (EN) | Général | proposal |
|
||||
| `editor.general.scope_disclaimer_fr` | Périmètre et limites (FR) | Scope and limits (FR) | Général, scope disclaimer | proposal |
|
||||
| `editor.general.scope_disclaimer_en` | Périmètre et limites (EN) | Scope and limits (EN) | Général, scope disclaimer | proposal |
|
||||
| `editor.general.attribution` | Attribution | Attribution | Général, section title | proposal |
|
||||
| `editor.general.authors` | Auteurs | Authors | Général, authors list | proposal |
|
||||
| `editor.general.author_new` | Nouvel auteur | New author | Général, add-author field | proposal |
|
||||
| `editor.general.author_add` | Ajouter l'auteur | Add the author | Général, add-author button | proposal |
|
||||
| `editor.general.author_remove` | Retirer {name} | Remove {name} | Général, remove-author accessible name | proposal |
|
||||
| `editor.general.license` | Licence | Licence | Général | proposal |
|
||||
| `editor.general.notes` | Notes | Notes | Général, attribution notes | proposal |
|
||||
| `editor.general.categories` | Catégories d'annotation | Annotation categories | Général, section title | plan wording FR; EN proposal |
|
||||
| `editor.general.category_name_fr` | Nom de la catégorie (FR) | Category name (FR) | Category field | proposal |
|
||||
| `editor.general.category_name_en` | Nom de la catégorie (EN) | Category name (EN) | Category field | proposal |
|
||||
| `editor.general.category_color` | Couleur | Colour | Category field | proposal |
|
||||
| `editor.general.category_color_hint` | Facultative, au format #rrggbb. | Optional, as #rrggbb. | Category colour hint | proposal |
|
||||
| `editor.general.category_new` | Nouvelle catégorie | New category | Category creation form | proposal |
|
||||
| `editor.general.category_add` | Ajouter la catégorie | Add the category | Category creation button | proposal |
|
||||
| `editor.reference.empty` | Aucune référence pour l'instant. | No reference yet. | Références, empty list | proposal |
|
||||
| `editor.reference.type` | Type | Type | Reference field | proposal |
|
||||
| `editor.reference.citation` | Citation | Citation | Reference field | proposal |
|
||||
| `editor.reference.url` | Adresse web (URL) | Web address (URL) | Reference field | proposal |
|
||||
| `editor.reference.doi` | DOI | DOI | Reference field | proposal |
|
||||
| `editor.reference.new` | Nouvelle référence | New reference | Reference creation form | proposal |
|
||||
| `editor.reference.add` | Ajouter la référence | Add the reference | Reference creation button | proposal |
|
||||
| `editor.reference.required` | Choisissez un type et renseignez la citation. | Choose a type and fill in the citation. | Reference creation, missing field | proposal |
|
||||
| `editor.reference.type.book` | Livre | Book | Reference type | proposal |
|
||||
| `editor.reference.type.journal` | Article de revue | Journal article | Reference type | proposal |
|
||||
| `editor.reference.type.standard` | Norme | Standard | Reference type | proposal |
|
||||
| `editor.reference.type.legal` | Texte juridique | Legal text | Reference type | proposal |
|
||||
| `editor.reference.type.web` | Site web | Web page | Reference type | proposal |
|
||||
| `editor.reference.type.manual` | Manuel | Manual | Reference type | proposal |
|
||||
| `editor.vertebra.empty` | Aucune région vertébrale pour l'instant. | No vertebral region yet. | Vertèbres, empty list | proposal |
|
||||
| `editor.vertebra.code` | Code | Code | Region field (read-only after creation) | proposal |
|
||||
| `editor.vertebra.name_fr` | Nom (FR) | Name (FR) | Region field | proposal |
|
||||
| `editor.vertebra.name_en` | Nom (EN) | Name (EN) | Region field | proposal |
|
||||
| `editor.vertebra.count` | Nombre de vertèbres | Number of vertebrae | Region field | proposal |
|
||||
| `editor.vertebra.range` | Plage possible | Possible range | Region range, read-only label | proposal |
|
||||
| `editor.vertebra.range_min` | Plage : minimum | Range: minimum | Region range field | proposal |
|
||||
| `editor.vertebra.range_max` | Plage : maximum | Range: maximum | Region range field | proposal |
|
||||
| `editor.vertebra.range_apply` | Appliquer la plage | Apply the range | Region range button | proposal |
|
||||
| `editor.vertebra.range_pair` | Indiquez les deux bornes de la plage, ou aucune. | Fill in both bounds of the range, or neither. | Region range, one bound missing | proposal |
|
||||
| `editor.vertebra.range_number` | Les bornes de la plage sont des nombres entiers. | The range bounds are whole numbers. | Region range, not numbers | proposal |
|
||||
| `editor.vertebra.new` | Nouvelle région vertébrale | New vertebral region | Region creation form | proposal |
|
||||
| `editor.vertebra.add` | Ajouter la région | Add the region | Region creation button | proposal |
|
||||
| `editor.vertebra.required` | Renseignez le code et les noms français et anglais. | Fill in the code and the French and English names. | Region creation, missing field | proposal |
|
||||
|
||||
## Lot G (Vues et illustrations, upload, cleaning dialog)
|
||||
|
||||
Status: `plan wording` = quoted in the plan or the brief (EN proposed unless noted); `proposal` = new.
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.views.main_title` | Vue principale | Main view | Views tab, main view card | proposal |
|
||||
| `editor.views.details_title` | Vues de détail | Detail views | Views tab, section title | proposal |
|
||||
| `editor.views.empty` | Aucune vue de détail pour l'instant. | No detail view yet. | Views tab, empty list | proposal |
|
||||
| `editor.views.name_fr` | Nom de la vue (FR) | View name (FR) | View field | proposal |
|
||||
| `editor.views.name_en` | Nom de la vue (EN) | View name (EN) | View field | proposal |
|
||||
| `editor.views.parent` | Vue parente | Parent view | Detail view field | proposal |
|
||||
| `editor.views.drawing` | Illustration | Drawing | View drawing section title | plan wording |
|
||||
| `editor.views.drawing.none` | Aucune illustration | No drawing | Drawing state | proposal |
|
||||
| `editor.views.drawing.ok` | Illustration valide | Drawing valid | Drawing state | plan wording (state ok) |
|
||||
| `editor.views.drawing.missing` | Illustration introuvable | Drawing not found | Drawing state | plan wording (state missing) |
|
||||
| `editor.views.drawing.rejected` | Illustration refusée | Drawing rejected | Drawing state | plan wording (state rejected) |
|
||||
| `editor.views.drawing.detail` | Détail : {detail} | Detail: {detail} | Drawing state, the core's detail | proposal |
|
||||
| `editor.views.drawing.inherited` | Utilise l'illustration de la vue parente. | Uses the parent view's drawing. | Detail view without own drawing | proposal |
|
||||
| `editor.views.drawing.hint` | Utilisez « Choisir une illustration » pour ajouter ou remplacer le dessin de cette vue. | Use « Choose a drawing » to add or replace this view's drawing. | Hint when the drawing is not usable (edit mode) | proposal |
|
||||
| `editor.views.drawing.unmeasured` | Cette vue n'est pas mesurable : ajoutez ou corrigez son illustration avant de placer ou de déplacer des éléments. | This view cannot be measured: add or fix its drawing before placing or moving elements. | Hint on an unmeasured view | proposal (adapted from the plan's Annotations hint) |
|
||||
| `editor.views.drawing.choose` | Choisir une illustration | Choose a drawing | Button (brief wording) | brief wording FR; EN proposal |
|
||||
| `editor.views.drawing.file` | Fichier d'illustration (SVG) | Drawing file (SVG) | File input accessible name | proposal |
|
||||
| `editor.views.drawing.use_parent` | Utiliser l'illustration de la vue parente | Use the parent view's drawing | Detail view, removes its own drawing (frame change) | proposal |
|
||||
| `editor.views.crop.title` | Recadrage | Crop | Detail view crop section | proposal |
|
||||
| `editor.views.crop.toggle` | Modifier le recadrage | Edit the crop | Button, opens the crop fields and the parent canvas | proposal |
|
||||
| `editor.views.crop.min_x` | Recadrage : x minimum | Crop: minimum x | Crop field (view_box.min_x) | proposal |
|
||||
| `editor.views.crop.min_y` | Recadrage : y minimum | Crop: minimum y | Crop field (view_box.min_y) | proposal |
|
||||
| `editor.views.crop.width` | Recadrage : largeur | Crop: width | Crop field (view_box.width) | proposal |
|
||||
| `editor.views.crop.height` | Recadrage : hauteur | Crop: height | Crop field (view_box.height) | proposal |
|
||||
| `editor.views.crop.hint` | Rectangle en unités du dessin parent. Quatre valeurs, ou aucune pour ne pas recadrer. Elles s'appliquent ensemble. | Rectangle in the parent drawing's units. Four values, or none for no crop. They apply together. | Crop group hint | proposal |
|
||||
| `editor.views.crop.incomplete` | Indiquez les quatre valeurs du recadrage, ou aucune. | Fill in all four crop values, or none. | Crop group, a value missing | proposal |
|
||||
| `editor.views.crop.number` | Les valeurs du recadrage sont des nombres. | The crop values are numbers. | Crop group, not a number | proposal |
|
||||
| `editor.views.crop.not_applied` | Non appliqué | Not applied | Crop group refused (board wording « non appliqué ») | ratified FR (plan); EN proposal |
|
||||
| `editor.views.crop.revert` | Revenir aux valeurs enregistrées | Revert to the saved values | Crop group refused | plan wording FR; EN proposal |
|
||||
| `editor.views.crop.canvas` | Vue parente avec le rectangle de recadrage | Parent view with the crop rectangle | Crop canvas accessible name | proposal |
|
||||
| `editor.views.crop.canvas_failed` | La vue parente ne peut pas être affichée. | The parent view cannot be displayed. | Crop canvas failure | proposal |
|
||||
| `editor.views.new` | Nouvelle vue de détail | New detail view | Creation form | proposal |
|
||||
| `editor.views.new_hint` | Saisissez le recadrage pour une vue recadrée ; laissez-le vide pour une vue qui aura sa propre illustration (à choisir une fois la vue ajoutée). | Fill in the crop for a cropped view; leave it empty for a view that will have its own drawing (chosen once the view is added). | Creation form hint | proposal |
|
||||
| `editor.views.add` | Ajouter la vue | Add the view | Creation button | proposal |
|
||||
| `editor.views.required` | Renseignez les noms français et anglais de la vue. | Fill in the French and English names of the view. | Creation, missing field | proposal |
|
||||
| `editor.views.frame.newly_invalid` | Ce changement de cadre mettrait en erreur la géométrie de : {names}. Déplacez d'abord ces éléments (onglet Annotations). | This frame change would put the geometry of these elements in error: {names}. Move them first (Annotations tab). | Refused frame change (crop, drawing, parent) | proposal |
|
||||
| `editor.views.frame.view_unmeasured` | Ce changement rendrait non mesurable une vue qui porte des annotations : {names}. | This change would make a view that holds annotations unmeasurable: {names}. | Refused frame change | proposal |
|
||||
| `editor.views.frame.kept` | L'illustration reste téléversée ; la vue garde son illustration précédente. | The drawing stays uploaded; the view keeps its previous drawing. | Refused attach after an upload | proposal |
|
||||
| `editor.upload.working` | Vérification et envoi de l'illustration… | Checking and sending the drawing… | Upload in progress | proposal |
|
||||
| `editor.upload.done` | L'illustration est ajoutée à la vue. | The drawing is added to the view. | Upload done | proposal |
|
||||
| `editor.upload.err.too_large` | Ce fichier dépasse 2 Mio. | This file is larger than 2 MiB. | Upload refused | plan code too_large |
|
||||
| `editor.upload.err.svg_active_content` | Ce fichier contient du contenu actif ou externe (script, lien, image distante) : il est refusé. | This file contains active or external content (script, link, remote image): it is refused. | Upload refused | plan code svg_active_content |
|
||||
| `editor.upload.err.svg_rejected` | Ce fichier n'est pas un dessin SVG utilisable ({reason}). | This file is not a usable SVG drawing ({reason}). | Upload refused, with the reader's reason | plan code svg_rejected |
|
||||
| `editor.upload.err.size_mismatch` | La taille du fichier envoyé ne correspond pas à celle annoncée. Réessayez. | The size of the file sent does not match the announced size. Try again. | Confirm refused | plan code size_mismatch |
|
||||
| `editor.upload.err.upload_missing` | Le fichier n'est pas arrivé sur le serveur. Réessayez. | The file did not reach the server. Try again. | Confirm refused | plan code upload_missing |
|
||||
| `editor.upload.err.upload.pending_other` | Ce dessin est en cours d'envoi par un autre compte. Réessayez dans quelques instants. | Another account is sending this drawing. Try again in a moment. | Policy refusal then confirm without object | plan code upload.pending_other |
|
||||
| `editor.upload.err.object_conflict` | Un fichier différent existe déjà sous cette empreinte : l'illustration est refusée. | A different file already exists under this hash: the drawing is refused. | Downloaded object does not match its hash | plan code object_conflict |
|
||||
| `editor.upload.err.caps` | Trop d'illustrations dans cette session d'édition (16 au plus). Enregistrez, puis rechargez le brouillon. | Too many drawings in this editing session (16 at most). Save, then reload the draft. | Core drawing cap | plan code caps |
|
||||
| `editor.upload.err.core` | Le contrôle du document a refusé cette illustration. | The document check refused this drawing. | Core refusal | proposal |
|
||||
| `editor.upload.reason.malformed` | fichier mal formé | malformed file | Reader reason | proposal |
|
||||
| `editor.upload.reason.doctype` | déclaration DOCTYPE interdite | DOCTYPE declaration not allowed | Reader reason | proposal |
|
||||
| `editor.upload.reason.not_svg` | ce n'est pas un SVG | not an SVG | Reader reason | proposal |
|
||||
| `editor.upload.reason.too_many_elements` | trop d'éléments | too many elements | Reader reason | proposal |
|
||||
| `editor.upload.reason.too_deep` | imbrication trop profonde | nesting too deep | Reader reason | proposal |
|
||||
| `editor.upload.reason.too_many_uses` | trop de réutilisations (use) | too many reuses (use) | Reader reason | proposal |
|
||||
| `editor.upload.reason.too_complex` | dessin trop complexe | drawing too complex | Reader reason | proposal |
|
||||
| `editor.upload.reason.reference_cycle` | références circulaires | circular references | Reader reason | proposal |
|
||||
| `editor.upload.reason.dangling_reference` | référence vers un élément absent | reference to a missing element | Reader reason | proposal |
|
||||
| `editor.upload.reason.reserved_id` | identifiant réservé | reserved identifier | Reader reason | proposal |
|
||||
| `editor.upload.reason.root_visibility` | élément racine masqué | hidden root element | Reader reason | proposal |
|
||||
| `editor.upload.reason.other` | motif non reconnu | unrecognised reason | Reader reason, any other | proposal |
|
||||
| `editor.views.drawing.not_canonical` | Illustration refusée : elle n'est pas sous la forme enregistrée. Choisissez de nouveau le fichier d'origine pour la remplacer. | Drawing refused: it is not in the stored form. Choose the original file again to replace it. | Drawing state, core holds it as rejected (not_canonical) | G fix, V1-2 §9.2/§9.3 item 6 |
|
||||
| `editor.views.drawing.rejected_reason` | Illustration refusée ({reason}). | Drawing refused ({reason}). | Drawing state, rejected for a reader reason; raw core detail never shown | G fix |
|
||||
| `editor.views.drawing.hash_mismatch` | Illustration refusée : le contenu du fichier ne correspond pas à son empreinte enregistrée. | Drawing refused: the file content does not match its recorded hash. | Drawing state, bytes failed the hash check at load | G fix, §9.3 item 3 |
|
||||
| `editor.upload.err.svg_not_canonical` | Cette illustration n'est pas sous la forme enregistrée : elle est refusée. Choisissez de nouveau le fichier d'origine. | This drawing is not in the stored form: it is refused. Choose the original file again. | Upload: bytes outside the page's cleaning refused at attach | G fix |
|
||||
| `editor.upload.reason.processing_instruction` | instruction de traitement interdite | processing instruction not allowed | Reason in `{reason}` | G fix |
|
||||
| `editor.upload.reason.removal` | le fichier contient des éléments à retirer | the file contains elements to remove | Reason in `{reason}` | G fix |
|
||||
Removed: `editor.views.drawing.detail` (raw core detail no longer shown).
|
||||
| `editor.cleaning.title` | Nettoyer cette illustration ? | Clean this drawing? | Cleaning dialog title | proposal |
|
||||
| `editor.cleaning.body` | Ce fichier contient des éléments qui ne sont pas conservés. L'aperçu montre le dessin tel qu'il sera enregistré. | This file contains elements that are not kept. The preview shows the drawing as it will be saved. | Cleaning dialog | proposal |
|
||||
| `editor.cleaning.preview` | Aperçu du dessin nettoyé | Preview of the cleaned drawing | Cleaning dialog preview accessible name | proposal |
|
||||
| `editor.cleaning.preview_failed` | L'aperçu du dessin nettoyé ne peut pas être composé. | The preview of the cleaned drawing cannot be composed. | Cleaning dialog | proposal |
|
||||
| `editor.cleaning.removed` | Éléments retirés : | Removed elements: | Cleaning dialog list | proposal |
|
||||
| `editor.cleaning.active` | Contenu actif ou externe retiré : | Active or external content removed: | Cleaning dialog list | proposal |
|
||||
| `editor.cleaning.style` | L'élément <style> a été retiré : les classes qu'il définissait s'afficheront sans style. | The <style> element was removed: the classes it defined will show unstyled. | Cleaning dialog | plan (style named) |
|
||||
| `editor.cleaning.confirm` | Nettoyer et utiliser cette version | Clean and use this version | Cleaning dialog button | plan wording FR; EN proposal |
|
||||
| `editor.cleaning.cancel` | Annuler | Cancel | Cleaning dialog button | plan wording FR; EN proposal |
|
||||
|
||||
## Lot I (Constats tree)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.findings.tree` | Arbre des constats | Findings tree | Tree accessible name | proposal |
|
||||
| `editor.findings.status.to_confirm` | À confirmer | To confirm | Review badge | ratified REVUE |
|
||||
| `editor.findings.status.reviewed` | Relu | Reviewed | Review badge | ratified REVUE |
|
||||
| `editor.findings.status.inherited` | Hérité, non relu | Inherited, not reviewed | Review badge | ratified REVUE |
|
||||
| `editor.findings.type.zone` | Zone de constats | Findings zone | Selected element kind | proposal |
|
||||
| `editor.findings.type.category` | Catégorie de constats | Findings category | Selected element kind | proposal |
|
||||
| `editor.findings.type.node` | Constat | Finding | Selected element kind | proposal |
|
||||
| `editor.findings.add_zone` | Ajouter une zone | Add a zone | Tree toolbar | plan wording FR; EN proposal |
|
||||
| `editor.findings.add_category` | Ajouter une catégorie | Add a category | Tree toolbar | plan wording FR; EN proposal |
|
||||
| `editor.findings.add_node` | Ajouter un constat | Add a finding | Tree toolbar, disabled at depth 8 | plan wording FR; EN proposal |
|
||||
| `editor.findings.new.zone` | Nouvelle zone de constats | New findings zone | Creation form title | proposal |
|
||||
| `editor.findings.new.category` | Nouvelle catégorie de constats | New findings category | Creation form title | proposal |
|
||||
| `editor.findings.new.node` | Nouveau constat | New finding | Creation form title | proposal |
|
||||
| `editor.findings.kind` | Type de catégorie | Category type | Creation form field | proposal |
|
||||
| `editor.findings.kind.dysfunction` | Dysfonction | Dysfunction | Category type option | proposal |
|
||||
| `editor.findings.kind.consultation_reason` | Motif de consultation | Reason for consultation | Category type option | proposal |
|
||||
| `editor.findings.kind.anamnesis` | Anamnèse | Anamnesis | Category type option | proposal |
|
||||
| `editor.findings.kind.custom` | Personnalisée | Custom | Category type option | proposal |
|
||||
| `editor.findings.required` | Renseignez le nom en français et en anglais (et le type d'une catégorie). | Fill in the name in French and English (and the type of a category). | Creation form refusal | proposal |
|
||||
| `editor.findings.create` | Créer | Create | Creation form button | proposal |
|
||||
| `editor.findings.cancel` | Annuler | Cancel | Creation form button | proposal |
|
||||
| `editor.findings.empty` | Aucune zone de constats pour l'instant. | No findings zone yet. | Empty tree | proposal |
|
||||
| `editor.findings.mark_reviewed` | Marquer comme relu | Mark as reviewed | Selected element action | ratified REVUE |
|
||||
| `editor.findings.reset_to_confirm` | Remettre à confirmer | Reset to confirm | Selected element action | ratified REVUE |
|
||||
| `editor.findings.description_fr` | Description (FR) | Description (FR) | Selected element field | proposal |
|
||||
| `editor.findings.description_en` | Description (EN) | Description (EN) | Selected element field | proposal |
|
||||
| `editor.findings.vet_referral` | Renvoi vers un vétérinaire | Veterinary referral | Node checkbox | proposal |
|
||||
| `editor.findings.yes` | Oui | Yes | Read-only value | proposal |
|
||||
| `editor.findings.no` | Non | No | Read-only value | proposal |
|
||||
| `editor.findings.references` | Références citées | Cited references | Selected element section | proposal |
|
||||
| `editor.findings.references_none` | Aucune référence citée. | No reference cited. | Selected element section | proposal |
|
||||
| `editor.findings.reference_add` | Citer une référence | Cite a reference | Selected element select | proposal |
|
||||
|
||||
## Lot H (Annotations tab: canvas, tools, creation, properties, geometry group)
|
||||
|
||||
Every key below is a proposal for the owner's separate review; none is declared approved. « plan wording FR » = quoted in the plan or ratified by the owner (FR verbatim, EN proposed).
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.annotations.tools` | Outils | Tools | Tool column accessible name | proposal |
|
||||
| `editor.annotations.tool.select` | Sélectionner et déplacer | Select and move | Tool button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.tool.point` | Point | Point | Tool button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.tool.zone` | Zone | Zone | Tool button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.tool.link` | Accès à une vue détaillée | Link to a detail view | Tool button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.undo` | Annuler | Undo | Tool column | plan wording FR; EN proposal |
|
||||
| `editor.annotations.redo` | Rétablir | Redo | Tool column | plan wording FR; EN proposal |
|
||||
| `editor.annotations.tool_hint.select` | Outil : sélectionner et déplacer · Échap annule un tracé | Tool: select and move · Esc cancels a tracing | Line above the canvas (board 04) | board 04 FR; EN proposal |
|
||||
| `editor.annotations.tool_hint.point` | Outil : point · cliquez dans le dessin pour placer un point. | Tool: point · click in the drawing to place a point. | Line above the canvas | proposal |
|
||||
| `editor.annotations.tool_hint.zone` | Outil : zone · cliquez pour poser les sommets ; Entrée ou « Fermer le tracé » termine, Échap annule. | Tool: zone · click to place the vertices; Enter or « Close the tracing » finishes, Esc cancels. | Line above the canvas | proposal |
|
||||
| `editor.annotations.tool_hint.link` | Outil : accès à une vue détaillée · tracez le contour qui ouvre la vue ; Entrée termine, Échap annule. | Tool: link to a detail view · trace the outline that opens the view; Enter finishes, Esc cancels. | Line above the canvas | proposal |
|
||||
| `editor.annotations.views` | Vues | Views | View chips group name | proposal |
|
||||
| `editor.annotations.unmeasured.hint` | Ce dessin n'est pas mesurable : ajoutez ou corrigez son illustration (onglet Vues et illustrations) avant de placer ou de déplacer des éléments. | This drawing cannot be measured: add or fix its illustration (tab Views and illustrations) before placing or moving elements. | Unmeasured view (C32) | plan wording FR; EN proposal |
|
||||
| `editor.annotations.outside` | Cliquez à l'intérieur du dessin. | Click inside the drawing. | Point click outside the frame | plan wording FR; EN proposal |
|
||||
| `editor.annotations.correction` | Le point ne tient pas à l'endroit choisi. Position corrigée proposée : x = {x}, y = {y}. | The point does not fit where you clicked. Corrected position proposed: x = {x}, y = {y}. | Corrected-position confirmation (C26) | plan wording FR; EN proposal |
|
||||
| `editor.annotations.correction_use` | Utiliser cette position | Use this position | Corrected-position confirmation | plan wording FR; EN proposal |
|
||||
| `editor.annotations.correction_cancel` | Annuler | Cancel | Corrected-position confirmation | plan wording FR; EN proposal |
|
||||
| `editor.annotations.no_category` | Créez d'abord une catégorie d'annotation (onglet Général). | Create an annotation category first (tab General). | Drawing tools disabled | plan wording FR; EN proposal |
|
||||
| `editor.annotations.no_child_view` | Aucune vue détaillée ne s'ouvre depuis cette vue : créez-en une dans l'onglet Vues et illustrations. | No detail view opens from this view: create one in the Views and illustrations tab. | Link tool disabled | proposal |
|
||||
| `editor.annotations.add.point` | Ajouter un point | Add a point | Keyboard creation button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.add.zone` | Ajouter une zone | Add a zone | Keyboard creation button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.add.detail_trigger` | Ajouter un accès | Add a link | Keyboard creation button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.new.point` | Nouveau point | New point | Creation panel title | plan wording FR; EN proposal |
|
||||
| `editor.annotations.new.zone` | Nouvelle zone | New zone | Creation panel title | plan wording FR; EN proposal |
|
||||
| `editor.annotations.new.detail_trigger` | Nouvel accès | New link | Creation panel title | plan wording FR; EN proposal |
|
||||
| `editor.annotations.create` | Créer | Create | Creation panel button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.create_cancel` | Annuler | Cancel | Creation panel button | plan wording FR; EN proposal |
|
||||
| `editor.annotations.name_fr` | Nom (FR) | Name (FR) | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.name_en` | Nom (EN) | Name (EN) | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.category` | Catégorie | Category | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.color` | Couleur | Colour | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.color_hint` | Laissez vide pour la couleur de la catégorie, ou indiquez une valeur hexadécimale (#rrggbb). | Leave empty for the category colour, or enter a hexadecimal value (#rrggbb). | Colour field hint | proposal |
|
||||
| `editor.annotations.laterality` | Latéralité | Laterality | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.laterality.unpaired` | Non latéralisée | Unpaired | Laterality option | board 04 FR; EN proposal |
|
||||
| `editor.annotations.laterality.bilateral` | Bilatérale | Bilateral | Laterality option | proposal |
|
||||
| `editor.annotations.laterality.left` | Gauche | Left | Laterality option | proposal |
|
||||
| `editor.annotations.laterality.right` | Droite | Right | Laterality option | proposal |
|
||||
| `editor.annotations.region` | Région vertébrale | Vertebral region | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.zone` | Zone de constats | Findings zone | Field | plan wording FR; EN proposal |
|
||||
| `editor.annotations.opens` | Vue ouverte | Opened view | Field (link) | plan wording FR; EN proposal |
|
||||
| `editor.annotations.none` | Aucune | None | Optional select, empty option | proposal |
|
||||
| `editor.annotations.required.fields` | Choisissez la catégorie et la latéralité (et la vue ouverte pour un accès). | Choose the category and the laterality (and the opened view for a link). | Creation refused before the core | proposal |
|
||||
| `editor.annotations.required.names` | Renseignez le nom en français et en anglais. | Enter the name in French and in English. | Creation refused before the core (a link's name is both languages or none) | proposal |
|
||||
| `editor.annotations.kind.point` | Point | Point | Annotation kind | proposal |
|
||||
| `editor.annotations.kind.zone` | Zone | Zone | Annotation kind | proposal |
|
||||
| `editor.annotations.kind.detail_trigger` | Accès | Link | Annotation kind | proposal |
|
||||
| `editor.annotations.status.to_confirm` | À confirmer | To confirm | Review badge | plan wording FR; EN proposal |
|
||||
| `editor.annotations.status.reviewed` | Relu | Reviewed | Review badge | plan wording FR; EN proposal |
|
||||
| `editor.annotations.status.inherited` | Hérité, non relu | Inherited, not reviewed | Review badge | plan wording FR; EN proposal |
|
||||
| `editor.annotations.mark_reviewed` | Marquer comme relu | Mark as reviewed | Properties action | plan wording FR; EN proposal |
|
||||
| `editor.annotations.to_confirm` | Remettre à confirmer | Reset to confirm | Properties action | plan wording FR; EN proposal |
|
||||
| `editor.annotations.list` | Annotations de la vue | Annotations of the view | List accessible name | proposal |
|
||||
| `editor.annotations.list_empty` | Aucune annotation dans cette vue. | No annotation in this view. | Empty list | proposal |
|
||||
| `editor.annotations.selection` | Sélection : {kind} « {name} » | Selection: {kind} « {name} » | Tag over the drawing (board 04) | plan wording FR; EN proposal |
|
||||
| `editor.annotations.select_hint` | Sélectionnez une annotation sur le dessin ou dans la liste pour voir ses propriétés. | Select an annotation on the drawing or in the list to see its properties. | Empty properties panel | proposal |
|
||||
| `editor.annotations.properties` | Propriétés de l'annotation | Annotation properties | Properties panel accessible name | proposal |
|
||||
| `editor.annotations.tracing` | {count} sommet(s) posé(s). | {count} vertex(es) placed. | Tracing bar | proposal |
|
||||
| `editor.annotations.trace_close` | Fermer le tracé | Close the tracing | Tracing bar | plan wording FR; EN proposal |
|
||||
| `editor.annotations.trace_cancel` | Annuler le tracé | Cancel the tracing | Tracing bar | plan wording FR; EN proposal |
|
||||
| `editor.annotations.replace_polygon` | Remplacer par un polygone | Replace with a polygon | Properties (path or missing geometry) | plan wording FR; EN proposal |
|
||||
| `editor.annotations.no_geometry` | Cette annotation n'a pas de géométrie : tracez un polygone pour lui en donner une. | This annotation has no geometry: trace a polygon to give it one. | Properties, geometry missing | proposal |
|
||||
| `editor.annotations.path` | Cette annotation est un tracé libre (path) : ses données ne se modifient pas ici. | This annotation is a free path: its data cannot be edited here. | Properties, path geometry | proposal |
|
||||
| `editor.annotations.geometry.circle` | Position et rayon | Position and radius | Geometry group legend | proposal |
|
||||
| `editor.annotations.geometry.polygon` | Sommets | Vertices | Geometry group legend | proposal |
|
||||
| `editor.annotations.geometry.cx` | Centre x | Centre x | Field | proposal |
|
||||
| `editor.annotations.geometry.cy` | Centre y | Centre y | Field | proposal |
|
||||
| `editor.annotations.geometry.r` | Rayon | Radius | Field | proposal |
|
||||
| `editor.annotations.geometry.vertex_x` | x du sommet {n} | x of vertex {n} | Field | proposal |
|
||||
| `editor.annotations.geometry.vertex_y` | y du sommet {n} | y of vertex {n} | Field | proposal |
|
||||
| `editor.annotations.geometry.vertices` | {count} sommets | {count} vertices | Polygon rows | proposal |
|
||||
| `editor.annotations.geometry.add_vertex` | Ajouter un sommet | Add a vertex | Polygon rows | plan wording FR; EN proposal |
|
||||
| `editor.annotations.geometry.unapplied` | Valeurs non appliquées : le brouillon est inchangé. | Values not applied: the draft is unchanged. | Geometry group after a refusal | proposal |
|
||||
| `editor.annotations.geometry.unapplied_tag` | non appliqué | not applied | Marker on a field of an unapplied group | plan wording FR; EN proposal |
|
||||
| `editor.annotations.geometry.revert` | Revenir aux valeurs enregistrées | Back to the saved values | Geometry group after a refusal | plan wording FR; EN proposal |
|
||||
| `editor.annotations.geometry.number` | Chaque champ doit contenir un nombre. | Each field must hold a number. | Geometry group, input shape | proposal |
|
||||
|
||||
## Lot J (Vérification, submission)
|
||||
|
||||
| Key | FR | EN | Where | Origin |
|
||||
|---|---|---|---|---|
|
||||
| `editor.verification.title` | Contrôle du brouillon | Draft check | Panel title (L27) | L27 FR/EN |
|
||||
| `editor.verification.errors` | {count} erreurs bloquantes | {count} blocking errors | Badge | L28 FR/EN |
|
||||
| `editor.verification.warnings` | {count} avertissements | {count} warnings | Badge | L28 FR/EN |
|
||||
| `editor.verification.to_confirm` | {count} éléments à confirmer | {count} items to confirm | Badge | L28 FR/EN |
|
||||
| `editor.verification.none` | Aucun problème détecté | No issues found | Panel, no issue | L27 FR/EN |
|
||||
| `editor.verification.warnings_title` | Avertissements | Warnings | Heading over the warnings | proposal |
|
||||
| `editor.verification.goto` | Aller à {tab} | Go to {tab} | Issue button ({tab} = the element name, else the tab name) | plan wording « Aller à … »; form proposal |
|
||||
| `editor.verification.to_confirm_info` | Des éléments restent à confirmer : cela n'empêche pas la soumission. | Some items are still to confirm: this does not prevent submission. | Info notice on to_confirm elements | proposal |
|
||||
| `editor.verification.completeness` | Complétude | Completeness | Section heading | proposal |
|
||||
| `editor.verification.vet_referrals` | {count} renvoi(s) vers un vétérinaire | {count} veterinary referral(s) | Completeness line | proposal |
|
||||
| `editor.verification.uncited` | {count} constat(s) sans référence citée | {count} finding(s) citing no reference | Completeness line | proposal |
|
||||
| `editor.verification.groups` | Statuts par groupe | Statuses per group | Section heading | proposal |
|
||||
| `editor.verification.group_removed` | supprimé | removed | Group row tag | proposal |
|
||||
| `editor.verification.status.to_confirm` | À confirmer | To confirm | Status count label | ratified status wording |
|
||||
| `editor.verification.status.reviewed` | Relu | Reviewed | Status count label | ratified status wording |
|
||||
| `editor.verification.status.inherited` | Hérité, non relu | Inherited, not reviewed | Status count label | ratified status wording |
|
||||
| `editor.verification.size_title` | Taille du document | Document size | Section heading | proposal |
|
||||
| `editor.verification.size` | {bytes} o sur {cap} o | {bytes} B of {cap} B | Document size against the cap | plan wording FR; EN proposal |
|
||||
| `editor.verification.caps_exceeded` | Limites dépassées : {caps}. | Limits exceeded: {caps}. | Caps exceeded, named | proposal |
|
||||
| `editor.verification.cap.views` | vues | views | Cap name | proposal |
|
||||
| `editor.verification.cap.annotations` | annotations | annotations | Cap name | proposal |
|
||||
| `editor.verification.cap.finding_nodes` | catégories et nœuds de constats | finding categories and nodes | Cap name | proposal |
|
||||
| `editor.verification.cap.finding_depth` | profondeur des constats | finding depth | Cap name | proposal |
|
||||
| `editor.verification.cap.label_length` | longueur des noms | name length | Cap name | proposal |
|
||||
| `editor.verification.cap.drawings` | illustrations | drawings | Cap name | proposal |
|
||||
| `editor.verification.cap.drawing_bytes` | taille d'une illustration | size of a drawing | Cap name | proposal |
|
||||
| `editor.verification.cap.drawings_total_bytes` | taille totale des illustrations | total size of the drawings | Cap name | proposal |
|
||||
| `editor.verification.cap.document_bytes` | taille du document | document size | Cap name | proposal |
|
||||
| `editor.verification.note_hint` | 1 à {max} caractères. | 1 to {max} characters. | Note field hint | proposal |
|
||||
| `editor.verification.note` | Note de soumission (obligatoire) | Submission note (required) | Field | plan wording FR; EN proposal |
|
||||
| `editor.verification.submit_title` | Soumission | Submission | Section accessible name | proposal |
|
||||
| `editor.verification.submit` | Soumettre à la revue | Submit for review | Button | plan wording FR; EN proposal |
|
||||
| `editor.verification.hint.errors` | Corrigez les {count} erreurs bloquantes pour soumettre. | Fix the {count} blocking errors to submit. | Hint under the disabled button | plan wording FR; EN proposal |
|
||||
| `editor.verification.hint.unsaved` | Enregistrez le brouillon avant de le soumettre. | Save the draft before submitting it. | Hint under the disabled button (unsaved or stale base) | plan wording FR; EN proposal |
|
||||
| `editor.verification.hint.note` | Saisissez la note de soumission pour soumettre. | Enter the submission note to submit. | Hint under the disabled button | proposal |
|
||||
| `editor.verification.issue.unknown` | Ce point ne respecte pas une règle de la fiche. Corrigez l'élément indiqué. | This item breaks a rule of the sheet. Fix the item shown. | Fallback for a code without a message | proposal |
|
||||
| `editor.verification.issue.view.main.count` | La fiche doit avoir exactement une vue principale. | The sheet must have exactly one main view. | Issue | proposal |
|
||||
| `editor.verification.issue.view.id.duplicate` | Deux vues ont le même identifiant. | Two views have the same id. | Issue | proposal |
|
||||
| `editor.verification.issue.view.parent.missing` | Le parent de cette vue détaillée n'existe pas. | The parent of this detail view does not exist. | Issue | proposal |
|
||||
| `editor.verification.issue.view.parent.cycle` | Les vues détaillées se renvoient en boucle. | The detail views refer to each other in a loop. | Issue | proposal |
|
||||
| `editor.verification.issue.view.unreachable` | Aucun accès d'une annotation n'ouvre cette vue détaillée. | No link of an annotation opens this detail view. | Issue | proposal |
|
||||
| `editor.verification.issue.view.asset.missing` | Cette vue n'a ni illustration ni cadrage. | This view has neither a drawing nor a crop. | Issue | proposal |
|
||||
| `editor.verification.issue.view.frame.unknown` | Le cadre de cette vue est inconnu : ni cadrage ni viewBox de l'illustration utilisables. | The frame of this view is unknown: no usable crop or drawing viewBox. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.id.duplicate` | Deux annotations ont le même identifiant. | Two annotations have the same id. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.view.missing` | Cette annotation est placée sur une vue qui n'existe pas. | This annotation sits on a view that does not exist. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.category.missing` | La catégorie de cette annotation n'existe pas. | The category of this annotation does not exist. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.opens_view.invalid` | La vue ouverte par cet accès n'est pas une vue détaillée de sa propre vue. | The view this link opens is not a detail view of its own view. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.finding_zone.missing` | La zone de constats de cette annotation n'existe pas. | The findings zone of this annotation does not exist. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.region.missing` | La région vertébrale de cette annotation n'est pas définie. | The vertebral region of this annotation is not defined. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.no_findings` | Cette annotation n'est liée à aucune zone de constats : un clic dessus ne proposera rien. | This annotation is linked to no findings zone: a click on it will offer nothing. | Warning | proposal |
|
||||
| `editor.verification.issue.annotation.geometry.missing` | Cette annotation n'a pas de géométrie. | This annotation has no geometry. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.geometry.out_of_frame` | Cette annotation n'est pas entièrement dans le cadre de sa vue. | This annotation is not entirely inside the frame of its view. | Issue | proposal |
|
||||
| `editor.verification.issue.annotation.geometry.too_small` | Un repère est trop petit pour être touché sur mobile. | A marker is too small to tap on a phone. | Issue | ratified, reused (REVUE.md Arbitrages `marker_too_small`, §17.9) |
|
||||
| `editor.verification.issue.annotation.geometry.interior_too_small` | L'intérieur d'une zone est trop étroit pour être touché sur mobile. | A zone's interior is too narrow to tap on a phone. | Issue | ratified, reused (REVUE.md `marker_interior_too_small`) |
|
||||
| `editor.verification.issue.region.code.duplicate` | Deux régions vertébrales ont le même code. | Two vertebral regions have the same code. | Issue | proposal |
|
||||
| `editor.verification.issue.region.count_range.invalid` | Le nombre habituel de cette région n'est pas dans la variation indiquée. | The usual count of this region is outside the stated variation. | Issue | proposal |
|
||||
| `editor.verification.issue.category.id.duplicate` | Deux catégories d'annotation ont le même identifiant. | Two annotation categories have the same id. | Issue | proposal |
|
||||
| `editor.verification.issue.finding_zone.id.duplicate` | Deux zones de constats ont le même identifiant. | Two findings zones have the same id. | Issue | proposal |
|
||||
| `editor.verification.issue.finding_zone.unreferenced` | Aucune annotation ne pointe vers cette zone de constats. | No annotation points to this findings zone. | Warning | proposal |
|
||||
| `editor.verification.issue.finding.id.duplicate` | Deux constats voisins ont le même identifiant. | Two sibling findings have the same id. | Issue | proposal |
|
||||
| `editor.verification.issue.finding.reference.missing` | Ce constat cite une référence qui n'est pas déclarée. | This finding cites a reference that is not declared. | Issue | proposal |
|
||||
| `editor.verification.issue.reference.id.duplicate` | Deux références ont le même identifiant. | Two references have the same id. | Issue | proposal |
|
||||
|
||||
## Lot M (fix round 1: ratified wordings, copy messages C25, submission failures)
|
||||
|
||||
Ruling R17: where the plan quoted a wording the contract contradicts, the contract wins. C25: every message
|
||||
about the local copy says it is temporary, limited to this tab and not saved on the server.
|
||||
|
||||
| Key | FR | EN | Old wording and why |
|
||||
|---|---|---|---|
|
||||
| `editor.upload.err.object_conflict` | Le contenu du fichier de l'illustration ne correspond pas à son empreinte SHA-256 enregistrée. | The illustration file's contents do not match its recorded SHA-256 hash. | Old « Un fichier différent existe déjà sous cette empreinte… »: ratified REVUE.md Arbitrages / contract §17.9 |
|
||||
| `editor.upload.err.size_mismatch` | La taille du fichier d'une illustration diffère de celle enregistrée. | A drawing's file size differs from the recorded size. | Old « La taille du fichier envoyé ne correspond pas à celle annoncée. Réessayez. »: ratified REVUE.md |
|
||||
| `editor.views.drawing.hash_mismatch` | removed | removed | State of `drawing_hash_mismatch` now reads `catalogue.failure.drawing_hash_mismatch` (the ratified wording REVUE.md maps to that code) |
|
||||
| `editor.draft.copy_kept` | Une copie locale temporaire, propre à cet onglet, est conservée ; elle n'est pas enregistrée sur le serveur. | A temporary local copy, limited to this tab, is kept; it is not saved on the server. | Old « Une copie locale temporaire existe dans cet onglet. » lacked the server fact (C25) |
|
||||
| `editor.draft.copy_not_kept` | Aucune copie locale temporaire n'a pu être écrite dans cet onglet : ces modifications ne sont enregistrées nulle part, ni dans l'onglet ni sur le serveur. | No temporary local copy could be written in this tab: these changes are saved nowhere, neither in the tab nor on the server. | Old « Les modifications non enregistrées ne peuvent pas être conservées. » (C25) |
|
||||
| `editor.draft.mode.unusable_copy` | Une copie locale temporaire de ce brouillon existe dans cet onglet ; elle n'est pas enregistrée sur le serveur et ne peut pas être utilisée dans cet état. | A temporary local copy of this draft exists in this tab; it is not saved on the server and cannot be used in this state. | Old lacked « temporaire » and the server fact (C25) |
|
||||
| `editor.draft.recovery.unreadable` | Une copie locale temporaire de ce brouillon existe dans cet onglet mais ne peut pas être lue. Elle n'est pas enregistrée sur le serveur. L'ignorer la supprime de cet onglet : son contenu sera perdu. | A temporary local copy of this draft exists in this tab but cannot be read. It is not saved on the server. Ignoring it deletes it from this tab: its content will be lost. | « temporaire » added (C25) |
|
||||
| `editor.draft.recovery.refused` | Le contrôle du document refuse cette copie : {kind}. Elle reste dans cet onglet. | The document check refuses this copy: {kind}. It stays in this tab. | Now a refusal line ADDED after the offer text (three facts), `{kind}` is a label (below), never the raw core kind (C25) |
|
||||
| `editor.draft.recovery.refused_kind.invalid_shape` / `core_unavailable` / `unknown` / `other` | le document ne respecte pas le format de la fiche / le moteur de calcul n'est pas disponible / motif non reconnu / motif non reconnu | the document does not follow the sheet format / the calculation engine is not available / reason not recognised / reason not recognised | New: labels of the refusal kind |
|
||||
| `editor.draft.recovery.ignore_body` | Abandonner la copie locale temporaire de cet onglet, non enregistrée sur le serveur (révision {revision}, {time}) ? Elle sera supprimée de cet onglet. | Abandon this tab's temporary local copy, not saved on the server (revision {revision}, {time})? It will be deleted from this tab. | Three facts (C25) |
|
||||
| `editor.draft.recovery.ignore_unreadable_body` | Abandonner la copie locale temporaire illisible de cet onglet, non enregistrée sur le serveur ? Elle sera supprimée de cet onglet et son contenu sera perdu. | Abandon this tab's unreadable temporary local copy, not saved on the server? It will be deleted from this tab and its content will be lost. | Three facts (C25) |
|
||||
| `editor.draft.copy_issue.cap` | Deux autres brouillons ont déjà une copie locale temporaire dans cet onglet. Les modifications de celui-ci ne sont conservées nulle part (rien n'est enregistré sur le serveur) tant que vous n'en abandonnez pas une. | Two other drafts already have a temporary local copy in this tab. The changes to this one are kept nowhere (nothing is saved on the server) until you abandon one. | Three facts (C25) |
|
||||
| `editor.draft.copy_issue.quota` | Le stockage de cet onglet est plein : la copie locale temporaire de ce brouillon ne peut pas être écrite, et ses modifications non enregistrées sur le serveur ne sont pas conservées. Enregistrez le brouillon ou abandonnez une copie ci-dessous. | This tab's storage is full: the temporary local copy of this draft cannot be written, and its changes not saved on the server are not kept. Save the draft or abandon a copy below. | Three facts (C25) |
|
||||
| `editor.draft.status.copy_quota` / `copy_cap` | Copie locale temporaire impossible (stockage de l'onglet plein) / … : deux autres brouillons ont déjà une copie dans cet onglet | Temporary local copy impossible (this tab's storage is full) / … two other drafts already have a copy in this tab | « temporaire » and « onglet » added (C25) |
|
||||
| `editor.refusal.recovery` | Répondez d'abord à la copie locale temporaire de cet onglet proposée en haut de page : elle n'est pas enregistrée sur le serveur. | First answer this tab's temporary local copy offered at the top of the page: it is not saved on the server. | Three facts (C25) |
|
||||
| `admin.failure.round.open` | Une revue est déjà en cours sur ce brouillon : il ne peut pas être soumis de nouveau. | A review is already under way on this draft: it cannot be submitted again. | New: `submit_sheet_review` raises `round.open`; it read « Le service ne répond pas » |
|
||||
| `admin.failure.view.asset.unknown` | Une illustration du brouillon n'est pas enregistrée pour cette fiche : choisissez-la de nouveau dans l'onglet Vues et illustrations. | A drawing of the draft is not registered for this sheet: choose it again in the Views and drawings tab. | New: raised by `submit_sheet_review` and publication |
|
||||
|
||||
### Lot M fix 3
|
||||
| Key | FR | EN | Why |
|
||||
|---|---|---|---|
|
||||
| `editor.draft.status.copy_quota` | Copie locale temporaire impossible (onglet plein) : non enregistré sur le serveur | Temporary local copy impossible (tab full): not saved on the server | C25: header status said nothing about the server (was « …(stockage de l'onglet plein) ») |
|
||||
| `editor.draft.status.copy_cap` | Copie locale temporaire impossible (deux autres copies dans cet onglet) : non enregistré sur le serveur | Temporary local copy impossible (two other copies in this tab): not saved on the server | C25 (was « …: deux autres brouillons ont déjà une copie dans cet onglet ») |
|
||||
|
||||
## Lot N1 (owner decisions 2026-11-04: plurals, parent illustration, category hint)
|
||||
|
||||
Plural keys use `<key>_one` / `<key>_other` (French 0 and 1 are singular). The base key is replaced by its two forms.
|
||||
|
||||
| Key | FR | EN | Old wording and why |
|
||||
|---|---|---|---|
|
||||
| `editor.annotations.tracing_one` / `_other` | {count} sommet posé. / {count} sommets posés. | {count} vertex placed. / {count} vertices placed. | Old « {count} sommet(s) posé(s). » / « {count} vertex(es) placed. »: agreement (C36) |
|
||||
| `editor.annotations.geometry.vertices_one` / `_other` | {count} sommet / {count} sommets | {count} vertex / {count} vertices | Old single form « {count} sommets »: agreement (C36) |
|
||||
| `editor.verification.errors_one` / `_other` | {count} erreur bloquante / {count} erreurs bloquantes | {count} blocking error / {count} blocking errors | Old L28 « {count} erreurs bloquantes »: its plural stays the ratified wording, the singular is new |
|
||||
| `editor.verification.warnings_one` / `_other` | {count} avertissement / {count} avertissements | {count} warning / {count} warnings | Agreement (C36) |
|
||||
| `editor.verification.to_confirm_one` / `_other` | {count} élément à confirmer / {count} éléments à confirmer | {count} item to confirm / {count} items to confirm | Agreement (C36) |
|
||||
| `editor.verification.vet_referrals_one` / `_other` | {count} renvoi vers un vétérinaire / {count} renvois vers un vétérinaire | {count} veterinary referral / {count} veterinary referrals | Old « {count} renvoi(s) … » / « {count} veterinary referral(s) » |
|
||||
| `editor.verification.uncited_one` / `_other` | {count} constat sans référence citée / {count} constats sans référence citée | {count} finding citing no reference / {count} findings citing no reference | Old « {count} constat(s) … » / « {count} finding(s) … » |
|
||||
| `editor.verification.hint.errors_one` / `_other` | Corrigez l'erreur bloquante pour soumettre. / Corrigez les {count} erreurs bloquantes pour soumettre. | Fix the blocking error to submit. / Fix the {count} blocking errors to submit. | Old « Corrigez les {count} erreurs bloquantes pour soumettre. » / « Fix the {count} blocking errors to submit. » read « 1 erreurs » |
|
||||
| `editor.views.drawing.use_parent_title` | Utiliser l'illustration de la vue parente ? | Use the parent view's drawing? | New: confirmation dialog (C39). The button label is unchanged |
|
||||
| `editor.views.drawing.use_parent_body` | La vue affichera l'illustration de la vue parente à travers son recadrage. Son propre fichier d'illustration reste enregistré, et vous pouvez annuler ce changement (Annuler). Les annotations de la vue repassent « à confirmer ». | The view will show the parent view's drawing through its crop. Its own drawing file stays stored, and you can undo this change (Undo). The view's annotations go back to "to confirm". | New: names the effect (nothing deleted, undo, `reconfirm_redrawn_views`) |
|
||||
| `editor.views.drawing.use_parent_confirm` / `_cancel` | Utiliser l'illustration parente / Annuler | Use the parent drawing / Cancel | New: dialog buttons |
|
||||
| `editor.findings.new.category_in_zone` | Nouvelle catégorie dans la zone « {zone} » | New category in the zone « {zone} » | Replaces `editor.findings.new.category` (« Nouvelle catégorie de constats » / « New findings category »): the form names the zone the category lands in (C42) |
|
||||
|
||||
## Lot N2 (owner decision 2026-11-04: sign-out and local copies, C43)
|
||||
|
||||
Shown by a voluntary sign-out only when the editor holds unsaved changes, a recovery offer waits, or this tab holds a local copy of the account. Nothing is asked otherwise.
|
||||
|
||||
| Key | FR | EN | Old wording and why |
|
||||
|---|---|---|---|
|
||||
| `shell.sign_out_loss_title` | Se déconnecter et perdre le travail local ? | Sign out and lose the local work? | New: dialog title |
|
||||
| `shell.sign_out_loss_body` | Des modifications non enregistrées ou des copies locales de cet onglet seraient perdues. Les enregistrer sur le serveur avant de vous déconnecter les conserve. | Unsaved changes or the local copies held in this tab would be lost. Saving them to the server before signing out keeps them. | New: names what is lost and the way to keep it |
|
||||
| `shell.sign_out_loss_cancel` | Annuler | Cancel | New: keeps the session and the copies |
|
||||
| `shell.sign_out_loss_confirm` | Se déconnecter quand même | Sign out anyway | New: purges this account's copies, then signs out |
|
||||
|
||||
## Lot N3 (owner decision 7, ruling R23: repair on attach to an unmeasured view, C41)
|
||||
|
||||
Shown when a drawing attached to a view that was unmeasured would put the geometry of its annotations out of the new frame. Plural keys use `_one` / `_other`.
|
||||
|
||||
| Key | FR | EN | Old wording and why |
|
||||
|---|---|---|---|
|
||||
| `editor.views.frame.newly_invalid_repairable` | Ces éléments sortent du nouveau cadre : {names}. Choisissez de nouveau l'illustration pour les réparer en l'attachant. | These elements fall outside the new frame: {names}. Choose the drawing again to repair them as you attach it. | New: shown after « Annuler » in the repair dialog. `editor.views.frame.newly_invalid` (« Déplacez d'abord ces éléments (onglet Annotations) ») stays for a measured view (C33); on an unmeasured view that tab is locked (C32) |
|
||||
| `editor.views.repair.title` | Réparer les annotations hors du nouveau cadre | Repair the annotations outside the new frame | New: dialog title |
|
||||
| `editor.views.repair.body_one` / `_other` | {count} annotation sort / {count} annotations sortent du nouveau cadre de cette illustration. Les valeurs proposées sont calculées dans ce cadre. Rien n'est appliqué avant « Attacher et appliquer » : l'illustration et les nouvelles valeurs sont alors appliquées ensemble, et un seul Annuler les restaure ensemble. | {count} annotation falls / {count} annotations fall outside the new frame of this drawing. The proposed values are computed in that frame. Nothing is applied before "Attach and apply": the drawing and the new values are then applied together, and a single Undo restores them together. | New: names the proposal, the atomic apply and the single undo |
|
||||
| `editor.views.repair.row` | {kind} « {name} » | {kind} "{name}" | New: heading of one annotation row |
|
||||
| `editor.views.repair.path_blocked` | Ce tracé n'a pas de coordonnées à corriger ici. Remplacez-le par un polygone pour pouvoir attacher l'illustration. | This path has no coordinates to correct here. Replace it with a polygon to be able to attach the drawing. | New: a path cannot be edited numerically; the existing « Remplacer par un polygone » converts it inside the form |
|
||||
| `editor.views.repair.refused` | Rien n'a été appliqué : le contrôle du document refuse ces valeurs. | Nothing was applied: the document check refuses these values. | New: the core refused the end state; the core's messages follow per annotation |
|
||||
| `editor.views.repair.apply` / `cancel` | Attacher et appliquer / Annuler | Attach and apply / Cancel | New: dialog buttons (« Attacher et appliquer » is the owner's wording) |
|
||||
|
||||
### Lot N3 fix round 1
|
||||
| Key | FR | EN | Why |
|
||||
|---|---|---|---|
|
||||
| `editor.views.repair.more_outside` | D'autres éléments sortiraient aussi du nouveau cadre : {names}. Rien n'a été appliqué. Annulez, corrigez-les, puis choisissez de nouveau l'illustration. | Other elements would also fall outside the new frame: {names}. Nothing was applied. Cancel, fix them, then choose the drawing again. | New: `newly_invalid` inside the dialog (the old wording sent to a locked tab) |
|
||||
| `editor.views.repair.not_measurable` | Avec cette illustration, une vue qui porte des annotations ne serait pas mesurable. Rien n'a été appliqué. | With this drawing, a view holding annotations would not be measurable. Nothing was applied. | New: `view_unmeasured` / `changed_unmeasured` inside the dialog |
|
||||
|
||||
## Lot O1 (owner decisions 2026-11-04: free paths never reshaped, C45; explicit category zone, C46)
|
||||
|
||||
| Key | FR | EN | Old wording and why |
|
||||
|---|---|---|---|
|
||||
| `editor.views.repair.path_blocked` | Ce tracé libre est conservé tel quel. L'illustration ne peut pas être attachée tant qu'il sort du nouveau cadre : l'éditeur ne sait pas encore corriger les points d'un tracé libre. | This free path is kept as it is. The drawing cannot be attached while it falls outside the new frame: the editor cannot yet correct the points of a free path. | Old « Ce tracé n'a pas de coordonnées à corriger ici. Remplacez-le par un polygone pour pouvoir attacher l'illustration. »: the conversion to a triangle is refused by the owner. The reason is plain, nothing offered. The repair dialog no longer uses `editor.annotations.replace_polygon` (kept for the properties panel) |
|
||||
| `editor.findings.zone` | Zone | Zone | New: label of the required zone choice in the « Ajouter une catégorie » form |
|
||||
| `editor.findings.add_category_no_zone` | Créez d'abord une zone pour ajouter une catégorie. | Create a zone first to add a category. | New: hint shown while « Ajouter une catégorie » is disabled because no zone exists |
|
||||
| `editor.findings.required` | Renseignez le nom en français et en anglais (et la zone et le type d'une catégorie). | Fill in the name in French and in English (and the zone and the type of a category). | Old « … (et le type d'une catégorie). »: the zone is now a required choice of a category |
|
||||
@@ -0,0 +1,95 @@
|
||||
# V1-2.6 new editor UX: feasibility audit (read-only, 2026-11-05)
|
||||
|
||||
Brief « V1-2.6 : nouvelles maquettes UX approuvées sur le principe ». Read-only analysis of `crates/core` and the
|
||||
V1-2.6 editor on `feature/v1-2-anatomical-sheets`; nothing built or run. Owner-facing summary in
|
||||
`docs/design/v1-2-6/REVUE.md` § Faisabilité. Classes: SUPPORTED, UI-ONLY, CORE-OP MISSING, SCHEMA CHANGE.
|
||||
|
||||
## 1. Annotation categories: SCHEMA CHANGE (fixed categories, opacity)
|
||||
- No fixed category. Equine draft: articulations #ff9500, os #a41e65, charnieres-vertebrales #ff0000, zone-colonne
|
||||
#e100ff, cadrans-du-crane #1baa08; only the legacy importer names them (curation/legacy/categories.rs:15-29).
|
||||
New sheet: `categories: []` (domain/sheet/create.rs:27); drawing tools disabled until one exists
|
||||
(EditableAnnotations.tsx:113,138).
|
||||
- Schema `{id, name, color: #rrggbb | null}` (schema.rs:219-228); `is_hex_color` = 7 chars, no alpha (domain/js.rs:180-183).
|
||||
- Delete refused with `has_dependents` only while used (edit.rs:570-577, 903-908); every row has Delete
|
||||
(general/CategoriesSection.tsx:108-116).
|
||||
- Opacity: constants only. Point twin 0.65 main / 0.5 detail (anatomy/layer.rs:94,242), zone 0.3 (layer.rs:299),
|
||||
trigger 0.06 (layer.rs:308), PDF highlight 0.85 (compose.rs:42), CSS selected 0.85 (styles/index.css:14);
|
||||
ANNOTATION-RENDERING.md:25-27. No stroke-opacity.
|
||||
- Displayed colour: annotation.color, else category colour, else #888888 (layer.rs:13,147-155).
|
||||
- A schema change touches: ts-rs types; frozen N-1 reader `.strict()` (packages/core-wasm/tests/n-1/.../schema.ts:66-72);
|
||||
PDF snapshot embeds categories (archive/snapshot_rules.rs:160-162); fingerprint = JCS of the validated document
|
||||
(fingerprint.rs:1-11, equine alias :43-48); review digests (review.rs:349-382); SQL pins (migrations
|
||||
20261010100000:12, 20261028110000:424); worker verdict strict read (verdict.rs:264-274); f64 breaks `Eq` on
|
||||
AnnotationCategory (schema.rs:219); rendering change → ANNOTATION-RENDERING.md first, R3/R4 goldens owner decision.
|
||||
|
||||
## 2. Category and vertebral region: no link (UI-ONLY filter, or new rule)
|
||||
- Only rule: region code exists, `annotation.region.missing` (validate.rs:348-365); also `region.code.duplicate`
|
||||
(validate.rs:391), `region.count_range.invalid` (validate.rs:502-526). Code grammar: 1-16 chars, alnum, `_`, `-`,
|
||||
alnum first (domain/js.rs:169-177).
|
||||
- Practitioner picker keyed on `vertebral_region_code`, never on the category (domain/editor/zone.rs:101-102,
|
||||
336-346; index.rs:145-164). Equine: only the 5 zone-colonne polygons carry a code.
|
||||
|
||||
## 3. Points: SUPPORTED (move, numeric radius); radius drag UI-ONLY
|
||||
- Drag translates cx, cy after 4 CSS px, rounded 0.01 (editor/annotations/gesture.ts:5,12-22); one `update` on
|
||||
pointer-up (useMoveGesture.ts:98-105; annotationCommit.ts:93-104).
|
||||
- Checks after commit (issues.ts:123-175): `out_of_frame` (frame.rs:113-119,167-174), `too_small` when
|
||||
2·max(2, r−12)·scale < 4 CSS px (layer.rs:260-262; frame.rs:63-67,160-165,219-221); no interior check on circles.
|
||||
- r > 0 only (schema.rs:335-336). « 12 + 3 % » is a page default (editor/annotations/frame.ts:55-59).
|
||||
|
||||
## 4. Polygons: SUPPORTED as `update` of the points array; vertex drag / segment insert UI-ONLY
|
||||
- Add vertex inserts the midpoint after the selected row (geometryEdit.ts:91-111); remove disabled at 3
|
||||
(GeometryGroup.tsx:320); schema refuses < 3 (schema.rs:365-372). Overlay vertices `pointer-events-none`
|
||||
(AnnotationOverlay.tsx:48-66,125).
|
||||
- Checks: out_of_frame, too_small, `interior_too_small` (frame.rs:206-254; interior.rs:33-43). Self-intersection
|
||||
allowed, nonzero fill decides (interior.rs:283).
|
||||
- Undo: one entry per accepted commit, 8 MiB (undo.ts:7,52-74; editorEdit.ts:45-61); Ctrl+Z / Ctrl+Shift+Z
|
||||
(useUndoShortcuts.ts:8-24). Preview on move, core on pointer-up (useMoveGesture.ts:90-105); < 61 ms on equine.
|
||||
|
||||
## 5. Paths: CORE-OP MISSING (point editing and translation)
|
||||
- Core reads `d` to measure only (anatomy/path.rs:51-133): private Cursor/Pen, no segment model, no writer.
|
||||
App: paths neither editable nor draggable (geometryEdit.ts:31-35; gesture.ts:32); C45 never reshaped
|
||||
(repair.ts:55-70,95-100). No seed contains a path.
|
||||
- Existing proposal, not built: `.claude/tasks/plans/2026-11-04-v1-2-6-path-repair-core-proposal.md`
|
||||
(`sheet.path_points`, `sheet.path_move_points`, wasm 583 126 / 600 000 B gzip).
|
||||
- Lossless handle editing also needs: number byte spans, relative-command compensation, H/V, implicit S/T controls,
|
||||
arcs (endpoint only). Reusable: path.rs number grammar (private), `json::js_number` (json.rs:18),
|
||||
`svg/number.rs:122`.
|
||||
|
||||
## 6. Detail views: crop SUPPORTED; derived asset not needed; remap on replacement MISSING
|
||||
- `compose_canvas` clones the whole sanitised asset, root becomes `<g>` keeping defs and transforms, only the root
|
||||
viewBox is the frame (compose.rs:94-160); reader strips only root class/style/transform/filter/mask/clip-path
|
||||
(svg/sanitize.rs:243-249).
|
||||
- Coordinates in the user space of the drawing shown (own asset, else up the parent chain) (compose.rs:74-90;
|
||||
frame.rs:6-11).
|
||||
- Replacement: clean_svg (crates/wasm/src/lib.rs:160) → upload → `addDrawing` (editorEdit.ts:85-104) → view
|
||||
`update` of `svg_asset_id` (drawingUpload.ts:185); numbers kept, read in the new space. View box or drawing change:
|
||||
geometry untouched, annotations → `to_confirm` (edit.rs:792-857); page refuses new geometry errors
|
||||
(issues.ts:141-160); repair dialog only for previously unmeasured views (repair.ts:132-151, C33).
|
||||
|
||||
## 7. Name suggestion from a rectangle: CORE-OP MISSING
|
||||
- No rectangle query or hit-test; clicks resolve through DOM `data-anno-id` (ops.rs:297,311-319;
|
||||
useCanvasGestures.ts:57-64). Internal blocks: `frame::geometry_bounds`, `placement` (frame.rs:167-204), index
|
||||
`name()` (index.rs:166-179). Sketch: `sheet.annotations_in_rect` {document, view_id, rect} →
|
||||
[{id, name, category_id, inside|partial}].
|
||||
|
||||
## 8. Touch
|
||||
- One pointer pans, two pinch, zoom 1-6, wheel, keyboard (catalogue/useFraming.ts:46-148; framing.ts:20);
|
||||
`touch-action: none` while a tool or drag is active (useCanvasGestures.ts:76-84).
|
||||
- No touch-sized handles (AnnotationOverlay.tsx:116). Move gesture has no pointerId check (useMoveGesture.ts:82-105).
|
||||
- LRN-108 Chromium tap tolerance, observation only. `MIN_EDIT_WIDTH` 1024 (editor/mode.ts:21; useViewport.ts:9-13).
|
||||
|
||||
## 9-10. References, Général
|
||||
- Only finding categories and nodes cite references (schema.rs:551,579); PDF snapshot drops them
|
||||
(snapshot_rules.rs:115,133,159).
|
||||
- Général: Fiche (name, description, scope disclaimer FR/EN), Attribution, Catégories (GeneralTab.tsx:22-24).
|
||||
No template text anywhere; contract §7.4 « No template of scientific content is shipped »; publication needs a
|
||||
non-blank disclaimer FR and EN, `publish.disclaimer.missing` (migration 20261028110000:206-214).
|
||||
|
||||
## 11. Reusable states
|
||||
Modes edit, narrow, rights, frozen, historical, inactive (mode.ts:12-18; ModeNotice.tsx); DraftHeader statuses;
|
||||
RecoveryNotice; CopyIssueNotice; ConflictDialog; BlockKind refusals (editorTypes.ts:13-23); frame refusal and repair
|
||||
dialog (i18n/fr.ts:1420-1434); canvas failure (AnnotationCanvas.tsx:164-188); delete dialog.
|
||||
|
||||
## Constraints in force
|
||||
BDR-043 (rules in Rust, no TS path parser), BDR-086, BDR-091, BDR-092, BDR-068, BDR-019, LRN-103, LRN-108; contract
|
||||
§8.3 level-2 deferrals and §8.4 O14 A; `crates/**` outside V1-2.6 scope without owner approval.
|
||||
@@ -0,0 +1,95 @@
|
||||
# V1-2.6 U1 new FR/EN labels: proposals
|
||||
|
||||
Everything below is a proposal (C44), not ratified: it goes to the owner's separate review. Each lot
|
||||
appends its rows to its own section (key, FR, EN, where it shows). Removed keys are listed per lot at the end.
|
||||
|
||||
## Lot B1 (four tabs, Annotations sections, references from the header)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.tab.errors_one` / `_other` | {count} erreur / {count} erreurs | {count} error / {count} errors | Vérification tab badge, in its accessible name | board text, plural form proposed |
|
||||
| `editor.place.drawing` | Dessin | Drawing | Live region, « Annotations · Dessin » | proposal |
|
||||
| `editor.place.views` | Vues | Views | Section heading, live region, « Aller à » fallback, hint link | proposal |
|
||||
| `editor.place.categories` | Catégories | Categories | Same | proposal |
|
||||
| `editor.place.regions` | Régions vertébrales | Vertebral regions | Same | T17 name |
|
||||
| `editor.place.references` | Références | References | Panel heading, live region | proposal |
|
||||
| `editor.section.back` | Retour au dessin | Back to the drawing | First control of each section | plan wording |
|
||||
| `editor.references.open` | Références | References | Header button | board text |
|
||||
| `editor.references.close` | Fermer les références | Close the references | Panel close button | proposal |
|
||||
| `editor.live.references_closed` | Références fermées | References closed | Live region on panel close | proposal |
|
||||
| `editor.live.creation_kept` | Une création est en cours : terminez-la ou abandonnez-la pour atteindre cette annotation. | A creation is in progress: finish or abandon it to reach this annotation. | Live region, « Aller à » kept | proposal |
|
||||
| `editor.live.tracing_kept` | Un tracé est en cours : terminez-le ou annulez-le pour atteindre cette annotation. | A tracing is in progress: finish or cancel it to reach this annotation. | Same | proposal |
|
||||
| `editor.overview.label` | Aperçu de la fiche | Sheet overview | Overview panel region name | proposal |
|
||||
| `editor.overview.views` | Vues | Views | Overview card | board text |
|
||||
| `editor.overview.view_main` / `view_detail` | Vue principale / Vue détaillée | Main view / Detail view | Overview rows | board text |
|
||||
| `editor.overview.annotations_one` / `_other` | {count} annotation / {count} annotations | {count} annotation / {count} annotations | Overview rows | board text |
|
||||
| `editor.overview.manage_views` / `see_views` | Gérer les vues / Voir les vues | Manage views / See the views | Overview entry, edit / read-only | board text |
|
||||
| `editor.overview.categories` | Catégories | Categories | Overview card | board text |
|
||||
| `editor.overview.categories_empty` | Aucune catégorie pour l'instant. | No category yet. | Overview card | proposal |
|
||||
| `editor.overview.edit_categories` / `see_categories` | Modifier les catégories / Voir les catégories | Edit categories / See the categories | Overview entry | board text |
|
||||
| `editor.overview.regions_one` / `_other` | Régions vertébrales ({count} région) / ({count} régions) | Vertebral regions ({count} region) / ({count} regions) | Overview entry (T17) | proposal |
|
||||
|
||||
Reworded prose (no new key): `admin.failure.view.asset.unknown`, `editor.annotations.unmeasured.hint`,
|
||||
`editor.annotations.no_category`, `editor.annotations.no_child_view`, `editor.views.frame.newly_invalid`
|
||||
(they named the removed tabs). Removed keys: see the closing list.
|
||||
|
||||
## Lot C (annotation card, side column from 1 024 px)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.overview.filter` | Filtrer par nom | Filter by name | Card field (name and placeholder) | board text |
|
||||
| `editor.overview.uncategorised` | Sans catégorie | No category | Group title, only if a document holds such an annotation | plan wording |
|
||||
| `editor.overview.no_match` | Aucune annotation ne correspond. | No annotation matches. | Card, filter without result | proposal |
|
||||
| `editor.annotations.show_all` | Toutes les annotations | All annotations | Properties panel, back to the card | plan wording |
|
||||
|
||||
Reused: `editor.annotations.list` (« Annotations de la vue », card title and list name), `editor.annotations.list_empty`.
|
||||
|
||||
## Lot D (references side panel)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.references.search` | Rechercher une référence | Search a reference | Panel field (name and placeholder) | board text |
|
||||
| `editor.references.cited_by` | Citées par « {name} » ({count}) | Cited by « {name} » ({count}) | Panel chip, opened from a finding | board text |
|
||||
| `editor.references.show_all` | Tout afficher ({count}) | Show all ({count}) | Panel link clearing the chip | board text |
|
||||
| `editor.references.no_match` | Aucune référence ne correspond. | No reference matches. | Panel, search or filter without result | proposal |
|
||||
| `editor.references.cited_one` / `_other` | citée {count} fois / citée {count} fois | cited {count} time / cited {count} times | Each reference card | board text |
|
||||
| `editor.findings.references_open_one` / `_other` | {count} référence / {count} références | {count} reference / {count} references | Finding detail, Citations block, opens the panel filtered | plan wording |
|
||||
|
||||
## Lot E (header history, save line, Abandonner)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.history.undo` / `undo_title` | Annuler / Annuler la dernière modification | Undo / Undo the last change | Header button (visible label from 640 px; name and title) | T15 |
|
||||
| `editor.history.redo` / `redo_title` | Rétablir / Rétablir la dernière modification annulée | Redo / Redo the last undone change | Header button | proposal |
|
||||
| `editor.draft.discard` (relabelled, FR only: was « Annuler les modifications »; EN unchanged) | Abandonner les modifications | Discard changes | Header button, dialog title; `discard_confirm` unchanged | C11 amended |
|
||||
| `editor.draft.discard_copy` | La copie locale temporaire de ces modifications sera aussi supprimée. | The temporary local copy of these changes will be deleted too. | Discard confirmation, when a copy is stored | precision 9 |
|
||||
| `editor.draft.status.unsaved` (reworded) | Modifications non enregistrées | Unsaved changes | Save line when the count is out of reach; status region | plan wording |
|
||||
| `editor.draft.status.unsaved_count_one` / `_other` | {count} modification non enregistrée / {count} modifications non enregistrées | {count} unsaved change / {count} unsaved changes | Save line | plan wording |
|
||||
| `editor.draft.status.saved_at` | Enregistré à {time} · révision {revision} | Saved at {time} · revision {revision} | Save line, server time known | plan wording |
|
||||
| `editor.draft.status.saved` | Enregistré · révision {revision} | Saved · revision {revision} | Save line, server time unknown or unreadable | owner wording |
|
||||
|
||||
## Lot B2b (withheld decisions, resume)
|
||||
|
||||
| Key | FR | EN | Where | Status |
|
||||
|---|---|---|---|---|
|
||||
| `editor.views.pending.cleaning` | Un nettoyage de l'illustration attend votre décision. | A drawing cleaning is waiting for your decision. | Views section, withheld decision notice | proposal |
|
||||
| `editor.views.pending.repair` | Une réparation des annotations attend votre décision. | An annotation repair is waiting for your decision. | Views section, withheld decision notice | proposal |
|
||||
| `editor.views.pending.parent` | Le retour à l'illustration de la vue parente attend votre confirmation. | Going back to the parent view's drawing is waiting for your confirmation. | Views section, withheld decision notice | proposal |
|
||||
| `editor.views.pending.resume` | Reprendre | Resume | Button reopening the withheld decision | proposal |
|
||||
|
||||
Reworded prose (no new key): `editor.views.frame.newly_invalid` now reads « (Annotations, dessin) » instead of
|
||||
« onglet Annotations ». No other B2b key.
|
||||
|
||||
## Lot F (shell sidebar and drawer)
|
||||
|
||||
No dictionary key added, renamed, reworded or removed (`git diff 846994b..HEAD` on fr.ts and en.ts shows none from F).
|
||||
|
||||
## Removed keys, per lot
|
||||
|
||||
Each key grepped dead (`grep -rn "<key>" apps/app/src apps/app/e2e apps/app/tests`, i18n files excluded): no hit.
|
||||
|
||||
- Lot B1: `editor.tab.views`, `editor.tab.references`, `editor.tab.vertebrae` (renamed to `editor.place.*`),
|
||||
`editor.annotations.select_hint` (the overview replaces it).
|
||||
- Lot E: `editor.annotations.undo`, `editor.annotations.redo` (moved to `editor.history.*`).
|
||||
- Lot G: none. The dictionaries held no orphan left by U1; `editor.tab.general` stays (used by `GeneralTab.tsx`,
|
||||
`ReviewFigures.tsx`, e2e).
|
||||
@@ -0,0 +1,87 @@
|
||||
# U1 plan challenges, original reports (2026-11-06)
|
||||
|
||||
Verbatim final reports of the blind plan challengers run on the first draft of
|
||||
`.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md` (three lenses), then of the confirmation pass on the revised plan.
|
||||
Recovered on 2026-11-06 from the session transcripts, which the harness may purge. The resolution of each MAJOR finding is
|
||||
traced in `docs/development/V1-2-6_UX_U1_CHECKPOINT.md` section 3; the plan's own record is its « Challenge record ».
|
||||
|
||||
## Correctness (first draft)
|
||||
|
||||
```text
|
||||
CHALLENGE — LENS: correctness — VERDICT: CONCERNS(6)
|
||||
PLAN: /home/bchanot/Documents/faunosteo-v1-2/.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md
|
||||
FINDINGS:
|
||||
1. [MAJOR] The `nextSaveDistance` rule for `saved(sentDistance)` (`distance − sentDistance`) can show a false count after commits made during a save, which is the exact case review focus #3 says it covers. — WHY: The plan's own rules give this sequence. Send at d=3, then undo twice (d=1), then commit three times: the first commit is not negative, so d goes +1 each time and ends at 4. The answer arrives and gives 4−3, shown as « 1 modification non enregistrée ». But the first commit cleared the redo stack (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/editor/state/undo.ts:52-54 via editorEdit.ts:58), so the sent text c3 is in no stack and the real path is 5 changes. The rule "commit → null when negative" only sees negatives against the old saved point, never against the in-flight sent point. The plan's own definition ("along the history") requires null here. — FIX: Verify instead of counting blind. After a save and after every step, keep d only when `d===0 ? documentText===savedText : undo[undo.length-d]?.text===savedText`, else null. A cheaper alternative: track "dropped below sentDistance then committed" during the flight and turn it into null. Add this sequence to the Lot E table.
|
||||
2. [MAJOR] React 19.2 `<Activity>` re-runs every effect on reveal, not only cleanups. §2 audits only the cleanups ("Existing cleanups keep their meaning"), so a focus effect in kept-alive Constats breaks AC12. — WHY: /home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/findings/FindingTree.tsx:31-33 focuses `focusId` in an effect. /home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/tabs/FindingsTab.tsx:47,73,90 sets `focusId` on every « Aller à » to a finding and after a deletion, and never clears it. After either one, every later click or arrow onto Constats moves focus from the tab into the tree. That breaks "clicking or arrowing a tab keeps focus on that tab", and the tree's own arrow keys then take over from the tablist walk. Any "focus on open" mount effect in a section h2 or the panel heading would do the same on each tab return. The Lot B "arrows" tests never set up a prior go-to. — FIX: Make `focusId` one-shot (clear it once applied). Add a plan rule that no focus or scroll side effect runs in a mount effect of kept-alive content (focus belongs to `useEditorNavigation`). Add a test: after an « Aller à » to a finding, arrowing onto Constats keeps focus on the tab.
|
||||
3. [MAJOR] Zoom and pan are not kept, contrary to §2 ("Hidden content keeps its state (… framing …)") and §4 ("the canvas state is the one left (kept alive)"). — WHY: /home/bchanot/Documents/faunosteo-v1-2/apps/app/src/catalogue/useFraming.ts:69 `useEffect(() => setFraming(FIT), [resetKey])` re-runs on every Activity reveal. Every return to Annotations and every « Retour au dessin » therefore resets zoom and pan. The Lot B tests only check tool and selection, so this ships unnoticed. The fix sits in `catalogue/useFraming.ts`, which `CatalogueCanvas` shares and which is outside the contract FILE SCOPE (only editor model files, editor/state, components/editor/**, shell, route, i18n). — FIX: Reset only when `resetKey` actually changes (previous-key ref), add `apps/app/src/catalogue/useFraming.ts` to FILE SCOPE, and add a keep-alive test: zoom, go to the views section, come back, framing kept. Otherwise remove "framing" from the claim and tell the owner.
|
||||
4. [MAJOR] Lot B depends on Lot D. Its tests cannot be written as specified, and two level-1 editors are unreachable in the Lot B and C commits. — WHY: The section entries (« Gérer les vues », « Modifier les catégories », « Régions vertébrales ») exist only in `OverviewPanel` (§4, Lot D files), and Lot B limits `EditableAnnotations` to "links only". Yet Lot B removes the Vues and Vertèbres tabs, takes categories out of Général, and tests "the canvas tool and selection survive « Gérer les vues »" and "« Retour au dessin » focuses the entry button". Until Lot D, the categories and regions editors are reachable only through an issue's « Aller à » (views through the unmeasured hint). The plan guarantees "no level-1 function is unreachable at any commit" for References only. Separately, "selection survives « Gérer les vues »" is impossible as written, because the overview holding that entry is "shown … when nothing is selected or pending" (§4). — FIX: Move the three entry buttons (minimal overview entries) into Lot B, or move those tests to Lot D. Rewrite the selection case through a path that can hold a selection (the unmeasured hint or « Aller à »).
|
||||
5. [MAJOR] The LAN trial suite (C47, an existing editor journey) is missing from Lot H and will break silently. — WHY: /home/bchanot/Documents/faunosteo-v1-2/apps/app/e2e/lan/trial-lan.spec.ts:125,148 clicks `getByRole('tab', { name: dict['editor.tab.views'] })`, a tab and key U1 removes. It also reads the save line through `/^Révision \d+/` (:24-29, :145), which the new line replaces with « n modification(s) non enregistrée(s) » and « Enregistré à hh:mm · révision n ». Typecheck will not catch the removed key because `Dict = Record<string,string>` (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/i18n/types.ts). The suite is "never part of check:all" (/home/bchanot/Documents/faunosteo-v1-2/apps/app/e2e/playwright.lan.config.ts header). UX_PLAN U1 acceptance requires "every existing editor journey green on the new shell". — FIX: Add trial-lan.spec.ts to Lot H (views reached through the section, revision read through the new save-line helper). Run it with the Lot I demo, or record it as not run.
|
||||
6. [MAJOR] The history-button spec contradicts itself on typed text, so the Lot E test "disabled buttons + typed text → committed, nothing undone" cannot pass with the stated mechanism. — WHY: Disabled buttons in a read-only mode cannot coexist with typed text, because `historyEnabled` false ⇔ readOnly ⇔ TextField renders ReadOnlyValue (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/fields/TextField.tsx:31-40). The only remaining case is an empty stack. There, pressing the aria-disabled button focuses it, the blur commits (TextField.tsx:75-79), and the store update re-renders before the separate `click` event (React flushes the sync update first; RTL wraps each user-event dispatch in act). So "enabled at its last render AND can step" is true and the undo runs. That matches AC5 and contradicts "nothing undone". — FIX: Choose one and tell the owner. (a) Follow AC5 and drop the "nothing undone" test. (b) Capture the enabled state at pointerdown/keydown and say so in §6.
|
||||
7. [MINOR] Lot file lists do not hold. Lot B adds a header « Références » button but lists no header file. Lot C edits `components/editor/HeaderActions.tsx`, which is created only in Lot E (§6, Lot E files). — WHY: Executors read "the files named in its lot". — FIX: List DraftHeader.tsx in Lot B, and either do the HeaderActions split no later than Lot C or have Lot C edit DraftHeader.
|
||||
8. [MINOR] Keying the discard sentence on `copyWritten` can remove an existing copy without saying so (gated precision: "never removing the local copy silently"). — WHY: When a quota failure follows an earlier successful write, `copyWritten` becomes false (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/editor/state/recoveryFlow.ts:125-128), but the failed setItem leaves the older copy in storage (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/state/persistence.ts:50-56). Discard then removes it unconditionally (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/editor/state/editorLoad.ts:200,229). The risk is real: three copies of up to 2 MiB each can exhaust sessionStorage. — FIX: Decide the sentence from `copyExists(userId, versionId)` (recovery.ts:80), read when the dialog opens.
|
||||
9. [MINOR] Review focus #4 ("nothing unmounts that holds typed text" on a width change) is false. — WHY: Several creation forms unmount when read-only: `{!readOnly && <CategoryForm />}` (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/general/CategoriesSection.tsx:51), `{doc && !readOnly && <ReferenceForm />}` (tabs/ReferencesTab.tsx:44) and `{pending && !readOnly && …}` (tabs/FindingsTab.tsx:105). Their typed text is lost at 1 024 px, while the §2 documented limit names only the canvas creation forms. — FIX: Widen the documented limit to every creation form, or keep them mounted read-only. Align the Lot D/H assertion with the choice.
|
||||
10. [MINOR] Below 640 px, the not-found focus fallback and the panel label point to an element that may not exist. — WHY: `#editor-tab-<id>` exists only while « Plus » is open (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/EditorTabs.tsx:108-127). « Aller à » stays available in read-only mode (verification/IssueList.tsx:44-61). An unresolved finding path goes to Constats, which sits under « Plus » there, so focus stays on a button inside a now-hidden panel and falls to body (AC12). The tabpanel's `aria-labelledby` dangles in the same case. — FIX: Fall back to the « Plus » button (or open the disclosure), and give such panels an `aria-label`.
|
||||
11. [MINOR] « Aller à » to an annotation silently drops a kept-alive pending creation. — WHY: /home/bchanot/Documents/faunosteo-v1-2/apps/app/src/components/editor/annotations/EditableAnnotations.tsx:60-65 dispatches `view` then `select`, and both reset `pending` (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/editor/annotations/uiState.ts:55-64). Keep-alive now lets that typed creation survive the tab change, and the go-to then discards it (precision 1). — FIX: Document it as a limit, or keep the pending creation and focus its panel instead.
|
||||
12. [MINOR] After `draft.unchanged`, the save line can show the time of an old save. — WHY: `applySaved(api, attempt, attempt.expected)` (/home/bchanot/Documents/faunosteo-v1-2/apps/app/src/editor/state/editorSave.ts:105) leads to `readSaveTime`, which finds the earlier `draft_last_save` of that revision (possibly from another day or another user). The line then reads « Enregistré à hh:mm » with no date, while AC7 says "after a save in this page session". — FIX: Skip the time read on draft.unchanged (show « Enregistré · révision n »), or format with the date when it is not today.
|
||||
13. [MINOR] The `saved` rule is ambiguous. — WHY: It is unclear whether "null when either is null" overrides "`unsaved ? … : 0`". If null wins, saving a restored copy with no in-flight change leaves `saveDistance` null, and the commit rule keeps it null until reload. — FIX: State that `!unsaved` → 0 takes precedence.
|
||||
PROOF: read 46 files (plan, contract, AdminSheetDraftRoute, focusRequest, tabs, useViewport, verification, focusTarget, EditorTabs, EditorTabBody, DraftHeader, TextField, DraftField, useCropGroup, editorBase, editorEdit, editorSave, editorLoad, recoveryFlow, recovery, persistence, undo, mode, format, useUndoShortcuts, sheetDocument, EditableAnnotations, AnnotationsTab, AnnotationCanvas, useCanvasBuild, useCanvasGestures, useFraming, uiState, PropertiesPanel, ToolColumn, GeometryGroup, FindingTree, FindingsTab, useSubmission, CategoriesSection, GeneralTab, ReferencesTab, IssueList, AppLayout, MobileDrawer, trial-lan.spec + playwright.lan.config, i18n types, UX_PLAN §2 G and U1, UX_TESTS U1); inspected every useEffect under components/editor, editor/annotations and catalogue for re-run-on-reveal behaviour, every `unsaved` writer, the copy write/remove paths, static ids, `editor.tab.*` key usages including e2e, and React/@types versions (19.2.6 / 19.2.14); checked plan §1, §2, §4, §5, §6, §7, §8, Review focus 1-5, Lots B, C, D, E, H, Edge cases. Read-only throughout; no test, pnpm, docker or supabase command run.
|
||||
```
|
||||
|
||||
## Robustness (first draft)
|
||||
|
||||
```text
|
||||
CHALLENGE — LENS: robustness — VERDICT: CONCERNS(5)
|
||||
PLAN: /home/bchanot/Documents/faunosteo-v1-2/.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md
|
||||
FINDINGS:
|
||||
1. [MAJOR] The references panel, positioned as §5 says, covers the header controls that the plan says stay usable. — WHY: §5 puts the panel "fixed to the right below the sticky top bar" at `min(27rem, 100vw)`. Its top is therefore the AppLayout `sticky top-0 h-14` header, so at the top of the page it sits over the right end of DraftHeader (Références, save line, Abandonner, Enregistrer) and over HistoryButtons at the right of the tab row (§3, §6). Board 11 starts both the panel and the scrim below the tab row (maquettes.html:623, `top:162px`). With the plan's position, a click on Enregistrer or Annuler lands on the panel, and keyboard Tab reaches those buttons while they are hidden behind it (focus obscured, which axe does not flag). The Lot C happy-dom test "header usable" has no layout, so it passes anyway. — FIX: anchor the panel top to the bottom of the tab row, either with a sticky header plus tab row and a measured top, or with a positioned container that starts after the tab row. Add a Playwright check that Enregistrer and Annuler are clickable (not intercepted) with the panel open at 1 024 and 1 280 px.
|
||||
2. [MAJOR] The view fallback can keep a pending creation and silently write it on the main view. — WHY: §4 says the canvas "falls back to the main view and clears the selection", and names nothing else. CreationPanel gets `viewId={scene.viewId}` (EditableAnnotations.tsx:227) and the insert uses it (creationAttempt.ts:38 `annotationOf(id, input.viewId, …)`). If the fallback is derived and only `selectedId` is cleared, this sequence writes a wrong annotation: place a point on a detail view, then a header undo removes that view. Once the main frame is built, « Créer » inserts the point on the main view with the old view's coordinates. Today the same path renders no canvas (`if (!view) return null`, :179) and the core refuses the unknown view. Keeping the drawing alive and adding a header undo on every tab makes this path common. — FIX: when the current view is missing, dispatch the full reset `{ type: 'view', viewId: main }` (initialUi clears pending, tracing, selection and hint). Pin it in Lot B with a pending point and with an active tracing.
|
||||
3. [MAJOR] `nextSaveDistance` gives a false count for edits made during a save, and it misses trims done by undo and redo. — WHY: §6 defines `saved(sentDistance) → unsaved ? distance − sentDistance : 0`. Take a save sent at distance 3, then one undo (distance 2) and one commit (allowed because 2 is not negative) while it is in flight. The commit cleared the redo stack that held the sent text, yet the answer computes 3 − 3 = 0 with `unsaved` true. The next commit then shows « 1 modification non enregistrée » although the saved text is no longer anywhere in the history. Separately, the trim check runs "after any commit" only, but `stepBack` and `stepForward` also call `bounded()` (undo.ts). Near the 8 MiB bound an undo or redo can drop the saved entry and the count stays a number. With the 300 KB equine document.json the bound is reached after about 27 entries, so this is not rare. Review focus 3 says both cases are pinned, but a table written from this formula pins the wrong values. — FIX: derive the distance instead of accumulating it. After every history event and on `saved`, find the saved text (`attempt.sentText` / `savedText`, exact string) by index in the undo and redo stacks, and use null when it is absent. Keep the event table only as a test oracle.
|
||||
4. [MAJOR] The discard confirmation can delete an existing local copy without saying so. — WHY: §6 adds « La copie locale temporaire … sera aussi supprimée » only when `copyWritten` is true. That flag means "the last write succeeded" (recoveryFlow.ts `syncCopy`), which differs from "a copy exists". On a quota refusal, `setItem` throws, the previous copy stays in sessionStorage (persistence.ts:50-56), and `copyWritten` becomes false. `discardChanges` then calls `removeCopy` without any condition (editorLoad.ts:229, and :200 through the staleBase reload). The older copy is deleted with no sentence, which the owner precision "never removing the local copy silently" forbids. — FIX: show the sentence when the copy exists (`copyExists(userId, versionId)` read when the dialog opens). Add the case "quota refusal after an earlier successful write" to the Lot E discard test.
|
||||
5. [MAJOR] Once places stay mounted, the test-isolation premise no longer holds. — WHY: the Edge cases section says "Testing Library ignores it by role; tests that look for hidden text use { hidden: true }". That is true for *ByRole only. getByLabelText, getByText and getByTestId, and Playwright getByLabel, getByText and locator(), all match `display:none` elements, and Playwright strict mode counts them. A concrete clash: « Nom (FR) » labels the sheet name (fr.ts:1332), every region name (:1368) and the annotation name (:1525). After Général, Régions and an annotation selection have been visited, these page-wide queries match several elements: editor-equine.spec.ts:113 and editor-geometry.spec.ts:375 (`getByLabel(name_fr)`), and editor-tabs-general.test.tsx:42. They either throw on multiple matches or act on a hidden copy and pass falsely. Review focus 1's mitigation ("locators scoped to the visible tab panel") still includes the hidden sections, because they sit inside the Annotations tab panel. LRN-115 records the same class of failure. — FIX: wrap each Activity child with a stable hook, and make `activePanel` and the unit helpers return the visible place (drawing, section or panel). Use getByRole or `filter({ visible: true })` for label and text queries, and state in the plan that non-role queries are never page-wide.
|
||||
6. [MINOR] Review focus 4 says "nothing unmounts that holds typed text" on a width change, but every creation form renders only while editable. — WHY: `!readOnly &&` guards CategoriesSection.tsx:52, ReferencesTab.tsx:47, ViewsTab.tsx:65, VertebraeTab.tsx:49 and FindingsTab.tsx:105. Crossing below 1 024 px drops their DraftField text, as it does today. §2's documented limit names only the canvas forms. Keeping these forms mounted in narrow mode would break owner precision 5 (read-only on every moved form), so an executor will either fail the Lot D/H test or bend it. — FIX: extend the §2 limit to these forms and reword Review focus 4.
|
||||
7. [MINOR] AC5 relies on the browser moving focus away from the field when the header button is pressed. — WHY: §6 says "pressing the header button blurs the field first". Chromium and user-event do this. Safari does not focus a button on click, and on iPadOS a tap on a button reportedly does not blur a focused input (uncertain, not verified here). Tablets from 1 024 px are edit devices (AC11, board 13). Without the blur, the undo reverts the previous commit; if that commit was the same field, TextField's `seen !== value` reset (TextField.tsx:58-61) overwrites the typed text. — FIX: on pointerdown of HistoryButtons, blur `document.activeElement` when it is a text control, before stepping.
|
||||
8. [MINOR] Two rules for typed text contradict each other. — WHY: §6 says the click acts only if the button "was enabled at its last render", and also says "when the buttons are disabled the blur still commits and nothing is undone". With an empty stack, the mousedown blur commits and React re-renders before `click`, so the button is enabled and the undo reverts that commit (what AC5 wants). The Lot E test "disabled + typed text → nothing undone" either fails or forces a pointerdown-time snapshot, which makes mouse and keyboard behave differently. — FIX: keep "nothing undone" for read-only modes only, or name the snapshot point.
|
||||
9. [MINOR] « Aller à » on a reference can miss its card when a search is active. — WHY: §5 says the panel opens "unfiltered with the search cleared and focuses that reference's card". The search lives in the kept-alive panel, so clearing it and focusing in the same `apply` runs before the card re-renders. `focusRow` finds nothing and falls back to the heading. The Lot C test never sets a prior search. — FIX: reset the filter and search first, focus after the next commit, and add a test where a search hides the target.
|
||||
10. [MINOR] `readSaveTime` must not lengthen the save outcome. — WHY: §6 does not say whether `saveWith` awaits the admin read. ConflictDialog awaits `keepMine` (ConflictDialog.tsx:131) and stays pending until it resolves, and unit tests that mock a single rpc answer would see an extra call. — FIX: call it with `void` after `applySaved`.
|
||||
11. [MINOR] The drawer can stay open as a modal over a page that shows the sidebar. — WHY: Lot F keeps the rule "close on a media `change` event" (MobileDrawer.tsx:31-32). Open the drawer at 1 180 px in the editor, then navigate back with no unsaved changes to a non-editor page at the same width. No change event fires, `closesFrom` becomes 64rem, which already matches, and the page stays inert behind the drawer. — FIX: close at effect setup when `query.matches` is already true, with `closesFrom` in the effect's deps.
|
||||
12. [MINOR] The save line becomes a chatty live region. — WHY: it stays `<p role="status">` (DraftHeader.tsx:130). Today its text changes once when `unsaved` flips. With a count, it changes on every blur commit, undo and redo, and each change is announced, competing with the new navigation live region. — FIX: announce state transitions only, and keep the running count out of the live text.
|
||||
13. [MINOR] Below 640 px the visible tab panel can lose its accessible name. — WHY: §3 sets `aria-labelledby="editor-tab-<tab>"`. Général and Constats live in the « Plus » list, which is rendered only while open (EditorTabs.tsx `open &&`), and `pick` closes it. So with Général or Constats selected, the visible panel has no name; today the panel carries an aria-label. axe reports this as "needs review", so the Lot H scan stays green. — FIX: keep an aria-label on each tab panel.
|
||||
14. [MINOR] Hidden places re-render on every commit. — WHY: DraftEditor subscribes to `previewState` (AdminSheetDraftRoute.tsx:95) and rebuilds `goTo` on each render (:86). If `navigate` is not memoised, every hidden Activity child re-renders at low priority on each commit. Each one re-parses the 300 KB document through its own `useSheetDocument`, and FindingsTab rebuilds its items. — FIX: make `navigate` stable (useCallback over dispatch) and keep the other place props stable.
|
||||
15. [MINOR] The Lot B keep-alive and focus proofs are blind in happy-dom, and the browser suite is off until Lot H. — WHY: happy-dom's `focus()` checks connection, disabled and inert only, never `display:none` (HTMLElementUtility.focus). So "requests reach only their owner" and "not found → tab, never body" pass even when the target is a hidden row. Meanwhile e2e:shell stays knowingly red from Lot B to Lot H, so a regression from Lots C to G cannot be told apart from the expected red. — FIX: move the `e2e/support/editor.ts` rewrite and one Chromium keep-alive/focus spec into Lot B, and run the unaffected specs (access, recovery, conflict, signout) at each lot.
|
||||
PROOF: read 52 files (the plan; the contract; AdminSheetDraftRoute; the tab model and tab row, ToolColumn; TextField, DraftField, useCropGroup, useEditCommand, useViewUpdate, sheetDocument; the General, Views, Vertebrae, References, Findings and Annotations tabs; CategoriesSection, EditableAnnotations, uiState, CreationPanel, creationAttempt, useCanvasBuild, AnnotationCanvas; focusRequest, useUndoShortcuts, useViewport, mode; the store slices editorEdit, undo, editorSave, editorBase, editorTypes, editorStore, editorLoad, recoveryFlow, recovery, persistence; DraftHeader, ConflictDialog, ModalDialog, Dialog, DeleteDialog, AppLayout, MobileDrawer, useAdminQuery; the getOfficialSheetAdmin schema; maquettes.html with the board 11 PNG; learnings LRN-057/082/085/089/104/111/115/116; happy-dom 20.10.6 focus and inert source). Also inspected: React 19.2.6 in the lockfile, the 300 KB equine document.json, the shared « Nom (FR) » labels in fr.ts, and the page-wide getByLabel calls in the e2e specs. Checked plan §2-§8, Review focus 1-5, Lots B/C/E/F/H and Edge cases. Read-only throughout: nothing was run, no test was executed.
|
||||
```
|
||||
|
||||
## Simplicity (first draft)
|
||||
|
||||
```text
|
||||
CHALLENGE — LENS: simplicity — VERDICT: CONCERNS(2)
|
||||
PLAN: /home/bchanot/Documents/faunosteo-v1-2/.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md
|
||||
FINDINGS:
|
||||
1. [MAJOR] The unsaved-count machinery is a second copy of state the history already holds. It adds a `saveDistance` store field, a `nextSaveDistance` reducer with six events, `saved(sentDistance)` threaded through the save attempt, and edits to `editorBase`, `editorEdit`, `editorLoad`, `recoveryFlow`, `editorSave`, `editorTypes` and `undo` (plan §6 "Store additions", Lot E files). — WHY: every writer already keeps the saved text and the history entries as the same string. `readyPatch` and `reloadPatch` set `documentText` and `savedText` from one `text` (editorLoad.ts:81-82, :138-139). `applySaved` sets `savedText: attempt.sentText`, which is the `documentText` at send time (editorSave.ts:86, :121). Commits and steps push `state.documentText` unchanged into the stacks (editorEdit.ts:58, :76; undo.ts:53, :56-73). So the count can be one memoised pure selector: 0 when `documentText === savedText`; otherwise the depth of `savedText` in `undo` (or `redo`), found by `===`; null when absent or `staleBase`. By construction that covers load, discard, reload, restore, commits made during a save, an undo past the save followed by a commit (redo cleared) and every trim. The hand-kept counter already misses one case: it nulls on trim only "after any commit", but `stepBack` and `stepForward` also call `bounded()` (undo.ts:63, :73). Review focus 3 ("the save line says something false") exists mostly because of this parallel state. — FIX: drop `saveDistance`, `nextSaveDistance` and the five writer edits; add one pure `savedDistance(state)` selector, tested on the same event table, read by `saveLineState`.
|
||||
2. [MAJOR] Lot B is several lots in one. It covers the four-tab model, Activity keep-alive with the visited bookkeeping, `useEditorNavigation` (openers, fallback focus, live region), the route split, the section registry and frame with three `git mv`, the focus-request rework, the "Aller à" retarget, the hint retargets, the canvas fallback to the main view and a provisional references panel. That is about 23 source files and 11 test files for one executor dispatch, and review focus items 1, 2 and 5 all land in it. — WHY: plan Lot B "Files" and "Tests". Keep-alive is separable: today only the active body is mounted (EditorTabBody.tsx:11, "only the active one is mounted"), so a lot that ships the four tabs and sections without Activity keeps today's unmount semantics with no regression, and Activity plus `visitedTabs`/`visitedSections`/`referencesMounted` plus `editor-keep-alive.test.tsx` can follow as their own lot. Separately, the plan leaves `e2e:shell` "knowingly red" from Lot B to Lot H (six commits). Most of the coupling sits in two helpers (`e2e/support/editor.ts:326-330` `selectTab`, `warm-up.ts:20,43` `TABS`), and only 9 `selectTab` calls name a removed tab ('views' 7, 'references' 1, 'vertebrae' 1). — FIX: split B into B1 (tabs, navigation, sections, retargets, plus the `selectTab`/`openSection` helper rewrite) and B2 (Activity keep-alive and its tests), so Lot H only adds the new journeys.
|
||||
3. [MINOR] The lot boundaries move header and glyph work away from their consumers. The header is touched in B, C and E. Lot B adds a header « Références » button but does not list DraftHeader. Lot C edits `HeaderActions.tsx` ("button wiring") while consuming only A and B, yet the `HeaderActions` split is in Lot E. Lot A builds `EditorGlyph` and `history.ts`, which nothing uses before C and E. — WHY: plan Lot A "nothing consumes them yet", Lot B "header « Références » button", Lot C files, Lot E files and §6 split. — FIX: do the DraftHeader → HeaderActions/SaveLine split in the first lot that adds a header control (B), and create `EditorGlyph` and `history.ts` in the lots that consume them.
|
||||
4. [MINOR] `apps/app/src/editor/history.ts` is a new module (with a test over every mode × recovery pair) for a predicate the route already computes twice. — WHY: AdminSheetDraftRoute.tsx:117 passes `mode === 'edit' && recovery === 'none'` to `useUndoShortcuts`, and :132 computes `readOnly = mode !== 'edit' || recovery !== 'none'`, its exact negation. A third spelling adds a source instead of unifying one. — FIX: compute `writable = !readOnly` once in the route and pass it to `useUndoShortcuts` and `HistoryButtons`; no new file.
|
||||
5. [MINOR] `EditorGlyph` re-draws icons that `Icon` already has, and splits ToolColumn's glyph map in two. — WHY: plan §6 "`EditorGlyph.tsx` (local glyph map … with `book`, `search`, `close`)". `components/ui/Icon.tsx` already exports `book` and `close` and is already imported by DraftHeader (`Icon name="lock"`), so using them needs no change to Icon.tsx. ToolColumn.tsx:24-34 keeps the other seven paths in its own `GLYPHS`, which leaves three glyph tables in the editor. — FIX: use `Icon` for book and close; move ToolColumn's whole `GLYPHS` map into `EditorGlyph` (adding `search`) so the editor keeps one table.
|
||||
6. [MINOR] `citationCounts` re-implements a tree walk the editor already has, and both new filters (overview "Filtrer par nom", panel search) re-implement accent folding. — WHY: plan §5 asks for a recursive walk "counting `reference_ids` of every `FindingCategory` and `FindingNode`", but `buildItems(doc)` (findings/tree.ts:161) already flattens every category and node with `element.value` (tree.ts:131, :154). `folded()` exists at catalogue/useCatalogue.ts:53 (NFD, strip `\p{Diacritic}`, lowercase). — FIX: count over `buildItems(doc)`; share one fold helper between the two filters (exporting `folded` needs a FILE SCOPE line, or put one editor-local helper used by both).
|
||||
7. [MINOR] The `reset` action and the render-phase `setTab` exist only because the navigation state lives in DraftEditor, which mounts before the document is loaded. — WHY: plan §1 `reset (tab: the C40 initial tab of an opened version)`, Edge cases "navigation state is per mounted `DraftEditor`"; AdminSheetDraftRoute.tsx:97-100 sets the tab during render once `previewState` arrives. The plan's new `EditorWorkspace` renders only once the version is opened, so `initialTab(previewState, tier)` is known when it mounts. — FIX: call `useEditorNavigation` in `EditorWorkspace` with a lazy `useReducer` initialiser; delete `reset` and the render-phase setState.
|
||||
8. [MINOR] Lot G rewords prose separately from the lots that move each place, so strings stay wrong from B to F and the same keys and tests are touched twice. — WHY: Lot B retargets `UnmeasuredHint` (PropertiesPanel.tsx:159-175) and renames `editor.tab.*` to `editor.place.*` (§10). But `editor.annotations.unmeasured.hint` and `no_child_view` (fr.ts:1510, :1516) still say "onglet Vues et illustrations" until Lot G, and `editor-annotations-tab.test.tsx:487` is rewritten in G instead of B. — FIX: reword each prose key in the lot that moves its place; Lot G keeps only the label-proposals file and the parity check.
|
||||
9. [MINOR] "On the drawing" has two encodings. — WHY: plan §1 makes `'drawing'` a member of `ANNOTATION_SECTIONS` while `EditorTarget.section` is `AnnotationSection | null`, so a target on Annotations can say `null` or `'drawing'`. The plan does not say whether `null` keeps the open section or means the drawing (for example the IssueList fallback "the place alone"). — FIX: keep one encoding (drop `'drawing'` and use `null`, or make `section` non-null on Annotations targets) and state that `select_tab` is the only action that keeps a section.
|
||||
PROOF: read 41 files: the plan, the U1 contract, UX_PLAN §3 U1, UX_TESTS U1, AdminSheetDraftRoute.tsx, editor/{tabs,focusRequest,verification,useUndoShortcuts,sheetDocument}.ts, annotations/focusTarget.ts, state/{undo,editorEdit,editorBase,editorLoad,editorSave,recoveryFlow}.ts, core/sameDocument.ts, findings/tree.ts, components/editor/{EditorTabs,EditorTabBody,DraftHeader}.tsx, tabs/{Annotations,General,References,Vertebrae}Tab.tsx, annotations/{ToolColumn,PropertiesPanel}.tsx, findings/FindingContent.tsx, verification/IssueList.tsx, ui/Icon.tsx, shell/{AppLayout,MobileDrawer}.tsx, admin/useAdminQuery.ts, catalogue/useCatalogue.ts, packages/supabase/src/sheets.ts (save answer, draft_last_save), i18n/fr.ts prose lines, e2e/support/{editor,warm-up}.ts, maquettes.html hist/save/overviewPanel, core-wasm ElementKey type, pnpm-lock (React 19.2.6). Inspected the string identity across every unsaved writer, bounded() call sites, existing icon/fold/tree helpers and e2e tab coupling (grep counts). Checked plan §1-§10, Lots A-I, Review focus, Edge cases and Contract amendments against the owner CONSTRAINTS; nothing that was settled is re-raised (server-time read, non-modal panel, approach A, registry, keep-alive goal).
|
||||
```
|
||||
|
||||
## Correctness, confirmation pass (revised plan)
|
||||
|
||||
```text
|
||||
CHALLENGE — LENS: correctness — VERDICT: CONCERNS(3)
|
||||
PLAN: /home/bchanot/Documents/faunosteo-v1-2/.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md
|
||||
FINDINGS:
|
||||
1. [MAJOR] Keeping places mounted with `hidden` removes the commit that currently saves typed text on a tab switch, and nothing replaces it on paths where no blur fires. — WHY: Today a tab switch unmounts the body (EditorTabBody.tsx:11, "only the active one is mounted"), and TextField's cleanup commits any typed text still pending (TextField.tsx:61-68). Plan §2 says instead "typed text is committed by the blur that any tab click, key or « Aller à » press causes first, as today". That is not how it works today. Plan §6 also says "Safari and iPadOS do not move focus to a tapped button", yet it adds the pointerdown blur only to HistoryButtons. Tab buttons, « Plus » items, overview entries, « Retour au dessin », header « Références » and « Aller à » all lack it. Edit mode includes touch from 1 024 px (AC11). Escape closing the references panel (§5) also hides a focused ReferenceRow TextField (ReferenceRow.tsx:54,67) without any blur event. The text then sits uncommitted in a hidden field. `unsaved` stays false, so the leave guard is not armed (editorBase.ts:58-60), no recovery copy is written (recoveryFlow.ts:124), and « Enregistrer » sends the document without it. Leaving the page loses it silently, which breaks owner precision 1. — FIX: in useEditorNavigation, blur the active text field (which commits it) before every move: select_tab, open_section, back_to_drawing, open_references, close_references including Escape, and go_to. Pin it with B2 tests where focus stays in the field during a tab change and during an Escape close.
|
||||
2. [MAJOR] « Aller à » an annotation silently discards a tracing in progress; the plan protects only a pending creation. — WHY: §4 / choice 12 keep the creation "while a creation is pending" (`ui.pending`). The drawing's request handler dispatches `view` then `select` (EditableAnnotations.tsx:60-65). `view` returns `{...initialUi, viewId}` and `select` sets `tracing: null` (uiState.ts:56-67), so the tracing and the active tool are dropped. That covers a new zone or link tracing and a `replace` tracing. With keep-alive the tracing survives the switch to Vérification, then « Aller à » discards it during a tab change, which breaks gated precision 1. Review focus 2 itself names "a tracing" as state, but §4's rule leaves it out. — FIX: extend the « Aller à » rule to `ui.tracing` (kept, shown, announced, no view or select dispatch), and add the test to editor-sections.test.tsx and editor-keep-alive.test.tsx.
|
||||
3. [MAJOR] Each lot runs only the e2e specs it touches plus two sentinels, which misses specs the lot actually breaks, so "Browser suites stay green at every lot" does not hold. — WHY: B2 (keep-alive) touches no existing spec. editor-journey.spec.ts:309 uses `page.getByLabel('Nom (FR)', {exact:true})` after modifyAnnotations left « Accès modifié » selected (journey:188-191), with no reload in between. After B2 the hidden PropertiesPanel's `#annotation-name-fr` is labelled `editor.annotations.name_fr` = 'Nom (FR)' (fr.ts:1525), so Playwright hits a strict-mode violation. The unit test editor-route.test.tsx:135 (`queryByTestId('editor-tab-annotations')).toBeNull()`) also breaks and is not in B2's list. Lot C moves the list under the drawing, but editor-equine.spec.ts:281,319 and editor-structures.spec.ts:288 query `getByRole('list', {name: editor.annotations.list})`, and C lists only editor-annotations, editor-geometry and editor-journey. Lot E changes the unsaved text: editor-structures.spec.ts:229-231 (`getByText('modifications non enregistrées').toHaveCount(0)`) becomes a check that always passes, because « 1 modification non enregistrée » no longer matches. editor-recovery.spec.ts:142-146 and 168-172 are unlisted (the sentinel will catch them). — FIX: B2, C and E run every editor-*.spec.ts on the sandbox, name these specs in their file lists, and map the rewrites (R-24).
|
||||
4. [MINOR] The unique-id claim is based on a grep of the source and misses SVG ids generated at runtime. — WHY: CropCanvas composes the parent view (CropCanvas.tsx:33 `buildView(preview, parentId)`), and the drawing composes the same view. Both use the per-view scope `fv.<view>.` (compose.rs:164,193), so their ids are identical once both are mounted (drawing visited and a crop group open). B2's "no `id` repeats" test then either fails or has to exempt them. `url(#…)` references in the visible copy also resolve into the hidden one, which relies on SVG keeping display:none defs referenceable. I have not verified this across browsers. — FIX: state the exemption and check the views-section rendering in Chromium, or scope the ids per render.
|
||||
5. [MINOR] The HistoryButtons mechanism has three gaps. — WHY: (a) The commit triggered by the pointerdown blur can be refused (TextField `error`, e.g. `editor.field.required_names`, AnnotationFields.tsx:50). The click then undoes an earlier unrelated change, possibly on another tab, which contradicts "the undo reverts exactly it". (b) That commit changes the save line (« Révision n » → « 1 modification non enregistrée »). If the header row above the tab row rewraps, the button moves between pointerdown and pointerup, the click lands on an ancestor and nothing is undone (LRN-104 class). (c) With an empty history the button is `aria-disabled`. I believe Playwright treats that as disabled for actionability, so the Lot H "typed text then undo, empty history" journey cannot use a plain click (not verified). — FIX: skip the step when the blur's commit did not land (compare `undo.length` before and after the blur); reserve the save line's width; plan the e2e click accordingly.
|
||||
6. [MINOR] The mechanics for « Aller à » while a creation is pending, and for the canvas reset, are under-specified. — WHY: The creation panel heading (CreationPanel.tsx:90 `<h3>`) has no tabIndex -1; the plan adds one only at PropertiesPanel.tsx:61. `apply: (target) => boolean` also cannot report "kept pending", so the hook has no way to trigger the "creation in progress" announcement. The `view` action always returns a new state (uiState.ts:57), so a reset effect that does not check whether a dispatch is needed loops on a document with no main view (`mainViewId` returns '', useViewModel.ts:18-19). I found no UI path that reaches that state. — FIX: add tabIndex -1 there, give `apply` a third outcome, and dispatch the reset only when `ui.viewId` names a missing view.
|
||||
7. [MINOR] Some lot file lists are incomplete. `pnpm typecheck` will catch these, but the R-24 mapping will miss them. — WHY: Lot A types `NavigationState.focus: FocusRequest` and has go_to produce `{target, serial}`, but FocusRequest only changes shape in B1 (focusRequest.ts:5-8 is still `{key, serial}`). B1 omits editor-findings.test.tsx:32 and editor-annotations-tab.test.tsx:44, whose props objects lack the now-required `navigate`; tests are typechecked (tsconfig include "tests"). Lot D omits FindingDetail/FindingsTab, which must pass the opener down to FindingContent. Lot E omits editorBase.ts, whose `initialData()` must hold `lastSave` for open and close to reset it. — FIX: add these files to their lots and define the request type in navigation.ts in Lot A.
|
||||
8. [MINOR] The reducer's rule on the open section is ambiguous. — WHY: §1 calls `select_tab` "the only action that keeps the open section". Read literally, `open_references` and `close_references` reset Annotations to the drawing, so opening the panel from the views section changes what the user sees underneath. Lot A's tests do not pin this. — FIX: state that open_references and close_references keep tab and section, and test it in Lot A.
|
||||
PROOF: read 62 files (plan, U1 contract, UX PLAN §2 G and §3 U1, UX TESTS U1, learnings LRN-089/104/111/115/116; undo.ts, editorEdit/Load/Save/Base/Types.ts, recoveryFlow.ts, recovery.ts, sameDocument.ts, editOps.ts; AdminSheetDraftRoute, EditorTabBody, EditorTabs, DraftHeader, AnnotationsTab, EditableAnnotations, uiState, creationAttempt, CreationPanel, PropertiesPanel, AnnotationFields, GeometryGroup, GeneralTab, FindingsTab, FindingTree, ReferencesTab, ReferenceRow, VerificationTab, IssueList, verification.ts, tabs.ts, focusRequest.ts, focusTarget.ts, useViewModel, sheetDocument, useFraming, useViewport, useUndoShortcuts, TextField, DraftField, ModalDialog, CropCanvas, CatalogueCanvas, AppLayout, MobileDrawer, format.ts, plural.ts, tsconfig; crates/core compose.rs, create.rs, edit.rs, ops.rs, preview.rs; e2e support/editor.ts, warm-up.ts, editor-journey/equine/structures/geometry/recovery specs; editor-route and editor-route-recovery tests; Tailwind 4.3 preflight, axe-core 4.14 aria-controls rule). Inspected: string identity of documentText, savedText and history entries on load, reload, discard, restore, commit, undo, redo, applySaved, draft.unchanged and keepMine (the savedDistance selector holds); Tailwind `[hidden]` !important; effects and focus calls in kept places; global key listeners (none); panel, sticky and inert layout against AppLayout's scroll container; lot compile dependencies and e2e or unit coverage per lot. Checked plan §1-§10, Lots A-I, Review focus, Global constraints, Challenge record.
|
||||
```
|
||||
@@ -102,3 +102,26 @@ Friction: JSON copy (6371523) had no in-app restore (Home picker PDF only; devto
|
||||
Root cause: copy shipped without restore path (round trip never tested in app); `internal` from draft read treated as transient core failure, no memory of trapping input; guard scoped to one route; session replacement unguarded since MVP.
|
||||
Solution: 9bd9aca (BDR-056). Evidence: round trip identical (3 golden reports, slot + import); fuzz 37k draft.restore 0 traps, OOM only ~50 MB drafts (5 MB worst = 0.4-0.8 GB wasm). Verifier CONFORME 10/10, security PASS 2 LOW, check:all green.
|
||||
Status: resolved 2026-10-17. Residuals: GC finalizer throws "memory access out of bounds" after stack-overflow trap (console only, live instance unaffected 50/50), ≤ 3 dead instances retained (~13.5 MB typical, ~4.5 MB each) until reload; raw lone surrogate in archive text quarantines readable draft (unreachable, session.rs); copy lacks archive envelope; iOS Safari likely ignores beforeunload (dialog + copy are protection there); Retry clicked during ms-long recovery → reload screen; re-importing copy of trapping draft re-traps (spends recovery); copy near 16 MiB may OOM low-memory device; storage full + confirmed replace + reload restores replaced draft; `internal` may come from handle rebuild (Retry reopens).
|
||||
|
||||
## BLK-013 — Editor drawing jumps on select/deselect (SelectionTag in flow above canvas) (2026-11-12)
|
||||
- **Status**: resolved 927537b
|
||||
Friction: owner R1 trial on db:trial (brief « V1-2.6 — R1 — Dernier retour utilisateur », 2026-11-12): « Sélection : zone « … » » text above drawing; drawing moves down on select, back up on deselect; redundant with highlight + side panel.
|
||||
Root cause: `SelectionTag.tsx` = in-flow `inline-block` `<p>`, mounted only while an annotation selected, placed before canvas in both twins (EditableAnnotations.tsx TagOf, tabs/AnnotationsTab.tsx). Mount/unmount changes column height above canvas. Not a live region (no announce lost).
|
||||
Solution: 927537b: tag `sr-only` (Tailwind 4.3: absolute, 1 px, clipped; no reserved space in `space-y-3` column), no role/aria-live, kept for SR browse mode. Unit test (sr-only, not live); e2e editor-deselect.spec.ts: canvas `boundingBox().y` unchanged for point, zone, link selected then deselected, desktop + read-only twin 375 px; editor-equine toBeVisible → toHaveCount(1). Gates: typecheck, lint, unit app 1382; e2e:shell db:sandbox 6 editor specs 37 passed / 37 skipped (other viewport) / 0 failed (run 1: 1 unrelated flake equine:348 commit latency). Verifier CONFORME (pass 2), security PASS x2. Docs 00936c8: board 04 + board 26 (v1-2-6-r0) deviation in docs/design/README.md, U1_CORRECTIONS R1, BROWSER_TESTS, OWNER_TRIAL §4.9.
|
||||
Scope of resolution: SelectionTag shift only. NOT all drawing shifts: ToolNotes `role="alert"` hint above canvas (EditableAnnotations.tsx ~373) cleared by `select` still moves drawing one line when a hint is showing (kept visible, out of R1 scope, TODO). Selection itself still not announced to SR (unchanged). Owner browser confirmation on db:trial pending.
|
||||
|
||||
## BLK-014 — admin.spec dialog check depended on shared singleton working-copy state (2026-11-12)
|
||||
- **Status**: resolved 2cdee42 (these 4 failures only)
|
||||
Friction: `apps/app/e2e/shell/admin.spec.ts` « admin screens: axe and no sideways scroll » failed 4× (fr/en × chromium-desktop/chromium-375) on every sandbox run since 2026-11-08: click on « Créer une copie de travail » timed out on `<button disabled>`.
|
||||
Root cause: working copy exists only for historical sheet (`private.historical_sheet_id()` fixed `503dc301-…`; `create_sheet_working_copy` refuses other source `working_copy.source_invalid`) and ONE active copy per database. Test required slot free in shared persistent sandbox. (a) slot taken by `8c315a12-…` leaked by `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts` (`kindOf` discarded created id; afterAll deleted accounts, not sheets). (b) `editor-equine.spec.ts` set-aside (archive active copies, create own, restore) flips slot while admin.spec runs in parallel (fullyParallel, 8 workers).
|
||||
Solution: 2cdee42 (owner option 1). Dialog checks → e2e:ui harness `e2e/harness/working-copy.*` + `e2e/ui/working-copy.spec.ts` on real `WorkingCopyAction` (StrictMode, MemoryRouter, free + taken): axe, overflow, panel in viewport, name, description, prefilled slug, explicit Tab/Shift+Tab order with one 'browser' step, Escape + focus return, taken disabled + reason. Shell: historical page kept in axe/overflow loop + state-consistent button check (disabled iff reason shown and linked). Sandbox suite: every created copy id captured, archived only those, `returning id` asserted equal, 3 independent cleanup steps, first error rethrown. Before 4 failed → after 4 passed ×2; full admin.spec 16/8 skipped/0; e2e:ui 251 ×2; sandbox sheets-admin 5/5; 637 pre-existing anatomical_sheets rows identical per id. Verifier CONFORME 6/6, security PASS (1 LOW: optional uuid check before interpolation).
|
||||
Scope of resolution: THESE 4 failures only. NOT all concurrency risks of e2e suites: editor-equine set-aside still writes pre-existing copies (8c315a12 updated_at already changed 2026-11-12 13:40 UTC by R1 follow-up run) → TODO, separate fix, suite not run on persistent data meanwhile. Open: cleanup creation branch and shell free-slot branch not run on a fresh stack. Limit (documented): dialog no longer a11y-checked in real server context by this test. Test fixtures accumulate (A1 sheets never archived) → tracked.
|
||||
|
||||
## BLK-015 — admin.spec rights screen crashes under axe on accumulated e2e grants (sandbox) (2026-11-13)
|
||||
- **Status**: open
|
||||
Friction: `apps/app/e2e/shell/admin.spec.ts` A0 « the rights screen with grants » (:373, sometimes :369 grant row not visible) and « admin screens » (:750 loop, fr/en, desktop + 375) fail with « Target crashed » inside axe (`e2e/support/browser.ts:219`) on persistent sandbox; locale varies run to run.
|
||||
Real cause: accumulation of e2e grants in persistent sandbox. Rights screen (/app/admin/access) renders EVERY grant (`list_catalog_grants` no argument, `GrantList` shows all) → renderer dies under axe. Grants 753 → 1 282 (R2.3) → 2 269 (C0 start 2026-11-13) → 3 515 (C6 end); each admin.spec run adds 25 grants + 25 accounts, full sweep +149.
|
||||
Evidence: interleaved A/B admin.spec alone, pre-R2 worktree 65a8fd3 vs HEAD 52aac41, 4 runs all 13p/8s/3f same crashes → not an R2 regression. Dose-response quiet window (temp spec copy routing list_catalog_grants to 753 newest rows, deleted after): capped 16p/0f (2 526 grants), full 11p/5f 4 crashes (2 551), capped 16p/0f (2 570). Final sweep c6sweep2 221p/119s/5f all admin.spec; isolated 12p/8s/4f. Guard OK every run.
|
||||
Solution: none applied (owner: no reset, no deletion of pre-existing data, pagination stays in RR-13). Rerun admin.spec alone only as diagnosis, never as gate. Close when RR-13 paginates grant list (or run-scoped fixture cleanup approved) and admin.spec green on sandbox.
|
||||
Refs: `docs/development/BROWSER_TESTS.md` §6, `V1-2-6_U1_CORRECTIONS.md` §R2, BDR-115, LRN-133.
|
||||
- **Status (2026-11-13)**: open: R2 finish 2026-11-13 sweep, admin.spec A0 + admin screens still Target crashed, same signature; shell chrome changed, no A/B cap rerun on this branch; pagination stays RR-13
|
||||
@@ -588,3 +588,425 @@ Status: active. Not checked on DEV (M1-M3 pending, owner).
|
||||
Decision (owner brief « Validation finale V1-1 et préparation de la recette DEV »): V1-1.6 + V1-1 closure limits accepted; Claude reads DEV only, owner runs backup, `migration up`, acceptance, merge go. SUPABASE.md §3.3 rewritten: SQL through read-only helpers (`default_transaction_read_only`), step 2 counts + md5 row fingerprints + structure counts saved, Storage bytes by `docker cp …:/mnt -` tar, step 3b restore into `restore_check_v1_1` on sandbox db (same image) instead of DEV server, post.sql (workspaces, holders, species, grants, pgtap), before/after diff with exact expected deltas, `supabase status -o env | grep API_URL` (default output prints keys). `e2e:avatar` removed from run: writes beyond fixture. Browser acceptance = brief §11 (19 lines).
|
||||
Alt: createdb scratch on DEV server (rehearsed form, but writes DEV server, typo risk on dropdb); throwaway postgres container (unrehearsed init); cold volume copy (stops DEV, restore = volume overwrite); keep e2e:avatar (touches bob + purge queue).
|
||||
Status: active. Steps 0-4 not run on DEV (owner).
|
||||
|
||||
## BDR-081 | 2026-10-27 | V1-2 orientations D1-D8 approved + D9 in-app admin of official sheets mandatory; contract drafted, not ratified
|
||||
|
||||
Decision (owner brief « V1-2.0 : contrat fonctionnel et technique des fiches anatomiques », after read-only V1-2 audit): D1 publish = habilitated platform admins, business validation traced apart from publish act, platform_role ≠ professional status. D2 no publish with blocking to_confirm, never auto → reviewed. D3 official drafts only admins/editors/explicit reviewers; equine stays draft. D4 published official sheets readable by authenticated authorised users, any workspace. D5 creation admin-only, no personal/community sheets in MVP. D6 traceable review (author, submitter, reviewers, decisions, publisher, exact version). D7 report editor + historical readers unchanged in V1-2, switch in V1-3. D8 published immutable, referenced versions readable after archive. D9 (new, mandatory): admins create/edit/version/prepare publication of official sheets of any species from the app (structured editor + minimal visual tool), no SQL or Git JSON per sheet, Rust core = validation authority.
|
||||
Contract `docs/development/V1-2_ANATOMICAL_SHEETS.md` proposes: capabilities table (editor, reviewer, publisher; owner grants), review rows bound to SQL content digest + frozen draft, atomic publish gate on server verdict (worker core run per submitted revision), element keys (finding path keys), MFA aal2, SVG clean before upload, Rust edit primitives, 10 steps, options O1-O20. Challengers fixed: deprecated deletable (F13), to_confirm→inherited bypass, can_edit_sheet (F14).
|
||||
Alt: read-only catalogue first + editor at Step 17 (audit plan) rejected by owner (D9).
|
||||
Status: orientations approved; contract proposals await owner ratification.
|
||||
|
||||
## BDR-082 | 2026-10-28 | V1-2 decisions O1-O23 ratified; contract consolidated
|
||||
|
||||
Decision (owner brief « V1-2.0 : ratification des arbitrages O1 à O23 et consolidation du contrat », after read-only review of O1-O20): O1 A+D three explicit capabilities (editor, reviewer, publisher) + provisional `catalog_reader`, owner grants with required reason + verification note + optional expiry, audited; reviewer may be non-admin; email confirmation ≠ competence. O2 A no author acks or approves, author set frozen at submit, two people suffice, publisher may approve. O3 B no `to_confirm` + no `inherited` at approve/publish; legacy import never a base (fixes contract §14 vs §6.4). O4 A `aal2` everywhere except published catalogue read; factor recovery operator-only, audited; O4-D (`aal2` on platform role RPCs) evaluated, not ratified. O5 A one decision. O6 A disclaimer FR+EN. O7 A new elements `to_confirm`. O8 A published/deprecated immutable, never deleted, readable by id after archive. O9 C editor creates inactive species, owner activates, `species_select_active` not widened so animal forms unchanged; V1-1 N1 amended. O10 A several sheets per species. O11 B catalogue copy deferred. O12 A explicit save. O13 A packages deferred. O14 A editor read-only < 1024 px. O15 A async worker verdict in sandboxed child; no browser verdict, no HTTP service; DEV worker start = separate checkpoint (AVATAR-01 waiting upload + purge queue). O16 A, `inherited` shown « Hérité, non relu ». O17 C historical sheet `503dc301…` intact + read-only, server-side working copy carries equine work, one source of truth, reference picked at V1-3. O18 mixed (carpus requalified, 11 level B changes in dossier; anatomy to reviewers). O19 A cleaning classes, active/external SVG content refused. O20 deferred, RR-2 open, gate before user release. O21 catalogue access explicit, provisional, fail-closed until Step 11 entitlements. O22 Rust sole authority on document rules; SQL mirror business rules removed in M5; structural/relational guards + one declared defensive status check kept. O23 fail-closed verification: states, idempotent retries, limits, withdrawal always possible, audit.
|
||||
Supersedes for official sheets the 2026-10-25 rule « no graphic editor until Step 17 » (OPEN_QUESTIONS conflict 1); curation pipeline stays authority of historical equine sheet only.
|
||||
Consolidation also fixed: rights table moved to M4 (M4 used table created in M5); core step V1-2.2 now before worker step V1-2.3; progressive review via per-group acknowledgments with digests.
|
||||
Alt: options not chosen listed in contract §17 and the 2026-10-28 review; O15 B and O4 C rejected outright.
|
||||
Status: ratified; contract under owner final review; V1-2.1 not authorised.
|
||||
|
||||
## BDR-083 | 2026-10-28 | AR-1 ratified option B: aal2 for every platform role change
|
||||
|
||||
Decision (owner brief « V1-2.0 : résolution définitive d'AR-1 »): grant, revoke, replace, promote, demote of any platform role (owner, admin, moderator, support) need valid aal2 session, checked server-side in RPC at call time. No permanent exception (owner, first admin, old accounts, admin UI, direct RPC). aal2 necessary never sufficient: can_manage_platform_role, self-target refusal, last-owner guard stay. Ordinary users no MFA. Completes O4, no change to D1-D9, O1-O23.
|
||||
Why: aal1 owner session could grant owner to attacker account → enrol own TOTP → aal2 → self-grant all catalogue capabilities. Read from `20261008100200` RPCs.
|
||||
Shape (contract §5.7): aal2 check 2nd after auth, before role checks (no role oracle); private assign/withdraw re-check for non-null actor; service_role revoked on profile_roles/profiles + RPC EXECUTE (F17); owner-count race locked (F18); first owner: enrol 2 factors first, role assigned last by operator; DEV owner: enrol before M4 applied; recovery operator-only, ban account during enrol window; GoTrue v2.197.0 enrol/unenroll need aal2 once verified factor (source read, sandbox proves).
|
||||
Alt: A (owner+admin only) rejected: leaves moderator/support weak path; C (accept residual) rejected.
|
||||
Review (fresh challenger FATAL(4), all integrated, no ratified decision changed): grant needs target with verified factor; private fns: non-null actor = auth.uid() + aal2, null actor only without JWT; advisory lock both RPCs; DEV precondition before M4 = ENVIRONMENTS §3.6 hardening (public default JWT secret + demo service key + 54321 LAN → aal2 forgeable) + seed owner password changed + role holders listed; recovery reordered (ban, password set with owner, unban, enrol).
|
||||
Reserves: staff read policies (is_platform_admin) stay aal1, owner decision; stolen aal2 session residual; refused attempts not in audit table.
|
||||
Status: ratified; contract only, no code/migration/DEV change; V1-2.1 not authorised.
|
||||
|
||||
## BDR-084 — V1-2.1 M4/M5 secure SQL foundations (sandbox) (2026-10-28)
|
||||
- **Status**: implemented + tested on sandbox; DEV apply is an owner action (contract 16.11)
|
||||
V1-2.1 M4/M5 built + tested on sandbox (not DEV). Migrations `20261028100000_sheet_access_hardening` (M4), `20261028110000_sheet_review_workflow` (M5); applied together (M4 removes Step-4 unsafe write paths, M5 adds the reviewed workflow; no unprotected window).
|
||||
|
||||
Key design choices:
|
||||
- AR-1 B: `private.has_aal2_session()` = aal claim == `aal2` AND the token's `session_id` names a live `auth.sessions` row of the caller at aal2 (closes the stolen-token-after-downgrade window at once, not after jwt_expiry). GoTrue v2.197 probe confirmed: verify upgrades the SAME session to aal2, token carries `aal`+`session_id`+`amr`, exp-iat=3600.
|
||||
- Predicates split by caller vs stored actor: `grant_active(uid,kind)` (no assurance) for stored approvers/acknowledgers; `caller_has(kind)` = `grant_active(auth.uid())` + `has_mfa()` for the session. `can_edit_sheet` redefined on `caller_has('sheet_editor')` + caller==auth.uid() (F14).
|
||||
- F12/F17: `revoke all ... from service_role` on every catalogue table + profiles/profile_roles; role RPCs `EXECUTE` revoked from service_role. service_role stays a GoTrue-admin residual (§13), not a table writer.
|
||||
- F18 last-owner race: one `pg_advisory_xact_lock` in both RPCs and both private writers, guard counts active owners under the lock. Cross-revoke resolves safely (one 200, one refused; one owner remains).
|
||||
- O22 mirror removed: dropped `sheet_document_issues` + the 4 business-mirror helpers; kept `sheet_document_has_shape`, `check_sheet_version_document`, `unknown_assets`; added the declared status check `sheet_all_reviewed` (absent review_status = inherited = refused). pgTAP 011 + the SQL-mirror parts of the Rust `sheet_conformance` generator deleted; ledger retargeted.
|
||||
- Publish gate: `publish_sheet_version(review_id)` atomic; `guard_sheet_version_update` lets draft->published only with an approved round of same version+revision + passed verdict (no direct UPDATE publishes, even table owner). Verdict is a fixture until M6 (V1-2.3).
|
||||
- Reader column grants narrowed; editor needs only `revision` on versions; authors/provenance/fingerprint reach staff via RPCs (`get_sheet_version`).
|
||||
|
||||
## BDR-085 — V1-2.1 owner final decisions: M6 self-review grant, M7 Git fixture, text size measure (2026-10-28)
|
||||
- **Status**: implemented + tested on sandbox; DEV untouched
|
||||
Owner brief « V1-2.1 : décisions finales du propriétaire » on checkpoint 2af61e7. Three decisions, M4/M5 edited in place (never on DEV).
|
||||
- M6 option A: `grant.self_review` dropped from `grant_catalog_right` + `SHEET_FAILURE_KINDS`. Owner at aal2 + verified factor may self-grant `sheet_reviewer`. Separation stays per round: author refused at ack + approve (`review.separation`), author approval refused again at publish (`publish.approval.invalid`). pgTAP 015 flipped, 017 owner-reviewer block (7 cases). Residual: owner reviewing others' drafts is now a normal path, audited like any grant.
|
||||
- M7: Git fixture accepted for V1-2.1 upgrade rehearsal (horse.svg, sha256 = DEV asset row). Bytes/metadata/relations compared before/after. No DEV Storage read -> live DEV object integrity NOT shown; checked when owner applies M4-M6 on DEV. Contract §12.3, §16.2, §17.3.
|
||||
- Size: one measure = UTF-8 bytes of jsonb text form `octet_length(content::text)` (`": "`, `", "` separators, jsonb key order, numeric without exponent). Base table CHECK `pg_column_size` (binary jsonb, uncompressed at write, bigger than text for dense docs) replaced in M5 by the text measure; `check_document_structure` drops pg_column_size. TS/Rust: no check today; core must compute same form in V1-2.2 (compact JSON.stringify shorter -> necessary not sufficient). Alternative rejected: compact JSON measure (SQL cannot compute it exactly: numeric prints no exponent).
|
||||
|
||||
## BDR-086 — V1-2.2 core authoring surface: verdict, PreviewSheet, edits, cleaning (2026-10-29)
|
||||
- **Status**: implemented + tested; READY FOR REVIEW; DEV untouched
|
||||
V1-2.2 core built (contract §16.3), no SQL/screen/DEV. Owner answers 2026-10-29 before code: editor exports (Inkscape/Illustrator/Figma/Affinity) supplied by owner under tests/fixtures/svg/exports/owner, cairo 1.18.4 + ImageMagick 7.1.2-18 exports committed meanwhile; strict-parse fail = `verification.integrity.document` (+ `.base`), 19 rule errors = `verification.validation.rules` (§6.7 aligned on §6.5); PreviewSheet draft = caps excess + missing drawings reported, published/deprecated = refused.
|
||||
Design choices: verdict snake_case in the shape M5 SQL reads (groups[{key,digest,coverable}], drawings[{asset_id,sha256}], fingerprint), pure `compute_verdict`, NOT exported to wasm (O15). Digest = sha256(JCS({"group": key, ...content})) from typed doc (omitted status written inherited); general = doc minus views/annotations/finding_zones; view:<id> = views of id + annotations drawn in it; zone:<id> = zones of id; removal = {removed:true}; coverable = no to_confirm/inherited. Size = PG jsonb text measure (`size.rs`), oracle by PGlite 17.5. Edit: free op `sheet.edit` doc in → doc out; refuses ambiguous keys (duplicate id among siblings), unknown keys, id change, bad position, finding depth > 8; no cascade beyond tree descendants (dependents lists the rest); views whose drawing/crop changed → annotations to_confirm. Cleaning: sanitiser walk classes removals `active` (script, embeds, image, animation, a, on*, external refs, @import, javascript:, expression(, image-set(, behavior:, backslash); cleaning-only reading drops oversized title/desc (stored reader still refuses, too_complex).
|
||||
Alt: verdict in wasm (rejected, O15); handle-applied edits (kept free op, page holds text for undo); serde tagged derive for commands (rejected: +100 KB wasm).
|
||||
|
||||
Reviews: verifier ECARTS(6) then ECARTS(3) (owner exports, helper); security PASS x2, MEDIUMs fixed (PIs, HTML fetchers, long-title bypass, quadratic groups, cubic view walk, bounds). Open owner: dangling #id across inlined drawings, clean upload = original bytes, stricter-than-table refusals, edit reading (contract 8.1/9.2), cairo rgb() colours. Module 596 671 B of 600 000.
|
||||
|
||||
## BDR-087 — V1-2.2 canonical stored SVG form, owner-ratified (2026-10-30)
|
||||
- **Status**: accepted
|
||||
**Decision** (owner, 2026-10-30, on 05de816): drawings stored only in canonical form = deterministic serialisation by Rust core (`serialize::stored_form`). Original uploaded bytes never trusted as safe by default. Integrity (sha256, verdict `verification.integrity.svg_not_canonical`, preview `not_canonical`, upload tool) checked on representation actually stored. Fingerprints of approved historical resources kept (equine drawing sha256 `0ea5202f…`, fingerprint `12d78872…` unchanged).
|
||||
|
||||
Also kept by owner: per-document-instance prefix required on top of per-view prefix (`fv.<view>.`); no multi-document inline rendering opened without it. Cairo strict numeric `rgb()`/`rgba()` kept, atomic `remove` refusal while named (`has_dependents`), wasm cap 600 000 B unchanged.
|
||||
|
||||
**Rationale**: validated bytes = stored bytes = rendered bytes; no gap between what check saw and what browser reads.
|
||||
|
||||
**Alternatives**: store original bytes after validation (rejected: validation and storage could diverge); re-serialise historical drawings (rejected: breaks approved fingerprints, archive reproduction).
|
||||
|
||||
## BDR-088 — V1-2.2 A6 scope (Figma + real Illustrator, Affinity optional) and mask/clip units allowed (2026-10-30)
|
||||
- **Status**: accepted
|
||||
**Decision** (owner, 2026-10-30, contract §17.5): A6 = Inkscape (met) + Figma (required; owner's two raw exports `owner/figma-web-20261030-{default,ids}.svg`, permanent fixtures) + real Adobe Illustrator (required; VectorCraft not equivalent). Affinity optional. V1-2.2 not VERIFIED until Illustrator exports committed and pass. Allowlist gains `maskUnits`, `maskContentUnits`, `clipPathUnits`, values `userSpaceOnUse`/`objectBoundingBox` only, else removed.
|
||||
|
||||
**Rationale**: Figma writes `<mask maskUnits="userSpaceOnUse">` for frame clipping. Removal re-reads mask x/y/width/height in bounding-box units: Chromium 156 cut half stroke at (10,100), 208 px diff at ×8; mask off origin could hide content (deduced, untested). With keywords allowed: stored forms pixel-identical to raw files. Enumerated keywords carry no function, no reference.
|
||||
|
||||
**Alternatives**: keep removal, document 1 px loss (rejected: silent fidelity loss, worse off-origin); allow `maskUnits` only (rejected: same risk class for the two siblings); allow any value (rejected: free text where keyword suffices).
|
||||
- **Status (2026-10-30)**: accepted, A6 scope part superseded by BDR-090 (Illustrator optional, 2026-10-30); mask/clip units part still in force
|
||||
|
||||
## BDR-089 — V1-2.2 reserved PDF halo id, refused by shared reader and composers (2026-10-30) (2026-10-30)
|
||||
- **Status**: accepted
|
||||
**Decision** (owner, 2026-10-30, RUST.md §12.9): PDF halo id `osteo-halo` reserved. Shared reader refuses any kept element holding it, root included, ASCII case folded (`SvgRejection::ReservedId`, `reserved_id`); cleaning, verdict, preview, loaded sheet, upload tool, PDF snapshot gate answer through same reader. Both composers refuse tree holding it (`ComposeError::ReservedId`), halo always engine's (`has_halo_filter` skip removed). Exact set `refs::RESERVED_IDS`, never `osteo-*` prefix.
|
||||
|
||||
**Rationale**: PDF view keeps drawing ids, engine writes `filter#osteo-halo` next to them. Defect: drawing own `filter#osteo-halo` → engine skipped its filter, transparent filter erased marker (0 highlight px Chromium 156 vs 1602); `g#osteo-halo` before first `<defs>` won resolution → halo lost (825 px). 11 historical drawings incl. DEV equine object (sha256 `0ea5202f…`) carry `osteo-overlays` → prefix reservation would refuse them. Fix: 08efd9a.
|
||||
|
||||
**Alternatives**: reserve `osteo-*` (rejected: refuses historical drawings); rename engine id to unguessable (rejected: changes R3 oracle + R4 digests, still collidable); strip drawing element silently (rejected: silent change, refusal explicit); composer guard only (rejected: refusal must happen before verification/publication).
|
||||
|
||||
## BDR-090 — V1-2.2 A6 final perimeter: Figma, Inkscape, cairo, ImageMagick; Illustrator + Affinity optional (2026-10-30) (2026-10-30)
|
||||
- **Status**: accepted
|
||||
**Decision** (owner, 2026-10-30, final; contract core E1, V1-2 contract §17.6): A6 tested perimeter = Figma (owner's two raw exports `owner/figma-web-20261030-{default,ids}.svg`), Inkscape 1.4.3, cairo 1.18.4, ImageMagick 7.1.2-18, all real exports read by suite. Adobe Illustrator + Affinity optional: never declared compatible/validated without real export; absence no longer blocks V1-2.2. `owner/` folder, procedure (Illustrator `presentation`/`internal-css`, Affinity `web`/`hq`), suite reading any file there kept for later. Replaces A6 part of BDR-088 (mask/clip units part still valid).
|
||||
|
||||
**Rationale**: owner had already lifted Illustrator requirement; earlier brief wording ("Illustrator obligatoire pour revendiquer la compatibilité Illustrator") read as A6 blocker. Compatibility claim stays evidence-bound: no export, no claim.
|
||||
|
||||
**Alternatives**: keep Illustrator required (rejected by owner: blocks step on tool not owned); fabricate or emulate exports (forbidden: VectorCraft not equivalent, never fake fixtures).
|
||||
|
||||
## BDR-091 — V1-2.2 view frame: one Rust rule, out_of_frame refusal (2026-11-01) (2026-11-01)
|
||||
- **Status**: accepted
|
||||
**Context**: V1-2.2 three MEDIUM, defect 3 (owner brief 2026-10-30). View without `view_box` framed by drawing root `viewBox`; shifting it + translating content back kept horse identical, all 19 main markers off frame, accepted.
|
||||
|
||||
**Decision**: one Rust rule `anatomy::frame::view_frame` = view `view_box`, else drawing `viewBox` read with SVG grammar. Same frame for both composers (canvas, PDF), server verdict, PreviewSheet. Annotation not entirely inside (edges incl., curves/arcs on shape, unreadable path data refused) → issue `annotation.geometry.out_of_frame`, verdict `verification.validation.out_of_frame`; no usable frame → `view.frame.unknown`. Document never rewritten. Owner validated 2026-11-01.
|
||||
|
||||
**Alternatives**: cap on viewBox dims (rejected: bypass by scale); document owning main frame (heavier model change); TS-side check (rejected: Rust by default, one definition).
|
||||
|
||||
**Extension 2026-11-01** (same rule, owner brief « décisions »): frame usable only within browser-faithful range (edges ≤ 2^20, span ≥ 1, aspect ≤ 100, far edge ≤ 256 spans); marker visible size ≥ 4 CSS px at 320 × 568 → `verification.validation.marker_too_small`. RUST.md §12.11, §12.13.
|
||||
|
||||
## BDR-092 — V1-2.2 VERIFIED: 4 px interior rule, codes approved, six LOWs accepted and tracked (2026-11-01)
|
||||
- **Status**: accepted
|
||||
**Decision**: V1-2.2 VERIFIED by owner 2026-11-01 (brief « Validation définitive V1-2.2 »). Zone or drawn trigger (polygon, path) must fill disc of 4 px diameter at 320 × 568 preview, nonzero rule, stroke never counted; conservative measure, compute caps, refusal in doubt. Codes approved: `annotation.geometry.interior_too_small`, `verification.validation.marker_interior_too_small`. Equine accepted unchanged.
|
||||
|
||||
**Rationale**: 4 px = approved point threshold; equine min widest disc 4.951 px (caudal). Conservative (under-estimate) measure never accepts shape browser fills less; browser probe on 3 engines confirms. Evidence `.claude/audits/2026-11-01-v1-2-2-interior-evidence.md`, RUST.md §12.14, V1-2 contract §17.7.
|
||||
|
||||
**Accepted LOWs (tracked, NOT fixed, stay in TODO V1-2 section)**: (1) fully overlapping marker discs: no rule, human review must find them before publication, no claim of individual selectability; (2) arc rotation sub-pixel error, bounded, tests kept; (3) arc tangent to frame edge refused (conservative); (4) f32 arc margin is bounded estimate (≤ 0.13 unit measured on model); (5) verification cost of all-arc sheet (~1.8 s native worst); (6) relative path commands accumulated in f32 (contrived worst 6 % of span). Complex-sheet duration monitored at editor validations on real devices.
|
||||
|
||||
**Alternatives**: larger threshold (6 px) refused equine; renderer-based measure (new dependency, WASM budget); area threshold (thin sliver keeps area). Rejected.
|
||||
|
||||
**Status**: accepted
|
||||
|
||||
## BDR-093 — V1-2.3 VERIFIED: M6 worker verdict, retry by cause, sandbox-only e2e; CPU-contention MEDIUM accepted temporarily (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: V1-2.3 VERIFIED by owner 2026-11-02 (brief « Clôture V1-2.3 et lancement V1-2.4 », HEAD 57b93af), sandbox scope only. Kept: M6 (four service-role RPCs, five worker codes, lease 10 min, verdict cap 3 MiB child / 4 MiB SQL), retry by effective cause (`resource_limit` intrinsic to frozen input and `verdict_refused` close at first occurrence; `timeout`, `unavailable` incl. external SIGKILL, `lease_expired` transient, delays 2/5/10/20 s, five attempts, `not_before` in SQL, no blocking wait), stale and null-token protections, avatar e2e on sandbox only (`pnpm e2e:avatar` alias, DEV script removed, suite refuses non-sandbox URL, container, key issuer), per-session sandbox secrets, seccomp `brk` + budgets, no `worker-verify` on DEV.
|
||||
|
||||
**Accepted temporarily (sandbox scope, NOT fixed, NOT a deploy authorisation)**: MEDIUM CPU contention: document needing ~60 s CPU under host contention can reach 90 s wall deadline first → `timeout` → retried up to five runs (~8 min worker time); owner refused `unsafe` rusage read at this stage. Re-examine before enabling `worker-verify` on DEV or exposing verification to external users. Register: V1-2 contract §13 accepted risks. LOWs open: header > 64 KiB → `resource_limit` not `caps`; oversized object → `[caps, drawing_missing]` not `size_mismatch`; SIGABRT also panic / host ENOMEM; verdict bound to another round answers `stale`. Four historical test reductions justified in `.claude/audits/2026-11-01-v1-2-floor-reductions.md`.
|
||||
|
||||
**Rationale**: definitive failures deterministic for frozen input → one child run, not five; transient by environment keeps retries; SQL owns code policy so any worker honours it. Evidence: RUST.md §13.1, V1-2 contract §6.4/§6.5, gates on 3c141c9 (check:all, pgTAP 1898, verify-e2e 10/10, avatar-e2e 5/5, e2e:shell 86, DEV untouched).
|
||||
|
||||
**Alternatives**: retry every worker code (five identical runs on deterministic failure, refused by owner); per-call `final` flag in RPC (signature change, rejected); rusage-based timeout classification (needs `unsafe`, deferred by owner).
|
||||
|
||||
## BDR-094 — V1-2.4 catalogue access UX (O21): hidden entry, « Accès non autorisé » page, reviewer keeps limited Administration; §6.5 alert divergence recorded (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « V1-2.4 : validation de la décision UX n° 3 » (2026-11-02, on 1a68cd8). Signed-in account without catalogue right (`private.can_read_official_catalog` false, O21):
|
||||
1. Sidebar and drawer hide « Fiches anatomiques » (`/app/anatomy`; owner's « Catalogue anatomique » = same entry, name kept).
|
||||
2. Direct URL (`/app/anatomy`, `/:sheetId`, `/versions/:n`) → page « Accès non autorisé »: explanation + link back to `/app`. Same page whether sheet exists or not (no existence oracle).
|
||||
3. Server checks, capabilities, RLS unchanged; hidden entry protects nothing.
|
||||
4. Reviewer-only account (`sheet_reviewer` only) keeps « Administration » entry to reach its rounds (boards 07, 09, 10; §11.1 E,V,P; R1 « À relire »), sees no entry or action it cannot use: no « Nouvelle fiche », « Créer une copie de travail », « Accès et habilitations », species creation or activation. Owner chose this reading of « ne pas exposer les entrées d'administration » (AskUserQuestion), boards unchanged.
|
||||
5. Not signed in → `RequireAuth` → `/login?next=` (IDENTITY.md); signed in, not entitled → « Accès non autorisé ». Never mixed.
|
||||
Also: G1/G2 corrections validated, conformance 8/8 acknowledged; UX decisions 2-11 of the 2026-11-02 checkpoint list ratified (3 settled here); item 1, labels, open. §6.5 « reported to the operator » for `verification.worker.verdict_refused` diverges from code: worker logs `complete_malformed` at error level, RPC keeps code on round + audit, no notification; recorded, no alert mechanism added. Still open: owner visual validation of 12 boards, 31 FR/EN labels.
|
||||
|
||||
**Rationale**: O21 right ≠ authentication ≠ capability (§5.3), so UI must tell the three apart; fail-closed, server decides. Hiding entry for reviewers would cut R1 (no e-mail in V1-2). Implementation (V1-2.5): visibility hint from own `anatomical_catalog_grants` rows (select policy `user_id = auth.uid()`), page decision from server refusal, never the hint.
|
||||
|
||||
**Alternatives**: show catalogue page with explanation for everyone (rejected by owner); hide « Administration » from reviewer-only accounts with separate « À relire » entry (needs boards 07, 09, 10 redrawn, not chosen); rename entry « Catalogue anatomique » (design change, not chosen).
|
||||
|
||||
## BDR-095 — V1-2.4 catalogue search by sheet name only (replaces BDR-094 item), distinct failed/unavailable titles (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner briefs « V1-2.4 : dernières corrections graphiques » and « arbitrages propriétaire et préparation de validation finale » (2026-11-02).
|
||||
1. Catalogue search (`/app/anatomy`) by sheet name only in V1-2; field « Rechercher une fiche ». Explicitly replaces zone-name search, ratified earlier same day under BDR-094 (« UX decisions 2-11 ratified », item 4). No repo trace of an earlier « no zone search » decision cited by external review.
|
||||
2. Distinct titles per outcome: `failed` « Vérification échouée » / « Verification failed »; `unavailable` « Vérification indisponible » / « Verification unavailable ». Round status `verification_failed` kept as technical status, §3 label unchanged.
|
||||
3. Future review lists (V1-2.7): tell content failure from technical unavailability only when data establish it (`anatomical_sheet_reviews.failure_outcome`, nullable, no CHECK tying it to `verification_failed`); otherwise exact generic label, never inferred cause. No migration now.
|
||||
4. No SQL model, business rule or closed code change.
|
||||
**Rationale**: search by zone widens a slice already large; one title per outcome stops an unavailable service reading as bad content.
|
||||
**Alternatives**: zone search (withdrawn); one title « Vérification échouée » + « indisponible » tag (replaced).
|
||||
|
||||
## BDR-096 — V1-2.4 GRAPHICAL APPROVED: 12 boards + « Accès non autorisé » page, last label arbitrations, V1-2.5 authorised on VERIFIED deps (2026-11-02) (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « Validation propriétaire V1-2.4 » (2026-11-02, on 74aa8f6), after review of archive `faunosteo-v1-2-4-maquettes-arbitrages-3.zip`. **V1-2.4 GRAPHICAL APPROVED**: 12 boards `01`-`12` + complementary page « Accès non autorisé » = design reference V1-2.5 to V1-2.7. No board, source or rule changed by the record.
|
||||
1. `object_conflict` FR: « Le contenu du fichier de l'illustration ne correspond pas à son empreinte SHA-256 enregistrée. » (meaning checked: stored bytes vs recorded sha256 key, `HashMismatch`). EN not arbitrated, checked at integration.
|
||||
2. L14: « Access and permissions » in UI; `capability` stays technical term (§3 row unchanged).
|
||||
3. L20: « Corriger le brouillon » / « Fix the draft » (content failure); « Modifier le brouillon » / « Edit the draft » (size limit).
|
||||
4. L32: « Accès non autorisé » / « Access denied »; explanation + « Retour au tableau de bord » / « Back to dashboard » declared already decided (board 12 wordings).
|
||||
5. Other technical messages (16 closed codes, L30 refusals) checked at integration, not blocking graphic closure. L15 2nd sentence not named by brief → stays open until V1-2.6.
|
||||
6. Minor doc remarks fixable without new graphic review, boards untouched. Board 12 keeps older `object_conflict` text and « à arbitrer » marks; REVUE.md + contract §17.9 hold ratified wordings.
|
||||
7. V1-2.5 authorised once §16.6 dependencies VERIFIED, existing contract only. Kept: no merge develop/main/release, no Supabase DEV op without own authorisation, no DEV worker, tests + independent review fit for step, commits + pushes on V1-2 branch, STOP at V1-2.5 checkpoint. Design not reopened without demonstrated defect or new owner decision.
|
||||
**Rationale**: four review rounds (G1/G2, final corrections, arbitrations, verifier CONFORME 21/21) closed every graphic finding; remaining messages are integration-time checks against code.
|
||||
**Alternatives**: regenerate board 12 with final wordings (rejected by brief: design not modified); hold approval until every message settled (rejected: owner closes graphics, messages at integration).
|
||||
|
||||
## BDR-097 — V1-2.5 start: M7 admin read migration, working-copy action in V1-2.5, EN Permission for Habilitation (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: V1-2.5 started 2026-11-02 under brief « Validation propriétaire V1-2.4 » after prerequisite check on 994b04e: V1-2.1 VERIFIED at ac71c5b (M4/M5 unchanged since), V1-2.2 VERIFIED (BDR-092), V1-2.4 approved (BDR-096), V1-2.3 VERIFIED (BDR-093). Owner answers (AskUserQuestion, 2026-11-02) to three gaps found at start:
|
||||
1. Admin reads: admin list needs working-copy badge + round counts; `working_copy_source_version_id` excluded from table grants (§5.3), no admin read RPC existed, §16.6 said « SQL changes: none ». Chosen: one read migration M7 `sheet_admin_reads` (list + overview RPCs, capability holders at aal2, no write path, no policy/rule change), sandbox only, DEV untouched. Contract §12.3, §16.6, §17.10.
|
||||
2. Working copy: « Créer une copie de travail » built in V1-2.5 (board 10) on existing `create_sheet_working_copy`, lands on copy's overview; editor link with V1-2.6. A1 new sheet also lands on overview until V1-2.6.
|
||||
3. EN term: « Habilitation » = « Permission » in English UI; `capability` stays technical term. Contract §3 amended.
|
||||
**Rationale**: board 10 (approved) shows badge, counts and working-copy action; column grant widening would expose the column to readers (§5.3); a read RPC keeps reader grants narrow. « Permission » follows L14 « Access and permissions ».
|
||||
**Alternatives**: drop badge in V1-2.5 (deviates from §11.1 + board 10); widen column grant (rejected, §5.3); defer working-copy action to V1-2.6; keep EN « Capability » (§3 old).
|
||||
|
||||
## BDR-098 — get_sheet_version returns deprecated versions' fingerprint (M7) (2026-11-02)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner 2026-11-02 (AskUserQuestion), V1-2.5 slice I. `get_sheet_version` returns `document_fingerprint` for published AND deprecated versions (draft: none). Redefined in M7 `20261102100000_sheet_admin_reads.sql` (never applied to DEV); body otherwise identical to M5. pgTAP 022 +3. Contract §10, §12.3, §17.10 amended.
|
||||
**Rationale**: core PreviewSheet (V1-2.2) checks stored fingerprint for published + deprecated; M5 RPC gave it for published only (contract §10 wording) → every withdrawn version page refused `fingerprint_mismatch`; §10 also says deprecated previews like published (self-contradiction). Fingerprint was public while version was published; integrity check kept.
|
||||
**Alternatives**: core skips fingerprint for deprecated (loses integrity check); defer retired versions (C8 unmet).
|
||||
|
||||
## BDR-099 — V1-2.5 VERIFIED: permission states, Retry, Paris end-of-day expiry, species order 0..9999, UX deviations, MFA recovery prerequisite (2026-11-03)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner accepted V1-2.5 final checkpoint at b4415a3 (brief « Validation V1-2.5 et autorisation V1-2.6 », 2026-11-03) → V1-2.5 VERIFIED. Decisions ratified (contract §17.11):
|
||||
1. Permission states, `/app/admin/sheets/new` order: own grants `loading` → waiting status; server species read answered `rights.*` → « Accès non autorisé » (server wins over failed client read, BDR-094); own grants `failed` → « Impossible de vérifier vos autorisations » + short text + « Réessayer », never form; `ready` + active `sheet_editor` → form; `ready` without it (reviewer-only, publisher-only, owner without capability) → refused. Technical error never read as no-right. Admin home: same notice replaces « Vos habilitations » line. Lists hide grant-dependent actions on failed read, no notice. Server checks + RLS stay mandatory.
|
||||
2. Retry (`reloadAccess`): status `loading`, re-reads platform roles + own grants (+ species list on creation page when it failed); ends `ready` or `failed` (grants `[]`); never wipes profile, roles, workspace already held; never rejects; `setForUser` guard drops late answers.
|
||||
3. Grant expiry: stored instant = 23:59:59.999 Europe/Paris of chosen day, offset in force then (DST-aware); picker + display in Paris dates; backend unchanged (`expires_at > now()`); historical rows untouched.
|
||||
4. Species order: integer 0..9 999, checked server-side in M7 (`create_species`, `update_inactive_species`); null keeps old meaning; M5 untouched.
|
||||
5. Two accepted UX deviations, boards unchanged: selection in zone panel not tag over drawing (aria-live region mounted before pick, names zone); « Références » card not collapsible on phone (starts at/below drawing bottom, measured 320 + 375 px).
|
||||
6. MFA lost-authenticator: no safe rehearsed recovery path exists (IDENTITY §4.2) → production prerequisite (contract §13). No bypass, no aal2 weakening, no factor-reset path.
|
||||
7. Reserve: unavailable-permissions e2e runs desktop only (skipped chromium-375; admin pages at 375 covered by other specs); sandbox suites share stack state, two state-dependent tests fixed (0499a39, f5456f3), others may surface → fresh stack per gate run.
|
||||
**Rationale**: owner brief §1-§5 at V1-2.5 checkpoint (14ff890) + final acceptance (b4415a3); fail-closed UI without false refusal; Paris = initial French scope.
|
||||
**Alternatives**: show form on failed read (rejected, owner); deduce no-right from error (rejected); UTC midnight expiry (cuts chosen day short); collapsible Références (rejected, no redesign); add MFA recovery bypass now (rejected, weakens aal2).
|
||||
|
||||
## BDR-100 — V1-2.6 UX technical decisions ratified: T11, T16 conditional, T2/T3 conditional, T4 no residual gap, T5 history, T9, T10 principle, T12 principle (2026-11-05)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « FAUNOSTEO — V1-2.6 UX — Ratification des décisions techniques » (2026-11-05) answers T11, T16, T2/T3, T4, T5, T9/T10, T12 of `docs/development/V1-2-6_UX_DECISIONS.md`. UX choices not reopened.
|
||||
1. T11 approved: old-UX (level 1) trials stopped; anomalies + untested items tracked (TODO level-1 line); level 1 NOT declared validated as a whole.
|
||||
2. T16 conditional deferral: curve handle editing out of V1-2.6 → curves lot (ex-U9), precedes any feature letting a path into a document. Audit: tracked docs 0 paths (seed draft 22 circles 6 polygons, legacy import 21/6), no product journey writes or needs a path change; DB contents (DEV, sandbox) not queried → read-only count before an env gets U6. Paths kept byte for byte, never converted; ops that would change one refused, doc unchanged; « Remplacer par un polygone » = sole explicit exit (contract §8.3).
|
||||
3. T2/T3 principle, conditional on proofs (COMPATIBILITY §8: fingerprints, Rust, SQL, PDF, worker, N-1, R3/R4, BDR-068): `role` + `fill_opacity` optional in schema v2, omitted when absent, never null by default, explicit null refused, absent never defaulted in fingerprinted doc; opacity integer 10-100; controlled snapshot-reader widening (exactly two keys, typed, ranged; else Schema rejection, report kept). One-way compat only: no return to old app after first write; never "full backward compatibility".
|
||||
4. T4 no residual gap: absolute verdict-tier rule on draft (3 roles once each, fixed names) → existing `verification.validation.rules`; `edit.rs` refusals + repair path; U6 migration withdraws rounds in flight + core gate on `verified_with` (pre-U6 passed verdict refused; marker needed, every core says 0.1.0); publication gate unchanged (current verdict). Write lock: keys written only after SQL + worker live (order SQL, worker, app). Save stays permissive (drafts may be incomplete) → owner confirmation pending.
|
||||
5. T5 history preserved: ids, names, colours, 3 own colours, annotations, fingerprints of historical equine; roles on working copy only; conversion test on in-memory copy. New-sheet defaults (ids, EN names, colours) pending.
|
||||
6. T9: explicit 3-action dialog on every crop drawing replacement, before upload: keep (R inside V + accept passes), reposition (same aspect exact, no path, no descendant crop), cancel (nothing uploaded). No approximate auto transformation; `remap.aspect` refusal.
|
||||
7. T10: access never put in Os/Articulations/Vertèbres; `detail_trigger` exists but requires an existing category; recommended internal category `cat-access` role `navigation` (to confirm); automatic access moved U5 → U6.
|
||||
8. T12: one versioned copy; legal text, source, validation to supply; U7 blocked; no invented normative text.
|
||||
**Rationale**: owner answers; no integrity gap at round or publication; history and archives preserved; honest compat wording.
|
||||
**Alternatives**: base-relative rules with first-version gap (old T4 rec, rejected); save-time SQL check (locks pre-U6 drafts, mirrors core rule; offered to owner); Joints category for access (rejected); optional trigger category (breaks N-1 type test + snapshot); V=R without question (rejected).
|
||||
**Open**: T1 (only if budget exceeded), T4 save boundary, T5 defaults, T6 (V1-2.8), T10 option B, T14, T15 (U1), T17 (U6), T12 text. No code; U0 needs new explicit authorisation.
|
||||
- **Status (2026-11-05)**: accepted, items 4 and 6 superseded after second review: T4 adds declared SQL check of fixed model at approval + publication, recommended save non-regression check (no role removed/duplicated/renamed away; role-less drafts still save), both to confirm with O22 amendment; functional write lock = rules epoch RPC read by app, SQL first mandatory; editor: role brings fixed names, repairs for names + duplicates, navigation never assignable; withdrawal limited to draft rounds; replay filters category.fixed.*. T9: keep only when V equals R, reposition same aspect on 0.01 grid, premises stated, two core calls (offer before upload, batch after hold), no viewBox -> cancel only.
|
||||
- **Status (2026-11-05)**: accepted, item 2 count scope aligned with DECISIONS T16: read-only path count before U6 or U8 reaches any env beyond throwaway sandbox (third check G4)
|
||||
- **Status (2026-11-05)**: accepted, open items answered 2026-11-05 by BDR-101: T4 SQL checks (save + approval/publication) approved, T5 defaults, T10 option B, T15; T1, T6, T14, T17, T12 text still open
|
||||
|
||||
## BDR-101 — V1-2.6 U0: T4 SQL checks approved (O22 amended), T5 defaults, T10 option B, T15 wording, T16 count, polygon replacement explicit (2026-11-05) (2026-11-05)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « FAUNOSTEO — V1-2.6 UX — Autorisation U0 uniquement » (2026-11-05). U0 authorised alone (docs, contract, preconditions, non-destructive checks). 16 V2 boards + 11 UX choices approved for good, no graphic arbitration reopened. Complementary ratification:
|
||||
1. T4: both declared SQL checks approved. Save: no role carried twice, role-bearing category keeps fixed FR/EN names, no role of stored draft lost; role-less drafts (pre-U6, equine working copy) still save. Approval + publication: `bone`, `joint`, `vertebra` once each with fixed names, `navigation` at most once, independent of worker. O22 amended strictly for these invariants (contract §12.2, §17.12); no other core rule mirrored. Both planned at U6, not built.
|
||||
2. T5 new-sheet defaults: `cat-bone` Os/Bones `#a41e65`, `cat-joint` Articulations/Joints `#ff9500`, `cat-vertebra` Vertèbres/Vertebrae `#e100ff`. Sources: Bones/Joints + colours = equine draft categories `os`, `articulations`, `zone-colonne` (`draft/document.json:417-446`); no existing category named Vertebrae, EN taken from editor tab pair (`fr.ts:1230`/`en.ts:1199`). History + fingerprints untouched.
|
||||
3. T10 option B: internal `cat-access`, role `navigation`, FR « Accès aux vues détaillées », EN « Detail view access », colour null; never shown as anatomical category; automatic access only at U6, on U5 overlap list, only when empty. Implementer: edits never give, change or clear `navigation`; canonical `cat-access` enters only in core-built access batch.
|
||||
4. T15: « Annuler la dernière modification » = history command (header, toast); « Abandonner » / « Abandonner les modifications » = leaving a form / discarding unsaved changes (C11 relabelled at U1).
|
||||
5. T16 kept: curves lot out of V1-2.6; read-only path count on each env before new model activated there (U6 write lock lifted); no DEV during U0.
|
||||
6. « Remplacer par un polygone »: explicit replacement only, core-validated, old path kept until success, undo/redo; no automatic conversion. Holds in level-1 code (`usePlacement.ts:39-63`, one commit under accept); undo/redo exact-restore test at U2.
|
||||
7. T12: U7 blocked until legal text, source, validation supplied. T1, T6 conditions kept. T17 open (blocks U6, not U0).
|
||||
8. U0 amended: V1-2 contract §6.2, §6.4 (draft rounds only, was « every round »), §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 O22 row, §16.7, §16.12, new §17.12; level-1 contract C3, C4, C6, C7, C8, C11, C13, C32, C33, C40; docs/design/README.md (v1-2-6 validated); rules sheet-model.md, schemas.md. Docs only.
|
||||
**Rationale**: owner answers; integrity enforced at save + publication even if worker defective; history and archives preserved; no invented wording.
|
||||
**Alternatives**: no save check (rejected, owner); full core validation mirrored in SQL (rejected, O22); access in Joints or optional trigger category (rejected, BDR-100); keep « Annuler » for both history and forms (rejected, T15).
|
||||
**Open**: T1 (only if wasm measure > 600 000 B), T6 (V1-2.8), T14 (follow-up), T17 (before U6), T12 text (before U7). U1+ need new explicit authorisation.
|
||||
- **Status (2026-11-06)**: accepted, item 8 completed: level-1 notes also on C16, C20 (keyboard path via handles), C28; contract §16.7 test line
|
||||
- **Status (2026-11-06)**: accepted, item 8 extended after 4th check: level-1 header precedence rule (validated boards and amended contract prevail; undecided board points listed in DECISIONS for U1/U6), notes on C5, C11 header, C16, C18, C25; C16 edited by note, not inline
|
||||
- **Status (2026-11-06)**: accepted, 5th check: precedence rule refined (amended contract first, then boards; listed board differences stay open owner questions, level-1 text in force until answered; V1-2.7 points stay there); level-1 plan choice 2 (properties at creation) listed open for U2/U5
|
||||
- **Status (2026-11-06)**: accepted, correction after 6th check: detail-view names follow validated choice 6 (not open); only points/zones properties at creation (plan choice 2 vs boards 02/04) open for U2; C11 note: dialogs closing without effect keep Annuler
|
||||
|
||||
## BDR-102 — V1-2.6 T17: fallback Régions vertébrales entry in Annotations without vertebra role, configured from Vertèbres category once it exists, no duplicate (2026-11-06)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « FAUNOSTEO — V1-2.6 UX — Autorisation de U1 uniquement » (2026-11-06) answers T17: no category with role `vertebra` → Annotations offers fallback entry « Régions vertébrales »; Vertèbres category exists → regions configured from that category (board 09), no duplicate entry. New category model not built before U6.
|
||||
Effect: U1 relocates existing level-1 regions editor into Annotations as that fallback entry (no role before U6); U6 adds vertebra-role path + removes entry when role present. Equine working copy uses fallback until V1-2.8 (T6).
|
||||
**Rationale**: board 09 path needs role; working copy and pre-U6 drafts have none; one place to edit regions avoids divergence.
|
||||
**Alternatives**: regions only from category (blocks equine copy until V1-2.8, rejected); permanent separate tab (duplicate, rejected by four-tab shell).
|
||||
**Open**: none on T17. Recorded in DECISIONS T17, contract §17.12, PLAN U6, TESTS U6, TODO.
|
||||
|
||||
## BDR-103 — V1-2.6 U2b principle approved: F1, F2, F6, F8, F22 decided, F7 term Famille, F3/F4 partial, F5 + F9-F21 open (2026-11-06)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « Validation de principe U2b et préparation des checkpoints » (2026-11-06) approves principle of bidirectional annotations ↔ findings navigation. Owner decisions only (recommendations not recorded as decided):
|
||||
- F1: sub-step U2b « Annotations et constats » after U2, before U3; own contract, tests, checkpoint. Not started; needs own authorisation.
|
||||
- F2: counters = real findings at any depth, families not counted, a zone named by several annotations counted once. Open: intermediate groups counted or not (study 7.1; boards count them: grasset 29 nodes vs 25 leaves; draft 730 vs 627).
|
||||
- F3 partial: instant search, accent- and case-insensitive. Field list, word rule, language rule to ratify (study 7.2).
|
||||
- F4 partial: text ∩ drawing; several picked zones = union, no duplicate. View semantics to ratify (study 7.3: model A facets, recommended; model B picks only).
|
||||
- F6: below 1 024 px consultation + list filters, no graphical editing.
|
||||
- F7 (term only): « Famille » = finding families, distinct from annotation categories. Other labels of F7 stay C44 proposals.
|
||||
- F8: annotation without zone gets one through one atomic, core-validated, undoable operation, no silent duplicate (`commitBatch`, one undo entry; duplicate-name notice = proposed reading, confirm in U2b contract).
|
||||
- F22: finding added from a selected annotation takes that annotation's zone; no second zone choice (board 18 A).
|
||||
Not decided: F5, F9-F21. U1 plan at 2e46c14 untouched: integration points re-checked, enough.
|
||||
**Rationale**: U2 rewrites selection/pointer/keyboard model of same canvas + `PropertiesPanel` → U2b after it; U3-U6 never touch zone link or findings tree. No core op, no document change (request C: `finding_zone_id` already links annotation → zone).
|
||||
**Alternatives**: U2b after U6 (less `AnnotationFields` rework, later delivery); inside U2 (too large). « Catégorie de constats » kept (clashes with annotation « Catégorie »).
|
||||
**Open**: F2 groups, F3 fields, F4 view model, F5, F9-F21. Recorded in `V1-2-6_UX_FINDINGS_NAV.md` §7, `V1-2-6_UX_PLAN.md` §3 U2b, contract `2026-11-06-v1-2-6-findings-nav-decisions.md`.
|
||||
- **Status (2026-11-06)**: accepted, corrected 2026-11-06 after fresh verifier: F22 decision = owner sentence only (« préselectionner sa zone de rattachement. Ne pas imposer une seconde sélection inutile. »); form variant open: fixed zone (board 18 A) or preselected changeable field (literal reading). F8 decision = owner wording (« opération logique atomique, validée et annulable, sans doublon silencieux »); core validation via commitBatch, one undo entry, duplicate-name notice = study's proposed means, confirm in U2b contract.
|
||||
- **Status (2026-11-06)**: accepted, completed by BDR-104 (F2 leaves, F3, F4 model A, F8, F22 decided 2026-11-06)
|
||||
|
||||
## BDR-104 — V1-2.6 U2b F2/F3/F4/F8/F22 decided, U1 design confirmed, no implicit sandbox deletion (2026-11-06)
|
||||
- **Status**: accepted
|
||||
**Decision**: owner brief « U1 / U2b — Derniers arbitrages avant implémentation » (2026-11-06). U1 design confirmed; U2b placement between U2 and U3 confirmed. U2b decided in full:
|
||||
- F2: count selectable leaves only, no intermediate groups; duplicates from several annotations of one zone removed (grasset 25, draft 627). Identity = zone id + node path, never label.
|
||||
- F3: search FR + EN on names of zones, families, groups, leaves; accent- and case-insensitive; all words must match, any order, across tree levels.
|
||||
- F4: model A. No annotation ticked → selected views filter their zones; from first tick → explicitly picked zones; intersection with text.
|
||||
- F8: never auto-create redundant zone; annotation without zone → explicit link to existing zone or validated creation; coherent, undoable, non-destructive; never merge two distinct findings on equal labels.
|
||||
- F22: finding added from an annotation defaults to its zone; any change of anatomical association = explicit action, no silent move of existing findings. Study reads « par défaut » as variant (b): preselected, changeable field.
|
||||
- Sandbox rule: plan approval authorises NO data deletion, sandbox included. Each `db:sandbox down` / `up fresh` needs its own explicit owner go (proposed contract clarification 2.9 of `V1-2-6_UX_U1_CHECKPOINT.md`, prevails over plan :38-40, :397).
|
||||
Still open: F5, F9-F21 (recommendations only); U2b contract details: F3 œ/æ/’ fold shared with catalogue, other-language display, F8 second confirmation for a duplicate name. U1 authorisation pending: 18 choices, amendments 2.1-2.9, reset procedure.
|
||||
**Rationale**: leaves = what practitioner records (`FindingsTreePicker.tsx:35`); facet model gives a view's findings in one click; explicit association avoids silent data moves.
|
||||
**Alternatives**: F2 all nodes (boards' 29/730); F4 model B picks only; F22 variant (a) fixed zone (board 18 A).
|
||||
**Open**: see above. Recorded in `V1-2-6_UX_FINDINGS_NAV.md` §6-§7, `V1-2-6_UX_PLAN.md` U2b, `V1-2-6_UX_U1_CHECKPOINT.md`.
|
||||
- **Status (2026-11-06)**: accepted, precision after fresh verifier: F2 « Identity = zone id + node path » is the study's reading (V1-2-6_UX_FINDINGS_NAV.md §7 F2), not owner wording; « never by label » comes from owner F8.
|
||||
- **Status (2026-11-06)**: accepted, wording: « decided in full » means decided by the owner; details left to the U2b contract stay open (F3 œ/æ/’ fold and other-language display, F8 second confirmation).
|
||||
|
||||
## BDR-105 — V1-2.6 U1 final ratification + conditional authorisation; U2b F5, F9-F21 ratified (2026-11-06)
|
||||
- **Status**: accepted 2026-11-06 by owner
|
||||
Owner brief « V1-2.6 UX — Ratification finale U1 et autorisation conditionnelle d'implémentation », 2026-11-06. Owner decisions only.
|
||||
|
||||
U1: 18 visible choices (checkpoint page §1), approach A, amendments AC3/AC4/AC5/AC7/AC17, changes 2.6-2.9 approved. Plan 2e46c14 stays reference, not redesigned. Two precautions: (1) 2.8 forms unmounted: no silent loss of typed input on 1 024 px crossing or recovery decision; check real components; keep values when safe U1-scope solution exists, else explicit confirmation or precise documented limit with recovery guarantees; out-of-scope need → report block before that work; tests. (2) AC7 save time: check rights of existing endpoint, no permission widening; not readable with normal practitioner rights → « Enregistré · révision n »; never success before server confirmation, never browser clock. Pre-code: independent re-check of 3 unverified confirmation-pass fixes (commitFocusedField before moves, tracing kept on « Aller à », every editor-*.spec.ts per lot from B1) + both precautions; exact verdict; blocking gaps fixed and re-checked first. Then U1 lots A-I authorised, commit + push per lot, no next lot with unmet preconditions.
|
||||
|
||||
Sandbox: per-operation go only. Before each `db:sandbox down`, `up fresh` or equivalent: stop, read-only inventory (containers, non-seed accounts, sheets, drafts, resources), show exact deletion, wait explicit go. No carry-over of earlier go. DEV never substitute.
|
||||
|
||||
U2b (no implementation): F5, F9-F21 approved as recommended (a). Precisions: F3 shared normalisation catalogue + findings, œ/oe, æ/ae, straight/typographic apostrophes; match only in other language shows that label too. F8 same-name zone → reuse proposed; distinct zone after explicit confirmation; no name uniqueness. F11 first annotation in document order, others offered at once. F12/F14 accessible identification, not colour alone, visible names. F13 detail hidden while filtering, state kept. F22 zone preselected, change via « Changer la zone associée », no silent move. U2b after U2, before U3.
|
||||
|
||||
Alternatives not taken: plan redesign; global sandbox reset go; U2b now.
|
||||
Status: in force. Supersedes nothing (completes BDR-104).
|
||||
|
||||
## BDR-106 — V1-2.6 U1 checkpoint: out-of-scope files + 3 rewrites accepted, checkpoint open, exact e2e 188/90/4, RR-13 rights paging track (2026-11-09) (2026-11-09)
|
||||
- **Status**: accepted 2026-11-09 by owner
|
||||
Owner brief « V1-2.6 UX — Décisions au checkpoint U1 », 2026-11-09. Owner decisions only.
|
||||
|
||||
- Accepted: 5 files outside initial FILE SCOPE (CatalogueCanvas.tsx B2a, placeVisibility.ts B2a, editingContext.ts B2b, references/filter.ts D, ShellChrome.tsx F) + 3 one-for-one assertion rewrites (editor-journey.spec.ts:14 8→4 lines, editor-recovery.spec.ts:7 4→2, editor-route-recovery.test.tsx:93 8→5; `expect(` per file unchanged 37/41/45; mapping 99b669b). Condition: justification + mapping kept in final report (`V1-2-6_UX_U1_CHECKPOINT.md` §7.2). No general scope widening for later steps.
|
||||
- U1 status: implementation done, owner validation checkpoint stays open (manual trial). Exact shell suite at da95b84: 188 pass / 90 skip / 4 fail (admin.spec.ts:717 fr/en × desktop/375). Never claim suite green on last commit. 192/0 at 81fba46 on fresh sandbox = earlier evidence only. 4 failures = probable sandbox-state dependency (single working-copy slot, WorkingCopyAction.tsx:88), confirm later by non-destructive reproduction or isolated test. No sandbox reset to get green.
|
||||
- New priority track RR-13 « Pagination côté serveur de la liste des droits et prévention de l'épuisement mémoire », separate from U1 and U2, not implemented now. Future plan: bounded server paging, deterministic order, authorization unchanged, paging + volume tests, admin scenario independence tests, memory check, DEV protected from test-suite side effects.
|
||||
- Limits kept in U1, not moved silently to U2: N4, N6, repair result/draft, local recovery copy (sessionStorage), references panel inert, widths (538 px at 1 024/1 280), trial-lan not run.
|
||||
- Doc closure authorized: LRN, TODO, BDR, journal, U1 criteria + reservations; docs-only commit + push. ChatGPT review file stays untracked. No app/Rust/SQL/worker/DEV config change, no merge, no deploy, no U2.
|
||||
|
||||
Alternatives not taken: sandbox reset for a green verdict; paging folded into U1 or U2; U1 limits moved to U2.
|
||||
Status: in force. Completes BDR-105.
|
||||
|
||||
## BDR-107 — V1-2.6 U1 trial arbitrations: References tab back, Défaire/Refaire, deselect, generic sheet list, trial stack, anomalies A-C (2026-11-09)
|
||||
- **Status**: accepted
|
||||
Owner brief « V1-2.6 UX — Arbitrages du premier essai propriétaire » 2026-11-09, after U1 trial diagnosis.
|
||||
Decided: fifth main tab « Références » between Constats and Vérification; header Références button removed; contextual panel only from finding detail, filtered, « Tout afficher » → tab, ~34 rem, slide 150-200 ms, prefers-reduced-motion honoured; tiles collapsible, search + clear, sort doc order (default) / A-Z / citation count / type, sort never touches document, reorder only in doc order; <640 px Références in « Plus ». History « Défaire » / « Refaire » (T15 history part superseded, form « Abandonner » kept). « Désélectionner » near « Supprimer »; Escape deselects when no dialog/priority panel/menu/tracing consumes it; deselect = UI state, no doc change, no history; empty-canvas click left to U2. Sheet list: search + clear, sort last modification (default) or name, date visible, better admin home card; no section by UUID/name/slug/test convention, generic, no test filter. Dedicated persistent manual trial stack separate from sandbox (plan only). Test anomalies A fictitious fingerprints, B working copy never archived by sheets-admin.sandbox.ts, C silent card integrity failure: tracked apart from U1/U2. Lots R0 boards → R1 labels/deselect → R2 References tab → R3 list → R4 card warning (independent). SQL or Rust change → own checkpoint.
|
||||
Supersedes: U1 AC1, AC3 (header opener), AC4 labels, AC12/AC13 panel target, AC17 panel tests; checkpoint choices 5, 10 (carried), 15; board 11 once R0 validated. Not contradicted: BDR-099 item 5 (catalogue phone card), U2b F5 (panel slot kept).
|
||||
Rejected alternative (owner): UI section for historical sheets, test-data filter in product.
|
||||
Docs: docs/development/V1-2-6_U1_CORRECTIONS.md, docs/development/TRIAL_STACK.md, docs/design/v1-2-6-r0/. Contract .claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md. Next: owner validates R0 boards + arbitrations A1-A15; no code before.
|
||||
|
||||
## BDR-108 — R0 owner decisions: A3 Retirer de ce constat, A6 focus, A7 SQL checkpoint, db:trial with two accounts, graphic validation pending (2026-11-09)
|
||||
- **Status**: accepted
|
||||
Owner brief « R0 — Décisions propriétaire et dernière validation graphique » 2026-11-09, on R0 report (BDR-107).
|
||||
Ratified: A3 « Retirer de ce constat » in finding panel, removes citation link only, reference stays in document, undoable via editor history. A6 focus after Désélectionner → annotation row if still exists else drawing; focus return never reselects; accessible announcement. A7 dedicated SQL checkpoint for true last-modified date (docs/development/V1-2-6_R3_SQL_CHECKPOINT.md, `last_modified_at` = greatest(sheet, versions updated_at)); until then no creation date shown as modification date, no misleading sort → R3 ships search + name sort first. Trial stack: `pnpm db:trial` approved; `db:sandbox trial*` kept provisionally, not removed nor silently redirected; two accounts (owner/admin; practitioner with editing rights — O1 makes sheet_editor need admin role, flagged); suites must not reach it; volumes preserved, resources capped, secrets renewable (rotate-keys + rotate-secrets). Anomalies A/B stay independent tracks. R4 accepted as independent display fix, fingerprint check unchanged.
|
||||
Boards 23-30: functional direction approved, graphic rendering NOT yet validated. Asked: review archive (8 boards, contact sheet, REVUE, CORRECTIONS, TRIAL_STACK + full A1-A15 table), targeted independent counter-check of last two conformity fixes, honest impeccable detect status + compliant proposal. No R1-R4, U2, U2b; no code, SQL, script, stack change.
|
||||
|
||||
## BDR-109 — R0 graphic verdict: approved with corrections 23/24/26, A1-A15 settled, SQL design accepted, impeccable observations kept (2026-11-09)
|
||||
- **Status**: accepted
|
||||
Owner verdict « R0 — Verdict de revue graphique propriétaire » 2026-11-09: R0 graphic direction APPROVED WITH THREE TARGETED CORRECTIONS. 25, 27, 30 approved; 28, 29 approved for post-SQL-checkpoint state. Fixed: 23 cited reference shows no Supprimer, hint « … « Aller à », puis « Retirer » dans le détail du constat ou de la famille » (existing editor.action.remove, exact for family citations), uncited keep Supprimer; 24 D note moved to annotation; 26 draws U1 ToolColumn icon-only + KeyboardAdd row; 28/29 annotations = post-checkpoint state. 25/27/30 byte-identical (board 23 frame shortened 78 px to keep positions).
|
||||
Arbitrations: A1 A2 A4 A5 A5b A8 A9 A10 A11 A15 ratified per exact recommendation; A3 A6 A7 A12 kept. A13 two accounts: owner/admin; practitioner = technical admin + sheet_editor, no owner/reviewer/publisher, not a production profile, O1 unchanged. A14 one-year keys on dedicated local stack, documented rotation, no secret in Git/logs, security review of renewal.
|
||||
SQL last_modified_at design accepted; no migration created/applied; R3 split before/after kept.
|
||||
impeccable detect 4.1.0 offline from cache (owner run + rerun after fixes): 2 observations overused-font Inter (app token --font-sans) and cream-palette #ECE6DA (mockup backdrop only; app bg #fbf9f5); kept by owner decision, documented.
|
||||
|
||||
## BDR-110 — R0 graphically validated: boards 23-30 reference for R1-R4 after closing counter-check CONFORME (2026-11-09)
|
||||
- **Status**: accepted
|
||||
Owner brief « R0 — Autorisation des trois dernières corrections graphiques » 2026-11-09. Applied: 28 inherited A7 fallback note + REVUE « Repli A7 » row removed, final rule = no reliable last-modified date and no date sort before SQL checkpoint, real date + sort after it is validated and applied; 26 A6 note complete (row if exists else drawing, focus never reselects, announcement « Aucune annotation sélectionnée. » / "No annotation selected."); 24 A uncited reference cr-l243-3 open with Supprimer (existing confirmation), cited = hint only. 25/27/30 byte-identical since 45f1cce (heights compensated, disclosed). impeccable 4.1.0 offline third run: same 2 observations kept. Fresh closing counter-check CONFORME (10/10 items, 9/9 render hashes, scope incl. SQL checkpoint doc via BDR-109 clarification). R0 GRAPHICALLY VALIDATED: boards 23-30 = reference for R1-R4. Review archive ~/faunosteo-v1-2-6-r0-maquettes.zip rebuilt. Next: R1-R4 each need own owner go; SQL migration needs own go.
|
||||
|
||||
## BDR-111 — Trial app served on LAN 192.168.1.100:5194 during dev (owner connects via LAN) (2026-11-11)
|
||||
**Decision** (owner 2026-11-11, verbatim: « il faut relancer le serveur sur --host on va se connecter systematiquement sur 192.168.1.100 pendant le dev »): during dev the owner always connects through the LAN address 192.168.1.100. Trial app = `pnpm db:trial app` with default host (FAUNOSTEO_DEV_HOST = 192.168.1.100) → Vite binds 192.168.1.100:5194 only (never 0.0.0.0), Host allowlist keeps other names out (403). Never start it on 127.0.0.1 by default.
|
||||
**Supersedes** the 127.0.0.1:5194 / « ne pas ouvrir l'application sur le LAN » line of the owner brief « DB TRIAL — Checkpoint sécurité et autorisation des comptes » (same day).
|
||||
**Why coherent**: trial GoTrue SITE_URL / API_EXTERNAL_URL / redirect allowlist already = http://192.168.1.100:5194 (set at create and rotation from trial_host); a 127.0.0.1 app origin mismatches GoTrue links.
|
||||
**Trade-off**: app proxies signed-in sessions to the trial gateway; reachable by every device of the private network. Firewall not changed (ENVIRONMENTS.md §3 owner action). Playwright LAN tests still gated by arbitration 2 (environment check before any LAN test): this decision covers manual use of the app only.
|
||||
**Apply**: every later trial session starts the app on 192.168.1.100 unless owner says otherwise; same for `pnpm dev` (already LAN by scripts/dev-env.sh).
|
||||
|
||||
## BDR-112 — db:trial owner grant needs one verified TOTP factor (narrows BDR-083 to non-trial stacks) (2026-11-11)
|
||||
**Decision** (owner 2026-11-11 « Modification de la règle MFA »): db:trial stack only, one verified TOTP factor suffices for owner grant, as for admin and practitioner; second factor optional backup.
|
||||
**Narrows** BDR-083 Shape "first owner: enrol 2 factors first, role assigned last by operator" → db:trial carve-out only. Every other stack (production included), V1-2 §5.6/§5.7.1/§5.7.7 procedure text, IDENTITY.md recommendation: unchanged until distinct study + owner authorisation.
|
||||
**Kept**: verified TOTP before owner/admin (count before typed confirmation + recount `>= :need` inside grant tx, `\gset` zero rows → rollback); catalogue rights need has_verified_totp (+ admin for editor/publisher); aal2 in RPCs/policies; SQL untouched; no bypass.
|
||||
**Where**: scripts/db-trial.sh grant_platform_role `local need=1` (owner branch need=2 dropped), harness 375/0 (0 factors refused, 1 granted, 2 granted, tx recount 0 refused); SUPABASE.md §5.2; V1-2 §5.7.1 step 2 dated note + §5.6 pointer. Commit 45d7453; contract .claude/tasks/contracts/2026-11-11-trial-owner-one-factor-2050.md; verifier CONFORME 7/7, security PASS, 3-lens challenge folded.
|
||||
**Alternatives**: keep 2 for owner (rejected by owner: trial friction); change SQL/production rule (forbidden without study).
|
||||
**Trade-off**: one-factor owner losing device → no second path; recovery = V1-2 §5.7.7 by hand at trial db, or new account via `grant` (SUPABASE.md §5.2).
|
||||
|
||||
## BDR-113 — R1 editor deselection paths and Escape priority (D6b press-based rule; editor only) (2026-11-12)
|
||||
- **Status**: accepted (owner 2026-11-12; R1 editor only; manual db:trial check pending)
|
||||
**Decision** (owner GO 2026-11-12 « GO R1 COMPLET + D6b », gates G1/G2): R1 sheet editor only: deselect paths = « Désélectionner » button, Escape, empty press on drawing (D6b). Scope: editor AnnotationCanvas + its read-only twin (CatalogueCanvas `onEmpty`, editor-only). NOT a general rule for other components; catalogue reader (SheetRoute) unchanged (BDR-099 item 5).
|
||||
**D6b rule**: verdict from the PRESS (`src/catalogue/useEmptyTap.ts`): pointerdown target without `[data-anno-id]`, primary, button 0, no second pointer anywhere (document capture listener), no contextmenu, accumulated move ≤ 4 px. Mouse → act at pointerup, swallow next click. Touch + pen → act in tap's own click, only if click target has no `[data-anno-id]` (pen = controller ruling after code review; cost: rare second tap after field blur-rebuild).
|
||||
**Escape order** (A5, validated, must hold): dialog > « Plus » menu > references panel > tracing > selection. Text field keeps Escape. Only SHOWN annotation body acts (`usePlaceVisible`), via document keydown listener while selection resolved, no tracing, no references open, no `dialog[open]`; target body or inside `[data-editor-workspace]`.
|
||||
**Focus** (G1, owner): button → A6 (row else drawing box); Escape from properties panel → A6; Escape elsewhere and drawing press → focus stays / canvas box. Announcement « Aucune annotation sélectionnée. ». G2: « Supprimer » style unchanged.
|
||||
**Alternatives rejected**: decide from click target (pointer capture retargets click of selected marker press; blur-commit rebuild drops click); deselect at pointerup for all pointers (touch click lands on shifted layout); Escape registry in workspace (hidden kept body cannot hold focus → per-body listener simpler).
|
||||
**Refs**: contract .claude/tasks/contracts/2026-11-12-r1-history-deselect-1141.md; plan rev 3 .claude/tasks/plans/2026-11-12-r1-history-deselect-1141.md; commits 7dda61d, bbb1668, bbdfd27, a1ee194, 132756e, 6ed90ef; docs V1-2-6_U1_CORRECTIONS.md R1 « Behaviour and limits », ANNOTATION-RENDERING.md D6b. Supersedes D6 line « empty-canvas click left to U2 » (BDR-107).
|
||||
**Validation**: technical (verifier 15/15, security PASS x2, code review fixes landed, e2e:shell 197/4/99 = baseline fails only); owner manual check on db:trial PENDING.
|
||||
- **Status (2026-11-12)**: accepted; R1 validated functionally by owner 2026-11-12 (10/10 manual db:trial + 927537b visual check)
|
||||
|
||||
## BDR-114 — R2 Références tab: display sort/search in TS, provisional EN labels, anomaly B fixed apart, GO after R1 visual confirmation (2026-11-12)
|
||||
- **Status**: accepted (owner 2026-11-12)
|
||||
**Decision** (owner 2026-11-12 « Validation du plan R2 » + « Validation finale R1, correctif E2E et GO R2 »): R2 = Références tab (D1-D4, A1-A4, boards 23-27), sub-lots R2.0-R2.6, one commit + push per validated sub-lot.
|
||||
**A. Sort + search of references for display in TypeScript**: pure over reference ids; never mutate document, stored order, ids or undo/redo history. Exception to BDR-043 (Rust by default) written in `RUST_ARCHITECTURE_REVIEW.md` Part II. Why: display ordering only; locale collation via `Intl.Collator` (Rust equivalent needs ICU); `filter.ts`, `citations.ts` already TS.
|
||||
**B. EN labels of `docs/design/v1-2-6-r0/REVUE.md`** = provisional working basis, NOT ratified one by one; exhaustive FR/EN table of new/changed R2 labels with ambiguities flagged, app terminology kept, shown at R2 checkpoint before final validation.
|
||||
**C. Anomaly B** (admin.spec working-copy dialog on historical sheet, slot taken by sandbox suite copy 8c315a12) fixed apart, before R2, own commit: isolated fixture (`seedOfficialSheet`, real core fingerprint), suite archives only copies it created, no existing data changed or deleted, assertions not weakened. Fails or needs existing data → stop, R2 not started.
|
||||
**Gate lifted**: R1 visual confirmation of 927537b obtained 2026-11-12 (R1 validated functionally).
|
||||
**Constraints**: sandbox-only automated tests; no SQL migration, Rust/worker, roles, MFA, secrets, trial data, historical sheet or manual working copy change; no merge/deploy; R3/R4/U2/U2b not started.
|
||||
**Alternatives rejected**: sort/search in Rust core (no gain, ICU weight, no document impact); EN labels ratified en bloc (owner wants per-label check); set-aside/restore of existing copies like editor-equine (modifies existing data).
|
||||
**Refs**: `.claude/tasks/TODO.md` R2 block (a1d4084), `docs/development/V1-2-6_U1_CORRECTIONS.md` §R2, `docs/design/v1-2-6-r0/{ARBITRAGES,REVUE}.md`, BDR-110.
|
||||
|
||||
## BDR-115 — R2 Références tab: owner-validated choices and 2026-11-13 corrections, pending manual validation (2026-11-13)
|
||||
- **Status**: implemented, pending owner manual validation on db:trial
|
||||
**Context**: R2 « Références » tab (V1-2.6) built 2026-11-12 (52aac41), owner brief 2026-11-13 (reviewed with ChatGPT) validated functional choices WITHOUT final validation, asked corrections before db:trial trial. Status: R2 implemented + corrected, PENDING owner manual validation on db:trial; nothing merged, nothing deployed.
|
||||
**Decisions**:
|
||||
- Read-only flip (width < 1024) keeps citations panel open (not a close, criterion 15 amended). Refused draft never dropped silently: tile in edit pinned (editingKey) through flip whatever search/sort; drop said once in polite live region + visible note in tile; forced close names every refused field once; flip adds no history entry (C1 3303530, 1e19479).
|
||||
- « Annuler l'ajout » on draft tile + Escape (non-text target, or pristine text field; never during IME composition): document + undo/redo untouched, focus back to « Ajouter une référence » (C2 d177992, c8109af).
|
||||
- Pinned tile outside search shows « Ne correspond pas à la recherche » (aria-describedby); « Aucun résultat » only when no tile shown, add draft excluded (C3 b1fd896).
|
||||
- 667×375: trigger reachable by touch, proof only, no app code (C4 969a5f3..78fb2d0). Rotation-at-scroll-0 cramped exception kept, auto-scroll offered as option.
|
||||
- User leave with several refused fields focuses first refused field WITH its own error (final review I1, 94f8a8b).
|
||||
- Draft dropped with its tile (header « Défaire »/« Refaire » removes the reference in edit) announced once from the drop callback via surviving AnnounceContext; panel tiles silent during panel's own forced close (hostLeaving, relies on React 19 parent-first layout cleanup, guarded by forced-close count test) (verifier gap, cb1ad47).
|
||||
- New keys provisional EN: add_cancel fr « Annuler l'ajout » en « Cancel adding »; outside_search fr « Ne correspond pas à la recherche » en « Does not match the search ».
|
||||
**Stated limits** (owner to ratify): undo/redo replacing pending draft in still-mounted view overwrites typed text silently; two drops in one flip speak only last (visible notes remain); full page reload out of scope (recovery copy rules); rotation cramped exception; admin.spec red on accumulated sandbox (BLK-015).
|
||||
**Alternatives rejected**: close panel on read-only flip (loses context); drop slot in a store (StrictMode, scope) → tile-local; rotation auto-scroll (scope, offered); per-field error map in useEditCommand (every panel uses it).
|
||||
**Refs**: plan `.claude/tasks/plans/2026-11-12-r2-references-tab-1730.md` rev 5/5b, contract criteria 15, 21-29, `docs/development/V1-2-6_U1_CORRECTIONS.md` §R2, BDR-114, BLK-015.
|
||||
|
||||
## BDR-116 — R2 finish: editor dialogs, view state in browser history, filter by finding (2026-11-13)
|
||||
- **Status**: accepted
|
||||
Context: owner R2 trial 2026-11-13, UX finish of sheet editor (plan .claude/tasks/plans/2026-11-13-r2-ux-finish-1624.md R2F-1..9, gate approved).
|
||||
Decision: finding + reference add/edit/detail in D13 modal dialogs, transactional forms (one undo entry per changed save, BDR-050 amended for dialogs). Citations panel = modal side sheet over finding dialog (D2 kept: from finding only). Editor view layers (tab, section, dialog by element key, sheet, references filter by finding key) live in history.state via react-router navigate state (src/editor/history/{entry,useEditorHistory}.ts); never typed text, search, draft. Entry owned by sheetId+userId, foreign entry -> default view; reload drops forms; read-back allowlisted + length capped. « Tout afficher » filters by finding with removable chip (A3 amended). « Plus » = overlay dropdown, CloseWatcher closes it first (board 27 A amended). Sidebar sticky top-0 h-dvh. No new mockups: owner brief + gate = validation (docs/design/README.md addendum 2026-11-13). Clients/animals list searches NOT in history (BDR-078 stands).
|
||||
Alternatives: URL params (rejected: leaks into links, A2), data router + useBlocker (rejected BDR-078), inline forms (owner asked modals).
|
||||
Limits: delete replaces dialog entry (one dead Back); POP during pending Back can swallow a same-instant move; CloseWatcher stub-proved only; outside tap only closes « Plus »; multi-entry Back out of editor drops dirty dialog draft -> content-free sessionStorage flag, notice once on next mount (src/editor/leftDraft.ts).
|
||||
Status: built, awaiting owner trial on db:trial. Commits 553a0e5..021685f on feature/v1-2-anatomical-sheets.
|
||||
|
||||
## BDR-117 — R2 closure after owner trial 2026-11-14: edit-only citing, session tag, leave confirm, U2 orientation (2026-11-14)
|
||||
- **Status**: accepted
|
||||
Context: owner R2 trial 2026-11-14 validated main journeys; asked last fixes + U2 orientation.
|
||||
Decision: (1) citing/removing references only in finding edit form, part of transactional save (one undo); view = « Références citées » + « X références »; sheet read-only (no « Retirer de ce constat »); draft citations reach sibling sheet via zustand store citationDraft.ts (shortcut). (2) deletion pops dialog entry (first Back moves); first Défaire reveals restored finding (store `revealed`). (3) « Plus » pick focuses new tab panel. (4) history entries carry random 128-bit session tag, not account id; tag record in sessionStorage bound by FNV-1a fingerprint salted with tag (sync, works on http LAN); rotated on sign-out/mismatch. (5) multi-entry traversal leaving editor with dirty dialog: Navigation API navigate event preventDefault (cancelable same-document traverse, verified Chromium 156 incl. CDP history jump), cascade ask top-down, only layers a Back removes are asked; fallback no API/not cancelable = content-free left-draft flag + notice; sign-out with dirty dialog = salted flag, notice at same account's next sign-in.
|
||||
U2 orientation: properties in modal dialog, geometry direct on canvas; click without move opens dialog, drag never does; point size slider stays on canvas strip; boards 02-06, 13 redraw + owner validation before U2 code. U2 not started.
|
||||
Owner-accepted limits: same-instant move vs Back race, « Aller à » view mode, search kept across tabs, first outside tap closes « Plus » only. To confirm: CloseWatcher on real Android, cascade limit, browser matrix (Firefox/Safari unverified).
|
||||
Status: built afc1051..f8be0ad, awaiting owner final manual checks (OWNER_TRIAL §4.12).
|
||||
|
||||
## BDR-118 — References dialog replaces citations side sheet; one tab order (2026-11-15)
|
||||
- **Status**: accepted
|
||||
Owner 2026-11-15: finding dialog keeps only « Références citées » + « X références » (view and edit). Button opens references dialog (Dialog layer, native) stacked over finding dialog, replaces side sheet (board 25). View mode read only; own « Modifier » = draft of adds/removes on current reference_ids: cite existing, remove, « Nouvelle référence » (created then cited in draft), « Modifier la référence » (stacked reference dialog). One save = one update = one Défaire. Families too (isCitable). Guard layer `citations` between finding and reference; LAYERS_TOP_DOWN derived from LAYERS. `{create}` over citations never read back from history. Tabs: one order everywhere; phone shows Général + Annotations, « Plus » vertical list with Vérification error count. Rejected: citations in finding edit form (Rev 4, owner reversed). Status: built b41c24b..ebd1d6d, awaiting owner db:trial check.
|
||||
- **Status (2026-11-15)**: shipped: validated by owner db:trial 2026-11-15, R2 closed
|
||||
|
||||
## BDR-119 — Citations draft owns creations and explicit cite (2026-11-15)
|
||||
- **Status**: implemented, awaiting owner db:trial
|
||||
Owner pre-closure brief 2026-11-15. Reference created from references dialog edit mode held in draft (created[]), written with citations by one commitBatch (inserts + update = one undo); abandon leaves library unchanged. Dry-run applyEdit validates at draft submit. Select only browses, « Citer » button cites; save with pending choice refused. Family labels via isFamilyKey (finding key path len 1), 18 _family keys. Shared Dialog close 44px.
|
||||
Alternatives: write-now + delete on abandon (two undo steps, rejected); fold existing-reference edits into draft (offered to owner, not done).
|
||||
- **Status (2026-11-15)**: shipped: validated by owner db:trial 2026-11-15, R2 closed; both offered choices ratified as built
|
||||
|
||||
## BDR-120 — R3 sheet list + admin home closed by owner, phone filters panel (2026-11-16)
|
||||
- **Status**: accepted
|
||||
**Decision:** R3 closed 2026-11-16 by owner after db:trial trial. Sheet list: search fr/en, sort by true last_modified_at (M9 `private.official_sheet_admin_summary`) or name, count line, Paris date, « indisponible » when date missing/unreadable (never fallback date). Home card: latest five + « Voir les {n} fiches ». Phone (<640 px): four filters in CSS-only collapsible panel (grid-rows 0fr→1fr, `visibility:hidden` closed, « Filtres (n) »), reset only inside panel (owner confirmed, no other button). Filter-only empty line not a live region: count line announces once.
|
||||
**Rationale:** owner trial passed; desktop layout unchanged; no JS viewport detection; closed panel height 0 asserted at 375 px.
|
||||
**Alternatives:** reset button outside panel (rejected by owner); `inert` on panel (would disable desktop grid); motion lib (CSS enough).
|
||||
**Open, separate:** BLK-015, RR-13 (admin lists paging, server search), pgTAP 014/021 on accumulated sandbox, D5 keep list state on back. No merge, no deploy, DEV unchanged.
|
||||
|
||||
## BDR-121 — R4 catalogue card integrity closed by owner, test sheets archived (2026-11-17) (2026-11-17)
|
||||
- **Status**: accepted
|
||||
**Decision:** R4 closed 2026-11-17 by owner after manual trial on `pnpm db:sandbox trial` (§4.16, account praticien@trial.local, catalog_reader only). Catalogue card says its own failure: integrity class (fingerprint, drawing hash, drawing missing, invalid document) → A10 line error tone, no retry; caps → own existing text, no retry (D1 alternative); other kinds → existing text warning tone + per-card « Réessayer »; view not drawable → neutral line (D2). « Consulter » always kept, check never bypassed, sheet page unchanged. Owner rulings at closure: e2e test sheets archived (not deleted) via `private.set_sheet_status` by captured id + name read-back; rules on sheets with published version unchanged (`delete_anatomical_sheet` still refuses); out-of-scope `Card.tsx` (`aria-busy`) and `e2e/support/records.ts` (`capturedId`) accepted.
|
||||
**Rationale:** owner trial pass; soft delete of a published-history sheet = state no screen reaches, archive reachable + inside owner's authorisation.
|
||||
**Alternatives:** soft delete (rejected, breaks §6.9); one engine retry for all cards (R-7, per-card kept); live region per card (burst at load, rejected).
|
||||
**Open, separate:** BLK-015, RR-13, anomaly A (4 « Cheval sandbox » fingerprint_mismatch). No merge, no deploy, DEV unchanged.
|
||||
|
||||
## BDR-122 — U2 design boards and A1-A15 validated by owner, three adjustments (2026-11-17) (2026-11-17)
|
||||
- **Status**: accepted
|
||||
**Decision:** U2 design validated by owner 2026-11-17 after external graphic review (ChatGPT): nine boards `docs/design/v1-2-6-u2/` + A1-A15 as recommended. Deviations from 2026-11-14 orientation accepted: A1 first click/Enter selects only, second click, double-click or « Propriétés » opens dialog, creation dialog opens itself after placement/trace close; A2 dialog over right column, never over drawing; A3 overview column stays. Three adjustments at implementation, boards not redrawn: A13 discreet contextual two-finger pan hint on tablet; A14 message line never moves/resizes drawing; board 33 validation messages name only fields actually missing.
|
||||
**Rationale:** selection without dialog keeps successive shape corrections cheap; skeleton stays visible; list stays keyboard path.
|
||||
**Alternatives:** orientation rules 1 and 6 literal (dialog per click), dialog over drawing, column removed (rejected by owner choice).
|
||||
**Next:** U2 technical plan + challengers, owner gate before code. No merge, DEV unchanged.
|
||||
|
||||
## BDR-123 — U2 plan validated: D1 repair coords until U5, D2 zoom hint, mode guard when started (2026-11-17) (2026-11-17)
|
||||
- **Status**: accepted
|
||||
**Decision:** U2 plan rev 2 validated by owner 2026-11-17, implementation authorised (plan rev 3, contract `2026-11-17-v1-2-6-u2-implementation.md`). D1: RepairDialog keeps coordinate fields until U5; A8 = normal annotation journey only. D2: « + » hidden on segments too short at current zoom, zoom reveals; while selected zone has hidden « + », strip shows discreet « Zoomez pour ajouter un sommet sur les segments courts. » (R-18). R-12 corrected: move mode / redraw end at once on navigation when nothing started; ask (« Abandonner le déplacement ? » / « … nouveau tracé ? ») once position changed or vertex placed; « Annuler », Escape = explicit, immediate. No silent loss: read-only flip suspends started mode; document change elsewhere dropping it is announced. Confirmed: veil ignores clicks, double-click opens, strip/messages no shift, read-only keeps properties readable, touch/loupe/gestures; A13, A14, board 33 as integrated.
|
||||
**Rationale:** precision without accidental insert; no silent loss of started work.
|
||||
**Alternatives:** RepairDialog redone in U2 (rejected: rare, redesign of decision 7); all « + » always shown (rejected: mis-tap inserts); silent cancel of modes (corrected by owner).
|
||||
**Next:** execute plan Tasks 1-10; owner trial on `pnpm db:trial` before U2 closure. No merge, DEV unchanged.
|
||||
@@ -296,3 +296,6 @@ Method: access layer by fork (unit 35, real PostgREST sandbox 7); screens unit t
|
||||
Result: security PASS (MEDIUM pre-existing sandbox literal pw; LOW trace override by argv). Verifier 1 ECARTS: client journey failed after passing (late replay of the animal-section reload added by V1-1.6) → dropLateReplays for every shell spec. Verifier 2 ECARTS: pgTAP 014 #237 regex `20[0-9]{2}-` matched a workspace uuid on long-lived sandbox (latent V1-1.4 false positive; would stop DEV db:test) → metadata minus workspace_id. Verifier 3 CONFORME 12/12.
|
||||
Anomalies: Card dropped aria-labelledby since Step 7 (TS ignores hyphenated props; LRN-087); useT unstable in deps (LRN-088); en substring matches (Male/Female, Save/saved) → exact; safety check refused rm inside sh -c (not bypassed; dump left for owner).
|
||||
Action: run the whole shell suite (not just the new spec) before the verifier; scope pgTAP regexes away from uuids; never chain rm into sh -c.
|
||||
|
||||
## EVAL-042 — Gate chain substituted test:run for db:sandbox test (2026-11-04)
|
||||
V1-2.6 Lot M gate chain ran `pnpm test:run` as third step instead of contract's `pnpm db:sandbox test` (sandbox suites on same fresh stack after e2e:shell, LRN-113). Two chains reported green with wrong step; §16.7 doc carried wrong order. Method: fresh verifier against contract C22 read packages/supabase/vitest.sandbox.config.ts and caught it. Anomaly: orchestrator's own gate script, not a subagent. Action: re-ran exact order on 697cefa and 7a4ce9e (sandbox test 105 passed / 10 skipped); doc fixed. Lesson: copy gate commands verbatim from contract/LRN, never paraphrase a step name.
|
||||
@@ -456,3 +456,125 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
|
||||
- Owner recette: 19 lines FR detailed, EN global + 4 at 375 px, isolation ok. RESP-01 global scroll = owner browser zoom (owner DEV measures). Real defect found on sandbox: long account e-mail widens dashboard cards (implicit grid track). Fix DashboardRoute + `e2e/shell/responsive.spec.ts` (fails on old code). LRN-094.
|
||||
- AVATAR-01 = class A: DEV worker stopped, row `uploaded` waits, message by design (STORAGE §4.4). Sandbox repro with temp gateway + worker on sandbox net: clean in 1.1 s. Side finding (pre-V1-1): full reload doesn't resume the waiting row, new save supersedes it. DEV read-only only.
|
||||
- Owner closure 2026-10-27: RESP-01 counter-check 6 PASS → closed; AVATAR-01 class A non-blocking, DEV worker stays off, Alice's waiting upload kept; AVATAR-02 ticket in TODO (no Gitea CLI). Pre-merge checkpoint, no merge.
|
||||
|
||||
## 2026-10-27 (V1-2 audit + V1-2.0 contract, branch feature/v1-2-anatomical-sheets)
|
||||
- Read-only V1-2 audit delivered (git, model, Supabase, DEV read-only, equine state); owner approved D1-D8 + added D9 (in-app admin of official sheets, any species).
|
||||
- V1-2.0: branch off develop 9135d73 in scratchpad worktree (recette server on main tree). Contract drafted (§1 facts, §5 capabilities, §6 review + publish gate, §8 editor levels, §9 worker-verified SVG, §12 defects F1-F12 confirmed by reading only, §16 steps, §17 O1-O20); 3 challengers (2 FATAL, 1 CONCERNS) integrated, contract rewritten (§19). Equine count fixed: 839 elements, 620 inherited (audit said 611 = findings only).
|
||||
- Doc fixes: V1-1 status TODO + contract header, CLAUDE.md M1-M3 line. Open: V1-1 CHANGELOG « Added » entry missing. STOP at V1-2.0 checkpoint.
|
||||
|
||||
## 2026-10-28 (V1-2.0 O1-O20 review, O1-O23 ratified, contract consolidated)
|
||||
- Read-only review of O1-O20 delivered; proposed O21-O23. Found own contract contradiction §14 vs §6.4 (legacy base) + `inherited`-edit hole. Owner ratified O1-O23 (BDR-082).
|
||||
- Contract rewritten: rights M4, catalogue access fail-closed, MFA + operator recovery, group acknowledgments, worker verdict states, species inactive, equine working copy, SQL mirror removal, steps §16 with 9 headings.
|
||||
- 3 fresh challengers: business CONCERNS, security FATAL (AR-1: aal1 owner grants owner role → bypasses catalogue MFA; O4-D unratified → owner arbitration), simplicity CONCERNS. All other findings integrated (omitted status = inherited, F12 unconditional, F15/F16, reader row predicate, uploads to M5, PreviewSheet editor handle, removal groups).
|
||||
- Docs only, committed + pushed on feature/v1-2-anatomical-sheets. STOP: verdict BLOCKED on AR-1.
|
||||
|
||||
## 2026-10-28 (V1-2.0 AR-1 B ratified, contract updated)
|
||||
- Owner ratified AR-1 B (BDR-083). Contract §5.7 written: rule, chain, path inventory (2 RPCs, 2 private fns, service_role table grants F17, owner-count race F18), bootstrap, factor/password/recovery, session rules, deploy order (enrol before M4 on DEV), tests §15.
|
||||
- GoTrue v2.197.0 source read: enrol needs aal2 once verified factor, unenroll verified needs aal2. auth.sessions check kept as to-verify.
|
||||
- Docs only. Independent security review, then commit + push feature branch. STOP at checkpoint.
|
||||
|
||||
## 2026-10-28
|
||||
- V1-2.1 M4/M5 built+tested on sandbox (DEV untouched): M4 20261028100000 sheet_access_hardening (rights table + RPCs, has_mfa/has_aal2_session, catalogue reader predicate, can_edit_sheet on capability, AR-1 B role RPCs + F17/F18/F19, F1-F16), M5 20261028110000 sheet_review_workflow (version/sheet cols, freeze/revision/author triggers, rounds/comments/acks, lifecycle+review+publish RPCs, species, working copy, uploads+INSERT policy, mirror removed + status check). Defects F1-F19 reproduced on old schema; pgTAP 001/003/004/005/006/007/010/015/016 green (850 real-stack, 122 PGlite); sandbox real-GoTrue AR-1 B + F18 race green; fresh install + M3->M5 upgrade green; sheets.ts closed kinds, client gate deleted, types regen no drift; rust:check + typecheck + lint + build green. 011 + SQL-mirror generator deleted, ledger retargeted. BDR + LRN-095. check:all Docker image/worker stages not re-run (no app/worker/Dockerfile change). STOP at checkpoint.
|
||||
- V1-2.1 fresh security+verifier gates run on commit 77e5fa4: security PASS (no blocker; lease-token whole-row grant narrowed to omit attempts/lease_token/locked_at). Verifier ECARTS(10) → fixed the real gaps: publish re-checks the approver's reviewer grant (publish.approval.invalid), scope disclaimer enforced at approve+publish (publish.disclaimer.missing, O6), to_confirm split from inherited (publish.to_confirm.open), save requires an active sheet, delete_sheet_asset revoked from service_role, species table comment updated, working-copy 2 MiB check, lock order sheet→version→round in decide/publish, conflict_retry kind (40001/40P01) in sheets.ts. Tests added (pgTAP 016 now 50, 001 census no-other-writer): omitted review_status, separation author-reviewer, revoked-reviewer approval + renewal, ack carry, inactive-species publish refusal, deprecated-delete, schema_version 1 refused, content-write-without-actor, working-copy positive. 871 real-stack pgTAP / 122 PGlite / 4 sandbox green; typecheck+lint+types drift clean. Deferred (noted): at-caps timing (V1-2.2 doc), fuller MFA factor mgmt (V1-2.5), low residuals (existence oracle, write-budget on some admin RPCs).
|
||||
- V1-2.1 corrections after audit (3914eaa CHANGES REQUIRED): M1 approve needs active sheet, M2 base only from published round version, LOW fixes (rights.mfa first, closed codes, budgets, view.asset.unknown at submit, upload policy = registrant, append-only acks, deprecate/working-copy locks). Found+fixed: published round withdrawable, approver-author not refused at publish. Found: jsonb pg_column_size > text size (CHECK binds before contract measure) → closed code; owner decision. pgTAP 1325 fresh+upgraded, sandbox 86/86 x2 both stacks, caps timing max 374 ms, M7 rehearsal object+metadata identical, check:all green. Commits d05f75d..4a82941 pushed. M6 + M7 criterion + size measure → owner. Fresh verifier + security gates dispatched.
|
||||
- V1-2.1 final owner decisions (2af61e7): M6 A grant.self_review dropped, size = octet_length(content::text) (table CHECK replaced in M5), M7 Git fixture wording in contract + evidence. pgTAP 1352 fresh+upgraded, sandbox 86/86 x2 both stacks (concurrency 16/16), caps text 2 076 707 / jsonb 2 346 648 accepted, PGlite 127. DEV metadata identical. BDR-085.
|
||||
- V1-2.1 review pass on 1281667: verifier ECARTS(6) (missing proofs: AR-1 B matrix, non-owner rights RPCs, publish.species.other; LOW docs), security PASS + MEDIUM number-exponent OOM (9000 x 1e131071 = 1 GiB text, raw OOM). Fixed 3eba6d8: bounded number walk before text measure; pgTAP 020 (449). Re-run 5620399: pgTAP 1807 x2 both stacks, suite 86/86 x2 both. Correction: earlier 'DEV metadata identical' = DEV container state only (ids, start times), no DEV data read.
|
||||
- V1-2.1 second reviews on 7c4bf12: security BLOCK HIGH = my number walk quadratic (jsonb_path_query per row, PG17 list_delete_first; 200k numbers 2.2 s native, ~26 s near cap). Fixed 538d103: jsonb_path_query_array + jsonb_array_elements (linear, 600k 0.4 s). Verifier ECARTS(1) LOW: red-on-old raw log now committed (.out). Rerun 2379d28: pgTAP 1808, suite 87/87 x2 both stacks.
|
||||
- V1-2.1 final: code 2379d28 (= HEAD code), check:all green on 532c61e, security PASS (1f9fa8b), verifier CONFORME on doc deltas after ECARTS(3) LOW fixed. Declared VERIFIED pending owner. Open V1-2.3: e2e:avatar DEV target, quadratic status walks, ingress cap, schema_version 2.0 raw 22P02. DEV containers untouched. STOP at checkpoint.
|
||||
|
||||
## 2026-10-29
|
||||
- 2026-10-29 V1-2.2 core built (size, review groups, verdict, PreviewSheet, sheet.edit, clean_svg); owner answers before code (exports by owner, integrity.document, draft load). Verifier ECARTS 6 then 3, security PASS x2, fixes ca31b78; check:all green. DEV untouched. STOP: READY FOR REVIEW.
|
||||
- V1-2.2 owner arbitrations on 17d9199: dangling SVG refs refused, canvas ids scoped per view, stored form required, strict rgb kept, remove refused while named, Inkscape 1.4.3 exports, wasm name section dropped. Security BLOCK(1) url(#%61) fixed a678faa, PASS. check:all green f1ef6a4. Open: A6 owner exports, per-document prefix. Not VERIFIED.
|
||||
|
||||
## 2026-10-30
|
||||
- V1-2.2 owner decisions on 05de816: BDR-087 canonical stored SVG, LRN-099→LRN-100 strict reference grammar. Final review (Opus, Fable out of credits): verifier ECARTS(3) = A6 open, B9 LOW f1ef6a4 glued url( reader/composer mismatch fail-closed, FLOOR prose FP; security PASS (MEDIUM per-document prefix, 5 LOW). 05de816 = f1ef6a4 code. A6 not met. No fix, STOP at checkpoint.
|
||||
- V1-2.2 finalisation 2026-10-30: Figma default Clean, ids Cleanable (g@id), pixel-identical after maskUnits/maskContentUnits/clipPathUnits allowed (BDR-088). Glued url( removed in every attribute (urls_unglued), LRN-101. check:all green 7d9ab8c. Verifier ECARTS(2): A6 Illustrator, doc drift fixed. Security PASS, pre-existing MEDIUM PDF halo id osteo-halo for owner. Not VERIFIED. STOP.
|
||||
- V1-2.2 K reserved ids 2026-10-30: drawing filter#osteo-halo erased PDF marker (0 px Chromium), g#osteo-halo before defs lost halo. Reader refuses reserved_id (exact set, ASCII case), both composers fail-closed, halo always engine's. 08efd9a. check:all green, mutations 11/11, verifier ECARTS(1) LOW leaked id expansion fixed, security PASS + pre-existing MEDIUM root visibility hides markers (owner). A6 open: Illustrator.
|
||||
- V1-2.2 L 2026-10-30: A6 final = Figma, Inkscape, cairo, ImageMagick; Illustrator/Affinity optional (BDR-090, BDR-088 amended). Root visibility≠visible refused (root_visibility) reader+cleaning+composers, red-first, 3 browsers, mutations 20/20, check:all green. BDR-089, LRN-102. Security PASS but 3 pre-existing MEDIUM marker-hiding vectors open (root viewBox frame, inherited stroke-opacity/dasharray, hitbox stroke-width click hijack): class fix changes R3/R4 oracles, owner decision.
|
||||
|
||||
## 2026-10-31
|
||||
- V1-2.2 three MEDIUM: lot A frame rule committed 0c87c7f..9e49ed1 (check:all green faa53c7); lot B isolation+hitbox built, uncommitted, patch in audits, R3 oracles pass under declared transforms, R4.1 manifest digest fails. Security PASS + MEDIUM scale bypass, verifier ECARTS(2) fixed. Junction-point overlap found. STOP: owner authorisation.
|
||||
|
||||
## 2026-11-01
|
||||
- V1-2.2 N (owner 2026-11-01): lot B committed 4f52f5e, R4.1 call-1 svgSha256 e677150, visible wins canvas-only 9c606aa, marker_too_small 4 px @320x568 + frame range 96b9978, path numbers ±2^20 76ead95. check:all + e2e:shell green on 76ead95, 56 mutants killed, 1 equivalent. Open: zone without interior (MEDIUM, owner). STOP at checkpoint.
|
||||
- 2026-11-01 V1-2.2 last MEDIUM: interior rule (4 px disc, nonzero, stroke out) 8dd2d78 + review fixes 03be75b (sub-f32 arc radius). Equine kept (caudal 4.95 px). Chromium touch adjustment measured. LRN-105..107. Checkpoint pending owner.
|
||||
- V1-2.2 closed VERIFIED (BDR-092, LRN-108, mutations re-anchored, delta verifier CONFORME). V1-2.3 built on sandbox: M6 RPCs, worker verify child + sheet-verify mode, brk added to seccomp (traced), verify-e2e 7/7, rehearsals ok, check:all + e2e:shell green on 6aa85fe; security PASS. Open for owner: proposals (codes, limit 5, lease 10 min, caps, service name, shared brk), e2e:avatar targets DEV, no backoff LOW. DEV untouched, no merge.
|
||||
- 2026-11-01 V1-2.3 reserves: avatar-e2e on sandbox 5/5, retry delay 2/5/10/20 s in SQL, caps proofs child + sandbox, brk bounded, per-run sandbox passwords, LRN-109; security PASS (null lease token MEDIUM fixed); verifier ECARTS(2) → CONFORME. Checkpoint, no merge, no DEV.
|
||||
- 2026-11-01 V1-2.3 closure: retry by cause (resource_limit, verdict_refused definitive; timeout, unavailable incl. external SIGKILL transient), e2e:avatar = sandbox alias (DEV script removed, suite refuses other targets and issuers), per-session seed secret, floor reductions recorded, V1-2.4 scope prepared. Review PASS; verifier ECARTS(1) → CONFORME. Checkpoint, no merge, no DEV.
|
||||
|
||||
## 2026-11-02
|
||||
- 2026-11-02 V1-2.3 closed (BDR-093, risk register §13.1), e2e:sheet-assets sandbox alias, V1-2.4 maquettes proposal. TWO DEV READ INCIDENTS: old DEV sheet-assets script ran from main checkout at 23:03:49 (executor, backgrounded cd) and 23:10:59 UTC (orchestrator, unquoted heredoc backticks); 13 GET each, no write, DEV not restarted. Stopped, reported to owner.
|
||||
- 2026-11-02 incident containment: bugfix sheet-assets guard merged into develop 6287e5b (always refuses there), refusals proven without IP sockets, security PASS; incident report reconciled (13 GET each); LRN-110 supersedes LRN-102. V1-2.4 maquettes: design review applied, security PASS on V1-2 runner, verifier ECARTS(1) (§13.1 register in the maquettes commit, owner-ordered). Graphic checkpoint.
|
||||
- 2026-11-02 V1-2.4 G1/G2 fixed on owner brief: phantom warning board 06 removed, « Mark as reviewed » to arbitrate, fingerprint + verdict_refused messages match code; only 06/12 re-rendered, contact sheet + REVUE.md; fresh verifier CONFORME; 98e8403 pushed. Graphic checkpoint, no approval.
|
||||
- 2026-11-02 V1-2.4 owner: UX decisions 2-11 ratified, item 3 = hidden catalogue entry + « Accès non autorisé » page, reviewer-only keeps limited Administration (asked: point 4 conflicted with boards 07/09/10), §6.5 alert divergence recorded. BDR-094. Boards unchanged; visual validation + 32 labels open.
|
||||
- 2026-11-02 V1-2.4 final graphic corrections (owner brief after external review): 01 sheet-name search only (UX item 4 withdrawn; no repo trace of earlier 'no zone search'), 06 distinct failed/unavailable titles, 03 whole horse at opening, 05 1 024 px not device, 04 vertex wording, complement « Accès non autorisé » board. 9adbd3a, f9fc13c. Verifier ECARTS(1) = zip not built yet; built after. Labels open. Checkpoint, no approval.
|
||||
- 2026-11-02 V1-2.4 owner arbitrations: BDR-095 (sheet-name search replaces BDR-094 zone item, distinct failed/unavailable titles, V1-2.7 lists on failure_outcome), board 05 whole horse at 768 px, 24 common labels + owner arbitrations ratified, object_conflict kept open (meaning = hash mismatch). Verifier ECARTS(2) → ECARTS(1) → CONFORME 21/21 incl. archive -3.zip. No global graphic approval.
|
||||
- 2026-11-02 V1-2.4 GRAPHICAL APPROVED by owner (BDR-096): 12 boards + « Accès non autorisé » page, no board regenerated; object_conflict FR, L20 EN, L32 EN ratified, L14 confirmed; L15 2nd sentence + code messages open, checked at integration. Recorded contract §16.5/§17.9, maquettes contract, REVUE.md, design README, TODO. Next: V1-2.5 prerequisites.
|
||||
- 2026-11-02 V1-2.5 built + tested on sandbox (A-K): MFA proofs 10/10 no STOP, M7 admin reads + deprecated fingerprint (BDR-097/098), access layer, shell/step-up/MFA UI, admin, catalogue, e2e A0 A1 S1 P1. pgTAP 1941, unit 66/148/655, e2e:shell 108+6 skip, check:all green. Security PASS; verifier ECARTS(7)->ECARTS(1)->ECARTS(1)->CONFORME. Phone e2e flake root-caused (inert closing drawer). DEV untouched, no merge. Checkpoint.
|
||||
|
||||
## 2026-11-03
|
||||
- 2026-11-03 V1-2.5 owner checkpoint corrections (f5456f3): three permission states (creation page order loading, server refusal, failed read, editor rule; admin home notice; reloadAccess keeps held roles), Paris end-of-day expiry, species order 0..9999 in M7, labels, TOTP reuse measured (code accepted by several sessions in step N and N+1, refused N+2), lost-factor review = production prerequisite. 2 state-dependent sandbox tests fixed. Gates green on fresh stack, security PASS, verifier CONFORME. V1-2.5 VERIFIED. No DEV, no merge.
|
||||
- 2026-11-03 owner accepted V1-2.5 final checkpoint b4415a3 (V1-2.5 VERIFIED): BDR-099 decisions, LRN-113 TOTP reuse/Storage 409/sandbox order. V1-2.6 editor level 1 authorised (brief « Validation V1-2.5 et autorisation V1-2.6 »).
|
||||
- 2026-11-03 V1-2.6 owner GO conditional on six FATAL re-check. Fresh verifier: REMAINING(2): fixes 1-5 closed, I1-I5 hold; radius fix 6 opens out_of_frame on small frames; I6 broken (pending recovery copy overwritten by first commit). 2 MINOR. LRN-095 collision + BLK-013 trap in TODO. Executor not launched, STOP.
|
||||
- 2026-11-03 V1-2.6 owner arbitrations on REMAINING(2) integrated (C25-C31, AAL2 risk V1-2 §13 + RR-12, RR-11 collision noted). Second fresh re-check REMAINING(1): F1 accept trusted core silence on unmeasured views (no drawing / no usable frame); 7 MINOR. All integrated in plan; C26 refinement for inherited out-of-frame edits awaits owner. Executor not launched, STOP.
|
||||
|
||||
## 2026-11-04
|
||||
- V1-2.6 owner GO after REMAINING(1): F1 approved, C26 refined (7 repair rules: commit only when changed annotation error-free after; form group applied whole; frame change never invalidates silently), C32-C34 gated. Execution lots A-M starts.
|
||||
- V1-2.6: scratchpad worktree removed by harness cleanup 13:08 (LRN-114); lots A-F + G committed safe at 8343528; uncommitted H + G fix lost. Worktree recreated at /home/bchanot/Documents/faunosteo-v1-2 (prune of 5 missing entries only). Tracked execution ledger added.
|
||||
- V1-2.6 lots A-M done on feature/v1-2-anatomical-sheets, HEAD 7a4ce9e. Fresh sandbox contract order green (1992 / e2e 148+46 skip / sandbox 105), check:all green, security PASS, verifier 33/34 then order fixed. Stop at owner checkpoint; R12 state files, m3, sign-out copy, labels pending owner.
|
||||
- V1-2.6 owner checkpoint decisions applied (lot N: C35-C44), code 5e0aa62. Fresh sandbox contract order green (1992 / e2e 150+48 skip / sandbox 105), check:all green, security PASS, fresh verifiers: all criteria met except checkpoint-report parts. Guide run from durable worktree. Stop: ready for owner trial.
|
||||
- V1-2.6 lot O: free paths never reshaped (core proposal written, not built), explicit category zone, owner trial on LAN 192.168.1.100:5193 behind a Host filter (no CORS, no ws, upgrades closed). Fresh verifier final pass CONFORME 0 NOT MET. Stop: ready for owner trial.
|
||||
|
||||
## 2026-11-05
|
||||
- V1-2.6 new editor UX maquettes: 16 boards docs/design/v1-2-6 (desktop, tablet, phone), REVUE.md, core feasibility audit. Missing core: annotations_in_rect, path point edit/translate, remap on drawing swap; schema change for fixed categories + opacity. Reopens §8.3, O14 A, §8.2, §7.4. Design review + verifier gaps fixed. No code, no DEV. Stop at graphic checkpoint.
|
||||
- V1-2.6 maquettes owner review prep: fresh verifier CONFORME 11/11 on 9f420d3, 5 defects outside criteria kept (no redraw; wrong category counts boards 07/09). ARBITRAGES.md, ETUDE-TECHNIQUE.md (route A: optional role + integer fill_opacity in schema v2, stripped from PDF snapshot), archive ~/faunosteo-v1-2-6-ux-maquettes.zip, SHA256SUMS verified on extraction. No code, no DEV. Stop.
|
||||
- V1-2.6 maquettes final corrections after external ChatGPT review: board 04 trace strip, undo/redo in header tab bar all tabs (owner-confirmed choice 2), board 07 one state per interaction, counters computed from draft data; 12/15 byte-identical. Targeted check ECARTS(2) on 7bc3d65 -> fixed b5058b3, delta K1-K8 8/8. ARBITRAGES: 1 confirmed, 10 open. Archive ~/faunosteo-v1-2-6-ux-maquettes-2.zip, SHA256SUMS 48 verified. No code, no DEV. Stop at final graphic checkpoint.
|
||||
- V1-2.6 UX technical prep: 5 static audits, plan U0-U9 + compat/tests/risks/decisions in docs/development (14fb527). Wasm margin 7 857 B by gate measure (not 17 KB). Category keys must be omitted when absent; view.unreachable blocks views without access; remap explicit (seed head drawing = crop viewBox). 3 challengers CONCERNS, fixes integrated. No code, no DEV. Stop at owner technical checkpoint.
|
||||
- V1-2.6 UX owner ratification recorded (BDR-100): T11, T16 cond. (curves lot), T2/T3 cond. (proofs COMPAT §8, one-way compat), T4 no gap (verdict rule, repairable edits, core gate, publication + save SQL checks to confirm, rules-epoch lock), T5 history, T9 two calls V=R keep, T10 cat-access to confirm, T12 text missing. LRN-118 wasm rule. Reviews fixed. Docs only, uncommitted. Stop at technical checkpoint.
|
||||
- V1-2.6 ratification docs committed: third independent check ECARTS(2) (R-3, U6 objective, write-lock test, T16 count scope) fixed, fresh re-check CONFORME 12/12. 7 observations deferred to U0 (RISKS:59-60 wording, COMPAT:146, contract §6.4). Docs only, no DEV.
|
||||
|
||||
## 2026-11-06
|
||||
- V1-2.6 U0 (docs only, BDR-101): V1-2 contract §6.2/§6.4 (draft rounds)/§6.7/§7.4/§8.2-8.4/§12.2 O22 (save + approval/publication fixed-category checks, not built)/§16.7/§16.12/§17.12; level-1 C3-C40 notes; design README v1-2-6 validated; rules sheet-model/schemas; 5 UX docs. T17, T12, T6, T14, T1 open. Verifier ECARTS(1) x2 fixed. No code, no DEV.
|
||||
- V1-2.6 U2b principle approved by owner (BDR-103): U2b after U2; F1/F2/F6/F8/F22 decided, F7 term, F3/F4 partial; study §7 table F1-F22 with alternatives + consequences, F2 groups open (730 vs 627 leaves), F3 fields, F4 facet model; LRN-119 Activity. U1 plan 2e46c14 untouched. Docs only, no DEV.
|
||||
- V1-2.6 owner final arbitrations (BDR-104): U2b F2 leaves, F3, F4 model A, F8, F22 decided; U1 design confirmed; no implicit sandbox deletion. U1 checkpoint page (18 choices, AC3/4/5/7/17 exact, 16 MAJOR traced, reset = down + up fresh, lot criteria). Docs only, sandbox untouched.
|
||||
|
||||
## 2026-11-09
|
||||
- V1-2.6 U1 implemented: lots A-I 9ec232a..da95b84, verifier 22/22, security PASS, final review fixes 0467885/da95b84 re-review clean. Shell at da95b84 188/90/4 (admin.spec:717 working-copy slot, sandbox state). Owner checkpoint decisions BDR-106: 5 files + 3 rewrites accepted, checkpoint open, RR-13 rights paging track. LRN-120-122. U2 not started.
|
||||
- 2026-11-09 U1 trial arbitrations: R0 boards 23-30 + corrections plan + trial stack plan; design review APPROVE WITH FIXES applied, verifier ECARTS(1) fixed; awaiting owner validation
|
||||
- 2026-11-09 R0 owner decisions recorded (BDR-108): A3/A6/A7 ratified, db:trial two accounts; ARBITRAGES.md, R3 SQL checkpoint proposal; counter-check closed both fixes, 2 minor label gaps fixed in REVUE; archive ~/faunosteo-v1-2-6-r0-maquettes.zip; impeccable detect not run (proposal: pinned 4.1.0 offline)
|
||||
- 2026-11-09 R0 graphic verdict applied (BDR-109): boards 23/24/26 fixed, 28/29 notes, 25/27/30 byte-identical; A1-A15 settled; impeccable 4.1.0 offline 2 observations kept; final counter-check ECARTS(1) file scope; stop at final R0 checkpoint
|
||||
- 2026-11-09 R0 closed: last corrections 24A/26/28, closing counter-check CONFORME, R0 graphically validated (BDR-110), archive rebuilt; stop before R1
|
||||
|
||||
## 2026-11-11
|
||||
- db:trial closure: code review + 2 fresh re-reviews fixed (d3bdbbe f2cbf68 953ae41). Strict absent match broke on real docker: inspect -f prints '\n' on stdout before stderr error; fresh re-review caught it, stub now splits streams. GATE 0 MET, harness 372/0, plan read-only: create would proceed. Stopped before create, owner go pending.
|
||||
- db:trial first create 2026-11-11 at 255dd67 (owner go): 6 containers, net, 2 volumes as planned, loopback ports only, DEV and sandbox unchanged, 17 migrations, equine draft equal. Interrupted at check 3: TR_PW in db container log, image migrate.sh ALTER USER logged during init. LRN-123..126 written. Owner decision pending.
|
||||
- db:trial TR_PW leak 2026-11-11: owner-ordered one-off rotation (5 roles, auth/storage/rest recreated, old pw refused, services ok, DEV/sandbox unchanged); fix 5f63d22 -c log_statement=none on server cmdline (harness 373/0, control 372/1, verifier CONFORME, security PASS); LRN-127. Real proof pending: create on fresh volume.
|
||||
- db:trial MFA rule 2026-11-11 (owner): owner grant with 1 verified TOTP on trial only (45d7453, harness 375/0, verifier CONFORME, security PASS), BDR-112 narrows BDR-083; production rule unchanged. App on LAN 192.168.1.100:5194 (BDR-111). Accounts owner@trial.local, praticien@trial.local created by owner, 1 verified factor each, no role yet.
|
||||
- db:trial equine drawing imported 2026-11-11 (owner go): pre-checks (gateway faunosteo_trial, key iss/signature, historical sheet, sha256/size vs assets.json/draft/row, bucket empty), R5.5 --check plan, `pnpm db:trial assets` 1/1 confirmed, object re-downloaded byte-identical, 2nd --check nothing to do, draft=document.json, seed=HEAD, no secret in logs, DEV/sandbox unchanged. App exposure 192.168.1.100:5194 noted (BDR-111); host Valheim argv password noted separately in TODO.
|
||||
|
||||
## 2026-11-12
|
||||
- 2026-11-12 R1 + D6b delivered on feature/v1-2-anatomical-sheets (owner GO): Défaire/Refaire, Désélectionner, Escape priority, empty press on drawing deselects (useEmptyTap, press-based; mouse at pointerup, touch+pen at own click). Plan challenged x2 (capture retarget, blur-rebuild click drop, touch click-through). Gates: unit 1381/180/66, e2e:ui 227, e2e:shell 197/4/99 (4 = admin.spec.ts:717 baseline). Verifier 15/15, security PASS x2, code review fixes landed. Stopped at R1 checkpoint; R2 not started.
|
||||
- 2026-11-12 R1 last owner feedback: « Sélection » tag above drawing made sr-only (927537b), drawing stable on select/deselect (desktop + 375 twin e2e); docs 00936c8 (board 04/26 deviation). BLK-013, LRN-131. Owner: R1 accepted technically, visual fix to confirm on db:trial; ToolNotes shift + SR selection announce + iOS open; RR-14 secrets rule added. R2 not started.
|
||||
- 2026-11-12 R1 VALIDATED functionally by owner (10/10 manual checks + 927537b visual confirmation). BDR-114 R2 decisions recorded. Next: anomaly B e2e fix (isolated fixture), then R2 GO.
|
||||
- 2026-11-12 Anomaly B fixed 2cdee42 (owner accepted): BLK-014, LRN-132. editor-equine set-aside risk + fixture accumulation tracked in TODO (separate fix). Owner GO R2.0-R2.6.
|
||||
|
||||
## 2026-11-13
|
||||
- R2 corrections 2026-11-13: C0 admin.spec diagnosis (A/B + dose-response, accumulation, BLK-015 open), C1-C5 + final review I1 + verifier gap fixed (3303530..538ce27), sweep 221p/5f admin.spec only, guard OK, verifier CONFORME; stopped at R2 checkpoint for db:trial trial.
|
||||
- 2026-11-13 R2 UX finish built (553a0e5..021685f): dialogs, history Back/Forward, filter chip, Plus overlay, sticky sidebar; final review fixes; gates green, shell sweep fails only admin.spec (BLK-015); awaiting owner db:trial trial
|
||||
|
||||
## 2026-11-14
|
||||
- 2026-11-14 R2 closed after owner trial: edit-only citing, delete undo reveal, Plus focus, session tag in history, Navigation API leave confirm + cascade, sign-out notice; U2 orientation recorded (BDR-117); final sweep only admin.spec (BLK-015); awaiting owner manual checks OWNER_TRIAL 4.12
|
||||
|
||||
## 2026-11-15
|
||||
- 2026-11-15 R2 owner follow-up built (Tasks 10-13 + fixes, b41c24b..ebd1d6d): references dialog with own edit mode, one tab order, vertical Plus. Gates 0, sweep 264 passed, fails = admin.spec BLK-015 + Target crashed (rerun green), GUARD OK. Waiting owner db:trial check.
|
||||
- R2 Rev 6 built: Citer button, draft-owned creation (commitBatch), family labels, 44px dialog close. Sweep final7 273 pass, 6 fail admin.spec BLK-015. Await owner db:trial then R2 closure.
|
||||
- R2 CLOSED 2026-11-15: owner db:trial 4.13+4.14 pass, validated functional+graphic; saved-ref edit own Défaire + unsaved new ref lost on abrupt close ratified. Sweep 52d5613 273p/163s/6f admin.spec BLK-015 open (RR-13). No merge/deploy. Next R3, R4; U2 orientation kept.
|
||||
|
||||
## 2026-11-16
|
||||
- R3 CLOSED 2026-11-16: owner db:trial trial pass, phone filters panel validated, reset in panel only. check:all exit 0 at a50796b. BLK-015, RR-13, pgTAP 014/021 open separate. No merge/deploy. Next R4 catalogue card integrity warning (D9 C).
|
||||
|
||||
## 2026-11-17
|
||||
- R4 built 2026-11-17 (f061111..8224eda): card integrity line A10, caps own line (D1), view line (D2), retry/focus R-3; spec on sandbox 6p, cleanup archive own ids; check:all exit 0 at 2c9d837 (app 1780); verifier 16/16 MET, 2 out-of-scope files to owner. STOP owner trial §4.16 on db:sandbox trial.
|
||||
- R4 CLOSED 2026-11-17: owner manual trial db:sandbox §4.16 pass, archive (D4) + Card.tsx/records.ts accepted, BDR-121. check:all 2c9d837 exit 0, spec 6/0/0/0 x4. BLK-015, RR-13, anomaly A open. Next U2 design (boards 02-06, 13), no code.
|
||||
- U2 design 2026-11-17: boards 02-06,13,31-33 in docs/design/v1-2-6-u2 (bc19481, 8bdb23a, pass 3), 15 arbitrations, A1-A3 deviate from orientation 14/11 (first click selects only; dialog over right column; overview kept). Design review 5 must-fix fixed; verifier ECARTS(4)->ECARTS(1)->fixed. STOP owner visual validation.
|
||||
- U2 design validated (BDR-122); U2 tech plan rev 2 (8c5a887) after 3 challengers + final pass; D1 RepairDialog coords until U5, D2 « + » on short segments; waits owner, no code.
|
||||
@@ -651,3 +651,341 @@ Apply: SQL test touching a worker queue or shared bucket → neutralise or scope
|
||||
Context: V1-1 DEV acceptance RESP-01. Owner saw whole-page sideways scroll everywhere at 375 px (DevTools responsive). Sandbox sweep (Chromium mobile + desktop with scrollbars shown via `ignoreDefaultArgs: ['--hide-scrollbars']`, WebKit iPhone, Firefox; 280-430 px) found none at 375; owner then measured DEV with a console snippet (cw/sw + topmost offending boxes, classes only): no overflow without zoom → browser zoom was the cause. Same sweep with long account e-mails found a real defect: dashboard `grid gap-4 md:grid-cols-2` has no explicit column below md → implicit `auto` track = cards' min-content → `truncate` e-mail never truncates, cards past screen from ~31 chars at 320 px.
|
||||
Fix: `grid-cols-1` (minmax(0,1fr)) + e-mail wraps (`min-w-0 [overflow-wrap:anywhere]`). Test sweeps 320-430 + desktop with long values, proven failing on old code.
|
||||
Apply: overflow report → ask how observed (zoom, preset, device type), give owner a read-only console probe for DEV, reproduce with realistic max-length values on sandbox; a grid used as a single column on phones needs `grid-cols-1`, else one unbreakable value widens every card.
|
||||
|
||||
## LRN-095 — pgTAP across PGlite and the real Supabase image: privileges, roles, storage triggers (2026-10-28)
|
||||
Adapting pgTAP across PGlite and the real Supabase image: the fixtures must respect privileges the shim doesn't enforce.
|
||||
|
||||
- `auth.sessions`/`auth.mfa_factors` added to the PGlite shim (`supabase-shim.sql`) with the pinned image's enums (`aal_level`, `factor_type`, `factor_status`) and NOT-NULL columns, so aal2-session checks run Dockerless. A test that checks a live-aal2 session fabricates the session + factor rows directly.
|
||||
- API roles (`authenticated`, `service_role`, `anon`) hold no privilege on `auth.*`: every test mutation of `auth.users/sessions/mfa_factors` must run under `reset role` (postgres), never while `set local role authenticated`. Same for seeding `public.*` rows a trigger guards (the content trigger needs `auth.uid()` set, so direct version seeding carries a `request.jwt.claims` sub).
|
||||
- Real-stack-only divergences: `storage.objects` has a storage-API trigger forbidding direct DELETE/UPDATE (PGlite allows it) — assert "no write policy" via `pg_policies` census, not a runtime throws_ok. PostgREST maps a `raise ... errcode='42501'` to HTTP 403 with code `42501` (not P0001). An EXECUTE-revoked function raises "permission denied for function" before its own body — test that, not the body's custom error.
|
||||
- A narrow operator read RPC returning JSON `null` for "no row" is cleaner than raising (PostgREST won't surface a raise as a 404 the client recognises); the tool treats `null` as absent.
|
||||
- Real GoTrue proves what fabricated rows can't: `pnpm db:sandbox test` enrol+verify TOTP → aal2 token, then the role RPC works at aal2 and is refused (mfa_required, 403) at aal1; F18 cross-revoke under real concurrency leaves one owner.
|
||||
|
||||
## LRN-096 — jsonb_path_query row iteration is quadratic; numeric text has no exponent (2026-10-28)
|
||||
PostgreSQL 17 `jsonb_path_query` (SRF) builds its whole match list on the first call and pops rows with `list_delete_first` -> O(n^2) when iterated row by row (FOR loop, count(*)): 200k matches 2.2 s, 400k ~27 s. Early `exit` saves nothing. Use one `jsonb_path_query_array(...)` then `jsonb_array_elements` (linear: 600k 0.4 s). Also: `numeric` prints no exponent, so `octet_length(jsonb::text)` of `1e131071` x 9000 (90 kB payload) = 1.2 GB -> raw OOM; sum printed numbers first. Apply to any SQL walk over user jsonb (status walks `sheet_all_reviewed`, `sheet_has_to_confirm` use the same SRF pattern, bounded today by core caps).
|
||||
|
||||
## LRN-097 — serde tagged enums and owned-Value reads double the wasm size (2026-10-29)
|
||||
serde derive cost in wasm: internally/adjacently tagged enums buffer through serde's private Content, so every type reachable through them gets a second Deserialize monomorphization (ContentDeserializer); `serde_json::from_value` (owned Value) is a third, distinct from `T::deserialize(&value)`. V1-2.2 measured: edit commands with tagged derive + owned from_value of the document = 635.7 KB gzip (budget 600); commands read via `Value` then `T::deserialize(&inner)`, document via `&Value` = 582.7 KB.
|
||||
Apply: in crates reaching wasm, read tagged wire forms through `serde_json::Value` with hand dispatch on the tag (keep ts-rs shape with `ts(tag, content, rename_all)`), always deserialize documents from `&Value`, measure `pnpm wasm:build` gzip after any new op; probe by removing one export at a time (cargo release wasm + gzip -9) before guessing.
|
||||
|
||||
## LRN-098 — Real SVG exports vs the allowlist; what the tree never reads (2026-10-29)
|
||||
Real vector exports vs R3 allowlist: cairo 1.18 writes colours as `rgb(20%, 40%, 70%)`; allowlist drops any function call in presentation attributes → cleaned drawing keeps shapes, loses colours. ImageMagick 7 MVG export writes style settings as bare text between elements (dropped silently, not a "removal"). Property test generators for SVG must avoid repeated attribute names (XML malformed) or most cases test nothing.
|
||||
Apply: classify fixtures by actual outcome before writing expectations; report colour loss on cleaning as an owner decision (allow numeric rgb()/rgba() = reader change); dedupe attribute names in generators.
|
||||
|
||||
Also: the tree drops processing instructions and comments, so "read with no removal" is not "bytes safe": `<?xml-stylesheet href=…?>` survives in stored bytes; scan PIs separately (fail-closed) wherever original bytes are kept.
|
||||
|
||||
## LRN-099 — SVG local references: one strict grammar shared by every stage (2026-10-30)
|
||||
**Context**: V1-2.2 security round on 17d9199: `url(#%61)` and Chromium `url('#<TAB>a')` passed dangling check, per-view scoping, expansion budget; browsers (Chromium 1248, Firefox 1555) resolved them. Root cause: reader, cleaner, composer each tolerated spellings browser normalises differently. Fixed a678faa (`sanitize::local_url_target`), f1ef6a4 (`	` ` ` ` ` spellings, composer coarse `url(` count sharing no parser).
|
||||
|
||||
**Pattern**: one strict grammar for local references (`href`, `xlink:href`, `url(#id)`), shared by cleaning, validation (reader, verdict, preview, PDF snapshot gate), composition. Any encoded or ambiguous spelling (`%XX`, entity, tab/space/unbalanced quote inside, empty or non-ASCII id, `url(` glued to longer name) = active content, refused, never normalised. Composer check fail-closed, independent of reader parser.
|
||||
|
||||
**Future application**: any new SVG/CSS consumer (editor page, PDF, preview, V1-2.5/2.6) reuses the grammar, never its own parser. Hostile tests written apart from the reader, asserting browser behaviour, not core behaviour.
|
||||
- **Status (2026-10-30)**: superseded by LRN-100
|
||||
|
||||
## LRN-100 — SVG local references: one strict grammar, same reading in every stage (2026-10-30)
|
||||
**Context**: V1-2.2 security round on 17d9199: `url(#%61)` and Chromium `url('#<TAB>a')` passed dangling check, per-view scoping, expansion budget; browsers (Chromium 1248, Firefox 1555) resolved them. Root cause: stages tolerated spellings browser normalises differently. Fixed a678faa (`sanitize::local_url_target`), f1ef6a4 (`	` ` ` ` ` spellings, composer coarse `url(` count). Supersedes LRN-099 (wrong on glued names).
|
||||
|
||||
**Pattern**: one strict grammar for local references (`href`, `xlink:href`, `url(#id)`), same interpretation in cleaning, validation (reader, verdict, preview, PDF snapshot gate), composition, browsers. Non-strict `url(` spelling (`%XX`, entity, tab/space/unbalanced quote inside, empty or non-ASCII id) = active content, refused, never normalised. `url(` glued to longer name = another function (removed in CSS attrs, kept elsewhere), not a reference.
|
||||
|
||||
**Trap**: independent check must share grammar rules, not just avoid parser. f1ef6a4 composer count treats glued `xurl(` as reference → reader accepts, verdict passes, `view.canvas` refuses `unscoped_reference`, PDF draws (final review 2026-10-30, LOW, availability only).
|
||||
|
||||
**Future application**: new SVG/CSS consumer reuses grammar. Hostile tests written apart from reader, asserting browser behaviour; every fail-closed branch gets a test reaching it.
|
||||
Supersedes [[LRN-099]].
|
||||
- **Status (2026-10-30)**: superseded by LRN-101
|
||||
|
||||
## LRN-101 — SVG local references: one strict grammar, reader and composer agree by construction (2026-10-30)
|
||||
**Context**: V1-2.2 security round 17d9199: `url(#%61)`, Chromium `url('#<TAB>a')` passed dangling check, per-view scoping, expansion budget; browsers resolved them. Fixed a678faa (`sanitize::local_url_target`), f1ef6a4 (entity spellings, composer coarse `url(` count). Final review 2026-10-30: composer count also saw glued `xurl(#a)` reader kept in `class`/`result`/`values` → verdict passed, canvas refused `unscoped_reference`, PDF drew. Fixed by `sanitize::urls_unglued` (reader removes any attribute holding a `url(` `url_openings` does not read). Supersedes LRN-100.
|
||||
|
||||
**Pattern**: one strict grammar for local references (`href`, `xlink:href`, `url(#id)`), same reading in cleaning, validation (reader, verdict, preview, PDF snapshot gate), composition, browsers. Non-strict `url(` (`%XX`, entity, tab/space/unbalanced quote inside, empty or non-ASCII id, backslash) = active content, file refused. `url(` glued to longer name = attribute removed, any attribute. Reader keeps only values whose every `url(` is a strict reference → composer check true by construction.
|
||||
|
||||
**Trap**: independent defence-in-depth check must agree with reader on what reader keeps; else fail-closed check becomes availability bug. Every fail-closed branch needs a test reaching it (tree built outside reader).
|
||||
|
||||
**Future application**: new SVG/CSS consumer reuses `url_openings`/`local_url_target`, never own parser. Hostile tests written apart from reader, assert browser behaviour.
|
||||
Supersedes [[LRN-100]].
|
||||
|
||||
## LRN-102 — Unquoted heredocs expand backticks: quote the delimiter, scan before commit (2026-10-30) (2026-10-30)
|
||||
**Pattern**: unquoted heredoc (`<<EOF`) runs command substitution on backticks and `$(…)` inside body. Markdown/Rust doc text with `` `id` `` became output of `id` (uid, groups incl. sudo, lxd) inside test doc comment; caught by fresh verifier before commit (V1-2.2 K, 2026-10-30). Same run: `` `tests/svg_reserved_ids.rs` `` and `` `snapshot_invalid` `` erased silently (shell errors only on stderr).
|
||||
|
||||
**Context**: any shell-written file holding backticks: Rust/TS doc comments, markdown, commit bodies, python snippets passed via `python3 - <<EOF`.
|
||||
|
||||
**Application**: always quote delimiter (`<<'EOF'`, `<<'PYEOF'`) unless expansion wanted; prefer Write/Edit tools for prose; before commit grep added lines for `uid=`, `gid=`, home paths and empty backtick pairs; treat `command not found` lines during a file write as corruption signal, re-read file.
|
||||
- **Status (2026-11-02)**: superseded by LRN-110
|
||||
|
||||
## LRN-103 — SVG pointer-events all hits the stroke area even unpainted: hitboxes declare stroke none + visibleFill (2026-11-01)
|
||||
**Pattern**: SVG `pointer-events="all"` hits fill AND stroke area whether painted or not. Transparent hitbox with no own `stroke-width` inherits ancestor's: root `stroke-width="2000"` widened every point hitbox, last one took 13 of 19 equine clicks (Chromium, WebKit). `stroke="none"` alone does not shrink hit area under `all`.
|
||||
|
||||
**Context**: V1-2.2 lot B (2026-10-30/11-01), marker layer hitboxes on editor canvas.
|
||||
|
||||
**Application**: invisible capture surface declares its own geometry + rule: `stroke="none"` + `pointer-events="visibleFill"` (hit = fill only; transparent fill still counts as painted). Visible element that should win → `visiblePainted`. Never rely on inherited stroke for a hit area; test with hostile root stroke in 3 engines.
|
||||
|
||||
## LRN-104 — Precomputed click coordinates go stale when the page moves after the first interaction (2026-11-01)
|
||||
**Pattern**: click coordinates computed once (boundingBox before first click) go stale when page layout moves after first interaction. Canvas harness listed recorded clicks above canvas: first click grew list, canvas shifted down, later precomputed points hit wrong marker/nothing. Looked like hit-test bug.
|
||||
|
||||
**Context**: V1-2.2 canvas click proofs (Playwright, `e2e/harness/canvas.tsx`), 2026-10-30.
|
||||
|
||||
**Application**: recompute target box right before each press (`centreOf` per click), or keep layout fixed (output with fixed height, `overflow:hidden`). Treat "first click right, next ones wrong" as layout shift first, hit-test second.
|
||||
|
||||
## LRN-105 — WebKit snaps real taps and clicks to whole CSS px: press with 1.5 px margin, else elementFromPoint (2026-11-01)
|
||||
**Pattern**: WebKit snaps real input to whole CSS px. Playwright `touchscreen.tap` and `mouse.click` at fractional coords land on rounded pixel; hit test then answers rounded point. Chromium keeps fraction on click, rounds tap.
|
||||
|
||||
**Context**: V1-2.2 canvas click proofs, WebKit 27.2 (Playwright 1.64.1), desktop 1280 and iPhone SE 375 emulation, 2026-11-01. Measured: tap at x 100.1 lands right of edge at 100.4; click at 100.9 lands left of it. Two junction-edge tests failed only on WebKit until margin added.
|
||||
|
||||
**Application**: real presses keep ≥ 1.5 px margin from any edge they test. Below that margin ask `document.elementFromPoint` at exact point instead of pressing. Never read a WebKit-only edge miss as hit-test bug before checking snapping.
|
||||
|
||||
## LRN-106 — Firefox getBoundingClientRect drifts (1/60 px units, stroke included); confirm by painted pixels (2026-11-01)
|
||||
**Pattern**: Firefox `getBoundingClientRect` drifts from rendered geometry: client rects in 1/60 px app units, and include stroke of element. Rendering itself exact. Size checks via client rects in Firefox show error up to 0.4 % (24 % on 0.067 px hitbox) though pixels are right.
|
||||
|
||||
**Context**: V1-2.2 frame and visible-size probes vs Rust f64 expectation, Firefox 157 (Playwright 1.64.1), preview box 286 × 310, 2026-11-01. Chromium 156 / WebKit 27.2 agree with core ≤ 8.2e-5 relative on same cases. One-unit frame: Firefox rects 3.3 % off 286 px/unit while painted pixels exact.
|
||||
|
||||
**Application**: compare geometry across engines with stroke none on probed element, and confirm Firefox outliers by painted pixels (canvas/screenshot count) before calling a rendering gap. Report Firefox rect gap as measurement artifact, not defect.
|
||||
|
||||
## LRN-107 — WebKit and Chromium stop painting SVG at tiny viewBox spans (f32): floors from painted pixels (2026-11-01)
|
||||
**Pattern**: WebKit and Chromium stop painting SVG at tiny viewBox spans. Frame span 2⁻⁷ → WebKit paints nothing; Chromium drifts at 2⁻¹⁴ (0.46 px), paints nothing at 2⁻²⁰; Firefox exact at every span. f32 view transform the cause.
|
||||
|
||||
**Context**: V1-2.2 frame range rules, disc a quarter of frame in 286 px box, painted-pixel count, WebKit 27.2 / Chromium 156 / Firefox 157 (Playwright 1.64.1), 2026-11-01. First span floor 2⁻²⁰ withdrawn on this measure; floor set to 1 unit (factor 32 from WebKit's last exact span 2⁻⁵).
|
||||
|
||||
**Application**: bound SVG frame spans and offsets by browser f32 range before trusting geometry; derive floors from painted pixels in all three engines, never from f64 math alone.
|
||||
|
||||
## LRN-108 — Chromium touch emulation sends taps ~10 px around point disc to the point; WebKit does not (observation, not contract) (2026-11-01)
|
||||
**Pattern**: Chromium touch emulation redirects taps near small targets: in V1-2.2 tap grid, taps up to ~10 px around point marker's visible disc went to the point, not to zone under finger. Not seen under WebKit. Experimental, browser-dependent observation, never a selection guarantee.
|
||||
|
||||
**Context**: V1-2.2 interior rule, Playwright 1.64.1 touch projects chromium-320 / chromium-375 vs webkit-375, equine main view, 2026-11-01. Taps at zone witness centre landed on junction points; zone taps recorded 18/21 (caudal) to 195/195 (cervical) at 320. Tool `.claude/audits/2026-11-01-v1-2-2-interior-tools/`.
|
||||
|
||||
**Application**: Chromium touch tests press away from point discs (clearest fill point, margin) or ask `elementFromPoint`. Never use this tolerance as functional contract: explicit selection rules and Rust core guarantees stay authority (owner 2026-11-01).
|
||||
|
||||
## LRN-109 — M6 worker musl image: verify child at caps needed brk, decode never did; derive seccomp in real image per child path (2026-11-01) (2026-11-01)
|
||||
**Pattern**: In M6 worker musl image, allocator needed `brk` syscall when verify child heap grew at caps; decode paths measured before never needed it. Seccomp policy must be checked in real image for each new child path. Observation scoped to this image and this measure: not generalised to all allocators or all musl environments.
|
||||
|
||||
**Context**: V1-2.3 verify child, `rust:1.99.0-alpine3.24` build (musl mallocng), distroless runtime, 2026-11-01. At-caps fixture under full filter died SIGSYS; strace derivation (`crates/worker/scripts/derive-seccomp.sh`) in Docker test stage showed `brk` only missing call. Decode traces (R1) showed neither `brk` nor `mprotect`. Owner approved `brk` in shared filter (brief 2026-11-01), wording of this entry owner-validated.
|
||||
|
||||
**Application**: new child command or new input path (bigger frames, other library) → rerun seccomp derivation inside real image on that path before trusting allowlist; add a syscall only when trace proves it, with trace as justification; never infer from native glibc runs.
|
||||
|
||||
## LRN-110 — Bash traps that reached DEV: backgrounded cd list, unquoted heredoc backticks; absolute verified cwd, env validated in-script, rules in sub-agent briefs (2026-11-02)
|
||||
**Pattern**: two Bash traps made a DEV-targeting test run from the main checkout (2026-11-01, 23:03:49 and 23:10:59 UTC, 13 GET each on DEV, no write seen). (1) `cd /path && cmd &` backgrounds the whole AND-list in a subshell: the caller's cwd never changes, next commands run where the shell was. (2) Unquoted heredoc (`<<EOF`) runs command substitution on backticks and `$(…)` in its body: a TODO text holding `` `pnpm e2e:sheet-assets` `` executed that command (LRN-102 had already caught `` `id` ``; its rule was not applied).
|
||||
|
||||
**Context**: orchestrator shell writes (python via `python3 - <<EOF`, markdown, TODO, commit bodies) and sub-agent test commands in a multi-worktree repo whose other checkouts still hold old scripts that read DEV keys (`supabase status`). Rule: a wrong cwd must never be able to reach DEV.
|
||||
|
||||
**Application**: quote every heredoc delimiter (`<<'EOF'`, `<<'PYEOF'`) unless expansion is wanted, pass values as arguments; prefer Write/Edit for prose. Run commands with an absolute, verified directory (`git -C <abs>`, `pnpm --dir <abs>`, `[ "$(pwd -P)" = <abs> ]` before acting); never `cd X && cmd &`. Validate the environment before any side effect (target URL, key issuer, container name) inside the script itself, so its safety never depends on cwd. Put these rules in every sub-agent brief that may run shell commands, with the explicit ban on running scripts from other worktrees.
|
||||
Supersedes [[LRN-102]].
|
||||
|
||||
## LRN-111 — Closing modal drawer leaves page inert: e2e typing lost until dialog gone (2026-11-02)
|
||||
**Context**: V1-2.5 e2e P1 at 375 px: search fill lost 2/4 full runs (8 cards, not 1). Test clicked drawer link, saw heading + first card, filled search at once.
|
||||
**Pattern**: native `<dialog>` showModal kept mounted through motion AnimatePresence exit → page behind inert ~200 ms; Playwright fill there goes nowhere, intermittently under load. Fix in test: after drawer link click, `expect(dialog).toHaveCount(0)` before typing. Proof: 1/16 red repro, 32/32 after.
|
||||
**Apply**: any e2e acting right after closing a modal drawer/dialog waits for it gone; flaky "input ignored" → suspect inert from closing modal first. Keep failure snapshot (check:all e2e:ui wipes test-results).
|
||||
|
||||
## LRN-112 — GoTrue v2.197 MFA: aal2 needed for password/email change; factor removal downgrades only its sessions (2026-11-02)
|
||||
**Context**: V1-2.5 sandbox proofs on GoTrue v2.197.0 (mfa-behaviour.sandbox.ts, IDENTITY.md §4.1).
|
||||
**Pattern**: once a TOTP factor verified: password change and recovery-link reset refused at aal1 (401 insufficient_aal) → reset/change UI must step up first; email change same. Removing verified factor downgrades only sessions last verified with that factor; their access token keeps aal2 claim until expiry (has_mfa true, has_aal2_session false). supabase-js `mfa.listFactors().totp` hides unverified factors → read `all`.
|
||||
**Apply**: never assume aal from claim alone for sensitive RPCs (session row check); any password/email flow on MFA accounts needs a step-up path; factor lists show unverified ones.
|
||||
|
||||
## LRN-113 — GoTrue v2.197 TOTP reuse observed; Storage 400 with statusCode 409; fresh sandbox, order test-db, e2e:shell, test (2026-11-03)
|
||||
**Context**: V1-2.5 checkpoint gates (2026-11-02/03) on sandbox `pnpm db:sandbox` (GoTrue v2.197.0 image defaults, Storage API of the pinned Supabase images).
|
||||
**Pattern**:
|
||||
1. TOTP reuse, OBSERVED on sandbox only (IDENTITY §4.1 case 11), no general guarantee: GoTrue keeps no used-code record. Code C of step N accepted by session A, by second aal1 session B, by A again; session D in step N+1 accepted (one step skew); session E in N+2 refused 422 `mfa_verification_failed`. Span 30-60 s, replayable by any session holding password within it. CLI/DEV config sets no replay option, same behaviour expected but unmeasured; other GoTrue versions/configs unverified.
|
||||
2. Storage duplicate upload: answers HTTP 400 with body `statusCode: "409"` (KeyAlreadyExists), not HTTP 409. Delete of missing object likewise HTTP 400 + `statusCode` 404. Test/client must read body `statusCode`; any other 400 still fails.
|
||||
3. Sandbox suites share one stack: e2e:shell seeds content-addressed drawings + working copies that later `test` cases meet (duplicate upload, `working_copy.exists`), so a case green only from 2nd run or only after another suite hides defects. Gate run = fresh stack (`db:sandbox down` + `up fresh`), order `test-db → e2e:shell → test`, each case robust to state the earlier suites leave; never re-run until green.
|
||||
**Apply**: never cite TOTP span as a guarantee (measured fact + version); Storage error handling reads body `statusCode`; V1-2.6+ gates start from fresh sandbox in that order, report state-dependent failures instead of masking them.
|
||||
|
||||
## LRN-114 — Worktree in session scratchpad dies with harness cleanup; durable path + tracked ledger (2026-11-04)
|
||||
- **Context**: V1-2 worktree lived in a past session's scratchpad (`/tmp/claude-1000/<project>/<session>/scratchpad/v1-2`). 2026-11-04 13:08 harness cleanup of ended sessions removed it (and other old session dirs) mid V1-2.6 execution.
|
||||
- **Lost**: uncommitted lot H work, uncommitted lot G review fix, git-ignored SDD workspace (briefs, reports, rulings ledger). **Kept**: every commit — pushed by gitflow hooks (origin at 8343528).
|
||||
- **Pattern**: long-running worktree → durable path outside `/tmp` and outside session dirs (now `/home/bchanot/Documents/faunosteo-v1-2`). Rulings, contract changes, findings and resume checkpoints → git-tracked file, committed + pushed after each validated lot. Scratch (SDD briefs/reports) may stay ignored; nothing needed to resume lives only there or in an agent's context.
|
||||
- **Recovery recipe**: `git worktree list --porcelain` → `git worktree prune --dry-run --verbose` (only entries whose dir is gone; check their commits reachable from a branch) → `git worktree prune` → `git worktree add <durable path> <existing branch>` → HEAD = origin, tree clean → `pnpm install --offline`, `pnpm wasm:build` (ignored build outputs).
|
||||
|
||||
## LRN-115 — Playwright label locator hits outgoing page during navigation (2026-11-04)
|
||||
Playwright `getByLabel` resolved on OUTGOING page during navigation: sheets list filter « Espèce » (#filter-species) and create form field « Espèce » share label; selectOption hit list filter before create route mounted, choice lost, looked like product remount (V1-2.6 Lot K, 3/3 repro, refuted by capture-phase change listener). Rule: after a navigation, wait for destination landmark (page h1 « Nouvelle fiche ») before any label-based locator. Instrument native events before blaming a remount.
|
||||
|
||||
## LRN-116 — Native dialog exit animation drops keystrokes (page inert) (2026-11-04)
|
||||
Native modal `<dialog>` closing with exit animation leaves page inert until animation ends; keystrokes sent then are dropped (no React onChange). V1-2.6 journey: fields filled right after « Nettoyer et utiliser cette version » emptied, later fields kept, looked like form reset. Rule: after closing a modal, wait for dialog count 0 (getByRole('dialog', {name}) toHaveCount(0)) before typing; never retry fills (masks real resets). Users cannot type during inert phase either, so no data loss.
|
||||
|
||||
## LRN-117 — Index-only staging past format noise: observation, strict control only (2026-11-04)
|
||||
Observation, not a routine: worktree held uncommitted format-only Prettier changes (owner pending) on files a fix had to touch. Staging logic hunks onto HEAD text via `git hash-object -w` + `git update-index --cacheinfo` kept format noise out of commits. Risky: index content bypasses working-tree review. Only with strict control: apply hunks by exact-match script on `git show HEAD:<file>`, prove equivalence (prettier(staged) == prettier(worktree)), run checks, inspect `git diff --cached`. Prefer resolving the noise first (owner decision) over routine index surgery.
|
||||
|
||||
## LRN-118 — Wasm budget margin: measure with the gate's exact call (Node gzipSync level 9 on pkg), never system gzip, never raise silently (2026-11-05)
|
||||
- **Context**: V1-2.6 UX prep, 2026-11-05. Earlier study measured wasm with GNU `gzip -9` (583 126 B) and claimed ~17 KB margin. Gate measures otherwise: real margin 7 857 B. Owner asked rule recorded.
|
||||
- **Gate (verified in repo)**: `packages/core-wasm/tests/size.test.ts` runs Node `gzipSync(bytes, { level: 9 })` on shipped build `packages/core-wasm/pkg/faunosteo_wasm_bg.wasm` (`coreWasmPath('pkg')`), asserts `toBeLessThanOrEqual(COMPRESSED_BUDGET_BYTES)`, `COMPRESSED_BUDGET_BYTES = 600_000` (D-R13).
|
||||
- **Reference**: 592 143 B of 600 000 B → margin 7 857 B (raw 1 569 864 B; pkg built 2026-11-04 after last core change `bbab0e6`; re-measured 2026-11-05 with same call, same figure).
|
||||
- **Rule**: margin = same call, same params (`level: 9`), same `pkg` file as gate. No system gzip substitute: results differ. Measure after every core change (each new op). Never raise ceiling silently: raise = explicit owner decision (D-R13) on measured figure.
|
||||
- **How**: after `pnpm wasm:build`, run size test (prints figure) or `node -e` with `zlib.gzipSync(buf, {level: 9})` on that file.
|
||||
|
||||
## LRN-119 — React 19.2 Activity keeps state but re-runs effects on reveal: audit one-shot mount effects, no general ban (2026-11-06)
|
||||
- **Context**: V1-2.6 U1 plan (2e46c14) chose kept-mounted `hidden` wrappers over React 19.2 `<Activity>` for tab places; owner asked distinction recorded, no general ban (2026-11-06).
|
||||
- **Fact (react.dev/reference/react/Activity, checked 2026-11-06)**: `mode="hidden"` keeps state, refs and DOM (`display: none`) but destroys Effects (cleanups run); reveal re-creates them (setups run again). Conceptually hidden = unmounted with saved state. Hidden children still re-render on prop changes, at lower priority.
|
||||
- **Trap**: state kept ≠ effects quiet. Effect that does one-shot action on mount re-fires at each reveal:
|
||||
- `apps/app/src/catalogue/useFraming.ts:69` `useEffect(() => setFraming(FIT), [resetKey])` → zoom and pan reset at each return, though framing state was kept.
|
||||
- `apps/app/src/components/editor/findings/FindingTree.tsx:31-33` `useEffect(() => focus(focusId), [focusId])` → stale `focusId` re-focuses tree item at each return (steals focus).
|
||||
- **Rule**: before wrapping subtree in `<Activity>`, audit its effects. Idempotent on re-run (subscriptions, listeners, measures with cleanup) → fine. One-shot on mount (reset, focus, scroll, fetch, write) → make reveal-safe (apply once per key via ref, consume one-shot request) or keep `hidden` wrapper. `hidden` wrapper: no effect runs on switch, but hidden places re-render at normal priority (U1 plan §2 cost control). `<Activity>` stays allowed where audit passes.
|
||||
- **Future application**: U1 makes `focusId` one-shot and bans focus in mount effects; U2b search, filter panel, drawing in filter panel (`useFraming` reuse) follow same rule, so a later move to `<Activity>` stays possible.
|
||||
- **Status (2026-11-06)**: correct, amended 2026-11-06 after fresh verifier: hidden Activity keeps state (useRef values included) and DOM; refs to DOM elements detached while hidden (safelyDetachRef, react-dom 19.2.6), re-attached on reveal in layout phase before effects re-run; impact lines unchanged.
|
||||
|
||||
## LRN-120 — Never edit src while a browser suite runs against a live dev server: HMR mixes code, run unusable (2026-11-09) (2026-11-09)
|
||||
- **Context**: V1-2.6 U1 Lot H. Controller ran whole shell suite on a474dda (Playwright against live Vite dev server) while fix round 1 edited `src`. HMR served half-edited code mid-run → failures mixed old/new code, run unusable, verdict lost.
|
||||
- **Rule**: suite against a live dev server = frozen tree for its whole duration. No edit dispatch while a suite runs. Fix needed during a run → wait for run end, or work in separate worktree with own port.
|
||||
- **Apply**: SDD controller sequences implementer dispatches and suite runs; report names commit the suite ran on and confirms no edit landed during it.
|
||||
|
||||
## LRN-121 — Sandbox volume and consumed state fail browser suites independent of code: check data before bisecting (2026-11-09) (2026-11-09)
|
||||
- **Context**: V1-2.6 U1 Lots F-I. admin.spec « Target crashed » in every full run since Lot F, bisect 89da8d3 / 580ff28 / 606f7ba same failure → not code. Cause: long-lived sandbox grew 2 306 grant rows; `list_catalog_grants()` + `GrantList` unbounded; axe scan drove Chromium renderer ~2.2 GB, earlyoom killed it. Same pressure SIGTERMed DEV `pg_meta`. Fresh sandbox (owner go) → 192/0. Later second run on same sandbox: admin.spec:717 failed 4/4, single working-copy slot taken by earlier run (WorkingCopyAction.tsx:88).
|
||||
- **Rule**: suite failing outside changed files → check sandbox data volume and consumed state before bisecting code. Tests create own state or tolerate existing state. Unbounded list endpoints = latent OOM under test tooling; page server-side. Never reset sandbox just to get green (owner go per reset, BDR-105/106).
|
||||
- **Apply**: report exact counts per commit and sandbox age; RR-13 covers paging + admin scenario independence + memory check.
|
||||
|
||||
## LRN-122 — pgrep -f wait loop matches its own command line: bracket the pattern or wait on PID (2026-11-09) (2026-11-09)
|
||||
- **Context**: V1-2.6 U1 Lot I. Implementer wait loop `while pgrep -f 'playwright.shell.config'; do sleep …; done` never ended: `pgrep -f` matched the loop's own shell command line, which contains the pattern.
|
||||
- **Rule**: `pgrep -f` pattern must not match the caller: bracket trick `pgrep -f '[p]laywright.shell.config'`, or wait on a known PID (`wait $pid`, `kill -0`), or the harness Monitor / background notification.
|
||||
- **Apply**: any wait-for-process loop in briefs and scripts.
|
||||
|
||||
## LRN-123 — docker inspect -f failure: bare newline on stdout, error sentence on stderr (2026-11-11)
|
||||
Context: db:trial absent detection, `resource_exists` in scripts/db-trial.sh. Measured 2026-11-11 on this machine: docker client 29.9.3, rootless daemon 29.9.2, read-only inspect of absent name `faunosteo_probe_absent`.
|
||||
|
||||
Fact (demonstrated): `docker <container|volume|network|image> inspect -f '{{...}}' <absent>` -> rc 1, stdout exactly "\n" (template inspector flush), stderr one sentence:
|
||||
- container: `Error response from daemon: No such container: <name>`
|
||||
- volume: `Error response from daemon: get <name>: no such volume`
|
||||
- network: `Error response from daemon: network <name> not found`
|
||||
- image: `Error response from daemon: No such image: <name>`
|
||||
Daemon unreachable: stdout also "\n", stderr = dial error.
|
||||
|
||||
Trap: `out="$(docker ... inspect -f ... 2>&1)"` then exact compare never matches (leading "\n"): every absent resource refused. Shipped in a fix round, stub printed stderr line only, 353 green tests missed it; fresh re-review caught it (d3bdbbe history).
|
||||
|
||||
Apply: absent = rc != 0 AND stderr alone (`2>&1 >/dev/null`) equals the per-kind sentence; anything else refuses. Stubs reproduce both streams (control: merged compare restored -> 288 harness fails). Measure real tool output stream by stream before freezing it in a stub.
|
||||
|
||||
Limit: sentences proven on this version pair only; a Docker upgrade may reword them (absent_answer then refuses everything, fail-closed).
|
||||
|
||||
## LRN-124 — bash 5.3 EXIT trap sees exit status 0 after SIGTERM (2026-11-11)
|
||||
Context: db:trial backup_now EXIT trap (scripts/db-trial.sh ~1170 comment), lot B2.
|
||||
|
||||
Fact (demonstrated 2026-11-11, GNU bash 5.3.9): script with `trap '...' EXIT` and no TERM trap, killed by SIGTERM -> EXIT trap runs, `$?` inside it is 0, process still exits 143. With `trap 'exit 143' TERM` the EXIT trap sees 143.
|
||||
Repro: `bash -c 'trap "echo \$?" EXIT; kill -TERM $$; sleep 2'` prints 0.
|
||||
|
||||
Apply: never decide success/failure from `$?` in an EXIT trap. Clear the trap on success (`trap - EXIT`) so any run of it means failure, or set a status variable, or add `trap 'exit 143' TERM` / `trap 'exit 130' INT`.
|
||||
|
||||
Limit: only bash 5.3.9 tested; other versions unproven.
|
||||
|
||||
## LRN-125 — psql single-transaction commits a truncated piped script (documented, unproven here) (2026-11-11)
|
||||
Context: db:trial rotation and grant SQL (scripts/db-trial.sh ~1525 comment; plan .claude/tasks/plans/2026-11-09-db-trial-stack.md B2/B3 records).
|
||||
|
||||
Rule (NOT demonstrated here, derived from psql's documented behaviour): `psql --single-transaction` / `-1` wraps the whole input in BEGIN ... COMMIT. If the producer of stdin dies mid-script (pipe closed early), psql sees EOF and sends COMMIT: the truncated prefix commits. ON_ERROR_STOP stops on SQL errors only, never on a short input.
|
||||
|
||||
Apply: for multi-statement writes fed through a pipe, write explicit `begin;` ... `commit;` in the script itself (a truncated script then never reaches its commit and rolls back on disconnect), plus a commit marker checked afterwards when the outcome matters (db-trial rotation digest marker).
|
||||
|
||||
Limit: no run in this project reproduced the truncation; treat as design rule pending a real psql test. Note: seed_equine still uses `sb_psql --single-transaction < file` (file input, not a pipe: lower risk).
|
||||
|
||||
## LRN-126 — Docker daemon-down error contains no such file or directory (2026-11-11)
|
||||
Context: db:trial daemon-down handling. Measured 2026-11-11, docker client 29.9.3, DOCKER_HOST=unix:///nonexistent/docker.sock.
|
||||
|
||||
Fact (demonstrated): every docker call with no daemon -> rc 1, stderr `failed to connect to the docker API at unix:///nonexistent/docker.sock; check if the path is correct and if the daemon is running: dial unix /nonexistent/docker.sock: connect: no such file or directory`.
|
||||
|
||||
Trap: substring tests like `*"no such"*` (meant for "No such container" / "no such volume") also match the dial error: daemon-down reads as "absent". On destructive paths (destroy, restore) that meant deleting live state or extracting into a non-empty volume.
|
||||
|
||||
Apply: never classify Docker errors by substring; exact whole-sentence match per kind on stderr, everything else refuses (see the inspect -f learning).
|
||||
|
||||
Limit: wording of this client version only.
|
||||
|
||||
## LRN-127 — Postgres image init logs role password: log_statement must be off on server command line (2026-11-11)
|
||||
**Context**: db:trial first real create 2026-11-11 (255dd67). TR_PW found in `docker logs faunosteo_trial_db` line 379: `postgres@postgres LOG: statement: ALTER USER supabase_admin WITH PASSWORD '…'`.
|
||||
**Cause** (demonstrated): image `supabase/postgres:17.11.0.004` init script `/docker-entrypoint-initdb.d/migrate.sh` sends role password as SQL text (lines 36/46/54/59) on init temp server; image `/etc/postgresql/postgresql.conf:545` has `log_statement = 'ddl'` → statement + password to stderr = container log. Our `/etc/postgresql.schema.sql` session `set log_statement='none'` runs after → too late. Per-role `log_statement=none` (image migration 20250205060043) also after.
|
||||
**Fix** (5f63d22): `-c log_statement=none` appended to `exec docker-entrypoint.sh postgres ...` in DB_INIT. Entrypoint `_main` → `docker_temp_server_start "$@"` → `pg_ctl -o "$(printf '%q ' "$@")"` passes every arg after `postgres` to temp server and final server; command line (PGC_S_ARGV) beats postgresql.conf + auto.conf; no init script sets log_statement other than none (grep). Harness check db-trial-check.sh:726, positive control red 372/1 → green 373/0. Static proof only: real proof = create on fresh volume + container log scan (counts only, SUPABASE.md §5.2). Trade-off: DDL no longer logged on trial server.
|
||||
**Not closed** (named, owner scope): failing init statement still logged (`log_min_error_statement = error`); migrate.sh puts password on psql argv during init; db-sandbox.sh same DB_INIT without flag; DEV CLI stack likely same log line.
|
||||
**Remediation of exposed value**: one-off TR_PW rotation 2026-11-11 (owner): 5 roles one tx (local logging off), secrets.env, auth/storage/rest recreated by `pnpm db:trial start`; old pw refused on scram path (container network IP; 127.0.0.1 is trust, proves nothing), new ok ×5; db container frozen env keeps dead old value.
|
||||
**Future application**: any self-hosted Postgres image with init scripts → set logging GUCs on server command line, never in init SQL; mandatory pre-production check in DEPLOY.md security prerequisites. Password probe must use non-trust pg_hba path + control with wrong password.
|
||||
|
||||
## LRN-128 — Click-time hit tests lie: pointer capture, blur-rebuild and touch click synthesis; decide taps from the press (2026-11-12)
|
||||
**Context**: R1 D6b (deselect on empty drawing press), sheet editor, Chromium. Found by plan challenge + code review, confirmed by e2e recorder.
|
||||
**Observed mechanisms** (facts):
|
||||
- Pointer capture retargets: `setPointerCapture` on the box at pointerdown (move gesture) → mouseup/click delivered to capture target (box), not the pressed marker → `closest('[data-anno-id]')` on click target = null.
|
||||
- Blur commit at mousedown: focusable box takes focus → field blur commits → store version bump → canvas `replaceChildren` rebuild before mouseup → pressed node detached → click can be dropped (Blink).
|
||||
- Touch: Chromium builds the tap's click after touchend, hit-tests the layout as it is then (after any pointerup state change shifting it), and applies touch adjustment toward `cursor:pointer` targets near the finger (~6-10 px).
|
||||
- happy-dom reproduces none of these (no capture retarget, no focus on pointerdown, no layout).
|
||||
**Implementation recommendations** (choices, not facts):
|
||||
- Decide a "tap on empty" from the press (pointerdown target, movement, pointer count), not from the click target.
|
||||
- Apply mouse verdict at pointerup and swallow the following click; apply touch/pen verdict in the tap's own click and re-check its target.
|
||||
- Unit tests: simulate capture retarget (`upOn: box`) and mousedown focus explicitly; prove the rest in real Chromium (CDP touch) with an event recorder asserting which guard fired.
|
||||
**Refs**: plan challenge records (.claude/tasks/plans/2026-11-12-r1-history-deselect-1141.md), useEmptyTap.ts, e2e/shell/editor-deselect.spec.ts, BDR-113.
|
||||
|
||||
## LRN-129 — Document-level Escape must re-check dialog and panel layers (body focus skips the React root) (2026-11-12)
|
||||
**Context**: R1 Escape priority in sheet editor (React 19). Code review found body-focused Escape skipping higher layers.
|
||||
**Facts**: keydown with focus on `document.body` (after click on non-focusable text) never traverses the React root → React handlers (ModalDialog, ReferencesPanel, workspace onKeyDown) never run. React synthetic `stopPropagation` does stop native propagation to `document`. A capture listener on document runs before everything, incl. dialogs.
|
||||
**Rule**: a document-level Escape listener must re-check the priority interfaces itself: `dialog[open]` present → skip; references panel open → skip deselect (and close panel for body-targeted Escape); `defaultPrevented`, `isComposing`, text field target → skip; act only on shown body. Keep validated order dialog > « Plus » > references > tracing > selection; every consumer `preventDefault` so later layers skip.
|
||||
**Test**: unit cases with focus on body + dialog open / references open / dialog outside workspace (phone drawer).
|
||||
**Refs**: deselect.ts useEscapeDeselect, EditorWorkspace useBodyEscape, EditorTabs useMoreEscape, commit 132756e, BDR-113.
|
||||
|
||||
## LRN-130 — happy-dom pointer/focus defaults; compressed-output proxy false OOM on piped pnpm lint (2026-11-12)
|
||||
**happy-dom** (20.x, vitest): `PointerEvent` init defaults `isPrimary: false`, `pointerType: ''`, `buttons: 0`; `fireEvent.click` moves no focus; no layout (box size 0), no pointer-capture retarget. → pass `isPrimary: true, button: 0, buttons: 1, pointerType` explicitly; focus explicitly; pan translation assertions impossible (assert zoom / preventDefault instead).
|
||||
**Compressed command output (rtk proxy)**: `pnpm lint | tail` printed `[warn] Linter process terminated abnormally (possibly out of memory)` with rc 254, while `pnpm lint > file 2>&1` gave rc 0 and every package "Done" (2026-11-12, worktree faunosteo-v1-2). Observed once in this context only; the message comes from the proxy wrapping a piped command, NOT proof that eslint never runs out of memory elsewhere. → For gate evidence, redirect to a file and read rc + per-package lines; a real OOM still has to be ruled out from the unproxied log.
|
||||
**Refs**: scratchpad gate logs r1-gates/final*, .superpowers ledger for plan 2026-11-12-r1-history-deselect-1141.
|
||||
|
||||
## LRN-131 — Conditional in-flow element above a canvas = layout shift; fix per message, sr-only only for redundant text (2026-11-12)
|
||||
**Context**: R1 owner feedback 2026-11-12: drawing jumped at each selection change in sheet editor (BLK of same date, 927537b).
|
||||
**General problem (layout)**: any element mounted/unmounted or resized on a state change and placed in flow ABOVE a canvas or hit-tested area moves that area: visual jump, and next clicks/taps land on stale coordinates. Sources: selection labels, transient hints, notices, banners.
|
||||
**Detection**: e2e reads target `boundingBox().y` before and after each state change (select, deselect, hint on/off), desktop + phone; happy-dom has no layout, so unit tests can only assert classes/structure.
|
||||
**Fix options (choose per message, not one rule)**: (a) redundant info already carried elsewhere (highlight, side panel) → drop visually, keep `sr-only` text if useful for SR browse (SelectionTag case); (b) message user must see (warning, refusal, error, save state) → stays VISIBLE: reserve fixed space (min-height slot), overlay inside canvas box (`relative` parent, absolute + pointer-events-none), or place below / beside canvas. Never sr-only a warning to fix layout.
|
||||
**A11y check**: sr-only text not live = no announce, available to browse only; announce needs live region, avoid duplicating an existing one.
|
||||
**Open instance**: ToolNotes hint above canvas (EditableAnnotations.tsx ~373) cleared on select = remaining shift, needs option (b).
|
||||
**Refs**: SelectionTag.tsx, editor-deselect.spec.ts layout tests, docs/design/README.md deviation 2026-11-12, LRN on layout shift vs hit-test (recompute box per press).
|
||||
|
||||
## LRN-132 — E2E tests and database-wide singleton state (2026-11-12)
|
||||
**Context**: anomaly B (BLK-014, 2cdee42): e2e on shared persistent sandbox asserted an action that needs a database-wide singleton free (one active working copy of historical sheet per database).
|
||||
**Rules**:
|
||||
- Never require a unique/singleton resource to be AVAILABLE in a shared persistent database: state depends on earlier runs and parallel suites.
|
||||
- Need to check the UI of that action → test the REAL component on a harness (e2e:ui, no backend) with the state simulated; import the production component, no fork/mock of its logic; prove it is the real one (e.g. its computed default value).
|
||||
- Server-side (shell) tests assert CONSISTENCY of the state actually present (e.g. button disabled iff reason shown and linked), both branches written, not conditional skips.
|
||||
- Clean up / archive ONLY resources created and identified by the current run (capture ids from successful calls, all calls, before classification); verify ids actually modified (`returning id` = expected set); each cleanup step independent, first error rethrown; skip empty `in ()`.
|
||||
- Avoid concurrent suites mutating the same singleton (set-aside/restore patterns race with readers under fullyParallel and alter pre-existing metadata such as updated_at).
|
||||
- Prove non-interference: per-id snapshot (id, status, archived_at, updated_at) of pre-existing rows before/after; counts alone lie (fixtures add rows).
|
||||
**Refs**: BLK-014, `e2e/ui/working-copy.spec.ts`, `sheets-admin.sandbox.ts` afterAll, `editor-equine.spec.ts` set-aside (open), LRN-076, LRN-082.
|
||||
|
||||
## LRN-133 — Guarded e2e on persistent sandbox: preflight wrapper, full-row guard, A/B then dose-response (2026-11-13)
|
||||
**Context**: R2 shell e2e on persistent sandbox (editor-equine must never run there; pre-existing rows must stay identical).
|
||||
**Rules**:
|
||||
- Wrap every shell e2e run in a script: refuse bare args, refuse any spec named editor-equine, run `--list` first and abort if editor-equine appears (preflight), then run.
|
||||
- Guard = full-row md5 per id of pre-existing rows in every touched table, snapshot before/after; report new rows per table + « pre-existing rows changed or deleted: none ». Counts alone lie; metadata (updated_at) included in the hash.
|
||||
- Diagnose suite failures with interleaved A/B (pre-change worktree vs HEAD, same lockfile, same data) then a dose-response probe (cap the suspect input, same code/data) in a quiet window; loaded runs confound.
|
||||
**Refs**: scratchpad wrappers run-shell.sh / guard.sh (R2), BLK-015, LRN-132.
|
||||
|
||||
## LRN-134 — Blur-commit plus explicit commit: stale value duplicates history; one error slot vs several refused fields (2026-11-13)
|
||||
**Context**: R2 reference tiles: field blur commits value to history; « Terminer » / panel close also commit.
|
||||
**Pattern**: blur-commit + explicit commit on the same gesture read a stale value → duplicate history entry (two undos for one edit). Fix: one commit path per edit, compare against document value at commit time, test « one history entry per edit » for blur, « Terminer », panel close (criterion 26, 1bf2701).
|
||||
**Also**: a guard that tries several pending fields with one shared error slot leaves the LAST field's message; focus first refused field then re-assert its refusal (94f8a8b). Test focused field's aria-invalid, not just that an error exists.
|
||||
**Apply**: any form with commit-on-blur plus a submit-like button.
|
||||
|
||||
## LRN-135 — Refusal layout shift loses the click (mousedown preventDefault); happy-dom observer and touch-slop test traps (2026-11-13)
|
||||
**Context**: R2 « Terminer » below a field whose blur-commit is refused.
|
||||
**Pattern**: mouse down blurs field → refusal line inserted → layout shifts → mouseup lands elsewhere → click lost (« Terminer » looks dead). Fix: `mousedown` preventDefault on the button (focus stays, button then runs the leave guard). Editor-wide general cure not done.
|
||||
**Also (tests)**: happy-dom 20.10.6 holds MutationObserver callback in WeakRef → GC under load silently stops observation; count live-region announcements by wrapping textContent/nodeValue setters, restore in afterEach (c8109af, b1fd896). Touch e2e: CDP synthesizeScrollGesture touch scrolls nothing in Chromium 1248; dispatchTouchEvent swipes do, but slop floor ~60 px + load-dependent gain → pixel-exact touch landing not reproducible; prove reachability by touch, place worst case by programmatic scroll (78fb2d0).
|
||||
|
||||
## LRN-136 — Implementer gate claims need exit codes, controller reruns (2026-11-13)
|
||||
Pattern: subagent implementer claimed typecheck/lint green while red (Task 2, 18085ce: missing import, readonly fixtures). Caught only when controller reran gates rounds later.
|
||||
Apply: briefs demand real exit codes per gate; controller reruns typecheck + lint itself on every report before review. Never accept "green" without rc.
|
||||
|
||||
## LRN-137 — Template-built i18n keys escape typecheck (2026-11-13)
|
||||
Pattern: i18n key built by template literal (t(`editor.findings.new.${kind}`)) escapes typecheck: Dict typed as string map, missing key renders raw. Found in final round: editor.findings.new.category absent in fr+en, title showed raw key.
|
||||
Apply: every dynamic key site gets unit test asserting heading text has no 'editor.' prefix, or enumerate union kinds against both dicts in a test. Audit dynamic key sites in touched files at review.
|
||||
|
||||
## LRN-138 — Unblockable leave + no draft storage: content-free loss flag (2026-11-13)
|
||||
Pattern: browser Back not interceptable (BDR-078) + owner forbids storing drafts + owner forbids silent loss. Resolution: on unmount with dirty dialog write one content-free flag (kind + element key, scoped sheetId+userId) to sessionStorage, try/catch; next mount of same sheet+user shows notice once, clears flag. Relies on React 19 parent-first cleanup on deletion.
|
||||
Apply: any "cannot block leave, cannot keep data" conflict -> record the fact of loss, not the data, and tell user on return.
|
||||
|
||||
## LRN-139 — Navigation API cancels same-document Back traversal in Chromium (2026-11-14)
|
||||
Pattern: Navigation API `navigate` event on same-document traverse is cancelable in Chromium 156 (probe: CDP Page.navigateToHistoryEntry -3, userInitiated true, preventDefault keeps entry). Gives real "confirm before leave" for SPA Back/history-menu jumps without data router (BDR-078). Then navigation.traverseTo(destination.key) after user confirms; pass-through flag for that follow-up event.
|
||||
Apply: guard only when dirty + destination leaves route + event.cancelable; fallback (no API, Firefox/Safari unverified) = after-the-fact notice. e2e via CDP history jump; page.goBack with cancel times out. Probe browser behaviour with throwaway page before planning.
|
||||
|
||||
## LRN-140 — crypto.subtle missing on http LAN origin (2026-11-14)
|
||||
Pattern: crypto.subtle absent on non-secure origin (http LAN dev/trial address); loopback 127.0.0.1 counts secure so tests miss it. Async SHA-256 binding broke reload restore on owner trial origin + added blank first frame.
|
||||
Apply: for equality binding (not secret) use sync non-crypto hash (FNV-1a 64 BigInt) salted with random per-record value; test with crypto.subtle undefined. Check every crypto.subtle use against the LAN http origin.
|
||||
|
||||
## LRN-141 — Stacked modals: ask only removed layers; never rule silent loss into a limit (2026-11-14)
|
||||
Pattern: stacked modal layers + "ask all layers" guard: question appeared in lower dialog hidden under still-open upper modal (citations sheet) -> looks frozen. Also ruling "accept as documented limit" for silent loss broke owner condition; reviewer caught it.
|
||||
Apply: a guard asks only layers the move actually removes; before showing a question, close clean layers above the dirty one. Never rule a silent-loss case into "documented limit" when owner condition forbids silent loss: restore notice instead. Label limits owner did not see as "to confirm", never "accepted".
|
||||
|
||||
## LRN-142 — Transactional dialog owns side-effect creations and explicit commit (2026-11-15)
|
||||
Context: R2 closure, owner db:trial trials 2026-11-14/15 drove Rev 4-6. Pattern: in dialog that edits draft, side-effect creations (new reference) belong to draft, written with save as one batch (one undo); abandon = no write. Select browses only, explicit action button commits choice; save refuses pending uncommitted choice with message + focus. Reason: arrow keys on native select fire change, silent draft edits. Apply: any future transactional dialog (U2 annotation properties dialog).
|
||||
|
||||
## LRN-143 — E2E cleanup on persistent stack: archive own rows by captured id + name read-back (2026-11-17)
|
||||
Context: R4 e2e on persistent sandbox seeded published sheets; app never deletes sheet with published history (`delete_anatomical_sheet` refuses + needs aal2). Pattern: clean only own rows: capture ids at seed, UUID-guard every id before SQL text (`capturedId`), read name back by id and compare exact seeded name (mismatch → archive nothing, fail run), archive via app's status RPC, revoke own grant by id, read back; data guard before/after (0 removed, 0 changed). Never match by pattern.
|
||||
Apply: e2e fixtures on shared persistent stack → reachable end state (archive) over delete; identity check by id + name before any write; guard diff proves no pre-existing row touched.
|
||||
|
||||
## LRN-144 — Per-card retry in lists: no live line, polite region on retry, focus rule (2026-11-17)
|
||||
Pattern: list of N cards each with own failure + retry. No live region on card lines (burst of N announcements at load). Retry: line + button stay mounted, button aria-disabled (not disabled, keeps focus), card aria-busy, clicks ignored by ref guard (two calls same tick = one attempt). Polite sr-only region empty at load, cleared at each attempt, says new line on repeat failure; stays mounted once a retry ran. When attempt settles without « Réessayer », move focus to card's « Consulter » only if focus was on removed button or body.
|
||||
Apply: any per-item retry in lists/grids; test focus on body vs elsewhere, repeat failure, failure with no retry left.
|
||||
|
||||
## LRN-145 — Single-request failure e2e via route.fallback + remount; 0fr grid row keeps child padding (2026-11-17)
|
||||
Pattern: (1) Playwright: fail one request (one version) with route.abort for its URL and route.fallback() for the rest; remount the component (search filter out/in) instead of page reload so failure state is reached without reload side effects; DevTools offline + search is the manual equivalent. (2) CSS collapse grid-rows 0fr→1fr: padding/border on the 0fr row's direct child stays visible (R3 phone panel kept 12 px); put padding on an inner wrapper inside the min-h-0 overflow-hidden child, assert closed height 0.
|
||||
Apply: single-request failure e2e; any CSS-only collapsible panel.
|
||||
@@ -8,7 +8,10 @@ paths: ["crates/core/src/domain/**", "packages/core-wasm/tests/n-1/**"]
|
||||
`packages/domain` was deleted at R5.7; its byte-identical Zod copy under `packages/core-wasm/tests/n-1` is the
|
||||
permanent N-1 reader. Never change a contract
|
||||
without bumping the version on a breaking change (additive optional fields keep it); a change touches the
|
||||
Rust struct, the regenerated ts-rs types and the N-1 test
|
||||
Rust struct, the regenerated ts-rs types and the N-1 test. A new optional field of the sheet document is omitted when
|
||||
absent and refuses `null` (`skip_serializing_if`, `js::present`, `ts(optional)`), so existing fingerprints stay
|
||||
equal and the ts-rs type stays assignable to N-1; the V1-2.6 category keys also need the proofs of
|
||||
`docs/development/V1-2-6_UX_COMPATIBILITY.md` §8 (T2)
|
||||
- Every report entering the store comes from the core (new report, draft restore, import, reducer outputs);
|
||||
form values are plain assignments (D-R7)
|
||||
- Report version 3: zones by `(annotationId, viewId)`, findings by `(findingZoneId, path)`, severities
|
||||
|
||||
@@ -1,17 +1,43 @@
|
||||
---
|
||||
paths: ["crates/core/src/domain/sheet/**", "docs/development/ANATOMICAL_SHEET_MODEL.md", "supabase/seed/anatomical-sheets/**", "crates/core/src/bin/upload_sheet_assets/**"]
|
||||
paths: ["crates/core/src/domain/sheet/**", "docs/development/ANATOMICAL_SHEET_MODEL.md", "docs/development/V1-2_ANATOMICAL_SHEETS.md", "supabase/seed/anatomical-sheets/**", "crates/core/src/bin/upload_sheet_assets/**"]
|
||||
---
|
||||
|
||||
# Anatomical sheet model (crates/core/src/domain/sheet + migration 20261008110000)
|
||||
- `docs/development/ANATOMICAL_SHEET_MODEL.md` is the source of truth: document shape, issue codes, tables, RPCs.
|
||||
- `docs/development/ANATOMICAL_SHEET_MODEL.md` is the source of truth for the model as built: document shape, issue
|
||||
codes, tables, RPCs. `docs/development/V1-2_ANATOMICAL_SHEETS.md` holds the ratified V1-2 rules (O1-O23, BDR-082):
|
||||
every V1-2 change follows it, and V1-2.9 folds it back into the model file.
|
||||
- Ids are stable slugs never derived from labels; labels are `{ fr, en }` objects. Annotation → findings is the
|
||||
explicit `finding_zone_id`; vertebral regions are ordered data with free codes. No label matching at runtime.
|
||||
- A published version is immutable (trigger, every role). Change = new draft (`create_sheet_draft`) then
|
||||
`publish_sheet_version`. Integrity rule codes are shared by `validate_sheet_document` (Rust core) and
|
||||
`private.sheet_document_issues` (SQL); add a rule on both sides and in the spec table.
|
||||
- A published version is immutable (trigger, every role) and, from V1-2, never deleted, even deprecated. Change = new
|
||||
draft (`create_sheet_draft`) then publication; from V1-2, publication only from an approved round on a server
|
||||
verdict of the core.
|
||||
- The Rust core is the only authority on document rules (O22): add a rule to `validate_sheet_document` and to the spec
|
||||
table only. A rule that must not strip existing fingerprints or reject old snapshots lives in `edit.rs` (editor
|
||||
refusals) and in the verdict-only tier of `sheet_report`, never as a `validate.rs` error (V1-2.6 fixed categories,
|
||||
T4). V1-2 (M5) dropped the SQL mirror (`private.sheet_document_issues`); SQL keeps the structural and relational
|
||||
guards, the declared status check and, from V1-2.6 U6, the two declared fixed-category checks (save
|
||||
non-regression; approval and publication), which hold the fixed-category invariants only (contract §12.2,
|
||||
§17.12). Never add any other business rule in SQL.
|
||||
- Document schema change → bump `SHEET_DOCUMENT_SCHEMA_VERSION`, extend the SQL CHECK on `document_schema_version`.
|
||||
- Official equine sheet = generated seed `draft/` (`pnpm import:equine --out` into an empty folder, then reviewed and copied; never edit `legacy-import/` or `draft/` by hand;
|
||||
`curation_draft` / `curation_review` fail on drift, `pnpm import:equine --check` lists it). Every content change goes through `curation/changes.json` (traced in CHANGELOG.md).
|
||||
It is a DRAFT until a platform admin publishes it after business review of `REVIEW-REPORT.md`.
|
||||
- Sheet SVG bytes live in Storage bucket `anatomical-sheet-assets` as `<sha256>.svg`; uploads are an operator task
|
||||
(`pnpm assets:upload <seed dir>` with the service key in env), never from the browser.
|
||||
No bump during V1-2 (BLK-008). Ratified exception (V1-2.6 T2, BDR-100, BDR-101): an optional key omitted when
|
||||
absent (`skip_serializing_if`, `js::present`, `ts(optional)`, an explicit `null` refused, never defaulted in the
|
||||
fingerprinted document) is not a version change; it ships only with the proofs of
|
||||
`docs/development/V1-2-6_UX_COMPATIBILITY.md` §8, and its first write is a point of no return (one-way
|
||||
compatibility, never called full backward compatibility).
|
||||
- Historical equine sheet `503dc301…` = generated seed `draft/` (`pnpm import:equine --out` into an empty folder, then
|
||||
reviewed and copied; never edit `legacy-import/` or `draft/` by hand; `curation_draft` / `curation_review` fail on
|
||||
drift, `pnpm import:equine --check` lists it). Its content changes only through `curation/changes.json` (traced in
|
||||
CHANGELOG.md), and the pipeline stays unchanged during V1-2. It is never published; equine work moves to an
|
||||
application working copy (O17), whose publication is an owner act after the business review.
|
||||
- Sheet SVG bytes live in Storage bucket `anatomical-sheet-assets` as `<sha256>.svg`, never overwritten. Until M5
|
||||
(V1-2.1) uploads are an operator task (`pnpm assets:upload <seed dir>`, local stacks, service key in env); from M5,
|
||||
editors upload from the application after the core's cleaning, and the worker verifies every submitted revision (M6).
|
||||
- Omitted `review_status` means `inherited` (`#[serde(default)]`): any check on statuses treats an absent value as
|
||||
`inherited`.
|
||||
- Since V1-2.2 the core also holds the review model (`review.rs`: groups, digests, `coverable`, change list), the server
|
||||
verdict (`verdict.rs`, the shape the M5 SQL reads; the function is never exported to the browser, only its TypeScript type for the
|
||||
review screen), the document measure (`size.rs`:
|
||||
PostgreSQL's `jsonb` text, never `JSON.stringify`), `PreviewSheet` and the editor's commands (`edit.rs`, the §6.6
|
||||
marking rules). A change to the SVG reader, the rules, the caps, the fingerprint or the digests is a core change
|
||||
(contract §6.4: the release withdraws the rounds of drafts in flight; a published version's round stays approved).
|
||||
RUST.md §12.
|
||||
+266
-10
@@ -380,10 +380,10 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- [x] V1-1 functional contract `docs/development/V1-1_OWNERS_ANIMALS.md` (no code); correction: inventory criterion 4 (validation in crates/core) contradicted D-R7 → form constraints TS + SQL CHECK + parity test (EVAL-034)
|
||||
- [x] owner orientations D1-D9, D16, C4-C6 integrated as proposals (§9.1, SQL / permission impact marked); sub-choices D4a, D6a, D6b, D7a, D9a (§9.2); D10-D15, D17 kept open (§9.3); legal basis, client information, retention framed before public exposure (§9.4)
|
||||
- [x] owner ratification 2026-10-25 (brief « V1-1 : ratification des décisions métier et préparation de l'implémentation », BDR-073): D1-D9a, C4-C6, D16, D15 principle, naming
|
||||
- [ ] V1-1 clients and animals: branch `feature/v1-1-clients-animals` (gitflow start off develop 5502617, pushed); contract `docs/development/V1-1_OWNERS_ANIMALS.md` (§3 nomenclature, §8 SQL, §9 RLS/RPC, §10 D15, §11 UI, §12 tests, §13 decisions). Each step = commits on this branch; owner validates after V1-1.1 and after the first UI step; merge into develop only on the owner's go. Gates every step: `pnpm typecheck && pnpm test:run && pnpm lint`; SQL steps also `pnpm db:reset && pnpm db:test`, `pnpm db:types:check`; UI steps through the design toolchain (Build UI) following `docs/design/`.
|
||||
- [x] V1-1 clients and animals (MERGED into develop 2026-10-27 on the owner's go, no-ff 9135d73; M1-M3 applied to DEV 2026-10-27; branch kept): branch `feature/v1-1-clients-animals` (gitflow start off develop 5502617, pushed); contract `docs/development/V1-1_OWNERS_ANIMALS.md` (§3 nomenclature, §8 SQL, §9 RLS/RPC, §10 D15, §11 UI, §12 tests, §13 decisions). Each step = commits on this branch; owner validates after V1-1.1 and after the first UI step; merge into develop only on the owner's go. Gates every step: `pnpm typecheck && pnpm test:run && pnpm lint`; SQL steps also `pnpm db:reset && pnpm db:test`, `pnpm db:types:check`; UI steps through the design toolchain (Build UI) following `docs/design/`.
|
||||
- [x] V1-1.0 preparation (docs only): branch checks (develop = origin/develop 5502617, tree clean, P0 merged dae74e0; two stale R5.6 rehearsal worktrees in an old session scratchpad hold edits, left untouched); contract statuses approved; nomenclature; SQL schema M1-M4; helpers, RLS, RPCs, failures, definer statement; D15 thresholds; journeys, forms, a11y; pgTAP/e2e/Playwright plan; decisions N1-N9, D10-D14, D17, U1-U3; BDR-073; OPEN_QUESTIONS C4/C5/C6/Q6; plan Step 10/12 notes; DOMAIN_MAP, CLAUDE.md, README, TEST_STRATEGY citations; 3 fresh plan challengers (correctness, robustness, simplicity: CONCERNS, findings integrated: search keys, phone search, GoTrue admin path, correlation header cap, idempotent creates, locks, identical errors, backfill function, behavioural parity, Chromium-only V1-1, beforeunload guard, derived values, 6 steps / 3 migrations)
|
||||
- [x] CHECKPOINT: owner validated the contract architecture + N1-N9 2026-10-25 (brief « Validation du contrat V1-1 et autorisation de V1-1.1 Workspaces »); D10-D14, D17, U1-U3 stay contract-level until their UI steps; only V1-1.1 authorised
|
||||
- [ ] V1-1.1 Workspaces foundation (owner brief 2026-10-25; isolated test DB only, DEV stack untouched, stop at checkpoint)
|
||||
- [x] V1-1.1 Workspaces foundation (owner brief 2026-10-25; isolated test DB only, DEV stack untouched, stop at checkpoint)
|
||||
- [x] contract: N1-N9 as decided (N4 voiding instead of deletion, N6 budget per workspace + concurrency rule, N7 effective-privilege wording, N9 metadata list), M1 as-built notes
|
||||
- [x] M1 `20261025100000_workspaces.sql`: enums, tables, deferred personal-holder invariant, `ensure_personal_workspace` + trigger + backfill, helpers, `log_event` correlation cap + NOT VALID CHECK, grants (service_role included), RLS
|
||||
- [x] pgTAP `012_workspaces.sql` + `001_schema.sql` census; schema-types map; config test (`enable_confirmations`, schemas)
|
||||
@@ -400,7 +400,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Acceptance: gates green; every account of `seed.sql` has one workspace + holder row after `pnpm db:reset`
|
||||
- Security: no platform-role branch; no `using (true)`; helpers `search_path = ''`, EXECUTE only where evaluated; email confirmation checked in SQL; `log_event` callers unchanged
|
||||
- Stop if: `auth.users` join behaves differently on PGlite and the real stack; the profiles trigger interferes with `handle_new_auth_user` or sign-up; an existing policy would need editing beyond the `log_event` redefinition
|
||||
- [ ] V1-1.2 Clients data (owner brief 2026-10-25; isolated stack only; DEV untouched; stop at checkpoint before V1-1.3)
|
||||
- [x] V1-1.2 Clients data (owner brief 2026-10-25; isolated stack only; DEV untouched; stop at checkpoint before V1-1.3)
|
||||
- [x] M1 closure: types re-checked with the official generator against an isolated DB holding M1 (diff 0); sandbox tool committed (`scripts/db-sandbox.sh`, `pnpm db:sandbox`: rootless, loopback, own ports, no volume, generated secrets outside Git, fresh + upgrade, official `supabase test db` / `gen types` via `--db-url`); owner DEV procedure for M1 (target, history, backup incl. auth, restore check, `db:test` non-destructive check) rehearsed on the sandbox; LRN-080/081
|
||||
- [x] M2 `<ts>_clients.sql`: unaccent, `private.fold_text`, `client_kind`, `clients` (+ `create_request_digest` for divergent replays), budget table + `private.consume_write_budget` (UTC fixed hour/day windows, row lock, last lock taken), RPCs create/update/set_archived/search, N9 audit policy, grants, RLS
|
||||
- [x] pgTAP 013; harness loads unaccent; `field-limits.ts` + behavioural parity test; types; census
|
||||
@@ -416,7 +416,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Acceptance: gates green; e2e green on the local stack; measurement written in the contract
|
||||
- Security: constraint and parse errors caught inside RPCs; text parameters parsed in the body; search through POST; definer census
|
||||
- Stop if: `unaccent` cannot load on PGlite or the CLI stack; the measurement is above 100 ms p95 (index decision for the owner); a CHECK cannot be mirrored in TypeScript
|
||||
- [ ] V1-1.3 UI foundations (owner brief 2026-10-25 « Validation V1-1.2 et autorisation V1-1.3 Socle UI »; no M3, no client/animal screen, DEV untouched, stop at checkpoint)
|
||||
- [x] V1-1.3 UI foundations (owner brief 2026-10-25 « Validation V1-1.2 et autorisation V1-1.3 Socle UI »; no M3, no client/animal screen, DEV untouched, stop at checkpoint)
|
||||
- [x] V1-1.2 closure: db:sandbox final check (fresh, upgrade, types, argv scan, negative cases, DEV fingerprint); defect `up` bad args started containers → fixed 57922e0, rerun green
|
||||
- [x] owner choices 2026-10-25: e2e backend = isolated stack (Playwright routes Supabase calls to `pnpm db:sandbox`); scripts `pnpm e2e:ui` (no backend) + `pnpm e2e:shell` (sandbox); MobileDrawer on the same modal mechanism; check:all runs e2e:ui when the pinned Chromium is installed, else an explicit SKIPPED line
|
||||
- [x] `ModalDialog` primitive on native `<dialog>` + `showModal()` (platform inertness, Escape via keydown/cancel → onClose, consumer decides, opener restore + nearest-container fallback, scroll lock CSS); `Dialog` on it (aria-labelledby title, optional `description` → aria-describedby); confirmation consumers pass their message as description; `MobileDrawer` on it (closes at lg)
|
||||
@@ -436,7 +436,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Acceptance: smoke green; axe 0 serious/critical on the smoke screens, or pre-existing violations listed under RR-7
|
||||
- Security: dependencies named with purpose; lockfile reviewed; no secret in fixtures or reports
|
||||
- Stop if: the Chromium download is refused or fails (owner decides); a fix outside V1-1 scope would be needed for axe
|
||||
- [ ] V1-1.4 Animals and relations data (owner brief 2026-10-26 « Validation V1-1.3 et autorisation V1-1.4 Animaux et relations »; isolated stack only; DEV untouched; no screen; stop at checkpoint before V1-1.5)
|
||||
- [x] V1-1.4 Animals and relations data (owner brief 2026-10-26 « Validation V1-1.3 et autorisation V1-1.4 Animaux et relations »; isolated stack only; DEV untouched; no screen; stop at checkpoint before V1-1.5)
|
||||
- [x] V1-1.3 closure: owner validated (CONFORME 8/8, security PASS, check:all green)
|
||||
- [x] V1-1.3 follow-ups asked by the brief §2 (test code only): axe KNOWN exceptions scoped to their route and node html so a new screen never inherits them; check:all prints an explicit PASSED / SKIPPED (env missing) / NOT RUN line per browser suite, failure stays a stop
|
||||
- [x] M3 `20261026100000_animals_relations.sql`: species rows (8 + other) + table comment; `animal_sex`, `animal_relation_role`; `animals` (+ `create_request_digest`), `animal_client_relations` (composite FKs, partial unique index current = not ended and not voided, digest); `private.latest_record_date(timestamptz)` (tomorrow UTC, testable); RPCs `create_animal` (optional initial relation, 2 audited writes), `update_animal`, `set_animal_archived`, `create_animal_client_relation`, `end_animal_client_relation`, `update_animal_client_relation`, `void_animal_client_relation`; reads `search_animals`, `list_client_animals` (cursor `sort_key` = current/former prefix + name_key), `client_archive_preview`; `search_clients` dropped and recreated with `current_animal_count`; lock order workspace → animal → relation → client → budget; caps 20 000 animals, 20 current / 200 total per animal, 100 000 per workspace (every row counts toward the totals, voided and ended included); grants, RLS
|
||||
@@ -457,7 +457,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Acceptance: gates green; e2e green; local tool and PDF unchanged
|
||||
- Security: same whole error for every foreign id; FK proof independent of the RPC; animal-then-client lock order
|
||||
- Stop if: N1, N4, N5 or N8 undecided; any change needed in report, sheet or editor code; the D9a guard blocks a flow the owner did not foresee
|
||||
- [ ] V1-1.5 Clients UI (owner brief 2026-10-26 « Validation V1-1.4 et autorisation V1-1.5 Interface Clients »; isolated stack only; no animal screen; stop at checkpoint before V1-1.6)
|
||||
- [x] V1-1.5 Clients UI (owner brief 2026-10-26 « Validation V1-1.4 et autorisation V1-1.5 Interface Clients »; isolated stack only; no animal screen; stop at checkpoint before V1-1.6)
|
||||
- [x] V1-1.4 closure: owner validated (CONFORME 11/11, security PASS); species_filter + replay order accepted
|
||||
- [x] owner choices 2026-10-26: U1 « Afficher plus » (keyset, page of 25 + 1 probe); U2 « Archivés » toggle; client page animals = read-only list (list_client_animals, no link, no add); « premier animal » section deferred to V1-1.6
|
||||
- [x] access layer `packages/supabase/src/{workspaces,clients,species,records}.ts`: personal workspace read, client reads/RPCs with explicit columns, keyset cursors, closed RecordFailure kinds (contract §9.4 + network, session_expired), Zod-checked RPC results; unit tests + real-PostgREST sandbox test of the same functions
|
||||
@@ -502,7 +502,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Acceptance: `pnpm check:all`; `pnpm db:reset && pnpm db:test`; fresh verifier + security gates; owner LAN check → merge only on the owner's go
|
||||
- Security: as V1-1.5; final RPC surface census for RR-4; guardrails on the new tables
|
||||
- Stop if: any gate red; any finding HIGH/CRITICAL; as V1-1.5
|
||||
- [ ] V1-1 DEV integration checkpoint (owner brief 2026-10-26 « Validation finale V1-1 et préparation de la recette DEV »; Claude reads DEV only; backup, migration, acceptance and merge are owner actions; no new feature, no migration, no merge)
|
||||
- [x] V1-1 DEV integration checkpoint (owner brief 2026-10-26 « Validation finale V1-1 et préparation de la recette DEV »; Claude reads DEV only; backup, migration, acceptance and merge are owner actions; no new feature, no migration, no merge)
|
||||
- [x] git: branch = origin 9f585e9, clean; develop 5502617, main 605ee7c, release/0.2.0 f8d9425 = origin; branch adds exactly M1-M3
|
||||
- [x] read-only DEV preflight (session forced read-only): 9 applied + M1-M3 pending, nothing remote-only, no linked project, no V1-1 object present, types drift = 24 names added 0 removed, 6 accounts = 6 profiles, storage 2 objects / 11 volume files, purge queue 13 due
|
||||
- [x] scripts read: supabase.sh / dev-env.sh (local CLI, no remote), CLI 2.120.0 `test db` creates + drops pgtap, `supabase status` prints keys, e2e:avatar writes beyond its fixture (temp account, bob sign-in, purge-queue drain)
|
||||
@@ -511,16 +511,16 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- [x] owner brief « dernière correction de la validation des sauvegardes »: 26 vs 28 = report double count (log has 26); rehearsal 2 on sandbox (156 MB, 4 variants, real exit codes): `--no-owner` exit 1 / 26 errors, `--no-acl` exit 1 + app grants lost, `--exit-on-error` exit 1 at COPY, filtered TOC + `--single-transaction --exit-on-error` exit 0, 28 rows + 15 privilege lines identical; §3.3 step 2 adds privs.sql + managed.sql (vault 0, D default ACL), step 3b = filtered list (D + 8 entries, DEV D=21 → 29), doc block replayed verbatim exit 0; DEV + sandbox unchanged; LRN-091
|
||||
- [x] steps 0-3b run by Claude on the owner's authorization (2026-10-27): preflight = 2026-10-26, vault 0, D 21; dump + Storage tar in `~/faunosteo-backups` (600, dump sha256); restore check run 1 exit 1 (role `supabase_functions_admin` missing in the sandbox), owner option A (NOLOGIN role, sandbox only), run 2 exit 0, 28 + 15 lines identical; LRN-092
|
||||
- [x] step 4 run by Claude on the owner's authorization: `migration up` exit 0, exactly M1-M3; post.sql, counts deltas, types check all as expected; DEV data unchanged
|
||||
- [ ] `pnpm db:test` on DEV: run 1 exit 1 (919 planned, 915 run, 914 passed: 007 storage collision, 010 13 due purge entries; 012-014 passed; DEV unchanged, pgtap absent after)
|
||||
- [x] `pnpm db:test` on DEV: run 1 exit 1 (919 planned, 915 run, 914 passed: 007 storage collision, 010 13 due purge entries; 012-014 passed; DEV unchanged, pgtap absent after)
|
||||
- [x] 007 + 010 made independent of the base's data (007: seed key only, confirmation cleared in-tx, 20 assertions; 010: section 0 leases the base's queued work in-tx, leftovers by fixture prefix, 141); sandbox A clean + B DEV-like and latent conditions: old FAIL reproduced, new PASS 921; 11 mutations detected on A and B (same set as the old suites); LRN-093
|
||||
- [x] rerun on DEV on the owner's go (2026-10-27): exit 0, 14 suites, 921 assertions, 83 integrity lines identical before/after, pgtap absent after
|
||||
- [x] owner: browser acceptance on DEV (2026-10-27): 19 lines FR detailed, EN validated as a whole + 4 lines at 375 px recorded, isolation A/B/owner; RESP-01 closed (fixed a70166e, owner counter-check 6 PASS); AVATAR-01 class A, non-blocking (DEV worker stays stopped, Alice's `uploaded` row kept)
|
||||
- [ ] post-acceptance fixes (owner brief « corrections post-recette RESP-01 et diagnostic AVATAR-01»; no DEV write, no worker on DEV, no migration, no merge)
|
||||
- [x] post-acceptance fixes (owner brief « corrections post-recette RESP-01 et diagnostic AVATAR-01»; no DEV write, no worker on DEV, no migration, no merge)
|
||||
- [x] RESP-01: owner's global overflow = browser zoom (owner's manual DEV measures, no zoom: /app and /app/clients 375 + 320 no overflow); real defect shown on the sandbox: dashboard grid has no explicit column below md, its implicit `auto` track takes the cards' min-content, the account card's e-mail never truncates → overflow from ~31 chars at 320 px, 44 chars overflow 320-430 px. Fix: explicit one-column track, e-mail wraps instead of being cut
|
||||
- [x] RESP-01 tests: e2e:shell responsive sweep 320/360/375/390/430 + desktop, FR/EN, long content (dashboard, client list/new/edit/page, animal list/new/edit/page, archive dialogs, drawer), e-mail fully visible
|
||||
- [x] AVATAR-01: read-only DEV (clean photo kept, attempt `uploaded` 0 attempts + quarantine object, superseded one `deleted`, worker stopped 10 days) = STORAGE.md §4 step 4 by design; isolated repro on the sandbox: worker stopped → 30 s → message + row `uploaded`; worker on the sandbox network → `clean`; classified A (expected without a worker; side finding pre-V1-1: a full reload does not resume the waiting row); open until the owner decides how DEV runs the worker
|
||||
- [x] gates: check:all, fresh verifier, security audit; docs (recette registry, SUPABASE.md acceptance note), registries; commit + push. Done: check:all exit 0 (cargo 1548 passed / 3 ignored, vitest 566 + 127 + 60, e2e:ui 26), e2e:shell sandbox 86 passed, responsive 4/4 after the fixture domain fix; verifier CONFORME 8/8; security PASS (2 LOW: fixture domain applied, pre-existing uuid interpolation noted); LRN-094. Next: owner counter-check of the dashboard at 375 px on DEV
|
||||
- [ ] after the owner's results: fixes if any (branch, gates, fresh verifier + security), CHANGELOG Unreleased, TODO closure, final report; merge only on the owner's explicit go
|
||||
- [ ] after the owner's results: fixes if any (branch, gates, fresh verifier + security), CHANGELOG Unreleased, TODO closure, final report; merge only on the owner's explicit go. State 2026-10-27: owner results in, no further fix, TODO closure done (V1-2.0), merged 9135d73; still open: no CHANGELOG Unreleased « Added » entry for V1-1 (only the RESP-01 fix is listed)
|
||||
- Owner cleanup (optional): rehearsal leftovers `/tmp/claude-1000/-home-bchanot-Documents-faunosteo/8d6890e5-060c-431d-b99f-545f2e315333/scratchpad/rehearsal/` (3 small files, fictitious data); the backup folder `~/faunosteo-backups` is kept until the acceptance is validated
|
||||
- [ ] AVATAR-02 (ticket, out of V1-1; not created in Gitea: no Gitea CLI or token on this machine, `gh` is GitHub only) « Reprendre le suivi d'une photo en attente après rechargement de la page »
|
||||
- Context: avatar processing is asynchronous (STORAGE.md §4): begin → quarantine upload → confirm (`uploaded`) → worker → `clean` / `rejected`; the page polls its own row 1 s, 30 s at most
|
||||
@@ -531,6 +531,241 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- Tests: unit (store arrives after mount), e2e:shell on the sandbox with the worker stopped and running (gateway + worker on the sandbox network, as the AVATAR-01 repro); never DEV
|
||||
- Limits: frontend only; no Storage contract, RPC, RLS, worker or migration change without owner approval
|
||||
- [ ] Code debt (not P0, no change on the doc branch): `docker/nginx.conf` still has `location /species/` (public/species deleted at Step 5); remove with its own `chore/` or `bugfix/` branch
|
||||
- [ ] V1-2 anatomical sheets from Supabase + official sheet administration (owner briefs 2026-10-27 « V1-2 : cadrage » and « V1-2.0 : contrat fonctionnel et technique »; D1-D8 orientations approved, D9 admin requirement mandatory, BDR-081). Branch `feature/v1-2-anatomical-sheets` (off develop 9135d73, worktree outside the main tree while the recette server runs). Contract `docs/development/V1-2_ANATOMICAL_SHEETS.md` = the plan (steps §16, decisions §17). No implementation, migration, DEV write, seed or equine publication before the owner ratifies the contract; merge only on the owner's go
|
||||
- [ ] V1-2.0 contract and decisions (docs only): read-only audit delivered; contract drafted; 3 fresh plan challengers (correctness, robustness, simplicity); doc fixes (V1-1 status in TODO + V1-1 contract header, CLAUDE.md M1-M3 line); challengers FATAL(2 blockers)/FATAL(1)/CONCERNS integrated (contract §19); STOP at checkpoint: owner ratification of §5-§16 and options O1-O20
|
||||
- [x] owner review of O1-O20 delivered (2026-10-28, read-only); O21-O23 proposed (catalogue access, SQL mirror, failed verification)
|
||||
- [x] owner ratified O1-O23 (brief « V1-2.0 : ratification des arbitrages O1 à O23 et consolidation du contrat », 2026-10-28, BDR-082)
|
||||
- [ ] consolidation (docs only): contract rewritten (decisions §17, contradictions C1-C14 §19.2, steps §16 with 9 headings each); IMPLEMENTATION_PLAN §0 + Steps 13/17 notes, ANATOMICAL_SHEET_MODEL stale Zod/TS mentions + V1-2 pointer, OPEN_QUESTIONS conflicts 1-2, V1-1 §5.4 pointer (N1 amended), rule sheet-model, CLAUDE.md pointer; 3 fresh challengers (business CONCERNS 3 major, security FATAL 1 arbitration + 6 major, simplicity CONCERNS 5 major) integrated (contract §19.3); commit + push branch; STOP at checkpoint: owner final review, no V1-2.1
|
||||
- [x] AR-1 ratified option B by the owner 2026-10-28 (BDR-083): `aal2` on every platform role change; contract §5.7 (rule, inventory, bootstrap, factors, recovery, sessions), F17-F19, M4 scope, tests §15, DEV order §16.11 (enrol before M4); docs only; independent security review then commit + push; no code, migration or DEV change
|
||||
- [ ] V1-2.1 server access and workflow (M4, M5): owner go 2026-10-28 (brief « V1-2.1 : SQL, habilitations et cycle de vie »); sandbox only, DEV untouched; STOP at checkpoint (report §14). State 2026-10-28: BUILT + TESTED on sandbox, checkpoint report delivered; VERIFIED by the owner 2026-10-29 at ac71c5b (M4/M5 accepted for the branch, not for DEV or production); BDR-084, LRN-095
|
||||
- [x] A prep: worktree deps; sandbox (old schema) service_role grants recorded (ALL on 7 tables → 0 after F12); F1-F17,F19 reproduced on old schema (repro_old.out), F18 two-session race
|
||||
- [x] B M4 `20261028100000_sheet_access_hardening`: grants table + rights RPCs; has_mfa / has_aal2_session / grant_active / caller_has; catalogue reader predicate + policies; can_edit_sheet on capability (F14); AR-1 B role RPCs + private writers (F19), F17, F18 advisory lock; F1 F3 F5 F6 F8 F9 F12 F13 F15 F16; historical-sheet + asset triggers; fork/visibility/personal-create dropped; shim auth.sessions + auth.mfa_factors; pgTAP 015 + 001/003/004 adapted
|
||||
- [x] C M5 `20261028110000_sheet_review_workflow`: version/sheet columns, version guards (content/revision/author, freeze, publish gate, deprecation), rounds/comments/acks, lifecycle + review + publish(review_id) RPCs, species RPCs, working copy, read RPCs, upload (register, confirm with storage check F7, INSERT policy, 2 MiB), operator read RPC, mirror dropped + `sheet_all_reviewed`, superseded signatures dropped; pgTAP 016 + 005/006/007 rewritten, 008/011 deleted, Rust generator trimmed + ledger retargeted
|
||||
- [x] D packages/supabase `sheets.ts` (closed SheetFailure kinds), old `anatomical-sheets.ts` gate + test deleted, types regenerated (no drift), schema-types map updated; upload tool `row_state` on `get_sheet_asset_state`
|
||||
- [x] E sandbox: real GoTrue MFA (totp.ts/mfa.ts helpers), aal1 refused / aal2 allowed on the role RPC, target-factor required, F18 cross-revoke leaves one owner; fresh install + M3→M5 upgrade green; V1-1 regression (65 sandbox tests) green
|
||||
- [x] F gates: rust:check, wasm:build, typecheck, test:run (566 app + 122 supabase), lint, build, db:types:check, sandbox test-db (850) + test (65) all green; BDR-084 + LRN-095 + journal; commit + push. NOT done: fresh verifier + security gates (owner to run); at-caps timing (needs the V1-2.2 synthetic doc); fuller MFA factor-management matrix → V1-2.5; exhaustive two-session concurrency beyond F18; check:all Docker image/worker stages not re-run (no app/worker/Dockerfile change)
|
||||
- [ ] G corrections after the independent audit (owner brief 2026-10-28 « V1-2.1 : corrections après audit indépendant »; verdict CHANGES REQUIRED on 3914eaa, verifier M1-M7 + L1-L11): M4/M5 edited in place (never applied to DEV); sandbox only, DEV untouched; STOP at checkpoint, no V1-2.2
|
||||
- [x] G1 M1 `decide_sheet_review`: lock sheet → version → round, refuse an inactive or historical sheet; pgTAP; two-session archive vs approve
|
||||
- [x] G2 M2 `create_sheet_draft`: base only from a `published` version with `published_review_id`; pgTAP: deprecated and pre-M5 sources give no base, every group to cover
|
||||
- [x] G3 M3 pgTAP coverage from the verifier list (§5.3 matrix, F14 per RPC and policy + capability at aal1, F2, F8/D8, submit conflict, `review.uncoverable`, `publish.drawing.changed`, no carry for an author, removal group, `verdict.*`, species refusals, working copy slot / unchanged / verbatim, historical triggers, table-owner immutability + deprecation freeze, document guards at save, 2 MiB asset, species mismatch, one draft, number never reused, deactivated, Storage key variants, service_role confirm, SVG mime); no SQL-mirror test restored. Done: 017 rules (77), 018 access matrix (337), 019 immutability + Storage (38); 006/016 adapted; PGlite 125/125
|
||||
- [x] G3b found while testing: withdrawal of a published version's round (now `draft.not_a_draft`, lock version → round); approver in the author set refused at publication too (§6.7); working-copy slot race (historical row lock) and restore while another copy is active
|
||||
- [x] G4 LOW: stale refs (`mfa.sandbox.ts`, LEDGER 011 note, sheet-model rule) + shim-vs-image column test; write budget on the 10 unmetered RPCs; `rights.mfa` before `rights.capability`; slug collision closed code; `view.asset.unknown` at submit; INSERT policy = registering caller; acknowledgments append-only; deprecate locks the sheet first (two-deprecation race); `delete_sheet_asset` closed codes + historical; red-on-old evidence + service_role grants record versioned
|
||||
- [x] G5 M5 sandbox suite re-runnable (F18 restores the other owners, workspaces uses its own owner); full suite twice on one stack
|
||||
- [x] G6 M4 the six two-session scenarios of §15 + archive vs approve + revoke vs grant; at-caps timing (synthetic document: 1 024 annotations, 8 192 nodes, 64 views, depth 8)
|
||||
- [x] G7 M7 upgrade rehearsal from the M3 state with a drawing-object fixture (Git bytes, sha256 = DEV row), bytes and metadata before/after; DEV-copy criterion → owner decision
|
||||
- [x] G8 AR-1 on the upgraded stack: seed owner with two factors works at aal2, refused at aal1; without a factor usable at aal1 except roles and rights
|
||||
- [x] G9 gates: pgTAP fresh + upgraded, PGlite, unit, sandbox ×2, types, check:all; fresh verifier + security audit
|
||||
- [x] M6 `grant.self_review`: divergence and proposal presented; owner decision → H1
|
||||
- [x] H owner final decisions (brief « V1-2.1 : décisions finales du propriétaire », 2026-10-28, on 2af61e7): M4/M5 edited in place, sandbox only, DEV untouched; STOP at checkpoint, no V1-2.2, no merge
|
||||
- [x] H1 M6 option A: drop `grant.self_review` (M4, sheets.ts kinds); keep author ≠ reviewer at ack/approve/publish, MFA, eligibility; pgTAP: owner self-grants reviewer ok, owner-reviewer approves another's draft ok, owner approving own draft refused, publish after an author's approval refused
|
||||
- [x] H2 M7 Git fixture accepted: contract §12.3/§15/§16.2 + evidence say Git fixture with sha256 = DEV row, bytes/metadata/relations before/after, no DEV Storage read, live DEV object integrity not shown
|
||||
- [x] H3 size measure = contract `octet_length(content::text)` (UTF-8 bytes of the jsonb text form): drop `pg_column_size` from `check_document_structure`, M5 replaces the base table CHECK by the text measure; contract defines the form for SQL, TS, Rust; pgTAP: cap − 1, cap, cap + 1, multibyte, dense (jsonb > cap, text ≤ cap) accepted; refusals `document.too_large`
|
||||
- [x] H4 gates: pgTAP fresh + upgraded, PGlite + unit, sandbox suite ×2, concurrency, fresh + M3→M5 (M7 rehearsal), types, check:all; fresh verifier + security on final HEAD; DEV metadata before/after — sandbox done on 7eca441 (pgTAP 1352 ×2 per stack, suite 86/86 ×2 per stack, types match, M7 diff = bucket + service_role only, DEV containers untouched: same ids, start times, restart counts; nothing on DEV read); check:all + reviews on final HEAD pending
|
||||
- [x] H6 review findings on 1281667 (verifier ECARTS(6), security PASS + 1 MEDIUM): number-exponent amplification → raw OOM (bounded number-text pre-sum, closed code, pgTAP); AR-1 B §15 matrix (015); rights RPCs refused for non-owners (015); `publish.species.other` alone (017); docs §1, §9.5, §12.2 vectors, evidence §3; then gates again + fresh reviews — done 3eba6d8/5620399: pgTAP 1807 ×2 per stack, suite 86/86 ×2 per stack, PGlite 128, bomb proof on real image; second reviews on 7c4bf12: verifier ECARTS(1) LOW (raw red-on-old log → committed .out), security BLOCK(1) HIGH quadratic number walk → linear 538d103, perf fixture 2379d28; rerun 2379d28: pgTAP 1808 ×2 per stack, suite 87/87 ×2 per stack; final: check:all green on 532c61e; security PASS on 1f9fa8b (code = final); verifier ECARTS(3) LOW docs on 1f9fa8b → fixed, delta verifiers → CONFORME on 532c61e. Open for V1-2.3: `e2e:avatar` targets DEV (verifier O3), quadratic status walks, ingress body cap, schema_version 2.0 raw 22P02
|
||||
- [x] H5 memory (BDR M6/size, journal), commit + push branch, final report
|
||||
- [x] V1-2.2 core: verdict, PreviewSheet, edit primitives, SVG cleaning (owner brief 2026-10-29 « Autorisation de démarrer V1-2.2 », V1-2.1 VERIFIED at ac71c5b; contract §16.3; sandbox only, DEV untouched; no SQL, no screen; STOP at checkpoint, no V1-2.3; state 2026-10-29: READY FOR REVIEW, owner checkpoint). Owner answers 2026-10-29: editor exports (Inkscape/Illustrator/Figma) supplied by the owner, cairo + ImageMagick exports committed meanwhile; strict-parse failure = `verification.integrity.document` (§6.5; §6.7 wording aligned); PreviewSheet draft = caps + missing drawings reported, published/deprecated = fatal
|
||||
- [x] A size: `domain/sheet/size.rs` PostgreSQL jsonb text measure (`octet_length(content::text)`, numbers as `numeric` prints them, linear); oracle: corpus measured by the sandbox PostgreSQL + the pgTAP 017 vectors (cap − 1, cap, cap + 1, 3- and 4-byte, dense, exponent numbers)
|
||||
- [x] B review model: element keys, caps report (SnapshotCaps, all), completeness (statuses, vet referrals, uncited), groups + digests (general, view:, zone:, removal groups, coverable), change list vs base
|
||||
- [x] C verdict: `domain/sheet/verdict.rs` pure function (binding, document text, base text, drawings with row sha256/size/bytes) → verdict in the shape M5 reads (`groups[{key,digest,coverable}]`, `drawings[{asset_id,sha256}]`, `fingerprint`); closed codes `verification.integrity.*` / `verification.validation.*`; not exposed to the browser (O15)
|
||||
- [x] D PreviewSheet: builder (drawings by sha256 checked, read once), draft / published / deprecated, failures `drawing_missing`, `drawing_hash_mismatch`, `fingerprint_mismatch`, `invalid_document`, `caps`; `replace_document`, `add_drawing`, `view.canvas` shared with LoadedSheet, `preview.state` (report, drawings, index tables)
|
||||
- [x] E `sheet.edit` primitives (insert, update, remove, move, set_status, mark_reviewed) with §6.6 status rules; `sheet.dependents`
|
||||
- [x] F SVG classification + cleaning (§9.2): active/external removals classed in the sanitiser walk, `clean_svg(bytes)` (clean / cleanable / rejected), cleaned bytes ≤ 2 MiB, fixpoint property test, hostile corpus, cairo + ImageMagick exports (owner editor exports pending)
|
||||
- [x] G wasm facade (`PreviewBuilder`, `PreviewSheet`, `clean_svg`, free ops) + ts-rs types + index; core-wasm proofs (equine preview = bundle index + fingerprint, mismatches, replace without re-read, hostile corpus in fresh instances)
|
||||
- [x] H docs (RUST.md §12, contract §6.7/§8.1/§9.2/§10/§17.4, CLAUDE.md, sheet-model rule), gates, fresh reviews, evidence, memory, commit + push. Reviews: verifier ECARTS(6) then ECARTS(3) (A6 owner exports, A12 covered by check:all, helper recorded); security PASS ×2, every MEDIUM fixed except owner decisions below. check:all green on 741c25c and 8294d54 (rerun on final). Open for owner: dangling #id across inlined drawings (scope ids per view or refuse), clean file uploaded as original bytes (§9.2), stricter-than-table refusals and the edit-command reading (§8.1, §9.2 « for the owner's confirmation »), cairo rgb() colours lost on cleaning, editor exports pending. Open for V1-2.3: M6 must accept a failed verdict without groups/drawings; R2 view.parent.cycle quadratic; PreviewSheet under CoreRuntime poison/recovery at V1-2.5
|
||||
- [ ] I owner arbitrations (brief « V1-2.2 : arbitrages du propriétaire et finalisation », 2026-10-29, on 17d9199): READY FOR REVIEW kept; fixtures and isolated stacks only, DEV untouched; no merge; STOP at checkpoint, no V1-2.3
|
||||
- [x] I1 SVG references: a dangling `#id` refused by the one reader (`dangling_reference`, cleaning classifies active content first); ids scoped per view in `view.canvas` (core composition, stored bytes and PDF views untouched); tests: valid, absent, same ids in two views, cross-view attempt, many references to one id, repeated composition
|
||||
- [x] I2 serialisation, owner go 2026-10-29 (option « canonique + serveur »): every accepted file uploaded in one canonical form (`<?xml version="1.0" encoding="UTF-8"?>` + LF + core serialisation); verdict (`svg_not_canonical`, code `verification.integrity.svg_not_canonical`) and PreviewSheet refuse a stored drawing in another form; upload tool too; DEV equine object already canonical (sha256 0ea5202f… unchanged); contract §6.4, §6.5, §9.2, §9.3, §9.5; RUST.md §12
|
||||
- [x] I3 cairo colours: strict numeric `rgb()` / `rgba()` kept in presentation attributes and `style`; `url(` outside the document, `expression(`, scripts, active CSS still refused; tests (colours kept, dangerous refused, fixpoint, shapes and references kept)
|
||||
- [x] I4 edit commands, owner go 2026-10-29 (option « refus atomique »): `remove` refused `has_dependents` when any dependent is not a descendant (view: drawn annotations, child views, links opening it; annotation category; region; finding zone: linked annotations; reference: citing findings); finding descendants still go with their parent; contract §8.1 amended
|
||||
- [x] I5 A6 inventory: Inkscape / Illustrator / Figma (version, drawing, steps, file name, folder, tests, status); Inkscape not installed → owner go 2026-10-29 to download it; inkscape.org answered 504 / timed out, so the Ubuntu archive package 1.4.3 (sha256 = signed index) + 22 libs fetched with `apt-get download`, unpacked in the scratchpad (no install, no sudo); 3 real exports + generator committed; Illustrator / Figma owner procedure; A6 stays open
|
||||
- [x] I6 wasm size: contributors measured, optimisation options for later steps; cap and test kept; owner go 2026-10-29: `--remove-name-section` in scripts/wasm-build.sh (debug `name` section, 279 KB raw, −30 691 B gzip measured)
|
||||
- [x] I7 gates: check:all green on 5281337 and a678faa (final rerun on the last commit); mutations 16 killed + 1 equivalent; fresh reviews (Sonnet: Fable out of credits, Opus alias 404): security BLOCK(1) HIGH url(#%61) → fixed a678faa → PASS; verifier ECARTS → LOWs fixed, A6 open; evidence §7; commit + push. Open: A6 owner exports, MEDIUM per-document prefix before any two-document page
|
||||
- [x] J finalisation and A6 Figma (brief « V1-2.2 : finalisation et intégration A6 Figma », 2026-10-30, on 98060d7)
|
||||
- [x] J1 Figma fixtures (`owner/figma-web-20261030-{default,ids}.svg`, owner files, never edited): both Cleanable at first; `mask@maskUnits` removal cuts 208 px (×8) in Chromium 156 → owner go 2026-10-30: allowlist `maskUnits`, `maskContentUnits`, `clipPathUnits`, values `userSpaceOnUse` | `objectBoundingBox` only; fixed expectations in `svg_clean`; pixel proof; constructs documented in exports README
|
||||
- [x] J2 glued `url(` (final review LOW, f1ef6a4): the reader removes any attribute holding a `url(` that `url_openings` does not read (same helper, no second parser); composer comment fixed; tests (glued in class/result/values, valid, absent, encoded/escaped, no reference, composer vs PDF on one drawing, fail-closed branch reached)
|
||||
- [x] J3 Affinity optional in A6 (owner 2026-10-30), Figma required, Illustrator expected (real Adobe Illustrator, VectorCraft not equivalent): contract, V1-2 contract §17.4, RUST.md §12, READMEs
|
||||
- [x] J4 FLOOR false positive: reword `.claude/audits/2026-10-29-v1-2-2-arbitrations-security.md:225`, guard kept
|
||||
- [x] J5 memory: BDR-087 checked, LRN-100 superseded after J2; per-document prefix requirement kept
|
||||
- [x] J6 gates (A6 closed by the owner's final perimeter, BDR-090, so no longer waiting on Illustrator): full cargo, svg suites, mutations, wasm + ts-rs, size < 600 000, check:all (DEV-isolated steps only), fresh independent review; commit + push; STOP (A6 open: Illustrator). Done 7d9ab8c/f976f33: check:all green, verifier ECARTS(2) (A6 Illustrator; §12.4 drift fixed after), security PASS (new pre-existing MEDIUM: PDF halo id `osteo-halo` reusable by a drawing, owner decision); left open until Illustrator
|
||||
- [x] K reserved ids and A6 Illustrator (brief « V1-2.2 : correction de sécurité PDF et poursuite A6 », 2026-10-30, on 2f1f076): fixtures and isolated stacks only, DEV untouched; no merge; STOP at checkpoint, no V1-2.3
|
||||
- [x] K1 audit: `osteo-halo` written by `compose_highlight` only (PDF view keeps the drawing's ids); `has_halo_filter` skips the injection when the drawing defines `filter#osteo-halo` (hijack), a non-filter `#osteo-halo` before the first `<defs>` wins resolution; historical drawings carry `osteo-overlays` (DEV equine object included) → exact reserved set, never an `osteo-*` namespace; canvas scoped `fv.<view>.`, layer writes no id, filter `result` names local to the filter
|
||||
- [x] K2 reader: `SvgRejection::ReservedId` (`reserved_id`), `refs::check_reserved_ids` (ASCII case folded, the id grammar is ASCII) in `read_svg` and in `clean_svg` after the active classification; reaches verdict, preview, loaded sheet, upload tool, PDF snapshot gate
|
||||
- [x] K3 composer fail-closed: `compose_highlight` refuses a tree holding a reserved id (`ComposeError::ReservedId`), always writes its own halo (`has_halo_filter` removed); ops mapping; TS-era "never duplicated" test becomes the refusal
|
||||
- [x] K4 tests: valid, filter + other elements (root included), references, adversarial spellings (case, entities, whitespace, `xml:id`, prefixed names, look-alikes), composition, PDF session (refusal + internal halo kept), equine + sha256, declared divergence for `osteo-halo-id.svg`, pixel proof in Chromium (before / after)
|
||||
- [x] K5 docs (RUST.md §12, contract §9.x hard rejections, ANNOTATION-RENDERING), Illustrator `presentation` / `internal-css` owner steps; gates (cargo, svg, mutations, wasm size, check:all DEV-isolated), fresh verifier + security on final HEAD; memory; commit + push; STOP (A6 open until Illustrator). State: check:all green, verifier ECARTS(1) LOW fixed (leaked `id` expansion in a comment), security PASS + pre-existing MEDIUM root `visibility` hides every marker (owner decision), LOW root stroke, LOW halo defs placement
|
||||
- [ ] L A6 final scope and root visibility (brief « V1-2.2 : arbitrage définitif A6 et correction visibility », 2026-10-30, on 81f7639): fixtures and isolated stacks only, DEV untouched; no merge; STOP at checkpoint (VERIFIED or CHANGES REQUIRED), no V1-2.3
|
||||
- [x] L1 A6 scope: Figma, Inkscape, cairo, ImageMagick = tested perimeter; Illustrator and Affinity optional, never claimed without a real export; core contract D1/B6/C1, V1-2 contract §17, RUST.md, export READMEs, TODO, BDR superseding BDR-088's A6 part; fixtures and owner procedure kept
|
||||
- [x] L2 tests first (red on 81f7639): root `visibility` hides the layer (canvas, PDF), descendant `visible`, value spellings, root `style` / `<style>` forms, other root attributes; reader, cleaning, verdict, preview, canvas, PDF session, equine
|
||||
- [x] L3 fix: reader refuses a root `visibility` other than `visible` (`root_visibility`), cleaning after active content, composers fail-closed; same check everywhere
|
||||
- [x] L4 browser proof before / after (Chromium, Firefox, WebKit from the Playwright cache) incl. opacity, display, stroke on the root
|
||||
- [ ] L5 BDR reserved ids + LRN heredoc expansion (owner go); docs; gates (cargo, fixtures, mutations, wasm + ts-rs, size, check:all), fresh verifier + security on final HEAD; commit + push; checkpoint
|
||||
- [ ] M three MEDIUM (brief « V1-2.2 : arbitrages propriétaire sur les trois MEDIUM », on 958228a): isolated stacks only, DEV untouched, no merge, no V1-2.3; STOP before any R3/R4/step6 reference change
|
||||
- [x] M1 audit: inherited vs group-wide properties reaching the layer (root presentation attributes, page CSS), what the reader already removes, hit rules of each marker, frame of each view (canvas, PDF, raster size), equine margins and hit winners
|
||||
- [x] M2 tests first (red on 958228a): marker isolation (stroke, stroke-opacity, dasharray, width, fill, fill-opacity, fill-rule, opacity, display, visibility, linejoin/miterlimit) in canvas and PDF; hitbox capture rule; offset viewBox + compensating translate refused by verdict and preview (19 main markers), limits, secondary views, no view_box, invalid coordinates, legit transforms
|
||||
- [x] M3 engine (lot B, uncommitted, patch in .claude/audits): composition root owned by the engine (frame + namespaces), drawing in a group of its own, layer and halo defs its siblings; composed layer hitbox `stroke="none"` + explicit capture rule; R3 layer form kept for the seed review drawings
|
||||
- [x] M4 frame: one frame definition (view box, else drawing viewBox read strictly) for both composers, verdict and PreviewSheet; annotation bounds (circle, polygon, path data with curves and arcs); closed code
|
||||
- [x] M5 browser click proofs (Chromium, Firefox, WebKit from the cache, touch where testable): normal hock click, giant root stroke before / after, close points, invisible and overlapping surfaces
|
||||
- [x] M6 oracle inventory (evidence 2026-10-30-v1-2-2-three-medium-evidence.md): failing R3 / R4 / step6 references, before / after diff, equine render, SVG source digests, N-1 and PDF consequences → STOP for owner authorisation before any reference change
|
||||
- [ ] M7 after authorisation only: references, docs, gates (cargo, mutations, wasm size, check:all DEV-isolated), fresh verifier + security, commit + push, checkpoint
|
||||
- [ ] N owner decisions and corrections (brief « V1-2.2 : décisions et poursuite des corrections », 2026-11-01, on f1bb19b): lot B approved, R3 transforms + R4.1 call-1 svgSha256 authorised; isolated stacks only, DEV untouched, no merge, no V1-2.3, no deploy; STOP at checkpoint
|
||||
- [x] N1 lot B applied = approved patch (checked identical); isolation proof over the whole sanitiser allowlist (every attribute on root and descendants, style properties incl. sibling-acting CSS), browser probe
|
||||
- [x] N2 commit lot B with its declared transforms; R4.1 manifest call 1 `a9a3155c…` → `45fd4aaf…` only, documented; manifest test green; RUST.md §12.10 correction
|
||||
- [x] N3 junctions « visible wins », canvas only (owner 2026-11-01; PDF keeps document order and bytes): hitboxes, then zones and triggers, then capturing twins; ANNOTATION-RENDERING first; declared transform on R3 canvas goldens; click spec c7-t1, l6-s1, t18-l1, fore fetlock, close fetlocks, touch; fixmes resolved or justified one by one
|
||||
- [x] N4 scale bypass: projected visible size rule (owner 2026-11-01: 4 px at 320 × 568, measured equine min 4.97 px), verdict + preview, closed code; numeric guard (finite, non-degenerate, value/transform bounds, f32 precision vs magnitude and frame), Rust vs browser edge cases
|
||||
- [x] N5 gates: cargo all features, clippy, mutations, wasm size, check:all on final HEAD, e2e:ui, e2e:shell if sandbox, C8 Docker + mutations
|
||||
- [ ] N6 fresh verifier + security on final HEAD (old MEDIUMs, f32/f64 residue); memory BDR + 2 LRN (dedup); checkpoint
|
||||
- [x] O last MEDIUM, zone without interior (brief « V1-2.2 : fermeture du dernier MEDIUM », 2026-11-01, on de2dfb3; contract `.claude/tasks/contracts/2026-11-01-v1-2-2-interior.md`)
|
||||
- [x] O1 measure: flattened outline (polygon, path curves/arcs with a chord deviation bound), fill rule (layer = nonzero), widest inscribed disc search (deterministic, capped), projected at 320 × 568
|
||||
- [x] O2 rule in `frame::annotation_placement` after the bounds rule; closed codes; verdict + preview; docs (ANNOTATION-RENDERING, RUST.md, V1-2 §6.7)
|
||||
- [x] O3 tests: back-and-forth, near-flat, self-intersection both rules, curves/arcs near zero, small legit, transforms/scales, threshold edges, equine; browser concordance fixture + spec on 3 engines
|
||||
- [x] O4 gates: wasm ≤ 600 000, mutations, check:all, e2e:shell sandbox, ignored tests documented, PDF unchanged; fresh verifier + security
|
||||
- [x] O5 memory: 3 LRN (WebKit snapping, Firefox client rects, WebKit tiny spans); LOW overlap recorded; checkpoint
|
||||
- [x] V1-2.2 CLOSED: VERIFIED by the owner 2026-11-01 (brief « Validation définitive V1-2.2 », code `c73415a`, BDR-092, contract §17.7); codes `interior_too_small` / `marker_interior_too_small` approved; LRN-108 (Chromium touch, observation only). Final verifier on the closed state: ECARTS(1) (three mutation anchors stale since 03be75b/86dce16) → re-anchored, script rerun on the final code (evidence « Closure »)
|
||||
- [ ] V1-2.2 accepted LOWs, TRACKED, not fixed (owner 2026-11-01; never mark fixed without a fix and proof):
|
||||
- [ ] fully overlapping marker discs: no rule; human review must find them before any publication (V1-2.7 review screen, V1-2.8 equine preparation)
|
||||
- [ ] arc rotation sub-pixel error (bounded, tests kept)
|
||||
- [ ] arc exactly tangent to a frame edge refused (conservative bounds)
|
||||
- [ ] `f32` arc margin a bounded estimate (≤ 0.13 unit measured on a model)
|
||||
- [ ] verification cost of an all-arc sheet (~1.8 s native): watch complex-sheet durations at the editor validations on real devices (V1-2.6) and the worker at-caps timing (V1-2.3)
|
||||
- [ ] relative path commands accumulated in `f32` (contrived worst 6 % of the span)
|
||||
- [ ] V1-2.3 worker verification (M6), owner go 2026-11-01 (brief « Validation définitive V1-2.2 »); contract `.claude/tasks/contracts/2026-11-01-v1-2-3-worker-verification.md`; sandbox only, DEV untouched, no merge, STOP at owner checkpoint (server workflow V1-2.1 to V1-2.3)
|
||||
- [x] P1 M6 SQL (1cd4344): 4 RPCs service role only, closed worker codes, attempt limit 5, lease 10 min, verdict cap 4 MiB, audit; pgTAP 021 (51) + 018 census; types; PGlite 129, sandbox test-db 1859 PASS
|
||||
- [x] P2 child `verify`: framed input, core verdict, caps per command (12 MiB in, 4 MiB out, 1 GiB, 60 s CPU, 90 s), seccomp derived again in Alpine: `brk` added (traced at caps, musl mallocng); worker:test 23 sandbox + 15 verify_loop, worker:image ok
|
||||
- [x] P3 `run --jobs sheet-verify` (VerifyBackend, closed codes, no sweep), compose `worker-verify` (not started); at-caps verdict 24 689 B, 0.69 s debug natively
|
||||
- [x] P4 sandbox e2e (`pnpm db:sandbox verify-e2e` 7/7, cases a-h, at caps 185 ms worker); rehearsals before M6 and before M4 (DEV path): pgTAP 1859, types equal; hostile corpus (42) through the child. NOT run: `pnpm e2e:avatar` (targets DEV: owner decision)
|
||||
- [x] P5 docs (RUST §13, STORAGE §3.6, contract §6.4/§6.5/§12.3/§16.4, SUPABASE, DEPLOY, CLAUDE.md); check:all + e2e:shell 86 on 6aa85fe; security PASS (LOWs: 2 fixed, 3 open); verifier ECARTS(2) → hostile corpus added, e2e:avatar to owner; checkpoint
|
||||
- [ ] Q owner reserves (brief « Décisions V1-2.3 / M6 et clôture des dernières réserves », on 96b19e5; contract `.claude/tasks/contracts/2026-11-01-v1-2-3-reserves.md`): M6 parameters + `brk` approved; CHANGES REQUIRED until proofs; sandbox only, no DEV, no merge, no V1-2.4
|
||||
- [x] Q1 `pnpm db:sandbox avatar-e2e`: existing avatar suite, real worker default mode, sandbox only
|
||||
- [x] Q2 retry delay 2/5/10/20 s persisted in SQL (M6 amended in place, unapplied outside the sandbox), pgTAP + sandbox case
|
||||
- [x] Q3 input limits at and just beyond the caps (child + sandbox), tracked misclassifications asserted as current
|
||||
- [x] Q4 `brk` bounded: RLIMIT_AS and argument filters on the verify child
|
||||
- [x] Q5 throwaway sandbox account passwords generated per run
|
||||
- [x] Q6 LRN-109 · Q7 docs · Q8 gates: check:all, sandbox fresh + 2 upgrades (pgTAP 1880, types, verify-e2e 10/10), avatar-e2e 5/5, test 87, e2e:shell 86; security PASS, MEDIUM null lease token fixed (3bfd6c8); verifier ECARTS(2) (TODO risks count, test + e2e:shell rerun on final M6) → fixed, delta verifier CONFORME on 550a785; checkpoint
|
||||
- [ ] residual risk 1, open, tracked: frame header > 64 KiB (several hundred drawings named) → `verification.worker.resource_limit` instead of `caps` (verify_loop + sandbox case k assert current behaviour, not fixed)
|
||||
- [ ] residual risk 2, open, tracked: object over the policy → failures `[caps, drawing_missing]`, never `size_mismatch` (verify_loop asserts current behaviour, not fixed)
|
||||
- [x] residual risk 3, closed by proof: largest allowed input measured (child max frame passed; sandbox j: document + base 2 MiB, drawings 6 MiB, worker 156/191 ms)
|
||||
- [x] residual risk 4, closed: sandbox throwaway password literal replaced by per-run random passwords (2a84e37); DEV seed passwords untouched
|
||||
- [ ] §16.11 queue inventory (avatars, purges) owed by the owner before any DEV activation; not done, not assumed
|
||||
- [ ] R closure adjustments (brief « Validation V1-2.3 (M6) et derniers ajustements », on 26e4b1b: V1-2.3 VERIFIED technically; contract `.claude/tasks/contracts/2026-11-01-v1-2-3-closure.md`): sandbox only, no DEV, no merge, then prepare V1-2.4 scope and STOP
|
||||
- [x] C1 retry by cause: resource_limit (intrinsic) + verdict_refused definitive at first; timeout, unavailable (incl. external SIGKILL), lease_expired transient
|
||||
- [x] C2 avatar-e2e port 57800 loopback, occupied port fails, suite refuses non-sandbox targets
|
||||
- [x] C3 `pnpm e2e:avatar` = alias of the sandbox run, scripts/avatar-e2e.sh removed, references updated
|
||||
- [x] C4 sandbox seeded accounts get a per-session secret (no DEV seed password dependency)
|
||||
- [x] C5 four historical test reductions recorded in `.claude/audits/2026-11-01-v1-2-floor-reductions.md`: none hides a security coverage (O22 mirror removal and client gate, server gate tested; one false positive)
|
||||
- [x] C6 gates on 3c141c9 (check:all, test-db 1898, test 87, verify-e2e 10/10, e2e:avatar 5/5, e2e:shell 86, DEV untouched); targeted review PASS, 3 LOWs fixed, MEDIUM CPU-contention timeout + 3 LOWs open for owner; verifier ECARTS(1) (STORAGE §6 DEV pairing) → fixed 093083d, delta verifier CONFORME · C7 V1-2.4 scope `.claude/tasks/contracts/2026-11-01-v1-2-4-wireframes-scope.md`
|
||||
- [x] V1-2.4 wireframes (editor, review, admin entry): GRAPHICAL APPROVED 2026-11-02 (BDR-096; detail under S below)
|
||||
- [x] V1-2.5 VERIFIED 2026-11-03 after the owner checkpoint corrections (final code f5456f3; brief « V1-2.5 : décisions propriétaire au checkpoint »); built + tested on the sandbox (5db85ff); started 2026-11-02 (brief « Validation propriétaire V1-2.4 »; prerequisites checked on 994b04e, contract §17.10; owner answers BDR-097: M7 admin reads, working-copy action in V1-2.5, EN « Permission »). Contract `.claude/tasks/contracts/2026-11-02-v1-2-5-admin-catalogue.md`, plan `.claude/tasks/plans/2026-11-02-v1-2-5.md`; sandbox only, no DEV, no worker on DEV, no merge; STOP at the V1-2.5 checkpoint
|
||||
- [x] A GoTrue MFA behaviour on the sandbox (C1): 10/10, no STOP; reset and password change need aal2 once a factor is verified (IDENTITY §4.1) (78791bf)
|
||||
- [x] B M7 sheet_admin_reads + pgTAP 022 (40) + types; fresh + upgrade from M6: 1938 pass (b0a4cbe)
|
||||
- [x] C core op sheet.empty + wasm + ts-rs; rust:check 2384, core-wasm 66 (bbab0e6)
|
||||
- [x] D packages/supabase accessors + kinds: unit 148, sandbox 5/5 x2; MFA kind name_taken added
|
||||
- [x] E shell: nav, RequireCatalog, RequireAdmin step-up, « Accès non autorisé » (C3, C4)
|
||||
- [x] F Mon compte Sécurité MFA + step-up screen (C2); app 601, e2e:ui 227; labels in .claude/audits/2026-11-02-v1-2-5-label-proposals.md; reset-password flow steps up to aal2 when the account has a verified factor (A finding)
|
||||
- [x] G Administration page, species, rights (C4, C6, C7)
|
||||
- [x] H sheets list, creation, overview, working copy (C5)
|
||||
- [x] I catalogue list, sheet page, version page (C8); deprecated fingerprint fixed in M7 (BDR-098); app 650 (0176b31)
|
||||
- [x] J e2e:shell A0 A1 S1 P1 + access + MFA + axe + viewports (C11): full suite 108 passed, 6 skipped by design
|
||||
- [x] K docs, check:all, fresh verifier + security, memory, checkpoint (C10-C12): security PASS (MEDIUM + LOW fixed), verifier ECARTS(7) → three delta rounds → CONFORME on e39f69e; check:all green; e2e:shell 108 + 6 skipped on cea0f1c; phone flake root-caused
|
||||
- [ ] L owner checkpoint corrections (brief « V1-2.5 : décisions propriétaire au checkpoint », 2026-11-02, on 14ff890; contract `.claude/tasks/contracts/2026-11-02-v1-2-5-owner-checkpoint-2041.md`, plan `.claude/tasks/plans/2026-11-02-v1-2-5-owner-checkpoint-2041.md`): sandbox only, no DEV, no merge, no V1-2.6
|
||||
- [x] L1 three permission states (creation page + Administration home), reloadAccess, unit + e2e: app 671, e2e:shell 110 + 8 skipped, pgTAP 1941 (fresh sandbox)
|
||||
- [x] L2 expiry end of day Europe/Paris, species order 0..9 999 in M7, labels, TOTP key test: app 696, supabase 148, pgTAP 1965 fresh + upgrade, types match
|
||||
- [x] L3 TOTP reuse measured (code accepted by several sessions in its step and the next, refused at N+2), lost-authenticator review (production prerequisite), decisions in docs; sandbox test 103 + 10 skipped x2
|
||||
- [x] L4 gates: check:all green (dcb1a94; delta = sandbox test + docs), fresh stack test-db 1965, e2e:shell 110 + 8 skipped, sandbox test 103 + 10 skipped after e2e, upgrade from M6 1965 + types match; security PASS x2; verifier ECARTS(6) -> CONFORME; two state-dependent sandbox tests fixed (0499a39, f5456f3); suites need a fresh stack in order test-db, e2e:shell, test
|
||||
- [ ] V1-2.6 editor level 1: plan APPROVED by the owner 2026-11-03 (brief « GO propriétaire V1-2.6 »: 13 lots A-M, C1-C24, 8 visible choices, M8 sandbox only, no JSON export button, recovery messages exact), gated on a targeted independent re-check of the six FATAL fixes. Re-check 2026-11-03: REMAINING(2) — fixes 1-5 closed, I1-I5 hold; fix 6 (r = 12 + 3 %) opens `out_of_frame` on frames under ~25.5 units (hitbox r in frame bounds); I6 broken: the first commit overwrites a pending recovery copy before « Restaurer » / « Ignorer »; 2 MINOR (N source when the admin read fails, two-copy cap). Executor NOT launched; STOP for the owner. Owner arbitrations 2026-11-03 (« arbitrages propriétaire sur REMAINING(2) »): C25-C31 gated, plan revised; second targeted re-check: REMAINING(1), no BLOCKER, F1 MAJOR (accept trusted the core's silence on unmeasured views) + 7 MINOR, all integrated in the plan. Owner GO 2026-11-04 (« GO propriétaire après REMAINING(1) »): F1 fix approved, C26 refined by seven repair rules, minor effects approved; C32-C34 gated; execution of lots A-M authorised, no third plan review. 2026-11-04 13:08 the scratchpad worktree was removed by the harness cleanup (LRN-114): commits safe on origin (8343528), uncommitted lot H + lot G fix lost; worktree recreated at /home/bchanot/Documents/faunosteo-v1-2 (owner authorisation); resume ledger `.claude/tasks/plans/2026-11-03-v1-2-6-execution.md`. Contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md`, plan `.claude/tasks/plans/2026-11-03-v1-2-6-editor.md`; sandbox only, no DEV, no worker on DEV, no merge, no V1-2.7; STOP at the V1-2.6 owner checkpoint (trial procedure)
|
||||
- [x] A M8 draft_last_save (2f824a9) · [x] B sheet asset accessors (f7e7bf4) · [x] C preview mutators, edit ops, ids (173be59..cfd49c7) · [x] D editor store, undo, recovery (7f1d440..b14509f) · [x] E route, modes, tabs (6aba971) · [x] F Général, Références, Vertèbres (d163b2c) · [x] G views + upload (8343528, 1bbf97e, 7ea9619) · [x] H Annotations (2609785, 3f15762) · [x] I Constats (92c595c, 91d06c9) · [x] J Vérification + submit (447d0a4..3d589e1) · [x] K e2e (5097fd7..4cc27a8) · [x] L owner trial tooling (ac5fbfb) · [x] M gates, reviews, checkpoint (071b58a..7a4ce9e; checkpoint report 2026-11-04, owner trial pending) · [x] N owner checkpoint decisions (C35-C44: be4f468..5e0aa62; ready for the owner trial, guide verified from the worktree) · [x] O last decisions (C45-C48: free paths never reshaped, explicit category zone, LAN trial on 192.168.1.100:5193; a69eba5..9b86f54) · [-] owner manual trial: STOPPED by the owner 2026-11-05 (T11, BDR-100), level 1 NOT declared validated as a whole
|
||||
- [ ] level-1 residuals kept in tracking (T11; re-checked at U8, `V1-2-6_UX_DECISIONS.md` T11): owner manual trial never run · real second device on the LAN not tested · editing specs at 375 px skipped (C16 waiver) + 8 admin journeys at 375 px skipped · worker-gated sandbox suite skipped (no worker by contract) · keyboard spec focuses programmatically (no Tab walk) · free-path attach repair covered by automated tests only · Safari iOS `beforeunload` unreliable · LOW security items of the checkpoint report « Audits and reviews » · review minors m4, m6, m7, m8, m10 · path point correction proposal (now in the curves lot)
|
||||
- [x] V1-2.6 new editor UX maquettes (owner brief 2026-11-05 « nouvelles maquettes UX approuvées sur le principe »; contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-maquettes.md`): mockups + feasibility audit only, no core/app code, no DEV, no merge, no V1-2.7; STOP at the graphic checkpoint
|
||||
- [x] core feasibility audit (`.claude/audits/2026-11-05-v1-2-6-ux-feasibility.md`) · [x] 16 boards + contact sheet + sources in `docs/design/v1-2-6/` · [x] REVUE.md (journey, 11 choices, contradictions, feasibility) · [x] fresh design review (6 MUST-FIX, 10 SHOULD applied; board 08 name finding wrong: frame holds Coude) + verifier ECARTS(2) U2/U9 fixed after (custom category menu, phone redraw), no re-verify · [x] commit + push branch · [x] owner review prep (brief 2026-11-05 « préparation de la validation propriétaire »): fresh verifier CONFORME 11/11 on 9f420d3 + 5 defects outside criteria kept (no redraw allowed), ARBITRAGES.md, ETUDE-TECHNIQUE.md, CONTROLE-CONFORMITE.md, archive `/home/bchanot/faunosteo-v1-2-6-ux-maquettes.zip` · [x] external ChatGPT review received (`faunosteo-v1-2-6-revue-ux-chatgpt.md`, untracked in the worktree root) · [x] final corrections (brief 2026-11-05 « Revue finale des nouvelles maquettes UX V1-2.6 », contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-corrections.md`): [x] board 04 trace strip · [x] undo/redo in the header on every tab · [x] board 07 split into distinct states, form visible · [x] counters computed from the data · [x] docs (confirmed vs open choices, prerequisites) · [x] targeted independent check: ECARTS(2) on 7bc3d65 (board 11 drawer hid header undo; 2 REVUE sentences) → fixed b5058b3, delta check K1-K8 8/8 MET, ECARTS(1) = K9 archive not built then · [x] archive `/home/bchanot/faunosteo-v1-2-6-ux-maquettes-2.zip` (SHA256SUMS verified on extraction by the author) · [x] owner final graphic checkpoint: 16 boards + 11 choices validated 2026-11-05 (brief « Validation UX définitive et préparation technique », confirmed by the brief « Autorisation U0 uniquement »)
|
||||
- [ ] separate tracks kept apart: TOTP asked at sign-in; missing illustrations blocking the copy of the historical equine sheet; phone editing (full touch editing below 1 024 px) = distinct future lot after V1-2 (owner 2026-11-05, choice 9; boards 14-16 kept as its reference)
|
||||
- [ ] V1-2.6 UX redesign technical preparation (owner brief 2026-11-05 « V1-2.6 — Validation UX définitive et préparation technique »: 16 boards + 11 choices validated; docs and static audits only, no app/Rust/SQL/worker code, no DEV, no merge, no V1-2.7; STOP at the technical checkpoint)
|
||||
- [x] static audits (core model, rendering/PDF/N-1, geometry/wasm, SQL/worker, editor/tests) · [x] docs/development V1-2-6_UX_{PLAN,COMPATIBILITY,TESTS,RISKS,DECISIONS}.md (sub-steps U0-U9, decisions T1-T19) · [x] independent review (3 lenses: CONCERNS 5/9/6, no BLOCKER) + fixes integrated (plan §6) · [x] commit + push branch · [x] owner answers 2026-11-05 (brief « V1-2.6 UX — Ratification des décisions techniques », BDR-100): T11 approved, T16 conditional deferral (curves lot), T2/T3 conditional on proofs, T4 no residual gap, T5 history preserved, T9 three actions, T10 navigation type, T12 principle · [x] five docs updated (decisions, compatibility §0/§7/§8, tests, risks + blocking criteria, plan §7) · [x] LRN-118 (wasm measuring rule) · [x] independent reviews: correctness challenger CONCERNS(5 MAJOR, 7 MINOR) integrated; verifier ECARTS(2) fixed; targeted re-check ECARTS(2) (one U6 test assumed permissive save, deploy order said all rounds) fixed · [x] third independent check before commit (2026-11-05): ECARTS(2) on K10/K11 (R-3 mitigation, U6 objective on older T4 scope, write-lock test assumed stripping save, T16 count scope in two forms) fixed · [x] fresh targeted re-check: CONFORME 12/12 (G1-G4 closed; 7 observations kept for U0) · [x] commit + push · [x] owner answers 2026-11-05 (brief « Autorisation U0 uniquement », BDR-101): T4 both SQL checks approved (O22 amended), T5 defaults, T10 option B, T15, T16 count before activation, « Remplacer par un polygone » explicit · [x] T17 answered 2026-11-06 (BDR-102) · [ ] still open: T12 text (before U7), T6 (V1-2.8), T14 follow-up; T1 only if a measure exceeds · [x] owner authorisation to start U0 (2026-11-05)
|
||||
- [ ] V1-2.6 UX U0, contract and decisions, docs only (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`; no code, no SQL, no DEV, no U1): [x] V1-2 contract §6.2, §6.4, §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 (O22), §16.7, §16.12, §17.12 · [x] level-1 contract C3, C4, C5, C6, C7, C8, C11, C13, C16, C18, C20, C25, C28, C32, C33, C40, with the precedence rule of its header · [x] docs/design/README.md · [x] rules sheet-model.md, schemas.md · [x] five UX docs · [x] BDR-101 · [x] preconditions (r5:import-equine --check clean, seed 22/6/0 paths, wasm 592 143 B) · [x] independent verification: ECARTS x6 fixed, then CONFORME 12/12 (2026-11-06); open points for U2/U6 not in docs: point edge-size handle (boards 02/03), default laterality of the automatic access (U6), §15 replay text vs the category.fixed.* filter · [x] commit + push · [x] owner U0 checkpoint (approved for good in the brief « Autorisation de U1 uniquement », 2026-11-06)
|
||||
- [ ] V1-2.6 UX U1, editor shell (brief « Autorisation de U1 uniquement » + « U1 — Validation de la conception interne », approach A; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md`; plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, lots A, B1, B2, C-I; no Rust/SQL/worker/scripts, no DEV, no merge, no U2): [x] design approach A validated by the owner with 10 precisions · [x] owner choices 2026-11-06 (server save time, non-modal references panel, citation button in the finding's detail, board 01 annotation card) · [x] plan written + three-lens challenge (correctness CONCERNS 6, robustness CONCERNS 5, simplicity CONCERNS 2, no BLOCKER) integrated · [x] U1 design confirmed by the owner 2026-11-06 (BDR-104; no data deletion implicit in the plan approval, sandbox included) · [x] authorisation checkpoint page `docs/development/V1-2-6_UX_U1_CHECKPOINT.md` (18 choices, amendments 2.1-2.9, audits traced, sandbox reset scope, lot criteria; challenger reports archived `.claude/audits/2026-11-06-v1-2-6-u1-plan-challenges.md`; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-u1-authorisation-checkpoint.md`, fresh verifiers ECARTS(3) → ECARTS(1) → last gap fixed, not re-verified) · [x] owner U1 authorisation 2026-11-06 (brief « Ratification finale U1 et autorisation conditionnelle d'implémentation », BDR-105): 18 choices, approach A, AC3/4/5/7/17 and 2.6-2.9 applied to the contract; precautions 2.8 (no silent loss on 1 024 px crossing or recovery decision) and AC7 (save time rights); per-operation sandbox go · [x] precautions investigated and written in the contract · [x] targeted counter-check (3 confirmation fixes + 2 precautions): CONFORME at 9ec232a · [x] lots A-H (A 95b1b7e; B1 bc2dba7..ca184da; B2a 6689827..9d89dae; B2b c57af64..51fd3db; C 6131225..cf9c300; D ab51ea7; E 99b669b..89da8d3; F 580ff28..925d843; G 23900f3..9c03cf2; H 0bb150f..606f7ba) · [x] Lot I (81fba46, 942d52a; one sandbox down + up fresh under the owner go of 2026-11-08; at 81fba46 e2e-shell 192/0, test-db 1 992, check:all passed) · [x] gates, verifier (22/22 MET on 942d52a), security (PASS on 81fba46, 3 LOW) · [x] final review: ready with fixes → 0467885, da95b84, scoped re-review all addressed · [ ] owner U1 checkpoint OPEN for the manual trial: decisions 2026-11-09 recorded (BDR-106; 5 out-of-scope files + 3 one-for-one assertion rewrites accepted, record in `V1-2-6_UX_U1_CHECKPOINT.md` §7). Exact shell suite at da95b84: 188 passed, 90 skipped, 4 failed, never reported green on the last commit
|
||||
- [ ] confirm the 4 `admin.spec.ts:717` failures at da95b84 (fr/en × desktop/375, « Créer une copie de travail » disabled: single working-copy slot taken by an earlier run, `WorkingCopyAction.tsx:88`) are sandbox-state dependent: non-destructive reproduction or isolated test; never a sandbox reset to get green (owner 2026-11-09). Linked: RR-13 admin scenario independence
|
||||
- [ ] U1 reservations kept in U1, not moved to U2 without justification (owner 2026-11-09; `V1-2-6_OWNER_TRIAL.md` « Limites connues de U1 », checkpoint §7.3): N4 in-place field loses a refused value · N6 upload in flight attaches in narrow mode · repair window drops refusal `result` and unparseable draft · local recovery copy in tab sessionStorage · references panel makes tab panels inert · canvas 538 px at 1 024/1 280 (choice 2.6) · `trial-lan.spec.ts` not run · LOW `usePress` (HistoryButtons.tsx) over 25 lines
|
||||
- [ ] shortcut: `apps/app/src/editor/sheetDocument.ts:15` keeps the last parsed document in one module-level entry (every kept place reads the document, one parse serves them all per commit), not store state. Limit: module state against the « no global state » rule, one entry. Upgrade path: the store holds the parsed document next to its text and the places select it
|
||||
- [ ] V1-2.6 U1 corrections after the owner's first trial (brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », 2026-11-09, BDR-107; contract `.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md`; plan `docs/development/V1-2-6_U1_CORRECTIONS.md`): design and docs only so far, no app/scripts/SQL/Rust code, no DEV, sandbox untouched, no merge, no U2/U2b/V1-2.7
|
||||
- [x] R0 boards 23-30 `docs/design/v1-2-6-r0/`: GRAPHICALLY VALIDATED 2026-11-09 (BDR-110) after owner corrections (BDR-109 + three last: 24 A, 26, 28) and closing counter-check CONFORME; A1-A15 settled (`ARBITRAGES.md`); archive `~/faunosteo-v1-2-6-r0-maquettes.zip`; impeccable 4.1.0 offline: 2 observations kept by owner
|
||||
- [x] R1 history « Défaire » / « Refaire » + « Désélectionner » + Escape priority + D6b: DELIVERED 2026-11-12 (`7dda61d`, `bbb1668`, `bbdfd27` + `a1ee194`, `ab823f4` + `2327d61` + `0849e54`, `0d1edac`; review fixes `132756e`, `6ed90ef`, `9807ed2`; docs `90a5e7a`, `a180b9e`, `58d432d`, `b8dda1b`, comment `6ef5223`); final gates on `a180b9e` (src = HEAD but one comment): typecheck, lint, build ok; unit app 1381, supabase 180, core-wasm 66; e2e:ui 227; e2e:shell 197 passed / 4 failed (`admin.spec.ts:717`, anomaly B, baseline) / 99 skipped; verifier 15/15, security PASS x2, code review fixes landed; limits in `V1-2-6_U1_CORRECTIONS.md` R1; memory BDR-113, LRN-128..130. Owner 2026-11-12 « Validation mémoire R1 »: R1 accepted TECHNICALLY on the report; owner manual validation on db:trial still to do (line below); R2, R3, R4, U2, U2b not started
|
||||
- [x] D6b (owner 2026-11-12, U1 manual test on db:trial): a click or tap on the drawing outside any annotation deselects; built and tested in Chromium
|
||||
- [ ] R1 follow-ups: undo/redo glyph paths differ from board i-undo / i-redo (U1 code, deferred) · « Toutes les annotations » and « Supprimer » are 36 px below xl (touch target) · « Toutes les annotations »: focus falls to the page when its row is filtered out
|
||||
- [x] owner manual checks on db:trial: R1 (« Défaire » / « Refaire », « Désélectionner », Escape) and D6b with mouse and touch: 10/10 passed (owner 2026-11-12); iOS Safari not covered (kept in the known limits below)
|
||||
- [x] last owner feedback (brief « V1-2.6 — R1 — Dernier retour utilisateur », 2026-11-12): « Sélection : … » tag above the drawing made screen-reader-only, drawing stable on select / deselect (`927537b`, docs `00936c8`, BLK-013, LRN-131); unit app 1382; e2e:shell db:sandbox 6 editor specs 37 passed / 37 skipped / 0 failed; verifier CONFORME, security PASS x2. Owner 2026-11-12: R1 accepted technically
|
||||
- [x] owner browser confirmation on db:trial of the `927537b` visual fix (drawing stays in place, no tag above it): CONFIRMED by the owner 2026-11-12 (brief « Validation finale R1, correctif E2E et GO R2 »). R1 VALIDATED FUNCTIONALLY by the owner; `927537b` + `00936c8` accepted
|
||||
- [ ] R1 known limits kept (owner 2026-11-12): ToolNotes `role="alert"` hint above the canvas (EditableAnnotations.tsx ~373), cleared on select, still moves the drawing one line when a hint is showing (must stay visible: fixed slot or overlay, LRN-131) · the selection itself is not announced to screen readers (only the deselection is) · iOS Safari validation still needed · the other R1 deviations already documented (follow-ups line above, `V1-2-6_U1_CORRECTIONS.md` R1 « Behaviour and limits »)
|
||||
- [ ] R2 fifth tab « Références », tiles, search + clear, view-only sort, panel from a finding only (34 rem, 150-200 ms slide, reduced motion). Plan APPROVED (owner 2026-11-12 « Validation du plan R2 »); GO was gated on the owner's visual confirmation of `927537b` on db:trial: confirmed 2026-11-12, GO R2 given (brief « Validation finale R1, correctif E2E et GO R2 ») AFTER anomaly B is fixed and validated (fails or needs existing data changed → stop, R2 not started). Flow `/ship-feature` (plan file, challenge, contract), one commit + push per validated sub-lot, sandbox-only automated tests, no SQL / Rust / worker / MFA / roles / trial data change, no merge, no deploy, R3 R4 U2 U2b not started, untracked review file kept. Stop at the final R2 checkpoint (commits, test results, independent reviews, known gaps, db:trial manual protocol)
|
||||
- Owner decisions: (A) presentation sort + search in TypeScript, never mutating document, stored order, ids or history; exception written in `RUST_ARCHITECTURE_REVIEW.md` Part II · (B) EN labels of `REVUE.md` = working basis, not ratified: exhaustive FR/EN table of new or changed R2 labels with ambiguities, app terminology kept, shown at the checkpoint before final validation · (C) anomaly B fixed apart (below)
|
||||
- Extra requirements: cited reference never deletable · « Retirer de ce constat » removes that one association only, undone by « Défaire » · no edit action in read-only · several findings citing one reference · panel only from a finding · focus back to its origin if it still exists · Vérification « Aller à » opens the right tile with focus · reader catalogue unchanged · panel ≤ 34 rem, never wider than available · no drawing shift on panel open / close · widths 375, 1 024, 1 180, 1 279, 1 280 · `prefers-reduced-motion` · closed panel (exit animation included) neither interactive nor keyboard-reachable · visual ops never mutate stored order · four sorts tested · A1 to A4 kept · references still reachable when a search returns nothing
|
||||
- Owner GO on plan rev 3 (brief « GO R2 — Plan révision 3 », 2026-11-12): arbitrations 1-5 approved (permanent dvh min-height, motion/react, 3 provisional FR labels, Type sort business order stable, « Tout afficher » keeps tiles and edits); mandatory correction folded as plan rev 4: panel from a finding ONLY (the family's existing trigger removed, family keeps inline « Retirer »); data controls on full rows incl. metadata (`guard.sh`, 197 018-row baseline); editor-equine never run, never reported verified
|
||||
- [x] R2.0 internal rename of the panel place (`references` → panel name), no visible effect
|
||||
- [x] R2.1 five-tab model (`EDITOR_TABS`, « Plus » below 640 px, header button removed, reference targets → tab, focus requests)
|
||||
- [x] R2.2 Références tiles (closed / open / edit, disclosure, citation count, hint instead of « Supprimer » when cited, A2 state)
|
||||
- [x] R2.3 search, clear, sort (four orders, pure over ids), counter, no-result line, reorder only in sheet order without search (A1), add flow
|
||||
- [x] R2.4 finding panel (filtered, Modifier, Retirer de ce constat, Aller à, Tout afficher, 34 rem, slide, reduced motion, inert through exit, focus return)
|
||||
- [x] R2.5 tests and non-regressions (unit, e2e:ui, e2e:shell on db:sandbox, axe, keyboard walk, layout widths)
|
||||
- [x] R2.6 docs, FR/EN label table, Rust exception (Part II), db:trial manual protocol, closure
|
||||
- R2 BUILT 2026-11-13, awaiting owner validation: fc3fec7 R2.0, 4499bc7 R2.1, c21995b R2.2, 3baac4d R2.3, 8db6f42 R2.4, 4b7d254 R2.5, 2182307 R2.6 docs, 1bf2701 final-review fixes (all pushed). Verifier 18/20 (NOT-MET 9 admin.spec renderer crash from accumulated grants, 15 read-only flip keeps panel open), security PASS, final review ready-with-fixes → fixed, re-review ready. Owner decisions pending: read-only flip ratification, admin.spec closure before merge (fresh-run authorisation or separate fix: paginated grants / run-scoped cleanup), add-draft cancel control, V1-2_ANATOMICAL_SHEETS.md D1-D4 supersede note wording. editor-equine updated, never run. Parked: N1 silent draft loss on read-only flip of an unmatched tile, N2 pinned non-matching tile beside no-result, first-click loss below a refused field, landscape 667×375 panel 13 px, M10 locals over 5 in R2 hooks (/refactor)
|
||||
- [x] R2 corrections (owner brief 2026-11-13, plan rev 5/5b): C0 admin.spec diagnosis (A/B 65a8fd3 vs 52aac41 identical, dose-response proves grant accumulation, BLK-015 open, pagination = RR-13), C1 read-only flip never drops a refused draft silently (3303530, 1e19479), C2 « Annuler l'ajout » + Escape (d177992, c8109af), C3 « Ne correspond pas à la recherche » (b1fd896), C4 667×375 touch proof, test only (969a5f3..78fb2d0), C5 docs (b919cf8, c0da36d, 58228ab), final review I1 (94f8a8b, 346a8fd), verifier gap undo drop announced (cb1ad47, 538ce27). Sweep 221p/119s/5f (admin.spec only), guard OK, verifier CONFORME, security PASS. BDR-115, LRN-133..135. Awaiting owner db:trial trial; residuals: two drops one flip speak last, undo/redo overwriting a pending draft in a mounted view, rotation cramped exception (auto-scroll offered), prettier drift editor-shell-layout.spec.ts:297-302
|
||||
- [x] R2 CLOSED 2026-11-15 (owner brief « Clôture R2 »): owner db:trial checks §4.13 + §4.14 pass, R2 validated functionally and graphically; Rev 4-6 adjustments (b41c24b..54e09a7, BDR-118, BDR-119); choices ratified: saved-reference edit keeps own Défaire, unsaved new reference lost on abrupt close. Final sweep 52d5613: 273p/163s/6f (admin.spec BLK-015, stays open, RR-13), not green. No merge, no deploy. Next: R3, R4; U2 not started (orientation 2026-11-14 kept)
|
||||
- [x] R3 sheet list + Administration home (owner brief 2026-11-16): CLOSED 2026-11-16, owner validation after the db:trial trial, phone filters included (reset stays in the panel only); BDR-120. Plan VALIDATED rev 2b `.claude/tasks/plans/2026-11-16-r3-sheet-list-0017.md` (D1-D4, D6, D7 yes; D5 no; recorded choices accepted; precisions P1-P4). Sandbox work authorised in plan scope; `pnpm db:trial migrate` authorised by the owner 2026-11-16 after the operational checkpoint and applied (Task 2); Tasks 3-8 authorised in plan scope; DEV unchanged. BLK-015 + RR-13 separate, open. pgTAP on the sandbox is NOT green (014, 021 below): never reported as green.
|
||||
- [x] Task 1 M9 migration + pgTAP 022 (74: drafts, working copy, sheet newer than versions; mutation-proved) + task review + security PASS; frozen (blob a33b1770) — e3495df, a76a54d, f3712b2
|
||||
- [x] Task 2 `db:sandbox migrate` (21c9a81, reviewed) + sandbox migrated 2026-11-16 (rows identical 6981/7130, rerun no-op); types match; recompute 6981 sheets mismatch 0 (11 working copies). db:trial migrated 2026-11-16 on the owner's go: app process checked then stopped, `pnpm db:trial migrate` 21 s, backup `20261116T144154Z-pre-migrate` (63M, checked before M9, checksums and archives re-verified), 18 applied; before / after digest of 58 tables, 155 functions (definition + privileges), 23 policies, 20 grants: 3 lines differ (migration registry +1, the summary function = sandbox digest 1a4a1157, privileges unchanged); accounts, roles, TOTP, sheets, versions, drawings identical; recompute 2 sheets mismatch 0; admin list, sheet page and editor read answer for the aal2 editor account (read-only); app restarted on 5194. Not checked: browser sign-in (owner trial); restore not exercised
|
||||
- [ ] pgTAP on the sandbox after M9, exact result kept open: `pnpm db:sandbox test-db` Files=21 Tests=1958 Result FAIL. 022 ok, 023 ok. `014_animals_relations` 2/258 failed (tests 6 « exactly the nine species… », 7 « every species row is active »). `021_sheet_verification_jobs` 23 failed, « Bad plan. You planned 90 tests but ran 42 », ERROR draft.frozen at :205. Read as accumulated-state dependent (line « suites need a fresh stack »), NOT proven by a run without M9; M9 touches neither file's functions. To settle on a fresh stack (`db:sandbox up fresh` needs an owner go: no sandbox reset in R3)
|
||||
- [x] Task 3 client requires last_modified_at (d9a5846, reviewed; supabase 181, app 1722, sandbox sheets-admin 5/5, guard identical)
|
||||
- [x] Task 4 search, sort, date format (pure) (f3b58ab, reviewed; app 1730)
|
||||
- [x] Task 5 list page (board 28, 29 A) (423125c, reviewed; app 1736, build ok)
|
||||
- [x] Task 6 home card (board 29 B) (de2424f, reviewed; app 1743, build ok)
|
||||
- [x] Task 7 shell spec admin-sheets-list + three locators (b4a5254, reviewed). Spec alone 4 passed. Sweep 27 files without editor-equine: 277 passed, 6 failed, 163 skipped, 0 flaky; failures all `admin.spec.ts` on the rights screen (BLK-015): « admin screens » :714 ×4 « Target crashed », A0 :220 ×2 lookup timeout at :144 (other symptom, about 7 600 grants; not A/B proven against pre-R3). A1, « access per right », editor-journey green. Guard: 0 pre-existing row changed; 12 R3 sheets soft-deleted
|
||||
- [x] Task 8 docs, closing gates, owner trial on db:trial: [x] documents as built (a86020d: U1_CORRECTIONS §R3, SQL checkpoint §6-§7 with F2-F4 corrections and F7 limits, V1-2 §12.3 M9, SUPABASE §5.1, BROWSER_TESTS, Rust Part II class C rows, design README deviations, CLAUDE.md, CHANGELOG) · [x] owner trial text §4.15 in French (b9e5d32) · [x] closing gates design review (28 CONFORME, 29 A and 29 B ÉCARTS, findings 1-4 fixed in the wave), code review (0 C, 0 I, 9 Minor: 1-7 fixed, 9 done at Task 8, 8 left), security PASS (4 non-blocking: spec SQL, date refine, RegExp escape fixed; db-sandbox.sh:485 false positive left) · [x] verifier on the contract 2026-11-16 at bcdacbb: ECARTS(1), 17/18 MET, criterion 4 NOT-MET on its CHECK line only (one-line literal split and strengthened by 374e300; layout-insensitive equivalent prints DATE_SOURCE_OK, recorded in the contract a8ab668; the owner closes it) · [x] `pnpm check:all` 2026-11-16 at bcdacbb: exit 0, « all checks passed » in 7 min 52 s (core-wasm 66, supabase 182, app 1743 in 137 files, e2e:ui 253 passed, app image, worker test and runtime image); e2e:shell NOT RUN by check:all (the sweep and the fix-wave run are the lines above) · [x] owner trial on db:trial passed and R3 validated 2026-11-16, no merge. Deviations for the owner: no magnifier (F14, validated); no info icon in the board 28 no-result block (ruling, to confirm)
|
||||
- [x] Final fix wave 2026-11-16 (`374e300` client refuses an unreadable date, test first; `1758276` list hooks split, rows memoised, className constants, phone clear button; `8bb2486` home cards as board 29 B, 44 px name links, row rhythm; `ea5512a` spec: `literal()` + uuid shape, UTC, one `<time>` per item, escaped pattern, Escape; docs commit after). Units core-wasm 66, supabase 182, app 1743; build ok. One run of admin-sheets-list + admin + editor-journey: 15 passed, 6 failed, 9 skipped, all six `admin.spec.ts` BLK-015 class (admin screens ×3 Target crashed + ×1 timeout during axe at :747; A0 fr :144, A0 en :158 « Granting… »), not A/B proven; guard 0 changed 0 missing 20 new; 6 R3 sheets deleted. Owner decisions open: U1_CORRECTIONS §R3 list (info icon, « Nouvelle fiche » at 375, breadcrumb, filter + search no result, double announcement)
|
||||
- [ ] Follow-up (security gate, outside R3's diff): guardrails scanner 2 FAIL at `scripts/db-trial-check.sh:1340`, pre-existing, not analysed
|
||||
- [ ] Follow-up: WebKit parsing of six fraction digits in `new Date(iso)` not verified (Chromium only until V1-5)
|
||||
- [ ] Follow-up: the R3 spec adds 2 accounts and 2 `sheet_editor` grants per run, feeding BLK-015's accumulation (RR-13)
|
||||
- shortcut: `apps/app/src/admin/sheetList.ts` search and sort run in the browser on the whole loaded list. Limit: the whole list loaded in one unbounded read, then filtered and sorted in the browser at each keystroke. Upgrade path: they move to the server with the admin list paging, RR-13 (widened per D4)
|
||||
- shortcut: the search field in `AdminSheetsRoute.tsx` repeats `ReferenceToolbar`'s search markup (R2, closed). Limit: two copies of one field. Upgrade path: fold both onto one shared search component when the editor is next opened
|
||||
- [x] Owner trial 2026-11-16 db:trial: R3 behaviour validated; phone filters collapsible (`9efc7b7`, spec `6d2ba0d`, no new board), double announcement fixed (filters-only empty line no longer a status), contract criterion 4 oracle replaced by the layout-insensitive check (DATE_SOURCE_OK). Units at `6d2ba0d`: core-wasm 66, supabase 182, app 1749 in 137 files; spec admin-sheets-list alone 8 passed (4 tests x 2 projects). BLK-015 and admin.spec.ts failures unchanged, separate.
|
||||
- [x] Phone filters review: 1 review + 2 fix rounds (`7a129dc`, `ca70178`, `a50796b`; closed panel height 0 asserted). `pnpm check:all` at `a50796b` exit 0: core-wasm 66, supabase 182, app 1750, e2e:ui 253; spec admin-sheets-list 8 passed. Sandbox R3 sheets: 60, all soft-deleted.
|
||||
- shortcut: the phone filters panel in `AdminSheetsRoute.tsx` is local to the sheet list. Limit: one page; the other admin lists have no filters panel. Upgrade path: lift it to a shared disclosure component when a second list needs one
|
||||
- [ ] Follow-up, NOT R3 (owner D5 2026-11-16): keep the admin sheet list's search, sort and filters when coming back from a sheet; joins the app-wide « search not kept on back » follow-up (BDR-079); BDR-116 rejected address parameters for view state; later navigation improvement, own go
|
||||
- [x] Anomaly B FIXED `2cdee42` (owner 2026-11-12 « Décision sur l'anomalie E2E », option 1): dialog checks moved to e2e:ui on the real WorkingCopyAction (`e2e/harness/working-copy.*`, `e2e/ui/working-copy.spec.ts`), shell keeps the historical page + state-consistent button check, sandbox suite archives only its own copies (`returning id` checked). Before 4 failed; after 4 passed ×2; full admin.spec 16 passed / 8 skipped; e2e:ui 251 ×2; sandbox sheets-admin 5/5; pre-existing anatomical_sheets rows identical per id (637 → 643, 6 added by A1). Verifier CONFORME, security PASS (1 LOW: optional uuid check before interpolation). Open: cleanup creation branch not run on a fresh stack; free branch of the shell check not run on this sandbox; `editor-equine.spec.ts` set-aside still archives and restores pre-existing copies (8c315a12 included, updated_at 2026-11-12 13:40 from the R1 follow-up run): owner decision. R2.0 waits for the owner's green light on this result
|
||||
- [ ] editor-equine risk (owner 2026-11-12 « Validation du correctif E2E et GO R2 » §3; separate fix, NOT part of R2): `editor-equine.spec.ts` beforeAll archives every active historical working copy (`update public.anatomical_sheets … private.is_historical_working_copy(id)`), afterAll restores them, and `confirmHistoricalDrawing` may upload / confirm the historical sheet's drawing; it already changed 8c315a12's `updated_at` (2026-11-12 13:40 UTC). NOT to be run on a persistent database holding data to preserve until fixed. Before any rerun: list its writes exactly, propose a reproducible non-destructive isolation of pre-existing resources, check interactions with admin.spec and parallel suites; keep 8c315a12 and its current metadata (no artificial date restore); no sandbox reset or deletion
|
||||
- [ ] e2e fixture accumulation (owner 2026-11-12 §3): sheets created by the suites persist on the sandbox (admin.spec A1 `fiche-e2e-<tag>` never archived, seedDraft / seedOfficialSheet sheets, editor copies); track them (count per run, owner per fixture) and propose run-scoped cleanup limited to ids each run created
|
||||
- [x] (was) Anomaly B (owner 2026-11-12, decision C): `admin.spec.ts` « admin screens: axe and no sideways scroll » (4 failures: 2 locales × 2 viewports) depends on the historical sheet's free working-copy slot, taken on the sandbox by `sheets-admin.sandbox.ts:181-195` (copy `8c315a12-…`, never archived). Fix in its own commit with proof the 4 failures are gone; isolated reproducible fixture, no existing data deleted; stop and present options if impossible without a destructive op or a scope change
|
||||
- [x] R3 sheet list: search + name sort first; date, date sort and « most recent » home card only after the dedicated SQL checkpoint `docs/development/V1-2-6_R3_SQL_CHECKPOINT.md` (A7 ratified 2026-11-09; never a creation date shown as modification date). Two-step split superseded 2026-11-16 by owner D2: one lot after M9, tracked in the R3 block above
|
||||
- [x] R4 catalogue card integrity warning (independent fix, = anomaly C): CLOSED 2026-11-17, owner validation after the manual trial on `pnpm db:sandbox trial` (§4.16, account `praticien@trial.local`, `catalog_reader` only); D4 archive kept, business rules on sheets with a published version unchanged; `Card.tsx` and `e2e/support/records.ts` accepted; BDR-121. `useCardDetails.ts` dropped a failed `loadVersion` silently; UI only, check never bypassed
|
||||
- [x] R4 plan rev 2 (owner brief 2026-11-16 « R3 est terminé … passer à R4 »): `.claude/tasks/plans/2026-11-16-r4-card-integrity-2337.md`, audit F1-F12, three challenges on rev 1 (correctness FATAL(4), robustness FATAL(4), simplicity FATAL(3)) folded in. STOP: owner decisions D1 caps class, D2 thumbnail failure, D3 trial place (sandbox recommended, trial stack has no published version), D4 e2e cleanup of published fixtures (archive own rows by SQL recommended). No implementation before them; DEV unchanged, no merge
|
||||
- [x] R4 plan rev 3 VALIDATED 2026-11-17 (owner « Je valide le plan R4 … »: D1 alternative, own caps line without retry; D2, D3, D4 as recommended; R-2 to R-7 accepted; P1 trial tells sandbox anomalies apart, P2 spec cleans only its own rows). Contract `.claude/tasks/contracts/2026-11-17-r4-card-integrity-0004.md` (7575c67). Branch feature/v1-2-anatomical-sheets, no merge, DEV unchanged, no write on db:trial
|
||||
- [x] Task 1 card failure line (board 30): f061111 Notice warning tone, `icon`, `live` + `wifi-off`; 6ad8d83 `cardFailure`, `useCardDetails` `{ state, retry }`, `CardFailure`, A10 key; `Card` `aria-busy` (outside file list, accepted). App 1771 tests in 138 files; typecheck, lint, build exit 0. Review approved (0 C, 0 I)
|
||||
- [x] Task 2 browser proof dadd8e5: `catalogue-integrity.spec.ts` alone 6 passed 0 failed 0 skipped 0 flaky (twice: once with temporary screenshot lines, once as committed); `catalogue.spec.ts` alone 8 passed. Guard: 0 removed, 0 changed, 81 added (27 sheets, 43 versions, 11 grants); 8 R4 sheets archived, 4 grants revoked by id, read back. Review approved (0 C, 0 I)
|
||||
- [x] Task 3 documents as built: U1_CORRECTIONS §R4 « As built 2026-11-17 » and §5 row C closed, OWNER_TRIAL §4.16 (db:sandbox trial), review Part II class C row (R-8), CHANGELOG, BROWSER_TESTS, design README deviation. Read-only sandbox census: 164 catalogue entries, 160 ok and main view composed, 4 `fingerprint_mismatch` = the four « Cheval sandbox » (anomaly A, stored `'a'.repeat(64)`), no other kind. No `shortcut:` in the R4 diff (`git diff b895ecf..HEAD`)
|
||||
- [x] Closing gates (controller): design review vs board 30 (CONFORME but one écart, fixed in the wave), final code review (0 C, 1 I, fixed), security PASS (1 LOW fixed), re-review of the wave (16/16 addressed), verifier ECARTS(5) → two tests added `83f2d8b`, contract oracle 9 and scope rulings `2c9d837`, gates.sh MET; `pnpm check:all` at `2c9d837` exit 0 (core-wasm 66, supabase 182, app 1780, e2e:ui 253; e2e:shell not run by check:all). Second fresh verifier at `8224eda`: ECARTS(2), criteria 1-16 all MET; the two écarts are the out-of-scope files `Card.tsx` (optional `aria-busy`) and `e2e/support/records.ts` (`capturedId`), judged justified and additive, owner micro-gate
|
||||
- [x] STOP owner trial R4 on `pnpm db:sandbox trial` (OWNER_TRIAL §4.16) and owner ruling on the two out-of-scope files; no merge. Done 2026-11-17: trial passed, R4 validated, archive (D4) and both files accepted. Final results kept: app 1780 tests in 138 files; check:all at `2c9d837` exit 0 (core-wasm 66, supabase 182, app 1780, e2e:ui 253; e2e:shell not in check:all); `catalogue-integrity.spec.ts` alone 6 passed 0 failed 0 skipped 0 flaky ×4; `catalogue.spec.ts` alone 8 passed; guard 0 removed 0 changed 81 added
|
||||
- [x] Final fix wave (FX1-FX16, `.superpowers/sdd/2026-11-16-r4-card-integrity-2337/final-fix-list.md`): b378cf0 retry ending with no retry left keeps the polite region and moves focus to « Consulter », busy look on « Réessayer », engine stopped for good in the error tone, one attempt for two calls in one tick, rendered tests (engine stopped, two cards on the core, no blob URL after unmount); 2930f49 lines over 100 columns wrapped; 1e50585 board 30 deviation fixed (failure row `*:px-3`, both buttons on one row at 1280 and 375, e2e checks it); 3bea19f spec reads each own sheet's name by id before archiving, `seedGrant` account id through `capturedId`. App 1775 tests in 138 files; typecheck, lint, build exit 0. `catalogue-integrity.spec.ts` alone 6 passed 0 failed 0 skipped 0 flaky (twice: once with temporary screenshot lines, once as committed); `catalogue.spec.ts` alone 8 passed. Guard: 0 removed, 0 changed, 81 added (27 sheets, 43 versions, 11 grants), the runs' own; 8 R4 sheets archived, 4 grants revoked, read back. `pnpm check:all` then run at `2c9d837` (line above)
|
||||
- [ ] Follow-up: seed owner row in `private.catalog_write_budgets` is R4's own (none before R4; its first run created it, later runs update that same row, 4 archives per run; 8 of 300 per hour after the final wave, outside the data guard); `catalogue.spec.ts` still leaves its published sheets listed, warm-up its sheet and `sheet_editor` grant per invocation (BLK-015, RR-13)
|
||||
- [ ] owner arbitrations A1-A15 (`V1-2-6_U1_CORRECTIONS.md` §6, `TRIAL_STACK.md` §6)
|
||||
- [x] V1-2.6 UX U2 design: boards 02-06, 13 redrawn + extras from 31 (owner brief 2026-11-17 « R4 est terminé … préparer U2 », orientation 2026-11-14 BDR-117; contract `.claude/tasks/contracts/2026-11-17-u2-design-boards.md`; docs only, no code, no DEV, no merge). [x] audit as built · [x] boards + REVUE + ARBITRAGES in `docs/design/v1-2-6-u2/` (bc19481, fixes 8bdb23a and pass 3) · [x] fresh design review (5 must-fix, 19 should, 19 observations; fixed) · [x] fresh conformity check (ECARTS(4), then re-check ECARTS(1) on 8bdb23a: two labels, fixed) · [x] owner validation 2026-11-17: nine boards + A1-A15 as recommended, adjustments A13 hint, A14 no shift, board 33 messages (ARBITRAGES « Validation du propriétaire »)
|
||||
- [x] V1-2.6 UX U2 technical plan (owner brief 2026-11-17 « conception graphique U2 validée … plan technique »): plan `.claude/tasks/plans/2026-11-17-v1-2-6-u2.md` · [x] audit · [x] plan rev 1 · [x] three fresh plan-challengers (rev 1: correctness FATAL(9), robustness FATAL(9), simplicity CONCERNS(5); rev 2 integrates them) · [x] owner approval 2026-11-17 (rev 2 + D1, D2 with zoom hint R-18, R-12 corrected) → rev 3, BDR-123
|
||||
- [ ] V1-2.6 UX U2 implementation (contract `.claude/tasks/contracts/2026-11-17-v1-2-6-u2-implementation.md`, plan rev 3, subagent-driven): [ ] T1 core min radius · [ ] T2 press machine · [ ] T3 strip + message, no shift · [ ] T4 points, move mode, guard · [ ] T5 zones, redraw, R-18 · [ ] T6 properties dialog · [ ] T7 creation · [ ] T8 touch, loupe · [ ] T9 docs · [ ] T10 gates, verifier, security · [ ] STOP owner trial on `pnpm db:trial` before closure
|
||||
- [ ] Test anomaly A (owner 2026-11-09, separate from U1/U2): fictitious fingerprints `'a'.repeat(64)` from worker stand-ins (`packages/supabase/tests/sandbox/sheet-fixtures.ts:115` openRound, `sheets-concurrency.sandbox.ts:168`, `sheets-perf.sandbox.ts:169`); 7 published/deprecated sandbox versions fail `check_published`. Fix: real fingerprint through the core (as e2e `fingerprintOf`, `apps/app/e2e/support/catalogue.ts:88`); never weaken the publish gate or the reader check. Needs its own go. Census 2026-11-17 (R4 Task 3, read-only): 4 of 164 catalogue entries fail, the four current « Cheval sandbox » versions (2 at v1, 2 at v2), all `fingerprint_mismatch`; R4 cards show them with the integrity line.
|
||||
- [ ] Test anomaly B (owner 2026-11-09, separate from U1/U2): `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts:181-195` creates the historical working copy and never archives it; slot taken → `admin.spec.ts:717` fails x4. Fix test independence and cleanup; the existing copy `8c315a12-20d4-4432-9db3-7cb88b27a5b4` stays untouched until the owner authorises. Linked: RR-13, the admin.spec confirmation line above.
|
||||
- [x] Test anomaly C (owner 2026-11-09, separate from U1/U2): CLOSED 2026-11-17 with R4's owner validation. Integrity failure invisible in catalogue cards; implemented as lot R4; failure shown, never hidden or bypassed. Built 2026-11-17 (R4 Task 1-3 and final fix wave, `V1-2-6_U1_CORRECTIONS.md` §5 row C: built by R4, closes on the owner's validation); checked off with R4's owner validation.
|
||||
- [ ] Dedicated persistent manual trial stack (owner 2026-11-09, D8; brief « Après R0 — Implémentation technique », contract .claude/tasks/contracts/2026-11-09-db-trial-stack-1809.md): [x] lot A suites' guard · [x] lot A2 trial dev server target (R13) · [x] lot B1 foundation · [x] lot B2 backups, restore, migrate, rotation · [x] lot B3 accounts, grants, drawings, app · [x] lot C docs · [x] reviews (verifier ECARTS owner-gated only, security PASS, code review + 2 re-reviews fixed: d3bdbbe, f2cbf68) · [x] first create 2026-11-11 at 255dd67 (owner go) · [x] post-create checks: interrupted at check 3 (TR_PW in the db container log), owner decided 2026-11-11 (rotation + fix, sub-item below) · [x] accounts 2026-11-11 (owner brief « Checkpoint sécurité et autorisation des comptes »): owner@trial.local owner+admin, praticien@trial.local admin+sheet_editor, 1 verified TOTP each (BDR-112), roles/rights/audit/aal2 refusals/secrets/persistence checked · [x] equine drawing 2026-11-11 (owner brief « Autorisation de l'import équin »): `pnpm db:trial assets`, 1/1 uploaded and confirmed, object re-downloaded through the gateway byte-identical, second read-only pass nothing to do, draft = document.json, seed = HEAD · [x] owner U1 manual test 2026-11-12 (brief « Retour du test manuel U1 »): equine working copy, four tabs, annotation select and edit, saves kept after reload, undo/redo, historical sheet unchanged; one defect → R1 D6b · [ ] owner Droits screen at aal2 not reported
|
||||
- app exposure (owner 2026-11-11, BDR-111): `pnpm db:trial app` listens on 192.168.1.100:5194 only (not 0.0.0.0; Host allowlist answers 403 to other names; 127.0.0.1:5194 closed). The accounts brief authorised 127.0.0.1:5194; the owner moved it to the LAN address the same day. No wider LAN exposure (other port, 0.0.0.0, firewall change) without a distinct decision.
|
||||
- shortcut: `pnpm db:trial app` takes no lock (scripts/db-trial.sh, comment above cmd_app): stop, backup, migrate, destroy, restore or rotate-* started in another terminal in the second before Vite listens on 5194 goes ahead. Upgrade: a dedicated app lock, shared by app and exclusive for those commands.
|
||||
- [x] init log leak: the image's /docker-entrypoint-initdb.d/migrate.sh runs `ALTER USER supabase_admin WITH PASSWORD '…'` while the init server logs statements, before /etc/postgresql.schema.sql (db container log line 379). Owner 2026-11-11 « Correction minimale de la fuite TR_PW »: [x] one-off TR_PW rotation (5 roles, auth/storage/rest recreated, old password refused on scram, services ok; the db container log and frozen env keep the dead old value, allowed) · [x] fix 5f63d22 `-c log_statement=none` on the server command line (contract .claude/tasks/contracts/2026-11-11-trial-init-log-leak-1907.md, harness 373/0, control 372/1, verifier CONFORME, security PASS, LRN-127) · [ ] real proof: a create on a fresh volume with the log scan (needs its own go) · not closed, named in SUPABASE.md §5.2: init error statements, migrate.sh argv, db-sandbox.sh same DB_INIT
|
||||
- [ ] arbitration 1: narrow the file-wide `# shellcheck disable=SC2016` of db-trial-check.sh to its lines; a readable reason on every directive
|
||||
- [ ] arbitration 2: LAN Playwright environment check proves target, container or service, key issuer and no DEV fallback before connecting (5193 vs 5194 explained and checked)
|
||||
- [ ] arbitration 3: rotate-secrets revokes refresh tokens and handles old access JWTs, tested on the real stack before it is enabled, else it refuses with the limit documented
|
||||
- [ ] arbitration 4: destroy refused by default without a backup proved by an isolated restore (PostgreSQL and Storage); explicit controlled procedure for an instance proved empty
|
||||
- [ ] Rights screen lists every catalogue grant unbounded (list_catalog_grants, GrantList): 2 306 rows crash axe at 8 workers on a long-lived sandbox. Owner 2026-11-09 (BDR-106): own priority track RR-13, separate from U1 and U2, not implemented now.
|
||||
- [ ] V1-2.6 UX complement « annotations ↔ constats » (owner brief 2026-11-06 « Nouvelle exigence UX : navigation bidirectionnelle »; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`; design only, U1 plan untouched, no code, no DEV): [x] relations audit (one link `finding_zone_id`, no new association, equine draft 1:1) · [x] boards 17-22 `docs/design/v1-2-6-constats/` · [x] study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` (no U1 integration point needed, sub-step U2b proposed, risks, tests, decisions F1-F21) · [x] fresh design review APPROVE WITH FIXES (3 MUST-FIX, 16 SHOULD), fixes applied · [x] fresh verifier ECARTS(4) → ECARTS(2) → CONFORME 9/9 (round 3; 567da67 came after it, not covered) · [x] owner principle validation 2026-11-06 (brief « Validation de principe U2b et préparation des checkpoints », BDR-103): U2b retained after U2 and before U3, F1/F2/F6/F8/F22 approved, F7 for the term « Famille », F3/F4 in part · [x] decisions F1-F22 table (alternatives, consequences, state), F2 groups vs leaves, F3 field list, F4 view semantics, boards with their decisions in study §7.4, U2b entry in `V1-2-6_UX_PLAN.md` §3, LRN-119 (`<Activity>`), contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md` · [x] fresh verifier on that contract: ECARTS(9) → fixed → CONFORME 11/11 (6 observations outside criteria kept for the owner) · [x] owner 2026-11-06 (brief « U1 / U2b — Derniers arbitrages avant implémentation », BDR-104): F2 leaves, F3, F4 model A, F8, F22 decided; study §6-§7 updated · [x] owner: F5, F9-F21 approved as recommended, precisions F3, F8, F11-F14, F22 (brief « Ratification finale U1 … », 2026-11-06, BDR-105); study header, §6 tests, §7 table, 7.2, 7.3, UX PLAN U2b entry, REVUE, DECISIONS pointer updated; no implementation · [ ] U2b authorisation (after U2, before U3)
|
||||
- [ ] follow-up candidates (owner T14): multi-tab notice; RR item for the rollback limit of the category model (new id, reconcile with develop)
|
||||
- [ ] curves lot (ex-U9, owner T16 2026-11-05): curve handle editing, curved zone move, path remap, path point correction; spec `V1-2-6_UX_PLAN.md` §2 D, tests `V1-2-6_UX_TESTS.md` « Curves lot ». Rule: no feature that lets a path enter a document (package import, zones from the drawing's shapes, a curve drawing tool) ships before or without it. Before the new model is activated on an environment, and before U6 or U8 reaches any environment beyond the throwaway sandbox: read-only count of path geometries in its drafts and published versions (sandbox by U6 itself; DEV and shared environments by the owner or under explicit authorisation; non-zero reopens T16)
|
||||
- [ ] MANDATORY before merging V1-2 into develop (owner 2026-11-03): registry id reconciliation. LRN-095 collides: develop 09655b2 « Port a safe runner verbatim… » (2026-11-02) vs V1-2 « pgTAP across PGlite and the real Supabase image… » (2026-10-28, cited by BDR-084 and the V1-2.1 TODO lines). BLK-013 exists on develop only (« e2e:avatar on develop reached DEV »): `memory.sh` on V1-2 would hand out BLK-013 again, so a V1-2 blocker needs its id checked against develop first. Same for the TODO release-readiness ids: RR-11 is develop's (« sandbox-only e2e follow-ups »), V1-2 uses RR-12. No renumbering during V1-2.6 unless needed; renumber one side and patch its citers at the merge
|
||||
- [ ] V1-2.5 catalogue, admin space, rights, species, MFA · V1-2.6 editor level 1 · V1-2.7 preview, review, publication UI · V1-2.8 equine working copy and review preparation · V1-2.9 FR/EN acceptance and closure (owner checkpoints V1-2.3, V1-2.4, V1-2.6, V1-2.7, V1-2.8, V1-2.9 + each DEV operation of contract §16.11)
|
||||
|
||||
## Host observations (outside Faunosteo; recorded at the owner's request, values never written)
|
||||
- [ ] 2026-11-11, seen in `ps` during the db:trial secret scan: a local Valheim game server process (`valheim_server.x86_64`, not part of Faunosteo) carries a password in its command-line arguments, readable by every local user through `ps` or `/proc/<pid>/cmdline`. The value was neither recorded nor reproduced. Owner action, outside this repository: move the password out of argv (config or environment file), then change it.
|
||||
|
||||
## Release readiness track (owner 2026-10-25, distinct from the functional roadmap; nothing here authorises a release or exposure)
|
||||
Inventory: `.claude/audits/2026-10-25-functional-inventory.md`. Each item: treat or qualify before any release or public exposure; not fixed now unless an active critical flaw is shown.
|
||||
@@ -544,6 +779,9 @@ Inventory: `.claude/audits/2026-10-25-functional-inventory.md`. Each item: treat
|
||||
- [ ] RR-8 mobile and end-to-end: real-browser e2e for sign-up, login, account, avatar, full editor flow, export, locale, mobile drawer (TEST_STRATEGY §1 `apps/app/e2e`); per-check device results (J1/J2 recorded as a whole)
|
||||
- [ ] RR-9 release 0.2.0 fate (Steps 3–6 on TS engines, 341 commits behind develop): ship, supersede, or rebase; sheet bundle default `none`
|
||||
- [ ] RR-10 census tools maintenance (LOW `#[ignore]` positions) and controlled oracle evolution on a new anatomical changeset
|
||||
- [ ] RR-12 (RR-11 is taken on develop: « sandbox-only e2e follow-ups ») AAL2 token after factor removal, production security prerequisite (owner 2026-11-03, recorded at V1-2.6, NOT fixed): catalogue and sheet RPCs and Storage policies check the JWT `aal2` claim (`private.has_mfa()`), not the live session (`has_aal2_session()` serves role and rights RPCs only), so a token issued at `aal2` keeps passing them after a factor removal until it expires. Study a live-session check or a revocation strategy compatible with Supabase / GoTrue before production; no authentication change in V1-2.6. Recorded in V1-2 contract §13
|
||||
- [ ] RR-13 (free on develop, max RR-11, and on V1-2, max RR-12) « Pagination côté serveur de la liste des droits et prévention de l'épuisement mémoire », scope widened 2026-11-16 by the owner (R3 D4) to the server paging of the admin lists, rights and official sheets (R3's browser-side search and sort move with it: `shortcut:` of `apps/app/src/admin/sheetList.ts`), not implemented in R3 (owner 2026-11-09, BDR-106; priority technical track, separate from U1 and U2; NOT implemented, needs its own plan and owner go). Cause: `list_catalog_grants()` (`supabase/migrations/20261028100000_sheet_access_hardening.sql:542`) and `GrantList.tsx` return and render every grant; on a long-lived sandbox (2 306 rows) the axe scan takes the Chromium renderer to ~2.2 GB and earlyoom kills it (« Target crashed », admin.spec 9/9 on 89da8d3, 580ff28, 606f7ba; absent at seed volume); the same memory pressure SIGTERMs DEV `pg_meta` (39 restarts in 2 days, stateless). The plan must cover: [ ] bounded server paging · [ ] deterministic result order · [ ] authorization checks unchanged · [ ] paging and large-volume tests · [ ] admin scenario independence tests (admin.spec:717 working-copy slot) · [ ] memory consumption check · [ ] Supabase DEV protected from indirect effects of the test suites
|
||||
- [ ] RR-14 (on V1-2; develop max RR-11) secrets outside logs, process arguments and test artifacts, production security prerequisite (owner 2026-11-12; not blocking R2; recorded in V1-2 contract §13): no real password or secret in any log; no real secret in process arguments (argv); no real secret in test or CI/CD artifacts; these three checked before any deployment. Trigger: guardrails FAIL `API-PASSWORD-PLAINTEXT` / `API-PASSWORD-LOGGED` at `scripts/db-trial-check.sh:1340` (security gate 2026-11-12); the passwords there are fictitious, test-only. Owner: harness NOT modified, no secret rotation now
|
||||
|
||||
## Phase A — DONE (kept for reference)
|
||||
|
||||
@@ -673,3 +911,21 @@ Apply when implementing B-phase:
|
||||
| C. Full horse.json authoring (user) | external |
|
||||
| C. QA + docs + deploy | 4 |
|
||||
| **Total dev** | **~23h** |
|
||||
|
||||
- [ ] S closure + V1-2.4 go (brief « Clôture V1-2.3 et lancement V1-2.4 », 2026-11-02, on 57b93af): V1-2.3 VERIFIED (BDR-093); CPU-contention MEDIUM accepted temporarily, register V1-2 contract §13.1 (VR-1..VR-5); `pnpm e2e:sheet-assets` = sandbox alias (f924ad0); INCIDENT 2026-11-01 23:03:49 UTC: executor ran the old DEV script from the main checkout (13 GET, no write, DEV not restarted); V1-2.4 maquettes (proposition); STOP at graphic checkpoint SECOND INCIDENT 2026-11-01 23:10:59 UTC, orchestrator: unquoted heredoc ran `pnpm e2e:sheet-assets` in the main checkout (13 GET, no write, DEV not restarted); STOPPED, reported to owner
|
||||
- [x] T containment (brief « Incident DEV : confinement, correctif urgent et reprise V1-2.4 », 2026-11-02): bugfix/sheet-assets-e2e-sandbox-only merged into develop 6287e5b (runner byte-identical to V1-2 bbc0627, always refuses on develop); refusals proven without IP sockets (strace, 7 configs), sandbox run 11 PASS; security PASS + 3 LOWs fixed; incident report `.claude/audits/2026-11-01-dev-read-incidents.md` (13 GET each, reconciled); LRN-110 supersedes LRN-102
|
||||
- [ ] at the V1-2 merge: CLAUDE.md (e2e:sheet-assets line) and docs/development/SUPABASE.md §3.1 conflict with develop's bugfix text: keep the V1-2 text
|
||||
- [ ] still vulnerable, owner decision needed: develop `pnpm e2e:avatar` (scripts/avatar-e2e.sh: DEV keys, worker on DEV, writes, purge expedite); main checkout (feature/v1-1-clients-animals) and worktree old-958228a hold both old scripts on disk; main and release/0.2.0 hold neither. Agents never run them.
|
||||
- [x] V1-2.4 maquettes: design review (4 MUST-FIX, 10 SHOULD) applied, boards re-rendered; sheet-assets V1-2 security PASS, LOWs open: one sandbox e2e at a time (shared gateway name and port), PGPASSWORD reaches the sheet-assets build, issuer claim not signature, gateway left after SIGKILL; verifier ECARTS(2) on a15c35c (G1 phantom warning board 06, G2 « Mark as reviewed » shown ratified) → owner-authorised text fixes + fingerprint / verdict_refused messages, only 06 and 12 re-rendered, contact sheet + `docs/design/v1-2-4/REVUE.md` (98e8403); fresh verifier CONFORME; graphic checkpoint at the time (visual validation and labels then pending; approved 2026-11-02, BDR-096, below)
|
||||
- [x] UX decisions 2-11 ratified, item 3 settled (hidden entry, « Accès non autorisé », signed out → login), reviewer-only keeps limited « Administration », §6.5 alert divergence recorded: BDR-094, contract §5.3, §6.5, §11.1, §17.8, REVUE.md (L32 « Accès non autorisé » EN to arbitrate)
|
||||
- [x] owner: global visual validation of the 12 boards + complement (brief « Validation propriétaire V1-2.4 », 2026-11-02, on 74aa8f6): V1-2.4 GRAPHICAL APPROVED, BDR-096, contract §16.5 + §17.9, maquettes contract, REVUE.md, design README; L20 EN « Fix the draft » / « Edit the draft », L32 EN « Access denied » (explanation + link as decided), object_conflict FR ratified; L14 confirmed; no board regenerated
|
||||
- [ ] still open after the approval, none blocking: L15 2nd sentence (before V1-2.6 narrow-screen mode), object_conflict EN + 16 other code messages (checked at integration), L30 refusal messages (with their screens: rights.* + mfa_required V1-2.5, verdict/publish/review V1-2.7)
|
||||
- [x] final graphic corrections (brief « V1-2.4 : dernières corrections graphiques », 2026-11-02, on fdf0f7f, after the owner's external review): mockups and their sources only, no app code, no DEV, no Docker, no merge, no V1-2.5; STOP at the final graphic checkpoint, no approval recorded
|
||||
- [x] F1 board 01: search by sheet name only, « Rechercher une fiche » (UX decision 4 withdrawn)
|
||||
- [x] F2 board 06: distinct titles, failed « Vérification échouée » / unavailable « Vérification indisponible », explanations and exits kept
|
||||
- [x] F3 board 03: whole horse at opening on mobile (fit to the screen, zoom after), drawing untouched
|
||||
- [x] F4 board 05: 1 024 px minimum instead of « ordinateur »; F5 board 04: vertex wording, level 1 behaviour unchanged
|
||||
- [x] F6 complementary board « Accès non autorisé », outside the twelve
|
||||
- [x] F7 board 12 rows touched by F2, F4, F6; contact sheet, REVUE.md (labels: both reviews compared, nothing ratified), README line, contract §17.8, SHA256SUMS, new zip (9adbd3a, f9fc13c; zip `faunosteo-v1-2-4-maquettes-corrigees.zip` sha256 b5bd8abf…)
|
||||
- [x] F8 fresh verifier on the new batch; open label arbitrations to the owner: ECARTS(1) = archive not yet built at check time, 15/16 met; archive built after, sums checked
|
||||
- [x] owner arbitrations (brief « arbitrages propriétaire et préparation de validation finale », 2026-11-02, on c2a3147): A1 BDR-095, A2 board 05 whole horse at 768 px, A3 V1-2.7 lists on failure_outcome, A4 24 common labels + owner arbitrations, A5 affected boards + contact sheet + archive -3.zip; verifier ECARTS(2) → ECARTS(1) → CONFORME 21/21 (27e5727, 74aa8f6)
|
||||
@@ -0,0 +1,142 @@
|
||||
# Contract: V1-2.2 core (verdict, PreviewSheet, edit primitives, SVG cleaning)
|
||||
|
||||
Source of truth: `docs/development/V1-2_ANATOMICAL_SHEETS.md` (the "V1-2 contract"), §16.3 for the
|
||||
step, with the sections it cites. Owner brief 2026-10-29 « Autorisation de démarrer V1-2.2 ». Base
|
||||
commit `ac71c5b` (V1-2.1 verified by the owner). Diff under review: `ac71c5b..HEAD` on
|
||||
`feature/v1-2-anatomical-sheets`.
|
||||
|
||||
## Scope (§16.3)
|
||||
|
||||
1. The verdict function: strict parse, issues, caps, drawings, fingerprint, completeness, groups,
|
||||
digests, removal groups, change list (§6.3, §6.4, §6.5, §6.6, §6.7).
|
||||
2. `PreviewSheet` as the catalogue, preview and editor handle, with `view.canvas` on it (§8.1, §10).
|
||||
3. `sheet.edit` primitives with the status rules of §6.6; `dependents` (§8.1).
|
||||
4. SVG classification and cleaning (§9.2).
|
||||
5. Application changes limited to the wasm facade and the ts-rs types; no SQL change; no screen.
|
||||
|
||||
## Acceptance criteria (§16.3, §15 « Core »)
|
||||
|
||||
- A1 Hash and fingerprint mismatches refused by `PreviewSheet`.
|
||||
- A2 The equine draft previews with the same index and fingerprint as from the bundle.
|
||||
- A3 An invalid draft draws with its issues.
|
||||
- A4 A document replacement redraws without re-reading the drawings.
|
||||
- A5 The groups of a derived version that deletes a zone include its removal group.
|
||||
- A6 Vector-tool exports cleaned and hostile files refused (scope: the owner's final decision E1 below, which
|
||||
replaces D1, B6 and C1 on this point).
|
||||
- A7 Every edit primitive outputs a strictly parseable document, keeps existing keys and applies the
|
||||
status rules (property tests).
|
||||
- A8 Groups, digests and removal groups; the change list; the verdict function tested.
|
||||
- A9 SVG classification and cleaning tested on committed vector-tool exports and the hostile corpus;
|
||||
the cleaning fixpoint proven by a property test.
|
||||
- A10 Caps fixtures at cap − 1, cap, cap + 1 and with astral characters.
|
||||
- A11 The document size computed in the measure of §12.2 (`octet_length(content::text)`, the jsonb
|
||||
text form, never `JSON.stringify`), reusing the pgTAP 017 vectors.
|
||||
- A12 Wasm facade and ts-rs types; the N-1 reader untouched; the frozen oracles green.
|
||||
- A13 None of the protected readers is modified: `crates/core/src/domain/{archive/read,report/rebase,
|
||||
report/read,session}.rs`, `crates/core/src/pdf/{read,json_js,import}.rs`, the frozen
|
||||
`packages/core-wasm/tests/n-1` copies. Any change there is a deviation.
|
||||
- A14 The verdict is never computed or accepted from a page (O15): no RPC or browser path makes a
|
||||
verdict authoritative.
|
||||
- A15 Verdict shape compatible with what the M5 SQL (`supabase/migrations/20261028110000_sheet_review_workflow.sql`)
|
||||
reads: `verdict->'groups'` items `{key, digest, coverable}`, `verdict->'drawings'` items
|
||||
`{asset_id, sha256}`, `verdict->>'fingerprint'`.
|
||||
- A16 No DEV operation, no SQL migration, no merge, no change outside the scope above beyond the
|
||||
documents that record it.
|
||||
|
||||
## Owner decisions taken during the step (2026-10-29, contract §17.4)
|
||||
|
||||
- D1 The editors' exports (Inkscape, Illustrator, Figma, Affinity) are supplied by the owner later,
|
||||
under `crates/core/tests/fixtures/svg/exports/owner/`; the exports of tools installed on the
|
||||
development machine (cairo, ImageMagick) are committed meanwhile. A6 is therefore partially met
|
||||
until the owner's files arrive; the report must say so.
|
||||
- D2 A document that does not read strictly fails as `verification.integrity.document` (§6.5); the
|
||||
19 rule errors are `verification.validation.rules`.
|
||||
- D3 `PreviewSheet` of a draft reports caps excess and missing drawings; a published or deprecated
|
||||
version refuses them (`caps`, `drawing_missing`); hash mismatch and an unreadable document refuse
|
||||
every mode.
|
||||
|
||||
## Where to look
|
||||
|
||||
- Core: `crates/core/src/domain/sheet/{size,keys,caps,review,report,verdict,preview,edit}.rs`,
|
||||
`crates/core/src/anatomy/svg/{clean,sanitize,mod}.rs`, `crates/core/src/{ops,facade}.rs`.
|
||||
- Wasm: `crates/wasm/src/lib.rs`; `packages/core-wasm/{src,types,tests/preview.test.ts}`.
|
||||
- Tests: `crates/core/tests/{sheet_size,sheet_review,sheet_verdict,sheet_preview,sheet_edit,svg_clean}.rs`,
|
||||
oracle `crates/core/tests/oracles/v1-2-2/`, fixtures `crates/core/tests/fixtures/svg/exports/`.
|
||||
- Records: `docs/development/RUST.md` §12, the contract's §6.7, §9.2, §10, §17.4.
|
||||
|
||||
## Commands
|
||||
|
||||
- `pnpm rust:check` (fmt, clippy, all core feature suites, ts-rs export, cargo deny).
|
||||
- `pnpm wasm:build` then `pnpm --filter @faunosteo/core-wasm test:run` (the size budget is 600 000 B).
|
||||
- `cargo test -p faunosteo-core --test sheet_verdict` (and the other five suites).
|
||||
|
||||
## Owner arbitrations at the checkpoint (2026-10-29, contract §17.4, last six rows)
|
||||
|
||||
Brief « V1-2.2 : arbitrages du propriétaire et finalisation » on `17d9199`. Diff under review for this round:
|
||||
`17d9199..HEAD`. The criteria above still hold; these are added.
|
||||
|
||||
- B1 A local reference (`href`, `xlink:href`, `url(#…)`) to an id the drawing does not define is refused
|
||||
(`dangling_reference`) by `read_svg` (stored drawings, verdict, preview, PDF snapshot gate) and by `clean_svg`, the
|
||||
latter only after active content is classified. Valid internal references keep working.
|
||||
- B2 `view.canvas` (on `LoadedSheet` and `PreviewSheet`) scopes every id and local reference of the drawing to its view
|
||||
(`fv.<view>.`); two canvases inlined in one page never resolve into each other; composition deterministic; stored
|
||||
bytes, sha256, fingerprints, archive snapshots and PDF views untouched. Tests: valid, absent, same ids in two views,
|
||||
cross-view attempt, many references to one id, repeated composition (`tests/svg_scope.rs`).
|
||||
- B3 Every accepted file (clean or cleanable) is uploaded in the stored form (`serialize::stored_form`); verdict
|
||||
(`verification.integrity.svg_not_canonical`), preview (`not_canonical`) and the upload tool refuse another form; the
|
||||
equine drawing's sha256 `0ea5202f…` and the fingerprint `12d78872…` unchanged.
|
||||
- B4 Strict numeric `rgb()` / `rgba()` kept; `url(` outside the document, `expression(`, scripts, active CSS and every
|
||||
other function still removed or refused; the cairo export keeps colours, shapes and references; fixpoint.
|
||||
- B5 `sheet.edit` `remove` refused atomically (`has_dependents`, document unchanged) while `dependents` holds anything
|
||||
but descendants; a removal never adds a referential issue (property test).
|
||||
- B6 (A6 scope superseded by E1) A6: real Inkscape 1.4.3 exports committed with their generator and provenance; Illustrator and Figma are not
|
||||
produced or imitated; A6 stays open until the owner's files arrive.
|
||||
- B7 Wasm: `--remove-name-section` only; the 600 000-byte cap and `size.test.ts` unchanged.
|
||||
- B8 Still: no SQL change, no protected reader modified (A13), the N-1 copies and frozen oracle files untouched (declared
|
||||
changes applied in tests only), no DEV operation, no merge.
|
||||
|
||||
### After the reviews of 5281337 (security BLOCK(1) HIGH, verifier ECARTS(2))
|
||||
|
||||
Delta under review: `5281337..HEAD`.
|
||||
|
||||
- B9 A `url(` is kept only in its strict spelling (`sanitize::local_url_target`); every other spelling a browser could
|
||||
normalise (`%XX`, tab, space or unbalanced quote inside, empty or non-ASCII id) is active content; `url(` or `rgb(`
|
||||
glued to a longer name (ASCII or not) is another function; a colour is not glued to what follows; the composer refuses,
|
||||
fail-closed, a canvas keeping a reference outside its scope (`unscoped_reference`). Tests written apart from the reader
|
||||
(`svg_clean::every_url_spelling_but_the_strict_one_is_refused`, `svg_scope::every_reference_a_browser_reads_stays_in_its_view`).
|
||||
- B10 The verifier's doc drift fixed (RUST.md §12.1, §12.4, §12.5, §12.6; exports README); the MEDIUM (scope unique per
|
||||
document only) recorded as a requirement for any page inlining two documents (contract §10, RUST.md §12.7).
|
||||
|
||||
## Owner decisions at finalisation (2026-10-30, contract §17.5)
|
||||
|
||||
Brief « V1-2.2 : finalisation et intégration A6 Figma » after the final review of `05de816` (verifier ECARTS(3),
|
||||
security PASS). Delta under review: `98060d7..HEAD`. The criteria above still hold; these are added, and C1 amends D1
|
||||
and B6.
|
||||
|
||||
- C1 (superseded by E1 for the A6 scope) A6 requires Inkscape (met, B6), Figma and Illustrator; Affinity is optional. Figma: the owner's two raw exports
|
||||
`owner/figma-web-20261030-default.svg` and `-ids.svg`, never edited, committed as permanent fixtures with fixed
|
||||
expectations. Illustrator: the real Adobe Illustrator only (VectorCraft is not equivalent). A6 stays open, and V1-2.2
|
||||
is not VERIFIED, until the Illustrator exports are committed and pass.
|
||||
- C2 `maskUnits`, `maskContentUnits`, `clipPathUnits` allowed with `userSpaceOnUse` / `objectBoundingBox` only, any
|
||||
other value removed (owner go after the proposal); the Figma stored forms render pixel-identical to the raw files.
|
||||
- C3 A `url(` glued to a longer name is removed from every attribute (`sanitize::urls_unglued`, built on
|
||||
`url_openings`, no second parser); the composer comment says when `unscoped_reference` can happen; tests: glued in
|
||||
ordinary attributes, valid, absent, encoded and escaped spellings, attributes with no reference, canvas, preview and
|
||||
PDF composition of the same drawings, the fail-closed branch reached.
|
||||
- C4 The audit sentence the floor guard read as a suppression is reworded; the guard is not disabled or waived.
|
||||
- C5 Still: no SQL change, no protected reader (A13), N-1 copies, frozen oracles or equine historical data modified;
|
||||
no DEV operation, no merge, no deployment, no V1-2.3.
|
||||
|
||||
## Final owner decisions (brief « V1-2.2 : arbitrage définitif A6 et correction visibility », 2026-10-30, on `81f7639`)
|
||||
|
||||
- E1 A6 scope, final: the tested perimeter is Figma (the owner's two raw exports
|
||||
`owner/figma-web-20261030-{default,ids}.svg`), Inkscape 1.4.3 (three real exports and their generator), cairo
|
||||
1.18.4 and ImageMagick 7.1.2-18 (real exports, `generate.sh`). Adobe Illustrator and Affinity are optional: never
|
||||
declared compatible or validated without a real export read by the suite; their absence does not block V1-2.2.
|
||||
The `owner/` folder, its procedure (Illustrator `presentation` / `internal-css`, Affinity `web` / `hq`) and the
|
||||
suite reading any file put there stay, for a later test.
|
||||
- E2 Root visibility: a root `visibility` other than `visible` is refused by the shared reader (`root_visibility`)
|
||||
before a drawing can be verified or published; the cleaning, the verdict, the preview, the canvas and the PDF
|
||||
snapshot gate answer it; both composers refuse such a root (fail-closed). No historical asset, oracle or golden
|
||||
changes.
|
||||
- E3 Still: no SQL change, no DEV operation, no historical resource modified, no merge, no deployment, no V1-2.3.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Contract: V1-2.2 reserved ids (PDF halo collision)
|
||||
|
||||
Owner brief « V1-2.2 : correction de sécurité PDF et poursuite A6 », 2026-10-30, on `2f1f076`
|
||||
(branch `feature/v1-2-anatomical-sheets`). Diff under review: the working tree against `2f1f076`.
|
||||
|
||||
## Problem
|
||||
|
||||
`crates/core/src/anatomy/compose.rs::compose_highlight` (PDF view) keeps the drawing's ids and
|
||||
writes its halo filter `osteo-halo` next to them. Before the fix it skipped writing its filter when
|
||||
the drawing already held a `filter#osteo-halo`, and a non-filter element holding the id before the
|
||||
first `<defs>` won `url(#osteo-halo)` resolution. A sheet drawing could thus replace, divert or hide
|
||||
the PDF markers.
|
||||
|
||||
## Criteria (each must hold on the diff)
|
||||
|
||||
- C1 The shared SVG reader (`anatomy/svg/mod.rs::read_svg`) refuses any kept element (root included)
|
||||
whose `id` is a reserved id, with a closed, stable reason `reserved_id`
|
||||
(`SvgRejection::ReservedId`).
|
||||
- C2 The decision is exact-name (reserved set, not a prefix): historical drawings holding
|
||||
`osteo-overlays` (the equine draft drawing, sha256 `0ea5202f…`, which is the DEV object) still read
|
||||
with no removal; no historical asset changes byte-wise.
|
||||
- C3 No bypass: letter case (ASCII), XML character references, whitespace, look-alike or invisible
|
||||
characters, `xml:id`, prefixed attributes or prefixed SVG elements, CSS escapes and percent-encoded
|
||||
`url(` targets either refuse the drawing or never leave a reserved id in the tree a composer
|
||||
receives.
|
||||
- C4 `clean_svg` (upload cleaning) refuses it (`reserved_id`) with no stored form, after active
|
||||
content is classified; the verdict, the preview, the loaded sheet, the upload tool and the PDF
|
||||
snapshot gate (`pdf/write/input.rs`, `snapshot_invalid` / `asset reserved_id`) answer it through
|
||||
the same reader.
|
||||
- C5 Composers are fail-closed: `compose_highlight` and `compose_canvas` refuse a tree holding a
|
||||
reserved id (`ComposeError::ReservedId`), and the highlight always writes the engine's own filter;
|
||||
no path remains where a drawing-supplied element named `osteo-halo` reaches the PDF view.
|
||||
- C6 No existing control weakened: every other reader rule, cap, reference check, scoping and the
|
||||
PDF/archive readers unchanged; frozen oracles, R4 digests, step6 goldens, N-1 copies untouched
|
||||
(declared divergences applied in tests only).
|
||||
- C7 Other internal collisions audited (ids the composition writes, canvas scope `fv.`, layer
|
||||
attributes, filter `result` names) and either covered or argued absent.
|
||||
- C8 Tests cover: a valid drawing; `filter id="osteo-halo"`; the id on other elements; references
|
||||
to it; adversarial spellings; the PDF keeping its own halo (behavioural, through the export
|
||||
session); equine non-regression and historical fingerprints; the shipped wasm module.
|
||||
- C9 Docs updated (RUST.md §12.9, V1-2 contract §9.2 table and closed codes, ANNOTATION-RENDERING);
|
||||
the R5 ledger target renamed with the test.
|
||||
- C10 A6: the owner README gives precise Illustrator steps for `…-presentation.svg` and
|
||||
`…-internal-css.svg` (names and variants unchanged), no fabricated Illustrator file, A6 not claimed.
|
||||
|
||||
## Out of scope
|
||||
|
||||
No SQL, no Supabase DEV, no worker, no merge, no V1-2.3.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Contract: V1-2.2 root visibility and final A6 perimeter
|
||||
|
||||
Owner brief « V1-2.2 : arbitrage définitif A6 et correction visibility », 2026-10-30, on `81f7639`
|
||||
(branch `feature/v1-2-anatomical-sheets`). Diff under review: the working tree against `81f7639`.
|
||||
|
||||
## Problem
|
||||
|
||||
Both composers (`crates/core/src/anatomy/compose.rs`) append the engine's marker layer as the drawing
|
||||
root's last child (PDF view: the drawing's own root; canvas: a root copying its attributes). A root
|
||||
`visibility="hidden"` was accepted with no removal; the layer inherited it while the drawing's
|
||||
children set `visible` back, so the markers vanished from the PDF and the canvas.
|
||||
|
||||
## Criteria
|
||||
|
||||
- R1 The shared reader (`read_svg`) refuses a root `visibility` other than `visible` with a closed,
|
||||
stable reason `root_visibility`, before a drawing can be verified or published; the cleaning
|
||||
(`clean_svg`), the verdict, the preview and its canvas, the loaded sheet, the upload tool and the PDF
|
||||
snapshot gate answer through the same check (no divergent rule).
|
||||
- R2 No bypass through the forms the reader accepts: letter case, CSS whitespace, character
|
||||
references, CSS-wide keywords, unreadable values; equivalent styles (root `style`, root `class`,
|
||||
`<style>`) never reach the root; a descendant's `visibility` cannot reach the layer.
|
||||
- R3 Targeted: legitimate attributes are not refused without a demonstrated danger; other root
|
||||
properties (`opacity`, `display`, `filter`, `mask`, `clip-path`, paint) are either already removed or
|
||||
argued to act on drawing and markers alike, with evidence.
|
||||
- R4 Both composers refuse such a root (fail-closed); the `osteo-halo` protections of `08efd9a` stay
|
||||
effective.
|
||||
- R5 Historical drawings, the equine fingerprint (sha256 `0ea5202f…`), frozen R3/R4 oracles, step6
|
||||
goldens and N-1 copies unchanged.
|
||||
- R6 Tests: reproduce the defect first, then the fix; normal drawing, hidden root, descendant
|
||||
`visible`, styles, other root attributes, cleaning and canonical form, verdict, PreviewSheet, composed
|
||||
canvas, real PDF export session, equine non-regression, adversarial inputs, targeted mutations,
|
||||
shipped wasm module.
|
||||
- R7 A6 final perimeter: Figma, Inkscape, cairo, ImageMagick (real exports, tested). Adobe Illustrator
|
||||
and Affinity are OPTIONAL: their absence is NOT a gap and must not be reported as one; they must not
|
||||
be declared compatible or validated anywhere without a real export; fixtures and the `owner/`
|
||||
procedure stay. Contract core (D1/B6/C1 superseded by E1), V1-2 contract §17.6, RUST.md, READMEs,
|
||||
TODO and the decisions registry (BDR-090, BDR-088 amended) say so consistently.
|
||||
- R8 BDR (reserved `osteo-halo`, not `osteo-*`) and LRN (heredoc expansion) recorded factually.
|
||||
- R9 Docs: RUST.md §12.10, V1-2 contract §9.2 and closed codes, ANNOTATION-RENDERING.
|
||||
|
||||
## Out of scope
|
||||
|
||||
No SQL, no Supabase DEV, no worker DEV, no historical resource change, no merge, no V1-2.3.
|
||||
|
||||
## Clarifications
|
||||
|
||||
- The reader-refusal assertions of `svg_reserved_ids.rs` moved, reason-parameterised and unchanged, into
|
||||
`tests/common/sheet_readers.rs::assert_refused_everywhere` (shared with `svg_root_visibility.rs`); the test count is
|
||||
unchanged (floor guard: assertion lines 18 → 10 in that file, by design).
|
||||
@@ -0,0 +1,60 @@
|
||||
# Contract: V1-2.2 three MEDIUM (marker isolation, click hijack, view frame)
|
||||
|
||||
Owner brief « V1-2.2 : arbitrages propriétaire sur les trois MEDIUM », 2026-10-30, on `958228a`
|
||||
(branch `feature/v1-2-anatomical-sheets`). Two lots:
|
||||
|
||||
- Lot A (committed): the frame rule, defect 3.
|
||||
- Lot B (working tree, NOT committed, awaiting the owner's authorisation because it changes the
|
||||
frozen R3 references): marker isolation and hitbox capture, defects 1 and 2, with the click proofs.
|
||||
|
||||
Diff under review: the working tree (lot A + lot B) against `958228a`.
|
||||
|
||||
## Problems
|
||||
|
||||
1. Both composers (`crates/core/src/anatomy/compose.rs`) appended the engine's marker layer to the
|
||||
drawing's own root: every presentation attribute the reader keeps on that root reached the markers,
|
||||
inherited (`stroke-opacity`, `stroke-dasharray`, `stroke-width`, `stroke-linejoin`, `fill-rule`,
|
||||
`color-interpolation-filters` on the halo…) or acting on a whole group (`opacity`, `display`).
|
||||
2. The point hitbox (`pointer-events="all"`, no stroke of its own) inherited a root `stroke-width`: a
|
||||
giant stroke widened every hitbox and the last one took the clicks meant for other markers.
|
||||
3. A view without `view_box` was framed by the drawing's `viewBox`: moving it and translating the
|
||||
drawing back left the horse identical and every marker out of frame, accepted.
|
||||
|
||||
## Criteria
|
||||
|
||||
- C1 Structural isolation, common to the canvas and the PDF view: no attribute of the drawing's root
|
||||
reaches the layer or the halo filter, inherited or group-wide; the drawing keeps its own attributes
|
||||
and renders as before; not a denylist of attributes.
|
||||
- C2 Interactive surfaces declare their geometry and capture rule: the point hitbox `stroke="none"` and
|
||||
a capture on its circle only; ergonomic sizes unchanged; zones and trigger keep their declared stroke.
|
||||
- C3 Real click tests in Chromium, Firefox and WebKit (installed engines), touch where testable: normal
|
||||
hock click, giant root stroke, hock after the fix, two close points, invisible and overlapping
|
||||
surfaces; red on `958228a`, green after. A missing engine is named, never passed silently.
|
||||
- C4 Frame rule in the Rust core, one definition for both composers, the verdict and PreviewSheet: the
|
||||
view's `view_box`, else the drawing's `viewBox` read as a browser reads it; `preserveAspectRatio`
|
||||
handled; annotations entirely in frame, edges included; curves, arcs, invalid coordinates, secondary
|
||||
views, views without `view_box`, legitimate transforms; explicit refusal with a closed code; the
|
||||
document never rewritten.
|
||||
- C5 The reported drawing (horse, offset `viewBox`, compensating translate) is refused with its 19
|
||||
main-view markers, the historical annotations unchanged.
|
||||
- C6 No frozen reference (R3 oracles, R3 canvas goldens, R4 digests, R4.1 real-raster manifest, step6
|
||||
goldens, N-1 copies, seed review drawings, equine drawing and fingerprint) rewritten or regenerated;
|
||||
where lot B changes what a reference compares, the change is identified, explained and left for the
|
||||
owner (no updated expectation committed).
|
||||
- C7 `osteo-halo` and `root_visibility` protections intact; the A6 perimeter unchanged.
|
||||
- C8 Gates: cargo on every feature set, clippy `-D warnings`, mutations, wasm module under 600 000 B
|
||||
gzip, check:all DEV-isolated (lot A), browser proofs.
|
||||
- C9 Docs describe only what is implemented (lot A in RUST.md §12.11, V1-2 contract §6.7,
|
||||
ANNOTATION-RENDERING); lot B documented in its patch and the evidence file, not as shipped.
|
||||
|
||||
## Out of scope
|
||||
|
||||
No SQL, no Supabase DEV, no worker DEV, no historical resource change, no merge, no V1-2.3.
|
||||
|
||||
## Clarifications
|
||||
|
||||
- The junction-point overlap (zones painted and hit after the vertebral junction points, part of their
|
||||
disc records the zone, on the historical sheet in every engine) is pre-existing and needs an owner
|
||||
decision on the capture order: reported, marked `fixme` in the click spec, not fixed.
|
||||
- `with_isolated_layer` (tests/common/svg_tree.rs, lot B) is the proposed declared change applied to
|
||||
the frozen R3 trees; it is not committed.
|
||||
@@ -0,0 +1,59 @@
|
||||
# Contract: V1-2.2 owner decisions of 2026-11-01
|
||||
|
||||
Owner brief « V1-2.2 : décisions et poursuite des corrections », 2026-11-01, on `f1bb19b`
|
||||
(branch `feature/v1-2-anatomical-sheets`). Owner answers during the run (2026-11-01): threshold
|
||||
4 CSS px on the editor at 320 × 568; « the visible wins » on the editor canvas only, the PDF view
|
||||
keeping the document order.
|
||||
|
||||
Diff under review: `f1bb19b..HEAD` (commits `4f52f5e` lot B, `e677150` R4.1 manifest, `9c606aa`
|
||||
junctions, `96b9978` visible size and frame range).
|
||||
|
||||
## Criteria
|
||||
|
||||
- D1 Lot B committed as the approved patch `.claude/audits/2026-10-30-v1-2-2-lot-b-isolation.patch`
|
||||
(no other change in `4f52f5e` but the allowlist census: `sanitize::ALLOWED_ATTRIBUTES` made public,
|
||||
`svg_marker_isolation::nothing_the_reader_keeps_changes_the_layer_or_the_halo`). Isolation holds for
|
||||
every attribute the reader keeps and for descendant `style` values, including CSS that acts outside
|
||||
its subtree in HTML; browser probe documented (RUST.md §12.12).
|
||||
- D2 References: R3 highlight oracle and R3 canvas goldens compared under declared transforms, frozen
|
||||
files unedited; the only edited reference is the R4.1 manifest call-1 `svgSha256`
|
||||
(`a9a3155c…` → `45fd4aaf…`); R4 PDF digests, step6 goldens, N-1 copies, seed review drawings,
|
||||
equine drawing and fingerprint unchanged. Each transform documented exactly (RUST.md §12.12 table).
|
||||
RUST.md §12.10 correction recorded. No general regeneration.
|
||||
- D3 Junctions: the canvas (`compose_canvas`, `render_canvas_layer`) paints every point hitbox, then
|
||||
every zone and trigger, then every visible twin capturing on `visiblePainted`, document order inside
|
||||
each pass; the PDF view (`render_composed_layer`) and the R3 layer (`render_layer`) unchanged.
|
||||
ANNOTATION-RENDERING updated. Click spec: `c7-t1`, `l6-s1`, `t18-l1`, fore fetlock, close fetlocks,
|
||||
disc coverage (main and head), zone coverage, touch projects (Chromium 320 and 375, WebKit 375); no
|
||||
`fixme`; red on `e677150` for the junction and disc tests. Drawings and documents not edited.
|
||||
- D4 Visible size: every annotation in frame shows at least `MIN_VISIBLE_PX` 4 CSS px on the preview
|
||||
boxes measured at 320 × 568 (main 286 × 310, detail 254 × 191, `xMidYMid meet`); a point measured on
|
||||
its visible disc (`layer::twin_radius`, the formula the layer draws with), never its hitbox; shapes
|
||||
on their smaller side with curves and arcs on their shape. Issue `annotation.geometry.too_small`,
|
||||
verdict `verification.validation.marker_too_small`; verdict and preview agree; the document never
|
||||
rewritten. The bypass (horse `viewBox` × 100 with content scaled back) refused with its 19
|
||||
main-view markers; × 1 000 refused as no usable frame.
|
||||
- D5 Frame range: one definition (`Frame::from_numbers`) for the composers, the verdict and the
|
||||
preview: finite, edges within 2²⁰, spans from 1 unit, aspect at most 100, farthest edge at most 256
|
||||
smaller spans; each bound tested at its limit and past it; justification measured in the three
|
||||
engines (RUST.md §12.13 tables); the equine accepted.
|
||||
- D6 Gates: cargo on every feature set, clippy `-D warnings`, mutations (2026-10-30 and 2026-11-01
|
||||
scripts) with every survivor justified, wasm module under 600 000 B gzip, `check:all` on the final
|
||||
HEAD (Docker stages included), e2e:ui (canvas clicks on the six projects), e2e:shell when the
|
||||
isolated stack runs.
|
||||
- D7 Docs describe only what is implemented: RUST.md §12.12 and §12.13, V1-2 contract §6.7 table,
|
||||
ANNOTATION-RENDERING, BROWSER_TESTS.
|
||||
|
||||
## Out of scope
|
||||
|
||||
No SQL, no Supabase DEV, no worker change, no merge, no V1-2.3, no deploy.
|
||||
|
||||
## Clarifications
|
||||
|
||||
- Declared limit: a thin shape on a diagonal is measured on its bounds (scale floor, not a shape
|
||||
review).
|
||||
- `crates/core/tests/svg_marker_isolation.rs` `layer_and_defs` uses `Iterator::skip(1)` (skips the drawing's
|
||||
group before serialising the layer and the halo): not a skipped test.
|
||||
- Mutant F5 (zero width accepted) is equivalent: the aspect rule refuses a zero or negative span.
|
||||
- New closed codes chosen by the implementer, to confirm with the owner: `marker_too_small`,
|
||||
`annotation.geometry.too_small`.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Contract: V1-2.2 last MEDIUM, zone without interior
|
||||
|
||||
Owner brief « V1-2.2 : fermeture du dernier MEDIUM », 2026-11-01, on `de2dfb3` (branch
|
||||
`feature/v1-2-anatomical-sheets`). Decisions of the previous checkpoint confirmed, not reopened.
|
||||
|
||||
## Criteria
|
||||
|
||||
- I1 Rule: a zone or trigger drawn as a polygon or a path is refused unless its fill, under the
|
||||
fill rule the layer paints (nonzero: the layer writes none, the root carries none, lot B
|
||||
isolation), holds a disc of diameter at least `MIN_VISIBLE_PX` (4 CSS px) on the smallest preview
|
||||
(main 286 × 310, detail 254 × 191, `xMidYMid meet`). The stroke never counts. The bounds rule stays
|
||||
and runs first. Circles keep their disc measure.
|
||||
- I2 Measure in the Rust core, conservative: curves and arcs flattened with a proven chord deviation
|
||||
bound subtracted from the radius; a point counts only when inside under the rule and at least the
|
||||
radius away from every edge (implicit closing edges included); deterministic search, capped; over
|
||||
the caps the annotation is refused (fail closed), never accepted.
|
||||
- I3 Closed codes, the approved ones unchanged: issue `annotation.geometry.interior_too_small`,
|
||||
verdict `verification.validation.marker_interior_too_small` (implementer's proposal; approved by the owner 2026-11-01, brief « Validation définitive V1-2.2 »).
|
||||
Verdict and preview agree. The document and the drawings never rewritten.
|
||||
- I4 Tests: back-and-forth path, near-flat polygon, self-intersection under both rules, curves and
|
||||
arcs of near-zero area, small legitimate filled shapes, drawing transforms and extreme scales,
|
||||
threshold edges, equine non-regression, every case previously accepted wrongly now refused.
|
||||
- I5 Browser concordance (Chromium, Firefox, WebKit, 320 × 568): for each accepted probe shape real
|
||||
presses inside the Rust witness disc select it; for each refused one the browser's fill-only hit
|
||||
area holds no disc of the threshold; the probe fixture generated by the core and checked for drift.
|
||||
- I6 WASM ≤ 600 000 B gzip (budget not raised); PDF bytes and historical references unchanged;
|
||||
existing click tests kept.
|
||||
- I7 Gates: check:all on the final HEAD, e2e:shell on the isolated sandbox, mutations, the three
|
||||
ignored cargo tests documented.
|
||||
- I8 Docs: ANNOTATION-RENDERING, RUST.md §12.13, V1-2 contract §6.7; LOW overlap recorded as a known
|
||||
limitation (human review identifies fully overlapping markers before publication).
|
||||
|
||||
## Out of scope
|
||||
|
||||
No selection redesign, no SQL, no DEV, no merge, no V1-2.3, no deploy.
|
||||
@@ -0,0 +1,38 @@
|
||||
# Contract: V1-2.3 closure adjustments (brief « Validation V1-2.3 (M6) et derniers ajustements »)
|
||||
|
||||
Owner brief 2026-11-01 on `26e4b1b`: V1-2.3 VERIFIED technically, three closure adjustments before
|
||||
V1-2.4. Branch `feature/v1-2-anatomical-sheets`. Sandbox only; DEV (containers
|
||||
`supabase_*_faunosteo`, its queues, purges, secrets, accounts) untouched; no merge; no worker on
|
||||
DEV; no production, no release; then prepare V1-2.4 along the existing plan (scope only) and STOP.
|
||||
|
||||
## Criteria
|
||||
|
||||
- C1 Retry by effective cause. Definitive at the first occurrence (round `verification_failed`,
|
||||
outcome `unavailable`, its code, never claimed again): `verification.worker.resource_limit` when
|
||||
the cause is intrinsic to the frozen input or the contract caps (frame refused, input over the
|
||||
child cap, output over its cap, CPU budget SIGXCPU, memory budget SIGABRT, seccomp SIGSYS) and
|
||||
`verification.worker.verdict_refused`. Transient, retried after 2, 5, 10, 20 s up to five
|
||||
attempts: `timeout` (wall clock), `unavailable` (transport, Storage, broken child, and a child
|
||||
killed from outside: SIGKILL or any signal not listed above), `lease_expired` (immediate, the
|
||||
lease being the wait). Business and integrity verdicts stay definitive. Kept: five attempts, lease
|
||||
10 min, `not_before`, no blocking wait, idempotence, stale protections, dead-lease recovery; RPC
|
||||
names, arguments and answers unchanged; user-facing outcome and codes unchanged. SQL holds the
|
||||
code policy, the worker maps cause to code. pgTAP and worker tests for each class; sandbox case
|
||||
for a definitive closure at attempt 1 with the real worker; docs (§6.4, §6.5, STORAGE.md §3.6,
|
||||
RUST.md §13) state the final policy and its effect on the codes.
|
||||
- C2 `pnpm db:sandbox avatar-e2e` (approved, port 57800): published on 127.0.0.1 only; an occupied
|
||||
port fails explicitly before anything starts; the suite refuses (fails, never silently passes)
|
||||
any target other than the sandbox gateway and database container; guards of Q1 kept.
|
||||
- C3 `pnpm e2e:avatar` becomes an alias of `pnpm db:sandbox avatar-e2e`; `scripts/avatar-e2e.sh`
|
||||
(DEV) removed; avatar tests kept; no missing variable, wrong argument or inherited setting can
|
||||
reach DEV; every reference in scripts, workspace and live docs updated (history kept as history).
|
||||
- C4 The sandbox no longer depends on the DEV seed password: the seeded accounts of the sandbox get
|
||||
a per-session random secret (600 file outside Git, never on argv or in logs) after seeding; the
|
||||
sandbox tests use it; `supabase/seed.sql` and every DEV account and secret untouched.
|
||||
- C5 The two tracked misclassifications keep their characterising tests, open, not declared fixed.
|
||||
The four historical test reductions found by the floor guard are recorded with scope and
|
||||
justification; any one hiding a missing security coverage is reported before V1-2.4.
|
||||
- C6 Gates: `verify-e2e`, `avatar-e2e`, `e2e:shell`, sandbox `test-db` / `types --check` / `test`,
|
||||
`pnpm check:all`, worker sandbox tests (seccomp, budgets) on the final code; independent review
|
||||
targeted on the retry policy and command isolation; fresh verifier.
|
||||
- C7 V1-2.4 prepared, not started: exact scope from the V1-2 contract plan, for the owner.
|
||||
@@ -0,0 +1,57 @@
|
||||
# Contract: V1-2.3 owner reserves (brief « Décisions V1-2.3 / M6 et clôture des dernières réserves »)
|
||||
|
||||
Owner brief 2026-11-01 on `96b19e5`: M6 parameters approved (five worker codes, 5 attempts, lease
|
||||
10 min, verdict 3 MiB child / 4 MiB SQL, `worker-verify`, `verify-e2e`); `brk` approved in the
|
||||
shared seccomp filter; verdict CHANGES REQUIRED until the proofs below exist. Branch
|
||||
`feature/v1-2-anatomical-sheets`. Sandbox stack only; DEV (containers `supabase_*_faunosteo`, its
|
||||
queues, purges, secrets and accounts) untouched; no merge; no V1-2.4; no deploy; STOP at the
|
||||
checkpoint. The base contract `2026-11-01-v1-2-3-worker-verification.md` (W1-W8) still holds,
|
||||
W6 `pnpm e2e:avatar unchanged` replaced by Q1.
|
||||
|
||||
## Criteria
|
||||
|
||||
- Q1 Avatar e2e isolated: `pnpm db:sandbox avatar-e2e` runs the existing avatar suite
|
||||
(`packages/supabase/tests/e2e/avatar-flow.e2e.ts`, every case kept) against the sandbox, with the
|
||||
real worker image in its default mode (avatars + sweep) on the sandbox network only, after M6.
|
||||
No DEV container, network, key or queue is reachable from the run: the suite needs its database
|
||||
container named explicitly (no DEV default), its purge acceleration touches only the run's own
|
||||
account, its accounts are throwaway with random passwords. `scripts/avatar-e2e.sh` (DEV) is not
|
||||
run. DEV container start times unchanged after every run.
|
||||
- Q2 Retry delay (owner decision §4): a technical failure reported by `fail_sheet_verification`
|
||||
makes the round claimable again only after 2 s, 5 s, 10 s, 20 s (after attempts 1, 2, 3, 4);
|
||||
attempt 1 immediate; the fifth failure closes the round `verification_failed` / `unavailable`
|
||||
as before. Persisted in SQL (a hidden column on the round, not granted to `authenticated`), so
|
||||
no worker sleeps and any worker honours it; RPC names, arguments and answers unchanged. Verdict
|
||||
failures (validation, integrity) are never retried (complete). Unchanged: attempt counter,
|
||||
lease, dead-lease interruption path (immediate, the lease being the wait), stale and malformed
|
||||
protections (a stale fail writes nothing, delay included). pgTAP: each delay, no claim before it,
|
||||
claim after it, stale fail, final attempt. Sandbox e2e: a technical failure retried by the real
|
||||
worker no earlier than its delay, the worker serving another round meanwhile.
|
||||
- Q3 Input limits: at the maximum the policy allows (document 2 097 152 bytes of `content::text`,
|
||||
base 2 097 152, four drawings totalling 6 291 456 bytes, each at most 2 097 152) the child under
|
||||
the full sandbox and the real worker on the sandbox both produce a verdict accepted by SQL,
|
||||
within the 120 s budget, measured; just beyond: document and drawing at +1 byte refused before
|
||||
the worker (save, registration, bucket), drawings over the total or the count → verdict failed
|
||||
`verification.validation.caps` (business, not a worker failure), input over 12 MiB refused by
|
||||
the child. The two tracked misclassifications (`resource_limit` for a header over 64 KiB,
|
||||
`drawing_missing` for an object over the policy) asserted as current behaviour, labelled
|
||||
tracked, never presented as fixed.
|
||||
- Q4 `brk` bounded: the verify child under the real filter and limits is still killed or aborted
|
||||
by RLIMIT_AS (large and small-chunk growth), the `mmap` exec and signal argument filters, and a
|
||||
denied syscall; no other syscall added.
|
||||
- Q5 Sandbox account password: no password literal for throwaway sandbox accounts in the sandbox
|
||||
script and its test helpers; generated per run, never written to Git, a log or a command line.
|
||||
The DEV seed accounts (`supabase/seed.sql`) and DEV secrets untouched.
|
||||
- Q6 Memory: LRN with the owner's wording (scoped to the M6 worker musl image, not generalised).
|
||||
- Q7 Docs describe only what is implemented (V1-2 contract §6.4, §6.5, §12.3, §16.4; STORAGE.md
|
||||
§3.6; RUST.md §13; SUPABASE.md sandbox table; CLAUDE.md lines); the four residual risks tracked
|
||||
in TODO, open.
|
||||
- Q8 Gates on the final HEAD: PGlite, sandbox `test-db` and `types --check`, `test`, `verify-e2e`,
|
||||
`avatar-e2e`, upgrade rehearsals (before M6, before M4), `pnpm worker:test`, `pnpm worker:image`,
|
||||
`pnpm check:all`, `pnpm e2e:shell`; 42 hostile SVG kept in the child proofs; fresh security
|
||||
review and fresh verifier.
|
||||
|
||||
## Out of scope
|
||||
|
||||
DEV and production (every §16.11 operation, including the queue inventory, which stays owed),
|
||||
screens, V1-2.4 onwards, merge, deploy; fixing the two tracked misclassifications.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Contract: V1-2.3 worker verification (M6)
|
||||
|
||||
Owner brief « Validation définitive V1-2.2 », 2026-11-01 (V1-2.2 VERIFIED at `c73415a`, BDR-092):
|
||||
start V1-2.3 along the validated plan, V1-2 contract §16.4 (objective, prerequisites, tests,
|
||||
acceptance), §6.4 (server verdict), §6.5 (failures), §12.3 (M6). Branch
|
||||
`feature/v1-2-anatomical-sheets`. Sandbox stack only; DEV and production untouched; no merge;
|
||||
no V1-2.4; STOP at the owner checkpoint (server workflow V1-2.1 to V1-2.3).
|
||||
|
||||
## Criteria
|
||||
|
||||
- W1 M6 `sheet_verification_jobs`, forward-only, service role only (revoked from `public`,
|
||||
`anon`, `authenticated`), `security definer`, `search_path = ''`:
|
||||
`claim_sheet_verifications(limit)` (clamped, `for update skip locked`, rounds `verifying` with no
|
||||
live lease, token + `locked_at` set, `attempts` incremented, an expired lease counted, the attempt
|
||||
limit closing the round `verification_failed` / `unavailable`);
|
||||
`get_sheet_verification_input(review_id, lease_token)` (the frozen document and the base as text,
|
||||
the referenced drawing rows registered for the sheet: asset id, sha256, byte size, bucket, object
|
||||
key; nothing for a stale token or status);
|
||||
`complete_sheet_verification(review_id, lease_token, verdict)` (accepted only while `verifying`
|
||||
with the live token; binding = the round's sheet, version, revision, review; a passed verdict's
|
||||
group keys = `general`, the document's view and zone ids and the base's removed ones, its drawings
|
||||
= the document's asset ids with the rows' sha256; a failed verdict accepted without groups or
|
||||
drawings, its code from the closed list; else `stale` or `malformed`, nothing written; moves to
|
||||
`open` or `verification_failed` / `failed`; audited);
|
||||
`fail_sheet_verification(review_id, lease_token, code)` (closed worker codes; claimable again
|
||||
below the limit, `verification_failed` / `unavailable` at it; audited).
|
||||
pgTAP allowed and denied cases; `database.types.ts` regenerated; publication still refused
|
||||
without an approved round whose passed verdict is current.
|
||||
- W2 Child `verify`: the same binary, empty environment, rlimits and seccomp installed before
|
||||
reading stdin; reads one framed input (binding, rows, document, base, drawing bytes) under the
|
||||
per-command input cap; runs `faunosteo_core` `compute_verdict`; writes the verdict JSON under the
|
||||
output cap. The parent never parses the document or the drawings. Seccomp allowlist derived again
|
||||
for this path (Docker `test` stage).
|
||||
- W3 Spawner per command: input cap, output cap, deadline and memory per command (`decode`
|
||||
unchanged); `verify` sized on the at-caps fixture (about 13 MiB input).
|
||||
- W4 Mode `run --jobs sheet-verify`: claim, input, Storage downloads (missing object = drawing
|
||||
missing for the core, never a worker failure), child, completion; transient, timeout, resource and
|
||||
crash outcomes reported by `fail_sheet_verification` with a closed code; a broken sandbox stops
|
||||
the worker. Avatar and purge processing unchanged in the default mode; the verification mode runs
|
||||
no sweep. RPC body cap of this mode raised to the verdict size.
|
||||
- W5 Compose service of its own under the `worker` profile (read-only, `cap_drop: ALL`, same
|
||||
hardening as `worker`); sandbox start of the verification worker; never started on DEV.
|
||||
- W6 Tests: `pnpm worker:test` (sandbox, seccomp derivation), unit and fake-backend job tests for
|
||||
each §6.5 row, hostile corpus through the child, e2e on the sandbox stack (clean sheet passes,
|
||||
each failure and its exit, stale or malformed completion writes nothing, avatars and purges
|
||||
unaffected, publication refused without a current passed verdict, the sandbox working copy
|
||||
verified in place with its shared drawing, verification time at the caps within budget), upgrade
|
||||
rehearsal from the DEV state (Git fixture of the DEV drawing, §12.3), `pnpm e2e:avatar` unchanged.
|
||||
- W7 Docs describe only what is implemented: V1-2 contract §6.4, §6.5, §12.3, §16.4; STORAGE.md
|
||||
worker section; RUST.md; SUPABASE.md; DEPLOY.md / compose notes; CLAUDE.md.
|
||||
- W8 Gates: `pnpm rust:check`, `pnpm worker:test`, `pnpm worker:image`, sandbox `test-db` and
|
||||
`types --check`, `pnpm check:all` on the final HEAD, `pnpm e2e:shell` on the sandbox; fresh
|
||||
verifier and security reviews on the final HEAD.
|
||||
|
||||
## Proposals for the owner (checkpoint)
|
||||
|
||||
Closed worker failure codes, attempt limit (five), lease duration, the service name: chosen by the
|
||||
implementer, listed at the checkpoint for confirmation.
|
||||
|
||||
## Out of scope
|
||||
|
||||
DEV and production (every §16.11 operation), screens, V1-2.4 onwards, merge, deploy.
|
||||
@@ -0,0 +1,52 @@
|
||||
# Scope (prepared, not started): V1-2.4 wireframes
|
||||
|
||||
Prepared on the owner's authorisation of 2026-11-01 (brief « Validation V1-2.3 (M6) et derniers
|
||||
ajustements » §7: prepare V1-2.4 along the existing plan, no general study, present its exact
|
||||
scope). Source: V1-2 contract §16.5, §11.3, §11.1, §11.2, §3, §6.3 to §6.8, §8.2, §8.4. Nothing
|
||||
below is started; the owner validates this scope first.
|
||||
|
||||
## What V1-2.4 delivers (§16.5)
|
||||
|
||||
Wireframes of the three interaction patterns that have no precedent (§11.3); everything else
|
||||
(catalogue, admin lists, forms, species, rights) follows the V1-1 precedent without a mockup.
|
||||
|
||||
1. Editor canvas, `/app/admin/sheets/:sheetId/draft`, at 1 024 px and wider: the tab bar (Général,
|
||||
Vues et illustrations, Annotations, Constats, Références, Vertèbres, Vérification); the
|
||||
Annotations tab with the canvas (choose a view, draw point, zone, detail view link, select,
|
||||
properties panel, link to finding zones); the Vérification tab (issues, Prévisualiser, Soumettre
|
||||
à la revue with a note); the frozen state while a round is open; the narrower-than-1 024 px
|
||||
read-only notice (§8.4).
|
||||
2. Review screen, `/app/admin/sheets/:sheetId/reviews/:round`, desktop and 375 px: verification
|
||||
state (« vérification en attente depuis N min », attempts, last code, §6.5), the failure
|
||||
outcomes `failed` / `unavailable` with their codes and exits, preview, verdict, the review
|
||||
groups with their changes and acknowledgments (« groupe lu »), authors, comments, request
|
||||
changes, approve with a note, then the publication confirmation (version, revision, approver,
|
||||
acknowledgments, fingerprint, §11.2 A6).
|
||||
3. Admin entry in the sidebar and the mobile drawer, reaching `/app/admin/sheets`,
|
||||
`/app/admin/species` (O9), `/app/admin/access`, shown only to holders of a capability.
|
||||
|
||||
Plus, for confirmation on these screens (§3 note): the labels of the round states, of O17 (working
|
||||
copy badge), O21 (catalogue access), O23 (verification outcomes) and the FR/EN message of each
|
||||
closed code (15 verdict codes, 5 worker codes, §6.5).
|
||||
|
||||
## Inputs and constraints
|
||||
|
||||
- The validated Step 7 mockup (`docs/design/faunosteo-etape7-maquettes-validees.png`) and the shell
|
||||
as built (sidebar, drawer, cards, badges, buttons, ModalDialog): no new direction, no design
|
||||
system change (`docs/design/README.md`).
|
||||
- Interaction rules already decided: level 1 only (no drawing edit, no raster, no curves, one draft
|
||||
per sheet, §8.2, §8.4), the selection rules and marker floors of V1-2.2, fail-closed states.
|
||||
- No application, SQL or worker change; no DEV; tests: none, a design review (toolchain of
|
||||
`~/.claude/rules/web-building.md` § Design work, review tier) instead.
|
||||
|
||||
## Deliverable and acceptance
|
||||
|
||||
Static wireframes (HTML rendered to PNG) and a labels table FR/EN; after the owner's validation,
|
||||
one file in `docs/design/` with its README line (§16.5 acceptance). Checkpoint: owner validation of
|
||||
these screens, before V1-2.6 and V1-2.7.
|
||||
|
||||
## Questions for the owner before starting
|
||||
|
||||
- Fidelity: grey low-fidelity layout, or mid-fidelity on the shell's existing tokens.
|
||||
- Admin entry: one sidebar entry « Administration » opening the three lists, or entries per list.
|
||||
- Whether the catalogue reader (P1, `/app/anatomy`) joins the file, though §11.3 needs no mockup.
|
||||
@@ -0,0 +1,133 @@
|
||||
# Contract: V1-2.4 maquettes (owner briefs of 2026-11-02)
|
||||
|
||||
Briefs « Clôture V1-2.3 et lancement V1-2.4 » §4-§6 and « Incident DEV … reprise V1-2.4 » §6. Scope file
|
||||
`.claude/tasks/contracts/2026-11-01-v1-2-4-wireframes-scope.md`; plan V1-2 contract §16.5, §11.1-§11.3,
|
||||
§3, §6.3-§6.8, §8.2, §8.4. Deliverable: mockups only, no React, SQL, rule or contract change. Proposals
|
||||
until the owner validates them. STOP at the graphic checkpoint.
|
||||
|
||||
## Criteria
|
||||
|
||||
- M1 Identity: existing logo, validated palette (`apps/app/src/styles/tokens.css`), Step 7 principles,
|
||||
components and spacing (`docs/design/faunosteo-etape7-maquettes-validees.png`, shell as built); no new
|
||||
design system; functional-mockup level, not a redesign; logo and validated design unchanged.
|
||||
- M2 Catalogue `/app/anatomy` in its own section: consultation, search and selection along planned
|
||||
features, links to editor or review only when authorised, consultation vs modification distinct; no
|
||||
community feature, no permission change.
|
||||
- M3 Editor desktop from 1 024 px: tabs of the plan, canvas, points and zones, detail-view access,
|
||||
Vérification tab, errors, warnings and results needing review.
|
||||
- M4 Narrow screens: read-only mode shown clearly with the reason editing is not available.
|
||||
- M5 Review desktop and mobile: verification state, attempts, last relevant technical code, failed and
|
||||
unavailable, groups and acknowledgments, comments, decision, confirmation before publication; actions
|
||||
match existing capabilities; no mockup suggests a publication without a valid, current verdict.
|
||||
- M6 One « Administration » entry, desktop sidebar and mobile drawer, shown only to entitled roles, with
|
||||
access control stated as independent of visibility.
|
||||
- M7 FR/EN labels with O21, O23 and the 20 closed codes; internal identifier distinct from the user
|
||||
message; undecided labels submitted for arbitration, not validated implicitly.
|
||||
- M8 Delivered in `docs/design/` following its conventions (README line), marked as an unvalidated
|
||||
proposal; the eight presentation items of the brief covered.
|
||||
|
||||
## The brief's eight presentation items (owner brief 2026-11-02 §6) and their boards
|
||||
|
||||
1. Catalogue in read-only: boards 01, 02, 03.
|
||||
2. Desktop editor: board 04.
|
||||
3. Read-only on a narrow screen: board 05.
|
||||
4. Vérification tab and its main states: board 06.
|
||||
5. Review screen desktop and mobile: boards 07, 08, 09.
|
||||
6. Administration navigation desktop and mobile: boards 10, 11.
|
||||
7. FR/EN labels to arbitrate: board 12.
|
||||
8. Open UX decisions: listed in the checkpoint to the owner (not a board).
|
||||
|
||||
## Item 8: open UX decisions submitted to the owner (checkpoint of 2026-11-02)
|
||||
|
||||
1. Every label marked « à arbitrer » or « à confirmer » on board 12, including « Retirée » vs « Soumission retirée ».
|
||||
2. « Administration » also shown to the owner role (board 10), placed between « Fiches anatomiques » and « Mon compte ».
|
||||
3. Account without catalogue access (O21): hide « Fiches anatomiques », or show the page with an explanation.
|
||||
4. Catalogue search by zone name as well as sheet name (board 01), beyond §11.1's « by species ».
|
||||
5. « Soumettre à la revue » disabled by the in-page check (board 06 A), though the server verdict would refuse anyway.
|
||||
6. Heading of the unavailable outcome: ratified « Vérification échouée » with an « indisponible » tag, or a distinct heading.
|
||||
7. « Copie de travail » badge kept on later drafts of the working copy (board 04).
|
||||
8. Reviewer-only accounts keep the full shell (boards 07, 09).
|
||||
9. Canvas: selection drawn as a dark dashed outline with its vertices; the boards use the review drawing (every annotation highlighted), not the practitioner rendering.
|
||||
10. Delivery as a folder of twelve PNGs plus source rather than one file (§16.5 « one file »).
|
||||
11. For implementation, outside this slice: green badge and amber notice tones, thirteen new icons.
|
||||
|
||||
Owner, 2026-11-02 (BDR-094, V1-2 contract §17.8): items 2 to 11 ratified. Item 3: entry hidden without the
|
||||
catalogue right, « Accès non autorisé » on a direct URL, signed out → login. Item 8 read with the brief's
|
||||
point 4: a reviewer-only account keeps « Administration » with only the entries its capability allows. Item 1
|
||||
(labels, now 31 with « Mark as reviewed ») and the visual validation of the twelve boards stay open.
|
||||
|
||||
Owner, 2026-11-02 (brief « V1-2.4 : dernières corrections graphiques », after an external review of the
|
||||
twelve boards): item 4 withdrawn (catalogue search by sheet name only); item 6 settled (distinct headings).
|
||||
|
||||
## Final graphic corrections (brief « V1-2.4 : dernières corrections graphiques », 2026-11-02, on fdf0f7f)
|
||||
|
||||
Direction accepted, no redesign. Only the boards concerned and their sources change; no application code,
|
||||
no DEV, no Docker, no merge, no V1-2.5; no definitive graphic approval recorded. STOP at the final graphic
|
||||
checkpoint.
|
||||
|
||||
- F1 Board 01: no search by zone; the field reads « Rechercher une fiche »; REVUE.md follows.
|
||||
- F2 Board 06: outcome `failed` titled « Vérification échouée » / « Verification failed », outcome
|
||||
`unavailable` « Vérification indisponible » / « Verification unavailable »; each state keeps its own
|
||||
explanation and exits.
|
||||
- F3 Board 03: at opening on mobile the whole horse is visible (initial framing fitted to the screen), zoom
|
||||
afterwards; the anatomical SVG is not modified.
|
||||
- F4 Board 05: no device imposed; the notice names the 1 024 px minimum width instead.
|
||||
- F5 Board 04: vertex wording clarified, level 1 behaviour of §8.2 and §8.3 unchanged (an annotation moves
|
||||
as a whole, vertices are edited in the list, no vertex drag, no resize on the drawing).
|
||||
- F6 A complementary board « Accès non autorisé » / « Access denied » (BDR-094, contract §5.3): current
|
||||
design, nothing reveals whether a sheet exists, a link back to `/app`; kept outside the twelve boards.
|
||||
- F7 Labels: ratified labels unchanged; the external review's L1-L32 wordings recorded as proposals only,
|
||||
none as a decision; error codes and business rules unchanged; board 12 touched only where F2, F4, F6
|
||||
require it.
|
||||
- F8 Delivery: only the boards concerned regenerated (02, 07 to 11 byte-identical to fdf0f7f); contact
|
||||
sheet, REVUE.md, SHA-256 (REVUE.md table and the archive's SHA256SUMS) refreshed; a new archive with the
|
||||
twelve boards, the complementary page, the HTML source and the report; M1 to M8 still hold on the batch.
|
||||
|
||||
## Owner arbitrations (brief « arbitrages propriétaire et préparation de validation finale », 2026-11-02, on c2a3147)
|
||||
|
||||
The six corrections F1-F6 confirmed. Documentation only: no application code, no DEV, no Docker, no merge, no
|
||||
deployment, no V1-2.5; no global graphic approval invented. Commit and push only after a conforming check.
|
||||
|
||||
- A1 BDR-095 recorded (sheet-name search replacing the zone search of BDR-094's item list; distinct
|
||||
`failed` / `unavailable` titles; no SQL model or business-rule change); contradicting references updated in
|
||||
the contract documents.
|
||||
- A2 Board 05 at 768 px: the whole horse at initial framing, as on board 03; « Lecture seule », narrow-screen
|
||||
consultation, planned zoom and pan, the historical SVG and the 1 024 px editing threshold kept; the board not
|
||||
redone, editing rules unchanged.
|
||||
- A3 `verification_failed` kept as the technical status; for V1-2.7 lists, content failure vs technical
|
||||
unavailability shown only when existing data establish the cause, else an exact generic label; recorded for
|
||||
V1-2.7, no migration, no implementation.
|
||||
- A4 The wordings common to both reviews ratified only once checked identical, compatible with the contract and
|
||||
true to the code; L30 is a note, not a label. Owner arbitrations applied: L2 « À lire » / « To read »; L3
|
||||
« Marquer le groupe comme lu » / « Mark group as read »; L14 « Accès et habilitations » / « Access and
|
||||
permissions »; L15 « L'édition nécessite une largeur d'écran d'au moins 1 024 px. » / « Editing requires a
|
||||
screen at least 1,024 px wide. », the warning not repeated; L20 « Corriger le brouillon » (content failure),
|
||||
« Modifier le brouillon » (size limit); L32 « Retour au tableau de bord » / « Back to dashboard » to `/app`;
|
||||
`size_mismatch` names the file size; both marker codes say « sur mobile »; `object_conflict`: the owner's
|
||||
wording checked against the code's meaning before any ratification. Technical codes and already ratified
|
||||
messages unchanged.
|
||||
- A5 Only the affected images and the contact sheet regenerated; REVUE.md, decisions, contract references and
|
||||
SHA256SUMS updated; a complete archive rebuilt (12 boards, complementary board, HTML sources and the resources
|
||||
they need, labels table and decisions, verified sums); an independent check on the final deliverables,
|
||||
archive included.
|
||||
|
||||
Scope note: the §13.1 risk register added to the V1-2 contract in f00d8b4 belongs to the V1-2.3 closure the owner ordered (BDR-093), not to the maquettes; it records accepted risks and changes no rule.
|
||||
|
||||
|
||||
## Owner approval (brief « Validation propriétaire V1-2.4 », 2026-11-02, on 74aa8f6)
|
||||
|
||||
**V1-2.4 GRAPHICAL APPROVED** (BDR-096, V1-2 contract §17.9): the twelve boards and the complementary page
|
||||
« Accès non autorisé », as examined in the archive `faunosteo-v1-2-4-maquettes-arbitrages-3.zip`. Recorded in
|
||||
the contract, the BDR registry, the TODO and the journal; no board, source or rule changed.
|
||||
|
||||
- Last arbitrations: `object_conflict` FR « Le contenu du fichier de l'illustration ne correspond pas à son
|
||||
empreinte SHA-256 enregistrée. »; L14 « Access and permissions » in the interface, `capability` a technical
|
||||
term; L20 « Fix the draft » / « Edit the draft »; L32 « Access denied », explanation and link already decided.
|
||||
- The other technical messages are checked at their integration and do not block the graphic closure; L15's
|
||||
second sentence, not named by the brief, stays open until V1-2.6.
|
||||
- Minor documentary remarks may be fixed without a new graphic review, the boards unchanged.
|
||||
- Next: commit and push on `feature/v1-2-anatomical-sheets`, check the prerequisites of V1-2.5 (§16.6); start
|
||||
it only if they are VERIFIED, within the existing contract. Kept: no merge into develop, main or a release;
|
||||
no Supabase DEV operation without its own authorisation; no worker on DEV; tests and an independent review
|
||||
fit for the step; commits and pushes on the V1-2 branch; STOP at the V1-2.5 checkpoint. The graphic design is
|
||||
not reopened without a demonstrated defect or a new owner decision.
|
||||
@@ -0,0 +1,92 @@
|
||||
# Contract: V1-2.5 administration space, rights, species, MFA, catalogue (owner, 2026-11-02)
|
||||
|
||||
Brief « Validation propriétaire V1-2.4 » (2026-11-02): V1-2.5 authorised once its dependencies are VERIFIED,
|
||||
within the existing contract, no new scope. Prerequisites checked on `994b04e` (V1-2 contract §17.10). Plan:
|
||||
V1-2 contract §16.6, with §5.2 to §5.7, §7.2, §10, §11, §15; owner answers BDR-097 (M7 admin reads,
|
||||
working-copy action, EN « Permission »); design reference `docs/design/v1-2-4/` (approved, BDR-096).
|
||||
Step plan: `.claude/tasks/plans/2026-11-02-v1-2-5.md`.
|
||||
|
||||
Kept from the brief: no merge into develop, main or a release; no Supabase DEV operation; no worker on DEV;
|
||||
tests and an independent review fit for the step; commits and pushes on `feature/v1-2-anatomical-sheets`; STOP
|
||||
at the V1-2.5 checkpoint (gates; the owner tries the result at V1-2.6). Sandbox stack only (`pnpm db:sandbox`),
|
||||
never DEV; every command runs from the V1-2 worktree, never from the main checkout. The graphic design is not
|
||||
reopened.
|
||||
|
||||
## Criteria
|
||||
|
||||
- C1 MFA behaviour proven on the sandbox (real GoTrue, §5.6, §5.7.1, §5.7.3, §5.7.4): first factor enrolled
|
||||
at `aal1`; verify reaches `aal2`; a second factor from `aal1` refused; removal of a verified factor from
|
||||
`aal1` refused; removal from `aal2` and what it does to the account's other sessions recorded; a dormant
|
||||
unverified factor verified later recorded; a password change or reset never reaches `aal2`; refresh keeps
|
||||
`aal2`; a new sign-in starts at `aal1`. Expectations are what the pinned image does; if `aal1` can enrol a
|
||||
second factor or remove a verified one, the step STOPS for an owner decision.
|
||||
- C2 Mon compte, Sécurité: add a TOTP factor (QR code, secret shown once, never stored, logged or sent
|
||||
anywhere by the app), verify it with a code, name it, list and remove factors; the `aal2` requirements of
|
||||
GoTrue surfaced as messages, never bypassed; a step-up challenge entering `/app/admin` at `aal1`, no admin
|
||||
data requested before it succeeds.
|
||||
- C3 Navigation (§11.1, BDR-094): « Fiches anatomiques » only for catalogue readers (hint from the caller's own
|
||||
grant rows), one « Administration » entry for capability holders and the owner role, sidebar and drawer; a
|
||||
direct `/app/anatomy` URL without the right shows « Accès non autorisé » (L32) acting on the server's
|
||||
refusal, the same whether the sheet exists or not; signed out → login. Hidden entries protect nothing.
|
||||
- C4 Administration (board 10, §11.1): the page lists the caller's permissions and session state; cards
|
||||
« Fiches officielles », « Espèces », and « Accès et habilitations » for the owner only; each account sees only
|
||||
the entries and actions its capabilities allow (reviewer-only: no « Nouvelle fiche », « Créer une copie de
|
||||
travail », « Accès et habilitations », species creation or activation).
|
||||
- C5 Sheets (A1, W1 start): `/app/admin/sheets` every official sheet with the historical and working-copy
|
||||
badges and the filters species, sheet status, version status, round status, through M7; `/new` species
|
||||
(inline creation of an inactive species), names, slug, from the core's empty document; `/:sheetId` overview
|
||||
with versions and rounds; « Créer une copie de travail » on the historical sheet, disabled with its
|
||||
explanation while a copy is active; creation and copy land on the overview (editor in V1-2.6).
|
||||
- C6 Species (S1, §7.2): `/app/admin/species` active and inactive species; creation and editing of an
|
||||
inactive species (E); activation and renaming (O); the animal forms unchanged until activation.
|
||||
- C7 Rights (A0, §5.2): `/app/admin/access` (owner): find an account by e-mail, grant with reason,
|
||||
verification note (capabilities) and optional expiry, revoke with a reason; active, expiring (30 days),
|
||||
expired and revoked grants with their reason and note; `aal1` attempts refused in the UI and in SQL.
|
||||
- C8 Catalogue (P1, boards 01 to 03, complementary page): `/app/anatomy` published sheets by species, search by
|
||||
sheet name only, species filter; `/:sheetId` current version (views, zones, findings, references, disclaimer,
|
||||
earlier versions); `/:sheetId/versions/:number`; loaded through `get_sheet_version` and `PreviewSheet`
|
||||
(hash, fingerprint, caps checked by the core); whole drawing at opening on a phone, zoom and pan after;
|
||||
drafts never listed; archived sheets absent from the list and readable by id; Supabase or core unavailable
|
||||
→ the unavailable notice.
|
||||
- C9 M7 `sheet_admin_reads`: read RPCs only, capability holders at `aal2` (`caller_can_see_official_sheet`),
|
||||
one answer for unknown and forbidden ids; no write path, grant widening, policy or rule change; pgTAP allowed
|
||||
and denied cases (anonymous, reader, admin without capability, capability at `aal1`); types regenerated; a
|
||||
fresh install and an upgrade from the M6 state on the sandbox.
|
||||
- C10 Labels: ratified wordings used verbatim (V1-2 contract §3 with BDR-097, REVUE.md tables); every new
|
||||
FR/EN string goes through i18n and is listed at the checkpoint as a proposal; every failure kind the screens
|
||||
meet has an FR and an EN message.
|
||||
- C11 Tests and gates: unit; `e2e:shell` A0, A1, S1, P1, access per right, MFA required, refresh keeps `aal2`,
|
||||
no `aal1` enrolment of a second factor, axe, 320 to 430 px for the catalogue, 375 px for admin screens, FR
|
||||
and EN; `pnpm check:all`; fresh verifier against this contract; fresh security audit. Nothing reported as
|
||||
passed that did not run.
|
||||
- C12 Docs: IDENTITY.md (MFA screens, step-up, recorded GoTrue behaviour), V1-2 contract state, CLAUDE.md
|
||||
folder map, design README owning steps, TODO, memory.
|
||||
|
||||
## Out of scope
|
||||
|
||||
The editor (V1-2.6), the review and publication screens (V1-2.7), deprecation and archive actions (V1-2.7),
|
||||
the equine working copy content work (V1-2.8), any DEV operation (§16.11), recovery runbook rehearsal (V1-2.9).
|
||||
|
||||
## CLARIFICATIONS (after the fresh reviews of 2026-11-02 on 3d2b5a5)
|
||||
|
||||
- Skips: `apps/app/e2e/shell/admin.spec.ts` skips A0, A1 and S1 on the `chromium-375` project only (three
|
||||
`test.skip(isPhone(info))`). These journeys run on desktop; every admin page at 375 px is covered by the
|
||||
unskipped screens test and the access-per-right test. Deliberate, not a reduction.
|
||||
- C4 gap fixed: `/app/admin/sheets/new` shows « Accès non autorisé » to any account whose own grants, once
|
||||
read, hold no active `sheet_editor` grant (display rule; the server refuses creation anyway); unit tests for
|
||||
a reviewer, a publisher and an owner without the capability. While the grants load the page waits; when
|
||||
their read failed it shows « Impossible de vérifier vos autorisations » with a Retry button, never the form
|
||||
(owner decision 2026-11-02; a server refusal of the species read still wins with « Accès non autorisé »;
|
||||
V1-2 contract §17.11).
|
||||
- Security MEDIUM fixed: M7 restates the grants of the redefined `get_sheet_version`. LOW fixed: the e2e
|
||||
enrolment check no longer prints the throwaway setup key on failure.
|
||||
- Run evidence for the criteria a read-only verifier cannot run (orchestrator runs, sandbox only):
|
||||
C1 `mfa-behaviour.sandbox.ts` 10/10 (twice by the executor, once on a fresh install); C9 sandbox fresh
|
||||
install and upgrade from M6, pgTAP 1941 pass, types match (after the fixes: fresh install, 1941 pass, types
|
||||
match); C11 `pnpm check:all` all checks passed on 4f6c0ba code (= 3d2b5a5 code), `pnpm e2e:shell` 108
|
||||
passed / 6 skipped (slice J run, and again after the fixes), unit core-wasm 66, supabase 148, app 653.
|
||||
- P1 catalogue journey on `chromium-375` (search typed, 8 cards instead of 1): failed in two of four full
|
||||
`e2e:shell` runs, reproduced once in 16 repetitions. Cause: the test filled the search box while the mobile
|
||||
drawer's modal was still closing, page inert. Fixed in the test: both navigation helpers wait for the drawer
|
||||
to be gone (32 of 32 repetitions, then the full suite green). A person cannot type in that window either. pgTAP 014 (« nine species ») fails on a stack where the
|
||||
shell suite already ran (test species left behind): run `test-db` before `e2e:shell` on one stack.
|
||||
@@ -0,0 +1,223 @@
|
||||
# CONTRACT — v1-2-5-owner-checkpoint
|
||||
- date: 2026-11-02 | flow: feat | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /tmp/claude-1000/-home-bchanot-Documents-faunosteo/e641af9a-743e-46d0-9804-99667836040e/scratchpad/v1-2
|
||||
(every command runs from this worktree; never from /home/bchanot/Documents/faunosteo, never against DEV)
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — V1-2.5 : décisions propriétaire au checkpoint
|
||||
|
||||
J'ai examiné ton rapport au HEAD `14ff890`.
|
||||
|
||||
Les résultats techniques de V1-2.5 sont acceptés : pgTAP, tests unitaires, E2E, MFA GoTrue, check:all et revues indépendantes.
|
||||
|
||||
Je valide les choix suivants et demande de traiter les dernières corrections ciblées avant de déclarer l'étape définitivement VERIFIED.
|
||||
|
||||
## 1. Autorisations indisponibles
|
||||
|
||||
Je ne souhaite pas afficher un formulaire de création pleinement utilisable lorsque la lecture des permissions échoue.
|
||||
|
||||
Afficher plutôt :
|
||||
- « Impossible de vérifier vos autorisations ».
|
||||
- Une explication courte.
|
||||
- Un bouton « Réessayer ».
|
||||
|
||||
Ne pas déduire une absence de droit d'une erreur technique.
|
||||
|
||||
Distinguer explicitement trois situations :
|
||||
1. Utilisateur autorisé : formulaire disponible.
|
||||
2. Utilisateur non autorisé : accès refusé.
|
||||
3. Vérification indisponible : état temporaire avec nouvelle tentative.
|
||||
|
||||
Les contrôles serveur/RLS demeurent obligatoires.
|
||||
|
||||
Ajouter des tests pour ces trois cas, notamment pour un compte reviewer-only et un compte editor.
|
||||
|
||||
## 2. Différences graphiques acceptées
|
||||
|
||||
J'accepte :
|
||||
- La sélection affichée dans le panneau plutôt que dans une étiquette au-dessus du dessin, à condition qu'elle reste identifiable et accessible.
|
||||
- Une carte « Références » non repliable sur mobile, sous réserve qu'elle ne masque pas la zone anatomique.
|
||||
|
||||
Consigner ces deux écarts comme décisions UX acceptées, sans modifier les maquettes historiques.
|
||||
|
||||
Ne pas entreprendre de refonte graphique.
|
||||
|
||||
## 3. Choix complémentaires ratifiés
|
||||
|
||||
- Nom de facteur MFA : 64 caractères maximum.
|
||||
- Clé TOTP : absence de bouton Copier acceptée, mais affichage lisible et sélectionnable pendant la configuration.
|
||||
- Habilitations : validité jusqu'à la fin du jour sélectionné, selon Europe/Paris pour le périmètre français initial. Vérifier l'interprétation backend, notamment aux changements d'heure, sans modifier les données historiques.
|
||||
- Ordre des espèces : entier entre 0 et 9 999, validé côté serveur.
|
||||
- Terminologie : « relecteur ou relectrice ».
|
||||
|
||||
## 4. Libellés
|
||||
|
||||
Ratifier :
|
||||
- L14 : « Access and permissions » dans l'interface ; `capability` reste technique.
|
||||
- L15 : supprimer la seconde phrase redondante si la restriction de largeur est déjà explicite.
|
||||
- `object_conflict` (EN) : « The illustration file's contents do not match its recorded SHA-256 hash. »
|
||||
|
||||
Ne pas déclarer les quelque 350 nouveaux libellés approuvés. Ils feront l'objet d'une revue distincte du propriétaire.
|
||||
|
||||
Conserver les formulations ratifiées de V1-2.4.
|
||||
|
||||
## 5. MFA et récupération de compte
|
||||
|
||||
Consigner le comportement observé de GoTrue concernant la réutilisation des codes TOTP dans une fenêtre de validité.
|
||||
|
||||
Examiner et documenter le parcours lorsqu'un utilisateur perd son authentificateur :
|
||||
- Facteur secondaire éventuel.
|
||||
- Récupération de compte.
|
||||
- Intervention administrative autorisée.
|
||||
- Contrôles d'identité et traces d'audit.
|
||||
|
||||
Ne pas créer de contournement de MFA ni affaiblir les protections AAL2.
|
||||
|
||||
Si un parcours de récupération sûr manque, le signaler explicitement comme prérequis à la mise en production.
|
||||
|
||||
## 6. Validation
|
||||
|
||||
Effectuer les corrections ciblées et les tests de non-régression.
|
||||
|
||||
Vérifier :
|
||||
- Les trois états d'autorisation.
|
||||
- Les droits reviewer/editor.
|
||||
- Les invariants MFA.
|
||||
- Les accès serveur/RLS.
|
||||
- Les comportements mobiles concernés.
|
||||
- Les dates de validité si le code les traite.
|
||||
|
||||
Relancer les contrôles pertinents et une revue indépendante du HEAD final.
|
||||
|
||||
Commiter et pousser sur `feature/v1-2-anatomical-sheets` uniquement après validation.
|
||||
|
||||
Aucune opération sur DEV, aucun worker DEV, aucune migration DEV, aucune fusion et aucun déploiement.
|
||||
|
||||
## 7. Checkpoint
|
||||
|
||||
Présenter les corrections, résultats des tests, éventuels risques résiduels et HEAD final.
|
||||
|
||||
Si tout est conforme, déclarer V1-2.5 VERIFIED.
|
||||
|
||||
Ne pas commencer V1-2.6 dans cette intervention. Présenter son périmètre contractuel et ses prérequis au checkpoint suivant, sans inventer de fonctionnalités.
|
||||
|
||||
## CLARIFICATIONS
|
||||
|
||||
Q: Where does the « verification unavailable » state apply? / A: [gated 2026-11-02] Creation page
|
||||
(`/app/admin/sheets/new`: full unavailable screen) + Administration home (`/app/admin`: the « Vos habilitations »
|
||||
line replaced by the same notice with Retry). Sheets and species lists keep their grant-dependent actions hidden
|
||||
on a failed read (no false statement); no notice there.
|
||||
Q: Expiry instant / A: delegated — internal: the instant stored is 23:59:59.999 Europe/Paris of the chosen day
|
||||
(UTC offset of that instant, DST-aware); the backend compares instants (`expires_at > now()`), unchanged;
|
||||
historical rows untouched; the expiry day is displayed in Europe/Paris.
|
||||
Q: TOTP key display / A: delegated — no visible change: the key is already rendered as plain selectable text
|
||||
(`<code>`, monospace, wrapped); a test pins that it stays selectable and complete.
|
||||
Q: Species order server check / A: delegated — M7 (V1-2.5 migration, sandbox only) redefines `create_species`
|
||||
and `update_inactive_species` with the 0..9 999 range (null keeps today's meaning), privileges restated; M5 and
|
||||
earlier migrations untouched (forward-only).
|
||||
Q: Creation page with failed own grants but a server `rights.*` refusal / A: delegated (plan challenge,
|
||||
2026-11-02) — the server's refusal wins: « Accès non autorisé » (BDR-094 kept); the unavailable state covers a
|
||||
failed client read only.
|
||||
Q: What does Retry re-read? / A: delegated (plan challenge) — roles and own grants (and the creation page's species
|
||||
list when it failed); a failed Retry never wipes the profile, roles or workspace already held.
|
||||
Q: The new unavailable-permissions e2e test is skipped on `chromium-375` / A: [gated 2026-11-02, mid-run, internal]
|
||||
criterion 5 asks for a desktop proof; the skip follows the file's A0/A1/S1 idiom; the 375 px admin pages stay
|
||||
covered by the unskipped « admin screens » and « access per right » tests.
|
||||
Q: Sandbox suites share one stack's state / A: [gated 2026-11-02, mid-run, internal] two pre-existing test defects
|
||||
surfaced by the gates are fixed inside this run (FILE SCOPE extended): `sheets-admin.sandbox.ts` working-copy case
|
||||
(green only from the second run) and `sheets-concurrency.sandbox.ts` storage seeding (HTTP 400 duplicate after
|
||||
e2e:shell seeded the same content-addressed object). Product code untouched.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
|
||||
1. Three permission states on `/app/admin/sheets/new`, checked in this order: own grants `loading` → the
|
||||
waiting status; the server refused (species read answered a `rights.*` kind) → « Accès non autorisé »
|
||||
(BDR-094, the server's answer wins); own grants `failed` → the unavailable screen (title « Impossible de
|
||||
vérifier vos autorisations » / EN proposal, one short explanation, a « Réessayer » button), never the form;
|
||||
`ready` with an active `sheet_editor` grant → the form; `ready` without it (reviewer-only, publisher-only,
|
||||
owner without capability) → « Accès non autorisé ». A failed client read never yields « Accès non autorisé »
|
||||
by itself. Retry re-reads the roles and own grants through the store and the species list when it failed,
|
||||
shows the waiting status, then lands on the state the new answers give.
|
||||
2. `/app/admin`: own grants `loading` → the line shows the waiting status, not « aucune »; `failed` → the
|
||||
line is replaced by the unavailable notice with Retry (section heading, not a second h1); `ready` → today's
|
||||
line unchanged.
|
||||
3. Store: a retry action (`reloadAccess`) sets `catalogGrantsStatus` to `loading`, re-reads the platform roles
|
||||
and own grants, ends `ready` (roles and grants replaced) or `failed` (grants `[]`; profile, roles and
|
||||
workspace already held are kept, never wiped by a technical error); it never rejects (no user or client →
|
||||
`failed`); the account-change guard (`setForUser`) drops late answers. The unused `refreshAccount` is
|
||||
removed (no caller).
|
||||
4. Unit tests cover criteria 1-3, including a reviewer-only account and an editor account in each of the
|
||||
three states, Retry recovering to the form (editor) and to « Accès non autorisé » (reviewer-only), Retry
|
||||
recovering a failed species list, a failed Retry keeping roles/profile/workspace; the old « leaves a failed
|
||||
read to the server » test is replaced; `pnpm test:run` is green on each lot.
|
||||
CHECK: cd /tmp/claude-1000/-home-bchanot-Documents-faunosteo/e641af9a-743e-46d0-9804-99667836040e/scratchpad/v1-2 && pnpm --filter @faunosteo/app exec vitest run tests/unit/routes.admin.test.tsx tests/unit/state.authStore.test.ts tests/unit/lib.dates.test.ts tests/unit/admin.validation.test.ts tests/unit/components.SecurityPanel.test.tsx && echo UNIT-OK
|
||||
EXPECT: UNIT-OK
|
||||
EVIDENCE: MET exit=0 marker-found :: RUN v3.2.7 /tmp/claude-1000/-home-bchanot-Documents-faunosteo/e641af9a-743e-46d0-9804-99667836040e/scratchpad/v1-2/apps/app ✓ tests/unit/lib…
|
||||
5. `e2e:shell` (sandbox) proves on desktop: an editor at `aal2` gets the form; a reviewer-only account gets
|
||||
« Accès non autorisé » on `/app/admin/sheets/new`; with the own-grants request answered 500, the unavailable
|
||||
screen shows (no form field present), axe clean, and Retry after the request is restored shows the form. At
|
||||
320 and 375 px (viewport set explicitly) the catalogue sheet page's zone panel holds an `aria-live` region
|
||||
before any pick, which then names the picked zone, and the « Références » card starts at or below the
|
||||
drawing's bottom (1 px tolerance).
|
||||
6. Grant expiry: the form converts the chosen day to 23:59:59.999 Europe/Paris with the offset in force at that
|
||||
instant; « today » for the past-day check and the date picker's `min` (tomorrow) are Europe/Paris dates;
|
||||
tests run with `process.env.TZ` set to non-Paris zones (asserted) and cover a winter day, a summer day,
|
||||
2026-03-29 and 2026-10-25 (DST days); the grant list shows the expiry day in Europe/Paris (tested under a
|
||||
non-Paris zone). pgTAP proves, through `grant_catalog_right` under two session `TimeZone` values, that the
|
||||
stored instant for future DST days (2027-03-28, 2027-10-31) is the same, and that `list_catalog_grants`
|
||||
gives `expired` (now - 1 min), `expiring` (now + 1 min) and `active` (now + 30 days + 1 min) with
|
||||
`effective` as expected. No historical row is rewritten (no UPDATE, no migration touching existing
|
||||
`expires_at`).
|
||||
7. Species order: `create_species` and `update_inactive_species` refuse an order outside 0..9 999 with
|
||||
`invalid_input`; 0 and 9 999 accepted; null keeps the current default/value; pgTAP covers -1, 10 000, 0,
|
||||
9 999, null; the redefined RPCs keep `security definer` and `search_path=""` (pgTAP `proconfig`); types
|
||||
unchanged (`db:types --check`); fresh install and upgrade from M6 (`pnpm db:sandbox up upgrade
|
||||
20261102100000`) on the sandbox.
|
||||
8. Labels: FR `admin.grant_kind.sheet_reviewer` = « Relecteur ou relectrice »; contract §3 nomenclature row
|
||||
aligned; EN `catalogue.failure.drawing_hash_mismatch` = « The illustration file's contents do not match its
|
||||
recorded SHA-256 hash. »; L14 EN card title stays « Access and permissions »; L15 recorded as the title alone
|
||||
(no second sentence) for V1-2.6; MFA factor name max 64 (client and its test unchanged or tightened); no
|
||||
other ratified V1-2.4 wording changed; the label-proposals file says the ~350 new labels are not approved.
|
||||
9. TOTP enrolment: a test proves the setup key is rendered in full as text in a selectable element (no
|
||||
`select-none`, no `user-select: none`) while enrolment is open; no Copy button added; the key is still never
|
||||
stored, logged or sent by the app.
|
||||
10. MFA docs: `IDENTITY.md` §4.1 records TOTP code reuse within its window as measured by a new asserted case of
|
||||
`mfa-behaviour.sandbox.ts` (same code verified by a second aal1 session signed in after the first verify and
|
||||
proven alive before the code is sent, again by the same session, and once more in the following 30 s step;
|
||||
the measured span quoted);
|
||||
a new `IDENTITY.md` subsection reviews the lost-authenticator paths (second factor, account recovery,
|
||||
authorised administrative intervention, identity checks, audit trail), states each gap, and the V1-2 contract
|
||||
lists the missing safe recovery as an explicit production prerequisite. No MFA bypass, no AAL2 weakening, no
|
||||
new RPC, screen or service path that resets a factor.
|
||||
11. Decisions recorded without touching any board image: V1-2 contract §12.3 M7 row and §17.10 row (M7 now
|
||||
redefines two species RPCs), §13 new bullets (TOTP reuse residual; production prerequisite: rehearsed
|
||||
lost-factor recovery), §17.11 (this checkpoint: three states and the creation-page order,
|
||||
two accepted UX deviations with their conditions, ratified choices, labels), `docs/design/README.md`
|
||||
(accepted deviations), `docs/design/v1-2-4/REVUE.md` label rows (L15, `object_conflict` EN), the V1-2.5
|
||||
contract clarification on the failed read replaced.
|
||||
12. Gates on the final code: `pnpm check:all` green; sandbox `test-db` (fresh install and upgrade from M6),
|
||||
`pnpm db:sandbox test` (MFA suite included), `pnpm e2e:shell` green; nothing reported that did not run;
|
||||
no DEV operation, no merge, no deploy.
|
||||
|
||||
## FILE SCOPE
|
||||
|
||||
- apps/app/src/state/authStore.ts
|
||||
- apps/app/src/components/shell/PermissionsUnavailable.tsx (new)
|
||||
- apps/app/src/components/shell/AccessDenied.tsx (doc comment only)
|
||||
- apps/app/src/app/routes/app/admin/AdminSheetCreateRoute.tsx
|
||||
- apps/app/src/app/routes/app/admin/AdminHomeRoute.tsx
|
||||
- apps/app/src/lib/dates.ts
|
||||
- apps/app/src/admin/validation.ts, apps/app/src/admin/labels.ts, apps/app/src/components/admin/{GrantList,GrantPanel}.tsx
|
||||
- apps/app/src/components/catalogue/ZonePanel.tsx (live region always mounted, nothing visible changes)
|
||||
- apps/app/src/i18n/fr.ts, apps/app/src/i18n/en.ts
|
||||
- apps/app/tests/unit/{routes.admin.test.tsx,state.authStore.test.ts,lib.dates.test.ts,components.SecurityPanel.test.tsx},
|
||||
new apps/app/tests/unit/admin.validation.test.ts
|
||||
- apps/app/e2e/shell/{admin.spec.ts,catalogue spec}
|
||||
- supabase/migrations/20261102100000_sheet_admin_reads.sql (M7), supabase/tests/{015_catalog_access,022_sheet_admin_reads}.sql
|
||||
- packages/supabase/tests/sandbox/mfa-behaviour.sandbox.ts
|
||||
- packages/supabase/tests/sandbox/{sheets-admin,sheets-concurrency}.sandbox.ts (state-independence fixes, mid-run)
|
||||
- docs/development/IDENTITY.md, docs/development/V1-2_ANATOMICAL_SHEETS.md, docs/design/README.md,
|
||||
docs/design/v1-2-4/REVUE.md, .claude/tasks/contracts/2026-11-02-v1-2-5-admin-catalogue.md,
|
||||
.claude/audits/2026-11-02-v1-2-5-label-proposals.md
|
||||
@@ -0,0 +1,484 @@
|
||||
# CONTRACT — v1-2-6-editor
|
||||
- date: 2026-11-03 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (durable since 2026-11-04, LRN-114; was a session scratchpad)
|
||||
(every command runs from this worktree; never from /home/bchanot/Documents/faunosteo, never against DEV:
|
||||
the `supabase_*_faunosteo` containers are DEV and are never touched; the sandbox is `faunosteo_dbsandbox_*`)
|
||||
- base: 7f618d0 (memory commit after V1-2.5 VERIFIED at b4415a3)
|
||||
- contract of the step: docs/development/V1-2_ANATOMICAL_SHEETS.md §16.7 and §8.1-§8.4, with §6.2, §6.6, §6.7,
|
||||
§9.2-§9.4, §10, §11.1-§11.2, §17.9, §17.11; design docs/design/v1-2-4 boards 04, 05, 06 A (approved, BDR-096),
|
||||
REVUE.md ratified wordings
|
||||
- [amended 2026-11-05, V1-2.6 UX U0] level 1 as built here is NOT declared validated as a whole (owner T11); the
|
||||
redesign (sub-steps U1 to U8 of `docs/development/V1-2-6_UX_PLAN.md`) follows the 16 boards of
|
||||
`docs/design/v1-2-6` (validated 2026-11-05), which replace v1-2-4 boards 04 and 05 for editing (board 05's
|
||||
narrow-screen read-only mode stays the reference under O14 A, C16); the criteria it changes carry an amendment
|
||||
note below. Precedence for the redesign: where a criterion of this contract, with or without a note, differs
|
||||
from the validated v1-2-6 boards or from the V1-2 contract as amended (§8.2-§8.4, §17.12), the amended contract
|
||||
prevails first, then the boards. Two exceptions: a difference listed in `docs/development/V1-2-6_UX_DECISIONS.md`
|
||||
(« Points from the boards for U1 and later ») is an open owner question, and until the owner answers it the
|
||||
criterion stays as written; a point owned by another step (V1-2.7: preview, withdrawal) stays with that step. The
|
||||
other criteria stay in force
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — Validation V1-2.5 et autorisation V1-2.6
|
||||
|
||||
Décision propriétaire : **ALL**.
|
||||
|
||||
J'accepte le checkpoint final V1-2.5 au HEAD `b4415a3`.
|
||||
|
||||
**V1-2.5 VERIFIED**
|
||||
|
||||
J'autorise l'enregistrement des deux mémoires proposées, puis le démarrage de V1-2.6 conformément au contrat existant.
|
||||
|
||||
## 1. Mémoires
|
||||
|
||||
Créer les deux entrées proposées :
|
||||
|
||||
**BDR — Décisions V1-2.5**
|
||||
- Ordre des états et contrôles d'autorisation.
|
||||
- Fonctionnement du bouton Réessayer.
|
||||
- Expiration des habilitations à 23:59:59.999, heure de Paris, le jour choisi.
|
||||
- Ordre des espèces limité à 0–9 999.
|
||||
- Deux écarts UX acceptés.
|
||||
- Parcours de récupération MFA sécurisé obligatoire avant production.
|
||||
- Réserve concernant les tests mobiles et les tests sandbox supplémentaires.
|
||||
|
||||
**LRN — Retours techniques**
|
||||
- Comportement de GoTrue v2.197 sur la réutilisation des codes TOTP, en distinguant les observations de toute garantie générale.
|
||||
- Particularité de la réponse Storage HTTP 400 avec `statusCode: "409"`.
|
||||
- Nécessité d'une sandbox neuve et de l'ordre `test-db → e2e:shell → test`, en conservant l'explication du problème de partage d'état.
|
||||
|
||||
Vérifier les identifiants BDR/LRN existants avant attribution. Ne pas créer de collision.
|
||||
|
||||
Commiter et pousser ces modifications sur `feature/v1-2-anatomical-sheets`.
|
||||
|
||||
## 2. Démarrage V1-2.6 autorisé
|
||||
|
||||
Développer l'éditeur anatomique de niveau 1, en respectant strictement le contrat V1-2 §16.7 et §8.2.
|
||||
|
||||
Périmètre :
|
||||
- Onglets et formulaires structurés.
|
||||
- Import de dessin SVG avec nettoyage par le cœur Rust.
|
||||
- Gestion des vues principales et secondaires.
|
||||
- Points, zones et liens anatomiques.
|
||||
- Édition des propriétés d'annotations.
|
||||
- Catalogue et arbre des constats.
|
||||
- Indicateurs de revue et éléments `to_confirm`.
|
||||
- Enregistrement, récupération locale et gestion des conflits.
|
||||
- Consultation en lecture seule sous 1 024 px.
|
||||
- Parcours clavier et accessibilité prévus au contrat.
|
||||
|
||||
Ne pas inventer de nouvelles fonctionnalités hors périmètre.
|
||||
|
||||
Ne pas modifier le design approuvé V1-2.4 sans défaut démontré.
|
||||
|
||||
## 3. Test fonctionnel obligatoire
|
||||
|
||||
Démontrer sur une sandbox fraîche un parcours complet :
|
||||
|
||||
1. Connexion avec un compte possédant les habilitations nécessaires.
|
||||
2. Création d'une nouvelle fiche pour une espèce autre que le cheval.
|
||||
3. Import d'un SVG réel.
|
||||
4. Vérification et nettoyage du dessin par le cœur Rust.
|
||||
5. Création d'une vue secondaire.
|
||||
6. Création et modification de points, zones et liens.
|
||||
7. Création des catégories et constats prévus par le contrat.
|
||||
8. Enregistrement du brouillon.
|
||||
9. Rechargement du navigateur et récupération correcte du travail.
|
||||
10. Gestion d'un conflit de modification entre deux sessions.
|
||||
11. Soumission de la fiche.
|
||||
12. Vérification de sa progression dans le workflow, jusqu'à `verifying` conformément aux règles existantes.
|
||||
|
||||
Respecter les règles concernant les éléments `to_confirm` et les verdicts. Ne pas contourner les contrôles pour faire réussir la démonstration.
|
||||
|
||||
## 4. Tests et qualité
|
||||
|
||||
Exécuter les tests contractuels, notamment :
|
||||
- E2E A2, A3 et A4.
|
||||
- Parcours clavier et champs numériques.
|
||||
- Import SVG hostile et valide.
|
||||
- Contrôles des permissions.
|
||||
- Gestion des conflits.
|
||||
- Rechargement et récupération.
|
||||
- Affichage mobile à 320 et 375 px.
|
||||
- Lecture seule sous 1 024 px.
|
||||
- Intégration des composants Rust/Wasm.
|
||||
- Non-régression des fiches équines historiques.
|
||||
|
||||
Préserver les oracles et les protections de sécurité déjà validés.
|
||||
|
||||
Exécuter les suites sandbox dans l'ordre requis, sur une pile neuve, sans masquer les problèmes de pollution d'état.
|
||||
|
||||
Relancer `check:all` et une revue indépendante de conformité et de sécurité sur le code final.
|
||||
|
||||
## 5. Livrable testable par le propriétaire
|
||||
|
||||
Au checkpoint V1-2.6, fournir une procédure pratique pour que je puisse tester l'éditeur dans un navigateur :
|
||||
|
||||
- Commandes exactes pour démarrer les services isolés nécessaires.
|
||||
- URL locale de l'application.
|
||||
- Méthode d'accès au compte de test, sans exposer de secret dans les logs.
|
||||
- Parcours précis pour créer une fiche.
|
||||
- Opérations que je dois pouvoir tester.
|
||||
- Résultat attendu pour chaque étape.
|
||||
- Procédure d'arrêt et de nettoyage de la sandbox.
|
||||
|
||||
Ne pas affirmer que le produit a été validé par le propriétaire avant mon essai.
|
||||
|
||||
## 6. Contraintes
|
||||
|
||||
- Travail uniquement sur `feature/v1-2-anatomical-sheets`.
|
||||
- Commits et push réguliers.
|
||||
- Aucune fusion vers develop, main ou release.
|
||||
- Aucune opération sur Supabase DEV.
|
||||
- Aucun worker DEV.
|
||||
- Aucune migration DEV.
|
||||
- Aucune modification des ressources équines historiques.
|
||||
- Aucun déploiement de production.
|
||||
- Aucun début de V1-2.7.
|
||||
|
||||
La reconstruction des images et les opérations sur la sandbox jetable sont autorisées si nécessaires, après vérification des cibles et de l'absence d'exécution concurrente.
|
||||
|
||||
## 7. Checkpoint final
|
||||
|
||||
Présenter :
|
||||
- HEAD et commits.
|
||||
- Fonctionnalités réalisées.
|
||||
- Résultats des tests.
|
||||
- Résultats de l'audit indépendant.
|
||||
- Écarts et risques résiduels.
|
||||
- Démonstration complète d'une fiche non équine.
|
||||
- Procédure de test manuel par le propriétaire.
|
||||
|
||||
Ne déclarer V1-2.6 VERIFIED qu'après satisfaction des critères techniques contractuels.
|
||||
|
||||
S'arrêter avant V1-2.7 et attendre mon retour après essai de l'éditeur.
|
||||
|
||||
## CLARIFICATIONS
|
||||
|
||||
Q: Conflict dialog « author and time » (§6.2) has no data source; §16.7 says SQL none / A: [gated 2026-11-03]
|
||||
read migration M8 (sandbox only, as M7 in V1-2.5): the admin read of the draft returns the last save's actor and
|
||||
time (from the audit), no write path, no policy or rule change; the deviation from « SQL changes: none » is
|
||||
recorded in the contract. DEV untouched.
|
||||
Q: Board 06 A shows « Prévisualiser »; §8.2 lists follow the round and withdraw; §16.8 gives V1-2.7 the
|
||||
practitioner preview, the round screen and the withdrawal / A: [gated 2026-11-03] deferred to V1-2.7: V1-2.6
|
||||
submits, then shows the frozen draft with « Revue n° N · vérification en cours » and a link to the sheet's
|
||||
overview; no « Prévisualiser » and no withdrawal before V1-2.7 (visible deviation from board 06 A, recorded).
|
||||
Q: Which drawing for A2 (« un SVG réel », non-equine, exported then cleaned) / A: [gated 2026-11-03] the
|
||||
committed Inkscape 1.4.3 export (`crates/core/tests/fixtures/svg/exports/inkscape-1.4.3-*.svg`, a real export,
|
||||
cleaning offered) plus a hostile file; the owner may import a drawing of their own at the trial.
|
||||
Q: Undo / redo control (not on board 04) / A: [gated 2026-11-03] two icon buttons « Annuler » and « Rétablir »
|
||||
in the tool column under the zoom, plus Ctrl+Z and Ctrl+Shift+Z. [amended 2026-11-05, U0, §17.12: the two buttons
|
||||
move to the editor header on every tab (ARBITRAGES choice 2, built at U1); the history command is named « Annuler la dernière
|
||||
modification » (T15); the shortcuts are unchanged.]
|
||||
Q: Plan approval (8 visible choices, rescue copy) / A: [gated 2026-11-03] owner brief « GO propriétaire V1-2.6 »:
|
||||
plan, lots A-M, C1-C24 and the 8 choices approved; M8 on the throwaway sandbox only; no JSON export button for the
|
||||
recovery copy; local recovery kept with exact messages on its state and limits; a local restore never silently
|
||||
overwrites a newer server revision; execution gated on a targeted independent re-check of the six FATAL fixes.
|
||||
Q: Re-check REMAINING(2) (default radius out of frame; pending copy overwritten) / A: [gated 2026-11-03] owner
|
||||
brief « arbitrages propriétaire sur REMAINING(2) »: radius `min(12 + 0.03 × max(w, h), min(w, h) / 2)` in the
|
||||
drawing's frame, the clicked position kept when a valid radius exists, a position correction shown and confirmed,
|
||||
never silent, never below the core's minimums, never `out_of_frame`, the core keeps the authority; editing blocked
|
||||
while a recovery offer is unanswered (« Restaurer la copie » / « Ignorer la copie », consultation allowed); conflict
|
||||
N from `draft_version.revision`, author and date from `draft_last_save`, failed read → « Recharger » / « Réessayer »,
|
||||
« Garder ma version » disabled; two-copy cap kept with no automatic eviction of an unresolved copy; AAL2 residual
|
||||
risk recorded, not fixed; second targeted re-check, then execution without a new authorisation if conforming.
|
||||
Q: Re-check REMAINING(1) (F1 unmeasured views; C26 refinement for annotations already out; minor effects) / A:
|
||||
[gated 2026-11-04] owner brief « GO propriétaire après REMAINING(1) »: F1 fix approved; C26 refined by seven
|
||||
repair rules (new annotation valid before integration; a valid annotation never made invalid; an annotation
|
||||
already out repairable; intermediate values kept in the form; geometry applied only when the whole satisfies the
|
||||
core; no diagnostic hidden; a frame change never silently invalidates); 4 px drag threshold, unreadable copy kept
|
||||
with « Ignorer la copie » naming the loss, leave guard while a decision is pending and not after; execution of
|
||||
lots A-M authorised without a third plan review; stop on a blocking defect or a contractual impossibility.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
|
||||
Memory part (§1 of the request): done before this contract, commit 7f618d0 pushed (BDR-099, LRN-113; ids
|
||||
checked across develop, main, feature/v1-1, feature/v1-2: next free were BDR-099 and LRN-113).
|
||||
|
||||
1. Route `/app/admin/sheets/:sheetId/draft` exists under `RequireAdmin`; the page loads the sheet's draft
|
||||
(admin read for the draft version, `get_sheet_version`, drawings downloaded under RLS, an editable
|
||||
`PreviewSheet`) and shows the permission states of BDR-099 (loading, failed read with « Réessayer », not
|
||||
authorised); an active `sheet_editor` grant gives the edit mode; reviewer-only and publisher-only accounts
|
||||
get the read-only mode; a draft frozen by a `verifying`, `open` or `approved` round is read-only with a
|
||||
notice naming the round; a sheet without a draft says so with a link to the overview. The overview offers
|
||||
the editor link; A1 (new sheet) and W1 (working copy) land on the editor (§11.2).
|
||||
2. The editable preview handle replaces the document (`replace_document`) and adds drawings (`add_drawing`)
|
||||
in place, and after a runtime trap rebuilds from the CURRENT document text and the drawings held, never
|
||||
from the initial input.
|
||||
3. Tabs Général, Vues et illustrations, Annotations, Constats, Références, Vertèbres, Vérification (§11.1),
|
||||
ARIA tabs; every change is one core `sheet.edit` command run on commit (blur, confirm, pointer-up), never
|
||||
per keystroke; TypeScript keeps no document schema and no Zod copy (ts-rs types only).
|
||||
[amended 2026-11-05, V1-2.6 UX U0, V1-2 contract §17.12; built at U1] Four tabs: Général, Annotations,
|
||||
Constats, Vérification. Views, drawings, annotation categories and vertebral regions move into Annotations;
|
||||
Références becomes a side panel opened from the header or from a finding; Annuler and Rétablir sit in the
|
||||
header on every tab. The commit rule and the ts-rs-only rule above are unchanged.
|
||||
4. Général: FR/EN name, description, scope disclaimer, attribution (authors, licence, notes); annotation
|
||||
categories (name FR/EN, colour) add, edit, delete.
|
||||
[amended 2026-11-05, U0, §17.12] Categories leave Général for the category panel of Annotations (U3: swatch
|
||||
and name, palette and hex, staged « Appliquer », delete when unused, « Réaffecter à… »). From U6 the three fixed
|
||||
categories Os, Articulations, Vertèbres keep their names and roles (no delete, name read-only), their colour and
|
||||
fill opacity stay adjustable; other categories stay free.
|
||||
5. Références: add, edit, delete; type, citation, URL (http or https only), DOI. Vertèbres: add (code typed at
|
||||
creation, read-only after), edit, reorder ↑/↓, delete. A refused removal (`has_dependents`) lists the
|
||||
dependents from `sheet.dependents`; no cascade deletion.
|
||||
[amended 2026-11-05, U0, §17.12] References move to a side panel (C3). Vertebral regions open from the
|
||||
vertebra-role category at U6 (board 09): reorder by grip handle or Alt+arrows, staged « Appliquer »; the
|
||||
↑/↓ buttons stay until then; whether a region code stays read-only after creation is settled at U6.
|
||||
6. Vues et illustrations: main view and detail views (parent; own drawing or crop entered as numeric
|
||||
`view_box` values over the parent's preview), rename, delete (dependents listed). Drawing upload: the file
|
||||
is read by the core (`clean_svg`); hard rejection and active content refused with the reason in FR/EN, no
|
||||
cleaning offered; cleanable: the cleaned drawing composed by the core and the removed names (a removed
|
||||
`<style>` named) shown, then one confirmation « Nettoyer et utiliser cette version »; clean: used. The bytes
|
||||
registered, hashed and uploaded are `SvgCleaning.stored` with the core's sha256; register, upload at
|
||||
`<sha256>.svg` (an existing object, Storage HTTP 400 with body `statusCode` "409", counts as present),
|
||||
confirm; the drawing state (ok, missing, rejected) is shown; the §9.3 closed codes have FR/EN messages.
|
||||
[amended 2026-11-05, U0, §17.12] Views and drawings sit in Annotations. A crop is drawn as a rectangle over
|
||||
the parent's drawing, its handles resizable by keyboard (U4); the numeric `view_box` editor leaves the normal
|
||||
journey; the view's name is proposed from the annotations inside and stays editable (U5); replacing a crop
|
||||
view's drawing opens the three-action dialog of decision T9 before any upload (U5). Upload, cleaning, register,
|
||||
upload and confirm are unchanged.
|
||||
7. Annotations: on the core-composed view (`view.canvas`), tools select, point, zone, detail-view link, zoom;
|
||||
a point by one click with its radius in a field; a zone and a link as polygons by successive clicks,
|
||||
closed, Escape cancels a tracing; a link chooses the view it opens; selection on the drawing or in the
|
||||
list; a selected circle or polygon moves as a block (page preview during the drag, the core command on
|
||||
pointer-up); a `path` annotation is displayed, selectable, deletable and replaceable by a polygon, never
|
||||
moved or edited as path data; zoom and pan; every coordinate (cx, cy, r, each vertex x and y) in numeric
|
||||
fields, vertices added and removed in the list; a keyboard-only path creates and edits points, zones and
|
||||
links (numeric fields).
|
||||
[amended 2026-11-05, U0, §17.12; built at U2 and U4] Direct manipulation replaces the numeric fields in the
|
||||
normal journey: point move and a size slider snapped to the sizes of the view, with the core's minimum mark;
|
||||
vertex drag, « + » on a segment, « − » on the chosen vertex (disabled at 3 vertices with its reason, board 12 B); zone move, directly
|
||||
with the mouse once selected, in an explicit « Déplacer la zone » mode by touch; redraw keeping the old shape
|
||||
until the new one is accepted. The keyboard alternative goes through the handles (Tab, arrows, Shift ×10,
|
||||
Insert or Backspace or Delete, Enter, Escape); no coordinate field. The detail-view link tool leaves the
|
||||
toolbar: an access is placed from the view's menu (« Ajouter un accès »), and created with the view from U6
|
||||
when no annotation overlaps it. Paths are unchanged (C45, T16): displayed, selectable, deletable, never moved
|
||||
or edited; « Remplacer par un polygone » stays their one explicit exit, validated by the core, the old path kept
|
||||
until the polygon is accepted, one undo entry.
|
||||
8. Annotation properties: FR and EN name, category, laterality, finding zone, vertebral region, colour,
|
||||
review marking; « Marquer comme relu » on one element; delete with the dependents shown when refused.
|
||||
[amended 2026-11-05, U0, §17.12; built at U3] The annotation's own colour is shown only when set, with
|
||||
« Revenir à la couleur de la catégorie » (one `update` with `color: null`); a new annotation carries no own
|
||||
colour and inherits its category's. The other properties are unchanged.
|
||||
9. Constats: tree of finding zones, categories (kind) and nodes up to depth 8: add, rename FR/EN, describe
|
||||
FR/EN, vet referral flag, cite references, review marking of one element, « Marquer comme relu » on one
|
||||
category or one zone (never sheet-wide), reorder among siblings with ↑/↓, delete with a confirmation
|
||||
listing what goes; no move to another parent, no drag and drop.
|
||||
10. Vérification (board 06 A): the core report's issues with an FR and EN message per code and a link to the
|
||||
element, the completeness counts, the statuses per group, the document size (`report.document_bytes`)
|
||||
against 2 MiB, the caps exceeded; `to_confirm` elements informative, never blocking submission (C7);
|
||||
submission note required as on board 06 A (non-blank, at most 1 000 characters); « Soumettre à la revue »
|
||||
disabled while the in-page check has errors or the page has unsaved changes, with the hint; a submission
|
||||
calls `submit_sheet_review` on the saved revision and the page then shows the draft frozen with its round
|
||||
`verifying`.
|
||||
11. Save: explicit « Enregistrer » (`save_sheet_draft` with `expected_revision`, no change note: accepted
|
||||
deviation of REVUE.md); header « Révision N · modifications non enregistrées »; every server failure kind
|
||||
mapped to an FR/EN message; « Annuler les modifications » returns to the last saved document after a
|
||||
confirmation; the leave guard (`useLeaveGuard`) is armed while unsaved.
|
||||
[amended 2026-11-05, U0, §17.12; built at U1] The header states follow the validated boards (07, 08, 09,
|
||||
12 A, 13): « n modifications non enregistrées » while unsaved, « Enregistré à hh:mm · révision n » after a
|
||||
save; the exact labels go to the U1 label review.
|
||||
[amended 2026-11-05, U0, owner decision T15, §17.12; built at U1] The command that returns to the last saved
|
||||
document is labelled « Abandonner les modifications » (today `editor.draft.discard` « Annuler les
|
||||
modifications », `apps/app/src/i18n/fr.ts:1238`), so no discard of unsaved changes is called « Annuler »;
|
||||
dialogs that close without effect keep « Annuler » (outside T15, DECISIONS T15); its confirmation and behaviour
|
||||
are unchanged.
|
||||
12. Conflict (§6.2): `draft_conflict` opens a dialog with the server revision (and its author and time if the
|
||||
owner's answer provides them) and « Recharger » or « Garder ma version »; the second saves the local
|
||||
document on the new revision only after an explicit confirmation naming what it replaces; nothing is
|
||||
overwritten silently.
|
||||
13. Local recovery (§6.2): a browser copy of the unsaved document in the report editor's persistence pattern
|
||||
(sessionStorage), keyed by version and revision, written on each committed change while unsaved, its
|
||||
status bound to the real write (LRN-057), removed after a successful save or an explicit discard; offered
|
||||
back on opening when it differs from the server document, restored through the core, never sent
|
||||
automatically; proven by a restore round trip (LRN-058).
|
||||
[amended 2026-11-05, U0, wording matched to the code] The copy is keyed by account and version
|
||||
(`apps/app/src/editor/state/recovery.ts:47-49`); the revision is a field of the copy (`recovery.ts:25`), used
|
||||
as the expected revision at restore (C27). Behaviour unchanged.
|
||||
14. Undo and redo: a stack bounded by 8 MiB of document strings (UTF-8 bytes).
|
||||
15. Ids generated by the page `<prefix>-<10 characters a-z2-7>` (crypto random), inside the stable-id grammar,
|
||||
never derived from labels, never editable, never reused within the document.
|
||||
16. Below 1 024 px (board 05): read-only, badges « Brouillon » and « Lecture seule », the notice title alone
|
||||
(L15, BDR-099 §17.11), tabs, the whole drawing at opening, zoom and pan, a properties summary, no editing
|
||||
action; unsaved work in memory survives a width change. No horizontal scroll at 320, 375 and 768 px.
|
||||
[amended 2026-11-05, U0] Board 05 is v1-2-4's and stays the reference of this read-only mode under O14 A.
|
||||
Board 15 C of v1-2-6 shows the same rule only as an illustration: its two-sentence notice and the absence of
|
||||
tabs and summary there are not adopted; the notice title alone, the tabs and the summary stay.
|
||||
17. Security: stored drawing bytes are never inserted into the page; only core-composed trees are rendered
|
||||
(DOMParser + importNode); the cleaning preview is composed by the core under a scope unique in the page;
|
||||
the original file is never rendered; no `innerHTML` / `dangerouslySetInnerHTML` carries drawing or
|
||||
document data; the page-drawn overlay (selection, vertices, tracing) holds numbers only.
|
||||
18. Unchanged: SQL migrations (unless the owner's conflict answer adds a read migration, sandbox only), the
|
||||
core's rules and readers, the readers of user data, the equine legacy sources, seed and oracles, the
|
||||
goldens; the wasm module within its 600 000 B gzip budget; `pnpm r5:import-equine --check` without
|
||||
difference.
|
||||
[amended 2026-11-05, U0, §17.12] This list describes level 1. The redesign changes, each on its own
|
||||
authorisation: one read-only core value (U2), two core queries (U5), and at U6 the category model (core rules
|
||||
and edit refusals, a bounded widening of the snapshot reader, one SQL migration with the declared checks of
|
||||
contract §12.2), under `docs/development/V1-2-6_UX_COMPATIBILITY.md`. The seed, the legacy sources, the
|
||||
oracles, the goldens, the wasm budget rule and `r5:import-equine --check` stay unchanged.
|
||||
19. i18n: FR and EN parity; the ratified wordings (REVUE.md, §17.9, §17.11) used verbatim; the new labels
|
||||
listed for a separate owner review, not declared approved.
|
||||
20. Tests: unit (editor state, ids, undo bound, recovery, conflict, upload steps, issue mapping); `e2e:shell`
|
||||
A2, A3, A4 with a conflict between two sessions and a local recovery after a reload; keyboard path
|
||||
through numeric fields; hostile and valid SVG imports; permissions (editor, reviewer-only read-only,
|
||||
account without capability refused); read-only at 320, 375 and a width under 1 024 px; axe on the
|
||||
editor and the read-only mode; core-wasm proofs; equine non-regression (catalogue P1, the equine working
|
||||
copy opening in the editor read path, `r5:import-equine --check`).
|
||||
[amended 2026-11-05, U0, §17.12] With the redesign the keyboard path goes through the handles and the
|
||||
rectangle (C7 and C6 as amended), not through numeric fields; the redesign's tests are in
|
||||
`docs/development/V1-2-6_UX_TESTS.md` (U1 to U8). The other tests are unchanged.
|
||||
21. Demonstration on a fresh sandbox of the request's §3 journey (steps 1 to 12) for a non-equine species,
|
||||
built from scratch in the UI, saved, reloaded, conflicted, submitted; the validation panel shows no error
|
||||
while elements are still `to_confirm`; the round reaches `verifying` (no verification worker started).
|
||||
22. Gates: fresh sandbox, suites in the order `test-db → e2e:shell → test`, state-dependent failures reported,
|
||||
never masked; `pnpm check:all` green; fresh independent verifier and security review on the final code.
|
||||
23. An owner test procedure (commands, local URL, test-account access without secrets in logs, journey,
|
||||
operations, expected results, teardown), and a checkpoint report; V1-2.6 not declared validated by the
|
||||
owner.
|
||||
24. Constraints: work on `feature/v1-2-anatomical-sheets` only, regular commits and pushes, no merge, no DEV
|
||||
operation, no DEV worker, no DEV migration, no production deployment, no V1-2.7 work.
|
||||
25. [gated 2026-11-03] The plan's eight visible choices are built as approved; no JSON export or import of the
|
||||
recovery copy; every message about the copy says it is temporary, limited to this tab and not saved on the
|
||||
server, and reads the real write flag.
|
||||
[amended 2026-11-05, U0, §17.12] Of the plan's eight choices, the redesign replaces three: categories edited in
|
||||
Général (now in Annotations, C4), keyboard creation through numeric fields (now through handles, C7), the
|
||||
properties card under the canvas from 1 024 to 1 279 px (now beside it, board 13).
|
||||
Plan choice 2 (creation panels ask names and laterality before the element exists, no preselection, no default
|
||||
labels): for detail views it gives way to the validated name proposal (ARBITRAGES choice 6, contract §8.2 as
|
||||
amended, C6); for points and zones it differs from boards 02 and 04 (laterality and other properties set after
|
||||
creation), an open owner question listed in DECISIONS, plan choice 2 in force until it is answered. The other
|
||||
four stay.
|
||||
26. [gated 2026-11-03] Default point: radius `r0 = min(12 + 0.03 × max(w, h), min(w, h) / 2)` in the view's frame
|
||||
as composed by the core (composed root `viewBox`, origin kept); the clicked position is kept with r0 when the
|
||||
circle fits, else with a smaller radius when the core accepts it; otherwise a corrected position is shown
|
||||
beside the original click and used only after an explicit confirmation, with a cancel; no point is ever
|
||||
created `out_of_frame` or `too_small` by the page's defaults, and no geometry commit leaves the changed
|
||||
annotation `out_of_frame` (rolled back before anything is kept); the decision is the core's report, TypeScript
|
||||
holds no copy of the frame or size rules; Node-core unit tests cover 40×30, 20×20, 100×300, very elongated
|
||||
frames, non-zero origins, clicks on edges and corners, equality at the edge, 0.01 rounding and large
|
||||
coordinates. (Refined by 33: the commit rule covers every geometry error, not only `out_of_frame`.)
|
||||
27. [gated 2026-11-03] A recovery offer left unanswered blocks every document change: the store refuses commit,
|
||||
undo, redo, save and submit, and the copy is neither written nor removed; consultation stays; « Restaurer la
|
||||
copie » goes through the core and keeps the copy's base revision as the expected revision (`staleBase` when
|
||||
older, never converted to the server's); « Ignorer la copie » is confirmed, removes the copy and resumes from
|
||||
the server version; a copy the core refuses is reported, kept, never applied, and editing stays blocked until
|
||||
it is ignored.
|
||||
28. [gated 2026-11-03] A copy is removed only by a successful save leaving nothing unsaved, or a confirmed
|
||||
« Annuler les modifications » ([amended 2026-11-05, U0] « Abandonner les modifications » from U1, C11 as amended), « Ignorer la copie »,
|
||||
« Recharger » or « Abandonner cette copie »; never on
|
||||
undo, never by automatic eviction; at most two copies of other versions of the account; when the cap or the
|
||||
storage quota prevents keeping the current copy, the page says so and lists the other copies for an explicit,
|
||||
confirmed abandonment; unit tests for the cap, the quota and pending copies.
|
||||
29. [gated 2026-11-03] Conflict dialog: N from `draft_version.revision`, author and date from `draft_last_save`
|
||||
only when its revision is N, never invented; a failed read offers « Recharger » and « Réessayer » only, with
|
||||
« Garder ma version » disabled; a confirmed replacement saves with `expected_revision = N` under the server's
|
||||
atomic check, and a new concurrent save re-opens the dialog instead of writing.
|
||||
30. [gated 2026-11-03] Tests named by the owner, in e2e on a fresh sandbox: concurrent save between two sessions,
|
||||
older-copy restore, a pending offer blocking edits, permission changes during an open session (grant revoked,
|
||||
grant expired, admin role removed), drawing import (hostile and valid), keyboard-only paths, a point near the
|
||||
edge of a detail crop (correction confirmed and cancelled); the full non-equine journey (C21).
|
||||
31. [gated 2026-11-03] Records: the AAL2 residual risk (catalogue RPCs check the token's `aal2` claim, not the live
|
||||
session, until the token expires after a factor removal) written in the V1-2 contract §13 as a production
|
||||
prerequisite, not declared fixed, no authentication change in V1-2.6; the LRN-095 and BLK-013 id collisions
|
||||
with develop recorded for the reconciliation before the merge, registries not renumbered.
|
||||
32. [gated 2026-11-04] Unmeasured views (no accepted drawing, or `view.frame.unknown` for the view): drawing tools,
|
||||
keyboard « Ajouter … » buttons and numeric geometry fields disabled with the hint naming « Vues et
|
||||
illustrations »; existing annotations shown and selectable with read-only geometry, no drag; `accept` refuses
|
||||
every creation and geometry commit there (checked on the post-commit state); the fallback frame `0 0 100 100`
|
||||
is never used as a frame; the core stays the authority, no TypeScript frame or size rule.
|
||||
[amended 2026-11-05, U0, §17.12] With direct manipulation the same views disable the handles, the size slider,
|
||||
the keyboard handle moves, the creation tools and the detail-view rectangle, with the same hint naming where the
|
||||
drawing is attached (Annotations after U1); there is no numeric geometry field left to disable.
|
||||
33. [gated 2026-11-04] Geometry commits: accepted only when the changed annotation carries no Error at
|
||||
`annotations[i].geometry` after the commit (new, valid or already invalid before), refused otherwise with the
|
||||
handle rolled back and nothing kept; a typed radius the core reports `too_small` is refused; the geometry
|
||||
fields form one group held in the form and applied whole, refused values stay shown as not applied with the
|
||||
core's message and a way back to the stored values; an annotation already invalid is repaired that way and
|
||||
its error stays visible until the fix is applied; a frame change (`view_box`, drawing) is refused when an
|
||||
annotation without a geometry error gets one, or a measured view holding annotations becomes unmeasured; the
|
||||
save path and the server verdict unchanged; Node-core unit tests for repair, `too_small`, drag rollback and
|
||||
frame changes.
|
||||
[amended 2026-11-05, U0, §17.12] The acceptance rule applies to every handle gesture, slider release and
|
||||
keyboard move: a geometry commit is kept only when the changed annotation carries no Error at
|
||||
`annotations[i].geometry` afterwards; a refused gesture restores the previous shape exactly, with the core's
|
||||
message. The numeric form group leaves the normal journey: an annotation already invalid is repaired through its
|
||||
handles, its error shown until the fix is accepted. The frame-change rule is unchanged.
|
||||
34. [gated 2026-11-04] A drag starts after 4 CSS px (click, keyboard and touch kept); an unreadable copy is kept
|
||||
until « Ignorer la copie » confirmed, its notice names the loss, editing blocked meanwhile; the leave guard is
|
||||
armed only while unsaved or a recovery decision is pending, and its mobile-browser limits are documented; the
|
||||
owner trial guide `docs/development/V1-2-6_OWNER_TRIAL.md` covers non-equine creation, SVG import, points,
|
||||
zones and links, geometry correction, save and restore, two-tab concurrency and submission; the checkpoint
|
||||
gives HEAD, commits, test and audit results.
|
||||
35. [gated 2026-11-04 checkpoint] The uncommitted Prettier changes under `apps/app/src/editor/state/` are restored
|
||||
only after a kept copy of their diff and a per-file proof that nothing but formatting differs from HEAD.
|
||||
36. [gated 2026-11-04 checkpoint] Counts agree in number in FR and EN (« 1 erreur bloquante », « 2 erreurs
|
||||
bloquantes »), through one plural mechanism, every editor count string included.
|
||||
37. [gated 2026-11-04 checkpoint] Leading and trailing spaces are removed from names and simple single-line labels
|
||||
before they are committed; descriptions, notes, citations, URLs, SVG content and secrets are never altered.
|
||||
38. [gated 2026-11-04 checkpoint] Mode precedence: rights, then the sheet's state (inactive, historical, frozen),
|
||||
then the screen width; server checks keep the last word.
|
||||
39. [gated 2026-11-04 checkpoint] « Utiliser l'illustration de la vue parente » is kept, explicit (a confirmation
|
||||
naming its effect) and non-destructive (undoable; the stored drawing is not deleted).
|
||||
40. [gated 2026-11-04 checkpoint] Default tab at opening: Général for a new, empty sheet; Annotations for an
|
||||
existing sheet with at least one measurable view; read-only modes kept.
|
||||
[amended 2026-11-05, U0, §17.12] Same rule on the four tabs of C3: Annotations now also holds the views and
|
||||
drawings, so a sheet without a measurable view still opens on Général and reaches the drawing upload from
|
||||
Annotations.
|
||||
41. [gated 2026-11-04 checkpoint] Attaching a drawing to an unmeasured view whose annotations would fall out of the
|
||||
new frame no longer forces their deletion: the attachment and the repairs are prepared in a temporary state
|
||||
and validated atomically by the Rust core (one commit, nothing kept on refusal). A new Rust operation, if one
|
||||
is indispensable, is presented (design and impact) to the owner before it is built.
|
||||
42. [gated 2026-11-04 checkpoint] « Ajouter une catégorie » creates at the root of the findings tree whatever the
|
||||
selection; inserting under an element has its own explicit action.
|
||||
43. [gated 2026-11-04 checkpoint] A voluntary sign-out with unsaved changes or local copies warns of the loss and
|
||||
asks for confirmation; once confirmed, that account's local copies are purged. After an involuntary session
|
||||
end, a copy is never exposed to another account; only the same user may recover it.
|
||||
44. [gated 2026-11-04 checkpoint] New FR/EN labels stay proposals for a separate review; the verifier's 33/34 is
|
||||
reconciled with the contract-order run, and 34/34 is stated only if a fresh verification confirms it; the
|
||||
owner trial guide's commands are run from `/home/bchanot/Documents/faunosteo-v1-2` (local URL
|
||||
`http://127.0.0.1:5193`, SSH tunnel documented), no DEV, no DEV worker, no merge, no V1-2.7.
|
||||
45. [gated 2026-11-04 final] Free paths in the repair dialog: never replaced by a triangle or any automatic
|
||||
shape; every original vertex kept; out-of-frame vertices identified and corrected explicitly only when the core
|
||||
allows it; attach and corrections validated atomically; cancel loses nothing; an invalid geometry is never saved
|
||||
or submitted. Without a core operation for it, no TypeScript path parser or rival validation: the attach is
|
||||
refused cleanly with the document unchanged, and the minimal core evolution is presented to the owner before it
|
||||
is built. Non-regression test with a complex free path and several vertices outside the frame.
|
||||
46. [gated 2026-11-04 final] « Ajouter une catégorie » never depends on the selected node: it creates a category on
|
||||
the first level directly under a zone of the business model, the zone chosen explicitly; adding child findings
|
||||
stays a separate explicit action. (Owner confirms « root » = that first level.)
|
||||
47. [gated 2026-11-04 final] The owner trial is reachable from the trusted LAN at http://192.168.1.100:5193 without a
|
||||
tunnel: the app server bound to 192.168.1.100 only (never 0.0.0.0), the browser's Supabase URL is that origin
|
||||
(Auth, REST, Storage proxied to the loopback trial gateway, no other port opened), Vite host check limited to
|
||||
that address, Supabase DEV and its ports 54321-54324 untouched, no production configuration changed, no
|
||||
Internet exposure; authentication, MFA and RLS unchanged; the journey (sign-in, MFA, catalogue, SVG import,
|
||||
save) checked through that address; the guide gives the address and exact start/stop commands.
|
||||
48. [gated 2026-11-04 final] Final controls: affected tests, restore/conflict/non-destruction of annotations,
|
||||
historical documents unchanged, an independent verification of criteria 23 and 34 on a written final report, a
|
||||
security review of the final changes; « 34/34 » stated only when established.
|
||||
|
||||
## FILE SCOPE
|
||||
|
||||
- apps/app/src: new editor module (route, state, canvas, tabs, dialogs), App.tsx route, AdminSheetRoute and the
|
||||
creation / working-copy landing, AppLayout width for the editor page, i18n fr.ts / en.ts, core wrappers
|
||||
(editable preview, `sheet.edit`, `sheet.dependents`, `clean_svg`), lib/id.ts or an editor id module
|
||||
- apps/app/tests/unit: editor tests; apps/app/e2e/shell: editor specs and support helpers; e2e fixtures
|
||||
- packages/supabase/src: sheet asset register / upload / confirm accessors and kinds, exports, unit tests
|
||||
- packages/core-wasm/src: a TS wrapper only if the glue needs one (no Rust change planned)
|
||||
- docs: BROWSER_TESTS.md, V1-2 contract state lines (§16.7) and §13 residual risks (AAL2 line, [gated 2026-11-03]),
|
||||
ANNOTATION-RENDERING.md editor overlay section, design README / REVUE pointers, owner test
|
||||
procedure, label proposals under .claude/audits
|
||||
- .claude/tasks (plan, TODO), .claude/memory (through memory.sh)
|
||||
- [amended 2026-11-04, each file required by a gated criterion or the approved plan; to confirm at the owner
|
||||
checkpoint] apps/app/src/components/shell/{SignOutButton,SignOutLossDialog}.tsx and
|
||||
apps/app/src/app/usePurgeForeignCopies.ts (C43); apps/app/src/catalogue/{catalogue,useFraming}.ts,
|
||||
apps/app/src/components/catalogue/CatalogueCanvas.tsx, apps/app/src/components/admin/WorkingCopyAction.tsx,
|
||||
apps/app/src/components/ui/Icon.tsx, apps/app/src/state/persistence.ts, apps/app/src/admin/labels.ts (C1, C7,
|
||||
C11, C13, C16, C17 reuse); apps/app/vite/trial.config.ts, scripts/db-sandbox.sh, docs/development/SUPABASE.md
|
||||
(plan choice 7, C25); supabase/tests/023_sheet_draft_last_save.sql (M8 pgTAP); packages/supabase/tests/sandbox/**
|
||||
and apps/app/e2e/playwright.shell.config.ts (C20, C22); [amended 2026-11-04 after the owner's approval of a09e24d] apps/app/e2e/playwright.lan.config.ts and
|
||||
apps/app/e2e/lan/** (C47: the LAN trial check); apps/app/tests/helpers/** (the unit tests' editor harness, C20)
|
||||
- NOT in scope: crates/**, supabase/migrations/** (except a read migration if the owner chooses it),
|
||||
supabase/seed/**, legacy sources, goldens, oracles
|
||||
@@ -0,0 +1,39 @@
|
||||
# CONTRACT: V1-2.6 maquettes, final graphic corrections (owner brief of 2026-11-05, after the external review)
|
||||
|
||||
- REQUEST (owner brief « Revue finale des nouvelles maquettes UX V1-2.6 », 2026-11-05, with the external report
|
||||
`faunosteo-v1-2-6-revue-ux-chatgpt.md`): fix the five documented graphic defects; keep the validated « + » / « − »
|
||||
on the polygon and vertex dragging by mouse or finger; do not redraw other boards needlessly; integrate the eleven
|
||||
recommendations as proposals to ratify, separating owner-confirmed decisions from open ones; no recommendation
|
||||
becomes an implementation authorisation; regenerate the affected boards, the contact sheet, the documents and the
|
||||
checksums; targeted independent graphic check; corrected archive. STOP at the final graphic checkpoint.
|
||||
- ACCEPTANCE CRITERIA:
|
||||
- K1 Board 04: the trace actions (Terminer, Retirer le dernier sommet, Abandonner) sit in a fixed strip outside the
|
||||
drawing; no vertex or segment of the trace is covered, at any zoom.
|
||||
- K2 Undo / redo: one global place in the editor header, visible on every tab (the boards of Général, Annotations
|
||||
and Constats show it); board 06 shows it in both states; no floating undo / redo pair remains on the drawing of
|
||||
any editor board (desktop, tablet, phone); the « … déplacé · Annuler » toast after a gesture may stay.
|
||||
- K3 Board 07: the new-category form is fully visible (frame and « Ajouter »).
|
||||
- K4 Board 07: one dominant interaction per state; the fixed-category editor, the « ⋮ » menu of a custom category
|
||||
with its editor, and the new-category form are distinct states; nothing hides a field or a counter.
|
||||
- K5 Boards 07 and 09: every annotation counter equals the example data (`supabase/seed/anatomical-sheets/equine/
|
||||
draft/document.json`), computed in the source, not typed; one counting rule across all boards.
|
||||
- K6 Board 05 keeps « + » at segment midpoints, the « − » bubble on the chosen vertex and vertex dragging; boards 13,
|
||||
14 A keep their touch handles.
|
||||
- K7 Boards whose content needed no change are byte-identical to `d21ffcc`; any other regenerated board differs only
|
||||
by K1-K5 (header undo / redo, counters, board 04 strip, board 06 header, board 07 states).
|
||||
- K8 Documents: `ARBITRAGES.md` lists the eleven choices with the external recommendation and its safeguards, each
|
||||
marked « confirmé par le propriétaire » or « ouvert, à ratifier »; no recommendation is presented as an
|
||||
implementation authorisation; `ETUDE-TECHNIQUE.md` keeps the protections (historical sheets, fingerprints, Rust
|
||||
core, PDF, worker) and lists the prerequisites before any development; `REVUE.md`, `CONTROLE-CONFORMITE.md`,
|
||||
`docs/design/README.md` match the corrected boards; the contact sheet shows the corrected boards.
|
||||
- K9 Corrected archive with the 16 boards, contact sheet, sources and resources, documents, external report and a
|
||||
`SHA256SUMS` verified after extraction; the archive sent for review earlier is not overwritten.
|
||||
- FILE SCOPE: `docs/design/v1-2-6/**`, `docs/design/README.md`, `.claude/tasks/TODO.md`, `.claude/memory/journal.md`,
|
||||
this contract; the archive outside the repository.
|
||||
- CLARIFICATIONS: owner-confirmed in the brief: the direction (SVG-centred editor, direct manipulation of points and
|
||||
polygons, graphic detail views, categories from Annotations), « + » / « − » on the polygon and vertex dragging, the
|
||||
global undo / redo in the header on every tab. Every other choice stays open. Ratified decisions in force (O14 A,
|
||||
§8.3, §8.2, §7.4) are unchanged until the owner decides otherwise.
|
||||
- OUT OF SCOPE: any change under `crates/`, `apps/`, `packages/`, `supabase/`; SQL; worker; Supabase DEV; merge;
|
||||
deploy; V1-2.7; implementation of the new editor.
|
||||
- ABANDON: if a fix needs a change outside the file scope, stop and report.
|
||||
@@ -0,0 +1,38 @@
|
||||
# CONTRACT: V1-2.6 new editor UX maquettes (owner brief of 2026-11-05)
|
||||
|
||||
- REQUEST (owner brief 2026-11-05, « V1-2.6 : nouvelles maquettes UX approuvées sur le principe »): replace a too
|
||||
technical editor by a graphic editor built on direct manipulation of the SVG; desktop and mobile mockups, contact
|
||||
sheet, individual boards and sources; audit feasibility with the current Rust core. A UX design, not an
|
||||
implementation. STOP at the graphic checkpoint.
|
||||
- ACCEPTANCE CRITERIA:
|
||||
- U1 Navigation: four tabs Général, Annotations, Constats, Vérification; views, drawings and vertebral settings
|
||||
inside Annotations; references reachable from a secondary surface.
|
||||
- U2 Categories: Os, Articulations, Vertèbres always present and not deletable, colour and opacity editable;
|
||||
custom categories added, edited, deleted in a folding panel of Annotations; « Ajouter une catégorie » during
|
||||
point or zone creation opens that panel; palette + opacity with synchronised values; annotations inherit their
|
||||
category's look.
|
||||
- U3 Direct editing: Point and Zone tools; points and zones moved on the drawing; radius by slider; no coordinate
|
||||
shown in the normal UI.
|
||||
- U4 Polygons: vertices on selection, vertex drag, + at segment midpoints, − bubble on a clicked vertex, whole-zone
|
||||
move in an explicit mode, redraw tool, undo/redo for all of it; curves keep their control points (no destructive
|
||||
simplification).
|
||||
- U5 Touch: equivalent finger interactions on tablet and phone, handles sized for touch.
|
||||
- U6 Detail views: tool, rectangle on the drawing, FR/EN name proposed, derived view framed, annotatable; no
|
||||
`viewBox` numbers shown; replacement by a specific SVG; vector quality preserved.
|
||||
- U7 Vertebrae: no standalone tab; « Configurer les régions vertébrales » from the Vertèbres category; regions,
|
||||
codes, counts, ranges and rules kept.
|
||||
- U8 Général simplified; controlled prefill of « Périmètre et limites » from a common text that never erases
|
||||
sheet-specific legal or anatomical text.
|
||||
- U9 Boards desktop and mobile for: main editor; point create + modify; zone create; polygon selection with +/−;
|
||||
zone move and redraw; categories and colours; detail view by selection; vertebral regions; error, read-only and
|
||||
save states.
|
||||
- U10 Identity kept (tokens, Step 7 shell, V1-2.4 components); contact sheet, individual PNGs and sources in
|
||||
`docs/design/v1-2-6/`, easy to open.
|
||||
- U11 Feasibility audit against the current Rust core: missing operations named (vertex editing, path editing,
|
||||
derived views, categories model), contradictions with ratified decisions listed for the owner.
|
||||
- FILE SCOPE: `docs/design/v1-2-6/**`, `docs/design/README.md`, `.claude/audits/2026-11-05-v1-2-6-*.md`,
|
||||
`.claude/tasks/TODO.md`, `.claude/memory/journal.md`, this contract.
|
||||
- CLARIFICATIONS: the TOTP-at-sign-in track and the missing equine illustrations stay separate tracks, outside this
|
||||
contract. Mockups are proposals until the owner validates them.
|
||||
- OUT OF SCOPE: any change under `crates/`, `apps/`, `packages/`, `supabase/`; Supabase DEV; merge; V1-2.7.
|
||||
- ABANDON: if a criterion needs a change to code, SQL or the worker, stop and report instead of changing it.
|
||||
@@ -0,0 +1,69 @@
|
||||
# CONTRACT: V1-2.6 UX, owner ratification of the technical decisions recorded in the docs (2026-11-05)
|
||||
|
||||
- REQUEST (owner brief « FAUNOSTEO — V1-2.6 UX — Ratification des décisions techniques », 2026-11-05): record the
|
||||
owner's answers to T11, T16, T2/T3, T4, T5, T9/T10 and T12 in `docs/development/V1-2-6_UX_DECISIONS.md` and the
|
||||
associated documents; update risks, dependencies, blocking criteria and tests; add the wasm measuring learning to
|
||||
the learnings registry, its wording checked against the size test really in the repository; independent review;
|
||||
exact verdict and remaining blocking points. Documentation only; stop at the final technical checkpoint. The
|
||||
validated UX choices are not reopened.
|
||||
- OWNER ANSWERS (summary of the brief):
|
||||
- T11 approved: stop the complementary trials of the old UX; keep the anomalies and the untested items in
|
||||
tracking; never declare the old V1-2.6 fully validated.
|
||||
- T16 conditional deferral: defer curve handle editing only if the audit confirms that no existing curved
|
||||
annotation and no journey available today needs it; guarantee exact geometry; prevent any destructive
|
||||
conversion; record full curve editing in an identified future lot.
|
||||
- T2/T3 agreement in principle, conditional on proofs: optional fields in schema v2, omitted when absent, never
|
||||
serialised as null by default; fill opacity 10 to 100 %; controlled widening of the snapshot reader;
|
||||
demonstrate effects on fingerprints, Rust, SQL, PDF, worker, N-1 reader, R3/R4 and BDR-068; document that the
|
||||
old application cannot be returned to after the new fields are written; never call it full backward
|
||||
compatibility.
|
||||
- T4 no residual gap allowed: define the fixed-category checks in the core and at the appropriate server
|
||||
boundaries for save and publication; do not enable writing the new model before the necessary checks exist;
|
||||
progressive rollout or functional lock if needed.
|
||||
- T5 historical preservation: keep ids, names, colours, particular annotations and fingerprints of the historical
|
||||
equine versions; role adaptation only on a working copy; test the conversion without mutating the originals.
|
||||
- T9 explicit choice when an SVG is replaced: keep positions only if the framing is compatible and the checks
|
||||
pass; reposition when the operation is safely supported; cancel without any change; no approximate automatic
|
||||
transformation.
|
||||
- T10 automatic access: prefer a system navigation type distinct from the visible anatomical taxonomy; check the
|
||||
existing schema constraints before choosing an internal id or category; never categorise it arbitrarily as Os,
|
||||
Articulations or Vertèbres.
|
||||
- T12: principle of one versioned copy kept; final legal text, source and validation still to be supplied; U7
|
||||
delivers no invented or unapproved normative text.
|
||||
- Wasm learning: margin measured with the exact method of the budget test (Node gzipSync with the same
|
||||
parameters), never a system gzip; reference 592 143 B for a limit of 600 000 B, margin 7 857 B; measure after
|
||||
each core change; never raise the ceiling silently.
|
||||
- ACCEPTANCE CRITERIA:
|
||||
- K1 T11: DECISIONS records the approval; level 1 explicitly not declared validated; the anomalies and untested
|
||||
items are listed with their sources and tracked in `.claude/tasks/TODO.md`.
|
||||
- K2 T16: the audit evidence is present and exact (counts and file:line hold in the code); the guarantee of exact
|
||||
geometry and of no conversion is written, with tests; any limit of the audit is stated rather than hidden; the
|
||||
future lot is identified in TODO.md with its dependency rule; stale « U9 in V1-2.6 » wording is gone outside
|
||||
historical records.
|
||||
- K3 T2/T3: the serialisation rule, the 10-100 range and a bounded definition of the snapshot widening are
|
||||
written; a proof is listed for each of fingerprints, Rust, SQL, PDF, worker, N-1, R3/R4, BDR-068; the
|
||||
impossibility of returning to the old application is documented; no text calls the change full backward
|
||||
compatibility (or equivalent) without that qualifier.
|
||||
- K4 T4: checks are defined in the core and at server boundaries for both save and publication; no residual gap
|
||||
is accepted silently (any remaining choice is stated as an open owner question); writing the new model is gated
|
||||
on the checks being live (order or lock written).
|
||||
- K5 T5: the preservation list, the working-copy-only rule and a conversion test that proves the originals
|
||||
unchanged are written.
|
||||
- K6 T9: the three actions with their conditions are written; no automatic or approximate transformation remains
|
||||
anywhere in the docs.
|
||||
- K7 T10: the schema constraints are checked with evidence before a choice; the choice is a navigation type or
|
||||
internal category outside the visible taxonomy; nothing assigns the access to Os, Articulations or Vertèbres; an
|
||||
unratified part is stated as open.
|
||||
- K8 T12: U7 is blocked until the text, its source and its validation exist; no normative wording is written.
|
||||
- K9 The learnings registry holds the wasm entry, written through `memory.sh`; its wording matches
|
||||
`packages/core-wasm/tests/size.test.ts` (call, parameters, file, limit, comparison) and the figures.
|
||||
- K10 Risks, dependencies, blocking criteria and tests are updated and consistent with K1-K9.
|
||||
- K11 No contradiction across the five docs, TODO.md and BDR-100 (superseded recommendations are marked as
|
||||
withdrawn, not left active).
|
||||
- K12 Scope: the change set touches only the FILE SCOPE; no validated UX choice is reopened.
|
||||
- FILE SCOPE: `docs/development/V1-2-6_UX_{DECISIONS,COMPATIBILITY,TESTS,RISKS,PLAN}.md`, `.claude/tasks/TODO.md`,
|
||||
`.claude/memory/{learnings,decisions,journal}.md` (through `memory.sh`), this contract.
|
||||
- OUT OF SCOPE: any change under `crates/`, `apps/`, `packages/`, `supabase/`, `scripts/`; SQL; worker; Supabase
|
||||
DEV; contract amendments of U0 (`V1-2_ANATOMICAL_SHEETS.md`, the level-1 contract, `.claude/rules/`); merge;
|
||||
deploy; V1-2.7; any implementation sub-step.
|
||||
- ABANDON: if a criterion needs a change outside the file scope, stop and report.
|
||||
@@ -0,0 +1,63 @@
|
||||
# CONTRACT: V1-2.6 UX, sub-step U0 (contract, decisions and amendments, docs only) (2026-11-05)
|
||||
|
||||
- REQUEST (owner brief « FAUNOSTEO — V1-2.6 UX — Autorisation U0 uniquement », 2026-11-05): start U0 and U0 only,
|
||||
after the pending doc corrections are verified and committed. The UX choices and the 16 V2 boards are approved
|
||||
for good; no graphic arbitration is reopened. Record the complementary ratification (A), run U0 as defined in
|
||||
`docs/development/V1-2-6_UX_PLAN.md` §3 U0 (docs, contract, preconditions, non-destructive checks), stop at the U0
|
||||
checkpoint. No merge, no deploy, no DEV access or write, no U1, no V1-2.7. Owner brief « FAUNOSTEO — V1-2.6 UX —
|
||||
Finalisation de U0 uniquement » (2026-11-05, after the ratification was verified CONFORME at `a505b24`): finish the
|
||||
uncommitted U0 work without overwriting it (main contract sections, level-1 criteria, five UX docs, BDR-101, TODO),
|
||||
check every cross-reference, independent review, commit and push only the planned docs, stop at the U0 checkpoint.
|
||||
- OWNER ANSWERS (brief A):
|
||||
- T4: both declared SQL checks approved: at save, protect the uniqueness of the fixed categories, their roles and
|
||||
their presence without blocking old drafts that carry none of these keys; at approval and publication,
|
||||
guarantee the model's invariants whatever the worker does. O22 amended strictly for these invariants; the core's
|
||||
validation is not duplicated in SQL.
|
||||
- T5: new-sheet ids `cat-bone`, `cat-joint`, `cat-vertebra`; the validated French names kept; the English names
|
||||
and the exact reference colours documented from the existing data; historical sheets and their fingerprints
|
||||
fully preserved.
|
||||
- T10: option B: internal category `cat-access`, role `navigation`, not visible as an anatomical category;
|
||||
automatic access conditional on U6.
|
||||
- T15: « Annuler la dernière modification » for the history; « Abandonner » or « Abandonner les modifications »
|
||||
for a form.
|
||||
- T16: deferral of curve editing kept; a check of the existing geometries planned before any activation of the
|
||||
new model, with no DEV access during U0.
|
||||
- T12: U7 stays blocked until the source and the legal content are validated.
|
||||
- T17: its exact wording read and presented, no decision invented; stop only if it really blocks U0.
|
||||
- T1/T6: conditions and deadlines already documented kept.
|
||||
- « Remplacer par un polygone »: kept only as an explicit replacement, validated, the old path kept until
|
||||
success, undo and redo supported; no automatic destructive conversion.
|
||||
- ACCEPTANCE CRITERIA:
|
||||
- U1c Each answer above is recorded once (`V1-2-6_UX_DECISIONS.md` and the contract's new §17.12) and cited where
|
||||
it applies; BDR-101 written through `memory.sh`; BDR-100's open items marked answered through `memory.sh status`.
|
||||
- U2c O22 (`V1-2_ANATOMICAL_SHEETS.md` §12.2 and the §17.1 row) amended strictly: the two declared checks hold only
|
||||
the fixed-category invariants (each role `bone`, `joint`, `vertebra` carried by exactly one category with its
|
||||
fixed FR and EN names; at save: no regression of the stored draft's roles, role-less drafts still save); no other
|
||||
rule mirrored; `.claude/rules/sheet-model.md` says the same.
|
||||
- U3c §7.4 records the one-time copy of a versioned common text and the T12 block, with no normative wording.
|
||||
- U4c §8.2, §8.3, §8.4 match the validated UX and the decisions: four tabs, direct manipulation, no coordinate
|
||||
field in the normal journey, crop rectangle drawn, fixed categories and opacity at U6, own colour shown when
|
||||
set, access placed from the view's menu (automatic at U6 with `cat-access`), curves per T16 with the
|
||||
« Remplacer par un polygone » guarantee, O14 A kept, the tablet rule.
|
||||
- U5c §16.7 states the level-1 status (T11, not validated as a whole) and the redesign sub-steps; the withdrawal
|
||||
rule of §6.4 is precise about draft rounds, matching T4 and the code.
|
||||
- U6c Level-1 contract criteria C3, C4, C6, C7, C8, C13, C32, C33, C40 amended in place (original text kept, an
|
||||
amendment note appended), the immutable REQUEST untouched; no contradiction with the boards or the contract.
|
||||
- U7c `docs/design/README.md`: v1-2-6 validated, its boards replace v1-2-4 boards 04 and 05 for the editor
|
||||
(BDR-096 kept for the rest).
|
||||
- U8c `.claude/rules/schemas.md` and `sheet-model.md`: optional category keys under T2 (omitted when absent, never
|
||||
null, no version bump, proof list), rules also in `edit.rs` and `sheet_report`.
|
||||
- U9c The implementer decisions (T7, T8, T13, T18, T19) recorded in the contract.
|
||||
- U10c The five UX docs, RISKS blocking criteria, TODO.md and the journal agree with U1c-U9c; nothing answered is
|
||||
still called open or « to confirm »; T17, T1, T6, T12, T14 stay open with their conditions.
|
||||
- U11c Facts cited for T5 (names, colours) and the « Remplacer par un polygone » guarantee hold in the data and
|
||||
the code (file:line).
|
||||
- U12c Scope: no change under `crates/`, `apps/`, `packages/`, `supabase/`, `scripts/`; no SQL, worker, sandbox or
|
||||
DEV command; no merge.
|
||||
- FILE SCOPE: `docs/development/V1-2_ANATOMICAL_SHEETS.md`, `docs/development/V1-2-6_UX_{DECISIONS,PLAN,COMPATIBILITY,
|
||||
TESTS,RISKS}.md`, `docs/design/README.md`, `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md`,
|
||||
`.claude/rules/{sheet-model,schemas}.md`, `.claude/tasks/TODO.md`, `.claude/memory/{decisions,journal}.md`
|
||||
(through `memory.sh`), this contract.
|
||||
- OUT OF SCOPE: code, SQL, worker, Supabase DEV, sandbox, `docs/design/v1-2-6/*` (archived boards and their notes),
|
||||
`ANNOTATION-RENDERING.md` and `ANATOMICAL_SHEET_MODEL.md` (U6), U1 and later, V1-2.7.
|
||||
- ABANDON: if a criterion needs a change outside the file scope, stop and report.
|
||||
@@ -0,0 +1,154 @@
|
||||
# CONTRACT — v1-2-6-findings-nav-decisions
|
||||
- date: 2026-11-06 | flow: design checkpoint preparation (docs only) | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the
|
||||
`supabase_*_faunosteo` containers are DEV; no sandbox needed)
|
||||
- base: 567da67 (complement after the verifier's CONFORME 9/9, trigger name per the core). Commit in place, push; no
|
||||
merge, no `gitflow.sh finish`.
|
||||
- context: follows `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md` (complement design, verdict
|
||||
CONFORME 9/9 on round 3, before 567da67). The U1 plan and contract stay as committed at 2e46c14.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — Validation de principe U2b et préparation des checkpoints
|
||||
|
||||
Le propriétaire approuve le principe de la navigation bidirectionnelle entre annotations et constats.
|
||||
|
||||
## 1. Placement
|
||||
|
||||
Retenir une sous-étape U2b « Annotations et constats », après U2 et avant U3, avec son propre contrat, ses tests et son checkpoint.
|
||||
|
||||
Ne pas modifier le plan U1 si les points d'intégration déjà prévus suffisent réellement.
|
||||
|
||||
Ne pas commencer l'implémentation de U2b.
|
||||
|
||||
## 2. Décisions enregistrables
|
||||
|
||||
F1 : placement U2b approuvé.
|
||||
|
||||
F2 : les compteurs portent sur les constats réels à toute profondeur, sans compter les conteneurs de familles et sans doublonner les constats associés à une même zone par plusieurs annotations.
|
||||
|
||||
F3 : recherche instantanée, insensible aux accents et à la casse. La liste exacte des champs recherchés doit être présentée avant ratification complète.
|
||||
|
||||
F4 : filtres texte et anatomiques combinés par intersection ; plusieurs zones anatomiques sélectionnées produisent une union sans doublon. Présenter la sémantique complète du filtre par vues avant ratification.
|
||||
|
||||
F6 : sous 1 024 px, consultation et filtres par liste, aucune édition graphique.
|
||||
|
||||
F7 : « Famille » désigne les familles de constats, distinctes des catégories anatomiques.
|
||||
|
||||
F8 : l'association d'une annotation dépourvue de zone passe par une opération logique atomique, validée et annulable, sans doublon silencieux.
|
||||
|
||||
Lorsqu'une annotation est sélectionnée et que l'utilisateur ajoute un constat, préselectionner sa zone de rattachement. Ne pas imposer une seconde sélection inutile.
|
||||
|
||||
## 3. Décisions non encore ratifiées
|
||||
|
||||
Préparer une table complète F1 à F21, reproduisant pour chacune :
|
||||
- Le libellé exact.
|
||||
- Les alternatives.
|
||||
- La recommandation.
|
||||
- Les conséquences techniques.
|
||||
- L'état : approuvé, partiellement approuvé ou à décider.
|
||||
|
||||
Ne pas convertir automatiquement les recommandations F5 et F9 à F21 en décisions du propriétaire.
|
||||
|
||||
## 4. Apprentissage React
|
||||
|
||||
Ajouter au registre d'apprentissages la distinction entre la conservation de l'état et la remise en route des effets avec React 19.2 `<Activity>`.
|
||||
|
||||
Documenter l'impact possible sur useFraming et FindingTree.
|
||||
|
||||
Ne pas généraliser l'interdiction de `<Activity>`.
|
||||
|
||||
## 5. Complément graphique
|
||||
|
||||
Conserver les six planches 17 à 22 comme proposition de conception U2b.
|
||||
|
||||
Fournir un moyen simple de les revoir avec les décisions F1 à F21.
|
||||
|
||||
Ne pas déclarer une nouvelle conformité indépendante après les modifications effectuées postérieurement au verdict CONFORME 9/9 sans vérification supplémentaire.
|
||||
|
||||
## 6. Plan U1
|
||||
|
||||
Préserver le plan U1 existant au commit 2e46c14.
|
||||
|
||||
Présenter son bilan de conception et les résultats des trois relecteurs indépendants, avec les éventuels blocages restants.
|
||||
|
||||
Ne pas engager l'implémentation U1 avant le checkpoint d'autorisation correspondant.
|
||||
|
||||
## 7. Restrictions
|
||||
|
||||
Documentation et conception uniquement pour cette intervention.
|
||||
|
||||
Aucune modification applicative, Rust, SQL ou worker.
|
||||
|
||||
Aucune opération sur Supabase DEV.
|
||||
|
||||
Aucune fusion, aucun déploiement et aucun début de V1-2.7.
|
||||
|
||||
S'arrêter au prochain checkpoint documentaire.
|
||||
|
||||
## CLARIFICATIONS
|
||||
(none; owner questions stay in the study's section 7)
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Placement (request 1): `docs/development/V1-2-6_UX_PLAN.md` §3 lists a sub-step « U2b · Annotations et constats »
|
||||
between U2 and U3, stating its own contract, tests and owner checkpoint, that it starts only on a new owner
|
||||
authorisation, and pointing to the study; the study's section 4 records F1 as approved; the study's section 3
|
||||
re-checks, with line references to the U1 plan, that the integration points already planned suffice, and proposes
|
||||
no U1 amendment.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "^### U2b · Annotations et constats" docs/development/V1-2-6_UX_PLAN.md && awk '/^### U2 ·/{a=NR} /^### U2b ·/{b=NR} /^### U3 ·/{c=NR} END{exit !(a<b && b<c)}' docs/development/V1-2-6_UX_PLAN.md && echo U2B_PLACED
|
||||
EXPECT: U2B_PLACED
|
||||
EVIDENCE: MET exit=0 marker-found :: U2B_PLACED
|
||||
2. U1 preserved (request 6): the U1 plan and contract are byte-identical to 2e46c14, in the commits and in the
|
||||
working tree.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 2e46c14 -- .claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md .claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md && echo U1_UNCHANGED
|
||||
EXPECT: U1_UNCHANGED
|
||||
EVIDENCE: MET exit=0 marker-found :: U1_UNCHANGED
|
||||
3. Decision table (request 3): the study's section 7 holds one row per decision F1 to F21, each with the question as
|
||||
the study worded it, the alternatives, the recommendation, the technical consequences and a state among
|
||||
« approved », « partially approved », « to decide »; F1, F2, F6, F8 approved and F7 approved for the term
|
||||
« Famille », with the owner's sentence quoted verbatim; F3 and F4 partially approved, with the approved part quoted
|
||||
and the part left to ratify named; F5 and F9 to F21 « to decide »; the owner's sentence on the preselected zone is
|
||||
recorded verbatim as an approved decision; every recommendation changed since commit 567da67 is flagged as changed.
|
||||
4. F2 precision: the study flags that « constats réels » may exclude intermediate group nodes, gives both counts on
|
||||
the equine draft (all nodes and leaves only: total, grasset, the boards' searches), cites the practitioner picker
|
||||
rule (only leaves are ticked) and leaves the choice to the owner.
|
||||
5. F3 field list (request 2): the study lists every text field of zones, families and findings, plus descriptions,
|
||||
references, ids, annotation names, kind labels, review status and the vet flag, each with searched or not
|
||||
(recommendation), its alternative and its effect on the equine draft computed from `document.json`; it states the
|
||||
normalisation, the word rule and the language rule.
|
||||
6. F4 semantics (request 2): the study states the complete semantics of the view filter: what the state holds, what
|
||||
chosen views do with and without picked annotations, picks across views, deselecting a view, detail triggers,
|
||||
annotations without zone, a zone shown by several annotations, combination with the text, partial clears, the
|
||||
keyboard and narrow lists, document changes (undo), read-only modes; with at least one alternative model and
|
||||
examples computed from the equine draft.
|
||||
7. Learning (request 4): a learnings entry written through `memory.sh` distinguishes state kept from effects re-run
|
||||
under `<Activity>` (React 19.2), names `useFraming.ts:69` and `FindingTree.tsx:31-33` with their impact, and does
|
||||
not forbid `<Activity>` in general.
|
||||
8. Boards (request 5): the PNG boards 17 to 22 and the contact sheet are byte-identical to 567da67; the study's
|
||||
section 7.4 shows the six boards (Markdown images, any preview) each with the ids of the decisions whose « Boards »
|
||||
column names it, consistent with that column, and no second copy of the decisions' content (amended 2026-11-06
|
||||
before verification: a generated HTML page needed a script, refused outside a skill run); `REVUE.md` says the
|
||||
CONFORME 9/9 verdict predates 567da67 and does not cover it, and claims no conformity for this intervention
|
||||
beyond the verdict of criterion 11.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 567da67 -- 'docs/design/v1-2-6-constats/*.png' && echo BOARDS_UNCHANGED
|
||||
EXPECT: BOARDS_UNCHANGED
|
||||
EVIDENCE: MET exit=0 marker-found :: BOARDS_UNCHANGED
|
||||
9. Registries: the owner's approved decisions recorded in one decisions entry (no recommendation recorded as
|
||||
decided), a journal line, the TODO line of the complement updated; all through `memory.sh` except TODO.md.
|
||||
10. Constraints (request 7): no change under `apps/`, `crates/`, `supabase/`, `packages/`, `scripts/`,
|
||||
`docs/design/v1-2-6/`; untracked review files never staged; no DEV, no merge, no V1-2.7.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 567da67 -- apps crates supabase packages scripts docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo FD_SCOPE_OK
|
||||
EXPECT: FD_SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: FD_SCOPE_OK
|
||||
11. A fresh independent verifier against this contract, covering the 567da67 delta (board 19 C trigger name, F7
|
||||
citation, REVUE text) and this intervention; justified gaps fixed; exact verdict reported. STOP at the
|
||||
documentary checkpoint.
|
||||
|
||||
## FILE SCOPE
|
||||
- docs/development/V1-2-6_UX_FINDINGS_NAV.md, docs/development/V1-2-6_UX_PLAN.md (U2b entry and order line),
|
||||
docs/development/V1-2-6_UX_DECISIONS.md (one pointer line)
|
||||
- docs/design/v1-2-6-constats/REVUE.md, docs/design/README.md (the complement's pointer line)
|
||||
- .claude/tasks/TODO.md, this contract, .claude/memory (through memory.sh)
|
||||
- NOT in scope: apps/**, crates/**, supabase/**, packages/**, scripts/**, docs/design/v1-2-6/**, the PNG boards, the
|
||||
U1 plan and contract, the V1-1 checkout
|
||||
@@ -0,0 +1,125 @@
|
||||
# CONTRACT — v1-2-6-findings-nav-design
|
||||
- date: 2026-11-06 | flow: design complement (docs and mockups only) | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the
|
||||
`supabase_*_faunosteo` containers are DEV; no sandbox needed for this track)
|
||||
- base: 2e46c14 (U1 contract and challenged plan, awaiting the owner's plan checkpoint). Commit in place, push; no
|
||||
merge, no `gitflow.sh finish`.
|
||||
- context: the U1 plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md` stays as committed; this track may only
|
||||
PROPOSE a named amendment to it, applied after the owner's approval.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
avant, demande de modification ou detail a apporter :
|
||||
|
||||
# FAUNOSTEO — Nouvelle exigence UX : navigation bidirectionnelle entre annotations et constats
|
||||
|
||||
Le propriétaire ajoute une exigence fonctionnelle aux maquettes validées.
|
||||
|
||||
Cette demande ne doit PAS interrompre le plan U1 actuellement en cours, ni provoquer une implémentation prématurée.
|
||||
|
||||
## Fonctionnement souhaité
|
||||
|
||||
### A. Depuis le schéma anatomique
|
||||
|
||||
Lorsqu'un utilisateur sélectionne un point ou une zone du SVG :
|
||||
|
||||
- Afficher les constats associés à cette annotation anatomique.
|
||||
- Permettre d'ajouter un constat depuis cette sélection.
|
||||
- Permettre de modifier les constats existants.
|
||||
- Permettre de gérer leur association anatomique.
|
||||
- Conserver les familles de constats du modèle existant.
|
||||
|
||||
Exemple : sélectionner le grasset affiche les constats associés au grasset.
|
||||
|
||||
### B. Depuis l'onglet Constats
|
||||
|
||||
Ajouter :
|
||||
- Une barre de recherche avec filtrage instantané.
|
||||
- Un compteur de résultats.
|
||||
- Un bouton « Filtrer sur le schéma ».
|
||||
- Un volet permettant de choisir une ou plusieurs vues anatomiques.
|
||||
- La sélection graphique de points ou de zones pour filtrer les constats.
|
||||
- La combinaison du filtre visuel et de la recherche textuelle.
|
||||
- Une action pour réinitialiser les filtres.
|
||||
|
||||
Les filtres sont des états d'interface : ils ne doivent pas modifier ni sauvegarder le document.
|
||||
|
||||
### C. Correspondance anatomique
|
||||
|
||||
Auditer les relations existantes entre annotations, vues, zones de constats et constats.
|
||||
|
||||
Éviter les doublons lorsque plusieurs annotations représentent une même région anatomique.
|
||||
|
||||
Ne pas inventer de nouvelles associations dans le modèle sans démontrer qu'elles sont nécessaires.
|
||||
|
||||
### D. Contraintes
|
||||
|
||||
- Respecter les autorisations existantes.
|
||||
- Préserver le mode lecture seule sur téléphone en V1-2.
|
||||
- Préserver le fonctionnement du cœur Rust et la compatibilité historique.
|
||||
- Rendre les sélections et filtres accessibles au clavier.
|
||||
- Ne pas modifier la structure documentaire sans validation spécifique.
|
||||
|
||||
## Travail demandé
|
||||
|
||||
Après finalisation du plan U1 actuel :
|
||||
|
||||
1. Examiner si l'architecture U1 doit prévoir des points d'intégration pour cette fonctionnalité.
|
||||
2. Identifier dans quelle sous-étape UX elle doit être implémentée, ou proposer une sous-étape dédiée.
|
||||
3. Produire un complément de maquettes ciblé sur ces interactions.
|
||||
4. Documenter les risques techniques et les tests nécessaires.
|
||||
5. S'arrêter à la validation de cette conception complémentaire.
|
||||
|
||||
Aucun code ne doit être modifié pour cette nouvelle fonctionnalité avant approbation.
|
||||
|
||||
Ne pas toucher à DEV, ne pas fusionner et ne pas commencer V1-2.7.
|
||||
|
||||
## CLARIFICATIONS
|
||||
(none yet; owner questions are listed in the study's « Décisions à prendre » section, never answered by the
|
||||
implementer)
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Audit (request C): the study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` states, with file:line references, every
|
||||
existing link between annotations, views, finding zones, finding categories (families), findings, vertebral
|
||||
regions and references, which side holds it and its cardinality, the core rules that check it, and counts from
|
||||
the equine draft document (annotations per zone, zones without annotation, annotations without zone, zones shown
|
||||
by several annotations); a new association in the model is proposed only with a demonstrated need, and flagged as
|
||||
requiring the owner's specific validation.
|
||||
2. Duplicates (request C): the study and the boards say how findings are shown once when several annotations name the
|
||||
same finding zone (both directions: from the drawing and in the schematic filter).
|
||||
3. U1 integration (work item 1): the study says whether U1 needs integration points; any needed one is a named
|
||||
amendment proposal for `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, not applied; the U1 plan and contract
|
||||
are unchanged by this track.
|
||||
4. Placement (work item 2): the study names the sub-step that implements the feature (or a dedicated one), with its
|
||||
dependencies on U1-U6, the files it would touch, whether it needs a Rust core operation (BDR-043, « Rust computes,
|
||||
TypeScript reads ») and the wasm budget effect.
|
||||
5. Boards (work item 3): a targeted complement in `docs/design/v1-2-6-constats/` (HTML source + one PNG per board,
|
||||
rendered with the project's pinned Chromium through the v1-2-6 `render.cjs` pattern), in the validated v1-2-6
|
||||
visual language, covering: A — an annotation selected on the drawing shows its findings by family, add from the
|
||||
selection, edit, manage the association; B — Constats tab with instant search, result count, « Filtrer sur le
|
||||
schéma », a panel choosing one or more views, graphical selection of points or zones, combined text and visual
|
||||
filter, reset; and the states: read-only (rights, frozen) and narrow read-only below 1 024 px, keyboard
|
||||
alternative to the graphical selection, no result, an annotation without finding zone, a zone shown by several
|
||||
annotations. Names and counts come from the equine draft document, computed in the source, never typed.
|
||||
6. Risks and tests (work item 4): the study lists the technical risks (with probability and mitigation) and the tests
|
||||
per kind (unit, core if any, e2e, accessibility, regression) for the feature.
|
||||
7. Constraints: no change under `apps/`, `crates/`, `supabase/`, `packages/`, `scripts/`, `docs/design/v1-2-6/`;
|
||||
filters described as interface state only (no document change, no save); permissions, phone read-only (O14 A),
|
||||
the core and the historical documents unchanged by the design; no V1-2.7 control; the untracked
|
||||
`faunosteo-v1-2-6-revue-ux-chatgpt.md` never staged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 2e46c14..HEAD -- apps crates supabase packages scripts docs/design/v1-2-6 && git diff --quiet -- apps crates supabase packages scripts docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo FN_SCOPE_OK
|
||||
EXPECT: FN_SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: FN_SCOPE_OK
|
||||
8. Every visible choice the design makes beyond the request is listed in the study for the owner (« Décisions à
|
||||
prendre »), with a recommendation; none is presented as decided.
|
||||
9. A fresh independent review of the boards (design) and a fresh verifier against this contract; justified gaps
|
||||
fixed; exact verdicts reported. STOP at the validation of this complementary design.
|
||||
|
||||
## FILE SCOPE
|
||||
- docs/design/v1-2-6-constats/** (new: maquettes.html, PNG boards, contact sheet, REVUE.md)
|
||||
- docs/development/V1-2-6_UX_FINDINGS_NAV.md (new study)
|
||||
- docs/design/README.md (one pointer line to the complement, marked « proposition, non validée »)
|
||||
- .claude/tasks/TODO.md, this contract, .claude/memory (through memory.sh)
|
||||
- NOT in scope: apps/**, crates/**, supabase/**, packages/**, scripts/**, docs/design/v1-2-6/**, the U1 plan and
|
||||
contract, the V1-1 checkout
|
||||
@@ -0,0 +1,108 @@
|
||||
# CONTRACT — v1-2-6-u1-authorisation-checkpoint
|
||||
- date: 2026-11-06 | flow: checkpoint preparation (docs only) | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV; the sandbox is
|
||||
neither started nor reset)
|
||||
- base: a43145a. Commit in place, push; no merge, no `gitflow.sh finish`.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — U1 / U2b — Derniers arbitrages avant implémentation
|
||||
|
||||
Le propriétaire confirme la conception U1 et le placement de U2b entre U2 et U3.
|
||||
|
||||
## A. Décisions U2b
|
||||
|
||||
F2 — Compter uniquement les feuilles sélectionnables de l'arbre des constats, sans les groupes intermédiaires. Les doublons dus à plusieurs annotations d'une même zone doivent être éliminés.
|
||||
|
||||
F3 — Recherche en français et en anglais, sur les noms des zones, familles, groupes et feuilles. Recherche insensible aux accents et à la casse. Tous les mots doivent correspondre, dans n'importe quel ordre, y compris lorsqu'ils apparaissent à différents niveaux de l'arbre.
|
||||
|
||||
F4 — Valider le modèle A. Sans annotation cochée, les vues sélectionnées filtrent les zones représentées. Dès qu'une annotation est cochée, les zones explicitement sélectionnées déterminent le filtre anatomique. Combiner ce filtre avec la recherche textuelle par intersection.
|
||||
|
||||
F8 — Ne jamais créer automatiquement une zone de constats redondante. Une annotation sans zone doit permettre une association explicite à une zone existante ou une création validée. L'opération doit être cohérente, annulable et non destructive. Ne pas fusionner deux constats distincts sur la seule égalité de leurs libellés.
|
||||
|
||||
F22 — Lorsqu'on ajoute un constat depuis une annotation, utiliser sa zone existante comme rattachement par défaut. Toute modification de l'association anatomique passe par une action explicite, sans déplacement silencieux des constats existants.
|
||||
|
||||
Mettre à jour les décisions et les tests U2b concernés.
|
||||
|
||||
## B. Décisions encore ouvertes
|
||||
|
||||
Présenter les questions F5 et F9 à F21 avec leurs libellés exacts et les recommandations correspondantes.
|
||||
|
||||
Ne pas les considérer comme automatiquement approuvées.
|
||||
|
||||
## C. Checkpoint d'autorisation U1
|
||||
|
||||
Le plan U1 au commit 2e46c14 est conservé.
|
||||
|
||||
Présenter maintenant, sans réécrire le plan :
|
||||
|
||||
1. Les 18 choix visibles du plan U1, avec alternatives, recommandation et conséquences.
|
||||
2. Les cinq amendements contractuels exacts.
|
||||
3. Le résultat des trois audits indépendants et la trace de résolution de leurs points majeurs.
|
||||
4. La portée exacte de toute suppression ou réinitialisation de la sandbox prévue dans le lot B1.
|
||||
5. Les critères de validation de chaque lot A à I.
|
||||
|
||||
Prévoir qu'aucune suppression de données, même en sandbox, n'est implicitement autorisée par l'approbation du plan.
|
||||
|
||||
## D. Apprentissage React
|
||||
|
||||
Conserver LRN-119, notamment la distinction entre préservation de l'état et reprise des effets de React Activity, ainsi que le comportement des références DOM lors du masquage.
|
||||
|
||||
## E. Restrictions
|
||||
|
||||
Documentation et arbitrages uniquement.
|
||||
|
||||
Ne pas modifier le code applicatif, Rust, SQL ou worker.
|
||||
|
||||
Ne pas utiliser Supabase DEV.
|
||||
|
||||
Ne pas réinitialiser la sandbox.
|
||||
|
||||
Ne pas fusionner, déployer ni commencer U1, U2 ou U2b.
|
||||
|
||||
S'arrêter à la présentation des dernières décisions nécessaires à l'autorisation d'implémentation U1.
|
||||
|
||||
## CLARIFICATIONS
|
||||
(none)
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. U2b decisions (A): the study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` section 7 records F2, F3, F4, F8 and
|
||||
F22 as approved with the owner's sentences of this REQUEST verbatim, adapts their recommendation and consequences
|
||||
(F2 leaves and identity never by label, F8 explicit link or validated creation and no merge on labels, F22 default
|
||||
zone and no silent move), flags any reading the owner did not state (F22 « par défaut ») and any detail left to
|
||||
the U2b contract; F5 and F9 to F21 stay « to decide »; every figure added is computed from the equine draft under
|
||||
the rule it names.
|
||||
2. U2b tests (A): the study's section 6 lists unit and e2e tests for each of F2, F3, F4, F8 and F22 as decided.
|
||||
3. U1 plan preserved (C): plan and contract byte-identical to 2e46c14.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 2e46c14 -- .claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md .claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md && echo U1_UNCHANGED
|
||||
EXPECT: U1_UNCHANGED
|
||||
EVIDENCE: MET exit=0 marker-found :: U1_UNCHANGED
|
||||
4. Checkpoint page (C1-C5): `docs/development/V1-2-6_UX_U1_CHECKPOINT.md` gives (1) the plan's 18 visible choices
|
||||
quoted verbatim, each with alternatives, recommendation and consequences; (2) the five AC amendments with the
|
||||
contract's current text verbatim and an exact proposed text faithful to the plan, plus the plan's other contract
|
||||
changes quoted; (3) the verdicts and MAJOR/MINOR counts of the three challengers and the confirmation pass, each
|
||||
MAJOR traced to its resolution in the plan, matching the archived original reports
|
||||
`.claude/audits/2026-11-06-v1-2-6-u1-plan-challenges.md`; (4) the exact scope of every planned sandbox reset
|
||||
(commands, what is removed and what is not, current state) from `scripts/db-sandbox.sh`; (5) the validation
|
||||
criteria of lots A to I matching the plan; every « plan :n » reference points at the cited text.
|
||||
5. No implicit deletion (C): the page states that the plan approval authorises no data deletion and proposes a
|
||||
contract clarification that prevails over the plan lines authorising the wipe, without editing the plan.
|
||||
6. LRN-119 kept (D): unchanged by this intervention, its status line on DOM refs present.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet a43145a -- .claude/memory/learnings.md && grep -q "refs to DOM elements detached while hidden" .claude/memory/learnings.md && echo LRN_KEPT
|
||||
EXPECT: LRN_KEPT
|
||||
EVIDENCE: MET exit=0 marker-found :: LRN_KEPT
|
||||
7. Registries: one decisions entry for this brief through `memory.sh`, recording only owner decisions; journal; TODO.
|
||||
8. Restrictions (E): no change under `apps/`, `crates/`, `supabase/`, `packages/`, `scripts/`, `docs/design/v1-2-6/`,
|
||||
the PNG boards; no sandbox container started or removed; the untracked review file never staged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet a43145a -- apps crates supabase packages scripts docs/design/v1-2-6 'docs/design/v1-2-6-constats/*.png' && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo CK_SCOPE_OK
|
||||
EXPECT: CK_SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: CK_SCOPE_OK
|
||||
9. A fresh independent verifier against this contract; justified gaps fixed; exact verdict reported. STOP.
|
||||
|
||||
## FILE SCOPE
|
||||
- docs/development/{V1-2-6_UX_FINDINGS_NAV.md, V1-2-6_UX_PLAN.md (U2b entry), V1-2-6_UX_U1_CHECKPOINT.md (new)}
|
||||
- docs/design/v1-2-6-constats/REVUE.md
|
||||
- .claude/audits/2026-11-06-v1-2-6-u1-plan-challenges.md (new, verbatim reports)
|
||||
- .claude/tasks/TODO.md, this contract, .claude/memory (through memory.sh)
|
||||
- NOT in scope: the U1 plan and contract, apps/**, crates/**, supabase/**, packages/**, scripts/**, the boards
|
||||
@@ -0,0 +1,486 @@
|
||||
# CONTRACT — v1-2-6-ux-u1
|
||||
- date: 2026-11-06 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command runs from this absolute path; never from
|
||||
/home/bchanot/Documents/faunosteo; never against DEV: the `supabase_*_faunosteo` containers are DEV; the throwaway
|
||||
sandbox is `faunosteo_dbsandbox_*`, reached only through `pnpm db:sandbox …`)
|
||||
- base: 846994b (T17 recorded, BDR-102). Commit in place, push each commit; no merge, no `gitflow.sh finish`
|
||||
(T13), no sub-branch.
|
||||
- spec: `docs/development/V1-2-6_UX_PLAN.md` §3 U1 and §2 G (undo rules), `docs/development/V1-2-6_UX_TESTS.md` U1,
|
||||
`docs/development/V1-2_ANATOMICAL_SHEETS.md` §8.2-§8.4 and §17.12 as amended, the level-1 contract
|
||||
`.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` with its U0 notes and header precedence rule,
|
||||
`docs/development/V1-2-6_UX_DECISIONS.md` (T15, T17, « Points from the boards for U1 and later »), boards
|
||||
`docs/design/v1-2-6` (`maquettes.html` is their source).
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — V1-2.6 UX — Autorisation de U1 uniquement
|
||||
|
||||
Le propriétaire approuve définitivement le checkpoint U0.
|
||||
|
||||
U0 est terminé, vérifié CONFORME 12/12, commité et poussé au HEAD 452a346.
|
||||
|
||||
J'autorise maintenant l'implémentation de U1 uniquement, conformément à V1-2-6_UX_PLAN.md, aux contrats amendés et aux 16 maquettes V2 validées.
|
||||
|
||||
## 1. Périmètre U1
|
||||
|
||||
Implémenter la nouvelle structure générale de l'éditeur anatomique.
|
||||
|
||||
Navigation principale à quatre onglets :
|
||||
- Général
|
||||
- Annotations
|
||||
- Constats
|
||||
- Vérification
|
||||
|
||||
Les références doivent rester accessibles depuis un panneau secondaire, sans imposer un onglet principal supplémentaire.
|
||||
|
||||
Les vues détaillées et les régions vertébrales seront intégrées progressivement à Annotations dans les étapes prévues. U1 ne doit pas anticiper les opérations U2 à U6.
|
||||
|
||||
## 2. Annuler / Rétablir
|
||||
|
||||
Déplacer les commandes globales dans l'en-tête conformément aux maquettes corrigées.
|
||||
|
||||
Contraintes :
|
||||
- Historique global de la fiche.
|
||||
- Conservation du comportement existant et de la pile d'historique.
|
||||
- États activé/désactivé correctement synchronisés.
|
||||
- Raccourcis clavier appropriés.
|
||||
- Noms accessibles explicites, notamment « Annuler la dernière modification ».
|
||||
- Aucun bouton flottant redondant sur le dessin.
|
||||
|
||||
Ne pas confondre Annuler/Rétablir avec l'abandon d'un formulaire.
|
||||
|
||||
## 3. Navigation et compatibilité
|
||||
|
||||
Préserver toutes les fonctions métier de l'ancien éditeur pendant leur réorganisation.
|
||||
|
||||
En particulier :
|
||||
- Aucune perte de brouillon lors d'un changement d'onglet.
|
||||
- Aucun changement non prévu du mécanisme de sauvegarde explicite.
|
||||
- Préservation de la récupération locale.
|
||||
- Préservation des contrôles d'autorisation et du MFA.
|
||||
- Aucune modification des règles de soumission et de publication.
|
||||
- Aucun changement du format des documents anatomiques.
|
||||
- Conservation des chemins et des états nécessaires aux étapes suivantes.
|
||||
|
||||
Ne pas implémenter prématurément des fonctions de V1-2.7 simplement parce qu'elles figurent dans certaines maquettes.
|
||||
|
||||
## 4. Responsive et accessibilité
|
||||
|
||||
Appliquer les règles UX validées :
|
||||
- Barre latérale repliée sous 1 280 px dans l'éditeur.
|
||||
- Navigation accessible au clavier.
|
||||
- Focus visible et cohérent après changement d'onglet.
|
||||
- Annonces et libellés accessibles.
|
||||
- Préservation de la règle O14 A : téléphone en lecture seule sous 1 024 px.
|
||||
- Ne pas supprimer les capacités tactiles déjà présentes sur les largeurs autorisées.
|
||||
|
||||
La manipulation avancée des points et des polygones relève de U2, pas de U1.
|
||||
|
||||
## 5. Décision T17
|
||||
|
||||
Le propriétaire valide la solution suivante pour U6 :
|
||||
|
||||
Lorsqu'aucune catégorie ne porte le rôle `vertebra`, proposer une entrée de secours « Régions vertébrales » depuis Annotations.
|
||||
|
||||
Lorsqu'une catégorie Vertèbres existe, sa configuration doit se faire depuis cette catégorie, sans doublon.
|
||||
|
||||
Enregistrer cette décision selon la convention du registre et actualiser ses dépendances. Ne pas implémenter maintenant le nouveau modèle de catégories.
|
||||
|
||||
## 6. Vérifications
|
||||
|
||||
Avant toute exécution de tests :
|
||||
- Vérifier le répertoire et la branche.
|
||||
- Examiner le statut Git.
|
||||
- Préserver le fichier de revue non suivi.
|
||||
- Inspecter les commandes pour confirmer qu'elles ne visent pas DEV.
|
||||
|
||||
Exécuter les vérifications applicables à U1 :
|
||||
- TypeScript et lint.
|
||||
- Tests unitaires de navigation et d'historique.
|
||||
- Tests de non-régression.
|
||||
- Tests clavier/accessibilité pertinents.
|
||||
- Tests d'intégration et E2E en sandbox jetable strictement isolée, si nécessaires.
|
||||
|
||||
Ne jamais exécuter une commande susceptible de joindre ou modifier Supabase DEV.
|
||||
|
||||
Faire une revue indépendante de la conformité U1 et corriger les écarts justifiés.
|
||||
|
||||
## 7. Git et traçabilité
|
||||
|
||||
Travailler dans :
|
||||
|
||||
`/home/bchanot/Documents/faunosteo-v1-2`
|
||||
|
||||
Sur :
|
||||
|
||||
`feature/v1-2-anatomical-sheets`
|
||||
|
||||
Utiliser les conventions Git du projet, avec commits réguliers et push.
|
||||
|
||||
Ne pas ajouter les fichiers non suivis préexistants sans nécessité et autorisation.
|
||||
|
||||
Ne pas modifier le checkout V1-1.
|
||||
|
||||
## 8. Interdictions
|
||||
|
||||
Aucune modification Rust, SQL, worker ou schéma documentaire.
|
||||
|
||||
Aucune migration, aucune opération sur DEV et aucun déploiement.
|
||||
|
||||
Aucune fusion.
|
||||
|
||||
Ne pas commencer U2, U3, U4, U5, U6, U7, U8 ou V1-2.7.
|
||||
|
||||
## 9. Checkpoint U1
|
||||
|
||||
Fournir :
|
||||
- Liste des modifications réalisées.
|
||||
- Correspondance entre l'interface et les maquettes V2.
|
||||
- Tests réellement exécutés et leurs résultats.
|
||||
- Revue indépendante et verdict exact.
|
||||
- Éventuelles limitations restantes.
|
||||
- Démonstration testable dans la sandbox.
|
||||
- Commits et état Git.
|
||||
- Critères de sortie U1.
|
||||
|
||||
S'arrêter au checkpoint U1.
|
||||
|
||||
Ne pas commencer U2 sans nouvelle autorisation explicite.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: The plan's U1 tooling (worker image commit label in `crates/worker/Dockerfile`, `verify-e2e` image check against
|
||||
HEAD, demo sheet provisioned by the trial command in `scripts/db-sandbox.sh`) — the brief forbids worker changes /
|
||||
A: [gated 2026-11-06] defer all of it to U6 (owner). No change under `crates/` or `scripts/` in U1. The U1 demo runs
|
||||
on the existing trial stack: the owner creates a non-equine sheet in the UI as in `docs/development/V1-2-6_OWNER_TRIAL.md`.
|
||||
The PLAN U1 acceptance line « a stale worker image is refused » and the TESTS U1 « Tooling » row move to U6.
|
||||
Q: Where does « Abandonner les modifications » (C11, return to the last saved revision) sit, since the boards show no
|
||||
discard control / A: [gated 2026-11-06] in the header, a secondary button beside the save state and « Enregistrer »,
|
||||
edit mode only, disabled when nothing is unsaved; same confirmation and behaviour as today (owner).
|
||||
Q: Internal design (brief « U1 — Validation de la conception interne », 2026-11-06) / A: [gated 2026-11-06] approach
|
||||
A: the Annotations panel keeps board 01's cards; « Gérer les vues », « Modifier les catégories » and « Régions
|
||||
vertébrales » open the existing level-1 editors in full-width sections with « Retour au dessin », until U3, U4 and U6
|
||||
replace them; four tabs, references in a side panel, history in the header, sidebar hidden below 1 280 px, keyboard
|
||||
navigation, focus management, read-only below 1 024 px. Ten mandatory precisions: no silent loss of changes, history
|
||||
or editing state on a section, tab or panel change; « Retour au dessin » restores a coherent context and an
|
||||
accessible focus; history tests on typed text, shortcuts and section transitions; a save shown only after effective
|
||||
confirmation, never the browser clock as proof of persistence; read-only below 1 024 px on every editing entry,
|
||||
moved forms and shortcuts included; reference counters from the current document, no network, no costly recount per
|
||||
render; no « Prévisualiser » nor withdrawal, no existing function removed; the regions entry respects T17 without
|
||||
anticipating U6; « Abandonner les modifications » only for unsaved changes, confirmed when data can be lost, never
|
||||
removing the local copy silently; no provisional code hard to remove, sections replaceable without rebuilding the
|
||||
navigation. Plan: `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`.
|
||||
Q: Save time source / A: [gated 2026-11-06] server time: after a confirmed save, one read of the existing admin
|
||||
endpoint; « Enregistré à hh:mm · révision n » only when `draft_last_save` names the same revision, else « Enregistré ·
|
||||
révision n »; never the browser clock.
|
||||
Q: References panel behaviour / A: [gated 2026-11-06] non-modal: scrim over the content below the tabs (board 11),
|
||||
content inert, header, tabs and Annuler/Rétablir usable, Escape or scrim click closes, content kept across closes.
|
||||
Q: Control opening the filtered panel from a finding / A: [gated 2026-11-06] a « n référence(s) » button in the
|
||||
Citations block of the selected finding's detail; no control inside the ARIA tree.
|
||||
Q: Annotation list layout / A: [gated 2026-11-06] board 01 card « Annotations de la vue » (grouped by category,
|
||||
« Filtrer par nom »), shown when nothing is selected; the properties panel gains « Toutes les annotations » to return
|
||||
to it.
|
||||
Q: U1 authorisation (brief « V1-2.6 UX — Ratification finale U1 et autorisation conditionnelle d'implémentation »,
|
||||
2026-11-06) / A: [gated 2026-11-06] the 18 visible choices of the plan (checkpoint page section 1), approach A, the
|
||||
amendments of AC3, AC4, AC5, AC7, AC17 (applied above, each tagged) and the changes 2.6 to 2.9 approved, with the two
|
||||
precautions below. The plan at 2e46c14 stays the reference and is not redesigned. Implementation of U1 only, lots A to
|
||||
I; per lot: scope and criteria respected, applicable checks run, existing functions kept, regressions fixed, validated
|
||||
changes committed and pushed, no next lot while its preconditions are unmet. Kept in particular: global history and
|
||||
Annuler/Rétablir, unsaved changes, the local recovery copy, rights and MFA checks, read-only behaviours, focus,
|
||||
keyboard navigation and accessibility, document compatibility. U2 to U6 graphic operations excluded. Code starts
|
||||
only after the targeted counter-check of the confirmation pass's three fixes and of the two precautions (verdict
|
||||
reported, blocking gaps fixed and re-checked).
|
||||
Q: Design criteria (checkpoint 2.7) / A: [gated 2026-11-06] no loss on a tab, section or panel change (Lots B2, D
|
||||
tests); « Retour au dessin » focus and context; history tests on typed text, shortcuts and section transitions; save
|
||||
shown only after the server answer, time only from the server; read-only below 1 024 px on every moved form and
|
||||
shortcut; counts from the current document without network; no « Prévisualiser », no withdrawal, no removed function;
|
||||
T17 entry without role logic; discard confirmation naming the stored copy; sections replaceable through one registry.
|
||||
Q: Sandbox data deletion (checkpoint 2.9, made stricter by the authorisation brief §4) / A: [gated 2026-11-06] the
|
||||
plan approval authorises no deletion of data, sandbox included, and no earlier go carries over. Before each
|
||||
`pnpm db:sandbox down`, `pnpm db:sandbox up fresh` or any equivalent that may reset the sandbox (Lot B1, Lot I or any
|
||||
other): stop before the destruction; take a read-only inventory of the containers, the accounts outside the seed, the
|
||||
sheets, drafts and other resources concerned; present exactly what will be deleted; run it only on the owner's
|
||||
explicit go for that operation. DEV is never a substitute for an unavailable sandbox. This prevails over plan :38-40,
|
||||
:59 and :397.
|
||||
Q: Unmounted forms (checkpoint 2.8, owner precaution) / A: [gated 2026-11-06] owner: « La traversée du seuil de
|
||||
1 024 px ou une décision de récupération ne doit pas provoquer une perte silencieuse de saisie. Vérifier le
|
||||
comportement réel des composants existants. Préserver les valeurs lorsqu'une solution sûre existe dans le périmètre
|
||||
U1. Sinon, prévoir une confirmation explicite ou documenter précisément la limitation et les garanties de
|
||||
récupération. Si la prévention de la perte exige une évolution hors périmètre U1, signaler le blocage avant
|
||||
implémentation concernée. Ajouter les tests adaptés. » Facts (read 2026-11-06, `apps/app/src`): `readOnly = mode !==
|
||||
'edit' || recovery !== 'none'` (route :132); the store accepts commits in narrow mode (`canEdit` true for edit and
|
||||
narrow, `mode.ts:90-92`, `editorBase.ts:44-50`). Resolution, executor's, under the owner's rule:
|
||||
- Recovery decision: no loss possible. An offer is pending only at opening (before any form exists,
|
||||
`editorLoad.ts:65-88`, route :125-131) or when `canEdit` turns true from rights, inactive, historical or frozen
|
||||
(`recoveryFlow.ts:76-95`), all read-only, so every edit-only part is absent while it is pending; « Restaurer » and
|
||||
« Ignorer » mount empty forms. Pinned by a test (no edit-only control while an offer is pending, empty forms after).
|
||||
- Width change to read-only, kept as today: `TextField` commits its typed text on unmount (`TextField.tsx:61-73`),
|
||||
accepted in narrow mode (an unsaved change, recovery copy written); a value the field refuses keeps its message,
|
||||
shown again when editing resumes.
|
||||
- Width change to read-only, preserved (new): the edit-only parts without a native modal of their own stay mounted and
|
||||
are hidden with `hidden` while read-only, instead of unmounting, so their values come back on widening: the
|
||||
creation forms of categories, references, regions and detail views, the findings creation form, the submission
|
||||
note, the crop group editor, and the annotation edit body (`EditableAnnotations`: tool, selection, pending creation
|
||||
with its typed name, tracing, numeric geometry drafts) beside the read-only body. Hidden parts use the B2
|
||||
`KeptPlace` visibility, so their canvases detach (one live composition per view). Three guards a width change needs
|
||||
and a tab change does not: when the editor turns read-only, the route runs `commitFocusedField()` and blurs any
|
||||
focus left inside a hidden part; the annotation edit body drops an in-flight drag without commit (its `moveTarget`
|
||||
null while hidden, `EditableAnnotations.tsx:256-265`, `useMoveGesture.ts:54-57`); dialogs that confirm an edit
|
||||
(`DeleteDialog`s, the discard confirmation) close without effect when the editor turns read-only, so no editing
|
||||
entry stays usable below 1 024 px (precision 5; today they stay open and still write, level-1 behaviour).
|
||||
- Width change to read-only, drawing actions of the views section (`ViewDrawing.tsx:47`): superseded by the answer
|
||||
« Targeted counter-check before code » below (kept hidden, dialogs closed while read-only, one documented limit:
|
||||
geometries typed inside an open repair dialog). Written in `docs/development/V1-2-6_OWNER_TRIAL.md` (Lot I) and the
|
||||
checkpoint report.
|
||||
- Not changed: `ConflictDialog` (a save outcome). Lots: B2 (kept edit-only parts, guards, unit tests), H (Chromium:
|
||||
type in each preserved part, cross 1 024 px, no edit control and no focus in a hidden part, widen, values back; a
|
||||
drag across the crossing commits nothing; open delete and discard confirmations close). Plan §2 cites
|
||||
`CategoriesSection.tsx:51` and `ReferencesTab.tsx:44`; the lines are 52 and 47.
|
||||
Q: Save time rights (AC7, owner precaution) / A: [gated 2026-11-06] owner: « Vérifier les droits nécessaires pour
|
||||
consulter l'heure de sauvegarde à partir de l'endpoint existant. Ne pas élargir les permissions. Si l'information
|
||||
n'est pas accessible avec les droits normaux du praticien, afficher « Enregistré · révision n ». Ne jamais afficher
|
||||
une sauvegarde réussie avant confirmation serveur, ni utiliser l'horloge du navigateur comme preuve de persistance. »
|
||||
Facts (read 2026-11-06): the read (`packages/supabase/src/sheets.ts:475-483`, SQL
|
||||
`supabase/migrations/20261103100000_sheet_draft_last_save.sql:14-94`) is `stable security definer`, needs
|
||||
`require_catalog_actor` (active profile, confirmed e-mail, aal2) and `caller_can_see_official_sheet` (aal2 and an
|
||||
active sheet_editor, reviewer or publisher grant on an official, non-deleted sheet); `save_sheet_draft` needs
|
||||
`can_edit_sheet` (aal2 and an active editor grant), so every user who can save can read; no audit row, no write
|
||||
budget, no sign-out or step-up in the wrapper; `saved_at` is the server's audit time, null when the revision was not
|
||||
written by a save. Resolution: no permission change; `readSaveTime` calls the accessor directly with the store's
|
||||
client and session, as `readConflict` does (`editorSave.ts:56-71`), never the route's query (a failed route refresh
|
||||
unmounts the editor, `useAdminQuery.ts:45-48`); any refusal or failure leaves `savedAt` null, shown « Enregistré ·
|
||||
révision n »; « Enregistré » appears only after the server's save answer (`applySaved`); the time is
|
||||
`draft_last_save.saved_at` formatted, never `Date.now()` or `new Date()`. Tests in Lot E: refusal and network failure
|
||||
→ « Enregistré · révision n », editor still mounted; no saved line while the request is in flight; no browser clock
|
||||
read in `saveLine.ts` and `readSaveTime`.
|
||||
Q: Targeted counter-check before code (2026-11-06, plan-challenger, REMAINING(4), 9 MINOR) / A: [gated 2026-11-06]
|
||||
fixes, executor's, under the owner's rules (no plan redesign; this answer prevails over the plan lines it names):
|
||||
- E2E per lot (MAJOR): lots B1, E and F, which change the draft header or `AppLayout`/`MobileDrawer` used by every
|
||||
shell page, run the whole shell suite (`pnpm db:sandbox e2e-shell`, no filter); the other lots from B1 run every
|
||||
`apps/app/e2e/shell/editor-*.spec.ts`. « The two sentinels » of plan :362 is struck: :55-59 and this line are the
|
||||
rule. No sandbox go at B1 → every e2e step waits and the lot is not committed as validated; never on the trial stack
|
||||
as found, never on DEV.
|
||||
- Plan text on unmounted forms (MAJOR): CLARIFICATIONS « Unmounted forms » prevails over plan :76-78, :145-146,
|
||||
:164-168 and :646-647. Lot B2 adds to its files: `general/CategoriesSection.tsx`, `references/ReferenceForm.tsx`
|
||||
(via the panel), `annotations/sections/{RegionsSection,ViewsSection}.tsx`, `views/{DetailViewRow,CropEditor,
|
||||
ViewDrawing}.tsx`, `tabs/{FindingsTab,VerificationTab,AnnotationsTab}.tsx`, `annotations/{EditableAnnotations,
|
||||
PropertiesPanel}.tsx`, `DeleteDialog.tsx`, the discard confirmation, `editor/useViewport.ts`, the route; its unit
|
||||
tests add, per preserved part: type, switch to read-only, no edit control in the accessibility tree, switch back,
|
||||
value back. Lot H (plan :519-520) checks that the values come back, not only « unsaved kept ».
|
||||
- Ids in read-only (MAJOR): an edit part kept hidden beside a read-only twin never shares an id with it: the read-only
|
||||
twins (`CropValues`, the read-only body's `PropertiesPanel` and fields) take an id prefix of their own; the B2
|
||||
unique-id test also runs in read-only after a crossing, every place visited, a crop group open.
|
||||
- Drawing actions (MAJOR): no longer a documented limit. `DrawingActions` stays mounted and hidden while read-only;
|
||||
its three dialogs receive their open state (candidate, offer, asking) only while not read-only, so no native modal
|
||||
is ever open inside a hidden part (`Dialog` mounts the modal only while open, `ModalDialog.tsx:72`) and the upload
|
||||
phase, a pending cleaning candidate, a repair offer and a parent choice come back on widening; an upload settling
|
||||
while read-only lands in the live hook. Remaining limit, documented: geometries typed inside an open repair dialog
|
||||
are lost when it closes on the crossing (the dialog unmounts); the offer itself comes back.
|
||||
- MINOR fixes: the read-only guard blurs before the hide: the viewport hook runs `commitFocusedField()` in its resize
|
||||
handler before it changes the tier across 1 024 px, Chromium case « type, no blur, cross 1 024 px → unsaved, copy
|
||||
written »; a value a field refuses is lost with that refusal (its message kept), stated as such; values a blur does
|
||||
not commit (region range drafts until « Appliquer », creation drafts, refused values) are kept by the hidden place,
|
||||
never committed, outside the document, the leave guard and the copy, as in level 1; focus requests go to the
|
||||
visible annotation body only; « Aller à » another annotation drops a refused « non appliqué » geometry group, the
|
||||
level-1 rule, kept and stated under choice 12; B2 tests add a click with no focus change (Safari-like) and the
|
||||
panel closed by its header toggle while a reference field is focused, and the real path: pending creation and a
|
||||
« Remplacer par un polygone » tracing, then Vérification, then « Aller à » an annotation → kept and focused.
|
||||
Q: Re-check of those fixes (2026-11-06, fresh plan-challenger, REMAINING(1), 7 MINOR) / A: [gated 2026-11-06]
|
||||
fixes, executor's (prevail over the answers above where they differ):
|
||||
- Dialogs in hidden places (MAJOR N1): a dialog of a kept part receives its open state only while editing AND its
|
||||
place is visible (`!readOnly && usePlaceVisible()`), so an offer that settles while the views section is hidden
|
||||
(left during an upload) or a widening on another tab never opens a native modal inside a hidden subtree; the dialog
|
||||
opens when the section is shown again. `DeleteDialog` and the discard confirmation close through `onClose`, never
|
||||
withheld. B2 test: an offer settling with the section hidden, and a widening on another tab, leave `dialog[open]` at
|
||||
0 until « Gérer les vues ».
|
||||
- N2: on a crossing, a withheld dialog stays modal for its exit animation (0.15-0.18 s, `Dialog.tsx:47-61`) and its
|
||||
unmount returns focus inside the editor; stated; H waits for a dialog count of 0 (LRN-111) before checking focus.
|
||||
- N3: the general rule: anything rendered in both annotation bodies (properties panel and fields, overview panel and
|
||||
its « Filtrer par nom », selection tag, test ids) takes the body's prefix or a `useId` id; the e2e helper scopes to
|
||||
the visible body; the unique-id test runs with nothing selected and with a selection, in edit and after a crossing.
|
||||
- N4: the split, stated and tested: a field that switches in place to its read-only value (`TextField.tsx:31-40`)
|
||||
loses a value its commit refuses (message kept); a field inside a kept part keeps it.
|
||||
- N5: a kept part mounts at its first edit-mode render and is kept from then on; a page opened read-only (narrow,
|
||||
recovery pending, rights, frozen, inactive, historical) mounts no edit part, so the recovery bullet holds; test: a
|
||||
page opened narrow has no edit body.
|
||||
- N6: level-1 behaviour stated in the limits: an upload in flight when the editor turns read-only still attaches its
|
||||
drawing (`drawingUpload.ts:184-191`, a commit the store accepts in narrow mode, an unsaved change); B2 test.
|
||||
- N7: B2's files add `annotations/AnnotationFields.tsx` and `references/ReferencesPanel.tsx`.
|
||||
- N8: the repair-dialog limit is removed: `geometries` moves from `RepairForm` into `RepairDialog`, keyed on the
|
||||
offer, so typed repair geometries survive the crossing like the other kept values (`views/RepairDialog.tsx`, B2).
|
||||
Q: Third pass (2026-11-06, fresh plan-challenger, REMAINING(1), 3 MINOR) / A: [gated 2026-11-06] MINOR fixes,
|
||||
executor's:
|
||||
- Pending offer after an edit-mode render: the route also treats `useEditorStore(s => s.canEdit) !==
|
||||
storeCanEdit(mode)` as read-only, so no render is in edit mode before the recovery detection of `setCanEdit` runs
|
||||
(`AdminSheetDraftRoute.tsx:115,132`, `recoveryFlow.ts:85-94`); test: rights → edit inside one mount with a stored
|
||||
copy mounts no edit part before the offer.
|
||||
- Repair dialog: `RepairDialog({ offer, open })`, `offer` never gated, state reset only when a different non-null
|
||||
offer arrives; not kept across a crossing, stated: the apply refusal `result` and an unparseable draft held in
|
||||
`GeometryGroup`'s own state.
|
||||
- Upload outcomes: `UploadNotices` and the `views.error` notice render outside the hidden wrapper, so a working,
|
||||
failed or pending state shows in read-only; N6 restricted to narrow mode (frozen, rights or inactive refuse the
|
||||
attach, its failure shown by those notices).
|
||||
Q: A withheld decision dialog of the views section (cleaning, repair, parent drawing) reopening by itself when its
|
||||
place is shown again, taking focus from a tab or an « Aller à » target (third pass MAJOR) / A: [gated 2026-11-06]
|
||||
owner: « Reprendre » button. A dialog withheld while its place was hidden or the editor read-only never reopens by
|
||||
itself: the view row's upload notice shows the decision as pending with a « Reprendre » button that reopens it (new
|
||||
label, proposal C44); AC12 and AC13 unchanged. B2/H tests: a tab click and an arrow back onto Annotations keep focus on
|
||||
the tab; « Aller à » a view focuses its row; `dialog[open]` stays 0 until « Reprendre »; « Reprendre » opens the
|
||||
dialog with its state (candidate, offer with typed geometries, parent choice).
|
||||
Q: Fourth pass (2026-11-06, fresh plan-challenger, REMAINING(1), 5 MINOR) / A: [gated 2026-11-06] fixes,
|
||||
executor's:
|
||||
- « Reprendre » in read-only (MAJOR): an `ActionButton readOnly={readOnly}`, absent in every read-only mode (AC11),
|
||||
the pending text kept; clicking it is the only way a withheld dialog opens. B2 test: narrow with a withheld
|
||||
decision shows the pending text and no « Reprendre »; after widening `dialog[open]` stays 0 until « Reprendre ».
|
||||
- Withheld state: per decision object (candidate, offer, parent `asking`), held in `DrawingActions`, set in any render
|
||||
where that decision exists while `readOnly`, its place hidden, or the references panel open; a new decision that
|
||||
arrives in edit mode, place visible and panel closed, opens normally. Test: after a withheld decision ends, a new
|
||||
one opens on its own.
|
||||
- Pending decision and new actions: while a decision is pending (dialog withheld), the file picker and « Utiliser
|
||||
l'illustration de la vue parente » are disabled with the pending notice as their description, so no pick silently
|
||||
replaces a pending offer and its typed geometries.
|
||||
- Parent choice: a withheld parent choice has its own pending line in the row's notices; the pending texts (cleaning,
|
||||
repair, parent) and « Reprendre » are label proposals listed in the Lot G file (C44).
|
||||
- References panel open: a place under the open panel counts as not visible for decision dialogs (withheld, then
|
||||
« Reprendre »), so no modal opens over the panel and focus is never lost to `body`.
|
||||
- Route resync after a submission: the route's `setCanEdit` effect depends on `[canEdit, sheet]`, so after
|
||||
`submit()` sets the store's `canEdit` false and the refresh keeps the draft editable (`verification_failed`,
|
||||
`changes_requested`, `withdrawn`), editing is re-enabled; test for each of those rounds.
|
||||
Q: Fifth pass (2026-11-06, fresh plan-challenger, VERDICT: CONFORME, 4 MINOR) / A: [gated 2026-11-06] MINOR
|
||||
answers, executor's:
|
||||
- Recovery bullet amended: an offer can also become pending mid-session after the submission resync or an edit →
|
||||
rights → edit change, with kept parts mounted and hidden; no data is lost (read-only, the user decides) and kept
|
||||
drafts stay across « Restaurer » or « Ignorer »; B2 test pins it. Skipping the detection would need `editor/state`
|
||||
(outside U1).
|
||||
- Parent choice: `asking` becomes a per-click token, so a later parent choice is a new decision and opens normally;
|
||||
cleared when the view's own drawing disappears; included in the « new decision opens on its own » test.
|
||||
- The hidden file input gets `disabled` while a decision is pending, as the visible picker.
|
||||
- Limits written in `V1-2-6_OWNER_TRIAL.md` (Lot I) with one B2 test: a withheld decision is lost when its view is
|
||||
removed (undo, discard, reload, deletion), redo does not bring it back; a decision pending at a submission stays as
|
||||
a pending line without action in frozen mode.
|
||||
Q: Files outside FILE SCOPE added during execution (fresh verifier, 2026-11-08) / A: executor's rulings, recorded in
|
||||
the SDD ledger at the lot that made them, not owner-gated: `components/catalogue/CatalogueCanvas.tsx` (B2a, the
|
||||
catalogue canvas detaches its tree while hidden like the editor canvases), `lib/placeVisibility.ts` (B2a, the
|
||||
visibility context in a neutral lib so the catalogue does not import the editor), `editor/editingContext.ts` (B2b,
|
||||
`EditOnly` and `useEverEditable`, precaution 2.8), `editor/references/filter.ts` (D, the panel filter split from
|
||||
`citations.ts`), `components/shell/ShellChrome.tsx` (F, `Sidebar` and `TopBar` split from `AppLayout.tsx` for the
|
||||
function limits). Each is reviewed in its lot. The three limits of N4, N6 and the third pass (repair `result`) are
|
||||
written in `V1-2-6_OWNER_TRIAL.md` « Limites connues de U1 » with the Fifth pass ones.
|
||||
|
||||
Q: Owner decisions at the U1 checkpoint (2026-11-09) / A: brief « V1-2.6 UX — Décisions au checkpoint U1 » (BDR-106) [gated 2026-11-09]: the five files of « Files outside FILE SCOPE added during execution » and the three one-for-one assertion rewrites (editor-journey.spec.ts:14, editor-recovery.spec.ts:7, editor-route-recovery.test.tsx:93; mapping 99b669b) are accepted, their justification and mapping kept in `docs/development/V1-2-6_UX_U1_CHECKPOINT.md` §7.2; no general scope widening for later steps. U1 implemented, checkpoint open; shell suite at da95b84 188 passed / 90 skipped / 4 failed (admin.spec.ts:717), never reported green on the last commit; no sandbox reset to get green.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Four tabs from 1 024 px: Général, Annotations, Constats, Vérification, as an ARIA tablist (arrows, Home/End not
|
||||
required beyond today's pattern); no « Vues et illustrations », « Références » or « Vertèbres » tab remains; the
|
||||
initial-tab rule of C40 as amended holds (Général for a sheet without a measurable view, else Annotations).
|
||||
2. Annotations holds, with their level-1 operations unchanged: the views and their drawings (main view, detail views,
|
||||
upload, cleaning, attach, the numeric crop editor kept until U4), the annotation categories (level-1 editor kept
|
||||
until U3) and the « Régions vertébrales » fallback entry with the level-1 regions editor (T17, BDR-102; no role
|
||||
exists before U6), laid out after board 01's overview panel; no U2-U6 operation is added (no handle, slider,
|
||||
rectangle, remap, role, opacity).
|
||||
3. [amended 2026-11-06, owner, checkpoint 2.1] References open in a non-modal side panel after board 11, anchored
|
||||
below the tab row so that it never covers the draft header or the tab row, from a « Références » button in the
|
||||
header and from the selected finding's detail (a « n référence(s) » button in its Citations block), filtered to
|
||||
that finding's citations with « Tout afficher (N) », with search on citation, DOI and URL, the citation count per
|
||||
reference, and the level-1 add / edit / delete; a scrim covers the tab panels, which are `inert` while the panel is
|
||||
open; the header, the tab row, « Annuler », « Rétablir » and Ctrl+Z stay usable; Escape, ✕ or a click on the scrim
|
||||
closes it, and focus returns to the opener, else to the header « Références » button; read-only (no edit control)
|
||||
in every read-only mode; the panel is not a `ModalDialog`, and every dialog opened from it stays one (D13,
|
||||
BDR-076).
|
||||
4. [amended 2026-11-06, owner, checkpoint 2.2] Undo and redo sit at the right of the tab row on every tab (board
|
||||
`hist()`): icon and visible « Annuler » /
|
||||
« Rétablir »; « Annuler » has the accessible name and tooltip « Annuler la dernière modification » (T15); redo's
|
||||
long name is a label proposal; enabled exactly when the store can undo or redo AND the editor is in edit mode with
|
||||
no recovery pending; disabled in every read-only mode (narrow, frozen, rights, inactive, historical, recovery
|
||||
pending); enabled while a save is in flight, as Ctrl+Z (a step taken during a save stays unsaved); the same `undo()`/`redo()` store actions as today, history and its 8 MiB bound unchanged;
|
||||
Ctrl+Z and Ctrl+Shift+Z unchanged; the undo and redo buttons of the tool column are removed (no pair on the
|
||||
drawing).
|
||||
5. [amended 2026-11-06, owner, checkpoint 2.3] Undo from any tab reverts the last accepted commit, whichever tab made
|
||||
it; a field holding typed text is committed before the header undo (blur forced at pointerdown; keyboard users
|
||||
reach the button with Tab, which blurs the field), and that commit is what the undo reverts, also when the history
|
||||
was empty before it; when the field refuses the value (its error shown), no undo happens and focus returns to the
|
||||
field (behaviours pinned by tests).
|
||||
6. « Abandonner les modifications » replaces « Annuler les modifications » in the header beside « Enregistrer »
|
||||
(clarification), with the same confirmation and `discardChanges` behaviour; C28's list names it.
|
||||
7. [amended 2026-11-06, owner, checkpoint 2.4; precaution in CLARIFICATIONS « Save time rights »] The header save
|
||||
line follows the boards, first matching form: a recovery copy issue (cap or quota), today's text;
|
||||
« Enregistrement… » while saving; while unsaved, « n modification(s) non enregistrée(s) » (plural mechanism) when
|
||||
n, the number of accepted changes between the shown and the saved document along the history, is a positive
|
||||
number, else « Modifications non enregistrées »; after a save confirmed by the server in this page session,
|
||||
« Enregistré à hh:mm · révision n » when one read of the existing admin endpoint returns that revision's save time,
|
||||
else « Enregistré · révision n » (also after `draft.unchanged`), never the browser clock; « Révision n » when
|
||||
nothing was saved in the session; state changes announced, not each count change; the save mechanism itself
|
||||
unchanged.
|
||||
8. The Vérification tab shows the boards' text badge « n erreur(s) » (plural mechanism) when the in-page check has
|
||||
errors.
|
||||
9. In the editor, the application sidebar is hidden below 1 280 px and shown from 1 280 px; below 1 280 px the top bar
|
||||
shows the menu button, which opens the existing drawer (D11, BDR-079) one tap away; the drawer does not close by
|
||||
itself while the sidebar stays hidden; every menu link stays under the leave guard (BDR-078); other pages keep
|
||||
today's 1 024 px rule.
|
||||
10. From 1 024 to 1 279 px the editor follows board 13: properties beside the canvas (C25 as amended), header actions
|
||||
in reach; no horizontal scroll at 1 024, 1 180, 1 279 and 1 280 px on any tab and with the references panel open.
|
||||
11. Below 1 024 px (O14 A, C16 as amended): read-only as today, notice title alone, badges, tabs, whole drawing, zoom
|
||||
and pan, properties summary, no editing action and no enabled undo or redo; unsaved work survives a width change;
|
||||
no horizontal scroll at 320, 375 and 768 px; touch abilities already present from 1 024 px kept.
|
||||
12. Focus and announcements: clicking or arrowing a tab keeps focus on that tab; a tab change started from inside a
|
||||
panel (a hint link, « Aller à ») moves focus to its target element, or to the new tab when there is none, never to
|
||||
`body`; a polite live region (distinct from the save status) announces a tab or section reached that way; focus
|
||||
is visible on every new control.
|
||||
13. « Aller à » reaches every issue kind in its new place: views, categories and regions in Annotations (the section
|
||||
shown and its row focused), references in the side panel (opened, the reference focused), annotations, findings
|
||||
and general fields as today.
|
||||
14. Unchanged: the explicit save, the local recovery (C13, C27, C28), conflicts, rights and MFA checks, the mode
|
||||
precedence (C38), submission and publication rules, the document format, Rust, SQL, the worker, the core and its
|
||||
wasm build; level-1 criteria C13, C14, C16, C34 and C41 re-run green.
|
||||
15. No V1-2.7 control: no « Prévisualiser », no withdrawal (DECISIONS « Points from the boards »).
|
||||
16. i18n: every string through `useT`, FR/EN parity; prose that names an old tab is reworded to the new place; the new
|
||||
labels are listed as proposals in `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md` for the owner's label
|
||||
review (C19, C44).
|
||||
17. Tests: unit tests for the tab model and tiers, header undo/redo states (edit and every read-only mode), cross-tab
|
||||
undo, the typed-field flush, the references panel (open from header and finding, filter, close, focus return),
|
||||
« Aller à » targets, the sidebar rule, the save line; e2e helpers (`e2e/support/editor.ts`, `warm-up.ts`) and
|
||||
specs rewritten for the new shell; every removed or rewritten assertion mapped to its replacement in the commit
|
||||
message (R-24); axe with no serious or critical violation on the four tabs, the open references panel and the
|
||||
narrow read-only mode; a keyboard test of the order header → tab list → « Annuler » / « Rétablir » → references
|
||||
panel when open → tab panel content in visual order (tools, canvas, side column) [last item amended 2026-11-06,
|
||||
owner, checkpoint 2.5].
|
||||
18. Gates, in this order, all green: `pnpm typecheck`, `pnpm lint`, `pnpm test:run`, `pnpm build`, `pnpm e2e:ui`,
|
||||
a fresh sandbox `pnpm db:sandbox up fresh` then `test-db → e2e-shell → test` (LRN-113), `pnpm check:all`,
|
||||
`pnpm r5:import-equine --check`; a fresh verifier and a fresh security review.
|
||||
19. Scope: no change under `crates/`, `supabase/`, `scripts/`, `packages/core-wasm/src/`, `packages/supabase/src/`,
|
||||
`docs/design/v1-2-6/`; nothing staged from the untracked review file.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 846994b..HEAD -- crates supabase scripts packages/core-wasm/src packages/supabase/src docs/design/v1-2-6 && git diff --quiet -- crates supabase scripts packages/core-wasm/src packages/supabase/src docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo U1_SCOPE_OK
|
||||
EXPECT: U1_SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: U1_SCOPE_OK
|
||||
20. FR/EN dictionaries hold the same keys.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && node -e "const fs=require('fs');const k=f=>new Set([...fs.readFileSync(f,'utf8').matchAll(/^\s*'([a-z0-9_.]+)':/gm)].map(m=>m[1]));const a=k('apps/app/src/i18n/fr.ts'),b=k('apps/app/src/i18n/en.ts');const d=[...a].filter(x=>!b.has(x)).concat([...b].filter(x=>!a.has(x)));if(d.length||a.size<100){console.error(d);process.exit(1)}console.log('I18N_PARITY_OK',a.size)"
|
||||
EXPECT: I18N_PARITY_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: I18N_PARITY_OK 1458
|
||||
21. [added 2026-11-06, owner precaution 2.8] No silent loss of typed input on a 1 024 px crossing or a recovery
|
||||
decision, as resolved in CLARIFICATIONS « Unmounted forms »: the listed edit-only parts kept and hidden while
|
||||
read-only with their values back on widening (drawing actions included, their dialogs closed while read-only),
|
||||
the guards, distinct ids for read-only twins, dialogs open only in edit mode in a visible place, kept parts mounted
|
||||
from the first edit-mode render; unit tests (B2) and Chromium journeys (H), as completed by CLARIFICATIONS
|
||||
« Targeted counter-check before code » and « Re-check of those fixes ».
|
||||
22. [added 2026-11-06, owner precaution AC7] Save time read with the existing rights only, as resolved in
|
||||
CLARIFICATIONS « Save time rights »: no permission change, refusal or failure → « Enregistré · révision n » with
|
||||
the editor still mounted, nothing shown as saved before the server's answer, no browser clock; tests in Lot E.
|
||||
|
||||
## FILE SCOPE
|
||||
- apps/app/src: editor tabs model (`editor/tabs.ts`, `editor/useViewport.ts`, `editor/verification.ts`,
|
||||
`editor/focusRequest.ts`, `editor/annotations/focusTarget.ts`), editor state selectors needed for the header
|
||||
(`editor/state/*`, read-only additions only: save count, save time), `components/editor/**` (EditorTabs,
|
||||
EditorTabBody, DraftHeader, tab bodies, annotations panels, references panel, verification), `components/shell/
|
||||
{AppLayout,MobileDrawer,SidebarNav}.tsx`, `app/routes/app/admin/AdminSheetDraftRoute.tsx`, `i18n/{fr,en}.ts`
|
||||
- [added 2026-11-06, owner, checkpoint 2.6] `apps/app/src/editor/{navigation,saveLine,useEditorNavigation,
|
||||
sheetDocument}.ts`, `apps/app/src/editor/references/citations.ts`, `apps/app/src/editor/annotations/{overview,
|
||||
useCanvasBuild}.ts` (overview new; the build hook detaches while hidden; the canvas reset uses the existing `view`
|
||||
action of `uiState.ts`, unchanged), `apps/app/src/catalogue/useCatalogue.ts` (export `folded` only),
|
||||
`apps/app/e2e/lan/trial-lan.spec.ts`; `editor/state/*` edits limited to `lastSave` and `readSaveTime`
|
||||
- apps/app/tests/unit/**, apps/app/tests/helpers/**, apps/app/e2e/** (support helpers, shell and ui specs)
|
||||
- docs: `docs/development/V1-2-6_OWNER_TRIAL.md` (U1 demo steps), `docs/development/BROWSER_TESTS.md` if a suite
|
||||
changes, `docs/development/V1-2-6_UX_{PLAN,TESTS}.md` (tooling moved to U6), `.claude/audits/2026-11-06-v1-2-6-u1-
|
||||
label-proposals.md`
|
||||
- .claude/tasks (this contract, plan, TODO), .claude/memory (through memory.sh)
|
||||
- NOT in scope: crates/**, supabase/**, scripts/**, packages/core-wasm/src/**, packages/supabase/src/**,
|
||||
docs/design/v1-2-6/**, the V1-1 checkout
|
||||
@@ -0,0 +1,281 @@
|
||||
# CONTRACT — db-trial-stack
|
||||
- date: 2026-11-09 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path, LRN-110; never the main
|
||||
checkout /home/bchanot/Documents/faunosteo, whose old scripts reach DEV). Commit in place on the working branch,
|
||||
push each commit; no sub-branch, no merge, no `gitflow.sh finish`.
|
||||
- base: b215b89
|
||||
- untracked files kept: `faunosteo-v1-2-6-revue-ux-chatgpt.md` (this worktree),
|
||||
`/home/bchanot/Documents/faunosteo/faunosteo-v1-2-4-revue-chatgpt.md` (main checkout).
|
||||
- design reference: `docs/development/TRIAL_STACK.md` (arbitrations A11-A15 settled, BDR-107 to BDR-110),
|
||||
`docs/development/V1-2_ANATOMICAL_SHEETS.md` §5.7.1 (first owner bootstrap order).
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — Après R0 — Implémentation technique de la pile d'essai dédiée
|
||||
|
||||
Le propriétaire prend acte de la clôture graphique de R0, du verdict indépendant CONFORME et de BDR-110.
|
||||
|
||||
Les maquettes R0 sont définitivement validées. Ne pas rouvrir leur conception.
|
||||
|
||||
## 1. Autorisation
|
||||
|
||||
Autorisation ciblée pour implémenter les scripts, configurations et tests nécessaires à la pile d'essai dédiée, selon docs/development/TRIAL_STACK.md et les arbitrages A11 à A15.
|
||||
|
||||
Cette autorisation ne couvre PAS le démarrage effectif de la pile ni la création de données.
|
||||
|
||||
## 2. Isolation
|
||||
|
||||
Créer une pile distincte de la sandbox automatisée et de Supabase DEV :
|
||||
|
||||
- Préfixe des conteneurs : faunosteo_trial_.
|
||||
- Commandes : pnpm db:trial.
|
||||
- Ports séparés, selon le plan validé.
|
||||
- Base de données, stockage, secrets, réseaux et volumes distincts.
|
||||
- Volumes persistants et sauvegardes contrôlées.
|
||||
- Limites mémoire adaptées aux ressources de l'hôte.
|
||||
- Aucune réutilisation des volumes, secrets ou noms de conteneurs de DEV ou de la sandbox.
|
||||
|
||||
Conserver les commandes db:sandbox trial* existantes, sans redirection implicite.
|
||||
|
||||
## 3. Sécurité
|
||||
|
||||
Mettre en place des garde-fous empêchant les suites E2E, Vitest ou les outils de réinitialisation de la sandbox d'utiliser la pile d'essai.
|
||||
|
||||
Privilégier des vérifications bloquantes : tout environnement ambigu doit provoquer un refus d'exécution.
|
||||
|
||||
Ne pas exposer les ports internes de PostgreSQL, Auth ou Storage au réseau local.
|
||||
|
||||
Prévoir la rotation des secrets sans perte de données.
|
||||
|
||||
Ne jamais écrire de secrets dans Git, les journaux ou les rapports.
|
||||
|
||||
## 4. Comptes d'essai
|
||||
|
||||
Prévoir deux comptes distincts :
|
||||
|
||||
- Owner/admin, pour les essais administratifs.
|
||||
- Praticien d'essai avec rôle admin technique et habilitation sheet_editor, sans owner, reviewer ou publisher.
|
||||
|
||||
Ne pas modifier la règle O1.
|
||||
|
||||
Documenter clairement que le second compte ne représente pas encore les autorisations d'un praticien de production.
|
||||
|
||||
Préserver les exigences MFA.
|
||||
|
||||
## 5. Cheval historique
|
||||
|
||||
Préparer une méthode reproductible pour charger la fiche équine de référence et ses illustrations.
|
||||
|
||||
Ne pas copier silencieusement des données de la sandbox actuelle.
|
||||
|
||||
Vérifier les empreintes, la présence des illustrations et l'intégrité du document importé.
|
||||
|
||||
Éviter les doublons en cas de relancement.
|
||||
|
||||
Ne pas modifier la fiche équine historique ni les données de DEV.
|
||||
|
||||
## 6. Tests
|
||||
|
||||
Exécuter uniquement les contrôles ne nécessitant pas de création ou de destruction d'environnement.
|
||||
|
||||
Vérifier :
|
||||
- Le ciblage exclusif des ressources trial.
|
||||
- Les collisions de ports et de noms.
|
||||
- Les garde-fous contre les tests automatisés.
|
||||
- La persistance prévue.
|
||||
- La sécurité des secrets.
|
||||
- Les chemins de sauvegarde et de restauration.
|
||||
- La compatibilité avec les commandes sandbox existantes.
|
||||
|
||||
Effectuer une revue indépendante du code et une revue de sécurité.
|
||||
|
||||
Commiter et pousser chaque lot validé.
|
||||
|
||||
## 7. Checkpoint avant création
|
||||
|
||||
Avant de lancer pnpm db:trial up ou une commande équivalente, fournir :
|
||||
|
||||
1. La liste exacte des ressources Docker qui seraient créées.
|
||||
2. Les ports réellement disponibles et les éventuels conflits.
|
||||
3. L'emplacement des volumes et sauvegardes.
|
||||
4. Les limites mémoire prévues.
|
||||
5. Les commandes de démarrage, arrêt, sauvegarde et rotation.
|
||||
6. La procédure de chargement de l'équin et des illustrations.
|
||||
7. Les résultats des tests et revues.
|
||||
8. La preuve que les commandes de test automatiques ne peuvent pas cibler cette pile.
|
||||
|
||||
S'arrêter et attendre l'accord explicite du propriétaire avant toute création effective.
|
||||
|
||||
## 8. Restrictions
|
||||
|
||||
Ne pas démarrer, réinitialiser ou supprimer de conteneur.
|
||||
|
||||
Ne pas toucher à la sandbox existante ni à ses 219 fiches.
|
||||
|
||||
Ne pas intervenir sur Supabase DEV.
|
||||
|
||||
Aucune migration SQL applicative, modification Rust, worker ou format documentaire.
|
||||
|
||||
Ne pas commencer R1 à R4, U2, U2b ou V1-2.7.
|
||||
|
||||
Aucune fusion ni déploiement.
|
||||
|
||||
Préserver les fichiers non suivis, notamment la revue ChatGPT.
|
||||
|
||||
S'arrêter au checkpoint de création de la pile d'essai.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: backup format and restore? / A: cold physical copy (stack stopped a few seconds, both volumes archived through a
|
||||
`--rm` helper container, secrets copy, restart) + new command `pnpm db:trial restore <backup>` with typed
|
||||
confirmation and an automatic backup first; same Postgres image required. Supersedes TRIAL_STACK.md §3.4 `pg_dump -Fc`.
|
||||
[gated 2026-11-09]
|
||||
Q: read-only dry run for the checkpoint? / A: new command `pnpm db:trial plan`: exact containers, volumes, network,
|
||||
each port free or taken, volume and backup locations, memory limits; no docker call that creates or changes anything.
|
||||
[gated 2026-11-09]
|
||||
Q: how far to change `scripts/db-sandbox.sh`? / A: guard only (refuse a trial state folder); `db-trial.sh` self-contained
|
||||
with its own image pins; no shared helper extraction (TRIAL_STACK.md §4 sentence superseded). [gated 2026-11-09]
|
||||
Q: public sign-up on the trial stack? / A: closed (`GOTRUE_DISABLE_SIGNUP=true`); accounts only through
|
||||
`pnpm db:trial account`. [gated 2026-11-09]
|
||||
Q: plan approval? / A: owner 2026-11-10 « Décision sur le plan db:trial »: architecture, lots A, B1, B2, B3, C and
|
||||
closure approved, conditional on R13 fixed in the plan (exact target identification, no ambiguous destination, no
|
||||
fallback, db:sandbox trial* preserved with non-regression tests) and an independent targeted counter-check; validated:
|
||||
exact interactive confirmations, piped or automated confirmations refused, harness outside check:all, grant without
|
||||
implicit admin, FAUNOSTEO_TRIAL_DIR checked on its canonical path incl. symlinks, no secrets.prev given a restorable
|
||||
protected prior backup, app address recomputed at each launch, ss checked explicitly. Authorisation covers writing and
|
||||
static or simulated checks only: no real create/start/stop/migration/restore/destroy/rotation, no DEV or sandbox, no
|
||||
merge or deploy; a script's interactive confirmation is never the owner's prior authorisation. [gated 2026-11-10]
|
||||
|
||||
Q: owner arbitrations at the creation checkpoint (HEAD 255dd67) / A: (1) shellcheck: the 15 directives are allowed
|
||||
for demonstrated false positives only, with minimal scope and a readable reason, global shellcheck clean, no other
|
||||
diagnostic masked (the file-wide SC2016 at the top of db-trial-check.sh does not qualify: to narrow). (2) LAN
|
||||
Playwright: before any LAN test the environment check proves the expected target, the container or service really
|
||||
used, the key issuer and that DEV cannot be reached; a port is no identity; 5193 vs 5194 explained and checked; any
|
||||
ambiguity refuses before connecting. (3) rotate-secrets: existing sessions invalidated, users sign in again:
|
||||
refresh tokens actually revoked and old access JWTs handled (revoking a session is not invalidating a JWT); real
|
||||
behaviour tested before the command is enabled, else it refuses and the limit is documented; DEV accounts and
|
||||
secrets untouched. (4) destroy: refused by default for keepable data without a backup verified by an isolated
|
||||
restore, PostgreSQL and Storage both; a backup file is never proof of restore; an explicit controlled procedure for
|
||||
an instance proved empty; no destroy in this step. (5) GO for the first create of faunosteo_trial only, after
|
||||
worktree/HEAD, Docker context/daemon, no overwrite, no concurrent run, static checks on the final code and proof
|
||||
that create depends on neither rotate-secrets, destroy nor the LAN test; then immediate checks 1-10; an exposed
|
||||
secret, a DEV target or a failed critical check interrupts, no optional step, real state reported, no secret shown.
|
||||
No merge, deploy, DEV change or DEV secret, no rotate-secrets before its validation, no destroy, no new network
|
||||
exposure, no DEV worker. [gated 2026-11-11]
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. `pnpm db:trial` (root `package.json`) runs `scripts/db-trial.sh` with the commands of TRIAL_STACK.md §4 (`create`,
|
||||
`start`, `stop`, `status`, `migrate`, `backup`, `rotate-keys`, `rotate-secrets`, `app`, `account <email>`,
|
||||
`grant <email> <right>`, `assets`, `destroy`); `pnpm db:sandbox` keeps every existing command, `trial`,
|
||||
`trial-account` and `trial-grant` included, with unchanged behaviour (no redirection to the trial stack).
|
||||
2. Docker resources of the trial stack are literal names only: containers `faunosteo_trial_db`, `_auth`, `_rest`,
|
||||
`_storage`, `_mail`, `_gateway`, network `faunosteo_trial_net`, volumes `faunosteo_trial_db` and
|
||||
`faunosteo_trial_storage`; every docker call of `db-trial.sh` that starts, stops, recreates or removes names one of
|
||||
them (helper containers excepted, prefixed `faunosteo_trial_` and `--rm`), never a filter or a pattern; no name,
|
||||
port, volume, network or secret is shared with DEV (`supabase_*_faunosteo`, 54321-54324) or the sandbox
|
||||
(`faunosteo_dbsandbox_*`, 57xxx, 5193).
|
||||
3. Ports: Postgres 127.0.0.1:58432, GoTrue :58999, PostgREST :58300, Storage :58500, Mailpit :58025, gateway :58801,
|
||||
all published on 127.0.0.1 only; the app on the validated trial host :5194 (`--strictPort`); every start refuses a
|
||||
taken port before any docker call and checks after start that each container publishes on 127.0.0.1 only.
|
||||
4. Persistence: Postgres data in volume `faunosteo_trial_db` at `PGDATA`, Storage files in `faunosteo_trial_storage`
|
||||
at `/mnt`; restart policy `no`; `start`/`stop`/rotation keep both volumes; a volume is removed only by `destroy`
|
||||
(and by the restore path if the gate adds one), after a typed confirmation.
|
||||
5. Resources: per container `--memory`, `--cpus 1`, `--pids-limit` as TRIAL_STACK.md §3.7 (Postgres 1 GiB with
|
||||
`shared_buffers` 128 MB, PostgREST 384 MiB, Storage 256 MiB, GoTrue 128 MiB, Mailpit and gateway 64 MiB); the app
|
||||
runs with `NODE_OPTIONS=--max-old-space-size=768`; `create` refuses when the host lacks the memory budget.
|
||||
6. Secrets: state folder `~/.cache/faunosteo-trial` (override `FAUNOSTEO_TRIAL_DIR`), mode 700, refused inside the
|
||||
repository and refused when it is (or holds) the sandbox state; files 600; values reach containers and tools through
|
||||
env files or stdin, never argv, script output, logs or Git; keys signed with the trial's own JWT secret, issuer
|
||||
distinct from `db-sandbox`, valid one year; `rotate-keys` re-signs both keys, `rotate-secrets` renews JWT secret,
|
||||
keys and role passwords without data loss, account passwords untouched; neither prints a secret.
|
||||
7. Isolation guards, blocking and fail-closed: `db-trial.sh` refuses to run when any `SANDBOX_*` variable is set; the
|
||||
sandbox suites (`packages/supabase/tests/sandbox/stack.ts` and every importer, the shell and LAN Playwright
|
||||
configs) refuse any target that is not the sandbox's exact container, loopback ports and key issuer before their
|
||||
first request; `db-sandbox.sh` refuses a state folder that belongs to the trial stack; `e2e:avatar` and
|
||||
`e2e:sheet-assets` still refuse anything but the sandbox.
|
||||
8. Accounts: `account <email>` creates a confirmed account through GoTrue's admin API, password at a hidden prompt
|
||||
(twice, 12 characters min.), never printed; `grant` assigns platform roles `owner` / `admin` only through
|
||||
`private.assign_platform_role(null, …)` from a JWT-less session after the operator check of §5.7.1 (verified TOTP
|
||||
factors present) and catalogue rights as the sandbox does; O1 and every migration unchanged; no MFA factor, aal or
|
||||
session is written by the script; docs state that the practitioner account (technical `admin` + `sheet_editor`) is
|
||||
not a production practitioner profile.
|
||||
9. Equine sheet: `create` applies the branch's migrations and `equine_draft.sql` only (never `seed.sql`), after
|
||||
checking the seed folder's hashes; it then checks in the database that the historical sheet is the only official
|
||||
sheet and that its draft content equals `document.json`; `assets` uploads the drawings with the existing
|
||||
`upload-sheet-assets` tool through the trial gateway (no overwrite, rerun = nothing to do) and checks every asset
|
||||
row uploaded; no data copied from the sandbox; seed files untouched.
|
||||
10. `migrate` takes a backup first (A15), refuses when a migration already applied differs from its file, applies the
|
||||
new ones with `--db-url` on 58432 only, and reloads PostgREST's schema.
|
||||
11. `backup` writes into `<state>/backups/` (700/600, never pruned by the script) what a restore needs, secrets copy
|
||||
included; the restore path follows the gate's decision.
|
||||
12. Environment-free checks only (no container, volume or network created, started, stopped or removed during the
|
||||
run): `shellcheck` clean on the new and changed scripts; a stub harness proves criteria 2-7, 10-11 on the docker
|
||||
and curl calls the script would make, with no daemon reachable; the guard's unit tests run in `pnpm test:run`;
|
||||
`pnpm typecheck`, `pnpm lint`, `pnpm test:run` green.
|
||||
13. Untouched: `supabase/migrations/`, `supabase/seed/`, `crates/`, document and archive formats, DEV, the sandbox's
|
||||
containers and data, the untracked review files.
|
||||
14. Docs: `SUPABASE.md` (trial stack section, rotation procedure), `V1-2-6_OWNER_TRIAL.md`, `TRIAL_STACK.md` status,
|
||||
`CLAUDE.md` commands, `.claude/tasks/TODO.md`.
|
||||
15. Stop at the creation checkpoint with the 8 items of §7 of the request; no `create` run.
|
||||
16. [gated 2026-11-10] R13: the trial dev server (`apps/app/vite/trial.config.ts`, shared with `db:sandbox trial`)
|
||||
serves exactly one of two literal targets (`apps/app/vite/trial-targets.ts`): sandbox = app 5193, gateway
|
||||
`http://127.0.0.1:57801`, key issuer `db-sandbox`; trial = app 5194, gateway `http://127.0.0.1:58801`, issuer
|
||||
`faunosteo-trial`, gateway identity `faunosteo_trial`; any other gateway, port, app URL, issuer or role is refused,
|
||||
no default, no fallback; the exact values `db-sandbox.sh` passes today stay accepted (non-regression tests).
|
||||
`db-trial.sh` checks before each operation the target container's exact loopback publication, the trial gateway's
|
||||
identity, and every key it hands over (issuer, role, HMAC with the trial secret, values never in argv). The
|
||||
independent R13 counter-check returned CONFORME (or every finding it raised is closed in the plan) before lot A2.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm --filter @faunosteo/app exec vitest run tests/unit/vite.trialTargets.test.ts tests/unit/vite.trialConfig.test.ts && pnpm --filter @faunosteo/app exec tsc -p tsconfig.node.json --noEmit && pnpm --filter @faunosteo/supabase exec vitest run tests/sandbox-target.test.ts && echo GUARD-TESTS-OK
|
||||
EXPECT: GUARD-TESTS-OK
|
||||
EVIDENCE: MET exit=0 marker-found :: RUN v3.2.7 /home/bchanot/Documents/faunosteo-v1-2/apps/app stderr | tests/unit/vite.trialConfig.test.ts > shared trial dev server config, as…
|
||||
17. [gated 2026-11-10] The stub harness passes in full with simulated services only (docker, curl, ss, node and env
|
||||
wrapped; no daemon reachable), including: typed confirmations of `destroy` (`faunosteo_trial`), `restore`
|
||||
(`restore <name>`) and `grant` (`grant <role>`) through a terminal only, piped phrases refused; `grant` never adds
|
||||
`admin` implicitly; `FAUNOSTEO_TRIAL_DIR` refused on its canonical path (symlink into the repository or onto the
|
||||
sandbox state, any git work tree); `ss` missing or failing refuses (never read as a free port); `rotate-keys` and
|
||||
`rotate-secrets` take a verified backup first (700/600, checksums, previous `secrets.env` inside); no secret in
|
||||
any logged argv. bash -n and shellcheck are never offered as proof of real behaviour.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && bash scripts/db-trial-check.sh
|
||||
EXPECT: db-trial-check: ALL PASS
|
||||
EVIDENCE: MET exit=0 marker-found :: -- static PASS shellcheck: db-trial.sh and this harness PASS shellcheck: db-sandbox.sh (pre-existing SC1090, SC1091, SC2016 excluded) PASS d…
|
||||
18. [gated 2026-11-10] Static checks: shellcheck clean on `db-trial.sh`, the harness and `db-sandbox.sh`.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && shellcheck -x scripts/db-trial.sh scripts/db-trial-check.sh && shellcheck -e SC1090,SC1091,SC2016 scripts/db-sandbox.sh && echo SHELLCHECK-OK
|
||||
EXPECT: SHELLCHECK-OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SHELLCHECK-OK
|
||||
19. [gated 2026-11-10] Project suites green.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm typecheck && pnpm lint && pnpm test:run && echo SUITES-GREEN
|
||||
EXPECT: SUITES-GREEN
|
||||
EVIDENCE: MET exit=0 marker-found :: > faunosteo@0.1.0 typecheck /home/bchanot/Documents/faunosteo-v1-2 > pnpm -r typecheck Scope: 3 of 4 workspace projects packages/core-wasm t…
|
||||
20. [gated 2026-11-10] `scripts/db-sandbox.sh` gains lines and loses none since b215b89 (its commands unchanged).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && test "$(git diff --numstat b215b89 -- scripts/db-sandbox.sh | awk '{print ($1>0 && $2==0) ? "ok" : "bad"}')" = ok && echo SANDBOX-ADDITIONS-ONLY
|
||||
EXPECT: SANDBOX-ADDITIONS-ONLY
|
||||
EVIDENCE: MET exit=0 marker-found :: SANDBOX-ADDITIONS-ONLY
|
||||
21. [gated 2026-11-10] Untouched: migrations, seed and crates (committed and working tree).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet b215b89 -- supabase/migrations supabase/seed crates && test -z "$(git status --porcelain -- supabase/migrations supabase/seed crates)" && echo UNTOUCHED
|
||||
EXPECT: UNTOUCHED
|
||||
EVIDENCE: MET exit=0 marker-found :: UNTOUCHED
|
||||
22. [gated 2026-11-10] Nothing real created: no `faunosteo_trial*` container, volume or network, no state folder
|
||||
(the pattern is first proven on a fixture line, the listings must succeed).
|
||||
CHECK: printf 'faunosteo_trial_db\n' | grep -q '^faunosteo_trial' && c=$(docker ps -a --format '{{.Names}}') && v=$(docker volume ls --format '{{.Name}}') && n=$(docker network ls --format '{{.Name}}') && ! printf '%s\n%s\n%s\n' "$c" "$v" "$n" | grep -q '^faunosteo_trial' && test ! -e "$HOME/.cache/faunosteo-trial" && echo NOTHING-CREATED
|
||||
EXPECT: NOTHING-CREATED
|
||||
EVIDENCE: MET exit=0 marker-found :: NOTHING-CREATED
|
||||
23. [gated 2026-11-10] The untracked review files are kept.
|
||||
CHECK: test -f /home/bchanot/Documents/faunosteo-v1-2/faunosteo-v1-2-6-revue-ux-chatgpt.md && test -f /home/bchanot/Documents/faunosteo/faunosteo-v1-2-4-revue-chatgpt.md && echo REVIEWS-KEPT
|
||||
EXPECT: REVIEWS-KEPT
|
||||
EVIDENCE: MET exit=0 marker-found :: REVIEWS-KEPT
|
||||
24. [gated 2026-11-10] Each lot (A, A2, B1, B2, B3, C) tested, reviewed, committed and pushed before the next; no
|
||||
merge, no deploy, no real create/start/stop/migrate/restore/destroy/rotation, DEV and the sandbox untouched; the
|
||||
closure report gives the exact R13 counter-check verdict, test results, security review, the 8 checkpoint items
|
||||
and the read-only `pnpm db:trial plan` output, then stops for the owner's explicit go.
|
||||
|
||||
## FILE SCOPE
|
||||
- new: `scripts/db-trial.sh`, the stub harness under `scripts/`, the guard module and its unit test under
|
||||
`packages/supabase/tests/`
|
||||
- changed: `package.json` (one script), `scripts/db-sandbox.sh` (state-folder guard),
|
||||
`packages/supabase/tests/sandbox/stack.ts`, `apps/app/e2e/playwright.shell.config.ts`,
|
||||
`apps/app/e2e/playwright.lan.config.ts`, `apps/app/vite/trial.config.ts` (target table checks, R13 [gated
|
||||
2026-11-10]); new `apps/app/vite/trial-targets.ts`, `apps/app/tests/unit/vite.trialTargets.test.ts` and
|
||||
`apps/app/tests/unit/vite.trialConfig.test.ts`
|
||||
- docs: `docs/development/{SUPABASE,V1-2-6_OWNER_TRIAL,TRIAL_STACK}.md`, `CLAUDE.md`, `.claude/tasks/TODO.md`
|
||||
- orchestrator artifacts (named after GATE 1, 2026-11-10; not a criterion change): this contract and the plan
|
||||
`.claude/tasks/plans/2026-11-09-db-trial-stack.md` (review record of every lot and of the R13 counter-check)
|
||||
@@ -0,0 +1,194 @@
|
||||
# CONTRACT — v1-2-6-trial-arbitrations
|
||||
- date: 2026-11-09 | flow: design and documentation only (R0 mockups, plans, tracking) | branch: feature/v1-2-anatomical-sheets
|
||||
- status: closed 2026-11-09 (closing counter-check CONFORME; R0 graphically validated, BDR-110)
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the
|
||||
`supabase_*_faunosteo` containers are DEV). The sandbox `faunosteo_dbsandbox_*` is read only (select queries), never
|
||||
reset, cleaned or written; the owner's running trial (`faunosteo_dbsandbox_trial_gateway`) is left alone.
|
||||
- base: 8cb681e. Commit in place, push; no merge, no `gitflow.sh finish`.
|
||||
- untracked file kept: `faunosteo-v1-2-6-revue-ux-chatgpt.md`.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
# FAUNOSTEO — V1-2.6 UX — Arbitrages du premier essai propriétaire
|
||||
|
||||
Le propriétaire a examiné le diagnostic et prend les décisions suivantes.
|
||||
|
||||
## 1. Références : nouvelle direction approuvée
|
||||
|
||||
Rétablir un cinquième onglet principal « Références », placé entre Constats et Vérification.
|
||||
|
||||
L'onglet devient le point d'accès principal à la bibliothèque de références.
|
||||
|
||||
Le bouton Références de l'en-tête devient inutile et sera supprimé.
|
||||
|
||||
Conserver un volet contextuel accessible depuis le détail d'un constat, filtré sur ses citations, avec une action « Tout afficher » menant à l'onglet principal.
|
||||
|
||||
Le volet sera plus large, environ 34 rem sous réserve de l'espace disponible, avec une animation latérale discrète de 150 à 200 ms et prise en compte de prefers-reduced-motion.
|
||||
|
||||
L'onglet principal présentera :
|
||||
- Des tuiles repliables et dépliables.
|
||||
- La citation abrégée, le type et le nombre de citations en état fermé.
|
||||
- Les informations complètes, DOI, URL et actions en état ouvert.
|
||||
- Une recherche instantanée avec bouton d'effacement.
|
||||
- Un tri par ordre documentaire, A–Z, nombre de citations ou type.
|
||||
- L'ordre documentaire comme tri par défaut.
|
||||
|
||||
Le tri ne doit jamais modifier le document. Les commandes de réorganisation ne sont disponibles que lorsque l'ordre documentaire est affiché.
|
||||
|
||||
Préserver les modifications non enregistrées, le focus, « Aller à », les permissions, le mode lecture seule et les tests d'accessibilité.
|
||||
|
||||
Sous 640 px, intégrer Références au menu « Plus ».
|
||||
|
||||
IMPORTANT : conformément aux règles du projet, produire les nouvelles maquettes et obtenir leur validation avant toute modification du code de l'interface.
|
||||
|
||||
## 2. Historique
|
||||
|
||||
Valider « Défaire » / « Refaire » à la place de « Annuler » / « Rétablir » pour l'historique.
|
||||
|
||||
Conserver des noms accessibles explicites, les raccourcis clavier et la distinction avec les boutons Annuler des dialogues.
|
||||
|
||||
## 3. Désélection
|
||||
|
||||
Prévoir un bouton « Désélectionner » près de « Supprimer ».
|
||||
|
||||
Échap désélectionne si aucun dialogue, volet prioritaire, menu ou tracé en cours ne consomme cette touche.
|
||||
|
||||
La désélection est un état d'interface, sans modification du document ni entrée d'historique.
|
||||
|
||||
Le clic sur une zone vide du dessin reste à définir dans U2.
|
||||
|
||||
## 4. Liste des fiches
|
||||
|
||||
Prévoir :
|
||||
- Recherche instantanée et effacement.
|
||||
- Tri par dernière modification (par défaut) ou nom.
|
||||
- Date de dernière modification visible.
|
||||
- Amélioration des cartes de l'accueil Administration.
|
||||
|
||||
Ne pas coder une section dédiée aux fiches historiques sur la base d'UUID, noms, slugs ou conventions propres aux tests.
|
||||
|
||||
La liste doit rester générique pour toutes les espèces.
|
||||
|
||||
Ne pas ajouter de filtre de test artificiel au produit.
|
||||
|
||||
## 5. Isolation des environnements
|
||||
|
||||
Le propriétaire choisit une pile d'essai manuelle dédiée et persistante, séparée de la sandbox automatisée.
|
||||
|
||||
Préparer un plan technique pour cette séparation :
|
||||
- Conteneurs, réseau et ports distincts.
|
||||
- Secrets, stockage et base de données distincts.
|
||||
- Aucun accès accidentel des suites E2E à la pile manuelle.
|
||||
- Commandes explicites pour démarrer et arrêter la pile.
|
||||
- Procédure de création d'un compte d'essai.
|
||||
- Méthode sûre de retrouver la fiche équine et ses illustrations.
|
||||
- Isolation mémoire et ressources pour éviter toute perturbation de DEV.
|
||||
|
||||
Ne pas créer, réinitialiser ou supprimer de pile pour le moment.
|
||||
|
||||
Ne pas toucher aux données existantes.
|
||||
|
||||
## 6. Anomalies de test à corriger séparément
|
||||
|
||||
Créer des éléments de suivi dédiés pour :
|
||||
|
||||
A. Empreintes fictives utilisées par certaines suites de test : remplacer la fabrication de fausses empreintes par le calcul réel du cœur, sans affaiblir les contrôles d'intégrité.
|
||||
|
||||
B. Copie de travail créée par sheets-admin.sandbox.ts et jamais archivée : corriger l'indépendance et le nettoyage des tests, sans toucher à la copie existante avant autorisation.
|
||||
|
||||
C. État d'échec du contrôle d'intégrité dans les cartes du catalogue : afficher un avertissement compréhensible dès la liste, sans masquer ni contourner l'échec.
|
||||
|
||||
Conserver ces travaux distincts de la refonte graphique U1 et de U2.
|
||||
|
||||
## 7. Plan de correction UX
|
||||
|
||||
Préparer les lots suivants :
|
||||
- R0 : nouvelles maquettes et validation propriétaire.
|
||||
- R1 : libellés de l'historique et désélection.
|
||||
- R2 : cinquième onglet Références et présentation des références.
|
||||
- R3 : recherche, tri et présentation générique de la liste des fiches.
|
||||
- R4 : signalement visuel des échecs d'intégrité dans le catalogue, en correctif indépendant.
|
||||
|
||||
Prévoir les tests unitaires, E2E, d'accessibilité et de non-régression adaptés.
|
||||
|
||||
Toute modification du schéma SQL ou du cœur Rust nécessite un checkpoint spécifique.
|
||||
|
||||
## 8. Restrictions
|
||||
|
||||
Cette intervention est limitée à la conception, à la documentation et aux propositions de plan.
|
||||
|
||||
Aucun code d'application ou de scripts ne doit encore être modifié.
|
||||
|
||||
Ne pas toucher à DEV.
|
||||
|
||||
Ne pas réinitialiser ni nettoyer la sandbox.
|
||||
|
||||
Ne supprimer, archiver ou modifier aucune fiche existante.
|
||||
|
||||
Ne pas fusionner, déployer ni commencer U2, U2b ou V1-2.7.
|
||||
|
||||
Préserver les fichiers non suivis.
|
||||
|
||||
Soumettre les maquettes, les plans et les arbitrages éventuels au propriétaire, puis s'arrêter.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- Fact found before the plan (2026-11-09, read-only): `save_sheet_draft` writes `anatomical_sheet_versions` only
|
||||
(`supabase/migrations/20261028110000_sheet_review_workflow.sql:569-630`), while the admin list payload carries
|
||||
`anatomical_sheets.updated_at` (`supabase/migrations/20261102100000_sheet_admin_reads.sql:54`). On the sandbox, 28 of
|
||||
219 official sheets have a version newer than the sheet row. A true « dernière modification » therefore needs a read
|
||||
change in SQL (owner checkpoint, request §7) or a documented approximation: this is an arbitration for the owner,
|
||||
never settled by the implementer.
|
||||
- Open questions are listed for the owner in `docs/development/V1-2-6_U1_CORRECTIONS.md`, never answered by the
|
||||
implementer.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. R0 boards (request §1 to §4, §6 C): a new folder `docs/design/v1-2-6-r0/` holds `maquettes.html`, its data
|
||||
generator and generated data, one PNG per board rendered with the pinned Chromium (`docs/design/v1-2-6/render.cjs`),
|
||||
a contact sheet and `REVUE.md`. The boards draw: the editor with five tabs and no « Références » header button; the
|
||||
Références tab (collapsed and expanded tiles, instant search with a clear button, the four sorts with document order
|
||||
as default, reorder commands only in document order, empty result, read-only mode); the contextual panel opened
|
||||
from a finding (filtered, « Tout afficher », about 34 rem, slide 150-200 ms and its reduced-motion variant); history
|
||||
« Défaire » / « Refaire » next to a dialog « Annuler »; « Désélectionner » next to « Supprimer » and the Escape
|
||||
priority; the phone « Plus » menu holding Références; the admin sheet list (search, clear, sort by last change or
|
||||
name, visible date, generic for every species, no historical section, no test filter) on desktop and phone; the
|
||||
Administration home card; the catalogue card in integrity failure.
|
||||
2. Data truth: every reference, citation count, finding name and type on the boards comes from the equine draft
|
||||
`supabase/seed/anatomical-sheets/equine/draft/document.json` through the generator; staging text (sheet list rows,
|
||||
dates, user names, unsaved counts) is listed as such in `REVUE.md`. No board uses a test-data name (`Fiche e2e`,
|
||||
`Cheval sandbox`, slugs `e2e-`, `sb-`, `wc-`, `perf-`).
|
||||
3. Identity: the boards reuse the validated identity (tokens, shell, components, icons) of `docs/design/v1-2-6/` and
|
||||
the U1 shell as built (`apps/app/src/components/editor/*`), with no new design system; each visible label that is
|
||||
new is listed in `REVUE.md` with its FR and EN proposal.
|
||||
4. Plan (request §7): `docs/development/V1-2-6_U1_CORRECTIONS.md` records the owner's decisions of this brief, which
|
||||
earlier validated decisions they supersede (checkpoint §1 choices, contract AC, board 11, BDR-099 item 5, U2b F5)
|
||||
and lots R0 to R4, each with files, unit, e2e, accessibility and non-regression tests, gates, and any SQL or Rust
|
||||
need flagged as a specific checkpoint; the open arbitrations are listed with a recommendation each.
|
||||
5. Trial stack (request §5): `docs/development/TRIAL_STACK.md` is a technical plan covering the seven points of the
|
||||
request, grounded in `scripts/db-sandbox.sh` and the e2e support code with file:line references; it proposes the
|
||||
command names as an arbitration; nothing is created, started or stopped.
|
||||
6. Tracking (request §6): `.claude/tasks/TODO.md` holds three separate items A, B, C with their cause, files and
|
||||
constraint (A no weaker integrity check, B no change to the existing copy before authorisation, C failure shown
|
||||
never hidden), a trial-stack item, and the R0-R4 line; memory records the owner's decisions (BDR) through
|
||||
`memory.sh`.
|
||||
7. Restrictions (request §8): the branch diff from 8cb681e touches only `docs/`, `.claude/tasks/`, `.claude/memory/`;
|
||||
no file under `apps/`, `packages/`, `crates/`, `supabase/`, `scripts/` changes; the sandbox holds the same official
|
||||
sheet count (219) and the same working copy `8c315a12-20d4-4432-9db3-7cb88b27a5b4` before and after; the untracked
|
||||
review file is still present.
|
||||
|
||||
## FILE SCOPE
|
||||
docs/design/v1-2-6-r0/**, docs/design/README.md, docs/development/V1-2-6_U1_CORRECTIONS.md,
|
||||
docs/development/TRIAL_STACK.md, .claude/tasks/TODO.md, .claude/tasks/contracts/this file, .claude/memory/*
|
||||
|
||||
## CLARIFICATIONS (owner brief « R0 — Décisions propriétaire et dernière validation graphique », 2026-11-09, BDR-108)
|
||||
- Ratified A3, A6 (with precision), A7 (dedicated SQL checkpoint, interim without date), A11 name `pnpm db:trial`;
|
||||
A12 decided as « keep `db:sandbox trial*` for now »; A13 decided as two accounts; secret renewal; R4 accepted.
|
||||
- Asked in this round, docs only: review archive outside the repository (8 boards, contact sheet, REVUE.md,
|
||||
V1-2-6_U1_CORRECTIONS.md, TRIAL_STACK.md, full A1-A15 table `docs/design/v1-2-6-r0/ARBITRAGES.md`); a targeted
|
||||
independent counter-check of the two last conformity fixes (criterion 3); the `impeccable detect` status and a
|
||||
compliant proposal, nothing installed or run. Stop at the graphic checkpoint.
|
||||
|
||||
## CLARIFICATIONS (owner graphic verdict « R0 — Verdict de revue graphique propriétaire », 2026-11-09, BDR-109)
|
||||
- FILE SCOPE gains `docs/development/V1-2-6_R3_SQL_CHECKPOINT.md` (asked by the owner under A7 « préparer un checkpoint
|
||||
SQL dédié »; created in 84aba41 before this line; flagged out of scope by the counter-check of this round).
|
||||
- Authorised this round: boards 23, 24, 26 corrected, annotations of 28 and 29, `impeccable detect` 4.1.0 from the
|
||||
local cache without network; 25, 27, 30 byte-identical; then the final R0 checkpoint.
|
||||
@@ -0,0 +1,61 @@
|
||||
# CONTRACT — trial-init-log-leak
|
||||
- date: 2026-11-11 | flow: bugfix | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
FAUNOSTEO — Correction minimale de la fuite TR_PW (owner, 2026-11-11), part 3 and the scope lines that bind it:
|
||||
|
||||
3. Empêcher que la fuite se reproduise
|
||||
|
||||
Corriger uniquement la cause identifiée.
|
||||
|
||||
Le script d'initialisation de l'image PostgreSQL écrit une instruction ALTER USER contenant le mot de passe pendant que log_statement est actif.
|
||||
|
||||
Configurer PostgreSQL pour désactiver la journalisation des instructions dès le premier démarrage, avant l'exécution des scripts d'initialisation.
|
||||
|
||||
Vérifier que la configuration est bien transmise au serveur temporaire d'initialisation utilisé par l'image.
|
||||
|
||||
Ajouter un test ciblé et consigner ce risque comme point obligatoire de vérification pour toute future installation de production.
|
||||
|
||||
Pas de refonte de l'infrastructure ni de campagne générale de durcissement.
|
||||
|
||||
5. Périmètre
|
||||
|
||||
Ne pas toucher maintenant aux autres sujets : Playwright LAN, destroy, révocation des sessions, durcissement général ou nettoyage des fichiers temporaires.
|
||||
|
||||
Ne pas créer de comptes, importer d'assets, fusionner de branche ni déployer.
|
||||
|
||||
Commits et push autorisés sur la branche de travail après vérification.
|
||||
|
||||
Enregistrer simplement la cause, le correctif et la vérification à prévoir avant production.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: where is the mandatory pre-production check recorded? / A: delegated — DEPLOY.md "Security prerequisites before deploying anything built from `develop`" (the production gate list), plus the trial's own record in docs/development/SUPABASE.md §5.2.
|
||||
Q: also close adjacent paths (log_min_error_statement at init, migrate.sh's password in psql argv, db-sandbox.sh's identical DB_INIT)? / A: no — owner: "Corriger uniquement la cause identifiée", sandbox untouched; they are named as residual risks in the docs, not fixed.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. The database container's command line hands `-c log_statement=none` to the image entrypoint after `postgres`, so that `docker_temp_server_start "$@"` passes it to the init temp server (and the final server): the `exec docker-entrypoint.sh postgres` line of DB_INIT in scripts/db-trial.sh carries it.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -E "exec docker-entrypoint\.sh postgres( [^ ]+)* -c log_statement=none( |$)" scripts/db-trial.sh | grep -q . && echo INIT_FLAG_OK
|
||||
EXPECT: INIT_FLAG_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: INIT_FLAG_OK
|
||||
2. The fake-Docker harness carries a targeted check on the db container's `docker run` line asserting that flag on the entrypoint's `postgres` line (the first line of the `sh -c` script), and the whole harness passes.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "log_statement=none" scripts/db-trial-check.sh && bash scripts/db-trial-check.sh </dev/null > /tmp/claude-1000/-home-bchanot-Documents-faunosteo/463d8810-0112-4b67-92e4-aa3c30af6089/scratchpad/gate-harness.txt 2>&1 && tail -n 1 /tmp/claude-1000/-home-bchanot-Documents-faunosteo/463d8810-0112-4b67-92e4-aa3c30af6089/scratchpad/gate-harness.txt
|
||||
EXPECT: db-trial-check: ALL PASS
|
||||
EVIDENCE: MET exit=0 marker-found :: db-trial-check: ALL PASS
|
||||
3. Positive control: with the flag removed from DB_INIT (temporarily, on the working copy, then restored), the new check FAILS by name; the executor reports that red run (check name and FAIL line) and the restoration.
|
||||
4. bash -n and shellcheck stay clean on both scripts (no new directive).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && bash -n scripts/db-trial.sh && bash -n scripts/db-trial-check.sh && shellcheck -x scripts/db-trial.sh scripts/db-trial-check.sh && [ "$(git diff -U0 -- scripts | grep -c '^+.*shellcheck disable')" -eq 0 ] && echo LINT_OK
|
||||
EXPECT: LINT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: LINT_OK
|
||||
5. The docs record the cause (the image's migrate.sh sends the password as SQL text on the init temp server while postgresql.conf sets log_statement = 'ddl'), the fix (`-c log_statement=none` on the server command line, passed to the init temp server by the entrypoint), and a mandatory pre-production verification (statement logging off from the first start, and the container log scanned for the password after init) for any self-hosted production database on this image; DEPLOY.md's security prerequisites list carries the verification.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "log_statement=none" DEPLOY.md && grep -q "log_statement=none" docs/development/SUPABASE.md && echo DOCS_OK
|
||||
EXPECT: DOCS_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: DOCS_OK
|
||||
6. Scope: only scripts/db-trial.sh, scripts/db-trial-check.sh, docs/development/SUPABASE.md and DEPLOY.md change; db-sandbox.sh, migrations, seed, crates and apps untouched; the untracked ChatGPT review file kept.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD | grep -vxE 'scripts/db-trial\.sh|scripts/db-trial-check\.sh|docs/development/SUPABASE\.md|DEPLOY\.md|\.claude/tasks/.*')" ] && [ -f faunosteo-v1-2-6-revue-ux-chatgpt.md ] && echo SCOPE_OK
|
||||
EXPECT: SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE_OK
|
||||
7. No secret value, no new network exposure, no change to any other DB_INIT line or container option.
|
||||
|
||||
## FILE SCOPE
|
||||
scripts/db-trial.sh (DB_INIT exec line and the comment above DB_INIT), scripts/db-trial-check.sh (one targeted check next to the existing init logging checks, ~line 725), docs/development/SUPABASE.md (§5.2 trial paragraph on the init), DEPLOY.md (security prerequisites list)
|
||||
@@ -0,0 +1,60 @@
|
||||
# CONTRACT — trial-owner-one-factor
|
||||
- date: 2026-11-11 | flow: feat | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
FAUNOSTEO — Modification de la règle MFA
|
||||
|
||||
Je souhaite modifier la décision concernant le nombre de facteurs TOTP.
|
||||
|
||||
Un seul facteur TOTP enrôlé et vérifié doit suffire pour les comptes owner, admin et praticien.
|
||||
|
||||
Un deuxième facteur reste facultatif comme méthode de secours.
|
||||
|
||||
Vérifie où la règle des deux facteurs obligatoires pour owner est appliquée (scripts db:trial, contrats, tests et règles de sécurité).
|
||||
|
||||
Adapte cette règle si elle est spécifique à la pile d'essai, tout en conservant :
|
||||
- L'obligation d'un TOTP vérifié avant l'attribution des rôles privilégiés.
|
||||
- Le niveau AAL2 exigé pour les opérations sensibles.
|
||||
- Les contrôles d'autorisation existants.
|
||||
- L'absence de contournement du MFA.
|
||||
|
||||
Ne modifie pas les règles de production sans étude et autorisation distinctes.
|
||||
|
||||
Teste, fais vérifier et documente le changement avant de reprendre les commandes grant.
|
||||
|
||||
Ne touche ni à DEV ni à la sandbox automatisée. Ne recrée aucun compte et ne réinitialise aucune donnée.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: where is the two-factor owner rule applied? / A: (investigation, main loop) enforced only by scripts/db-trial.sh (`need=2` for owner in grant_platform_role) and pinned by scripts/db-trial-check.sh; the SQL (`private.assign_platform_role`, `private.has_verified_totp`) requires one verified factor on the session path and none on the operator path, never two; the contract docs/development/V1-2_ANATOMICAL_SHEETS.md §5.7.1, §5.7.2, §5.7.7 state "two factors on two devices before the first grant on any stack" as an operator procedure (covers production); docs/development/IDENTITY.md calls it a recommendation; apps/app/e2e/shell/admin.spec.ts A0 and packages/supabase/tests/sandbox/seed-owner-mfa.sandbox.ts enrol two factors as a scenario (they do not require two; sandbox suites, untouched).
|
||||
Q: production rule? / A: unchanged (owner: no production rule change without a distinct study and authorisation): V1-2 §5.7 keeps its text; a dated note scopes the db:trial exception; IDENTITY.md untouched.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. scripts/db-trial.sh grants `owner` with one verified TOTP factor, as `admin`: no factor count of 2 remains in grant_platform_role; the factor count before the typed confirmation and the recount inside the grant transaction (`>= :need`, `\gset` fails on zero rows) both stay, with need = 1.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && f=scripts/db-trial.sh && ! grep -qE 'need=2|\|\| need=' "$f" && grep -q 'local need=1' "$f" && grep -q '>= :need' "$f" && grep -q 'factor_count "\$1"' "$f" && grep -q 'confirm "grant \$2"' "$f" && echo ONE_FACTOR_OK
|
||||
EXPECT: ONE_FACTOR_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: ONE_FACTOR_OK
|
||||
2. The harness pins it: owner with 0 verified factors refused ("owner needs 1", nothing granted, no role SQL); owner with 1 factor granted with `-v need=1`; owner with 2 factors still granted (optional backup); the in-transaction recount falling to 0 refuses, nothing granted; admin and catalogue-right cases unchanged; the whole harness passes.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q 'owner needs 1' scripts/db-trial-check.sh && grep -q -- '-v role=owner -v need=1' scripts/db-trial-check.sh && ! grep -q 'need=2' scripts/db-trial-check.sh && bash scripts/db-trial-check.sh </dev/null > /tmp/claude-1000/-home-bchanot-Documents-faunosteo/463d8810-0112-4b67-92e4-aa3c30af6089/scratchpad/gate-harness-mfa.txt 2>&1 ; tail -n 1 /tmp/claude-1000/-home-bchanot-Documents-faunosteo/463d8810-0112-4b67-92e4-aa3c30af6089/scratchpad/gate-harness-mfa.txt
|
||||
EXPECT: db-trial-check: ALL PASS
|
||||
EVIDENCE: MET exit=0 marker-found :: db-trial-check: ALL PASS
|
||||
3. Kept unchanged: every SQL file, the catalogue-right checks (`private.has_verified_totp` before sheet_editor / reviewer / publisher), aal2 in the app and RPCs, the operator-path audit row; no MFA bypass added.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD -- supabase apps packages crates scripts/db-sandbox.sh)" ] && [ "$(git diff -U0 HEAD -- scripts/db-trial.sh | grep -cE '^[-+].*(has_verified_totp|is_platform_admin|log_event|assign_platform_role)')" -eq 0 ] && echo KEPT_OK
|
||||
EXPECT: KEPT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: KEPT_OK
|
||||
4. bash -n and shellcheck clean, no new directive.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && bash -n scripts/db-trial.sh && bash -n scripts/db-trial-check.sh && shellcheck -x scripts/db-trial.sh scripts/db-trial-check.sh && [ "$(git diff -U0 HEAD -- scripts | grep -c '^+.*shellcheck disable')" -eq 0 ] && echo LINT_OK
|
||||
EXPECT: LINT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: LINT_OK
|
||||
5. Docs: SUPABASE.md §5.2 (grant row, first-use step 1) and the script's `account` hint say one verified factor for owner and admin, a second optional as backup; V1-2_ANATOMICAL_SHEETS.md carries a dated note (owner 2026-11-11) that the db:trial stack takes one factor for the owner grant while the rule for every other stack (production included) is unchanged pending a distinct study and authorisation; IDENTITY.md unchanged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && ! grep -q 'two for owner' docs/development/SUPABASE.md && ! grep -q 'enrol two TOTP' docs/development/SUPABASE.md && grep -q '2026-11-11' docs/development/V1-2_ANATOMICAL_SHEETS.md && [ -z "$(git diff --name-only HEAD -- docs/development/IDENTITY.md)" ] && ! grep -q 'two factors for the owner account' scripts/db-trial.sh && echo DOCS_OK
|
||||
EXPECT: DOCS_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: DOCS_OK
|
||||
6. Scope: only scripts/db-trial.sh, scripts/db-trial-check.sh, docs/development/SUPABASE.md, docs/development/V1-2_ANATOMICAL_SHEETS.md change; the untracked ChatGPT review file kept.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD | grep -vxE 'scripts/db-trial\.sh|scripts/db-trial-check\.sh|docs/development/SUPABASE\.md|docs/development/V1-2_ANATOMICAL_SHEETS\.md|\.claude/tasks/.*')" ] && [ -f faunosteo-v1-2-6-revue-ux-chatgpt.md ] && echo SCOPE_OK
|
||||
EXPECT: SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE_OK
|
||||
7. No secret, no DEV or sandbox action, no account or data change (harness = fake Docker only).
|
||||
|
||||
## FILE SCOPE
|
||||
scripts/db-trial.sh (grant_platform_role ~1719-1747, its comment ~1696-1700, the account hint ~1693), scripts/db-trial-check.sh (grant cases ~1211-1242 and ~1312-1323), docs/development/SUPABASE.md (§5.2 grant row ~867, first-use ~874), docs/development/V1-2_ANATOMICAL_SHEETS.md (§5.7.1 step 2 dated note, §5.6 pointer)
|
||||
@@ -0,0 +1,113 @@
|
||||
# CONTRACT — anomaly-b-working-copy-dialog
|
||||
- date: 2026-11-12 | flow: bugfix | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
- plan: .claude/tasks/plans/2026-11-12-anomaly-b-working-copy-dialog-1530.md (rev 2)
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
# FAUNOSTEO V1-2.6 — Décision sur l'anomalie E2E
|
||||
|
||||
Je valide l'OPTION 1 : déplacer les contrôles d'accessibilité et de mise en page du dialogue « Créer une copie de travail » dans e2e:ui.
|
||||
|
||||
Le diagnostic est accepté : seule la fiche historique peut servir de source à une copie de travail, et une seule copie active est autorisée. Nous ne devons pas modifier cette règle métier pour les tests.
|
||||
|
||||
## 1. Correctif autorisé
|
||||
|
||||
- Utiliser le véritable composant WorkingCopyAction dans e2e:ui, avec une situation simulant une place disponible.
|
||||
- Vérifier le dialogue dans les deux langues et les deux largeurs prévues.
|
||||
- Conserver les assertions axe, focus, navigation clavier et absence de défilement horizontal.
|
||||
- Vérifier que le comportement testé correspond au composant réellement utilisé dans l'application.
|
||||
- Conserver dans e2e:shell les contrôles de la page historique et son accessibilité, sans dépendre de la disponibilité de sa copie de travail.
|
||||
- Ne pas affaiblir les assertions existantes : les déplacer vers la couche appropriée et documenter le changement de couverture.
|
||||
|
||||
## 2. Nettoyage des fixtures
|
||||
|
||||
La suite sandbox peut archiver exclusivement les copies qu'elle crée elle-même.
|
||||
|
||||
Le nettoyage doit être limité aux ressources identifiées comme appartenant à l'exécution courante, avec gestion des échecs lorsque c'est possible.
|
||||
|
||||
Ne jamais archiver ou modifier la copie préexistante 8c315a12-… ni une autre ressource préexistante.
|
||||
|
||||
Ne pas réinitialiser la sandbox.
|
||||
|
||||
## 3. Vérifications
|
||||
|
||||
- Les quatre variantes précédemment défaillantes doivent réussir.
|
||||
- Exécuter au moins deux passages pour démontrer la reproductibilité.
|
||||
- Vérifier les contrôles du vrai composant dans e2e:ui.
|
||||
- Vérifier que la page historique reste couverte dans e2e:shell.
|
||||
- Vérifier que les refus et contraintes serveur restent couverts par les tests sandbox.
|
||||
- Documenter explicitement la limite : le dialogue n'est plus testé dans son contexte serveur réel par ce test d'accessibilité.
|
||||
- Effectuer une revue fonctionnelle et une revue indépendante du code.
|
||||
|
||||
Si une assertion essentielle ne peut pas être préservée, s'arrêter et présenter le problème.
|
||||
|
||||
## 4. Restrictions
|
||||
|
||||
Aucune migration SQL.
|
||||
|
||||
Aucune modification des règles de copie de travail.
|
||||
|
||||
Aucune modification de données existantes, y compris 8c315a12-….
|
||||
|
||||
Aucun test automatisé sur db:trial ou DEV.
|
||||
|
||||
Aucune fusion ni aucun déploiement.
|
||||
|
||||
Préserver le fichier de revue ChatGPT non suivi.
|
||||
|
||||
Isoler le correctif dans un commit indépendant, puis pousser.
|
||||
|
||||
## 5. Checkpoint
|
||||
|
||||
Fournir :
|
||||
- Le détail des assertions déplacées.
|
||||
- Les résultats avant/après.
|
||||
- Les résultats des deux passages.
|
||||
- Les contrôles d'accessibilité conservés.
|
||||
- La preuve que les ressources préexistantes sont intactes.
|
||||
- Les éventuelles limites de couverture.
|
||||
- Les commits et l'état Git.
|
||||
|
||||
S'arrêter après ce correctif.
|
||||
|
||||
R1 est définitivement validé par le propriétaire.
|
||||
|
||||
Le plan R2 est approuvé, mais ne commencer R2.0 qu'après mon nouveau feu vert sur le résultat du correctif.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: tests environment? / A: e2e:ui local (no backend); e2e:shell and sandbox suite only through `pnpm db:sandbox` (faunosteo_dbsandbox_*, already up); never db:trial, DEV, `up`/`down`/`reset`/`trial*`.
|
||||
Q: run editor-equine? / A: no (its set-aside archives and restores pre-existing copies); reported to the owner.
|
||||
Q: data proof? / A: per-id snapshot (id, status, archived_at, updated_at) of every pre-existing anatomical_sheets row before and after; new rows allowed.
|
||||
Q: Tab walk vs Dialog contract? / A: explicit order with one 'browser' step (LRN-082), like dialog.spec.ts; not "stays inside".
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Harness renders the real WorkingCopyAction (free + taken, StrictMode, MemoryRouter, ?lang) and a new e2e:ui spec covers fr/en on both projects: axe, overflow, panel in viewport, keyboard open, prefilled slug, explicit Tab/Shift+Tab walk, Escape + focus return, taken button disabled with its reason.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && test -f e2e/harness/working-copy.html && grep -q "WorkingCopyAction" e2e/harness/working-copy.tsx && grep -q "StrictMode" e2e/harness/working-copy.tsx && grep -q "MemoryRouter" e2e/harness/working-copy.tsx && grep -q "faunosteo-cheval-copie-de-travail" e2e/ui/working-copy.spec.ts && grep -q "expectAccessible" e2e/ui/working-copy.spec.ts && grep -q "expectNoHorizontalOverflow" e2e/ui/working-copy.spec.ts && grep -q "Shift+Tab" e2e/ui/working-copy.spec.ts && grep -q "Escape" e2e/ui/working-copy.spec.ts && grep -q "toBeDisabled" e2e/ui/working-copy.spec.ts && echo UI_SPEC_OK
|
||||
EXPECT: UI_SPEC_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: UI_SPEC_OK
|
||||
2. admin.spec.ts no longer opens the working-copy dialog (other dialogs of the file untouched; oracle corrected 2026-11-12, the first form matched them); it keeps the historical page in the axe/overflow loop and asserts the button state is consistent with its linked reason.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && ! grep -A1 "getByRole('dialog', {$" e2e/shell/admin.spec.ts | grep -q "admin.working_copy.create" && grep -q "historical}" e2e/shell/admin.spec.ts && grep -q "admin.working_copy.active" e2e/shell/admin.spec.ts && grep -q "working-copy.spec" e2e/shell/admin.spec.ts && echo SHELL_OK
|
||||
EXPECT: SHELL_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SHELL_OK
|
||||
3. Sandbox suite captures every created copy, archives only those with `returning id` checked, cleanup steps independent, first error rethrown.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "returning id" packages/supabase/tests/sandbox/sheets-admin.sandbox.ts && grep -q "status = 'archived'" packages/supabase/tests/sandbox/sheets-admin.sandbox.ts && echo CLEANUP_OK
|
||||
EXPECT: CLEANUP_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: CLEANUP_OK
|
||||
4. Static gates green; no SQL, Rust, worker, app src change.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD -- supabase crates apps/app/src packages/supabase/src scripts docker)" ] && pnpm -s typecheck >/dev/null 2>&1 && pnpm -s lint >/dev/null 2>&1 && pnpm -s test:run >/dev/null 2>&1 && echo STATIC_OK
|
||||
EXPECT: STATIC_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: STATIC_OK
|
||||
5. Runs (manual, logs in scratchpad): BEFORE grep « admin screens » 4 failed; AFTER passes 1 and 2: 4 passed each; full admin.spec once; e2e:ui full ×2 green; sandbox suite sheets-admin green; pre-existing anatomical_sheets rows identical per id before/after.
|
||||
6. Docs updated in the same commit: BROWSER_TESTS.md (e2e:ui row, harness paragraph, coverage change + limit), V1-2-6_U1_CORRECTIONS.md §5 row B and four-failure lines, playwright.ui.config.ts header, CLAUDE.md e2e:ui line and harness list.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "working-copy" docs/development/BROWSER_TESTS.md && grep -q "working-copy" apps/app/e2e/playwright.ui.config.ts && grep -q "working-copy" CLAUDE.md && echo DOCS_OK
|
||||
EXPECT: DOCS_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: DOCS_OK
|
||||
|
||||
## FILE SCOPE
|
||||
- apps/app/e2e/harness/working-copy.html (new), apps/app/e2e/harness/working-copy.tsx (new)
|
||||
- apps/app/e2e/ui/working-copy.spec.ts (new)
|
||||
- apps/app/e2e/shell/admin.spec.ts
|
||||
- packages/supabase/tests/sandbox/sheets-admin.sandbox.ts
|
||||
- apps/app/e2e/playwright.ui.config.ts (header comment only)
|
||||
- docs/development/BROWSER_TESTS.md, docs/development/V1-2-6_U1_CORRECTIONS.md, CLAUDE.md
|
||||
- this contract, the plan, .claude/tasks/TODO.md and memory (memory commit)
|
||||
@@ -0,0 +1,164 @@
|
||||
# CONTRACT — r1-history-deselect
|
||||
- date: 2026-11-12 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
# FAUNOSTEO V1-2.6 — GO R1 COMPLET + D6b
|
||||
|
||||
Le propriétaire approuve l'implémentation complète de R1, incluant le critère D6b ajouté après les tests manuels U1.
|
||||
|
||||
La cause identifiée dans useCanvasGestures.ts est acceptée. Le périmètre proposé est validé, sous les décisions suivantes.
|
||||
|
||||
## 1. Arbitrages
|
||||
|
||||
A. Focus après clic :
|
||||
- Le focus reste dans le schéma après une désélection par clic ou toucher.
|
||||
- Utiliser un élément graphique approprié et focusable ; ne pas tenter de focaliser arbitrairement un os ou un path SVG.
|
||||
- Déclencher l'annonce accessible prévue.
|
||||
- Conserver la règle A6 propre au bouton Désélectionner : ligne correspondante si disponible, sinon repli sur le schéma.
|
||||
|
||||
B. Zones et liens :
|
||||
- Un clic sur une annotation interactive (point, zone ou lien) conserve le comportement de sélection.
|
||||
- Un clic sur un élément non interactif du dessin, y compris un os ou un tracé SVG interne, désélectionne.
|
||||
- Ne pas confondre les éléments SVG ordinaires et ceux porteurs d'une annotation.
|
||||
|
||||
C. Livraison :
|
||||
- Implémenter R1 complet, conformément aux maquettes R0 validées et à V1-2-6_U1_CORRECTIONS.md.
|
||||
- Isoler D6b dans un commit distinct pour faciliter sa revue et sa traçabilité.
|
||||
- Ne pas commencer R2, R3, R4, U2 ou U2b.
|
||||
|
||||
D. Valeurs invalides :
|
||||
- Conserver pour R1 le comportement actuel d'une valeur explicitement refusée et non appliquée : fermeture du panneau sans modification du document.
|
||||
- Vérifier qu'aucune modification valide en attente d'enregistrement n'est perdue silencieusement.
|
||||
- Ne pas introduire une nouvelle gestion globale des formulaires ou une modale de confirmation dans ce lot.
|
||||
- Documenter le comportement et ses limites.
|
||||
|
||||
## 2. Implémentation D6b
|
||||
|
||||
Traiter les deux parcours :
|
||||
|
||||
- useCanvasGestures.ts / EditableAnnotations.tsx pour l'éditeur modifiable.
|
||||
- CatalogueCanvas.tsx / AnnotationsTab.tsx pour la consultation en lecture seule.
|
||||
|
||||
Mutualiser le chemin de désélection existant lorsque c'est pertinent, sans altérer le catalogue du lecteur.
|
||||
|
||||
Une désélection ne doit pas :
|
||||
- Modifier le document ;
|
||||
- Déclencher une sauvegarde ;
|
||||
- Ajouter une opération Défaire/Refaire ;
|
||||
- Annuler une création en cours lorsqu'aucune annotation n'était sélectionnée ;
|
||||
- Interférer avec le déplacement d'un repère, le pan, le zoom ou le pincement.
|
||||
|
||||
Le seuil de mouvement de 4 px et la protection des gestes multidoigts doivent être vérifiés sur les séquences réelles d'événements, et pas uniquement sur des clics synthétiques isolés.
|
||||
|
||||
## 3. Tests
|
||||
|
||||
Exécuter les tests unitaires et navigateur prévus pour R1 et D6b.
|
||||
|
||||
Couvrir :
|
||||
- Clic sur un point, une zone et un lien interactif ;
|
||||
- Clic sur rect/path/circle non interactifs, racine SVG et marge ;
|
||||
- Absence de sélection initiale ;
|
||||
- Pan, zoom, déplacement d'annotation et gestes à plusieurs doigts ;
|
||||
- Utilisation tactile ;
|
||||
- Annonce accessible et gestion du focus ;
|
||||
- Lecture seule ;
|
||||
- Absence de régression du catalogue du lecteur ;
|
||||
- Défaire/Refaire après désélection ;
|
||||
- Persistance du document et absence d'écriture inattendue ;
|
||||
- Gestion des valeurs refusées et des modifications valides en attente.
|
||||
|
||||
Exécuter les suites automatisées uniquement sur leur environnement prévu. Ne jamais utiliser db:trial comme sandbox E2E jetable.
|
||||
|
||||
Si un test équin nécessite des fixtures, les préparer dans un environnement automatisé isolé, sans toucher à la fiche historique ni aux données de la pile d'essai.
|
||||
|
||||
iOS Safari reste une vérification manuelle ultérieure, non une preuve de compatibilité acquise.
|
||||
|
||||
## 4. Livraison et contrôles
|
||||
|
||||
Respecter les conventions de branche, commit et push du projet.
|
||||
|
||||
Réaliser :
|
||||
- Les vérifications statiques ;
|
||||
- Les tests unitaires ;
|
||||
- Les tests navigateur ;
|
||||
- Une revue fonctionnelle indépendante ;
|
||||
- Une revue de code indépendante ;
|
||||
- Une vérification de sécurité ciblée sur les interactions et l'isolation des environnements.
|
||||
|
||||
Documenter les écarts et limites réels, sans déclarer validé un test non exécuté.
|
||||
|
||||
## 5. Restrictions
|
||||
|
||||
Aucune intervention sur DEV.
|
||||
|
||||
Aucune migration SQL ni modification du moteur Rust ou du worker.
|
||||
|
||||
Ne pas modifier la fiche équine historique.
|
||||
|
||||
Ne pas supprimer ni réinitialiser la copie de travail d'essai.
|
||||
|
||||
Aucune modification des rôles, du MFA ou des secrets.
|
||||
|
||||
Ne pas modifier l'exposition réseau de la pile d'essai.
|
||||
|
||||
Préserver le fichier de revue ChatGPT non suivi.
|
||||
|
||||
Aucune fusion ni aucun déploiement.
|
||||
|
||||
## 6. Checkpoint
|
||||
|
||||
Fournir :
|
||||
- Le détail des modifications R1 et D6b ;
|
||||
- Les commits et leur état de push ;
|
||||
- Les résultats des tests et contre-revues ;
|
||||
- Les éventuelles régressions ou limitations ;
|
||||
- Les points à vérifier manuellement dans l'éditeur sur db:trial.
|
||||
|
||||
S'arrêter à la fin de R1.
|
||||
|
||||
Ne pas démarrer R2 sans nouveau feu vert.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: spec of R1? / A: docs/development/V1-2-6_U1_CORRECTIONS.md §1 D5, D6, D6b, §3 R1, §6 A5, A5b, A6; board 26 (docs/design/v1-2-6-r0/26-historique-deselection.png, maquettes.html:380-391, :611-667, REVUE.md:57-60, :72, :108-111, :129-135) is normative (BDR-110).
|
||||
Q: tooltip with the shortcut and Meta in aria-keyshortcuts? / A: yes, board 26 and REVUE.md:59, :108-110 (title = name + « (Ctrl+Z ou ⌘Z) » / « (Ctrl+Maj+Z ou ⇧⌘Z) », EN « (Ctrl+Z or ⌘Z) » / « (Ctrl+Shift+Z or ⇧⌘Z) »; aria-label = name only; aria-keyshortcuts adds Meta+Z / Meta+Shift+Z).
|
||||
Q: suites environment? / A: unit + e2e:ui local; e2e:shell only on `pnpm db:sandbox` (already up); never db:trial, never DEV; no sandbox reset/down; exact shell count reported against the known baseline (4 failures admin.spec.ts:717, anomaly B).
|
||||
|
||||
Q: pen pointer rule for D6b (criterion 14)? / A: [ruling 2026-11-12, controller, after the final code review] pen follows the TOUCH rule (verdict applied in the tap's own click, only when its target has no [data-anno-id]); the mouse alone acts at pointerup and swallows the next click. Reason: on stylus platforms the click is built after the lift on the layout without the selection and could land on « Ajouter … »; cost if wrong: a pen tap after a field blur-rebuild needs a second tap. Criterion 14's « mouse/pen » reads « mouse » for pointerup, « touch and pen » for the click.
|
||||
Q: path of the deselect helper? / A: [ruling 2026-11-12] apps/app/src/editor/annotations/deselect.ts as the plan specified (FILE SCOPE line was loose).
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. FR history labels read « Défaire » / « Refaire » with names « Défaire la dernière modification » / « Refaire la dernière modification défaite »; EN undo/redo strings unchanged; fr and en key sets identical.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "'editor.history.undo': 'Défaire'" src/i18n/fr.ts && grep -q "'editor.history.redo': 'Refaire'" src/i18n/fr.ts && grep -q "'editor.history.undo_title': 'Défaire la dernière modification'" src/i18n/fr.ts && grep -q "'editor.history.redo_title': 'Refaire la dernière modification défaite'" src/i18n/fr.ts && grep -q "'editor.history.undo': 'Undo'" src/i18n/en.ts && grep -q "'editor.history.redo_title': 'Redo the last undone change'" src/i18n/en.ts && ! grep -qE "'editor\.history\.(undo|redo)(_title)?': '(Annuler|Rétablir)" src/i18n/fr.ts && echo LABELS_OK
|
||||
EXPECT: LABELS_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: LABELS_OK
|
||||
2. History buttons: aria-label = the name, title = name + the shortcut text of board 26, aria-keyshortcuts lists Control and Meta forms; shortcuts themselves unchanged (useUndoShortcuts.ts untouched); dialog « Annuler » buttons untouched; the FR prose naming the history command (editor.views.drawing.use_parent_body, editor.views.repair.body_one/_other) says « Défaire ».
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 541706c -- apps/app/src/editor/useUndoShortcuts.ts && grep -q "Meta+Z" apps/app/src/components/editor/HistoryButtons.tsx && grep -q "Meta+Shift+Z" apps/app/src/components/editor/HistoryButtons.tsx && ! grep -q "un seul Annuler" apps/app/src/i18n/fr.ts && ! grep -q "ce changement (Annuler)" apps/app/src/i18n/fr.ts && echo HISTORY_OK
|
||||
EXPECT: HISTORY_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: HISTORY_OK
|
||||
3. « Désélectionner » (secondary, deselect glyph) sits to the left of « Supprimer » in the properties panel, in edit and read-only modes (read-only: no « Supprimer »); after it: the annotation's list row if visible, else the drawing box; focus never reselects; polite announcement « Aucune annotation sélectionnée. » / « No annotation selected. ».
|
||||
4. Escape in the editor workspace, first applicable wins: open dialog (native, untouched) > « Plus » menu open (closes, focus on « Plus ») > references panel open (closes, focus on its opener) > tracing in progress (cancels, as today) > selection (deselects, focus per the [gated] rule, same announcement); Escape inside a text field / select never deselects; nothing applicable → nothing; acts on the shown body only (kept hidden edit body or hidden tab never changes).
|
||||
5. D6b, edit canvas: with the select tool, a click/tap whose target has no [data-anno-id] ancestor deselects when an annotation is selected (bone or any drawing shape, the composed root, the box margin); a click on a point, zone or link still selects it; nothing selected → no dispatch (pending keyboard creation, typed fields, « Filtrer par nom » kept); drawing tools and tracing unchanged; a press that moved > 4 px (pan, marker drag, pinch) or during which a second pointer came down never deselects; focus ends on the canvas box (role=group, tabIndex 0), never on an SVG shape; same announcement.
|
||||
6. D6b, read-only twin: CatalogueCanvas gets an optional onEmpty with the same rules, passed only by the editor's read-only twin; the catalogue reader (SheetRoute) passes none and behaves exactly as before; useFraming.ts unchanged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 541706c -- apps/app/src/catalogue/useFraming.ts apps/app/src/app/routes/app/anatomy/SheetRoute.tsx && grep -q "onEmpty" apps/app/src/components/catalogue/CatalogueCanvas.tsx && grep -q "onEmpty" apps/app/src/components/editor/tabs/AnnotationsTab.tsx && echo READER_UNCHANGED_OK
|
||||
EXPECT: READER_UNCHANGED_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: READER_UNCHANGED_OK
|
||||
7. Every deselect path (button, Escape, click/tap): document text, handle version, history length, unsaved count and save state unchanged by the deselect itself; no save request; a valid typed value not yet blurred is committed (its own edit, undoable), never dropped silently; a refused « non appliqué » value: panel closes, document unchanged (current behaviour, documented); undo after a deselect undoes the previous edit.
|
||||
8. Unit tests (vitest) cover items 1-7 including clicks on inner SVG elements (rect/circle/path), the root svg and the margin, pointer sequences (down/move/up then click) under and over 4 px, a second pointer, read-only twin, reader unchanged; `pnpm typecheck`, `pnpm lint`, `pnpm test:run`, `pnpm build` pass.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm -s typecheck >/dev/null 2>&1 && pnpm -s lint >/dev/null 2>&1 && pnpm -s test:run >/tmp/claude-1000/-home-bchanot-Documents-faunosteo/463d8810-0112-4b67-92e4-aa3c30af6089/scratchpad/r1-unit.txt 2>&1 && echo STATIC_UNIT_OK
|
||||
EXPECT: STATIC_UNIT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: STATIC_UNIT_OK
|
||||
9. Browser tests: `pnpm e2e:ui` passes; a new shell spec (Chromium, `pnpm db:sandbox` only) covers button, Escape matrix, D6b mouse clicks on inner shapes/root/margin/annotations, pan/zoom/marker drag, touch tap, touch drag, two-finger tap and pinch through CDP, read-only twin, persistence after reload and no save request; `editor-equine.spec.ts` clicks a bone path of the horse drawing on its own sandbox copy; the full shell suite run is reported with its exact counts against the baseline.
|
||||
10. D6b lands in its own commit; commits pushed on feature/v1-2-anatomical-sheets; no change under supabase/, crates/, scripts/db-trial*.sh, docker/; the untracked review file kept.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only 541706c -- supabase crates scripts/db-trial.sh scripts/db-trial-check.sh docker)" ] && [ -f faunosteo-v1-2-6-revue-ux-chatgpt.md ] && git log --format=%s 541706c..HEAD | grep -q "D6b" && [ "$(git rev-parse HEAD)" = "$(git rev-parse @{u})" ] && echo SCOPE_PUSH_OK
|
||||
EXPECT: SCOPE_PUSH_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE_PUSH_OK
|
||||
11. Docs: V1-2-6_U1_CORRECTIONS.md R1 status + the deselect limits (refused value, focus rules, iOS manual), BROWSER_TESTS.md (new spec, keyboard order « Défaire », « Refaire »), V1-2-6_OWNER_TRIAL.md labels, a D5 note on T15 in V1-2-6_UX_DECISIONS.md and V1-2_ANATOMICAL_SHEETS.md, ANNOTATION-RENDERING.md click paragraph (D6b); historical records (U1 checkpoint, v1-2-6 board records) untouched.
|
||||
|
||||
12. [gated 2026-11-12] Escape focus (G1, owner): focus inside the properties panel → A6 (row if visible, else the drawing box); focus anywhere else → stays where it is. Escape deselects from anywhere inside the editor workspace (header and tab row included) or with the focus on the page body, only on the shown annotation body; from outside the workspace nothing happens.
|
||||
13. [gated 2026-11-12] « Supprimer » (G2, owner): unchanged style (filled danger button, no icon), to the right of « Désélectionner » in a row with a top border.
|
||||
14. [gated 2026-11-12] D6b decision (plan rev 3): the verdict comes from the press (pointerdown target without [data-anno-id], primary button, no second pointer anywhere in the page, no contextmenu, accumulated movement ≤ 4 px); mouse/pen apply it at pointerup and swallow the following click; touch applies it in the tap's own click and only when that click's target has no [data-anno-id]. A press that begins on the selected marker never deselects (even when its click is retargeted to the box by pointer capture).
|
||||
15. [gated 2026-11-12] « Désélectionner » is not rendered while a tracing runs; a press on it keeps a typed field focused until its handler commits it, so one press always closes the panel.
|
||||
|
||||
## FILE SCOPE
|
||||
apps/app/src/catalogue/useEmptyTap.ts (new); apps/app/src/i18n/{fr,en}.ts; apps/app/src/components/editor/{HistoryButtons,EditorTabs,EditorWorkspace,EditorGlyph}.tsx; apps/app/src/components/editor/annotations/{PropertiesPanel,EditableAnnotations,AnnotationCanvas}.tsx; apps/app/src/components/editor/references/ReferencesPanel.tsx; apps/app/src/components/editor/tabs/AnnotationsTab.tsx; apps/app/src/components/catalogue/CatalogueCanvas.tsx; apps/app/src/editor/annotations/{useCanvasGestures,usePlacement}.ts; apps/app/src/editor/{focusRequest,useEditorNavigation}.ts; new apps/app/src/editor/{deselect,escape}.ts(x) helpers; apps/app/tests/unit/*.test.tsx (editor-history-buttons, editor-annotations-tab, editor-overview, editor-sections, editor-keep-alive, routes.catalogue, new editor-deselect / editor-escape); apps/app/e2e/shell/editor-*.spec.ts (titles/comments), new e2e/shell/editor-deselect.spec.ts, e2e/support/editor.ts, editor-equine.spec.ts; docs listed in criterion 11; .claude/tasks/*.
|
||||
@@ -0,0 +1,95 @@
|
||||
# CONTRACT — r1-selection-tag
|
||||
- date: 2026-11-12 | flow: bugfix | branch: feature/v1-2-anatomical-sheets
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
# FAUNOSTEO V1-2.6 — R1 — Dernier retour utilisateur
|
||||
|
||||
Les 10 tests manuels R1 sur db:trial sont réussis, y compris la désélection par clic sur le squelette, le tactile, le focus et les raccourcis.
|
||||
|
||||
Un dernier défaut UX a été constaté.
|
||||
|
||||
## Problème
|
||||
|
||||
Lorsqu'une annotation est sélectionnée, un texte apparaît au-dessus du schéma :
|
||||
|
||||
« Sélection : zone « Vertèbres cervicales » »
|
||||
|
||||
Cet affichage est redondant : l'annotation est déjà surlignée sur le dessin et son nom apparaît dans le panneau latéral.
|
||||
|
||||
Il provoque surtout un déplacement vertical du schéma, particulièrement désagréable lorsqu'on sélectionne et désélectionne plusieurs annotations.
|
||||
|
||||
## Correction autorisée
|
||||
|
||||
1. Identifier le composant responsable de cet affichage.
|
||||
2. Supprimer son affichage visuel dans l'éditeur, en modification comme en lecture seule.
|
||||
3. Ne laisser aucun espace vide réservé à cet affichage.
|
||||
4. Garantir une position stable du schéma lors des changements de sélection.
|
||||
5. Conserver le surlignage et les informations de l'annotation dans le panneau latéral.
|
||||
6. Si ce texte sert aussi d'annonce accessible, conserver une solution adaptée aux lecteurs d'écran, hors du flux visuel, sans annonce redondante ni perte d'accessibilité.
|
||||
7. Ne pas supprimer les autres messages utiles, notamment les erreurs, avertissements et états de sauvegarde.
|
||||
|
||||
## Tests attendus
|
||||
|
||||
- Sélection d'un point, d'une zone et d'un lien.
|
||||
- Désélection par clic, bouton et Échap.
|
||||
- Absence de déplacement vertical de l'interface.
|
||||
- Éditeur modifiable et consultation en lecture seule.
|
||||
- Desktop et mobile.
|
||||
- Accessibilité et absence de régression des interactions R1.
|
||||
|
||||
## Périmètre
|
||||
|
||||
Correction UX minimale, rattachée à R1.
|
||||
|
||||
Ne pas modifier les règles de sélection, le document, l'historique Défaire/Refaire, les données ou la sauvegarde.
|
||||
|
||||
Ne pas toucher à db:trial, DEV ou aux données de la sandbox, en dehors des tests automatisés autorisés sur l'environnement isolé prévu.
|
||||
|
||||
Faire relire la correction, exécuter les tests pertinents, documenter, commit et push.
|
||||
|
||||
R2, R3, R4, U2 et U2b restent bloqués.
|
||||
|
||||
Fournir le résultat et s'arrêter au checkpoint final R1.
|
||||
|
||||
## DIAGNOSIS
|
||||
- BUG: « Sélection : … » tag shown above the drawing on selection; drawing moves down by its height, back up on deselect.
|
||||
- ROOT CAUSE: `SelectionTag` (apps/app/src/components/editor/annotations/SelectionTag.tsx) renders an in-flow `inline-block` `<p>` mounted only while an annotation is selected, placed before the canvas in both twins (EditableAnnotations.tsx TagOf, tabs/AnnotationsTab.tsx). Mount/unmount changes the column height above the canvas.
|
||||
- A11y: the tag is not a live region (no role, no aria-live); selection is not announced by it today. Deselection announce (deselect.ts) is separate and untouched.
|
||||
- RELATED MEMORY: none bears (LRN on layout shift vs hit-test is general, honored by the e2e recomputing positions).
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: announce the selection politely (reviewer suggestion)? / A: no. Brief item 6 conditions it on the tag being an announcement, it is not; "sans annonce redondante". Text kept sr-only, not live.
|
||||
Q: other shift source: ToolNotes `role="alert"` hint cleared by `select` (EditableAnnotations.tsx ~373)? / A: out of scope (brief: minimal, keep warnings); reported to the owner, not changed.
|
||||
Q: design record? / A: owner brief ratifies the deviation from board 04; recorded in docs/design/README.md under the existing accepted deviations.
|
||||
Q: suites environment? / A: unit local; e2e:shell only on `pnpm db:sandbox` (already up, faunosteo_dbsandbox_*), targeted specs; never db:trial, never DEV; no sandbox up/reset/down.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. SelectionTag renders `sr-only`, no visible style classes, no role/aria-live; both twins still render it.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q 'className="sr-only"' src/components/editor/annotations/SelectionTag.tsx && ! grep -qE "aria-live|role=|inline-block|surface-strong" src/components/editor/annotations/SelectionTag.tsx && grep -q "<SelectionTag" src/components/editor/tabs/AnnotationsTab.tsx && grep -q "<SelectionTag" src/components/editor/annotations/EditableAnnotations.tsx && echo TAG_OK
|
||||
EXPECT: TAG_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: TAG_OK
|
||||
2. Regression unit test asserts sr-only and not live; typecheck, lint, full unit suite green.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "keeps the selection tag out of the visual flow" apps/app/tests/unit/editor-annotations-tab.test.tsx && pnpm -s typecheck >/dev/null 2>&1 && pnpm -s lint >/dev/null 2>&1 && pnpm -s test:run >/dev/null 2>&1 && echo UNIT_OK
|
||||
EXPECT: UNIT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: UNIT_OK
|
||||
3. e2e: editor-deselect.spec.ts has a test asserting the canvas top is unchanged after selecting and deselecting a point, a zone and a link; editor-equine.spec.ts no longer asserts the tag visible.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "the drawing does not move when the selection changes" e2e/shell/editor-deselect.spec.ts && ! grep -q "selectionTag(page)).toBeVisible" e2e/shell/editor-equine.spec.ts && echo E2E_SRC_OK
|
||||
EXPECT: E2E_SRC_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: E2E_SRC_OK
|
||||
4. Shell specs editor-deselect, editor-equine, editor-access, editor-annotations run green on `pnpm db:sandbox` (manual run, counts reported); no selection rule, document, history, save or data code changed.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD -- apps/app/src/editor apps/app/src/state supabase crates scripts docker packages)" ] && echo SCOPE_OK
|
||||
EXPECT: SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE_OK
|
||||
5. docs/design/README.md records the owner-ratified deviation for board 04 (2026-11-12); SelectionTag doc comment states why.
|
||||
|
||||
## FILE SCOPE
|
||||
- apps/app/src/components/editor/annotations/SelectionTag.tsx
|
||||
- apps/app/tests/unit/editor-annotations-tab.test.tsx
|
||||
- apps/app/e2e/shell/editor-deselect.spec.ts
|
||||
- apps/app/e2e/shell/editor-equine.spec.ts
|
||||
- apps/app/e2e/support/editor.ts
|
||||
- docs/design/README.md
|
||||
- docs sync (approved by owner 2026-11-12): docs/development/BROWSER_TESTS.md, docs/development/V1-2-6_U1_CORRECTIONS.md, docs/development/V1-2-6_OWNER_TRIAL.md
|
||||
- closure (owner 2026-11-12): docs/development/V1-2_ANATOMICAL_SHEETS.md §13 (RR-14 prerequisite), .claude/tasks/TODO.md
|
||||
- this contract; memory: .claude/memory/{blockers,learnings,journal}.md (BLK-013, LRN-131)
|
||||
@@ -0,0 +1,203 @@
|
||||
# CONTRACT — r2-references-tab
|
||||
- date: 2026-11-12 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets (commit in place, no finish)
|
||||
- status: active
|
||||
- plan: .claude/tasks/plans/2026-11-12-r2-references-tab-1730.md
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
# FAUNOSTEO V1-2.6 — Validation du correctif E2E et GO R2
|
||||
|
||||
Le propriétaire valide le checkpoint du correctif E2E.
|
||||
|
||||
## 1. Correctif E2E accepté
|
||||
|
||||
Le commit 2cdee42 est accepté.
|
||||
|
||||
Résultats retenus :
|
||||
- Les quatre échecs historiques ont disparu.
|
||||
- Deux passages successifs réussis.
|
||||
- Le véritable composant WorkingCopyAction est couvert dans e2e:ui.
|
||||
- Les contrôles de la fiche historique restent présents dans e2e:shell.
|
||||
- Les refus serveur restent couverts.
|
||||
- Les 637 fiches préexistantes sont restées inchangées pendant cette intervention.
|
||||
|
||||
Conserver la limite documentaire : le dialogue n'est plus testé dans son contexte serveur réel par ce contrôle d'accessibilité.
|
||||
|
||||
## 2. Mémoire — VALIDÉE
|
||||
|
||||
Enregistrer :
|
||||
|
||||
BLK-014 — admin.spec dialog check depended on shared singleton working-copy state — resolved 2cdee42.
|
||||
|
||||
Préciser que la résolution concerne les quatre échecs de ce contrôle, pas tous les risques de concurrence des suites E2E.
|
||||
|
||||
LRN-132 — E2E tests and database-wide singleton state.
|
||||
|
||||
Documenter :
|
||||
- Ne pas exiger qu'une ressource unique soit disponible dans une base persistante partagée.
|
||||
- Tester le véritable composant UI indépendamment lorsque nécessaire.
|
||||
- Vérifier dans les tests serveur la cohérence de l'état réellement présent.
|
||||
- Nettoyer ou archiver exclusivement les ressources créées et identifiées par la suite concernée.
|
||||
- Vérifier les identifiants effectivement modifiés par les opérations de nettoyage.
|
||||
- Éviter les interactions concurrentes entre suites manipulant une ressource singleton.
|
||||
|
||||
Effectuer les contrôles documentaires et commit/push.
|
||||
|
||||
## 3. Risque editor-equine — À encadrer
|
||||
|
||||
La suite editor-equine archive temporairement les copies actives de la fiche historique puis les restaure.
|
||||
|
||||
Ce comportement a déjà modifié la date de modification de 8c315a12.
|
||||
|
||||
Il ne doit plus être exécuté sur une base persistante contenant des données préexistantes à préserver.
|
||||
|
||||
Avant de relancer une suite qui inclut editor-equine :
|
||||
- Identifier précisément ses écritures.
|
||||
- Proposer une isolation reproductible et non destructive pour les ressources préexistantes.
|
||||
- Vérifier les interactions possibles avec admin.spec et les autres suites parallèles.
|
||||
- Préserver la copie 8c315a12 et ses métadonnées actuelles.
|
||||
- Ne pas chercher à rétablir artificiellement une ancienne date.
|
||||
- Ne pas supprimer ou réinitialiser la sandbox.
|
||||
|
||||
Présenter une correction séparée si nécessaire. Ne pas élargir silencieusement le périmètre R2.
|
||||
|
||||
Suivre également les fiches créées par les tests pour éviter l'accumulation de fixtures persistantes.
|
||||
|
||||
## 4. GO — Implémentation de R2
|
||||
|
||||
J'autorise R2.0 à R2.6 conformément au plan technique approuvé et aux maquettes R0.
|
||||
|
||||
R2.0 — Renommage interne du volet de références.
|
||||
|
||||
R2.1 — Cinquième onglet Références et navigation.
|
||||
|
||||
R2.2 — Tuiles de références dépliables.
|
||||
|
||||
R2.3 — Recherche, tri et actions.
|
||||
|
||||
R2.4 — Volet contextuel des références citées par un constat.
|
||||
|
||||
R2.5 — Tests et non-régressions.
|
||||
|
||||
R2.6 — Documentation, traductions et clôture.
|
||||
|
||||
Respecter les décisions A1 à A4 et D1 à D4, ainsi que les exigences enregistrées dans la TODO par a1d4084.
|
||||
|
||||
Chaque sous-lot doit être vérifié, commité et poussé avant le suivant.
|
||||
|
||||
Ne pas déclencher une suite dangereuse pour les données préexistantes au prétexte qu'elle fait partie des contrôles habituels. Si cela bloque une validation obligatoire, s'arrêter au checkpoint correspondant et proposer une solution.
|
||||
|
||||
## 5. Exigences R2
|
||||
|
||||
- Une référence citée ne peut pas être supprimée.
|
||||
- « Retirer de ce constat » retire seulement l'association concernée et reste annulable.
|
||||
- Aucune modification en lecture seule.
|
||||
- Recherche et tri en TypeScript, exclusivement pour l'affichage.
|
||||
- Aucune mutation de l'ordre enregistré ou du document.
|
||||
- Volet contextuel sans déplacement du schéma.
|
||||
- Navigation clavier et gestion du focus conformes aux maquettes.
|
||||
- Accessibilité, mobile et prefers-reduced-motion respectés.
|
||||
- Tableau exhaustif des nouveaux libellés FR/EN à présenter avant leur validation définitive.
|
||||
- Documenter l'exception TypeScript dans la revue d'architecture Rust.
|
||||
|
||||
## 6. Restrictions
|
||||
|
||||
Aucune intervention sur db:trial ou DEV.
|
||||
|
||||
Les tests automatisés utilisent uniquement les environnements autorisés et ne doivent jamais modifier des données préexistantes à préserver.
|
||||
|
||||
Ne pas toucher à la fiche équine historique ni à la copie d'essai manuelle.
|
||||
|
||||
Aucune migration SQL, modification Rust ou worker hors périmètre.
|
||||
|
||||
Aucune suppression de données, aucune fusion et aucun déploiement.
|
||||
|
||||
Préserver le fichier de revue ChatGPT non suivi.
|
||||
|
||||
Ne pas commencer R3, R4, U2 ou U2b.
|
||||
|
||||
## 7. Checkpoint final
|
||||
|
||||
Fournir :
|
||||
- La liste des sous-lots R2 réalisés.
|
||||
- Les commits et leur état de push.
|
||||
- Les résultats exacts des tests exécutés et ceux volontairement non exécutés.
|
||||
- Les revues indépendantes et les éventuelles réserves.
|
||||
- Le statut du risque editor-equine.
|
||||
- Le tableau FR/EN des nouveaux libellés.
|
||||
- Le protocole de test manuel sur db:trial.
|
||||
|
||||
S'arrêter après R2 et attendre la validation utilisateur.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: family detail « n références » button? / A: same panel with family words (« Retirer de cette famille », badge « cette famille », « N références citées par cette famille »); new FR/EN labels in the checkpoint table. [gated 2026-11-12] SUPERSEDED by the owner GO below.
|
||||
Q: 640-1 023 px tab row? / A: all five tabs shown; the row may wrap (fixed per width, never moves on interaction, no horizontal scroll). [gated 2026-11-12]
|
||||
Q: « Retirer » marks the finding / family « À confirmer » (core rule, edit.rs)? / A: accepted; documented in docs and db:trial protocol; one « Défaire » restores both. [gated 2026-11-12]
|
||||
Q: shell gate with editor-equine? / A: excluded from every run (owner §3, §4 « ne pas déclencher une suite dangereuse »); its helper calls are updated for typecheck only, never run; per-id snapshot of pre-existing anatomical_sheets before/after each shell run.
|
||||
Q: where does the FR/EN table live? / A: `docs/development/V1-2-6_R2_LABELS.md` (decided in plan, shown at the gate).
|
||||
Q: panel from a family? / A: NO. Owner GO 2026-11-12 (brief « GO R2 — Plan révision 3 », « Correction obligatoire de R2.1 »): the contextual panel opens only from a finding, per the earlier decision; never from a family without a new arbitration; the library stays reachable from the Références tab. The trigger a family's detail shows today (shared FindingContent) is removed; the family keeps its inline citation list with « Retirer ». [gated 2026-11-12]
|
||||
Q: arbitrations of the gate? / A: owner GO 2026-11-12: (1) permanent Places min-height on the available screen height, mobile browsers and viewport changes handled, no drawing move, no horizontal overflow; (2) motion/react instead of Tailwind motion-reduce:, prefers-reduced-motion and focus return mandatory with or without animation; (3) « Ce constat ne cite plus aucune référence », « Référence introuvable », « Saisie non appliquée : … » accepted provisionally, EN not ratified one by one, full FR/EN table at R2.6; (4) Type sort in business order, deterministic and stable for equal types; (5) « Tout afficher » resets search and sort, keeps open tiles and any edit in progress, never loses a valid entry nor closes unexpectedly. Data controls must prove no unauthorised change, metadata included. [gated 2026-11-12]
|
||||
Q: read-only flip while the panel is open? / A: PENDING OWNER. Implemented: the panel stays open in read view (no edit control; existing crossing spec expects it visible); plan P22'' and criterion 15 listed it as a forced close. Verifier 2026-11-13: criterion 15 NOT-MET on this point only. Shown at the R2 checkpoint.
|
||||
Q: admin.spec red at the end of R2? / A: PENDING OWNER. A0 (fr, en) and « admin screens » crash the renderer during axe on screens rendering every accumulated grant (1 282+); not proven by a base-commit run. Verifier 2026-11-13: criterion 9 NOT-MET on this point only. Separate fix proposed at the checkpoint.
|
||||
|
||||
Q: read-only flip, owner answer? / A: owner 2026-11-13: panel kept open in read view (ratified; criterion 15 amended). A draft abandoned by the flip must be said clearly (accessible and perceptible), nothing shown as saved, no extra history entry. [gated 2026-11-13]
|
||||
Q: admin.spec, owner answer? / A: owner 2026-11-13: no sandbox reset, no deletion or change of pre-existing data; non-destructive diagnosis first (accumulation or regression, evidence required, not assumed); grant pagination stays in RR-13, not here; results and still-failing tests documented. [gated 2026-11-13]
|
||||
Q: add tile cancel? / A: owner 2026-11-13: « Annuler l'ajout » approved; abandons an unfinished creation without leaving an incomplete reference; tests for document, Défaire / Refaire, focus, Escape. [gated 2026-11-13]
|
||||
Q: V1-2 contract note? / A: owner 2026-11-13: dated note authorised (four tabs and references dispositions superseded by D1 to D4 of R2). [gated 2026-11-13]
|
||||
Q: three UX fixes before the trial? / A: owner 2026-11-13: landscape 667 × 375 trigger reachable without a physical keyboard; a refused draft never lost silently when its tile leaves the results; no pinned non-matching tile shown incoherently next to the no-result notice. Targeted; stop and present before any architecture or model change. Behaviours chosen by the controller under that delegation (plan rev 5 C1-C4), reported. [gated 2026-11-13]
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
Seed (from the request); design criteria appended at STEP 3 with [gated].
|
||||
1. Five editor tabs in the order Général, Annotations, Constats, Références, Vérification; below 640 px « Plus » holds Général, Constats, Références; no header « Références » button.
|
||||
2. A cited reference never shows « Supprimer » (hint instead); an uncited one keeps « Supprimer » + existing dialog; the core refusal stays the authority.
|
||||
3. « Retirer de ce constat » (panel, finding only) removes only that association, one « Défaire » restores it; the reference stays in the document. [corrected 2026-11-12, owner GO: no family wording]
|
||||
4. Read-only and no-right modes show no edit control in the tab or the panel.
|
||||
5. Search and the four sorts are TypeScript display functions over ids; the document text, stored order, ids and history are identical before and after any search or sort (tested).
|
||||
6. The panel opens only from a finding (never from a family; corrected 2026-11-12, owner GO), width ≤ 34 rem and ≤ available width, slide 180 / 140 ms, none under reduced motion, page inert and panel unreachable while closed or exiting, focus back to the trigger if it still exists; no layout shift of the tab content on open / close.
|
||||
7. A1 to A4 hold; « Aller à » from Vérification opens the right tile, open and focused; references reachable when a search returns nothing (clear button).
|
||||
8. Exhaustive FR/EN table of new and changed labels with ambiguities: `docs/development/V1-2-6_R2_LABELS.md`; Rust exception rows in `RUST_ARCHITECTURE_REVIEW.md` Part II.
|
||||
9. Gates per sub-lot: typecheck, lint, test:run, build; e2e:ui; e2e:shell on db:sandbox without editor-equine; pre-existing rows unchanged per id; one commit + push per sub-lot.
|
||||
10. No change under supabase/, crates/, scripts/db-trial*, docker/; no db:trial / DEV access; untracked review file kept; no merge.
|
||||
11. [gated 2026-11-12] A family's detail shows no « {n} références » trigger and keeps its inline citation list with « Retirer »; `open_citations` with a family key is a no-op; the panel carries no family wording.
|
||||
12. [gated 2026-11-12] The header « Références » button and its id are gone.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && ! grep -rq "REFERENCES_BUTTON_ID" apps/app/src && ! grep -rq "editor-references-panel" apps/app/src && echo NO_HEADER_BUTTON
|
||||
EXPECT: NO_HEADER_BUTTON
|
||||
EVIDENCE: MET exit=0 marker-found :: NO_HEADER_BUTTON
|
||||
13. [gated 2026-11-12] New files exist: pure sort and safe-link modules, the two new shell specs, the labels table.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && test -f apps/app/src/editor/references/sort.ts && test -f apps/app/src/editor/references/safeLink.ts && test -f apps/app/e2e/shell/editor-references.spec.ts && test -f apps/app/e2e/shell/editor-citations.spec.ts && test -f docs/development/V1-2-6_R2_LABELS.md && echo R2_FILES_OK
|
||||
EXPECT: R2_FILES_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: R2_FILES_OK
|
||||
14. [gated 2026-11-12] Sorts: sheet order, citation (Intl.Collator base + numeric), citation count descending, Type in REFERENCE_TYPES order; equal keys keep the stored order (deterministic, stable); inputs never mutated; unit-tested with permutations.
|
||||
15. [gated 2026-11-12; amended 2026-11-13, owner: the read-only flip keeps the panel open in read view, it is not a close] Closing: every close (✕, Escape outside text fields, scrim, « Tout afficher », « Aller à », tab switch, element gone) records one pending move applied after the exit; focus lands on the trigger if present, else the active tab button (« Plus » below 640 px); checked by `document.activeElement` in normal and reduced motion; page inert and panel unreachable during exit; a user close with a refused draft is cancelled (field focused), a forced close drops it with the « Saisie non appliquée : … » announcement.
|
||||
16. [gated 2026-11-12] « Tout afficher » resets search and sort, keeps open tiles and any tile in edit; a valid panel draft is committed before the close.
|
||||
17. [gated 2026-11-12] Layout: Places min-height = dynamic viewport height minus the top bar, permanent; panel wrapper `overflow-x: clip`; document scrollWidth / scrollHeight and the drawing box unchanged before, during and after open / close at 375, 1 024, 1 180, 1 279, 1 280 px and across a viewport height change and a rotation at phone width.
|
||||
18. [gated 2026-11-12] Safe links: DOI and URL rendered as links only when http(s) / a valid `10.x/…` DOI; `javascript:` never a link; dangling citation ids shown as « Référence introuvable » with « Retirer »; duplicate ids stay distinct.
|
||||
19. [gated 2026-11-12] Data controls: every shell run goes through the preflight (editor-equine never listed) and the full-row guard (every column of every row of public, audit, storage tables and auth.users); no pre-existing row changed or deleted, metadata included; new rows counted per table and reported.
|
||||
20. [gated 2026-11-12] No change outside scope since 49867ba.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only 49867ba..HEAD -- supabase crates docker packages/supabase/src scripts)" ] && echo SCOPE_OK
|
||||
EXPECT: SCOPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE_OK
|
||||
|
||||
21. [gated 2026-11-13] Read-only flip: no history entry from the flip itself (unit: undo and redo lengths unchanged with nothing pending and with a refused draft; +1 exactly with a valid focused draft, the typed change only; +0 on the flip back); a dropped draft leaves the document unchanged, is said once in the polite live region and shown as visible text in its tile; the read view shows the document values.
|
||||
22. [gated 2026-11-13] A tile in edit never leaves the shown list on a read-only flip (pin kept whatever the search or sort); an edit view unmounted with pending drafts outside an explicit leave is always announced (all pending fields named), visibly noted when its tile is shown; a panel forced close is announced exactly once.
|
||||
23. [gated 2026-11-13] « Annuler l'ajout » and Escape (not during IME composition) abandon the draft tile: document references identical, undo and redo stacks unchanged (a pending redo kept), focus on « Ajouter une référence », a new add starts empty; unit + e2e.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "editor.references.add_cancel" src/i18n/fr.ts && grep -q "editor.references.add_cancel" src/i18n/en.ts && grep -rq "Annuler l'ajout" e2e/shell/editor-references.spec.ts tests/unit && echo ADD_CANCEL_OK
|
||||
EXPECT: ADD_CANCEL_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: ADD_CANCEL_OK
|
||||
24. [gated 2026-11-13] A shown tile outside the search carries « Ne correspond pas à la recherche »; the no-result notice shows only when no tile is shown; unit + e2e.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "editor.references.outside_search" src/i18n/fr.ts && grep -q "editor.references.outside_search" src/i18n/en.ts && echo OUTSIDE_OK
|
||||
EXPECT: OUTSIDE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: OUTSIDE_OK
|
||||
25. [gated 2026-11-13, amended rev 5b and C4 round 4] At 667 × 375: (A) with touch only (CDP touch swipes, no keyboard, no programmatic scroll) the trigger is brought wholly on screen and hit-testable, a tap opens the panel, heading and ✕ in the viewport and hit-testable, scrollY unchanged; (B) worst case, trigger bottom placed on the viewport bottom by an instant programmatic scroll (a touch landing cannot be pixel-exact: slop floor ~60 px), a tap opens the panel with heading and ✕ in view and hit-testable, scrollY unchanged (e2e, phone project). The rotation to 667 × 375 with the panel open at scroll 0 keeps its documented cramped exception (not built, offered to the owner at the checkpoint).
|
||||
26. [gated 2026-11-13] One history entry per reference edit (field blur, « Terminer », panel close), re-proved on the final code (unit + e2e green).
|
||||
27. [gated 2026-11-13] admin.spec diagnosis recorded: grant counts, interleaved A/B runs at pre-R2 65a8fd3 and HEAD with results and memory, conclusion with its evidence, still-failing tests listed in docs and BLK-015; no grant pagination, no reset, no deletion.
|
||||
28. [gated 2026-11-13] V1-2 contract notes dated 2026-11-13 at the four-tab bullet and at « Validated UX ».
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ "$(grep -c 'Note 2026-11-13' docs/development/V1-2_ANATOMICAL_SHEETS.md)" -ge 2 ] && echo V12_NOTE_OK
|
||||
EXPECT: V12_NOTE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: V12_NOTE_OK
|
||||
29. [gated 2026-11-13] No change outside scope since 52aac41 (no SQL, Rust, worker, scripts, docker, Supabase package, admin sources).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only 52aac41..HEAD -- supabase crates docker packages/supabase/src scripts apps/app/src/admin apps/app/src/components/admin apps/app/src/app/routes/app/admin)" ] && echo SCOPE2_OK
|
||||
EXPECT: SCOPE2_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE2_OK
|
||||
|
||||
## FILE SCOPE
|
||||
apps/app/src/editor/{tabs,navigation,focusRequest,useEditorNavigation,verification,editingContext}.ts, apps/app/src/editor/annotations/deselect.ts, apps/app/src/editor/references/** (new sort.ts), apps/app/src/components/editor/{EditorWorkspace,EditorTabBody,EditorTabs,DraftHeader,HeaderActions,KeptPlace}.tsx, apps/app/src/components/editor/references/**, apps/app/src/components/editor/findings/{FindingsTab,FindingContent,FindingDetail}.tsx, apps/app/src/components/editor/tabs/** (new ReferencesTab), apps/app/src/i18n/{fr,en}.ts, apps/app/tests/unit/**, apps/app/tests/helpers/editorRoute.tsx (StrictMode wrap, rev 5b), apps/app/src/editor/useViewport.ts (C1, rev 5b), apps/app/src/editor/useEditCommand.ts (only if the final-review I1 fix requires it), apps/app/e2e/{support,shell,ui}/**, docs/development/V1-2_ANATOMICAL_SHEETS.md (dated notes, criterion 28), docs/development/{V1-2-6_U1_CORRECTIONS,BROWSER_TESTS,V1-2-6_OWNER_TRIAL,RUST_ARCHITECTURE_REVIEW,V1-2-6_R2_LABELS}.md, docs/design/README.md, CLAUDE.md (tree), this contract, the plan, .claude/tasks/TODO.md, memory.
|
||||
@@ -0,0 +1,268 @@
|
||||
# CONTRACT — r2-ux-finish
|
||||
- date: 2026-11-13 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets (worktree /home/bchanot/Documents/faunosteo-v1-2)
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
J'ai terminé mon essai manuel de R2 sur db:trial.
|
||||
|
||||
Globalement, tout fonctionne et je suis satisfait du résultat. J'ai néanmoins plusieurs améliorations UX à apporter avant de clôturer R2.
|
||||
|
||||
Je te laisse autonome sur l'analyse, la conception technique, le découpage, les tests et l'implémentation. Tu connais le projet, ses contrats et son architecture. Utilise ton processus habituel de développement, de relecture et de validation.
|
||||
|
||||
L'objectif général est de rendre l'éditeur plus fluide, en évitant les déplacements inutiles dans la page et en conservant le contexte de navigation.
|
||||
|
||||
### 1. Constats : utiliser des modales
|
||||
|
||||
Actuellement, lorsqu'on clique sur un constat pour le consulter ou le modifier, son contenu s'affiche plus bas dans la page.
|
||||
|
||||
Quand il existe beaucoup de constats, c'est contraignant : il faut descendre, effectuer la modification, puis retrouver sa position précédente.
|
||||
|
||||
Je souhaite que le clic sur un constat ouvre une modale contenant son détail.
|
||||
|
||||
De même, l'ajout et la modification d'un constat devraient utiliser une modale.
|
||||
|
||||
Comportement attendu :
|
||||
- Ouverture du constat directement devant l'utilisateur.
|
||||
- Consultation et modification dans la modale.
|
||||
- Enregistrement, annulation ou fermeture.
|
||||
- Retour à l'endroit exact où l'utilisateur se trouvait, avec la même position de défilement et les mêmes filtres.
|
||||
- Conservation du contexte de sélection.
|
||||
|
||||
L'utilisateur ne doit pas devoir rechercher à nouveau son constat après avoir fermé la modale.
|
||||
|
||||
### 2. Références : modales pour l'ajout et la modification
|
||||
|
||||
Dans l'onglet Références, les tuiles dépliables fonctionnent bien pour consulter les informations.
|
||||
|
||||
En revanche, je préfère que les formulaires d'ajout et de modification s'ouvrent dans des modales.
|
||||
|
||||
Les tuiles restent utilisées pour la consultation.
|
||||
|
||||
L'utilisateur doit retrouver exactement sa position dans la liste lorsqu'il enregistre, annule ou ferme une modale.
|
||||
|
||||
### 3. Simplifier les références affichées dans un constat
|
||||
|
||||
Actuellement, lorsqu'un constat possède des références, leurs informations apparaissent directement dans son détail.
|
||||
|
||||
Or il existe déjà un bouton « X références » qui ouvre le volet latéral.
|
||||
|
||||
Cela fait doublon.
|
||||
|
||||
Je souhaite conserver uniquement :
|
||||
- Un libellé « Références citées ».
|
||||
- Le bouton « X références », qui ouvre le volet existant.
|
||||
- La possibilité de lier une référence existante au constat, comme actuellement.
|
||||
|
||||
La liste détaillée des références n'a plus besoin d'apparaître directement dans le constat.
|
||||
|
||||
### 4. « Tout afficher dans l'onglet Références » : filtrer automatiquement
|
||||
|
||||
Actuellement, ce bouton ouvre correctement l'onglet Références, mais affiche toutes les références.
|
||||
|
||||
Je voudrais qu'il affiche uniquement les références citées par le constat depuis lequel on vient.
|
||||
|
||||
Exemple :
|
||||
|
||||
Je consulte le constat A, qui cite les références 12 et 25.
|
||||
|
||||
Je clique sur « Tout afficher dans l'onglet Références ».
|
||||
|
||||
L'application ouvre l'onglet Références et n'affiche que les références 12 et 25.
|
||||
|
||||
Le filtre doit être clairement visible, par exemple :
|
||||
|
||||
« Références du constat : [Nom du constat] × »
|
||||
|
||||
L'utilisateur doit pouvoir retirer ce filtre pour retrouver toutes les références.
|
||||
|
||||
La recherche et le tri existants doivent rester utilisables avec ce filtre.
|
||||
|
||||
### 5. Navigation Précédent et historique du navigateur
|
||||
|
||||
C'est un point important.
|
||||
|
||||
Je veux que la navigation interne fonctionne naturellement avec le bouton Précédent du navigateur, y compris sur téléphone.
|
||||
|
||||
Exemple de parcours :
|
||||
|
||||
1. Je suis dans l'onglet Constats.
|
||||
2. J'ouvre le constat A.
|
||||
3. Je clique sur « 2 références ».
|
||||
4. Le volet des références citées s'ouvre.
|
||||
5. Je clique sur « Tout afficher dans l'onglet Références ».
|
||||
6. J'arrive dans l'onglet Références, filtré sur les deux références du constat A.
|
||||
7. J'appuie sur Précédent dans mon navigateur ou sur mon téléphone.
|
||||
8. Je reviens au constat A, avec son volet de références ouvert, dans l'état où je l'avais quitté.
|
||||
|
||||
Je souhaite aussi que les changements d'onglet et les autres navigations significatives soient cohérents avec l'historique du navigateur.
|
||||
|
||||
Tu peux prévoir un bouton de retour visible lorsque cela améliore l'expérience.
|
||||
|
||||
Choisis une solution adaptée au routeur et à l'architecture existante, sans accumuler d'entrées d'historique inutiles.
|
||||
|
||||
### 6. Menu « Plus » sur téléphone
|
||||
|
||||
Le menu « Plus » des onglets devrait fonctionner comme un véritable menu déroulant.
|
||||
|
||||
Je souhaite une ouverture et une fermeture fluides, avec une animation légère et naturelle.
|
||||
|
||||
L'objectif est que la navigation mobile paraisse moins rigide et soit plus agréable.
|
||||
|
||||
### 7. Menu principal latéral gauche
|
||||
|
||||
Actuellement, le menu principal latéral gauche défile avec le contenu de la page.
|
||||
|
||||
Je souhaite qu'il reste fixe à l'écran pendant que l'utilisateur fait défiler le contenu.
|
||||
|
||||
Le menu principal ne doit pas disparaître lorsqu'on descend dans une longue page.
|
||||
|
||||
Adapte naturellement le comportement aux différentes tailles d'écran. Si son contenu dépasse la hauteur disponible, il peut disposer de son propre défilement.
|
||||
|
||||
### 8. Principe général pour les formulaires
|
||||
|
||||
Plus généralement, je souhaite privilégier les modales pour les opérations d'ajout et de modification lorsque c'est pertinent.
|
||||
|
||||
Cela concerne notamment les écrans présentant de longues listes, où les formulaires intégrés au milieu ou au bas de la page rendent la navigation pénible.
|
||||
|
||||
Il ne s'agit pas de transformer aveuglément tous les formulaires en modales.
|
||||
|
||||
Analyse les composants existants et applique ce principe là où il améliore réellement l'expérience.
|
||||
|
||||
L'objectif est d'avoir un comportement cohérent dans l'ensemble de l'application :
|
||||
- Consulter facilement.
|
||||
- Ajouter ou modifier sans perdre sa position.
|
||||
- Enregistrer ou annuler.
|
||||
- Retrouver immédiatement son contexte précédent.
|
||||
- Utiliser naturellement Précédent et Suivant dans le navigateur.
|
||||
|
||||
Pense également au focus clavier, à l'accessibilité, aux erreurs de validation et aux modifications non enregistrées.
|
||||
|
||||
### 9. Finition de R2
|
||||
|
||||
Tu peux intégrer à ce travail les limites résiduelles déjà relevées au checkpoint R2, notamment :
|
||||
- Les saisies remplacées silencieusement pendant Défaire/Refaire.
|
||||
- Les annonces accessibles lorsque plusieurs brouillons sont abandonnés.
|
||||
- Les derniers petits problèmes de formatage.
|
||||
|
||||
Pour BLK-015, conserve le diagnostic établi sur l'accumulation des droits dans la sandbox et le suivi du chantier séparé de pagination.
|
||||
|
||||
### Organisation
|
||||
|
||||
Je te laisse choisir le découpage le plus pertinent, mutualiser les composants et prendre les décisions techniques nécessaires.
|
||||
|
||||
Tu peux apporter des améliorations complémentaires si elles servent directement les objectifs UX décrits.
|
||||
|
||||
Évite de multiplier les checkpoints intermédiaires pour des détails que tu peux résoudre par ton analyse et tes relectures habituelles.
|
||||
|
||||
Si une décision modifie réellement le fonctionnement métier, les droits, les données ou une règle importante déjà ratifiée, présente-moi le choix.
|
||||
|
||||
Sinon, avance de manière autonome.
|
||||
|
||||
À la fin, fournis-moi :
|
||||
- Le résumé des changements.
|
||||
- Les principaux choix UX et techniques.
|
||||
- Les tests et les résultats.
|
||||
- Les éventuelles limites restantes.
|
||||
- Une courte procédure pour tester les changements sur db:trial.
|
||||
|
||||
Je veux pouvoir essayer cette nouvelle navigation avant de considérer R2 définitivement terminé.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: Standing restrictions from the earlier R2 briefs still bind? / A: yes (owner briefs 2026-11-12 and 2026-11-13): no SQL migration, Rust, worker, roles, MFA or secrets change; no db:trial or DEV access (the owner's trial app is left running, untouched); automated tests only on db:sandbox through the guarded wrapper (preflight, full-row guard), editor-equine never run; no merge, no deploy; the untracked faunosteo-v1-2-6-revue-ux-chatgpt.md kept; R3, R4, U2, U2b not started; BLK-015 diagnosis kept, grant pagination stays in RR-13.
|
||||
Q: Pass B open choices (visible wording, placement, animation timings, dialog layouts, URL parameter names `q`, `species`, `archived`, the « Revenir au constat » button, the post-create notice) / A: delegated — defaults of plan rev 1 (R2F-1 to R2F-9), reported in the final French report with the FR/EN table [gated 2026-11-13]
|
||||
Q: Pass A gaps? / A: none. The owner delegated analysis, design, split, tests and implementation; choices touching business behaviour, rights, data or an important ratified rule are presented once, at the plan validation gate.
|
||||
|
||||
Q: Plan rev 3 and choices 1-5 / A: approved by the owner 2026-11-13 (« je valide le plan et les choix 1 à 5 »), choice 6 = default (no list search kept, BDR-078); precisions 1-5 folded as criteria 13-17 [gated 2026-11-13]
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Constats: activating a tree item opens a modal dialog with its detail in front of the user; add and edit of a finding happen in a modal dialog; save, cancel and close are available; after any of them the page scroll position, the tree's expanded branches and the selection are those before the dialog opened, and focus returns to the opener (no re-search).
|
||||
2. Références: tiles stay the reading surface; adding and editing a reference happen in a modal dialog; after save, cancel or close the list scroll position, search, sort, filter and open tiles are those before the dialog opened.
|
||||
3. A finding's detail no longer lists its cited references inline: it shows the label « Références citées », the « X références » button opening the citations panel, and the control linking an existing reference.
|
||||
4. « Tout afficher dans l'onglet Références » opens the Références tab filtered to the references cited by the source finding, with a visible removable chip « Références du constat : [name] × »; search and sort keep working with the filter; removing the chip shows every reference.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "editor.references.filter_chip" src/i18n/fr.ts && grep -q "editor.references.filter_chip" src/i18n/en.ts && echo FILTER_KEY_OK
|
||||
EXPECT: FILTER_KEY_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: FILTER_KEY_OK
|
||||
5. Browser Back and Forward follow the editor's internal navigation (tab changes, the finding dialog, the citations panel, the filtered Références tab), desktop and phone, with no duplicate or orphan entries; the owner's 8-step journey ends, after Back, on finding A with its panel open as left (e2e).
|
||||
6. The phone « Plus » tab menu opens and closes as a dropdown with a light animation (none under reduced motion), closes on outside click and Escape, keyboard and screen-reader usable.
|
||||
7. The main left sidebar stays in view while the page scrolls (sizes where it is shown), with its own scroll when taller than the viewport; no sideways scroll introduced.
|
||||
8. App-wide review of add/edit forms recorded (each candidate with its decision and reason); modals applied where the review says they help; focus, accessibility, validation errors and unsaved changes handled in every new dialog (no silent loss).
|
||||
9. R2 residuals: no typed text is replaced or dropped silently by Défaire/Refaire or by a read-only flip; announcements of several abandoned drafts are all heard (or the cause removed); `prettier --check` passes on the e2e and source files this run touches (fr.ts and en.ts exempt: pre-existing long lines, one line per new key; owner gate 2026-11-13).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && pnpm -s exec prettier --check e2e/shell/editor-shell-layout.spec.ts >/dev/null && echo PRETTIER_LAYOUT_OK
|
||||
EXPECT: PRETTIER_LAYOUT_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: PRETTIER_LAYOUT_OK
|
||||
10. Gates: typecheck, lint, test:run, build, e2e:ui green; e2e:shell on db:sandbox through the guarded wrapper without editor-equine, every failure other than admin.spec (BLK-015) fixed; no pre-existing sandbox row changed, metadata included.
|
||||
11. No change under supabase/, crates/, docker/, scripts/, packages/supabase/src; no db:trial or DEV access; no merge.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only 36c6eb3..HEAD -- supabase crates docker scripts packages/supabase/src)" ] && echo SCOPE3_OK
|
||||
EXPECT: SCOPE3_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: SCOPE3_OK
|
||||
12. Final French report: summary of changes, main UX and technical choices, tests and results, remaining limits, short db:trial test procedure.
|
||||
13. [gated 2026-11-13] A changed « Enregistrer » in the finding or reference dialog is exactly ONE undoable operation (undo length +1, one Défaire restores the prior state); a pristine « Enregistrer » and every « Annuler » / « Abandonner » add none (unit + e2e).
|
||||
14. [gated 2026-11-13] The citations sheet stacked over the finding dialog is fully usable by keyboard (Tab reaches every control, Escape closes the sheet only, focus returns to « X références ») and by touch (taps on its controls at 375 with hasTouch, the dialog underneath not activated) (e2e).
|
||||
15. [gated 2026-11-13] Browser history entries hold navigation state only (tab, section, open layers by element key, references filter by finding key): no typed text, no search term, no draft; an entry restores only for the same sheet and the same signed-in account, otherwise the editor opens on its default view (unit: entry state shape and mismatch rules).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && f=src/editor/history/entry.ts && [ -f "$f" ] && grep -q "sheetId" "$f" && grep -q "tag" "$f" && ! grep -Eq "^\s*(query|draft|text|search)\??\s*:" src/editor/history/*.ts && echo HISTORY_SHAPE_OK
|
||||
EXPECT: HISTORY_SHAPE_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: HISTORY_SHAPE_OK
|
||||
16. [gated 2026-11-13] With the « Plus » menu open, the platform back request (CloseWatcher where the browser offers it) closes the menu before any navigation; without CloseWatcher the limit is stated (unit with a CloseWatcher stub).
|
||||
17. [gated 2026-11-13] No user modification is lost silently in any documented limit (owner condition on the stated limits).
|
||||
18. [gated 2026-11-13] Clients and Animaux lists keep no search term in browser history (BDR-078; choice 6 = default).
|
||||
|
||||
## FILE SCOPE
|
||||
apps/app/src/editor/** (navigation, history adapter, references view and filter), apps/app/src/components/editor/** (findings, references, citations, tabs, workspace, layers), apps/app/src/components/ui/{ModalDialog,Dialog}.tsx (only if a shared fix is needed), apps/app/src/components/shell/{ShellChrome,AppLayout}.tsx, apps/app/src/clients/useClientList.ts, apps/app/src/animals/useAnimalList.ts and their list routes (if the app-wide review keeps them), apps/app/src/i18n/{fr,en}.ts, apps/app/src/styles/** (only if needed), apps/app/tests/**, apps/app/e2e/{support,shell,ui}/**, docs/development/{V1-2-6_U1_CORRECTIONS,V1-2-6_OWNER_TRIAL,V1-2-6_R2_LABELS,BROWSER_TESTS,V1-2_ANATOMICAL_SHEETS}.md, docs/design/README.md, this contract, the plan, .claude/tasks/TODO.md, memory.
|
||||
|
||||
ORACLE AMENDMENT 2026-11-13 (controller): criterion 4 key renamed to the shipped key editor.references.filter_chip (chip « Références du constat : {name} »); criterion 15 path is src/editor/history/entry.ts (folder split in Task 1) and the forbidden-field scan covers every file of src/editor/history. Same assertions, no weakening.
|
||||
|
||||
## Owner trial 2026-11-14 (brief « Retour de mon essai propriétaire R2 »): additional criteria
|
||||
19. [gated 2026-11-14] Finding view mode shows « Références citées » and « X références » only (no cite or remove control); edit mode adds and removes citations in the form draft; one changed « Enregistrer » = one undoable operation covering names and citations; the side sheet has no « Retirer de ce constat » (unit + e2e).
|
||||
20. [gated 2026-11-14] After deleting a finding, the first « Défaire » restores it at once, selected, visible and focused; the first Back after a deletion has a visible effect (unit + e2e).
|
||||
21. [gated 2026-11-14] Choosing a « Plus » entry by keyboard moves the focus to the new tab's panel (e2e at 375).
|
||||
22. [gated 2026-11-14] History entries hold a random session tag, never an account id; accounts stay separated (tag bound to the account by a digest, rotated on sign-out and on mismatch); left-draft flag keyed by the tag (unit).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && ! grep -q "userId" src/editor/history/entry.ts && ! grep -q "userId" src/editor/leftDraft.ts && grep -q "tag" src/editor/history/entry.ts && echo SESSION_TAG_OK
|
||||
EXPECT: SESSION_TAG_OK
|
||||
EVIDENCE: MET SESSION_TAG_OK (controller 2026-11-14, rc 0; verifier rerun)
|
||||
23. [gated 2026-11-14] With a dirty dialog, a multi-entry traversal leaving the editor asks « Abandonner les modifications ? » before anything is lost where the Navigation API can cancel it (Chromium, e2e via CDP history jump); elsewhere the after-the-fact notice stays (unit).
|
||||
24. [gated 2026-11-14] R2 closure docs: validated status, limits accepted and lifted, a short list of final manual checks (incl. Android Back on a real phone, the leave confirmation, the fallback browsers).
|
||||
25. [gated 2026-11-14] U2 orientation recorded in the U2 plan, the UX decisions and the design README (annotation property modals with direct manipulation kept; boards to redraw and validate before U2 code); U2 not started.
|
||||
|
||||
ORACLE AMENDMENT 2026-11-14 (controller): criterion 15 now reads « same sheet and same session tag » (owner decision 2026-11-14 replaces the account id); its oracle checks `sheetId` and `tag` instead of `userId`.
|
||||
|
||||
SCOPE AMENDMENT 2026-11-14 (controller): apps/app/src/app/providers/AuthProvider.tsx joins FILE SCOPE (Task 8: the session tag rotates on sign-out for the app lifetime; an editor-local subscription would miss a sign-out while the editor is unmounted).
|
||||
|
||||
SCOPE AMENDMENT 2026-11-14 (controller): docs/development/V1-2-6_UX_PLAN.md and V1-2-6_UX_DECISIONS.md join FILE SCOPE (required by criterion 25); CLAUDE.md folder map lines, useLeaveGuard.ts and components/ui/afterModalsClosed.ts accepted (helpers named by the plan).
|
||||
|
||||
## Owner follow-up 2026-11-15 (brief « Suite de mon essai propriétaire R2 »): additional criteria
|
||||
26. [gated 2026-11-15] Tab order is Général, Annotations, Constats, Références, Vérification at every width; on phones the « Plus » entries keep that relative order (unit tabsFor + e2e 375).
|
||||
27. [gated 2026-11-15] « Plus » opens a vertical dropdown (entries stacked top to bottom, touch rows ≥ 44 px, active entry marked by more than colour, light motion, none under reduced motion, inside the viewport at 320/375, no sideways scroll); existing dismissals and keyboard focus kept (unit + e2e + axe).
|
||||
28. [gated 2026-11-15] The finding dialog, in view and edit modes, shows only « Références citées » and « X références »; its « Modifier » edits the finding's properties only (no citation list or control) and its save never rewrites citations (unit + e2e).
|
||||
29. [gated 2026-11-15] « X références » opens a modal references dialog stacked over the finding dialog, replacing the side sheet; view mode reads the cited references (no modifying control), close returns to the finding dialog with focus on « X références »; Back, reload restore, « Tout afficher » and « Aller à » keep working (unit + e2e, keyboard and touch, axe).
|
||||
30. [gated 2026-11-15] The references dialog's own « Modifier » edits the associations in a draft: cite an existing reference, remove one, create a new one (cited in the draft), open a reference's edit dialog; « Enregistrer » = ONE undoable operation, pristine none, « Annuler »/close/Back/leave with changes asks first (no silent loss) (unit + e2e).
|
||||
31. [gated 2026-11-15] Docs: R2 follow-up recorded, limits and labels updated, a short db:trial check procedure for both adjustments.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "4.13" docs/development/V1-2-6_OWNER_TRIAL.md && echo FOLLOWUP_DOCS_OK
|
||||
EXPECT: FOLLOWUP_DOCS_OK
|
||||
EVIDENCE: MET FOLLOWUP_DOCS_OK (controller 2026-11-15, rc 0; verifier rerun)
|
||||
|
||||
CLARIFICATIONS 2026-11-15 (controller, owner brief 2026-11-15): the tests removed or reduced in b41c24b..HEAD (editor-shell-layout.spec.ts sheet edge geometry, editor-finding-dialog / editor-findings citation controls in the finding form, editor-initial-tab tier parameter, editor-reference-dialog reference over the side sheet, editor-references-panel sheet scrim and header) cover behaviour the owner asked to remove (side sheet, citing in the finding form, phone split); their replacements live in editor-citations-edit.test.tsx, editor-citations-guards.test.tsx and the updated e2e specs. These assertion drops are authorized.
|
||||
|
||||
## Owner pre-closure brief 2026-11-15 (« Avant la clôture définitive de R2 »): additional criteria
|
||||
32. [gated 2026-11-15] In the references dialog's edit mode, the select only browses: arrow keys or a pick never change the draft; a « Citer » button adds the chosen reference (unit + e2e keyboard).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "'editor.citations.cite'" src/i18n/fr.ts && grep -q "'editor.citations.cite'" src/i18n/en.ts && echo CITE_KEY_OK
|
||||
EXPECT: CITE_KEY_OK
|
||||
EVIDENCE: MET CITE_KEY_OK (controller 2026-11-15 rc 0; verifier rerun)
|
||||
33. [gated 2026-11-15] A reference created from the references dialog's edit mode is written only by its « Enregistrer », together with the citations, as ONE undoable operation; abandoning the draft leaves the library unchanged; « Ajouter une référence » in the Références tab still creates an independent reference at once (unit + e2e).
|
||||
34. [gated 2026-11-15] Labels follow the cited element's kind: « Références du constat » / « Ce constat ne cite aucune référence. » for a finding, « Références de la famille » / « Cette famille ne cite aucune référence. » for a family, same logic in EN and in the filtered Références tab (unit).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "Références de la famille" src/i18n/fr.ts && grep -q "Cette famille ne cite aucune référence." src/i18n/fr.ts && grep -q "'editor.references.panel_empty_family'" src/i18n/en.ts && echo FAMILY_LABELS_OK
|
||||
EXPECT: FAMILY_LABELS_OK
|
||||
EVIDENCE: MET FAMILY_LABELS_OK (controller 2026-11-15 rc 0; verifier rerun)
|
||||
35. [gated 2026-11-15] The shared Dialog ✕ has a touch area of at least 44 × 44 px (e2e bounding box at 375 and 1280, axe).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "h-11 w-11" src/components/ui/Dialog.tsx && echo CLOSE_44_OK
|
||||
EXPECT: CLOSE_44_OK
|
||||
EVIDENCE: MET CLOSE_44_OK (controller 2026-11-15 rc 0; verifier rerun)
|
||||
36. [gated 2026-11-15] Docs: limits lifted, labels table, short manual checks for db:trial; the full sweep reported with its failures (never as all green).
|
||||
|
||||
CLARIFICATIONS 2026-11-15 b (controller, owner pre-closure brief): the Rev 5 unit tests in apps/app/tests/unit/editor-citations-edit.test.tsx asserting that a reference created from the edit mode is in the library before « Enregistrer » (two undo steps) and stays uncited after an abandon are inverted by Task 15 (owner item 2 asks the opposite behaviour); the inversion is authorized, the new assertions are stricter (library unchanged, one undo step).
|
||||
|
||||
SCOPE AMENDMENT 2026-11-15 (controller): apps/app/e2e/harness/dialog.tsx joins FILE SCOPE (the ui Dialog harness gains the long-title case for criterion 35; dev-server only, never built).
|
||||
|
||||
CLARIFICATIONS 2026-11-15 c (controller, owner pre-closure brief: « Le balayage complet présente toujours des échecs et ne doit pas être annoncé comme entièrement vert »): for criterion 10, full-sweep failures that are browser crashes (« Target crashed ») or navigation timeouts under the accumulated sandbox load, and that pass when their spec runs alone, are reported to the owner with their counts and names, as the BLK-015 family; they are not counted as fixed and the sweep is never announced green.
|
||||
|
||||
## CLOSURE 2026-11-15 (owner brief « Clôture R2 »)
|
||||
Owner: db:trial manual checks done, all pass; R2 validated functionally and graphically, no further correction. Choices ratified: « Modifier la référence » on a saved reference keeps its own dialog and Défaire; an unsaved new reference is lost on an abrupt browser close (as other unsaved forms). Criteria 1-36: MET, with criterion 10 reported as is: final sweep 52d5613 273 passed, 163 skipped, 6 failed (admin.spec, BLK-015 open, RR-13); never announced green. Status: CLOSED. No merge, no deployment authorized.
|
||||
@@ -0,0 +1,286 @@
|
||||
# CONTRACT — r3-sheet-list
|
||||
- date: 2026-11-16 | flow: subagent-driven-development (plan `.claude/tasks/plans/2026-11-16-r3-sheet-list-0017.md` rev 2b) | branch: feature/v1-2-anatomical-sheets (worktree /home/bchanot/Documents/faunosteo-v1-2)
|
||||
- status: active
|
||||
- range under review: `98178de..HEAD` (`98178de` = the commit before the R3 plan)
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
### Owner brief 2026-11-16 (R3 start)
|
||||
|
||||
Je confirme la clôture de R2. Merci pour le travail réalisé.
|
||||
|
||||
Je donne maintenant mon feu vert pour démarrer la préparation de R3 : amélioration de la liste des fiches anatomiques et de l'accueil Administration.
|
||||
|
||||
Les maquettes R0 correspondantes, notamment les planches 28 à 30, sont déjà validées et constituent notre référence graphique.
|
||||
|
||||
Je souhaite retrouver une liste de fiches claire et facile à utiliser, avec :
|
||||
- Une recherche efficace.
|
||||
- Des filtres compréhensibles sur les statuts.
|
||||
- Un tri par nom.
|
||||
- Un tri par véritable date de dernière modification.
|
||||
- Une présentation permettant de distinguer facilement une fiche historique, une fiche publiée, un brouillon et une copie de travail.
|
||||
- Une navigation simple pour retrouver rapidement la fiche que je souhaite consulter ou modifier.
|
||||
|
||||
Pour la date de dernière modification, reprends la conception déjà validée dans V1-2-6_R3_SQL_CHECKPOINT.md.
|
||||
|
||||
Présente-moi d'abord le checkpoint SQL et ses conséquences avant toute application de migration.
|
||||
|
||||
Je te laisse autonome pour :
|
||||
- Auditer l'existant.
|
||||
- Réutiliser les décisions et maquettes déjà validées.
|
||||
- Préparer le plan technique.
|
||||
- Organiser les relectures indépendantes.
|
||||
- Identifier les éventuelles contradictions ou dépendances.
|
||||
|
||||
Conserve BLK-015 et RR-13 comme chantiers séparés, sans perdre leur suivi.
|
||||
|
||||
Je souhaite pouvoir tester R3 sur db:trial lorsqu'il sera terminé.
|
||||
|
||||
Une fois le checkpoint SQL et le plan prêts, présente-moi les décisions nécessitant mon accord avant l'implémentation.
|
||||
|
||||
### Owner validation 2026-11-16 (plan rev 2, decisions D1 to D7)
|
||||
|
||||
Je valide le plan R3 en révision 2 et les décisions suivantes.
|
||||
|
||||
D1 : OUI.
|
||||
Écriture de la migration SQL et des tests correspondants.
|
||||
|
||||
D2 : OUI.
|
||||
Une seule livraison à l'état final. Il n'est pas nécessaire de construire l'état intermédiaire sans date.
|
||||
|
||||
D3 : OUI.
|
||||
L'ordre retenu est :
|
||||
- Migration de la sandbox.
|
||||
- Migration de db:trial.
|
||||
- Mise à jour de l'application.
|
||||
|
||||
Je valide le principe de la nouvelle commande pnpm db:sandbox migrate, sans réinitialisation de la sandbox.
|
||||
|
||||
En revanche, présente-moi le checkpoint opérationnel avant d'appliquer la migration à db:trial.
|
||||
|
||||
Cette opération nécessite l'arrêt temporaire de mon application d'essai et une sauvegarde. Je donnerai mon accord au moment voulu.
|
||||
|
||||
D4 : OUI.
|
||||
Élargir RR-13 à la pagination des listes d'administration, notamment les droits et les fiches, sans implémenter ce chantier dans R3.
|
||||
|
||||
D5 : NON.
|
||||
Conserver la recherche, le tri et les filtres au retour d'une fiche reste hors R3, conformément aux décisions existantes.
|
||||
|
||||
Le besoin reste suivi pour une amélioration ultérieure de la navigation.
|
||||
|
||||
D6 : OUI.
|
||||
Je conserve les libellés recommandés :
|
||||
- « Toutes les fiches officielles » pour zéro ou une fiche.
|
||||
- « Voir les {n} fiches » à partir de deux.
|
||||
|
||||
D7 : OUI.
|
||||
Les tests peuvent effectuer une suppression logique des fiches qu'ils ont eux-mêmes créées.
|
||||
|
||||
Ils doivent identifier précisément leurs propres données et ne jamais modifier ou supprimer les données préexistantes de la sandbox.
|
||||
|
||||
Je valide également les autres choix retenus dans le plan :
|
||||
- Présentation conforme aux maquettes R0.
|
||||
- Filtres existants.
|
||||
- Recherche sans résultat conforme à la planche 28.
|
||||
- Pas de nouvelle icône de recherche.
|
||||
- Tri alphabétique selon la langue.
|
||||
- Dates affichées en heure de Paris.
|
||||
- Recherche et tri de présentation en TypeScript.
|
||||
|
||||
Quelques précisions :
|
||||
|
||||
1. Vérifie que les tests couvrent le calcul réel de last_modified_at sur PostgreSQL, notamment les brouillons et les copies de travail.
|
||||
|
||||
2. La migration doit être relue et figée avant sa première application.
|
||||
|
||||
3. L'application ne doit jamais afficher une date ancienne ou incorrecte comme une date fiable de dernière modification.
|
||||
|
||||
4. Conserve les résultats exacts des tests, notamment les échecs connus de BLK-015.
|
||||
|
||||
Tu peux maintenant committer le plan et le TODO, puis engager l'implémentation de R3 selon ton processus habituel.
|
||||
|
||||
Tu disposes de mon accord pour les développements et les vérifications sur la sandbox dans le périmètre du plan validé.
|
||||
|
||||
Avant toute migration de db:trial, présente-moi :
|
||||
- Les opérations exactes.
|
||||
- La sauvegarde prévue.
|
||||
- Le temps d'indisponibilité estimé.
|
||||
- La procédure de vérification après redémarrage.
|
||||
|
||||
Je donnerai alors mon accord pour cette opération.
|
||||
|
||||
DEV reste inchangé.
|
||||
|
||||
Je te laisse autonome pour les choix techniques et les relectures habituelles.
|
||||
|
||||
### Owner go 2026-11-16 (db:trial migration, then the application tasks)
|
||||
|
||||
Je valide le checkpoint SQL M9 et j'autorise son application sur db:trial.
|
||||
|
||||
Je préfère que tu réalises toi-même les opérations prévues, puisque tu as préparé et audité la procédure.
|
||||
|
||||
Mon autorisation couvre :
|
||||
|
||||
1. La vérification de l'état initial de db:trial.
|
||||
2. L'arrêt temporaire de l'application d'essai sur le port 5194.
|
||||
3. La sauvegarde à froid des volumes et des secrets par la procédure prévue.
|
||||
4. L'application de la migration M9 avec pnpm db:trial migrate.
|
||||
5. Le redémarrage et la vérification des six conteneurs.
|
||||
6. Les contrôles d'intégrité des données et de la nouvelle fonction SQL.
|
||||
7. Le redémarrage de l'application d'essai.
|
||||
|
||||
Avant d'arrêter l'application, vérifie que le processus ciblé correspond bien à l'application Faunosteo sur le port 5194. Ne te fie pas uniquement au PID 1718512, qui peut avoir changé.
|
||||
|
||||
La sauvegarde doit être complète, vérifiée et récupérable avant l'application de M9.
|
||||
|
||||
Je valide l'interruption temporaire annoncée de db:trial.
|
||||
|
||||
En cas d'échec de la sauvegarde ou de la migration, arrête la procédure et présente-moi le diagnostic. N'effectue pas de restauration destructive sans mon accord.
|
||||
|
||||
Après migration, vérifie notamment :
|
||||
- Les 18 migrations appliquées.
|
||||
- Les comptes, rôles et facteurs TOTP.
|
||||
- Les fiches, versions et illustrations.
|
||||
- Le calcul de last_modified_at.
|
||||
- L'absence de modification inattendue des données.
|
||||
- Le fonctionnement de l'administration et de l'éditeur.
|
||||
|
||||
DEV reste strictement inchangé.
|
||||
|
||||
Conserve les échecs pgTAP 014 et 021 dans le suivi, avec leurs résultats exacts. Ne présente pas la suite complète comme verte.
|
||||
|
||||
Une fois M9 appliquée et vérifiée sur db:trial, tu peux poursuivre les tâches applicatives de R3 selon le plan validé, avec tes relectures et tests habituels.
|
||||
|
||||
À la fin, présente-moi le bilan et la procédure d'essai propriétaire de R3.
|
||||
|
||||
### Owner message 2026-11-16 (R3 trial feedback: collapsible filters on a phone)
|
||||
|
||||
Retour de mon essai propriétaire R3 sur db:trial.
|
||||
|
||||
Tous les tests fonctionnels sont satisfaisants. Je valide le comportement général de R3.
|
||||
|
||||
J'ai seulement une dernière amélioration UX à demander pour le téléphone.
|
||||
|
||||
Actuellement, sur mobile, les quatre filtres suivants occupent beaucoup de place :
|
||||
|
||||
- Espèce
|
||||
- État de la fiche
|
||||
- Statut de version
|
||||
- État de la dernière revue
|
||||
|
||||
Je souhaite les regrouper dans un volet repliable.
|
||||
|
||||
Comportement attendu :
|
||||
|
||||
- Sur téléphone, les quatre filtres sont masqués par défaut.
|
||||
- Un bouton « Filtres » permet d'ouvrir et de refermer le volet.
|
||||
- À l'ouverture, les quatre filtres apparaissent verticalement.
|
||||
- Les filtres continuent de fonctionner immédiatement.
|
||||
- Fermer le volet ne réinitialise pas les filtres sélectionnés.
|
||||
- Si des filtres sont actifs, le bouton doit le signaler clairement, par exemple « Filtres (2) ».
|
||||
- L'utilisateur doit pouvoir réinitialiser facilement les filtres.
|
||||
- La recherche et le tri restent directement accessibles, sans devoir ouvrir le volet.
|
||||
|
||||
Je souhaite une ouverture fluide, cohérente avec les autres panneaux de l'application, et adaptée à une utilisation tactile.
|
||||
|
||||
Sur ordinateur, conserve la présentation actuelle.
|
||||
|
||||
Je te laisse choisir le composant, le breakpoint et les détails d'intégration les plus pertinents.
|
||||
|
||||
Cette amélioration ne nécessite pas de nouvelle maquette complète.
|
||||
|
||||
Après cette correction, termine les vérifications et la clôture documentaire de R3.
|
||||
|
||||
Pense également à solder l'écart du vérificateur automatique et à vérifier la remarque sur la double annonce aux lecteurs d'écran, sans rouvrir les décisions UX déjà validées.
|
||||
|
||||
Conserve BLK-015 et les échecs connus des tests d'administration dans leur suivi séparé.
|
||||
|
||||
Tu peux utiliser ton processus habituel de développement, de tests, de relectures et de commits.
|
||||
|
||||
À la fin, présente-moi un court bilan et le résultat des vérifications mobiles.
|
||||
|
||||
R3 est validé fonctionnellement par mes essais, sous réserve de cette dernière amélioration mobile.
|
||||
|
||||
### Owner validation 2026-11-16 (R3 closed)
|
||||
|
||||
Je confirme avoir testé le volet repliable des filtres sur téléphone.
|
||||
|
||||
Tout fonctionne correctement et l'ergonomie me convient.
|
||||
|
||||
Je valide officiellement R3, y compris sa dernière amélioration mobile.
|
||||
|
||||
Je confirme également que « Réinitialiser les filtres » doit rester uniquement à l'intérieur du volet. Aucun bouton supplémentaire n'est nécessaire.
|
||||
|
||||
Tu peux enregistrer cette validation propriétaire dans la documentation, le suivi et la mémoire, puis committer et pousser les éventuelles mises à jour.
|
||||
|
||||
R3 est terminé.
|
||||
|
||||
Nous pouvons maintenant passer à R4 : affichage des erreurs d'intégrité sur les cartes du catalogue.
|
||||
|
||||
Reprends les décisions déjà validées, notamment D9 C, les maquettes R0 et le plan V1-2.6.
|
||||
|
||||
Je te laisse autonome pour auditer l'existant, préparer le plan technique et organiser les relectures habituelles.
|
||||
|
||||
Présente-moi les éventuelles décisions qui nécessitent mon accord avant l'implémentation.
|
||||
|
||||
Conserve BLK-015 et RR-13 comme chantiers séparés.
|
||||
|
||||
Aucune fusion ni intervention sur DEV.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- Graphic reference: boards 28 and 29 of `docs/design/v1-2-6-r0/` (R0, validated 2026-11-09). Board 30 belongs to R4.
|
||||
- Labels: `docs/design/v1-2-6-r0/REVUE.md:82-84`. Date format (A8): « 9 nov. 2026, 12:06 » / « 9 Nov 2026, 12:06 », Paris time.
|
||||
- Recorded choices the owner validated with the plan: no new badge (published and draft told apart by the detail line), the four existing filters unchanged, the no-result note of board 28 literally, no magnifier in the search field, name sort in the collation of the interface language, search and sort in TypeScript (display only).
|
||||
- Out of scope, tracked: BLK-015 (rights screen under axe on accumulated grants), RR-13 (server paging of the admin lists, widened per D4, not implemented), D5 (list state kept on return), R4 (board 30).
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. SQL: `private.official_sheet_admin_summary(uuid)` returns `last_modified_at` = the newest of the sheet row's `updated_at` and of its versions' `updated_at`; the migration is the M7 function body plus that key and the restated revoke, nothing else; privileges unchanged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ "$(git hash-object supabase/migrations/20261116100000_sheet_admin_last_modified.sql)" = a33b1770ec284bfbb25245fc606c9f952d4651e3 ] && echo M9_FROZEN_OK
|
||||
EXPECT: M9_FROZEN_OK
|
||||
2. Precision 1: pgTAP (`supabase/tests/022_sheet_admin_reads.sql`) covers the real computation on PostgreSQL for a saved draft, a saved working copy, a sheet without version and a sheet row newer than its versions; the file passes on PGlite.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "select plan(74)" supabase/tests/022_sheet_admin_reads.sql && grep -c "last_modified_at" supabase/tests/022_sheet_admin_reads.sql
|
||||
EXPECT: a count of at least 8
|
||||
3. Precision 2: the migration file was reviewed (task review, security review) before its first application and has not changed since (criterion 1's digest; no other file under `supabase/migrations/` changed in the range).
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --name-only $(git rev-parse 2277e41^)..HEAD -- supabase/migrations | tr '\n' ' '
|
||||
EXPECT: supabase/migrations/20261116100000_sheet_admin_last_modified.sql only
|
||||
4. Precision 3: the application never shows an old or wrong date as the last modification: the client refuses an answer without `last_modified_at` or with a value that is no timestamp (`unavailable`), the list and the card show `last_modified_at` only (never `updated_at` or `created_at` under « Modifiée le »), the `<time>` carries the same instant.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && sed 's#//.*$##' packages/supabase/src/sheets.ts | tr -d ' \n' | grep -q "last_modified_at:z.string().datetime({offset:true}).refine((value)=>!Number.isNaN(Date.parse(value)))" && ! grep -rn "ModifiedDate iso={[^}]*\(updated_at\|created_at\)" apps/app/src && echo DATE_SOURCE_OK
|
||||
EXPECT: DATE_SOURCE_OK
|
||||
5. List page `/app/admin/sheets`: a search on the sheet name (French or English, accents and case ignored, instant), combined with the four existing status filters; a native « Trier par » with « Dernière modification » (default, newest first) and « Nom » (collation of the interface language); a count line « {n} fiches » / « {n} fiches sur {total} »; each row shows « Modifiée le {date} » in the ratified format, Paris time.
|
||||
6. The search field: label « Rechercher une fiche par son nom », 100 characters at most, no magnifier; a clear control « Effacer la recherche » only while it holds text; Escape empties a non-empty field and does nothing on an empty one; clearing returns the focus to the field.
|
||||
7. Empty states as board 28's note: no official sheet at all, nothing under active filters, nothing for a search (« Aucune fiche ne contient « {q} » dans son nom. » with « Effacer la recherche »); the searched text is shown as typed (a `$&` stays `$&`), long text wraps without sideways scroll.
|
||||
8. The presentation tells a historical sheet, a published sheet, a draft and a working copy apart with the existing badges and the detail line; no new badge, no rule built on a UUID, a name, a slug or a test convention (D7 of the R0 arbitration).
|
||||
9. Administration home card (board 29 B): sub-heading « Dernières modifications », at most five sheets by last modification, each with its name link, badges, detail line and date; the footer link reads « Voir les {n} fiches » from two sheets and « Toutes les fiches officielles » for zero or one (D6); a failed species read never hides the card; a rights refusal of the sheet list still hides it.
|
||||
10. Labels in French and English exactly as the ratified list, through the dictionaries with fr / en parity; no raw string in JSX.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && for k in admin.sheets.search admin.sheets.clear_search admin.sheets.sort_by admin.sheets.sort.modified admin.sheets.sort.name admin.sheets.count_one admin.sheets.count_other admin.sheets.count_of_one admin.sheets.count_of_other admin.sheets.modified admin.sheets.no_result admin.home.latest admin.home.see_all; do grep -q "'$k'" src/i18n/fr.ts && grep -q "'$k'" src/i18n/en.ts || echo "MISSING $k"; done; echo KEYS_CHECKED
|
||||
EXPECT: KEYS_CHECKED with no MISSING line
|
||||
11. D3: the sandbox was migrated through `pnpm db:sandbox migrate` without a reset; `scripts/db-sandbox.sh` received additions only.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff $(git rev-parse 2277e41^)..HEAD -- scripts/db-sandbox.sh | grep -c '^-[^-]'
|
||||
EXPECT: 0
|
||||
12. D7: the browser spec `apps/app/e2e/shell/admin-sheets-list.spec.ts` deletes (soft deletion) only the sheet ids it created in its own run, captured one by one; no statement of the spec can match a pre-existing sheet row.
|
||||
13. Browser proof on the sandbox: the spec proves the order by the true date (a draft save moves a sheet first), the name sort, the no-result state, the focus return, axe and no sideways scroll, in French and English at desktop and 375 px.
|
||||
14. Precision 4 and the go message: exact test results are kept in `.claude/tasks/TODO.md` and the documents, including the `admin.spec.ts` failures of BLK-015 and the pgTAP failures of `014_animals_relations` and `021_sheet_verification_jobs` on the accumulated sandbox; no suite that failed is called green anywhere.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -c "Bad plan. You planned 90 tests but ran 42" .claude/tasks/TODO.md
|
||||
EXPECT: at least 1
|
||||
15. BLK-015 and RR-13 stay separate, open tracks with their lines kept; RR-13's text is widened to the admin lists (rights and sheets) per D4; D5 is tracked as a later navigation improvement.
|
||||
16. Scope: nothing changed under `crates/`, `scripts/db-trial*`, `apps/app/src/components/editor/`, `apps/app/src/components/catalogue/`, `GrantList`; `admin.spec.ts` changed only by the two locator rewrites.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only $(git rev-parse 2277e41^)..HEAD -- crates 'scripts/db-trial*' apps/app/src/components/editor apps/app/src/components/catalogue apps/app/src/components/admin/GrantList.tsx)" ] && echo SCOPE_OK
|
||||
EXPECT: SCOPE_OK
|
||||
17. Documents as built: the R3 section of `V1-2-6_U1_CORRECTIONS.md`, the SQL checkpoint status, the owner trial procedure in French (`V1-2-6_OWNER_TRIAL.md` §4.15), M9 in `V1-2_ANATOMICAL_SHEETS.md`, `SUPABASE.md`, `BROWSER_TESTS.md`, the Rust exception rows, `docs/design/README.md` (deviations), `CLAUDE.md`, `CHANGELOG.md`.
|
||||
18. No merge, no deploy, DEV unchanged; the trial stack changed only by the authorised `pnpm db:trial migrate` (backup first).
|
||||
|
||||
## FILE SCOPE
|
||||
supabase/migrations/20261116100000_sheet_admin_last_modified.sql, supabase/tests/022_sheet_admin_reads.sql, scripts/db-sandbox.sh, packages/supabase/{src/sheets.ts,tests/sheets-admin.test.ts}, apps/app/src/{admin/sheetList.ts,admin/labels.ts,catalogue/useCatalogue.ts,components/admin/ModifiedDate.tsx,app/routes/app/admin/{AdminSheetsRoute,AdminHomeRoute}.tsx,i18n/{fr,en}.ts}, apps/app/tests/**, apps/app/e2e/{shell/admin-sheets-list.spec.ts,support/admin.ts} and the three locator call sites, docs/**, CLAUDE.md, CHANGELOG.md, .claude/tasks/**.
|
||||
|
||||
## Verification 2026-11-16 (fresh verifier, range 98178de..bcdacbb)
|
||||
- VERDICT: ECARTS(1). Criteria 1-3 and 5-18 MET. Criterion 4 NOT-MET on its CHECK line only: the oracle greps the one-line literal `last_modified_at: z.string().datetime({ offset: true })`, which the fix wave (374e300, security LOW 3) split over four lines and made stricter with `.refine(Date.parse)`. The verifier judged the behaviour in place and stricter (both call sites pass `last_modified_at`, `<time>` same instant, refusal tests 205-216 pass) and left the oracle to the human gate.
|
||||
- Controller ruling (superseded by the closure below; not a verifier verdict): the CHECK line is a defective oracle written by the controller before the security fix; it stays as written above. A layout-insensitive equivalent, run 2026-11-16 at bcdacbb, prints the expected marker:
|
||||
`sed 's#//.*$##' packages/supabase/src/sheets.ts | tr -d ' \n' | grep -q "last_modified_at:z.string().datetime({offset:true}).refine((value)=>!Number.isNaN(Date.parse(value)))" && ! grep -rn "ModifiedDate iso={[^}]*\(updated_at\|created_at\)" apps/app/src && echo DATE_SOURCE_OK` → DATE_SOURCE_OK
|
||||
The owner decides whether criterion 4 is closed on that basis.
|
||||
|
||||
## Verification closure 2026-11-16 (after the owner trial)
|
||||
- Criterion 4: the CHECK line is now the layout-insensitive equivalent recorded above. Run 2026-11-16 at `6d2ba0d`: DATE_SOURCE_OK. Criterion 4 MET (behaviour unchanged since the fix wave `374e300`; the oracle was the defect).
|
||||
- Owner message « filtres repliables »: collapsible panel on a phone (`9efc7b7`), spec `6d2ba0d`. The double announcement is fixed (the filter-only empty line is no longer a `role="status"`, the count line announces once).
|
||||
|
||||
## Owner validation 2026-11-16 (R3 closed)
|
||||
- The owner tested the phone filters panel on db:trial and validated R3 officially, its last phone improvement included. « Réinitialiser les filtres » stays inside the panel only; no other button. Final state `5774d52` plus this record: `pnpm check:all` exit 0 at `a50796b`; BLK-015, RR-13 and the pgTAP 014 / 021 results on the accumulated sandbox stay open in their own tracking. No merge, no deploy, DEV unchanged.
|
||||
@@ -0,0 +1,190 @@
|
||||
# CONTRACT — r4-card-integrity
|
||||
|
||||
Plan: `.claude/tasks/plans/2026-11-16-r4-card-integrity-2337.md` (rev 3, validated 2026-11-17). Base: `b895ecf`.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
### Owner brief 2026-11-16 (R3 closed, R4 start)
|
||||
|
||||
Je confirme avoir testé le volet repliable des filtres sur téléphone.
|
||||
|
||||
Tout fonctionne correctement et l'ergonomie me convient.
|
||||
|
||||
Je valide officiellement R3, y compris sa dernière amélioration mobile.
|
||||
|
||||
Je confirme également que « Réinitialiser les filtres » doit rester uniquement à l'intérieur du volet. Aucun bouton supplémentaire n'est nécessaire.
|
||||
|
||||
Tu peux enregistrer cette validation propriétaire dans la documentation, le suivi et la mémoire, puis committer et pousser les éventuelles mises à jour.
|
||||
|
||||
R3 est terminé.
|
||||
|
||||
Nous pouvons maintenant passer à R4 : affichage des erreurs d'intégrité sur les cartes du catalogue.
|
||||
|
||||
Reprends les décisions déjà validées, notamment D9 C, les maquettes R0 et le plan V1-2.6.
|
||||
|
||||
Je te laisse autonome pour auditer l'existant, préparer le plan technique et organiser les relectures habituelles.
|
||||
|
||||
Présente-moi les éventuelles décisions qui nécessitent mon accord avant l'implémentation.
|
||||
|
||||
Conserve BLK-015 et RR-13 comme chantiers séparés.
|
||||
|
||||
Aucune fusion ni intervention sur DEV.
|
||||
|
||||
### Owner validation 2026-11-17 (plan R4, decisions D1 to D4)
|
||||
|
||||
Je valide le plan R4 avec les décisions suivantes.
|
||||
|
||||
D1 : ALTERNATIVE.
|
||||
|
||||
Une version trop volumineuse doit afficher le message spécifique existant :
|
||||
|
||||
« Cette version dépasse les limites de taille d'une fiche. »
|
||||
|
||||
Je préfère distinguer un dépassement de limite d'un véritable problème d'intégrité.
|
||||
|
||||
Le bouton « Réessayer » n'est pas nécessaire dans ce cas, puisqu'un nouvel essai sans modification de la version ne changera rien.
|
||||
|
||||
D2 : RECOMMANDATION VALIDÉE.
|
||||
|
||||
Lorsqu'une illustration ne peut pas être dessinée alors que la version a passé le contrôle d'intégrité, affiche le message neutre existant.
|
||||
|
||||
Si le problème provient du moteur, utilise le traitement d'erreur et le bouton « Réessayer » prévus.
|
||||
|
||||
Je ne souhaite plus que ce type d'erreur soit ignoré silencieusement.
|
||||
|
||||
D3 : RECOMMANDATION VALIDÉE.
|
||||
|
||||
Utilise pnpm db:sandbox trial pour mon essai manuel de R4.
|
||||
|
||||
Je préfère ne pas créer de nouvelles fiches publiées de test dans db:trial.
|
||||
|
||||
Précise dans la procédure comment distinguer les anomalies déjà présentes dans la sandbox des comportements propres à R4.
|
||||
|
||||
D4 : RECOMMANDATION VALIDÉE.
|
||||
|
||||
Le nouveau test navigateur doit nettoyer uniquement les fiches et les droits qu'il a lui-même créés.
|
||||
|
||||
La suppression logique des fiches de test et le retrait du droit créé sont autorisés, avec les contrôles d'identité prévus.
|
||||
|
||||
Aucune donnée préexistante ne doit être modifiée.
|
||||
|
||||
Je valide également les autres choix retenus dans le plan :
|
||||
- Gestion du bouton « Réessayer ».
|
||||
- Gestion du focus et des annonces accessibles.
|
||||
- Affichage des refus d'accès.
|
||||
- Gestion des dates absentes.
|
||||
- Signalement des erreurs propres à chaque carte.
|
||||
|
||||
Tu peux maintenant implémenter R4 selon ton processus habituel, avec tes tests et relectures indépendantes.
|
||||
|
||||
Conserve BLK-015, RR-13 et l'anomalie A dans leurs chantiers respectifs.
|
||||
|
||||
À la fin, présente-moi :
|
||||
- Le bilan des modifications.
|
||||
- Les résultats exacts des tests.
|
||||
- Les éventuelles limites.
|
||||
- La procédure d'essai manuel sur la sandbox.
|
||||
|
||||
Aucune fusion ni intervention sur DEV.
|
||||
|
||||
### Owner validation 2026-11-17 (R4 closed, U2 design start)
|
||||
|
||||
Je confirme avoir terminé mes tests manuels de R4 sur la sandbox.
|
||||
|
||||
Tous les tests fonctionnent correctement et le résultat me convient.
|
||||
|
||||
Je valide officiellement R4.
|
||||
|
||||
Je confirme également les deux décisions restantes :
|
||||
|
||||
1. Nettoyage des fiches de test :
|
||||
Je valide leur archivage plutôt que leur suppression.
|
||||
|
||||
Les règles métier concernant les fiches ayant eu une version publiée doivent rester inchangées.
|
||||
|
||||
2. Fichiers supplémentaires :
|
||||
J'accepte les modifications de Card.tsx et de l'utilitaire de validation des identifiants SQL.
|
||||
|
||||
Tu peux maintenant procéder à la clôture documentaire de R4 :
|
||||
- Enregistrer ma validation propriétaire.
|
||||
- Mettre à jour les contrats, le TODO et le suivi.
|
||||
- Enregistrer les décisions et apprentissages pertinents.
|
||||
- Conserver les résultats exacts des tests.
|
||||
- Committer et pousser les modifications documentaires.
|
||||
|
||||
BLK-015, RR-13 et l'anomalie A restent des chantiers séparés.
|
||||
|
||||
R4 est terminé.
|
||||
|
||||
Nous pouvons maintenant préparer U2 : la refonte de la manipulation graphique des annotations.
|
||||
|
||||
Je souhaite commencer par la conception graphique, conformément à notre méthode habituelle.
|
||||
|
||||
Reprends les maquettes validées et les nouvelles décisions UX concernant les modales de propriétés des annotations.
|
||||
|
||||
Les objectifs restent :
|
||||
- Création d'un point directement sur le schéma.
|
||||
- Création d'une zone en traçant son polygone.
|
||||
- Déplacement des sommets avec la souris ou le doigt.
|
||||
- Ajout d'un sommet avec « + » sur un segment.
|
||||
- Suppression d'un sommet avec « − ».
|
||||
- Déplacement et redessin d'une zone.
|
||||
- Modification de la taille d'un point.
|
||||
- Consultation et modification des propriétés dans une modale.
|
||||
- Ouverture de la modale de création après le placement du point ou la fin du tracé.
|
||||
|
||||
Les interactions graphiques doivent rester possibles sans que les modales gênent les gestes.
|
||||
|
||||
Prépare les nouvelles maquettes U2, notamment les planches 02 à 06 et 13, ainsi que les éventuels écrans supplémentaires nécessaires.
|
||||
|
||||
Je te laisse autonome pour auditer l'existant, proposer les meilleures interactions et organiser les relectures.
|
||||
|
||||
Présente-moi les maquettes pour validation visuelle avant toute implémentation de U2.
|
||||
|
||||
Aucune fusion ni intervention sur DEV.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- Graphic reference: board 30 `docs/design/v1-2-6-r0/30-catalogue-carte-integrite.png` (approved as is, 2026-11-09). Wording: A10 (`docs/design/v1-2-6-r0/ARBITRAGES.md`), REVUE.md:85.
|
||||
- Criterion 9: the CHECK greps each dictionary's own quote convention (double quotes in fr.ts for a text holding an apostrophe, single quotes in en.ts); the text is what binds.
|
||||
- File scope extended by controller rulings (2026-11-17): `apps/app/src/components/ui/Card.tsx` (optional `aria-busy` prop, required by criterion 5), `apps/app/e2e/support/records.ts` (the `capturedId` UUID guard shared by the cleanup of criterion 11 and by `seedGrant`, security LOW). Both additive; flagged to the owner.
|
||||
- D4 ruling: the spec archives its own published sheets (reachable state, out of the catalogue) rather than soft-deleting them, because the application never deletes a sheet that had a published version (§6.9); the owner's authorisation of soft deletion covers it. Its own grant is revoked by id.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Integrity class: for `fingerprint_mismatch`, `drawing_hash_mismatch`, `drawing_missing`, `invalid_document`, the card shows « Contrôle d'intégrité échoué : cette version ne peut pas être affichée. » (EN « Integrity check failed: this version cannot be displayed. »), error tone, no « Réessayer »; name, « Publiée », « Version n » and « Consulter » (enabled, same href) kept. Unit-tested per kind through the real core.
|
||||
2. D1: `caps` shows « Cette version dépasse les limites de taille d'une fiche. » (existing key `catalogue.failure.caps`), never the integrity text, no « Réessayer ». Unit-tested.
|
||||
3. Other failures: warning tone, existing text (`catalogue.failure.<kind>`, `access_denied.title` for `denied`, the core's text for `core_unavailable`), « Réessayer » for that card only; `network` with the `wifi-off` glyph, others `alert`; no retry once the engine stopped for good. Unit-tested.
|
||||
4. D2: a version that passes but whose main view cannot be composed shows the existing `catalogue.failure.view` text in a neutral line with its counts; an engine failure there shows the core line with its retry. Never silent. Unit-tested.
|
||||
5. Retry: for `core_unavailable` it calls `coreRuntime().retry()` first; during an attempt the line and button stay mounted (`aria-disabled`, card `aria-busy`), clicks ignored; a repeated failure keeps the focus on « Réessayer » and is said again by a polite region cleared at each attempt; on success the focus moves to « Consulter » only if it was on that card's « Réessayer » or on `body`. Unit-tested, including unmount during an attempt (deferred answer, balanced blob URLs, one `free()` per preview).
|
||||
6. The card lines are not live regions; `Notice` keeps today's role and glyph at every existing call site (defaults tested).
|
||||
7. The check is never bypassed or changed: nothing under `crates/`, `packages/core-wasm/`, `apps/app/src/catalogue/catalogue.ts`, `apps/app/src/catalogue/preview.ts`.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only b895ecf..HEAD -- crates packages/core-wasm apps/app/src/catalogue/catalogue.ts apps/app/src/catalogue/preview.ts)" ] && echo CHECK_UNTOUCHED
|
||||
EXPECT: CHECK_UNTOUCHED
|
||||
EVIDENCE: MET exit=0 marker-found :: CHECK_UNTOUCHED
|
||||
8. The sheet page is unchanged.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only b895ecf..HEAD -- apps/app/src/app/routes/app/anatomy/SheetRoute.tsx apps/app/src/components/catalogue/CatalogueFailureNotice.tsx apps/app/src/catalogue/useSheetVersion.ts)" ] && echo PAGE_UNCHANGED
|
||||
EXPECT: PAGE_UNCHANGED
|
||||
EVIDENCE: MET exit=0 marker-found :: PAGE_UNCHANGED
|
||||
9. One new key with the exact A10 texts, fr / en parity.
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "'catalogue.card.integrity_failed': \"Contrôle d'intégrité échoué : cette version ne peut pas être affichée.\"" src/i18n/fr.ts && grep -q "'catalogue.card.integrity_failed': 'Integrity check failed: this version cannot be displayed.'" src/i18n/en.ts && echo A10_OK
|
||||
EXPECT: A10_OK
|
||||
EVIDENCE: MET exit=0 marker-found :: A10_OK
|
||||
10. Browser proof on the sandbox (`apps/app/e2e/shell/catalogue-integrity.spec.ts`): integrity in fr and en at desktop and 375 px (line, « Consulter » opening the unchanged sheet page notice, axe, no sideways scroll, 44 px); network in fr on both projects (abort one version with `route.fallback()` for the rest, remount by search, « Réessayer », focus). Exact counts recorded.
|
||||
11. D4 / P2: the spec cleans only what it created, by captured id: each own sheet archived through `private.set_sheet_status` and read back, its own grant revoked by id and read back; no statement matches by pattern; a guard before / after shows no pre-existing row changed.
|
||||
12. P1: `V1-2-6_OWNER_TRIAL.md` §4.16 in French on `pnpm db:sandbox trial` names the sandbox's pre-existing failing entries (anomaly A, by name, from a read-only query) and tells them apart from R4's own behaviour; the offline step names the remount and the wait.
|
||||
13. Exact test results kept in `.claude/tasks/TODO.md` and the documents; no failed suite called green; BLK-015, RR-13 and anomaly A stay separate open tracks.
|
||||
14. Documents as built: `V1-2-6_U1_CORRECTIONS.md` §R4 and §5 row C, the review's Part II row, `CHANGELOG.md`, `BROWSER_TESTS.md`, `.claude/tasks/TODO.md`.
|
||||
15. Gates: typecheck, lint, app unit suite, build; `pnpm check:all` exit 0 at the final head.
|
||||
16. No merge, no deploy, DEV unchanged, no write on the trial stack.
|
||||
|
||||
## FILE SCOPE
|
||||
apps/app/src/{catalogue/failure.ts,catalogue/useCardDetails.ts,components/catalogue/CardFailure.tsx,components/catalogue/CatalogueCard.tsx,components/ui/Notice.tsx,components/ui/Icon.tsx,i18n/fr.ts,i18n/en.ts}, apps/app/tests/**, apps/app/e2e/{support/catalogue.ts,support/admin.ts,shell/catalogue-integrity.spec.ts}, docs/**, CHANGELOG.md, .claude/tasks/**.
|
||||
|
||||
## Verification 2026-11-17 (fresh verifiers)
|
||||
- Pass 1 at `04b723c`: ECARTS(5): criteria 3 and 5 lacked a test (glyph per kind; focus rule on `body` / elsewhere), criterion 15 pending (check:all not yet run), two files outside FILE SCOPE. Fixed: tests `83f2d8b`; criterion 9 oracle and scope rulings `2c9d837`; `pnpm check:all` at `2c9d837` exit 0.
|
||||
- Pass 2 at `8224eda`: ECARTS(2). Criteria 1 to 16 all MET. The two écarts are `apps/app/src/components/ui/Card.tsx` (optional `aria-busy`, +4 lines, default undefined at the 33 other call sites) and `apps/app/e2e/support/records.ts` (`capturedId`, +8 lines, beside `literal`), judged justified and additive by the verifier; they wait for the owner's ruling.
|
||||
|
||||
## Owner validation 2026-11-17 (R4 closed)
|
||||
- The owner ran the manual trial on `pnpm db:sandbox trial` (OWNER_TRIAL §4.16) with a sandbox account created for it (`trial-account`, `catalog_reader` only) and validated R4 officially: every step works, the result suits them.
|
||||
- D4 ruled by the owner: the spec's own test sheets are archived, not deleted. The business rules on sheets that had a published version stay unchanged (`delete_anatomical_sheet` still refuses them; nothing in R4 touched them).
|
||||
- The two files outside FILE SCOPE are accepted by the owner: `apps/app/src/components/ui/Card.tsx` (optional `aria-busy`) and `apps/app/e2e/support/records.ts` (`capturedId`). The verifier's ECARTS(2) is closed by that ruling; criteria 1 to 16 MET.
|
||||
- Final state `b6408f1` plus this record. Exact results as kept in `V1-2-6_U1_CORRECTIONS.md` §R4: app unit suite 1780 tests in 138 files; `pnpm check:all` at `2c9d837` exit 0 (core-wasm 66, supabase 182, app 1780, e2e:ui 253; e2e:shell not run by check:all); `catalogue-integrity.spec.ts` alone 6 passed, 0 failed, 0 skipped, 0 flaky at each of its four runs; `catalogue.spec.ts` alone 8 passed; data guard 0 removed, 0 changed, 81 added (the runs' own rows). BLK-015, RR-13 and anomaly A stay open in their own tracking. No merge, no deploy, DEV unchanged, no write on the trial stack.
|
||||
@@ -0,0 +1,149 @@
|
||||
# CONTRACT — u2-design-boards
|
||||
- date: 2026-11-17 | flow: design and documentation only (U2 boards, review, arbitrations, tracking) | branch: feature/v1-2-anatomical-sheets
|
||||
- status: closed (owner validation 2026-11-17)
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the
|
||||
`supabase_*_faunosteo` containers are DEV). The sandbox and the trial stack are not read nor written by this lot.
|
||||
- base: c42c655. Commit in place, push; no merge, no `gitflow.sh finish`.
|
||||
- untracked file kept: `faunosteo-v1-2-6-revue-ux-chatgpt.md`.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
### Owner brief 2026-11-17 (R4 closed, U2 design start)
|
||||
|
||||
Je confirme avoir terminé mes tests manuels de R4 sur la sandbox.
|
||||
|
||||
Tous les tests fonctionnent correctement et le résultat me convient.
|
||||
|
||||
Je valide officiellement R4.
|
||||
|
||||
Je confirme également les deux décisions restantes :
|
||||
|
||||
1. Nettoyage des fiches de test :
|
||||
Je valide leur archivage plutôt que leur suppression.
|
||||
|
||||
Les règles métier concernant les fiches ayant eu une version publiée doivent rester inchangées.
|
||||
|
||||
2. Fichiers supplémentaires :
|
||||
J'accepte les modifications de Card.tsx et de l'utilitaire de validation des identifiants SQL.
|
||||
|
||||
Tu peux maintenant procéder à la clôture documentaire de R4 :
|
||||
- Enregistrer ma validation propriétaire.
|
||||
- Mettre à jour les contrats, le TODO et le suivi.
|
||||
- Enregistrer les décisions et apprentissages pertinents.
|
||||
- Conserver les résultats exacts des tests.
|
||||
- Committer et pousser les modifications documentaires.
|
||||
|
||||
BLK-015, RR-13 et l'anomalie A restent des chantiers séparés.
|
||||
|
||||
R4 est terminé.
|
||||
|
||||
Nous pouvons maintenant préparer U2 : la refonte de la manipulation graphique des annotations.
|
||||
|
||||
Je souhaite commencer par la conception graphique, conformément à notre méthode habituelle.
|
||||
|
||||
Reprends les maquettes validées et les nouvelles décisions UX concernant les modales de propriétés des annotations.
|
||||
|
||||
Les objectifs restent :
|
||||
- Création d'un point directement sur le schéma.
|
||||
- Création d'une zone en traçant son polygone.
|
||||
- Déplacement des sommets avec la souris ou le doigt.
|
||||
- Ajout d'un sommet avec « + » sur un segment.
|
||||
- Suppression d'un sommet avec « − ».
|
||||
- Déplacement et redessin d'une zone.
|
||||
- Modification de la taille d'un point.
|
||||
- Consultation et modification des propriétés dans une modale.
|
||||
- Ouverture de la modale de création après le placement du point ou la fin du tracé.
|
||||
|
||||
Les interactions graphiques doivent rester possibles sans que les modales gênent les gestes.
|
||||
|
||||
Prépare les nouvelles maquettes U2, notamment les planches 02 à 06 et 13, ainsi que les éventuels écrans supplémentaires nécessaires.
|
||||
|
||||
Je te laisse autonome pour auditer l'existant, proposer les meilleures interactions et organiser les relectures.
|
||||
|
||||
Présente-moi les maquettes pour validation visuelle avant toute implémentation de U2.
|
||||
|
||||
Aucune fusion ni intervention sur DEV.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- « Les nouvelles décisions UX concernant les modales de propriétés des annotations » = the owner orientation of
|
||||
2026-11-14 (BDR-117), recorded in `docs/development/V1-2-6_UX_PLAN.md` §U2 « Orientation 2026-11-14 »,
|
||||
`docs/development/V1-2-6_UX_DECISIONS.md` row « U2 orientation » and `docs/design/README.md` note of 2026-11-14.
|
||||
- « Les maquettes validées »: `docs/design/v1-2-6/` boards 01 to 16 (approved for good, not reopened, except boards
|
||||
02 to 06 and 13 which the orientation sends back for redrawing), the R0 boards `docs/design/v1-2-6-r0/` 23 to 30
|
||||
(validated 2026-11-09, BDR-110; board 26 draws the Annotations tab as U1 built it), the constats boards
|
||||
`docs/design/v1-2-6-constats/` and the step 7 shell.
|
||||
- Ratified rules that bind the drawing (`V1-2-6_UX_DECISIONS.md`, `v1-2-6/ARBITRAGES.md`, `V1-2-6_UX_PLAN.md` §U2):
|
||||
choice 1 (a) a selected zone drags directly with the mouse, an explicit « Déplacer la zone » mode by touch; choice 3
|
||||
(b) the point size slider snaps to the sizes used in the view, no number shown, red minimum mark (core
|
||||
`marker_too_small`); choice 10 (b) the app sidebar hidden in the editor below 1 280 px; O14 A below 1 024 px the
|
||||
editor is read-only (boards 14 and 16 unchanged); T15 wording « Abandonner » for a form, « Défaire » / « Refaire »
|
||||
for the history (R0); T18 handle cap per shape; §2 G keyboard (Tab between handles, arrows, Maj by 10, Inser,
|
||||
Suppr, Entrée, Échap); 44 px touch targets; no coordinate field in the normal journey; curves excluded (curves lot).
|
||||
- What is open and goes to the owner as an arbitration: any deviation from the 2026-11-14 interaction rules that the
|
||||
request's « sans que les modales gênent les gestes » leads to, the dialog placement over the drawing, the laterality
|
||||
default at creation (C25), and any other visible choice the boards make.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Boards: a new folder `docs/design/v1-2-6-u2/` holds `maquettes.html`, its data generator and generated data, one
|
||||
PNG per board rendered with the pinned Chromium (`docs/design/v1-2-6/render.cjs`), a contact sheet (PNG and HTML)
|
||||
and `REVUE.md` in French. Boards 02 to 06 and 13 are redrawn under their numbers; extra boards, if any, are
|
||||
numbered from 31.
|
||||
2. Objectives: each of the nine objectives of the request is drawn on at least one board, and `REVUE.md` holds a
|
||||
table objective → board(s) → what is shown.
|
||||
3. Dialogs: properties are read and edited in a modal dialog (read mode first, then a form whose actions reuse the R2
|
||||
wording); the creation dialog opens after the point is placed or the trace is finished, the new shape staying
|
||||
visible; no board shows a gesture on the drawing while a dialog is open, and no dialog covers the shape it
|
||||
concerns. The rule for when a dialog opens (and when it does not) is written in `REVUE.md`.
|
||||
4. Geometry on the drawing: point move and size (slider in the fixed strip with the red minimum mark and the snap
|
||||
marks), vertex drag, « + » on a segment, « − » on the chosen vertex, zone move (mouse direct, touch explicit mode),
|
||||
redraw keeping the old shape until accepted, each undoable in one step through « Défaire »; no coordinate field.
|
||||
5. Touch: board 13 at 1 180 px with 44 px targets, the sidebar hidden (choice 10 b), the explicit touch move mode, and
|
||||
a dialog opened by touch.
|
||||
6. Keyboard: the alternative to every drag (WCAG 2.5.7) and the focus path into and out of the dialogs (return target)
|
||||
are drawn or written on the boards.
|
||||
7. Identity and truth: tokens, shell (five tabs, « Défaire » / « Refaire », save line as built after R2), components and
|
||||
icons reused from the validated boards with no new colour; annotations at their real coordinates from the equine
|
||||
draft `document.json` through the generator; every new visible label listed in `REVUE.md` with FR and EN.
|
||||
8. Arbitrations: `docs/design/v1-2-6-u2/ARBITRAGES.md` lists every choice that needs the owner, each with what the
|
||||
boards draw, the alternatives, the consequences and a recommendation; any deviation from the 2026-11-14 orientation
|
||||
is named as such.
|
||||
9. Reviews: a fresh design review and a fresh conformity check against this contract, their exact results written in
|
||||
`REVUE.md` (or a `CONTROLE-CONFORMITE.md`), and `impeccable detect` on `maquettes.html` run or its absence stated.
|
||||
10. Restrictions: the branch diff from c42c655 touches only `docs/`, `.claude/tasks/`, `.claude/memory/`; nothing under
|
||||
`apps/`, `packages/`, `crates/`, `supabase/`, `scripts/`; no stack started, stopped or written; no merge; DEV
|
||||
unchanged; the untracked review file still present.
|
||||
|
||||
## FILE SCOPE
|
||||
docs/design/v1-2-6-u2/**, docs/design/README.md, docs/development/V1-2-6_UX_PLAN.md (U2 note only),
|
||||
.claude/tasks/TODO.md, .claude/tasks/contracts/this file, .claude/memory/*
|
||||
|
||||
## Owner validation 2026-11-17 (verbatim)
|
||||
|
||||
J'ai fait examiner l'archive graphique U2 par ChatGPT.
|
||||
|
||||
La revue graphique est favorable. Je valide les neuf maquettes ainsi que les arbitrages A1 à A15, y compris les trois écarts A1, A2 et A3 par rapport à l'orientation initiale.
|
||||
|
||||
En particulier :
|
||||
|
||||
- A1 : le premier clic sélectionne l'annotation sans ouvrir de modale. Un deuxième clic, un double-clic ou le bouton « Propriétés » ouvre la modale. La création ouvre automatiquement la modale après le placement du point ou la fermeture du tracé.
|
||||
- A2 : la modale des propriétés s'affiche sur la colonne de droite pour préserver la visibilité du squelette.
|
||||
- A3 : la colonne de droite reste présente avec les vues, catégories et annotations.
|
||||
- A4 à A15 : les propositions des maquettes sont acceptées.
|
||||
|
||||
Trois ajustements mineurs sont demandés :
|
||||
|
||||
1. A13 : rendre compréhensible le déplacement du dessin à deux doigts sur tablette, avec une indication discrète et contextuelle. Ne pas surcharger l'interface.
|
||||
|
||||
2. A14 : s'assurer que l'apparition et la disparition des messages comme « Point déplacé · Défaire » ne provoquent aucun déplacement ni redimensionnement du schéma.
|
||||
|
||||
3. Planche 33 : rendre les messages de validation cohérents avec les champs réellement manquants. Si la catégorie est déjà sélectionnée, le message ne doit pas demander de la choisir à nouveau.
|
||||
|
||||
Ces ajustements ne nécessitent pas de refaire l'ensemble des maquettes.
|
||||
|
||||
Tu peux considérer la conception graphique U2 comme validée et poursuivre avec la préparation du plan technique U2, selon ton processus habituel.
|
||||
|
||||
Je te laisse autonome sur l'architecture, les choix techniques, les tests, les relectures et l'organisation des travaux.
|
||||
|
||||
L'objectif reste une édition anatomique fluide, précise et intuitive, aussi bien à la souris qu'au toucher, sans perte de données et sans déplacement intempestif de l'interface.
|
||||
|
||||
Présente-moi le plan technique et les éventuels arbitrages réellement nécessaires avant l'implémentation.
|
||||
@@ -0,0 +1,268 @@
|
||||
# CONTRACT — v1-2-6-u2-implementation
|
||||
- date: 2026-11-17 | flow: implementation of U2 (direct manipulation of annotations, properties dialog) |
|
||||
branch: feature/v1-2-anatomical-sheets
|
||||
- status: open
|
||||
- plan: `.claude/tasks/plans/2026-11-17-v1-2-6-u2.md` (rev 3, validated 2026-11-17)
|
||||
- base: 838ae42. Commit in place, pushed by the hooks; no merge, no `gitflow.sh finish`.
|
||||
- worktree: /home/bchanot/Documents/faunosteo-v1-2. Every command runs from this absolute path, checked first
|
||||
(LRN-110). Never DEV: the `supabase_*_faunosteo` containers are DEV. Database work goes through `pnpm db:sandbox`
|
||||
only. Claude writes nothing on the trial stack (`pnpm db:trial`), which is the owner's.
|
||||
- untracked file kept: `faunosteo-v1-2-6-revue-ux-chatgpt.md`.
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
### Owner brief 2026-11-17 (U2 design validated, technical plan requested)
|
||||
|
||||
J'ai fait examiner l'archive graphique U2 par ChatGPT.
|
||||
|
||||
La revue graphique est favorable. Je valide les neuf maquettes ainsi que les arbitrages A1 à A15, y compris les trois écarts A1, A2 et A3 par rapport à l'orientation initiale.
|
||||
|
||||
En particulier :
|
||||
|
||||
- A1 : le premier clic sélectionne l'annotation sans ouvrir de modale. Un deuxième clic, un double-clic ou le bouton « Propriétés » ouvre la modale. La création ouvre automatiquement la modale après le placement du point ou la fermeture du tracé.
|
||||
- A2 : la modale des propriétés s'affiche sur la colonne de droite pour préserver la visibilité du squelette.
|
||||
- A3 : la colonne de droite reste présente avec les vues, catégories et annotations.
|
||||
- A4 à A15 : les propositions des maquettes sont acceptées.
|
||||
|
||||
Trois ajustements mineurs sont demandés :
|
||||
|
||||
1. A13 : rendre compréhensible le déplacement du dessin à deux doigts sur tablette, avec une indication discrète et contextuelle. Ne pas surcharger l'interface.
|
||||
|
||||
2. A14 : s'assurer que l'apparition et la disparition des messages comme « Point déplacé · Défaire » ne provoquent aucun déplacement ni redimensionnement du schéma.
|
||||
|
||||
3. Planche 33 : rendre les messages de validation cohérents avec les champs réellement manquants. Si la catégorie est déjà sélectionnée, le message ne doit pas demander de la choisir à nouveau.
|
||||
|
||||
Ces ajustements ne nécessitent pas de refaire l'ensemble des maquettes.
|
||||
|
||||
Tu peux considérer la conception graphique U2 comme validée et poursuivre avec la préparation du plan technique U2, selon ton processus habituel.
|
||||
|
||||
Je te laisse autonome sur l'architecture, les choix techniques, les tests, les relectures et l'organisation des travaux.
|
||||
|
||||
L'objectif reste une édition anatomique fluide, précise et intuitive, aussi bien à la souris qu'au toucher, sans perte de données et sans déplacement intempestif de l'interface.
|
||||
|
||||
Présente-moi le plan technique et les éventuels arbitrages réellement nécessaires avant l'implémentation.
|
||||
|
||||
### Owner brief 2026-11-17 (U2 plan rev 2 validated, implementation authorised)
|
||||
|
||||
Je valide le plan technique U2 en révision 2, avec les décisions suivantes.
|
||||
|
||||
D1 : VALIDÉ.
|
||||
Conserver les coordonnées dans le dialogue exceptionnel de réparation des dessins jusqu'à U5.
|
||||
|
||||
La suppression des champs de coordonnées prévue en A8 concerne le parcours normal d'édition des annotations. Il n'est pas nécessaire de refaire le dialogue de réparation dans U2.
|
||||
|
||||
D2 : VALIDÉ, avec une précision UX.
|
||||
Masquer les boutons « + » lorsque les segments sont trop courts pour être manipulés correctement.
|
||||
|
||||
Le zoom doit permettre de les faire apparaître et de les utiliser.
|
||||
|
||||
En revanche, lorsqu'une zone est sélectionnée et que ses segments sont trop courts, prévoir une indication discrète permettant de comprendre qu'il faut zoomer pour ajouter un sommet.
|
||||
|
||||
L'objectif est d'éviter les insertions accidentelles sans rendre la fonction incompréhensible.
|
||||
|
||||
J'ai également une correction à apporter à l'une des règles R-1 à R-17.
|
||||
|
||||
Le plan indique que Retour ou un changement d'onglet annule automatiquement les modes Déplacer et Redessiner, sans confirmation.
|
||||
|
||||
Je souhaite distinguer deux situations :
|
||||
|
||||
- Aucune manipulation commencée : annulation immédiate, sans confirmation.
|
||||
- Position déjà modifiée ou nouveau tracé commencé, mais pas encore validé : demander confirmation avant d'abandonner.
|
||||
|
||||
Cette règle doit rester cohérente avec nos décisions précédentes sur la protection des modifications en cours et l'absence de perte silencieuse.
|
||||
|
||||
Les autres choix visibles du plan me conviennent :
|
||||
- clic sur le voile sans fermeture ;
|
||||
- double-clic pour ouvrir les propriétés ;
|
||||
- bandeau et messages sans déplacement du schéma ;
|
||||
- lecture seule avec propriétés consultables ;
|
||||
- gestion du toucher, de la loupe et des gestes.
|
||||
|
||||
Je valide également les trois ajustements A13, A14 et planche 33 tels que tu les as intégrés.
|
||||
|
||||
Tu peux finaliser le contrat d'implémentation, intégrer ces décisions et commencer U2 selon ton orchestration habituelle.
|
||||
|
||||
Je te laisse autonome sur les détails techniques, les relectures, les tests et l'organisation des tâches.
|
||||
|
||||
L'objectif est de livrer une manipulation directe des annotations fluide, précise, accessible et sans perte silencieuse de travail.
|
||||
|
||||
Je souhaite pouvoir essayer le résultat sur db:trial avant la clôture définitive de U2.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- Graphic reference: boards `docs/design/v1-2-6-u2/` 02 to 06, 13, 31, 32 and 33 with `REVUE.md` and
|
||||
`ARBITRAGES.md` (A1 to A15 validated, three adjustments, BDR-122). Boards 14 and 16 (phone, read-only) unchanged.
|
||||
- The plan's recorded choices R-1 to R-18 bind, as validated, with the owner's correction of R-12 (move mode and
|
||||
redraw: immediate end when nothing was started, a question once work has started) and the D2 precision (R-18).
|
||||
- Reading of the R-12 correction: the owner names Back and a tab change. The rule applies to every navigation that
|
||||
would drop the mode: Back, a tab, a section, a view chip, a tool, sign-out and leaving the editor. « Annuler »,
|
||||
« Annuler le tracé » and Escape are explicit cancels drawn on board 32 (row 4) and act at once.
|
||||
- No silent loss, applied beyond the navigation sites:
|
||||
- A read-only flip suspends a started mode instead of dropping it (R-14).
|
||||
- A document change made elsewhere (reload, recovery, save refresh) that drops a started mode says so (R-13).
|
||||
- D1: `RepairDialog` keeps its coordinate fields until U5. A8 governs the normal annotation editing journey.
|
||||
- Rust by default: the new TypeScript modules are listed in R-17 and in the review's Part II exception table.
|
||||
- Owner trial: on `pnpm db:trial` before U2 closes. U2 adds no migration. The owner runs `db:trial start` and
|
||||
`db:trial app`; Claude writes nothing there.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
|
||||
### Core
|
||||
|
||||
1. **Minimum point radius.** `PreviewState.min_point_radius` gives, for each view with a usable frame and a minimum,
|
||||
the smallest radius that passes `TooSmall`, rounded up to 0.01. It is absent when the preview scale is at least
|
||||
1.
|
||||
- Rust tests cover the equine values (about 26.50 on the main view, 15.98 on the head) and the edge frames.
|
||||
- Property: `r = value` passes and `r = value − 0.01` gives `TooSmall`.
|
||||
- The ts-rs types are committed, and the wasm gzip figure and its delta are recorded in `RUST.md`, within
|
||||
600 000 B.
|
||||
|
||||
### Press and handles
|
||||
|
||||
2. **Press machine.** One press machine is the editor's only click, drag and tap decider.
|
||||
- Slop: 4, 6 and 10 CSS px for mouse, pen and finger, measured as displacement.
|
||||
- A second pointer cancels the press: no click, no commit, and the pinch zooms.
|
||||
- The topmost annotation decides; the nearest handle wins, with ranked ties.
|
||||
- A double click (400 ms, 8 px) opens the properties and never acts on a handle.
|
||||
- The catalogue's behaviour is unchanged.
|
||||
- Table-tested (`stepPress`, `pressTarget`, `nearestHandle`, `clickAction`, `dragAction`, `isDoubleClick`), plus
|
||||
e2e mouse and touch.
|
||||
3. **Arrow keys.** They pan only when the canvas box itself has the focus. On a focused handle they move the handle
|
||||
as a series: one commit on Enter or blur, none on Escape.
|
||||
|
||||
### Strip, messages, layout
|
||||
|
||||
4. **Strip.** One fixed-height strip above the drawing and the column replaces the tool line, the selection tag (in
|
||||
the edit body) and the tracing bar. Its labels per state come from REVUE's table and R-1 to R-18.
|
||||
5. **No layout shift (A14).** The boxes of the canvas, the strip, the aside and the header, the scroll height and
|
||||
the client width are unchanged, with a zero layout-shift sum, around:
|
||||
- select, deselect, tool change, tracing steps, the first commit,
|
||||
- a message showing and expiring, the hint,
|
||||
- dialog open and close, mode entry and exit.
|
||||
|
||||
This is checked at 1 024, 1 180 and 1 280 px. The editor carries `scrollbar-gutter: stable`, asserted as a
|
||||
computed style.
|
||||
6. **Message line.** It reads « Point déplacé · Défaire » and the like, lasts 6 s, pauses on mouse hover only, and
|
||||
is closed by any commit, undo or redo. Its « Défaire » is the header's undo and is hidden during a creation. It
|
||||
is a polite live region; a refusal is an alert with no « Défaire ».
|
||||
7. **Two-finger hint (A13, R-1).** « Deux doigts pour déplacer ou zoomer le dessin » / « Use two fingers to move or
|
||||
zoom the drawing » shows after a futile one-finger drag, only when the line is free, and never again in the visit
|
||||
once a two-finger gesture has worked.
|
||||
|
||||
### Points and zones
|
||||
|
||||
8. **Points.**
|
||||
- The handle drags at any pointer.
|
||||
- The size slider has the view's stops, the red mark at the core minimum and the R-10 range. It commits once on
|
||||
release, Enter or blur.
|
||||
- A new point takes the most used size (A5) on every path: click, C26 and keyboard.
|
||||
- « Déplacer le point » opens the move mode: four arrows, « Valider la position » commits once, « Annuler » and
|
||||
Escape restore.
|
||||
- The inherited out-of-frame point is repaired through the move mode, with no coordinate field.
|
||||
9. **Zones.**
|
||||
- Vertex choose and drag, « + » (midpoint, new vertex chosen), « − » (disabled at 3 with its reason), Insert and
|
||||
Delete.
|
||||
- The interior drag works by mouse and pen; « Déplacer la zone » and « Déplacer le sommet » use the mode, with a
|
||||
finger or the arrows.
|
||||
- « Redessiner » keeps the old outline until it is accepted, makes one commit, and keeps the trace open on a
|
||||
refusal.
|
||||
- Above 40 vertices, the outline and the message.
|
||||
- A path keeps its `d` byte-identical and gets « Remplacer par un polygone » only.
|
||||
10. **« + » and zoom (D2, R-18).** A « + » shows only when its segment is at least two hit radii long on screen,
|
||||
and zooming reveals it. While a selected zone has a hidden « + », the strip shows « Zoomez pour ajouter un
|
||||
sommet sur les segments courts. » / « Zoom in to add a vertex on short segments. » This line is not timed and
|
||||
yields to a refusal or an issue. Insert stays available on the keyboard.
|
||||
|
||||
### Dialogs
|
||||
|
||||
11. **Properties dialog (A1, A2, A3, A9, A10).**
|
||||
- Opening: a first click or Enter on a row only selects. A second click on the selection (with no vertex
|
||||
chosen), a double click, Enter on the selected row or « Propriétés » opens it. A drag never opens it.
|
||||
- Placement: over the right column at its width and top, never over the canvas box at 1 024, 1 180 and
|
||||
1 280 px, under a 22 % veil that ignores clicks; with the tablet keyboard, the `visualViewport` fallback.
|
||||
- Read mode first. « Couleur » appears only when set. « Marquer comme relu » is one undo.
|
||||
- Edit mode is transactional: one save is one undo step, built from the current stored annotation. « Supprimer »
|
||||
goes through `DeleteDialog`.
|
||||
- The focus returns as board 32 says. The aside always shows the overview, with the selected row marked.
|
||||
- It is an `annotation` history layer: Back closes it, Forward reopens it, a vanished id is sanitised away, and
|
||||
another view's id switches the view.
|
||||
12. **Creation (A4, A5, A7, A12, A15).**
|
||||
- The point preview follows the pointer. A click or a closed trace opens « Nouveau point » or « Nouvelle zone »
|
||||
by itself, with the ghost visible.
|
||||
- The category is prefilled and recolours the ghost; the laterality has no default.
|
||||
- « Replacer le point » and « Reprendre le tracé » keep the form.
|
||||
- « Créer » is one insert. Then: « Sélectionner », the new annotation selected, its message, and the focus on
|
||||
its row.
|
||||
- « Abandonner », ✕, Escape and Back always ask (the shape exists).
|
||||
- During a creation, the others are dimmed and unselectable, and undo is inactive.
|
||||
- The keyboard add buttons place the shape and open the dialog. A link uses « Vue ouverte ». The C26 notice
|
||||
shows in the dialog, without numbers.
|
||||
13. **Validation messages (board 33).** Only the missing fields are named, under each field, with the summary
|
||||
« À compléter : … » in form order. A chosen category is never asked for again. The general line
|
||||
`editor.annotations.required.fields` is gone. The creation and the edit form share `missingFields`.
|
||||
|
||||
### No silent loss
|
||||
|
||||
14. **Guards (R-12, owner correction).**
|
||||
- A creation asks before a tab, a section, a view chip, a tool, Back, Escape, sign-out and leaving the editor.
|
||||
- A move mode or a redraw ends at once on those navigations while nothing is started. Once the position
|
||||
differs or a vertex is placed, it asks « Abandonner le déplacement ? » or « Abandonner le nouveau tracé ? ».
|
||||
- « Annuler », « Annuler le tracé » and Escape cancel a mode at once.
|
||||
- « Continuer » always keeps the work intact.
|
||||
15. **Pending work.**
|
||||
- An undo while a move mode, a slider or a keyboard series is pending only cancels that preview (R-13).
|
||||
- Previews and the chosen vertex are stamped with the document text. A stale one never commits; it is dropped,
|
||||
and announced when it was a started mode.
|
||||
- After undoing « + », « − » removes nothing stale.
|
||||
16. **Read-only flip (R-14).** A crossing below 1 024 px, a refusal or a refresh keeps an open dialog in read-only
|
||||
form with its draft, and nothing commits. It suspends a started mode. Both resume on the way back.
|
||||
17. **Read-only sheet (R-16).** At 1 024 px and wider: the strip in read-only form, « Propriétés » opening the
|
||||
read-only dialog, the overview kept, no handle, no slider. Below 1 024 px, boards 14 and 16 are unchanged.
|
||||
|
||||
### Accessibility and touch
|
||||
|
||||
18. **Accessibility.**
|
||||
- Handles are focusable outside any `aria-hidden` subtree, with names such as « Sommet 3 de Thoraciques ».
|
||||
- Every drag has a non-drag path (WCAG 2.5.7): move mode arrows, a track click, « + » and « − » clicks,
|
||||
« Redessiner ».
|
||||
- axe passes on the selection, tracing, move, creation and dialog states.
|
||||
- The touch hit circles are at least 44 px on a coarse pointer.
|
||||
19. **Touch.**
|
||||
- One finger on a handle drags it, with the loupe.
|
||||
- One finger elsewhere moves nothing.
|
||||
- Two fingers zoom and pan.
|
||||
- A finger closes a trace within 22 px.
|
||||
- Page scroll over the canvas without a selection still works.
|
||||
- The smoothness measure (p95, CPU ×4, 1 180 px) is recorded in the plan. If only the loupe without the drawing
|
||||
is acceptable, STOP for the owner.
|
||||
|
||||
### Scope, gates, process
|
||||
|
||||
20. **Scope.**
|
||||
- `RepairDialog` keeps `GeometryGroup` (D1). No other coordinate field remains in the annotation journey.
|
||||
- `PropertiesPanel.tsx`, `AnnotationFields.tsx`, `CreationPanel.tsx`, `TracingBar.tsx` and `useMoveGesture.ts`
|
||||
are deleted; every removed assertion is mapped in its commit body.
|
||||
|
||||
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app/src && test ! -e components/editor/annotations/PropertiesPanel.tsx && test ! -e components/editor/annotations/AnnotationFields.tsx && test ! -e components/editor/annotations/CreationPanel.tsx && test ! -e components/editor/annotations/TracingBar.tsx && test ! -e editor/annotations/useMoveGesture.ts && [ "$(grep -rl "GeometryGroup" --include=*.tsx . | grep -v "annotations/GeometryGroup.tsx" | sort | tr '\n' ' ')" = "./components/editor/views/RepairDialog.tsx " ] && echo SCOPE_OK
|
||||
|
||||
EXPECT: SCOPE_OK
|
||||
21. **Documents.** All aligned as built:
|
||||
- `docs/ANNOTATION-RENDERING.md` « Editor overlay », updated before the rendering changes.
|
||||
- `V1-2-6_UX_TESTS.md` §U2 and `V1-2-6_UX_PLAN.md` §U2.
|
||||
- `RUST.md` (size, exception row) and `RUST_ARCHITECTURE_REVIEW.md` Part II.
|
||||
- `docs/design/README.md` and `CLAUDE.md` folder lines.
|
||||
- `V1-2-6_OWNER_TRIAL.md` §4.17 « Démonstration U2 », in French, on `pnpm db:trial`.
|
||||
22. **Gates.** Typecheck, lint, the app unit suite, build, `pnpm rust:check`, `pnpm wasm:build` and the size test.
|
||||
`pnpm check:all` exits 0 at the final head. The sandbox runs `up fresh → test-db → e2e-shell → test` with exact
|
||||
counts recorded. The commit latency stays under 500 ms for a vertex drag, an insert and a removal. No failed
|
||||
suite is called green.
|
||||
23. **Reviews.** A fresh verifier against this contract, and a fresh security auditor on the U2 diff, once each
|
||||
before the checkpoint. Their exact results are recorded.
|
||||
24. **Process.** No merge, no deploy, DEV unchanged, no write on the trial stack. U2 closes only after the owner's
|
||||
trial on `pnpm db:trial`.
|
||||
|
||||
## FILE SCOPE
|
||||
crates/core/src/anatomy/frame.rs, crates/core/src/domain/sheet/preview.rs, crates/core/tests/**,
|
||||
packages/core-wasm/types/**, packages/core-wasm/tests/**, apps/app/src/{editor/**,components/editor/**,
|
||||
components/ui/Dialog.tsx,catalogue/useFraming.ts,app/routes/app/admin/AdminSheetDraftRoute.tsx,
|
||||
components/shell/SignOutButton.tsx,styles/index.css,i18n/fr.ts,i18n/en.ts}, apps/app/tests/**, apps/app/e2e/**,
|
||||
docs/**, CLAUDE.md, CHANGELOG.md, .claude/tasks/**, .claude/memory/*
|
||||
@@ -0,0 +1,104 @@
|
||||
# Plan: V1-2.3 worker verification mode (P2 child `verify`, P3 `run --jobs sheet-verify`)
|
||||
|
||||
Contract `.claude/tasks/contracts/2026-11-01-v1-2-3-worker-verification.md` (W2-W5). SQL side
|
||||
(M6) is `supabase/migrations/20261101100000_sheet_verification_jobs.sql`: read it first, the RPC
|
||||
names, argument names, return shapes and the closed worker codes are fixed there.
|
||||
|
||||
Style: follow `crates/worker` as it stands (plain `main`, no async, closed outcomes, `log`
|
||||
allowlist, `Backend` trait + fake in tests, `#[allow(unsafe_code)]` never added). Functions
|
||||
small, one responsibility, comments only for the why. No new dependency beyond `faunosteo-core`
|
||||
(path dependency, default features: no `pdf-read`, no `curation`).
|
||||
|
||||
## P2 child `verify`
|
||||
|
||||
1. `crates/worker/Cargo.toml`: `faunosteo-core = { path = "../core" }`. Update `main.rs::version`
|
||||
and `faunosteo_core_version` to print `faunosteo_core::CORE_VERSION` (the comment saying the
|
||||
worker links no core becomes false: remove it).
|
||||
2. `limits.rs`, per command (decode constants unchanged):
|
||||
- `VERIFY_MAX_INPUT_BYTES` 12 MiB (document 2 MiB + base 2 MiB, SQL CHECK; four drawings,
|
||||
6 MiB total, `SnapshotCaps::ASSETS*`; header and margin);
|
||||
- `VERIFY_MAX_HEADER_BYTES` 64 KiB;
|
||||
- `VERIFY_MAX_OUTPUT_BYTES` 4 MiB (= SQL `sheet_verification_max_verdict_bytes`);
|
||||
- `VERIFY_ADDRESS_SPACE_BYTES` 1 GiB, `VERIFY_CPU_SECONDS` 60, `VERIFY_DEADLINE` 90 s
|
||||
(contract budget: verification under 120 s at the caps);
|
||||
- drawing download policy: at most `SnapshotCaps::ASSETS` drawings fetched, each at most
|
||||
`SnapshotCaps::ASSET_BYTES`, total at most `SnapshotCaps::ASSETS_TOTAL_BYTES`.
|
||||
3. `verify_frame.rs` (shared by parent and child): the framed stdin input.
|
||||
`[u32 LE header length][header JSON][document][base?][drawing bytes in header order]`.
|
||||
Header: `{sheet_id, version_id, revision, review_id, document_len, base_len|null,
|
||||
drawings:[{asset_id, sha256, byte_size, bytes_len|null}]}`. `encode(&FrameInput) -> Vec<u8>`
|
||||
and `decode(&[u8]) -> Result<Frame<'_>, FrameError>` (borrowed slices; header over its cap,
|
||||
lengths not summing exactly to the rest, document or base not UTF-8 → `FrameError`). Unit
|
||||
tests: round trip, every malformed case, empty base, missing drawing bytes.
|
||||
4. `verify.rs`, `pub fn main(args, stdin, stdout, stderr) -> i32` mirroring `decode::main`:
|
||||
empty environment check; `--no-seccomp` test hook like decode (only under `test-hooks`);
|
||||
`sandbox::apply(&Limits { VERIFY_ADDRESS_SPACE_BYTES, VERIFY_CPU_SECONDS }, seccomp)`;
|
||||
read stdin `take(cap + 1)`; over cap → `INPUT_TOO_LARGE`; frame error → new exit code
|
||||
`FRAME_INVALID` (a parent bug: Broken, not content); build
|
||||
`faunosteo_core::domain::sheet::verdict::VerdictInput` and run `compute_verdict`;
|
||||
`serde_json::to_vec(&verdict)` to stdout. A failing verdict is still exit 0 (it is content,
|
||||
judged by the core).
|
||||
5. `exit_codes.rs`: add `FRAME_INVALID` (next free number), its name; NOT a content rejection.
|
||||
6. `main.rs`: `Some("verify") => verify::main(...)`; usage line updated.
|
||||
7. `spawn.rs`: the spawner takes the command and its limits: add a `ChildCommand` (or fields)
|
||||
so `Spawner::for_decode(exe)` keeps today's values and `Spawner::for_verify(exe)` uses
|
||||
`VERIFY_DEADLINE`, `VERIFY_MAX_OUTPUT_BYTES`, subcommand `verify`. Output classification per
|
||||
command: decode keeps `webp_check`; verify exit 0 → `Produced(bytes)` only if the bytes parse
|
||||
as a JSON object (`serde_json::from_slice::<serde_json::Map<..>>`), else `Failed`. Keep the
|
||||
decode path byte-for-byte equivalent in behaviour (existing tests must pass unchanged).
|
||||
8. Sandbox / seccomp: the verify child must run under the same filter
|
||||
(`sandbox::ALLOWED_SYSCALLS`). Extend `crates/worker/scripts/derive-seccomp.sh` to also trace
|
||||
`verify --no-seccomp` on a test-hooks fixture (add `fixture verify-clean` and
|
||||
`fixture verify-caps` to `fixtures.rs`: framed inputs built from a small valid document +
|
||||
drawing, and the at-caps document of `crates/core/tests/sheet_verdict.rs::at_caps`); if a
|
||||
syscall is missing from the allowlist, add it ONLY if the trace proves it and say so in the
|
||||
report (do not guess).
|
||||
9. `tests/sandbox.rs` (Docker test stage): verify child exits 0 on the clean fixture with a
|
||||
passed verdict, refuses a non-empty environment, kills on over-cap input, and a seccomp
|
||||
violation still kills (reuse the decode patterns).
|
||||
|
||||
## P3 mode `run --jobs sheet-verify`
|
||||
|
||||
10. `run.rs::main`: accept `--jobs sheet-verify` (and keep `run` / `run --check` unchanged:
|
||||
default mode = avatars + sweep, exactly as today). Verification mode: no sweep, its own loop
|
||||
`verify_loop(config, backend, verifier, watchdog)`; `--check` may combine (`run --jobs
|
||||
sheet-verify --check`) and prints the mode.
|
||||
11. `backend.rs`: new trait `VerifyBackend` (keep `Backend` untouched): `claim_verifications(max)
|
||||
-> Vec<VerifyJob>`, `verification_input(review_id, token) -> Option<VerifyInput>`,
|
||||
`download_drawing(bucket, key, max_bytes) -> Vec<u8>` (404 → `Status(404)`; over max →
|
||||
`Overflow`), `complete_verification(review_id, token, verdict_json) -> CompleteAnswer`
|
||||
(`passed|failed|stale|malformed`), `fail_verification(review_id, token, code) -> FailAnswer`
|
||||
(`retry|unavailable|stale`). Structs deserialize the M6 shapes exactly.
|
||||
12. `http.rs`: implement it on `HttpBackend` (same client, auth headers, error mapping). Body
|
||||
caps per call: input RPC response 16 MiB (two 2 MiB documents escaped in JSON can double),
|
||||
other RPCs keep `MAX_RPC_BODY`; complete RPC request body up to `VERIFY_MAX_OUTPUT_BYTES` +
|
||||
small envelope; drawing download capped at `max_bytes + 1`.
|
||||
13. `verify_job.rs`: one job: validate ids are UUIDs (`keys::is_uuid`), read the input (None →
|
||||
log `verify_stale_input`, end); drawings: bucket must be `anatomical-sheet-assets`, key must
|
||||
be `<64 hex>.svg` equal to `sha256 + ".svg"` (else that drawing is passed without bytes);
|
||||
rows not `uploaded`, over the per-drawing cap, past the count or total cap → passed without
|
||||
bytes (the core reports missing / caps: a business failure, never a worker failure);
|
||||
404 or `Overflow` → without bytes, logged; transport error → `fail(verification.worker.unavailable)`. Build the frame, spawn,
|
||||
classify: `Produced` → complete; complete `malformed` → `fail(verification.worker.verdict_refused)`;
|
||||
`stale` → log, end. Child `Timeout` → `fail(timeout)`; `Signalled` (SIGXCPU, SIGKILL,
|
||||
SIGABRT, SIGSYS) and `OutputOverflow` and `Rejected` (input too large) →
|
||||
`fail(resource_limit)`; `Broken` / `Failed` → `fail(unavailable)` then stop the loop (exit
|
||||
`CHILD_BROKEN`), as the avatar loop does. Every log line through `log` with the allowlist
|
||||
(add `review` field if needed, never document text, never child stderr raw).
|
||||
14. `tests/verify_loop.rs` (fake `VerifyBackend`, real child binary like `tests/job_loop.rs`
|
||||
does): passed verdict completes; failed verdict (unreadable document) completes `failed`;
|
||||
stale input; complete answers stale/malformed; drawing 404 → verdict failed with
|
||||
`drawing_missing` (not a worker failure); transport error → `fail(unavailable)`; timeout
|
||||
(test-hooks hang like decode, if present; else a deadline of 0 in a test spawner) →
|
||||
`fail(timeout)`; output overflow → `fail(resource_limit)`; broken child → stop.
|
||||
15. `docker-compose.yml`: service `worker-verify` under profile `worker`, same image, same
|
||||
hardening as `worker` (read-only, `cap_drop: ALL`, no-new-privileges, user, tmpfs if any,
|
||||
network), `command: ["run", "--jobs", "sheet-verify"]`, same `.env.worker`. Do not start it.
|
||||
|
||||
## Gates the executor runs
|
||||
|
||||
`pnpm rust:check` (fmt, clippy -D warnings, cargo test core + wasm + worker unit, ts-rs, deny);
|
||||
`cargo test -p faunosteo-worker --features test-hooks` natively for the non-sandbox tests. Docker
|
||||
stages (`pnpm worker:test`, `pnpm worker:image`) are run by the orchestrator, not the executor.
|
||||
Never start a worker against any stack. Never touch `supabase/`, `apps/`, `packages/`,
|
||||
`crates/core/src` (read only), DEV or production. No commit.
|
||||
@@ -0,0 +1,209 @@
|
||||
# Plan: V1-2.5 owner checkpoint corrections (revised after challenge)
|
||||
|
||||
Contract `.claude/tasks/contracts/2026-11-02-v1-2-5-owner-checkpoint-2041.md` (criteria 1-12). Branch
|
||||
`feature/v1-2-anatomical-sheets`, worktree
|
||||
`/tmp/claude-1000/-home-bchanot-Documents-faunosteo/e641af9a-743e-46d0-9804-99667836040e/scratchpad/v1-2`
|
||||
(every command runs from there; never the main checkout `/home/bchanot/Documents/faunosteo`, never DEV, no
|
||||
`pnpm e2e:sheet-assets`, no worker against DEV). Sandbox only (`pnpm db:sandbox …`). Three lots, one fresh
|
||||
executor each, in order; the orchestrator commits each lot after `pnpm typecheck && pnpm lint && pnpm test:run`
|
||||
are green (project rule), plus the lot's own checks.
|
||||
|
||||
In-force decisions honoured: BDR-094 (« Accès non autorisé » acts on the server's refusal: kept, and on the
|
||||
creation page the server's `rights.*` answer is checked before the failed client read), BDR-096 (boards never
|
||||
regenerated), BDR-097 (M7 = V1-2.5's migration, sandbox only), BDR-098 (M7 redefinitions restate privileges),
|
||||
LRN-112 (GoTrue MFA, aal2 for factor changes: untouched), LRN-110 (sandbox-only runners). Server/RLS checks
|
||||
unchanged.
|
||||
|
||||
## Lot 1 — three permission states (criteria 1-5)
|
||||
|
||||
- `apps/app/src/state/authStore.ts`
|
||||
- delete `refreshAccount` (interface line ~75 and implementation ~263; no caller in src, tests or e2e).
|
||||
- new action `reloadAccess: () => Promise<void>`, doc « Reads the platform roles and own grants again after a
|
||||
failed permission read (owner 2026-11-02): pages wait, then show what the answer gives; a technical error
|
||||
never wipes what the account already holds. Never rejects. »
|
||||
Body: `const user = get().user; const client = getSupabaseClient()`; if either is missing →
|
||||
`set({ catalogGrants: [], catalogGrantsStatus: 'failed' })` and return. Else `const setOwn =
|
||||
setForUser(user, set, get)`; `setOwn({ catalogGrantsStatus: 'loading' })`; `try { const [roles,
|
||||
catalogGrants] = await Promise.all([fetchOwnPlatformRoles(client, user.id), listOwnCatalogGrants(client,
|
||||
user.id)]); setOwn({ roles, catalogGrants, catalogGrantsStatus: 'ready' }) } catch { setOwn({ catalogGrants:
|
||||
[], catalogGrantsStatus: 'failed' }) }`. Profile and workspace untouched. `applyAuthEvent`'s catch unchanged.
|
||||
- `catalogGrantsStatus` doc: `failed` = the read failed; pages show the unavailable state, never deduce an
|
||||
absence of right from it.
|
||||
- `apps/app/src/components/shell/PermissionsUnavailable.tsx` (new, modelled on `AccessDenied.tsx`): props
|
||||
`{ asPage: boolean; onRetry?: () => void }`. Retry button `onClick={onRetry ?? (() => void
|
||||
useAuthStore.getState().reloadAccess())}`. `asPage` → `<Card as="section" className="space-y-3 p-5 sm:p-6">`
|
||||
with `<h1 ref={usePageHeading()} tabIndex={-1}>` (AccessDenied classes); else `<Card as="section"
|
||||
aria-labelledby="permissions-unavailable-title">` with `<h2 id=…>` (`font-serif text-lg
|
||||
text-[var(--color-ink)]`). Body `t('permissions_unavailable.body')`, button `<Button type="button"
|
||||
variant="secondary">{t('common.retry')}</Button>`. Doc comment: owner 2026-11-02, a technical error never reads
|
||||
as an absence of right; the server still decides.
|
||||
- `apps/app/src/app/routes/app/admin/AdminSheetCreateRoute.tsx`: checks in this order:
|
||||
1. `grantsStatus === 'loading'` → existing waiting status;
|
||||
2. `species.state.status === 'error' && isRightsRefusal(species.state.failure)` → `<AccessDenied />`;
|
||||
3. `grantsStatus === 'failed'` → `<PermissionsUnavailable asPage onRetry={retry} />` where `retry = () => {
|
||||
void reloadAccess(); if (species.state.status === 'error') species.refresh() }` (`reloadAccess` read with a
|
||||
selector);
|
||||
4. `!editor` → `<AccessDenied />`.
|
||||
Replace the comment block with the new rule, and state the invariant: every hook stays above the early returns
|
||||
(form values survive a state switch; do not move form state into a child).
|
||||
- `apps/app/src/app/routes/app/admin/AdminHomeRoute.tsx`: a wrapper `<div ref={access} tabIndex={-1}
|
||||
className="outline-none">` under the h1 stays mounted in every state; inside it: `loading` → `<p
|
||||
role="status" className="text-sm text-[var(--color-ink-muted)]">{t('shell.loading_session')}</p>`; `failed`
|
||||
→ `<PermissionsUnavailable asPage={false} onRetry={retry} />`; `ready` → today's `permissionsLine` paragraph.
|
||||
`retry = async () => { await reloadAccess(); access.current?.focus() }` (focus not lost when the button
|
||||
unmounts). Cards unchanged.
|
||||
- `apps/app/src/components/shell/AccessDenied.tsx`: doc comment only (shown on the creation page once the own
|
||||
grants are read and hold no editor capability, or when the server refuses; never for a failed read).
|
||||
- `apps/app/src/i18n/fr.ts`, `en.ts` next to `access_denied.*`: `permissions_unavailable.title` FR « Impossible
|
||||
de vérifier vos autorisations » / EN « Unable to verify your permissions »; `permissions_unavailable.body` FR
|
||||
« La vérification n'a pas abouti, probablement à cause d'un problème de connexion. Cette erreur ne modifie pas
|
||||
vos droits. » / EN « The check did not complete, probably because of a connection problem. This error does not
|
||||
change your permissions. ». Retry reuses `common.retry`.
|
||||
- `apps/app/tests/unit/routes.admin.test.tsx`: in `beforeEach`/`afterEach`, save and restore the store's real
|
||||
`reloadAccess` (no leak). Replace the test at ~658-665 (« leaves a failed read to the server ») by: for a
|
||||
reviewer-only grant set and an editor grant set, each in `ready` / `failed` / `loading`: form / « Accès non
|
||||
autorisé » / unavailable (no `input`, no `select`, no « Accès non autorisé ») / waiting. Retry: setState
|
||||
`reloadAccess: vi.fn(async () => useAuthStore.setState({ catalogGrants, catalogGrantsStatus: 'ready' }))` →
|
||||
form for the editor, « Accès non autorisé » for the reviewer-only. Species list failing with a network kind +
|
||||
grants failed → Retry → species options present (the species accessor mock answers on the second call).
|
||||
Server rights refusal + grants failed → « Accès non autorisé ». Admin home: `loading` status, `failed` notice +
|
||||
Retry and no « aucune », `ready` unchanged, focus on the wrapper after Retry.
|
||||
- `apps/app/tests/unit/state.authStore.test.ts`: `reloadAccess` → `loading` then `ready` (roles + grants
|
||||
replaced); grants read rejects → `failed`, grants `[]`, roles/profile/workspace unchanged; roles read rejects
|
||||
→ same; no user → `failed`, resolves; account change during the reload → late answer dropped.
|
||||
- `apps/app/e2e/shell/admin.spec.ts`: in « access per right » (~603) add `page.goto('/app/admin/sheets/new')`
|
||||
and the `access_denied.title` heading check for the reviewer. New test « creation page: unreadable permissions
|
||||
show a retry, never the form » (desktop only, `test.skip(isPhone(info))` with the same comment as A0/A1/S1):
|
||||
the A1 editor setup at `aal2` → form visible; then `page.route('**/rest/v1/anatomical_catalog_grants*', r =>
|
||||
r.fulfill({ status: 500, contentType: 'application/json', body: '{}' }))`, reload the page → unavailable
|
||||
heading, no `#sheet-species-id`, axe clean (the suite's helper); `page.unroute(…)`, click « Réessayer » → form
|
||||
visible. Respect the suite's allowlist (a fulfilled route answers locally).
|
||||
- `apps/app/src/components/catalogue/ZonePanel.tsx`: keep one `<div aria-live="polite" className="space-y-2">`
|
||||
mounted in both branches (selection content, or the existing prompt `<p id="catalogue-zone-title">`); markup and
|
||||
classes otherwise unchanged, nothing visible changes.
|
||||
- `apps/app/e2e/shell/catalogue.spec.ts` (P1): for 320 and 375 px, set the viewport explicitly; before any pick
|
||||
the panel holds `[aria-live="polite"]`; after the pick it contains the zone name; the « Références » card's top
|
||||
≥ the drawing's bottom − 1 px, once the drawing is visible (reuse the file's box helper).
|
||||
|
||||
Lot checks: typecheck, lint, `pnpm test:run`, then on the sandbox (`pnpm db:sandbox up fresh` if not up; `pnpm
|
||||
db:sandbox test-db` before e2e on one stack) `pnpm e2e:shell`.
|
||||
|
||||
## Lot 2 — expiry, species order, labels, TOTP key (criteria 6-9)
|
||||
|
||||
- `apps/app/src/lib/dates.ts`: `export const PARIS_TIME_ZONE = 'Europe/Paris'`; private `parisParts(instant:
|
||||
number)` via `new Intl.DateTimeFormat('en-US', { timeZone: PARIS_TIME_ZONE, year: 'numeric', month:
|
||||
'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hourCycle: 'h23'
|
||||
}).formatToParts(instant)` → numbers; `parisDateIso(date = new Date())` from those parts (YYYY-MM-DD, padded);
|
||||
`parisTomorrowIso(date = new Date())` = the next calendar day of `parisDateIso(date)` (UTC date arithmetic on
|
||||
the Y-M-D, never + 86 400 000 ms); `endOfParisDayIso(day: string): string`: validate `^\d{4}-\d{2}-\d{2}$`
|
||||
and a real date (else throw); `guess = Date.UTC(y, m - 1, d, 23, 59, 59, 999)`; offset = `Date.UTC(parts at
|
||||
guess, ms 999) - guess` (Paris changes offset at 01:00 UTC, so one pass is exact for 23:59 local); return `new
|
||||
Date(guess - offset).toISOString()`. No `longOffset`, no `format()` string parsing.
|
||||
- `apps/app/src/admin/validation.ts`: `parseGrant(values, today = parisDateIso())`; transform uses
|
||||
`endOfParisDayIso`. Comments « the end of the chosen day, Europe/Paris (owner 2026-11-02) ». The `expires_on`
|
||||
refine also checks the day is a real calendar date (round-trip through `Date.UTC`), so the transform never
|
||||
sees `2026-02-30` (refused with `admin.access.error.expiry`; test it).
|
||||
- `apps/app/src/components/admin/GrantPanel.tsx` ~280: `min={parisTomorrowIso()}`; drop the `localDateIso`
|
||||
import if unused.
|
||||
- `apps/app/src/admin/labels.ts`: `formatDay(iso, locale, timeZone?: string)` passes `timeZone` to
|
||||
`toLocaleDateString` when given. `GrantList.tsx`: expiry `formatDay(grant.expires_at, locale,
|
||||
PARIS_TIME_ZONE)`; granted date unchanged.
|
||||
- `apps/app/tests/unit/lib.dates.test.ts`: a `describe` that sets `process.env.TZ = 'America/Los_Angeles'` in
|
||||
`beforeAll` (and another with `'Pacific/Kiritimati'`), asserts `Intl.DateTimeFormat().resolvedOptions().timeZone`
|
||||
is that zone, restores in `afterAll`. Cases: `endOfParisDayIso('2026-01-15')` → `2026-01-15T22:59:59.999Z`;
|
||||
`'2026-07-15'` → `2026-07-15T21:59:59.999Z`; `'2026-03-28'` → `2026-03-28T22:59:59.999Z`; `'2026-03-29'` →
|
||||
`2026-03-29T21:59:59.999Z`; `'2026-10-25'` → `2026-10-25T22:59:59.999Z`; `'2026-02-30'` and `'2026-1-5'`
|
||||
throw; `parisDateIso(new Date('2026-11-02T23:30:00Z'))` → `'2026-11-03'`; `parisTomorrowIso(new
|
||||
Date('2026-03-28T22:30:00Z'))` → `'2026-03-29'` (Paris still 03-28, 23:30 CET) and `parisTomorrowIso(new
|
||||
Date('2026-03-28T23:30:00Z'))` → `'2026-03-30'` (Paris 03-29 00:30). New
|
||||
`apps/app/tests/unit/admin.validation.test.ts` (same TZ setup): `parseGrant` → Paris instant; today refused,
|
||||
tomorrow accepted; move the parseGrant case from `routes.admin.test.tsx` (~552-583) here and delete it there.
|
||||
A GrantList render with `process.env.TZ = 'Pacific/Kiritimati'` (asserted; a zone east of Paris, where the
|
||||
device-zone display would say « 1 janvier 2027 ») shows « 31 décembre 2026 » for `2026-12-31T22:59:59.999Z`
|
||||
in FR — in the new file.
|
||||
- `routes.admin.test.tsx` ~458: the label lookup « Relecteur, relectrice » → « Relecteur ou relectrice ».
|
||||
- `supabase/migrations/20261102100000_sheet_admin_reads.sql` (M7): append « Species order range (owner
|
||||
2026-11-02) »: the full M5 `create or replace function` statements of `public.create_species(id text, name_fr
|
||||
text, name_en text, sort_order integer default 100)` and `public.update_inactive_species(id text, name_fr text,
|
||||
name_en text, sort_order integer)` copied with signature, defaults and qualified names unchanged, adding only
|
||||
`or (create_species.sort_order is not null and create_species.sort_order not between 0 and 9999)` (resp.
|
||||
`update_inactive_species.sort_order`) to the `invalid_input` condition; then for both `revoke all on function …
|
||||
from public, anon, service_role; grant execute on function … to authenticated;` (M5's loop). Header: replace
|
||||
« No write, no grant, no policy and no rule changes here » with what M7 now changes (two species RPCs range
|
||||
check, privileges restated).
|
||||
- `supabase/tests/022_sheet_admin_reads.sql`: as an editor at aal2 (the file's helpers): `create_species` with -1
|
||||
and 10000 → `invalid_input`; 0 and 9999 accepted; `update_inactive_species` -1/10000 refused, 0/9999 accepted,
|
||||
null keeps the stored order; `prosecdef` true and `proconfig = array['search_path=""']` for both; bump `plan`.
|
||||
- `supabase/tests/015_catalog_access.sql`: as the owner at aal2 (file helpers), under `set local timezone 'UTC'`
|
||||
then `'America/New_York'`: `grant_catalog_right(..., expires_at => '2027-03-28T23:59:59.999+02:00')` (and
|
||||
`'2027-10-31T23:59:59.999+01:00'`) stores `'2027-03-28T21:59:59.999Z'::timestamptz` (resp.
|
||||
`'2027-10-31T22:59:59.999Z'`) — revoke between grants or use distinct accounts/kinds to avoid `grant.active`;
|
||||
and via direct inserts with an explicit earlier `granted_at` (pattern at ~179), one fresh confirmed account
|
||||
per state, kind `catalog_reader` (`effective` is per account and kind): now()-1 min → `expired`, effective
|
||||
false; now()+1 min → `expiring`, effective true; now()+30 days+1 min → `active`, effective true. Bump `plan`. No
|
||||
UPDATE of existing rows.
|
||||
- Labels: `fr.ts` `admin.grant_kind.sheet_reviewer` → « Relecteur ou relectrice » (grep both dicts for other
|
||||
« relectrice » forms); `en.ts` `catalogue.failure.drawing_hash_mismatch` → « The illustration file's contents do
|
||||
not match its recorded SHA-256 hash. ».
|
||||
- `apps/app/tests/unit/components.SecurityPanel.test.tsx` (reuse its fake `mfa.enroll` and `startEnrolment`):
|
||||
the setup key is the full text of one element with no `select-none` class and no inline `user-select`; no
|
||||
button named /cop(y|ier)/i; a 65-character name refused without calling GoTrue, 64 accepted.
|
||||
|
||||
Lot checks: typecheck, lint, `pnpm test:run` (includes PGlite pgTAP), `pnpm db:sandbox up fresh` + `test-db`,
|
||||
`pnpm db:sandbox up upgrade 20261102100000` + `test-db`, `pnpm db:sandbox types --check`.
|
||||
|
||||
## Lot 3 — MFA reuse measure, recovery review, decisions in docs (criteria 8, 10, 11)
|
||||
|
||||
- `packages/supabase/tests/sandbox/mfa-behaviour.sandbox.ts` case « 11. TOTP code reuse »: account with a
|
||||
verified factor (`withFactor` verifies with the enrolment step's code); wait into a fresh 30 s step N (so C is
|
||||
not the enrolment code) with ≥ 8 s left; session A (password) takes code C of step N, verifies → aal2.
|
||||
Then sign in session B (password, after A's verify), assert B is `aal1` and alive (a `getUser` or its
|
||||
`auth.sessions` row, as the file does elsewhere) before sending C; B challenge + verify with C; assert the
|
||||
answer is not `session_not_found` and record whether C is accepted. Then A challenges and verifies again with
|
||||
C. Then wait into step N+1, sign in session D, verify with C once more (skew); then into step N+2, session E,
|
||||
verify with C (upper bound of the span). Assertions pin the
|
||||
observed outcome (first run measures; then the assertions are written to it and the suite re-run). No secret or
|
||||
code printed on failure.
|
||||
- `docs/development/IDENTITY.md` §4.1: replace « observed, not asserted » with the asserted outcome, the measured
|
||||
span (one step or two with skew) and its consequence, citing the configuration that ran the measurement (the sandbox GoTrue environment in
|
||||
`scripts/db-sandbox.sh`, image defaults plus its overrides) and, separately, `supabase/config.toml` `[auth.mfa]`
|
||||
for the CLI/DEV stacks, before any claim about mitigations. New §4.2 « Lost authenticator: paths and gaps »: second factor
|
||||
(enrol from `aal2`, recommended for every capability holder, two on independent devices for the owner, V1-2
|
||||
§5.6); self-service recovery (none: no recovery codes; password reset and factor removal need `aal2`; an
|
||||
ordinary account keeps `aal1` use, a capability holder loses administration); authorised administrative
|
||||
intervention (operator procedure of V1-2 §5.6 and §5.7.7, server access, never an app path, no RPC or screen);
|
||||
identity checks (out of band, owner present, reason recorded) and audit (`auth.mfa_factor_reset` row written by
|
||||
the operator in the same session, GoTrue audit log); gaps: not rehearsed (V1-2.9), audit row depends on the
|
||||
operator, single-owner platform has no second person, no recovery codes → « Production prerequisite: a recovery
|
||||
runbook rehearsed on the sandbox and written here before any production use of MFA-protected rights. » No new
|
||||
path, no weakening of `aal2`.
|
||||
- `docs/development/V1-2_ANATOMICAL_SHEETS.md`: §3 nomenclature « Relecteur ou relectrice »; §12.3 M7 row and
|
||||
§17.10 row: M7 also redefines `create_species` / `update_inactive_species` (order 0..9 999) with privileges
|
||||
restated; §13: new bullets « TOTP code reuse within its window (measured, IDENTITY §4.1): residual » and
|
||||
« Production prerequisite: the lost-factor recovery rehearsed and written (§5.7.7, IDENTITY §4.2) »; new §17.11
|
||||
« V1-2.5 checkpoint decisions (owner, 2026-11-02) »: three permission states (creation page order: loading,
|
||||
server refusal, failed read, editor or not; Administration home notice; lists keep actions hidden), accepted UX
|
||||
deviations (selection in the zone panel with an always-mounted live region; « Références » card not collapsible
|
||||
on mobile, below the drawing, measured at 320/375 px), MFA factor name 64, TOTP key without Copy (readable,
|
||||
selectable), expiry end of day Europe/Paris (23:59:59.999, picker and display in Paris, backend compares
|
||||
instants, historical rows untouched), species order 0..9 999 server-side (M7), « relecteur ou relectrice », L14,
|
||||
L15 title alone, `object_conflict` EN, ~350 new labels not approved (separate owner review).
|
||||
- `docs/design/README.md`: « Accepted deviations (owner 2026-11-02, V1-2.5) » with the two items and conditions;
|
||||
boards unchanged.
|
||||
- `docs/design/v1-2-4/REVUE.md`: L15 second-sentence row → decided (removed, title alone); `object_conflict` EN
|
||||
row → ratified wording. No image touched.
|
||||
- `.claude/tasks/contracts/2026-11-02-v1-2-5-admin-catalogue.md`: the C4 clarification sentence (« when their read
|
||||
failed … shows the form and the server decides … Submitted for the owner's acknowledgement ») → the owner's
|
||||
decision (unavailable state with Retry; server refusal first; owner 2026-11-02).
|
||||
- `.claude/audits/2026-11-02-v1-2-5-label-proposals.md`: header: L14, L15, `object_conflict` EN, « relecteur ou
|
||||
relectrice » ratified 2026-11-02; every other new label stays a proposal for a separate owner review; ~31 expiry
|
||||
line → end of the chosen day Europe/Paris, species order → 0..9 999 checked in SQL; ~74 « Relecteur, relectrice »
|
||||
→ « Relecteur ou relectrice »; add `permissions_unavailable.*` as proposals (FR title = owner wording).
|
||||
|
||||
Lot checks: `pnpm db:sandbox test` (MFA suite and the others) twice green after the assertions are pinned.
|
||||
|
||||
## After the lots (orchestrator)
|
||||
|
||||
GATE 0 `gates.sh`, fresh verifier, fresh security audit on the whole diff; `pnpm check:all`; `pnpm e2e:shell` on
|
||||
the final code; commit + push per lot; memory (BDR for the checkpoint decisions, journal), TODO; V1-2.6 scope from
|
||||
V1-2 contract §16.7 and §8.2 for the checkpoint report.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Plan: V1-2.5 administration space, rights, species, MFA, catalogue
|
||||
|
||||
Contract `.claude/tasks/contracts/2026-11-02-v1-2-5-admin-catalogue.md` (C1 to C12). Branch
|
||||
`feature/v1-2-anatomical-sheets`, sandbox only. One slice = one coherent change, committed and pushed when its
|
||||
own checks pass. Slices A, B and C have no dependency on each other; D needs B and C; E to I need D.
|
||||
|
||||
| Slice | Content | Criteria | Checks |
|
||||
|---|---|---|---|
|
||||
| A | GoTrue MFA behaviour on the sandbox: `packages/supabase/tests/sandbox/mfa-behaviour.sandbox.ts` with the existing `mfa.ts` / `totp.ts`; findings written into IDENTITY.md. STOP for the owner if `aal1` enrols a second factor or removes a verified one | C1 | sandbox suite |
|
||||
| B | M7 `supabase/migrations/20261102100000_sheet_admin_reads.sql`: `list_official_sheets_admin()`, `get_official_sheet_admin(sheet_id)`; pgTAP `022`; types; sandbox fresh + upgrade from M6 | C9 | PGlite, `db:sandbox test-db`, `db:types --check` |
|
||||
| C | Core op `sheet.empty` (wraps `create_empty_sheet_document`: species, names, slug), wasm facade, ts-rs types | C5 | `rust:check`, `wasm:build`, core-wasm proofs |
|
||||
| D | `packages/supabase`: MFA wrappers (list, enrol, challenge and verify, unenrol, assurance level), species, working copy, account lookup, M7 reads, catalogue reads (versions of a sheet, drawing download), closed failure kinds; unit tests | C1-C9 | `test:run`, typecheck, lint |
|
||||
| E | Shell: nav entries and their hints (own grants + roles), guards `RequireCatalog` and `RequireAdmin` (step-up), « Accès non autorisé » page, routes | C3, C4 | unit, e2e |
|
||||
| F | Mon compte, Sécurité: factor list, enrolment (QR, secret once), verification, naming, removal; step-up screen | C2 | unit, e2e |
|
||||
| G | Administration page (board 10), species screens, rights screen | C4, C6, C7 | unit, e2e |
|
||||
| H | Sheets list with filters, creation (inline species), overview, working copy action | C5 | unit, e2e |
|
||||
| I | Catalogue list (board 01), sheet page (board 02, 03), version page; `PreviewSheet` load path, canvas with zoom and pan | C8 | unit, e2e |
|
||||
| J | `e2e:shell` journeys A0, A1, S1, P1, access per right, MFA, refresh, axe, viewports, FR/EN | C11 | `pnpm e2e:shell` |
|
||||
| K | Docs, `check:all`, fresh verifier + security, memory, checkpoint report with the label proposals | C10-C12 | all gates |
|
||||
@@ -0,0 +1,482 @@
|
||||
# Plan: V1-2.6 editor level 1 (revised after challenge, 2026-11-03)
|
||||
|
||||
Contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` (criteria C1 to C34, CLARIFICATIONS [gated
|
||||
2026-11-03] and [gated 2026-11-04]). Branch `feature/v1-2-anatomical-sheets`, worktree
|
||||
`/home/bchanot/Documents/faunosteo-v1-2` (durable since 2026-11-04, LRN-114; execution ledger
|
||||
`.claude/tasks/plans/2026-11-03-v1-2-6-execution.md`), base
|
||||
7f618d0. Sandbox only (`pnpm db:sandbox`, containers `faunosteo_dbsandbox_*`); the `supabase_*_faunosteo`
|
||||
containers are DEV: never touched, never a target. Every command runs with the worktree as an absolute,
|
||||
verified cwd (LRN-110). One lot = one coherent change, committed and pushed by the orchestrator after its own
|
||||
checks (`pnpm typecheck && pnpm lint && pnpm test:run`, plus the lot's checks).
|
||||
|
||||
Format note: the project's lot format (precedent `.claude/tasks/plans/2026-11-02-v1-2-5.md`), every choice closed
|
||||
here; executors write the code and the tests. Reading list for every executor: the contract, this plan,
|
||||
`docs/development/V1-2_ANATOMICAL_SHEETS.md` §6.2, §6.6, §8, §9.2-§9.4, §10, §11.1, `docs/design/v1-2-4/REVUE.md`
|
||||
(ratified wordings), boards `04-editeur-desktop.png`, `05-lecture-seule-etroit.png`, `06-verification-etats.png`
|
||||
(panel A only), the ts-rs types under `packages/core-wasm/types`.
|
||||
|
||||
## Architecture (closed decisions)
|
||||
|
||||
### Core and handle
|
||||
- No Rust change (crates/** untouched): the core already offers `sheet.edit`, `sheet.dependents`, `sheet.empty`,
|
||||
`clean_svg`, `PreviewSheet` with `replace_document` / `add_drawing`, `preview.state`, `view.canvas`. The wasm
|
||||
module and its 600 000 B gzip budget are unchanged.
|
||||
- The editor reuses `CataloguePreview` (`apps/app/src/catalogue/preview.ts`), extended, never duplicated: its kept
|
||||
input (`document` text) and drawing list become mutable; `replaceDocument(text)` and `addDrawing(drawing)` call
|
||||
the glue's `replace_document` / `add_drawing`. A new text is kept only after `replace_document`, the following
|
||||
`preview.state` AND the optional `accept(state)` all succeed (`replaceDocument(text, accept?)`, ruling R2); when `state` fails without a trap, `replace_document(previous)` rolls the handle
|
||||
back, so the handle, the kept input and the store never diverge. The rebuild after a trap (generation change)
|
||||
uses the kept input, so a text or file that trapped is never kept and never re-read automatically (LRN-058).
|
||||
Kept drawings are a map keyed by asset id (a re-added id replaces its entry; the builder counts entries), holding
|
||||
only drawings the core accepted (16 at most; `caps: drawings` gets its own message, a reload frees them). Every
|
||||
accepted `replaceDocument` / successful `addDrawing` bumps a store counter `handleVersion` (never a refused one).
|
||||
- The draft handle is built with NO drawing (a draft builds with its drawings missing, §10; `add_drawing` works on
|
||||
a draft and `view.canvas` looks drawings up live), then each downloaded drawing is added with `addDrawing`; a
|
||||
refusal or a failed download becomes that drawing's state (`missing`, `hash mismatch`), never a load failure: one
|
||||
bad drawing never blocks authoring (§9.3). A load dropped by the session token frees the preview it built;
|
||||
`close()` frees the session's preview.
|
||||
- Wrappers `apps/app/src/editor/core/editOps.ts`: `applyEdit(text, command)` (input text built as
|
||||
`{"document":<text>,"command":<json>}`, output `{document}` serialised back with `JSON.stringify`),
|
||||
`dependentsOf(text, key)`; `cleaning.ts`: `cleanSvg(bytes)`, `composeCleaningPreview(stored)` (a throwaway
|
||||
`CataloguePreview`: `sheet.empty` → `sheet.edit insert` a detail view `view-<random>` under the main view with a
|
||||
random uuid as its own drawing, the stored bytes added under that uuid, `canvas(<that view id>)`; the scope
|
||||
`fv.view-<random>.` is unique in the page; freed when the dialog closes). The original file is never rendered.
|
||||
- Content comparisons (recovery offer, unsaved flag) compare parsed JSON deeply (`sameDocument(a, b)`), never raw
|
||||
strings: the server text is in jsonb key order, the core's in serde order.
|
||||
|
||||
### Ids
|
||||
- `<prefix>-<10 chars a-z2-7>` from `crypto.getRandomValues`, prefixes `view`, `anno`, `cat`, `ref`, `zone`,
|
||||
`fcat`, `node`; a `duplicate_key` answer regenerates once and retries; no document walk. Region codes are typed
|
||||
at creation (the core checks the grammar), read-only afterwards.
|
||||
|
||||
### Store and sessions
|
||||
- One Zustand store `editorStore`, module-level; `open(versionId, userId)` returns a session token, `close()`
|
||||
invalidates it; EVERY async continuation (load, downloads, save, upload, conflict read, submit) checks the token
|
||||
before writing and drops its result otherwise (StrictMode runs open → close → open in dev, the e2e and the
|
||||
trial). DOM handlers read `getState()` (LRN-043).
|
||||
- The page holds the document as ONE JSON text (`documentText`) and the saved pair (`savedText`, `savedRevision`)
|
||||
taken from the SAME `get_sheet_version` answer (`revision` and `document` together; the admin read is never the
|
||||
revision source). `catalogue/catalogue.ts` `readVersion` is exported and gains a draft mode that accepts
|
||||
`draft`, returns `revision` and returns per-drawing settled results (`Promise.allSettled`, a failure kind per
|
||||
asset id) instead of failing the load; the catalogue's all-or-nothing path is unchanged: no second loader.
|
||||
- Every change is one `sheet.edit` command run on commit (blur with a changed value, Enter, a confirm button,
|
||||
pointer-up), never per keystroke (BDR-050); field typing stays local; a field with a pending value commits it in
|
||||
its unmount cleanup (mode switch). The new text is stored only after `replaceDocument` and `preview.state`
|
||||
succeed; a refused command leaves everything unchanged and shows its closed kind next to the control.
|
||||
- Undo/redo: arrays of texts; each entry's UTF-8 size measured once (`TextEncoder`); oldest undo entries dropped
|
||||
while both stacks exceed 8 388 608 B; a new commit clears redo; save keeps both; a reload of the server draft
|
||||
(« Recharger », discard after an older-copy restore) and « Annuler les modifications » clear both. Controls:
|
||||
icon buttons « Annuler » / « Rétablir » in the tool column under the zoom; Ctrl+Z and Ctrl+Shift+Z outside text
|
||||
fields (no Ctrl+Y).
|
||||
|
||||
### Creation of elements (no invented labels)
|
||||
- No element is inserted with default labels. Each creation collects the fields the core requires, then one
|
||||
`insert`:
|
||||
- annotation (drawn or keyboard): the geometry is held as a pending outline in the overlay and the properties
|
||||
panel opens in a « Nouveau point / Nouvelle zone / Nouvel accès » state with Nom (FR), Nom (EN), Catégorie
|
||||
(first category preselected), Latéralité (no preselection, required), Vue ouverte (link, required), then
|
||||
« Créer » inserts; « Annuler » drops the pending element. Zone de constats and Région vertébrale optional;
|
||||
- annotation category: name FR/EN, colour optional; reference: type, citation, URL, DOI; region: code, name
|
||||
FR/EN, count; detail view: name FR/EN, parent, own drawing or crop values; finding zone: name FR/EN; finding
|
||||
category: kind, name FR/EN; node: name FR/EN.
|
||||
- A blank optional field is sent as `null` where the type is nullable and omitted where it is an optional key
|
||||
(`LocalizedOptionalText`); never "" (the core refuses empty strings).
|
||||
|
||||
### Rendering and canvas
|
||||
- Only `view.canvas` trees are rendered, inserted with `DOMParser` + `importNode` through `buildView`, exported
|
||||
from `CatalogueCanvas.tsx` and reused. Read-only modes mount `CatalogueCanvas` as is (board 05). The edit canvas
|
||||
reuses `framing.ts` and `useFraming` with one added option `canPan(event)` (false when the press starts on a
|
||||
selected marker or a drawing tool is active).
|
||||
- A page-drawn overlay `<svg>` (numbers only: selection outline dashed dark, vertex circles, the tracing in
|
||||
progress, the pending or dragged outline, the crop rectangle) sits over the drawing inside the same transformed
|
||||
container, with the composed root's `viewBox` and `preserveAspectRatio`. Pointer → drawing coordinates through
|
||||
the overlay's `getScreenCTM().inverse()`. `docs/ANNOTATION-RENDERING.md` gets an « Editor overlay (V1-2.6) »
|
||||
section first, stating it draws no annotation and holds numbers only.
|
||||
- Only the active tab panel is mounted, so one view's canvas is never twice in the DOM.
|
||||
- Canvases follow the handle: the edit canvas rebuilds on `[viewId, handleVersion, attempt]`; the read-only
|
||||
`CatalogueCanvas` is mounted with `key={handleVersion}`, so a restore, an upload or a drawing added after the
|
||||
first paint is shown (no stale tree, no stuck `no_asset` notice).
|
||||
- Pointer handling: `setPointerCapture` on press; `pointercancel` and `lostpointercapture` drop the drag with no
|
||||
command; a switch to read-only mid-drag drops it.
|
||||
|
||||
### Tools (board 04)
|
||||
- Sélectionner/déplacer, Point, Zone, Accès à une vue détaillée, separator, Zoom (−, +, Ajuster), separator,
|
||||
Annuler, Rétablir. Select: a press on a marker selects it; a drag from a selected circle or polygon moves it as
|
||||
a block (overlay preview; on pointer-up one `update` with coordinates translated by the drawing-unit delta,
|
||||
rounded to 2 decimals); a drag on empty space pans. Point: one click holds a pending circle placed by the rule
|
||||
« Default point and the frame » below. Zone and link: clicks add vertices;
|
||||
Enter, a click on the first vertex or « Fermer le tracé » closes (3 vertices at least); Escape or « Annuler le
|
||||
tracé » drops it. A detail-view link opens a direct child of its own view (core rule
|
||||
`annotation.opens_view.invalid`): the link tool is enabled only while the current view has a direct detail
|
||||
child (hint otherwise), and « Vue ouverte » lists only those children, in creation and in properties; every drawing tool
|
||||
is disabled with « Créez d'abord une catégorie d'annotation (onglet Général). » while there is none.
|
||||
- Default point and the frame (owner 2026-11-03, C26). The frame F = (x, y, w, h) is the composed root's `viewBox`
|
||||
read from the core's `view.canvas` output (the view's `view_box`, else its drawing's `viewBox`; origin offsets
|
||||
kept; drawing units), parsed from the attribute TEXT with `Number` (never `viewBox.baseVal`, held in f32).
|
||||
Measured views only (re-check F1): F is read, and creation or geometry edits are possible, only while the view's
|
||||
drawing state is `ok` AND the core's report carries no `view.frame.unknown` for that view. The core skips every
|
||||
other view (no drawing held, missing, hash mismatch, rejected: `frame_faults` frame.rs:281-284; no usable frame:
|
||||
only `view.frame.unknown`, frame.rs:285-288; the canvas then shows the fallback `0 0 100 100`, compose.rs:43), so
|
||||
its silence there proves nothing: on such a view the drawing tools, the keyboard « Ajouter … » buttons and the
|
||||
numeric geometry fields are disabled with the hint « Ce dessin n'est pas mesurable : ajoutez ou corrigez son
|
||||
illustration (onglet Vues et illustrations) avant de placer ou de déplacer des éléments. », and `accept` refuses
|
||||
any creation or geometry commit whose view is not measured (checked on the post-commit state, so a commit
|
||||
cannot rely on a view that the same commit made unmeasurable). Default radius `r0 = min(12 + 0.03 × max(w, h), min(w, h) / 2)`, floored to 0.01. The
|
||||
page only PROPOSES geometry (arithmetic); the core decides. TypeScript carries no copy of the core's frame or size
|
||||
rules: no 4 px constant, no preview sizes, no twin radius, no edge tolerance.
|
||||
- Proposal at click (c = the clicked point, rounded to 0.01; d = its distance to the nearest edge of F): d ≥ r0 →
|
||||
candidate A (c, r0); d < r0 → candidate B (c, floor₀.₀₁(d)), the clicked position kept with a smaller
|
||||
radius, only when that radius is at least 0.01 (otherwise straight to C below; the edge is inclusive in the
|
||||
core, so no extra margin). A click outside F proposes nothing (hint « Cliquez à l'intérieur du dessin. »). Keyboard
|
||||
« Ajouter un point »: the centre of F with r0 (fits by construction).
|
||||
- The core decides at « Créer »: the insert runs through `commit(command, { accept })`: `sheet.edit` →
|
||||
`replaceDocument` → `preview.state`, then `accept(report)` reads the geometry issues whose path names the new
|
||||
annotation (`editor/issues.ts`); a refusal rolls the handle back with `replaceDocument(previous)` before
|
||||
anything is kept (no store change, no `handleVersion` bump, no copy write). A new point is refused on
|
||||
`annotation.geometry.out_of_frame` and `annotation.geometry.too_small`.
|
||||
- Correction, never silent: when B is refused, or A is refused `out_of_frame` (float edge), the page computes
|
||||
candidate C (radius r0, centre clamped per axis into [x + r0, x + w − r0] and [y + r0, y + h − r0], rounded
|
||||
inward to 0.01; when that rounding leaves an empty interval, r0 = min(w, h)/2 with an origin off the 0.01
|
||||
grid, the exact clamped value is used: the core accepts any decimals) and shows it in the overlay with the original click marked apart (a hollow cross) and the
|
||||
message « Le point ne tient pas à l'endroit choisi. Position corrigée proposée : x = …, y = …. » with
|
||||
« Utiliser cette position » / « Annuler ». Confirm → C is inserted through the same `accept`; the numeric
|
||||
fields and the properties show C's values only (nothing refers to the click afterwards). « Annuler » keeps the
|
||||
pending point at the click so the user can change its radius or position, or drop it. A refusal of C, or
|
||||
`too_small` on A or C (r0 already capped: an extremely elongated frame), creates nothing and shows the core's
|
||||
issue message beside the creation panel.
|
||||
- Geometry errors (owner 2026-11-04, C33): an annotation's geometry errors are the core's Error issues at
|
||||
`annotations[i].geometry` (`annotation.geometry.missing`, `out_of_frame`, `too_small`, `interior_too_small`),
|
||||
mapped to the annotation's id through the document of the same state (an insert, a delete or a reorder shifts
|
||||
the index); « before » is the report of the last accepted state the store holds, « after » the report of the
|
||||
candidate state. One rule for every geometry commit (creation insert, move by drag, numeric cx, cy, r or
|
||||
vertex, vertex added or removed, polygon replacing a path): `accept` refuses it unless the changed annotation
|
||||
carries no geometry error after it, whether it was new, valid or already invalid before (owner rules 1, 2
|
||||
and 5). A refusal rolls the handle back (no store change, no `handleVersion` bump, no copy write); the message
|
||||
is the core's issue (« L'élément sortirait du cadre. » for `out_of_frame`). A radius the user types that the
|
||||
core reports `too_small` is therefore refused, never committed (rule 2). Zones and links: the creation insert
|
||||
is refused the same way (tracing kept for numeric correction or cancel).
|
||||
- Repair through a temporary form (owner rules 3 to 5): the geometry fields of the properties panel (cx, cy, r;
|
||||
the vertex rows; « Ajouter un sommet » / « Retirer ») form one group held in component state. Enter or leaving
|
||||
a field proposes the WHOLE group as one `update`; accepted → committed; refused → nothing changes in the
|
||||
document, the fields keep the typed values marked « non appliqué » with the core's issue message and a
|
||||
« Revenir aux valeurs enregistrées » action. So an annotation already invalid (inherited, restored) is
|
||||
repaired by typing a coherent set (e.g. cx then cy) applied once it satisfies the core, never through an
|
||||
invalid intermediate document; its error stays in Vérification and on the properties panel until the fix is
|
||||
applied (rule 6: no diagnostic hidden, an invalid annotation never shown as valid). Selecting another element
|
||||
drops an unapplied group (it was never in the document). Drag on an already-invalid annotation follows the
|
||||
same rule: a drop that leaves it invalid is rolled back with the message. The save path and the server's
|
||||
verdict are unchanged: a draft that already holds geometry errors saves as before (the core's rules are never
|
||||
weakened, nothing is added to them) and the submit stays the server's decision.
|
||||
- Frame changes (a view's `view_box` update, a drawing set or replaced on a view, rule 7) use `accept` too:
|
||||
refused when any annotation that had no geometry error before has one after, the refusal listing those
|
||||
annotations; an annotation already invalid does not block it. Refused too when a measured view holding
|
||||
annotations becomes unmeasured (the core then goes silent on them: their validity would vanish unseen).
|
||||
- No move without intent: numeric fields show the stored number exactly (no display rounding; the equine draft
|
||||
holds values such as 743.0451049804688) and commit only when the typed number differs from it; a drag starts
|
||||
only after the pointer travelled 4 CSS px from the press, so a click with jitter on a selected marker never
|
||||
moves it (owner 2026-11-04: a plain click still selects, the keyboard path is untouched, pointer events serve
|
||||
mouse, pen and touch alike; the canvas sets `touch-action: none` only while a drawing tool or a drag is
|
||||
active, so a touch scroll of the page still works otherwise).
|
||||
- Unmeasured views, read-only geometry (owner 2026-11-04, C32): existing annotations of such a view stay shown
|
||||
when the canvas can draw them and stay selectable; their properties show geometry as read-only text, drag is
|
||||
off, and the hint names the « Vues et illustrations » tab where the drawing is fixed. The fallback frame
|
||||
`0 0 100 100` is never read as a frame: no proposal, no `accept` verdict, no message relies on it.
|
||||
- Unit tests on the Node core (C26): frames 40×30, 20×20, 100×300 (detail crops), 500×380, 640×480, 200×150, very
|
||||
elongated 1000×30 and 4000×200, non-zero origins (e.g. `-50 20 40 30`); clicks on each edge, each corner, at
|
||||
distance exactly r0 and r0 − 0.005 from an edge; coordinates near 2^20; r0 = min(w, h)/2 exactly; a non-grid
|
||||
origin with r0 = min(w, h)/2; unmeasured views (a crop of span 0.5, a drawing without `viewBox`, a missing
|
||||
drawing: every creation and geometry commit refused); repair (C33): an inherited out-of-frame point, then
|
||||
polygon, whose intermediate values (cx only) are refused with the document unchanged and whose coherent set
|
||||
is applied, a restored copy holding an invalid point repaired the same way; a valid point given a typed
|
||||
radius the core reports `too_small` refused; a drag dropping a valid point half out rolled back; a `view_box`
|
||||
change refused when it pushes a point out or makes it `too_small`, accepted when only an already-invalid
|
||||
point is affected; each case asserts the proposal, the core's verdict on it and that no page action ever
|
||||
leaves an annotation with a geometry error it did not already have.
|
||||
- Keyboard path (C7): under the canvas, « Ajouter un point », « Ajouter une zone », « Ajouter un accès » hold a
|
||||
pending element at the frame centre (zone and link: a triangle of 10 % of the smaller side) and open the
|
||||
creation panel; then every coordinate is edited in numeric fields (cx, cy, r; rows « n | x | y »; « Ajouter un
|
||||
sommet » after the selected row or the last; « Retirer » while more than 3 remain).
|
||||
- A `path` annotation: shown and selectable; « Remplacer par un polygone » starts a tracing whose result replaces
|
||||
its geometry; never moved; its path data never shown as editable.
|
||||
- Selection also from the annotation list of the view (name, kind, review badge; keyboard reachable); the tag
|
||||
« Sélection : <type> « <nom> » » over the drawing (board 04).
|
||||
|
||||
### Panels and tabs
|
||||
- Properties panel (board 04): Nom (FR), Nom (EN), Catégorie, Couleur (« de la catégorie » or a hex value),
|
||||
Latéralité, Région vertébrale, Zone de constats (point, zone), Vue ouverte (link), coordinates, review badge
|
||||
(« À confirmer », « Relu », « Hérité, non relu »), « Marquer comme relu » (`set_status reviewed`, while not
|
||||
`reviewed`), « Remettre à confirmer » (`set_status to_confirm`, while `reviewed`), « Supprimer » (confirmation;
|
||||
a refusal lists the dependents).
|
||||
- Général: names, description and scope disclaimer FR/EN, attribution (authors add/remove, licence, notes); section
|
||||
« Catégories d'annotation » (list, add, rename, colour, delete with dependents).
|
||||
- Vues et illustrations: main view (name, drawing state ok / missing / rejected with its detail, « Choisir une
|
||||
illustration »), detail views (add, parent, own drawing or crop: four numeric `view_box` fields with the parent's
|
||||
canvas beside them and the crop rectangle in the overlay; rename; delete with dependents).
|
||||
- Constats: tree zones → categories → nodes (depth ≤ 8), `role="tree"` / `treeitem`, arrow keys; categories and
|
||||
nodes carry a review badge, zones none (FindingZone has no status); actions: add zone, add category, add node
|
||||
(disabled at depth 8), ↑ / ↓ (`move`), « Marquer comme relu » (zone and category: `mark_reviewed`; node:
|
||||
`set_status reviewed`), « Remettre à confirmer » (categories and nodes only), delete with a confirmation listing
|
||||
the descendants and, on refusal, the dependents.
|
||||
- Références: list + form (type, citation, URL http/https checked by the core, DOI). Vertèbres: list (code, name,
|
||||
count, optional range), add, edit, ↑ / ↓, delete.
|
||||
- Read-only renders through shared field components that show their value as text when `readOnly` (action buttons
|
||||
hidden by the same flag): each tab stays one component.
|
||||
- Vérification (board 06 A): badges « N erreurs bloquantes » / « N éléments à confirmer »; one notice per error
|
||||
issue with its FR/EN message and « Aller à … » when the path names an element; warnings apart; the info notice on
|
||||
`to_confirm` elements; completeness; statuses per group; size « <n> o sur 2 097 152 o » from
|
||||
`report.document_bytes`, caps exceeded named; « Note de soumission (obligatoire) » (trimmed 1 to 1 000
|
||||
characters); « Soumettre à la revue » disabled with its hint while errors exist (« Corrigez les N erreurs
|
||||
bloquantes pour soumettre. »), while unsaved (« Enregistrez le brouillon avant de le soumettre. ») or while the
|
||||
note is empty. Submit → `submit_sheet_review(version_id, savedRevision, note)`; success → the admin read and the
|
||||
version are reloaded, the page shows the `frozen` read-only state. No « Prévisualiser », no withdrawal (V1-2.7).
|
||||
|
||||
### Save, conflict, recovery
|
||||
- Save: « Enregistrer » sends `sentText` with `expected_revision = savedRevision`, no change note; the answer is
|
||||
parsed as `{revision: number}` (`unavailable` otherwise). Success: `savedText = sentText`, `savedRevision =
|
||||
answer`, unsaved = `!sameDocument(current, sentText)`; the recovery copy is removed when unsaved is off, else
|
||||
rewritten on the new revision. `draft.unchanged` sets the saved pair to (`sentText`, the `expected_revision`
|
||||
sent). Other kinds → header notice, document and copy kept.
|
||||
- Conflict (`draft_conflict`, owner 2026-11-03, C29): the page reads `get_official_sheet_admin` and opens a
|
||||
dialog. N = `draft_version.revision` of that read; the author and date come from M8 `draft_last_save` only when
|
||||
its `revision` equals N, otherwise they are omitted (never invented): « Une autre session a enregistré la
|
||||
révision N » + « par <nom>, le <date heure Paris> » when known (a neutral « depuis une autre session de votre
|
||||
compte » when `saved_by` is the caller). When that read fails, answers without `draft_version`, or the answer
|
||||
does not parse, the dialog says « Une autre session a enregistré une version plus récente de ce brouillon. » and
|
||||
offers « Recharger » and « Réessayer » (repeats the read) only; « Garder ma version » is disabled with the hint
|
||||
« Révision du serveur inconnue : rechargez ou réessayez. »; no revision number or author is shown. « Recharger » → a confirmation
|
||||
« Abandonner vos modifications et recharger la révision N ? » → reload of the server draft (text and revision
|
||||
from one `get_sheet_version`, the listed drawings the handle lacks downloaded and added), both stacks cleared,
|
||||
copy removed; « Garder ma version » → a confirmation
|
||||
« Remplacer la révision N (<nom>, <date>) par votre version ? » (author and date only when known) → save with
|
||||
`expected_revision = N`; the server's atomic revision check decides at write time; a new conflict re-reads and
|
||||
re-opens the dialog with the new N, never writes; « Annuler » changes nothing.
|
||||
- Local recovery copy (C13, C27, C28): a TEMPORARY copy in this tab's sessionStorage (the report editor's pattern),
|
||||
never a server save and never called one. Key `osteo:sheet-draft:<userId>:<versionId>`, value
|
||||
`{"v":1,"user_id","version_id","sheet_id","sheet_name","revision","written_at","document":<text>,
|
||||
"drawings":[{"asset_id","sha256"}]}` (revision = the saved revision the edits started from; `sheet_name` is a
|
||||
display label taken at write time). Written SYNCHRONOUSLY by a store subscription on each committed change while
|
||||
unsaved and no offer is pending, through `writeOrRemove` exported from `state/persistence.ts`; its boolean is
|
||||
kept in the store.
|
||||
- Removal, only by an explicit outcome: a successful save that leaves nothing unsaved; « Annuler les
|
||||
modifications » confirmed; « Ignorer la copie » confirmed; « Recharger » confirmed (conflict); « Abandonner
|
||||
cette copie » confirmed (cap list below). Never on undo back to the saved content (the copy keeps the last
|
||||
unsaved document), never by automatic eviction, never while an offer is pending.
|
||||
- Offer on opening, blocking (owner 2026-11-03): a copy of this account and version whose document differs
|
||||
(`sameDocument`) from the server's opens the store state `recovery = pending`. While pending (and while
|
||||
`refused` and `restoring`, below) the STORE refuses every commit, undo, redo, save and submit and every action
|
||||
that would remove the copy other than « Ignorer la copie » (« Annuler les modifications » included) (kind
|
||||
`recovery.pending`, not only disabled buttons, keyboard shortcuts included) and the copy subscription neither
|
||||
writes nor removes. A stored copy that cannot be read (malformed JSON, `v` ≠ 1, `user_id` or `version_id` not
|
||||
matching its key) is never overwritten: it opens `recovery = refused` with « Ignorer la copie » only (the report
|
||||
editor's quarantine pattern) and a notice that names the loss (owner 2026-11-04): « Une copie locale de ce
|
||||
brouillon existe dans cet onglet mais ne peut pas être lue. Elle n'est pas enregistrée sur le serveur.
|
||||
L'ignorer la supprime de cet onglet : son contenu sera perdu. » (label proposal); kept until that explicit
|
||||
abandonment, never replaced or removed otherwise; editing stays blocked until then. The leave guard is armed while unsaved OR while `recovery` is not `none`.
|
||||
Consultation stays: tabs, selection, list, zoom, pan, properties as text (the read-only field components).
|
||||
Notice under the header: « Une copie locale temporaire de ce brouillon existe dans cet onglet (révision R,
|
||||
<heure>). Elle n'est pas enregistrée sur le serveur. Choisissez avant de modifier le brouillon. » (+ « Elle est
|
||||
basée sur la révision R ; le serveur est à la révision M. » when R < M) with « Restaurer la copie » and
|
||||
« Ignorer la copie ».
|
||||
- « Restaurer la copie »: `recovery = restoring` (both buttons disabled) while the copy's document goes through
|
||||
the core (`replaceDocument` + `preview.state`) and the copy's drawings the page does not hold are downloaded
|
||||
(`downloadSheetDrawing`) and added (`addDrawing`; a failed one becomes that drawing's state); the continuation
|
||||
checks the session token and that `recovery` is still `restoring`, then applies the result in ONE store update
|
||||
(`documentText`, `savedRevision = R`, `staleBase`, unsaved, `recovery = none`) so the synchronous copy
|
||||
subscription never sees a mixed state; `savedText` stays the server text (it drives « unsaved » and submit).
|
||||
Unit test: the copy rewritten after an R < M restore still carries R. The expected revision stays the
|
||||
copy's base R (`savedRevision = R`), never converted to the server's M; when R < M the store flag `staleBase`
|
||||
is set, so the first save meets `draft_conflict` and its dialog (author and time when known) and needs the
|
||||
« Garder ma version » confirmation; « Annuler les modifications » with `staleBase` takes the « Recharger » path
|
||||
(server text and revision M). A copy the core refuses (or that traps) is reported (« La copie locale ne passe
|
||||
pas le contrôle du document : <kind>. Elle est conservée. »), kept, never applied, never re-read automatically
|
||||
(LRN-058): `recovery = refused`, « Restaurer la copie » disabled, editing stays blocked until « Ignorer la
|
||||
copie ».
|
||||
- « Ignorer la copie »: a confirmation « Abandonner la copie locale non enregistrée (révision R, <heure>) ? Elle
|
||||
sera supprimée de cet onglet. » with « Abandonner la copie » / « Annuler »; confirmed → copy removed,
|
||||
`recovery = none`, editing resumes from the server version.
|
||||
- Conflict read checks (re-check G): N is used only when `draft_version.version_id` is the edited version, else
|
||||
the failed-read variant. A `draft_conflict` answered by `submit_sheet_review` opens the same dialog and never
|
||||
re-submits automatically; submit is refused while `staleBase` is set (hint « Enregistrez le brouillon avant de
|
||||
le soumettre. »).
|
||||
- The offer shows only in edit mode or `narrow`. In a mode that cannot save (`rights`, `frozen`, `historical`,
|
||||
`inactive`) the copy is left untouched (never offered, written or removed) and the mode notice adds « Une copie
|
||||
locale non enregistrée de ce brouillon existe dans cet onglet ; elle ne peut pas être utilisée dans cet état. »
|
||||
- Cap and quota: at most two copies of OTHER versions of the account are kept beside the current one; nothing is
|
||||
ever evicted automatically (every stored copy is pending or live; resolved copies are removed at resolution).
|
||||
When writing the current copy is impossible because the cap is reached, or `writeOrRemove` fails (quota), the
|
||||
write flag is false and a notice lists the account's other copies (« <sheet_name> · révision R · <heure> »,
|
||||
each with « Ouvrir ce brouillon » and « Abandonner cette copie », the latter confirmed as above); after an
|
||||
abandonment the current copy is written again at once. Copies of another account are never listed, offered or
|
||||
removed. Unit tests: cap reached (third version refused, both others kept), quota exceeded (`setItem` throws),
|
||||
a pending copy kept through commit, undo, redo and save attempts, removal cases, another account's copies
|
||||
untouched, abandon then retry.
|
||||
- Header status: failure variants only (board 04 keeps « Révision N · modifications non enregistrées »):
|
||||
« Copie locale impossible (stockage plein) » and « Copie locale impossible : deux autres brouillons ont déjà une
|
||||
copie dans cet onglet ». Every message that promises kept work reads the real write flag and says the copy is
|
||||
temporary and limited to this tab: session or MFA lost (`session_expired`, `rights.mfa`) and an unsaveable draft
|
||||
(`draft.frozen`, `sheet.inactive`, `rights.capability`) say « une copie locale temporaire existe dans cet onglet »
|
||||
only when the last write succeeded, otherwise that the unsaved changes cannot be kept.
|
||||
- Leave guard (`useLeaveGuard`) armed while unsaved or while a recovery offer is not answered (`recovery` ≠ `none`),
|
||||
disarmed as soon as both are off (a confirmed save, an explicit abandonment); never kept armed otherwise. Its
|
||||
limits are written in the owner trial guide and BROWSER_TESTS.md (owner 2026-11-04): `beforeunload` is not
|
||||
reliable on mobile browsers (iOS Safari, a tab killed in the background) and its text is the browser's own; the
|
||||
sessionStorage copy is the only fallback there and dies with the tab.
|
||||
|
||||
### Upload (§9.2-§9.3)
|
||||
- File input (`.svg`, `image/svg+xml`), size ≤ 2 MiB checked before reading; bytes → `clean_svg`. `rejected` →
|
||||
message per reason, nothing else. `cleanable` → dialog with the core-composed cleaned drawing, the removed names
|
||||
(the `<style>` element named when `style_removed`), « Nettoyer et utiliser cette version » / « Annuler ».
|
||||
`clean` → no dialog.
|
||||
- Then: `register_sheet_asset(sheet_id, sha256, byte_size, file_name)` with the core's sha256 and size of
|
||||
`stored`; read the row (`listSheetAssets(sheetId)`: id, sha256, byte_size, uploaded_at); if `uploaded_at` is set,
|
||||
nothing is uploaded or confirmed (§9.3 step 2); if pending, upload `stored` at `<sha256>.svg` (`image/svg+xml`,
|
||||
no upsert): ok → confirm; already present (HTTP 409, or 400 with `statusCode` "409") → confirm; refused by the
|
||||
policy (403, or 400 with `statusCode` "403": a pending row registered by another account) → `confirm` once (the
|
||||
other account's object may already be there); `upload_missing` then → closed code `upload.pending_other`; then `confirm_sheet_asset_upload(asset_id)` (`upload_missing`, `size_mismatch`). Then the
|
||||
stored object is downloaded and added with `addDrawing`: `drawing_hash_mismatch` → `object_conflict`; `caps` →
|
||||
its message. Then the view the upload started from gets the drawing (`update` view with `svg_asset_id`).
|
||||
- Codes with FR/EN messages: `size_mismatch`, `hash_mismatch`, `svg_rejected` with the reason, `svg_active_content`,
|
||||
`svg_not_canonical`, `too_large`, `upload_missing`, `object_conflict`, `upload.pending_other`, `caps`, and the
|
||||
server kinds through `failureMessage` (allowlist extended).
|
||||
|
||||
### Modes, permissions, layout
|
||||
- Edit mode needs, as a display rule only: an active `sheet_editor` own grant AND the admin or owner platform role
|
||||
(`grant_active` needs both), a viewport ≥ 1 024 px, no freezing round, not the historical sheet, an active sheet.
|
||||
Otherwise read-only with the reason's notice: `narrow` (board 05: badge « Lecture seule » with the lock icon,
|
||||
notice title alone « L'édition nécessite une largeur d'écran d'au moins 1 024 px. », L15), `rights`, `frozen`
|
||||
(« Revue n° N · vérification en cours » for `verifying`, the round status label otherwise, link to the
|
||||
overview), `historical`, `inactive`. Unsaved work in memory survives a switch to narrow and back.
|
||||
- Permission states on the route (BDR-099 order): own grants `loading` → waiting; a `rights.*` answer from the admin
|
||||
read → « Accès non autorisé »; own grants `failed` → `PermissionsUnavailable` with « Réessayer »; `not_found` →
|
||||
`SheetNotFound` (exported from `AdminSheetRoute.tsx`); no draft → notice + link to the overview.
|
||||
- Tabs: wide, all seven (board 04); narrow (board 05), static lists: 640 to 1 023 px « Général, Annotations,
|
||||
Constats, Vérification » + « Plus »; below 640 px « Annotations, Vérification » + « Plus »; « Plus » is a
|
||||
disclosure (`aria-expanded`) listing the others; no width measurement.
|
||||
- Layout: `AppLayout` drops `max-w-4xl` for `/app/admin/sheets/:sheetId/draft` (`matchPath`). From 1 280 px board
|
||||
04's three columns; from 1 024 to 1 279 px the properties card goes under the canvas (tools + canvas columns),
|
||||
the tab row scrolls within itself and the header wraps; no page horizontal scroll at 1 024 px.
|
||||
- Links: the overview shows « Ouvrir le brouillon » (edit possible) or « Consulter le brouillon » when a draft
|
||||
exists; A1 creation and W1 working copy navigate to `/app/admin/sheets/<id>/draft`.
|
||||
|
||||
### i18n
|
||||
- Keys `editor.*` in fr.ts and en.ts (parity tests); ratified wordings verbatim (REVUE.md, contract §17.9, §17.11,
|
||||
L15); every new label listed in `.claude/audits/2026-11-03-v1-2-6-label-proposals.md` for the owner's separate
|
||||
review, none declared approved.
|
||||
|
||||
## Lots
|
||||
|
||||
| Lot | Content | Criteria | Checks |
|
||||
|---|---|---|---|
|
||||
| A | M8 `supabase/migrations/20261103100000_sheet_draft_last_save.sql`: redefines `public.get_official_sheet_admin` only (the list and the summary helper untouched) adding `draft_last_save` = `{revision, saved_at, saved_by: private.sheet_admin_person(actor)}` from the newest `audit.audit_logs` row with `resource_type = 'anatomical_sheet_version'`, `resource_id` = the draft, `action = 'anatomical_sheet_version.saved'`, `metadata->>'revision'` = the draft's revision, else null; body otherwise identical to M7; privileges restated as M7 has them. pgTAP `supabase/tests/023_sheet_draft_last_save.sql`: null on a fresh draft, actor and time after a save, the second editor after a second save, null after a non-save content write, same refusals as M7, no new privilege. `packages/supabase` schema `draft_last_save` (nullable). Sandbox fresh + upgrade from M7; `db:types --check`. Contract §12.3 and §16.7 amended (read migration, owner 2026-11-03) | C12, C18 | PGlite, `db:sandbox test-db`, types |
|
||||
| B | `packages/supabase/src/sheets.ts`: `registerSheetAsset`, `listSheetAssets(sheetId)`, `uploadSheetDrawing` (→ `'uploaded' \| 'present'`, `upload.pending_other` on a policy refusal, Storage errors read on HTTP status and body `statusCode`, checked against the installed storage-js error type), `confirmSheetAssetUpload`, `parseSaveAnswer`; new kind `upload.pending_other`; exports; unit tests; sandbox test `packages/supabase/tests/sandbox/sheet-editor-assets.sandbox.ts` with bytes unique per run (pattern of `sheet-fixtures.ts`): register, upload, confirm, row read, second register of a confirmed hash (no upload), second editor on a pending row (`upload.pending_other` with its own statusCode) | C6 | unit, sandbox |
|
||||
| C | `CataloguePreview` extension (mutators, kept input on ok only, accepted drawings only); `editor/core/editOps.ts`, `cleaning.ts`, `editor/ids.ts`, `sameDocument`; `CatalogueCanvas` exports `buildView`; `useFraming` option `canPan`; unit tests on the Node core: rebuild after a forced generation change keeps the replaced text and the added drawing, a refused text is not kept, a bad drawing refused alone, the cleaning preview's scope | C2, C3, C15, C17 | unit |
|
||||
| D | `editor/state/editorStore.ts`, `undo.ts`, `recovery.ts`, `editor/issues.ts`; `persistence.ts` exports `writeOrRemove`; unit tests: session token drops late answers, commit, refusal unchanged, undo bound, redo cleared, save with commits in flight (sent text kept), save unchanged, conflict paths (reload clears stacks, keep mine with confirmation), recovery write flag, removal cases (none on undo back to saved), restore round trip through the core, older-revision restore keeps R and `staleBase`, pending offer refuses commit/undo/redo/save/submit and never writes or removes the copy, refused copy kept and blocking until ignored, ignore needs confirmation, cap and quota with explicit abandonment and no eviction, other account untouched; `commit(command, { accept })` with rollback before anything is kept; `readVersion` draft mode (export, `draft` accepted, `revision`, per-drawing settled results; ruling R1, moved from E); conflict read: N from `draft_version.revision`, author only when `draft_last_save.revision` = N, failed read → no « Garder ma version » | C11-C14, C27-C29 | unit |
|
||||
| E | Route `AdminSheetDraftRoute.tsx`, App.tsx, AppLayout width, header, tabs (wide and narrow), modes and permission states, blocking recovery offer (« Restaurer la copie » / « Ignorer la copie », consultation only while pending), cap/quota notice with the other copies, conflict dialog (known N and author, failed read with « Recharger » / « Réessayer »), leave guard, overview links, A1/W1 landing, shared read-only field components; `failureMessage` allowlist; i18n | C1, C11-C13, C16, C27-C29 | unit |
|
||||
| F | Général (+ annotation categories), Références, Vertèbres; shared delete-with-dependents dialog | C4, C5 | unit |
|
||||
| G | Vues et illustrations + upload flow | C6, C17 | unit |
|
||||
| H | `docs/ANNOTATION-RENDERING.md` overlay section first; Annotations: canvas, overlay, tools, list, creation panel, properties panel (geometry group applied whole, « non appliqué » state), keyboard creation, undo/redo controls; default point rule with the corrected-position confirmation and the `accept` hook on every geometry commit (« Default point and the frame »: measured views only, read-only geometry elsewhere, repair rules) with its Node-core unit tests | C7, C8, C14, C17, C26, C32-C34 | unit |
|
||||
| I | Constats tree | C9 | unit |
|
||||
| J | Vérification panel + submission | C10 | unit |
|
||||
| K | e2e `apps/app/e2e/shell/editor-*.spec.ts` reusing `createAccount`, `assignRole`, `seedGrant`, `enrolVerifiedFactor`, `stepUpAdmin`, `seedOfficialSheet`, `expectAccessible`, `expectNoHorizontalOverflow`, `dropLateReplays`; adds editor-only helpers. A2 (hostile refused, Inkscape export cleaned, attach, detail view by crop; both upload outcomes accepted), A3 (points, zones, links by clicks and by keyboard, move, numeric edits), A4 (zones, categories, nodes, refs, regions, reorder, mark reviewed, delete with dependents), journey (the brief's §3 steps 1-12 with two editor accounts: creation, upload, detail view, points/zones/links, categories and findings, save, reload with the beforeunload dialog accepted and the recovery offer, conflict, submit, round `verifying` read back in SQL, no error shown while elements are `to_confirm`), access (reviewer-only read-only, editor grant without admin role read-only, account without capability refused), narrow (320, 375, 800 px read-only, no horizontal scroll; 1 024 px edit without horizontal scroll), axe on editor and read-only, the equine working copy opening (sets aside an active copy first, as `sheets-concurrency.sandbox.ts` does); owner tests (C30): concurrent save between two sessions, older-copy restore then save → conflict dialog then « Garder ma version » confirmation, a pending recovery offer blocks editing until answered, permission changes during an open editing session (grant revoked, grant expired, admin role removed: the next save is refused with its message, the copy wording true), a click near the edge of a detail crop (corrected position shown, confirmed, cancelled), hostile and valid drawing imports, keyboard-only creation and numeric edits; commit latency measured on the equine copy and on a synthetic document near 2 MiB (reported; budget 500 ms per commit on the equine copy); `docs/development/BROWSER_TESTS.md` | C16, C20, C21, C26-C30 | `e2e:shell` on a fresh sandbox |
|
||||
| L | Owner trial: `scripts/db-sandbox.sh` subcommands `trial` (its own gateway container `faunosteo_dbsandbox_trial_gateway` on its own loopback port, refusing to start when that container exists, + Vite dev server on 127.0.0.1:5193 whose proxy forwards `/auth/v1`, `/rest/v1` and `/storage/v1` to that gateway so the browser stays same-origin (no CORS change), proven by the manual run; foreground, Ctrl+C stops both), `trial-account <email>` (password at a hidden prompt, confirmed account, nothing secret printed), `trial-grant <email> <kind>` (email and kind checked against fixed patterns and passed as psql variables; for `sheet_editor` / `sheet_publisher` also `private.assign_platform_role(null, <id>, 'admin')`, the same SQL as the e2e helpers); `docs/development/V1-2-6_OWNER_TRIAL.md` (commands, URL, account, TOTP enrolment, journey, operations, expected results, the freeze after a submission with no worker and no withdrawal, teardown); label proposals file | C23 | script review, manual run on the sandbox |
|
||||
| M | Gates: fresh sandbox → `test-db` → `e2e:shell` → `test`; `check:all`; `r5:import-equine --check`; fresh verifier + security; docs (contract §16.7 state, TODO, design README pointer); memory (registry ids checked against develop first: LRN-095 and BLK-013 collide, no renumbering in V1-2.6); checkpoint report | C18, C22, C24, C31 | all |
|
||||
|
||||
Dependencies: A, B, C independent; D needs A, C; E needs A, B, D; F-J need E; K needs A-J; L needs E; M last.
|
||||
|
||||
## Edge cases (all lots)
|
||||
|
||||
- Core trap mid-edit: the store keeps `documentText`; the handle rebuilds from its kept input; the canvas shows the
|
||||
engine notice with retry (BDR-054); a command or file that trapped is not retried automatically.
|
||||
- A drawing missing or refused: that view shows its state and the canvas notice; edits continue.
|
||||
- Two tabs on the same draft: each its own copy; the server revision decides (conflict dialog).
|
||||
- A save answer lost (`network`): the next save meets the conflict dialog with the neutral own-account wording.
|
||||
- Permission lost or draft state changed during an open session (grant revoked or expired, admin role removed,
|
||||
session or aal2 lost, round opened, sheet archived): the server refuses the next write with its kind; the page
|
||||
shows the message (copy wording bound to the write flag), never retries or auto-sends, and switches to the
|
||||
matching read-only mode on `draft.frozen` / `sheet.inactive` / `rights.*`. Residual risk recorded, not fixed
|
||||
(C31): catalogue RPCs check the token's `aal2` claim (`private.has_mfa()`), not the live session, so a token
|
||||
issued at `aal2` keeps passing them after a factor removal until it expires.
|
||||
- Escape in a native dialog closes it (LRN-082); e2e waits for a closed dialog before typing (LRN-111) and accepts
|
||||
the beforeunload dialog before a reload.
|
||||
|
||||
## Disposition of memory (in force)
|
||||
|
||||
Honors BDR-043 (no rule in TS: translation and defaults are UI arithmetic, every check is the core's), BDR-050,
|
||||
BDR-054/055/056 (failure states, honest unsaved wording, restore through the core), BDR-076, BDR-078, BDR-082,
|
||||
BDR-084 (M8 reads through the RPC, no grant widening), BDR-085, BDR-086, BDR-087 (stored form; unique scope for
|
||||
the cleaning preview; one canvas per view in the DOM), BDR-088/090 (Inkscape 1.4.3 fixture), BDR-091/092,
|
||||
BDR-094, BDR-096 (boards followed; deviations listed), BDR-097, BDR-099; LRN-010, -017, -043, -055, -057, -058,
|
||||
-060, -082, -085, -087, -088, -089, -094, -097, -101, -103, -104, -110, -111, -112, -113.
|
||||
|
||||
## Visible choices taken in this plan (for the owner at the validation gate)
|
||||
|
||||
1. Annotation categories edited in the Général tab.
|
||||
2. Creation panels collect the required fields (names FR/EN, laterality with no preselection, category, opened
|
||||
view) before the element exists; no default labels.
|
||||
3. Keyboard creation buttons under the canvas, then numeric fields.
|
||||
4. Read-only notices per reason (rights, frozen, historical, archived) besides board 05's narrow notice.
|
||||
5. From 1 024 to 1 279 px the properties card goes under the canvas.
|
||||
6. Overview links « Ouvrir le brouillon » / « Consulter le brouillon »; A1 and W1 land on the editor (§11.2).
|
||||
7. Owner trial commands `pnpm db:sandbox trial`, `trial-account`, `trial-grant` and the doc
|
||||
`docs/development/V1-2-6_OWNER_TRIAL.md`.
|
||||
8. New closed code `upload.pending_other` (another account's unfinished upload of the same drawing).
|
||||
|
||||
All eight approved by the owner 2026-11-03 (« GO propriétaire V1-2.6 »), with: no JSON export or import of the
|
||||
recovery copy in V1-2.6; exact messages on the copy's state and limits. Owner arbitrations 2026-11-03 on the
|
||||
re-check (« arbitrages propriétaire sur REMAINING(2) »): default point rule with a confirmed correction, never a
|
||||
silent move (C26); editing blocked while a recovery offer is unanswered, actions « Restaurer la copie » /
|
||||
« Ignorer la copie » (C27); no automatic eviction, explicit abandonment on cap or quota (C28); conflict dialog
|
||||
sources and failed-read variant (C29).
|
||||
|
||||
Recorded deviations from board 06 A (owner answer): no « Prévisualiser », no withdrawal before V1-2.7.
|
||||
|
||||
## Challenge record (2026-11-03, three lenses, each CONCERNS(4), no BLOCKER tag)
|
||||
|
||||
Accepted and integrated: simplicity 1-11 (CataloguePreview extended, canvas and framing reused, static narrow
|
||||
tabs, synchronous copy writes, one key per account and version, id retry on `duplicate_key`, recovery drawings in
|
||||
the copy, loader and failure map reused, failure-only copy status, no Ctrl+Y, shared read-only fields, e2e
|
||||
helpers reused); robustness 1-3 and 5-17 (sent text kept on save, session token, drawings added one by one and
|
||||
the stored object re-read, removal cases, no pending write, account in the key, trapping input not kept, edit mode
|
||||
needs the admin role, 16-drawing cap, two-step reload and neutral own-account wording, pointer capture, unique
|
||||
test bytes and working-copy slot, trial gateway and SQL variables, admin role in trial-grant, M8 in
|
||||
`get_official_sheet_admin` only with `resource_type`, 2 MiB latency); correctness 1-14 (confirmed row skips the
|
||||
upload and a policy refusal is named, creation fields, discard removes the copy, deep comparison, saved revision
|
||||
from the version answer, save answer parsed, zones without status, A before D and E, 1 024 px layout, older-copy
|
||||
restore, stacks cleared on reload, one canvas per view, beforeunload in e2e).
|
||||
|
||||
Confirmation pass (one fresh correctness challenger on the revision): FATAL(6) → all 12 integrated: [BLOCKER] an
|
||||
older restored copy saved over a newer revision → `savedRevision` stays the copy's base with `staleBase`, the
|
||||
first save meets the conflict dialog; state failure after replace → rollback, kept input only after `state`;
|
||||
draft `readVersion` per-drawing settled results; `handleVersion` drives canvas rebuilds and the read-only `key`;
|
||||
link tool and « Vue ouverte » limited to direct detail children; default radius 12 + 3 %; drawings keyed by
|
||||
asset id; `draft.unchanged` sets the saved pair; policy refusal tries `confirm` once; trial through a Vite proxy
|
||||
(same origin); dropped loads and `close()` free the preview; recovery offer only where saving is possible. The
|
||||
procedure allows one confirmation pass: these fixes go to the gate unchallenged again. Robustness 4: messages read the
|
||||
write flag (integrated); a downloadable rescue copy (BDR-055 pattern) is a visible choice asked at the gate (owner:
|
||||
no export button in V1-2.6).
|
||||
|
||||
Owner-ordered targeted re-check (fresh verifier, 2026-11-03): REMAINING(2): fixes 1-5 closed, invariants I1-I5
|
||||
hold; [MAJOR] the 12 + 3 % radius made points `out_of_frame` on frames under about 25.5 units → « Default point
|
||||
and the frame » (owner formula, core-decided placement, confirmed correction); [MAJOR] I6 broken, a pending copy
|
||||
overwritten by the first commit → blocking offer, no write while pending; [MINOR] N source on a failed read →
|
||||
conflict dialog sources and failed-read variant; [MINOR] two-copy cap evicting copies → no eviction, explicit
|
||||
abandonment. Second targeted re-check ordered by the owner on these two corrections and their interaction with
|
||||
the five validated invariants.
|
||||
|
||||
Second owner-ordered re-check (fresh verifier, 2026-11-03): REMAINING(1), no BLOCKER; confirmations 2-6 confirmed,
|
||||
I1-I5 hold; confirmation 1 NOT confirmed: [MAJOR] F1 `accept` read the core's silence as acceptance on views the
|
||||
core does not measure (no accepted drawing, no usable frame) → measured views only, tools and numeric geometry
|
||||
disabled elsewhere, `accept` refuses there. MINORs integrated: A (B = floor(d), exact clamp on an empty interval,
|
||||
F parsed from the attribute text), B (kept input and `handleVersion` only after `accept`), C (exact numeric display,
|
||||
4 px drag threshold), D (frame changes under `accept`; edits allowed on an annotation already out, owner approval
|
||||
pending as it refines C26), E (`restoring` state, one store update, `savedText` stays the server's), F (removal
|
||||
actions refused while pending, unreadable copy kept as refused, leave guard while an offer is open), G
|
||||
(`version_id` checked, submit conflict uses the dialog, submit refused under `staleBase`). STOP for the owner.
|
||||
|
||||
Owner GO 2026-11-04 (« GO propriétaire après REMAINING(1) »): F1 fix approved (C32); C26 refined by the owner's
|
||||
seven repair rules (C33: one rule, the changed annotation carries no geometry error after a commit; a typed
|
||||
`too_small` radius is now refused; repair through a temporary form group applied whole; frame changes refused when
|
||||
they give an error-free annotation a geometry error or leave a view with annotations unmeasured); minor effects
|
||||
approved (C34: 4 px threshold with click, keyboard and touch kept, unreadable copy with the loss named, leave
|
||||
guard disarmed after a confirmed save or an explicit abandonment, mobile limits documented). Execution of lots A-M
|
||||
authorised without a third plan review; stop and present any blocking defect or contractual impossibility.
|
||||
@@ -0,0 +1,253 @@
|
||||
# V1-2.6 execution ledger (tracked, resume source)
|
||||
|
||||
Plan `.claude/tasks/plans/2026-11-03-v1-2-6-editor.md`, contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md`
|
||||
(C1-C34). Worktree `/home/bchanot/Documents/faunosteo-v1-2` (durable, owner 2026-11-04; the former one under a session
|
||||
scratchpad was removed by the harness cleanup at 13:08, LRN-114). Branch `feature/v1-2-anatomical-sheets`. Sandbox
|
||||
only. This file holds every ruling, finding and checkpoint needed to resume; the git-ignored SDD workspace
|
||||
(`.superpowers/sdd/2026-11-03-v1-2-6-editor/`) holds drafts only. Updated and pushed after each validated lot.
|
||||
|
||||
## Lots
|
||||
|
||||
| Lot | Commits | Review | State |
|
||||
|---|---|---|---|
|
||||
| A M8 `draft_last_save` | 2f824a9 | clean | done (sandbox fresh 1992 + upgrade from M7, types --check) |
|
||||
| B sheet asset accessors | f7e7bf4 | clean | done (sandbox 2/2 twice; refusal observed HTTP 400 + statusCode "403") |
|
||||
| C preview mutators, edit ops, ids | 173be59, bc43a1b, cfd49c7 | clean after 2 fix rounds | done |
|
||||
| D store, undo, recovery, issues | 7f1d440, b14509f | clean after 1 fix round | done |
|
||||
| E route, modes, offer, conflict | 6aba971 | clean | done |
|
||||
| F Général, Références, Vertèbres | d163b2c | clean | done |
|
||||
| G views + upload | 8343528, 1bbf97e, 7ea9619 | clean after the redone fix rounds (G1 closed codes, G3 hash at load, G2 split) | done |
|
||||
| H Annotations | 2609785, 3f15762 | clean after 1 fix round (owner rules O1-O6 hold, H1-H8 addressed) | done |
|
||||
| I Constats | 92c595c, 91d06c9 | clean after 1 fix round (C9 description, vet referral, citations; keyboard focus) | done |
|
||||
| J Vérification + submit | 447d0a4, 4f223e0, 3d589e1 | clean after 2 fix rounds (« Aller à » selects the element, consumed once) | done |
|
||||
| L owner trial tooling + guide | ac5fbfb | clean (security checks all hold); 3 minors for the guide fix with K's findings | done |
|
||||
| K e2e (fresh sandbox: test-db 1992; e2e-shell final 147 passed / 45 skipped 375 px / 0 failed) | 5097fd7, bb99edd, 4cc27a8 | clean after 2 fix rounds (I1-I4, M1/M3/M4/M5/M8; species loss = spec resolving the list filter « Espèce », not a product defect) | done |
|
||||
| M gates | 071b58a..7a4ce9e | 3 fresh verifier passes (last: 33/34 MET, C22 order fixed and re-run); final opus review With fixes (I1, I2, m1, m2, m5 fixed, re-review Approved); security PASS on 7a4ce9e | done: on 7a4ce9e, one fresh sandbox test-db 1992 → e2e-shell 148 passed / 46 skipped / 0 failed → db:sandbox test 105 passed / 10 skipped → down; check:all green (unit 66/159/1033, e2e:ui); r5:import-equine --check 0 differences |
|
||||
|
||||
## Rulings (orchestrator, each with its cost if wrong)
|
||||
|
||||
- R1 `readVersion` draft mode moved from Lot E to Lot D (D's `open()` consumes it). Cost: one lot boundary moved.
|
||||
- R2 the `accept` hook lives in `CataloguePreview.replaceDocument(text, accept?)` so the rollback is in one place.
|
||||
Cost: one signature to move.
|
||||
- R3 a lot's review may run in parallel with the next lot's implementation when their files are disjoint. Cost: a
|
||||
fix round sees a partial tree in typecheck; commits use explicit paths.
|
||||
- R4 the store refuses `submit` while unsaved (closed kind `unsaved`) besides `stale_base`; the UI mirrors it.
|
||||
Cost: one extra refusal kind.
|
||||
- R5 Lot E dispatched while Lot D's re-review ran (E never edits store files). Cost: E adapts to a later store fix.
|
||||
- R6 mode precedence rights > inactive > historical > frozen > narrow (strongest server-side reason first, display
|
||||
reason last). Cost: notice order only; listed at the checkpoint.
|
||||
- R7 a detail view's parent change goes through the geometry `accept` (it changes the inherited drawing, owner
|
||||
rule 7); the button « Utiliser l'illustration de la vue parente » (drop an own drawing back to a crop) kept as a
|
||||
label proposal and a visible choice for the checkpoint. Cost: a refused parent change; one button removed.
|
||||
- R8 locals limit: one destructuring declaration (`const [x, setX] = useState()`, `const {a, b} = form`) counts as
|
||||
one local, the reading every earlier lot was reviewed under; `useCropGroup` (5) and `useCropDraft` (4) pass.
|
||||
Cost if wrong: a cosmetic split of two hooks.
|
||||
- R9 Constats: a finding category's kind is creation-only (C9 lists no kind edit). Cost: one select added later.
|
||||
- R10 undo/redo shortcuts editor-wide (plan « Store and sessions »), writable mode only, ignored under an open modal
|
||||
dialog. Cost: shortcut scope only.
|
||||
- R11 « Aller à … » selects the element through a focus request on `EditorTabProps` (`{key, serial}`), each tab
|
||||
seeding its own selection. Cost: one prop on every tab.
|
||||
- R12 the 10 store files reformatted by a subagent's Prettier run (format only, uncommitted) are neither committed
|
||||
nor reverted by the orchestrator: the subagent's `git checkout` was refused by the permission classifier and the
|
||||
orchestrator does not run a refused action on its behalf; the owner decides (revert or keep). Every commit uses
|
||||
explicit paths meanwhile.
|
||||
- R13 an editor grant without the admin role sees « Fiche introuvable », not a read-only draft: the route sits
|
||||
under `RequireAdmin` (contract C1); the K brief's read-only expectation was wrong. Cost: none (contract text).
|
||||
- R14 Lot K touch fix: `touch-action: none` while a movable annotation is selected (the browser reads it at
|
||||
touchstart; a touch drag was cancelled as a pan). Visible side effect: no touch scroll of the canvas while a
|
||||
movable annotation is selected; listed at the checkpoint. Cost: one CSS condition.
|
||||
- R15 the findings-tree crash on the equine copy (stored nodes omit serde-defaulted fields) is fixed at the root:
|
||||
the loader keeps the core's defaults-filled `PreviewState.document` as `documentText`/`savedText`; K's
|
||||
TypeScript mirror of the defaults in `tree.ts` (BDR-043 breach) is removed. `editorLoad.ts` hunks are staged on
|
||||
the committed version, the R12 format changes stay uncommitted. Cost: one load path.
|
||||
- R16 `docs/design/v1-2-4/REVUE.md` (approved dossier, holds SHA-256 of the boards) is not edited; the V1-2.6
|
||||
pointer lives in `docs/design/README.md`. Cost: one extra pointer line.
|
||||
- R17 contract C25 binds over the plan's quoted copy wordings (« … Elle est conservée. », copy_kept): every copy
|
||||
message names « temporary, this tab, not saved on the server »; the refused-copy notice keeps the offer text and
|
||||
adds the refusal; new wordings are proposals. Cost: wording only.
|
||||
- R18 the 375 px `test.skip` of editing specs stands (C16: editing ≥ 1 024 px; read-only phone coverage in
|
||||
editor-access); the verifier's floor flags them, no CLARIFICATION needed. Cost: none.
|
||||
- Promoted minors (same invariant as an Important finding): C non-trap `internal` taken as a trap (now detected by
|
||||
runtime generation/status); D `discardChanges` busy guard and late `readConflict` write after dismiss.
|
||||
|
||||
## Open findings to carry
|
||||
|
||||
- Lot G fixes DONE (1bbf97e, 7ea9619): G3 root cause — the store already recorded `drawing_hash_mismatch` in
|
||||
`drawingFailures`; `drawingStatusOf` read the core's `missing` entry first. `issues.ts` gained the refusal reason
|
||||
`drawing_rejected` (+ optional `drawingDetail`) for attaching a drawing the core holds as rejected; `geometryAccept`
|
||||
unchanged. `svg_not_canonical` is unreachable through the page's own upload (it uploads its cleaned form); covered by
|
||||
attaching a held non-canonical drawing.
|
||||
- Lot H design notes from the lost attempt (NOT implemented, NOT tested; to be rebuilt): proposal arithmetic in
|
||||
`editor/annotations/frame.ts` (F from the `viewBox` text with `Number`, r0 floored to 0.01, candidates A/B/C, C by
|
||||
an inward-rounded per-axis clamp with the exact clamp on an empty interval); every geometry commit through
|
||||
`commit(cmd, { accept: geometryAccept({ before: previewState, changedIds: [id] }) })`; `correctionFor` offers C on
|
||||
an `out_of_frame` refusal or a refused radius under r0; one geometry-group component for the pending creation and
|
||||
the properties panel; read-only reuses `CatalogueCanvas` with `key={handleVersion}`; select and place on `click`,
|
||||
drag move after 4 CSS px; `canPan` false on a selected marker or while a drawing tool is active. Implementer's own
|
||||
additions to judge: zone and link clicks outside F get the same hint as points; « Remplacer par un polygone »
|
||||
commits on close under `accept`, a refusal drops the tracing.
|
||||
|
||||
## Deferred minors (for the final review's triage)
|
||||
|
||||
- A: M8 header comment « Null when the draft has no draft »; 023 lacks a save with a null actor; 023 non-save write
|
||||
relies on the revision trigger (asserted).
|
||||
- B: doc line 101 chars in sheets.ts; test lines > 100 chars; `classifyUploadError` duplicates 3 branches of
|
||||
`classifyDrawingError`; `storageCode()` "undefined" fallback.
|
||||
- C: `canPan` ref set during render; unrelated Prettier re-wrap in useFraming.ts; tests lack re-add-replaces-bytes
|
||||
after rebuild and a 16-entry map assertion; cleaning test IIFE builder; private `handle` cast in a test; local
|
||||
`document` shadows the DOM global.
|
||||
- D: `keepMine` checks conflict before the recovery block (unreachable); `finishRestore` drops a failed copy
|
||||
drawing from the held list; `geometryErrorsById` superset of the four codes (accepted); `setCanEdit` without a
|
||||
`restoring` guard (no loss); true→false→true with unsaved work untested.
|
||||
- E: `otherCopies.ts` re-parses copies on render (add `sheetId` to `StoredCopyInfo`); leave guard under recovery
|
||||
alone untested at page level; conflict `reading` state has no Annuler (Escape to confirm in e2e).
|
||||
- F: digits-only count check overlaps the core's unsigned rule (shape check); `duplicate_key` retry and
|
||||
DeleteDialog failure branch untested; RangeEditor `setState` during render; repeated row labels; long citation
|
||||
titles.
|
||||
- G: `issues.ts` Prettier noise on Lot D lines; frame-refusal test lacks the `other` / `removal` fallbacks; no session check between register/list/upload/confirm (idempotent); UI state set after an await without the
|
||||
session check; `parseBox` accepts `1e3` / `0x10` (the core decides).
|
||||
|
||||
- I: no tree type-ahead; expansion seeded once (a restore bringing new zones leaves them collapsed); add-category
|
||||
with a node selected lands at zone level without a hint; `Citations` long JSX; `currentItems()` swallows a parse
|
||||
error.
|
||||
|
||||
- H: `pendingForClick` (creation.ts:161) 7 locals; ToolColumn, CreationFields, CreationPanel, ToolButton long JSX
|
||||
(markup); per-click 1000×30 / 4000×200 tests assert invariants, not each verdict; 1000×30 keyboard case skips
|
||||
silently; `useUndoShortcuts` uses `dialog[open]` (not `:modal`), ignores neither `defaultPrevented` nor `repeat`;
|
||||
stale `built.failure` notice for one build after a view switch; `proposedRadius` kept on a cx/cy-only edit.
|
||||
- E (found at H re-review): `DraftEditor` 13 locals and `AdminSheetDraftRoute` 10 locals (limits breach).
|
||||
|
||||
- J: focus serial restarts at 1 after a clear (latent: a same-instance self « go to » would be skipped; a
|
||||
monotonic route counter removes it); `focusRow` global querySelectorAll by JSON key; issue codes a hand-kept
|
||||
mirror of the core's 26 codes (complete today).
|
||||
|
||||
- K: M2 accepted (a recovery copy written before R15 holds raw text: one extra recovery offer, answered once; no
|
||||
editor in use outside this branch); M6 pointer capture not exercised in a real browser; M7 journey test body
|
||||
~140 lines and 6 lines > 100 chars; M9 French literals in the journey spec; e2e support `browser.ts` untouched
|
||||
(a stray Prettier reformat was verified format-only and restored).
|
||||
- L (folded into bb99edd except the two script items below): trial.config.ts checks hostname only (add `protocol === 'http:'`);
|
||||
guide hard-codes the worktree path (say « racine du dépôt »); step 4.3.1 paraphrases the no-category hint (quote
|
||||
« Créez d'abord une catégorie d'annotation (onglet Général). » and name « Nouvelle catégorie » / « Ajouter la
|
||||
catégorie »); unknown email gives a raw `\gset` error; `trial-account` not idempotent.
|
||||
|
||||
- K: latency (headless Chromium, n=16, median/p95/max ms, handler end): equine rename 38/42/55, add category
|
||||
45/49/49, geometry edit 46/54/61; synthetic 1 803 038 B rename 100/117/222, add category 105/111/112; second
|
||||
animation frame up to 133 (equine) and 331 (synthetic). Budget 500 ms met. Expect timeout raised to 10 s (8
|
||||
workers on one stack); `e2e/support/warm-up.ts` global setup absorbs Vite's first dependency reload.
|
||||
|
||||
- Final review (opus, 2571978..0764eb1): no Critical; I1 (undo shortcuts active in narrow read-only), I2
|
||||
(`downloadAndHold` store write without the session check), m1 (post-submit edit window), m2 (restore keeps raw
|
||||
copy text, R15), m5 (staleBase with nothing unsaved is a dead end) taken in Lot M fix round 3. Kept for before
|
||||
the V1-2 merge: m4 per-commit copy bookkeeping cost (each other copy parsed twice), m6 conflict dialog after a
|
||||
`rights.*` refusal of « Garder ma version », m7 `issues.ts` `drawingAssetOf` mirrors the core's
|
||||
`asset_id_of_view` (BDR-043: needs a core op, crates out of scope in V1-2.6), m8 React component locals
|
||||
(DraftEditor 13, AdminSheetDraftRoute 10, DraftHeader ~11, `pendingForClick` 7), m10 M8 header comment
|
||||
« Null when the draft has no draft » (migrations frozen in this step). Every ledger deferred minor triaged
|
||||
« keep » except L trial.config / path / 4.3.1 (done). Second verifier pass: C19 marker wordings, C25 two header
|
||||
copy strings, C22 final-HEAD check:all + security, floor waivers on the 375 px skips: fix round 3.
|
||||
|
||||
- Final gates. My first two chains ran `pnpm test:run` as the third step; the contract's `test` is
|
||||
`pnpm db:sandbox test` on the same fresh stack after `e2e:shell` (LRN-113), caught by the third fresh verifier
|
||||
(C22 NOT MET, 32/34 MET otherwise). Re-run in the exact order on 697cefa. Security gate on 5bd1226: PASS, LOWs:
|
||||
trial dev server not pinned to loopback in its own config (fixed 697cefa), Vite inherits PGPASSWORD in
|
||||
`cmd_trial` (kept: never exposed to the browser; `env -u PGPASSWORD` before the merge), template SQL in e2e
|
||||
helpers against the throwaway sandbox (kept, same idiom as the existing sandbox suites). Verifier note fixed:
|
||||
EN hints named the tab « Views and illustrations » (3831a49).
|
||||
|
||||
- Security gate on 7a4ce9e: PASS; new LOWs kept for before the merge: the trial nginx gateway answers any Host
|
||||
(DNS rebinding could reach the throwaway sandbox during a trial; `server_name` + default 444), `secondSession`
|
||||
aborts refused requests without failing the test, the recovery copy survives an explicit sign-out (owner
|
||||
question below). One e2e setup failure (`editor fixture: no aal2`, TOTP verify) seen once on 697cefa, not
|
||||
reproduced; step guard added to the shared helper (2b10471), failure messages now carry status + GoTrue code.
|
||||
|
||||
## Questions for the owner at the checkpoint (not decided)
|
||||
|
||||
- The 10 format-only uncommitted changes under `apps/app/src/editor/state/` (R12): revert (`git checkout -- apps/app/src/editor/state`) or keep.
|
||||
- « 1 erreurs bloquantes »: ratified wording kept; a singular form needs the owner.
|
||||
|
||||
- Trim leading/trailing spaces of typed values before sending (Lot F review: visible choice).
|
||||
- R6 mode precedence, R7 « Utiliser l'illustration de la vue parente », default tab Annotations (boards 04/05).
|
||||
- m3: attaching a drawing to an unmeasured view that already holds annotations is refused as « newly invalid »
|
||||
when they fall outside the new frame, and geometry on an unmeasured view is locked (C32): the only way out is
|
||||
deleting those annotations. Keep the rule, or allow repair after attach?
|
||||
- Findings: adding a category with a node selected lands at zone level without a hint (visible behaviour).
|
||||
- The local copy survives an explicit sign-out in the same tab (sessionStorage): drop the account's copies at
|
||||
sign-out, or keep them (current design: a copy is removed only on an explicit outcome)?
|
||||
- Every new label stays a proposal (`.claude/audits/2026-11-03-v1-2-6-label-proposals.md`).
|
||||
|
||||
## Lot N — owner checkpoint decisions (brief « Checkpoint V1-2.6 : décisions finales du propriétaire », 2026-11-04)
|
||||
|
||||
Contract criteria 35-44. Arbitration 1 done by the orchestrator (diff kept in the git-ignored SDD workspace
|
||||
`r12/r12-format.diff`, sha256 3593183c…, plus the session scratchpad; 10/10 files equal to HEAD after Prettier on
|
||||
both sides; restored with `git restore`). Memories LRN-115, LRN-116, LRN-117 (observation, strict control only),
|
||||
EVAL-042 (67480b2). Arbitration 4 already holds (mode.ts:57-69 rights > inactive > historical > frozen > narrow;
|
||||
server refusals demote only from `edit`): no change. Arbitration 10: proposals file only.
|
||||
|
||||
| Lot | Scope | State |
|
||||
|---|---|---|
|
||||
| N1 | plurals (36), trimming (37), parent illustration confirmation (39), default tab (40), category destination hint (42) | be4f468; review spec ✅ Approved; Important (stale category fallback key) carried to N3; `editor.draft_rebased` is the local tool, out of the editor scope; core `reconfirm_redrawn_views` (edit.rs:842) backs the dialog text |
|
||||
| N2 | sign-out confirmation and copy purge; purge of other accounts' copies on a different-account sign-in (43) | bd4ba33; review spec ✅ Approved (store cannot hold another account at click: route closes it; purge before sign-out, after confirmation); minor: confirm button not `variant="danger"` unlike the leave dialog (align in N4); the implementer's chained `pkill` + `db:sandbox down` was refused by the permission system: not re-run by the orchestrator, surfaced to the owner, 5 sandbox containers left up |
|
||||
| N3 | repair on attach to an unmeasured view: temporary repair dialog, one atomic commit validated by the core (41) | 3776a33, 9c21fd3, 46fd861; opus review Changes requested (locals, pending drafts, dialog wording) then re-reviews Approved; no Rust op (R23); owner question: a free path is only replaceable by a small triangle at the frame centre (shape lost) |
|
||||
| N4 | guide (086d6e9, c5fd3c3), trial commands run from the worktree, gates | done: on 5e0aa62 fresh sandbox test-db 1992 → e2e-shell 150 passed / 48 skipped / 0 failed → db:sandbox test 105/10 → down; check:all green (66/159/1083, e2e:ui); r5 check 0 diff. Verifier on 6471b25: 43/44 (C37: submission note trimmed since lot J) → fixed 5e0aa62 with the sign-out purge race (second purge after sign-out); security PASS full range + scoped |
|
||||
|
||||
- R19 default tab: Annotations when at least one view is measurable (`unmeasuredViews` complement), Général
|
||||
otherwise; this also covers an existing sheet with no measurable view (the brief names two cases only; Général
|
||||
keeps one rule for « nothing to annotate yet »). No « new » flag exists. Cost: one condition.
|
||||
- R20 findings « root »: the core accepts a finding category only under a zone (`insert_top` refuses it), so the
|
||||
root a category can have is the zone level; « Ajouter une catégorie » already inserts there whatever the
|
||||
selection; N1 adds the destination zone to the form, « Ajouter un constat » stays the explicit child insert.
|
||||
Cost: wording only.
|
||||
- R21 plurals: one editor helper on `Intl.PluralRules(locale)` with `_one` / `_other` keys (French 0 and 1 are
|
||||
singular); V1-1 call sites keep their ternaries (not reopened). Cost: a helper.
|
||||
- R22 trimming: opt-in on the fields that commit names and simple labels (sheet, categories, views, annotations,
|
||||
regions, finding zones/categories/nodes, authors, licence) and their creation forms; never on descriptions,
|
||||
notes, citations, URL, DOI, colours, SVG. Cost: one prop.
|
||||
- R23 arbitration 7 without a Rust op: `sheet.edit` is pure text→text; the attach and the repairs are chained on a
|
||||
scratch text and committed once through `preview.replaceDocument(text, accept)` (one undo entry); the core
|
||||
judges the end state. Cost: one store action.
|
||||
- Trial commands verified 2026-11-04 from the durable worktree: account, grants, rerun, unknown e-mail, `trial`
|
||||
(/login 200, proxied /auth/v1/health 200, password sign-in through the proxy 200), sockets on 127.0.0.1 only.
|
||||
One `up fresh` right after a `down` failed on « 127.0.0.1:57432 address already in use » (rootless Docker port
|
||||
release lag): `down` + `up fresh` recovered; guide §5 says so.
|
||||
- Residual LOW (security, unproven): an upload resolving after the second purge and before the editor store
|
||||
closes could rewrite the departing account's own copy in its own tab (purged at the next other-account sign-in
|
||||
or tab close). Before the merge: gate `syncCopy` on the auth user matching `state.userId`.
|
||||
- R24 involuntary session end: copies stay keyed to their user (offered again only to that user); when a
|
||||
different account signs in within the tab, the other accounts' copies are purged (never exposed). Cost: a lost
|
||||
copy if another person signs in on that tab.
|
||||
|
||||
## Verification state at the owner-trial checkpoint (2026-11-04)
|
||||
Fresh verifiers, combined: 6471b25 pass → 1-36 and 38-44 MET in code, 37 NOT MET (fixed 5e0aa62); 6f0fa41 pass →
|
||||
37 and 43 MET, 1-19, 24-29, 31-33, 35-44 hold, 20/21/22/30 not observable to it; raw-log pass on the 5e0aa62 run →
|
||||
20, 21, 22 (sandbox + check:all), 30 CONFORME. Security: full range PASS (6471b25), scoped PASS (5e0aa62). Open:
|
||||
23 and 34 only for the checkpoint report itself. Verifier notes kept: 8 of the 48 e2e skips are pre-existing
|
||||
admin.spec 375 px journeys; the keyboard spec focuses programmatically (no Tab walk); the journey's restore checks
|
||||
the unsaved status (editor-recovery:134 proves the value in SQL); FILE SCOPE amended (a09e24d) awaits the owner.
|
||||
|
||||
## Lot O — last owner decisions before the trial (brief « V1-2.6 : derniers arbitrages avant essai propriétaire »)
|
||||
|
||||
Contract criteria 45-48. Owner confirmed R19 (default tab), R20 (category root = first level under a zone, but the
|
||||
action must not depend on the selection: C46), and the FILE SCOPE amendment a09e24d (only files the criteria need).
|
||||
|
||||
| Lot | Scope | State |
|
||||
|---|---|---|
|
||||
| O1 | C45 free paths: drop the triangle conversion, clean refusal, regression test; C46 explicit zone choice | a69eba5 (+2057b0e quotes); review Approved; i18n rebuilt from HEAD by the orchestrator (the agent had reformatted the dictionaries) |
|
||||
| O2 | C47 LAN trial on http://192.168.1.100:5193 (bind, Supabase URL, host check), guide | d74c54e, fb95255 (fs.allow to app sources, no PGPASSWORD); review Approved; LAN journey passed twice by the orchestrator; two agent commands refused by the permission system (probe chain, `rm -rf` in a chain): not re-run by the orchestrator |
|
||||
| O3 | gates, checkpoint report, fresh verifiers, security | done: gates green on 2057b0e; LAN journey re-run after each trial-server change; host filter 5207f87, cors/ws/open-in-editor 8531dd3, upgrade closing 72b742f; security PASS on every range to fe724b2; fresh verifiers: final pass on 70c34bf CONFORME, 0 NOT MET, all 48 criteria hold with the earlier verdicts (security verdicts and raw-log runs as recorded); 9b86f54 fixes the last guide/comment wording after that pass (docs/comment only, not re-verified) |
|
||||
|
||||
- R25 C45: the core stores a free path as an SVG `d` string and exposes no operation that lists or moves its
|
||||
points (`sheet.check`, `sheet.empty`, `sheet.edit`, `sheet.dependents` only). Parsing `d` in TypeScript would be
|
||||
a rival parser (BDR-043, owner clause): O1 refuses the attach cleanly when a free path falls out of the new frame
|
||||
(document unchanged, no triangle) and the minimal core evolution is presented at the checkpoint, not built.
|
||||
- R26 O1 and O2 run in parallel: disjoint files (O1: editor repair/findings/i18n/unit and e2e editor specs; O2:
|
||||
apps/app/vite/trial.config.ts, scripts/db-sandbox.sh, guide). Cost: one conflict if a file overlaps.
|
||||
- R27 C47: only Vite is exposed, on 192.168.1.100:5193; it proxies /auth/v1, /rest/v1, /storage/v1 to the trial
|
||||
gateway kept on 127.0.0.1:57801; the sandbox ports stay on loopback; secrets live in ~/.cache (outside Vite's
|
||||
served root); the LAN browser runs in a non-secure context (plain HTTP), already handled by lib/id.ts as on DEV.
|
||||
|
||||
## Owner-trial checkpoint (2026-11-04, after lot O)
|
||||
Report `.claude/tasks/plans/2026-11-04-v1-2-6-checkpoint.md` (verified at 70c34bf). Pending owner decisions: the
|
||||
core proposal for free-path point correction (`2026-11-04-v1-2-6-path-repair-core-proposal.md`, reopens crates/**);
|
||||
the single-zone preselection in the category form (C46 says « chosen explicitly »: one zone is preselected); the
|
||||
FILE SCOPE line adding apps/app/tests/helpers/** (5a3ed97). Owner-side checks: a real second LAN device, the host
|
||||
firewall rule if needed, removing the trial TOTP entry afterwards. Not validated functionally until the owner's trial.
|
||||
@@ -0,0 +1,89 @@
|
||||
# V1-2.6 checkpoint report: ready for the owner trial (2026-11-04)
|
||||
|
||||
Contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` (criteria 1-48), plan
|
||||
`.claude/tasks/plans/2026-11-03-v1-2-6-editor.md`, resume ledger `.claude/tasks/plans/2026-11-03-v1-2-6-execution.md`.
|
||||
The owner has not tried the editor: V1-2.6 is NOT declared functionally validated.
|
||||
|
||||
## HEAD and commits
|
||||
- Branch `feature/v1-2-anatomical-sheets`, pushed, no merge, working tree clean. HEAD: the commit that adds this file
|
||||
(`git log -1 -- .claude/tasks/plans/2026-11-04-v1-2-6-checkpoint.md`); last application code `2057b0e`, last trial
|
||||
tooling: `git log -1 -- apps/app/vite/trial.config.ts` (the host filter itself is `5207f87`).
|
||||
- Step range `2571978..HEAD`: lots A-M (`2f824a9..7a4ce9e`), lot N owner checkpoint decisions (`be4f468..5e0aa62`),
|
||||
lot O last owner decisions (`a69eba5`, `d74c54e`, `2057b0e`, `fb95255`, `5207f87`, `8531dd3`, `72b742f`, then a
|
||||
comment-and-wording commit on the trial config, the trial script and the guide, the one before this report's last
|
||||
update); docs and `.claude` commits in between.
|
||||
- No file changed under `crates/`, `supabase/seed/`, `apps/app/tests/fixtures/`, `packages/core-wasm/{tests,types}/`
|
||||
in the range; the only migration is M8 `20261103100000_sheet_draft_last_save.sql` (a read). Supabase DEV, its
|
||||
worker and its migrations untouched; no deploy; V1-2.7 not started.
|
||||
|
||||
## Tests (one fresh sandbox, contract order, on `2057b0e`; raw logs kept in the session scratchpad `final-o/`)
|
||||
- `pnpm db:sandbox up fresh` → `pnpm db:sandbox test-db`: Files=21, Tests=1992, PASS.
|
||||
- `pnpm db:sandbox e2e-shell`: 151 passed, 49 skipped, 0 failed (skips: the 375 px project of editing specs, waived
|
||||
for C16, and 8 pre-existing admin journeys at 375 px), including the free-path refusal (`editor-geometry.spec.ts:317`),
|
||||
the attach repair (`:226`), sign-out (`editor-signout.spec.ts`), the full non-equine journey (`editor-journey.spec.ts`).
|
||||
- `pnpm db:sandbox test`: 105 passed, 10 skipped (worker-gated suite, no worker by contract) → `pnpm db:sandbox down`.
|
||||
- `pnpm check:all`: « all checks passed » (unit core-wasm 66, supabase 159, app 1085; e2e:ui passed).
|
||||
- `pnpm r5:import-equine --check`: legacy-import 6 files and draft 12 files, 0 differences (historical documents intact).
|
||||
- LAN trial on `fb95255` (orchestrator): `pnpm db:sandbox trial` → `== trial: http://192.168.1.100:5193`; sockets
|
||||
192.168.1.100:5193 and 127.0.0.1:57801 only; 127.0.0.1:5193 refused; `/@fs` of `.claude`,
|
||||
`.superpowers`, `supabase/seed.sql`, `crates`, the sandbox secrets → 403, `packages` → 200; no `PGPASSWORD` in the
|
||||
Vite environment; the LAN Playwright journey (`apps/app/e2e/playwright.lan.config.ts`: sign-in, TOTP, catalogue,
|
||||
new non-equine sheet, SVG import through cleaning, save, reload, no request leaving the LAN origin) passed; then
|
||||
stopped, `down`, 0 containers, 0 listeners, throwaway password deleted. Not tested: a real second device.
|
||||
- `fb95255` changes only the trial Vite config, the trial command and docs (not used by the automated suites).
|
||||
- Host filter (after the third fresh verifier found that Vite 7's `allowedHosts` lets every IP literal and
|
||||
localhost through): the trial config adds a middleware answering 403 to any Host other than the trial host.
|
||||
Probed on the running trial: `Host: 192.168.1.100:5193` → 200; `10.0.0.1:5193`, `127.0.0.1:5193`,
|
||||
`localhost:5193`, `a.localhost`, `evil.example` → 403, also on the proxied `/auth/v1/health`; the LAN Playwright
|
||||
journey passed again; then stopped, `down`, 0 containers, 0 listeners, password deleted.
|
||||
- Then (fourth fresh verifier and auditor: OPTIONS pre-flights answered by Vite's CORS before any host check, and
|
||||
the hot-reload WebSocket upgrade bypassing the middlewares): the trial sets `cors: false` and `ws: false` and
|
||||
closes `/__open-in-editor`. Probed: OPTIONS with Host localhost or 10.0.0.1 → 403 (trial host → 404, no CORS);
|
||||
WebSocket upgrade → never answered 101 (then closed at once, see below); `/__open-in-editor` and `/__OPEN-IN-EDITOR` → 404; no
|
||||
`Access-Control-Allow-Origin`; /login 200; the LAN journey passed again; stopped, `down`, 0 containers,
|
||||
0 listeners, password deleted. Security of the host-filter commit (`fb95255..671a1bd`): PASS.
|
||||
- Security of `671a1bd..b2941eb` (cors/ws/open-in-editor): PASS, two LOW: an upgrade request was held open by the
|
||||
proxy's upgrade listener (not refused), and the guide's CORS sentence was exact for Vite only (the proxied
|
||||
Supabase routes keep the stack's CORS headers). Both fixed after: every upgrade socket is destroyed at once,
|
||||
`/__open-in-editor` also matched by connect's own route, the guide reworded. Probed on the running trial: an
|
||||
upgrade request (trial host, localhost, /auth/v1/health) gets an empty reply in 0.01 s; `/__open-in-editor` → 404
|
||||
with the trial Host and with an IP-literal Host (a host name gets Vite's own 403 first); OPTIONS with Host
|
||||
10.0.0.1 → 403; evil.example → 403; /login 200; LAN journey passed; stopped, `down`, 0 containers, 0 listeners,
|
||||
password deleted. Security of `b2941eb..fe724b2` (`72b742f`): PASS, both earlier LOWs closed, one LOW on wording
|
||||
(« 403 » for every wrong Host was not exact for `/__open-in-editor` and upgrades), fixed in the comment-and-wording
|
||||
commit, which changes comments and docs only.
|
||||
|
||||
## Audits and reviews
|
||||
- Security (fresh auditor): full range `2571978..25bdac4` PASS (0 blocking); scoped `25bdac4..fb95255` PASS: worktree
|
||||
serving on the LAN closed, PGPASSWORD closed, cleartext LAN traffic re-rated LOW (documented in the guide: trusted
|
||||
network only, the TOTP enrolment key also travels in clear). `/__open-in-editor` closed (8531dd3). Kept LOW: the
|
||||
allow list includes tests and node_modules, the
|
||||
default trial host is the first `hostname -I` address (the guide says how to force 192.168.1.100), template SQL in
|
||||
e2e helpers, trial gateway without a Host check (loopback only), an unproven sign-out copy-rewrite window, AAL2
|
||||
claim after a factor removal (§13, production prerequisite).
|
||||
- Fresh verifiers: criteria 1-36 and 38-44 MET in code at `6471b25`; 37 and 43 MET at `6f0fa41`; 20, 21, 22, 30
|
||||
CONFORME from the raw logs of the `5e0aa62` run. Lots N and O reviewed per lot (spec ✅, quality Approved after the
|
||||
fix rounds recorded in the ledger). Criteria 23, 34, 45-48: judged on this report by the next fresh verifier.
|
||||
|
||||
## Owner decisions applied
|
||||
- C35-C44 (lot N): Prettier files restored after a kept diff and a per-file proof; plurals; trimmed names only;
|
||||
mode precedence unchanged; parent illustration confirmed and undoable; default tab; attach repair; findings
|
||||
categories; sign-out confirmation and copy purges; labels stay proposals.
|
||||
- C45 (lot O1): free paths are never reshaped; no TypeScript path parser; an attachment that would leave a free path
|
||||
outside the new frame is refused, the document unchanged byte for byte, cancel loses nothing. Point correction for
|
||||
free paths needs a core operation: proposal `.claude/tasks/plans/2026-11-04-v1-2-6-path-repair-core-proposal.md`,
|
||||
NOT built (it reopens `crates/**`; owner approval required).
|
||||
- C46 (lot O1): « Ajouter une catégorie » never depends on the selection; required zone choice.
|
||||
- C47 (lot O2): trial served on http://192.168.1.100:5193, sandbox kept on loopback behind Vite.
|
||||
|
||||
## Owner trial
|
||||
Guide `docs/development/V1-2-6_OWNER_TRIAL.md`, every command from `/home/bchanot/Documents/faunosteo-v1-2`:
|
||||
`pnpm db:sandbox up fresh`; `pnpm db:sandbox trial-account vous@example.com` (hidden password, 12+ characters);
|
||||
`pnpm db:sandbox trial-grant vous@example.com sheet_editor` and `... sheet_publisher`; `pnpm db:sandbox trial`; open
|
||||
`http://192.168.1.100:5193/login`; end with Ctrl+C then `pnpm db:sandbox down` and
|
||||
`docker ps -a --format '{{.Names}}' | grep dbsandbox` (no line). If another device cannot reach the page, the owner
|
||||
may add `sudo ufw allow from 192.168.1.0/24 to any port 5193 proto tcp` (never run by the agent).
|
||||
|
||||
## Open before the V1-2 merge (tracked in the ledger)
|
||||
Path point correction (core proposal), the LOW security items above, m4/m6/m7/m8/m10 of the final review, the
|
||||
LRN-095 / BLK-013 / RR-11-RR-12 id reconciliation, the keyboard spec's programmatic focus (no Tab walk).
|
||||
@@ -0,0 +1,44 @@
|
||||
# Proposal: correcting a free path's points through the core (owner decision C45, not built)
|
||||
|
||||
Status: PROPOSAL for the owner, 2026-11-04. Nothing below is implemented. Until it is approved and built, the editor
|
||||
refuses an attachment that would leave a free path outside the new frame, keeps the document unchanged and never
|
||||
reshapes the path (contract C45, ruling R25).
|
||||
|
||||
## Why the core is needed
|
||||
A free path is `{type:'path', d:<SVG path data>}` (crates/core/src/domain/sheet/schema.rs:377). The core already
|
||||
reads path data strictly with the browser's grammar (crates/core/src/anatomy/path.rs: `path_bounds`, `path_outline`,
|
||||
1 090 lines, bounded numbers, curves and arcs measured on their shape) but only internally, to judge frames. It
|
||||
exposes no operation that lists or moves points: the facade offers `sheet.check`, `sheet.empty`, `sheet.edit`,
|
||||
`sheet.dependents`. Listing or moving points in TypeScript would mean a second path parser and writer in the
|
||||
browser, which BDR-043 and the owner's clause exclude.
|
||||
|
||||
## Minimal evolution
|
||||
Two pure operations in the core, on top of the existing reader, reached through the wasm facade like the others:
|
||||
|
||||
1. `sheet.path_points` (read): input `{ d, frame }`; output the path's editable points in drawing order: for each
|
||||
command, its end point and its control points (cubic, quadratic, arc end point; an arc's radii and flags are not
|
||||
points and are not editable), each with a stable index, its absolute coordinates, `kind` (`anchor` | `control`)
|
||||
and `outside` (outside the frame). Unreadable `d` → the closed refusal the reader already has.
|
||||
2. `sheet.path_move_points` (transform): input `{ d, moves: [{ index, x, y }] }`; output a new `d` where ONLY the
|
||||
numbers of the listed points change (converted back to the command's own absolute or relative form; every other
|
||||
command, number and separator kept as it was, so nothing is simplified or re-encoded); refused when an index is
|
||||
unknown, a coordinate is not finite or out of the existing bounds, or `d` is unreadable.
|
||||
|
||||
The editor then: lists the out-of-frame points of each free path in the repair dialog (values shown as stored,
|
||||
never pre-moved), lets the owner type new coordinates, and sends the attachment and every corrected annotation as
|
||||
one batch through the existing `commitBatch` + `geometryAccept` (the core judges the end state: out of frame,
|
||||
interior, too small). Cancel keeps everything; an invalid geometry is never kept, saved or submitted. Moving an
|
||||
anchor of a curve may leave its bulge outside: the control points are listed too, and the core's verdict says so.
|
||||
|
||||
## Impact
|
||||
- crates/core: `anatomy/path.rs` (a writer for the moved numbers, sharing the reader), `ops.rs` / `facade.rs` (two
|
||||
operations), Rust unit tests and conformance cases (absolute/relative, H/V, S/T reflections, arcs, implicit
|
||||
repeats, numbers at the bounds, hostile inputs). No document schema change, no change to the archive or report
|
||||
readers, the N-1 reader untouched, no SQL, no seed, no golden or oracle regenerated.
|
||||
- packages/core-wasm: generated ts-rs types (`PathPoint`, `PathMove`) and a thin wrapper; the wasm stays within
|
||||
its 600 000 B gzip budget (583 126 B today: the writer must stay small; measured before merge).
|
||||
- apps/app: the repair dialog's free-path rows (fields per out-of-frame point), labels as proposals, unit and e2e
|
||||
tests (the complex path of C45 corrected point by point, saved, reloaded with every untouched number identical).
|
||||
- Gates: `pnpm rust:check`, `pnpm wasm:build`, the core-wasm proofs, `check:all`, a fresh verifier and security
|
||||
review. Scope: it reopens `crates/**`, excluded from V1-2.6 so far: it needs the owner's explicit approval (and
|
||||
could be scheduled as its own small step).
|
||||
@@ -0,0 +1,685 @@
|
||||
# Plan: V1-2.6 UX U1, editor shell (four tabs, sections, references panel, header history)
|
||||
|
||||
> For agentic workers: executed lot by lot under `subagent-driven-development` (ship-feature STEP 4); each lot is
|
||||
> one coherent change, committed and pushed by the orchestrator after its own checks.
|
||||
|
||||
Status: REVISED after the three-lens challenge (2026-11-06, record at the end), for the owner's plan checkpoint. No
|
||||
application code is written before the owner approves this plan (brief « U1 — Validation de la conception
|
||||
interne »).
|
||||
|
||||
- Goal: replace the seven-tab level-1 shell of the draft editor by the four-tab shell of the validated v1-2-6
|
||||
boards, with approach A (owner, 2026-11-06): the level-1 editors of views, categories and vertebral regions open in
|
||||
full-width sections of Annotations with « Retour au dessin », References in a side panel, history in the header.
|
||||
- Architecture: a pure navigation model (tab, Annotations section, references panel, focus request) held by the
|
||||
editor workspace; every visited place stays mounted and is hidden with the `hidden` attribute, so no switch loses
|
||||
state and no effect re-runs on a switch; the unsaved count is derived from the history the store already holds; the
|
||||
store gains one display field (`lastSave`, the server's save time).
|
||||
- Stack: React 19.2.6, Zustand 5, Tailwind 4 (`lg` 64rem, `xl` 80rem; preflight hides `[hidden]` with `!important`),
|
||||
vitest + happy-dom, Playwright 1.64.1 + axe on the throwaway sandbox.
|
||||
- Spec: contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md` (AC1-AC20, CLARIFICATIONS
|
||||
[gated 2026-11-06]); `docs/development/V1-2-6_UX_PLAN.md` §3 U1 and §2 G; `docs/development/V1-2-6_UX_TESTS.md`
|
||||
U1; `docs/development/V1-2-6_UX_DECISIONS.md` (T11, T15, T17, « Points from the boards for U1 and later »); level-1
|
||||
contract `.claude/tasks/contracts/2026-11-03-v1-2-6-editor-1509.md` (header precedence rule, C3, C4, C5, C6, C11,
|
||||
C13, C14, C16, C27, C28, C32, C34, C36, C38, C40, C41, C44, C47 as amended); boards `docs/design/v1-2-6` 01, 11,
|
||||
12 A, 13 (source `maquettes.html`: `hist()` :287, `save()` :292, `overviewPanel()` :325, board 11 :615-628); board
|
||||
05 of v1-2-4 for the narrow read-only mode.
|
||||
- Reading list for every executor: the contract, this plan, the files named in its lot, `.claude/rules/i18n.md`,
|
||||
`.claude/rules/stores.md`.
|
||||
- Format: the project's lot format (precedent `.claude/tasks/plans/2026-11-03-v1-2-6-editor.md`): every choice is
|
||||
closed here, executors write the code and the tests named per lot.
|
||||
|
||||
## Global constraints
|
||||
|
||||
- Worktree `/home/bchanot/Documents/faunosteo-v1-2`, branch `feature/v1-2-anatomical-sheets`, base 846994b; every
|
||||
shell command starts with `cd /home/bchanot/Documents/faunosteo-v1-2 &&` (LRN-110). Commit in place, push each
|
||||
commit, no sub-branch, no merge, no `gitflow.sh finish` (T13).
|
||||
- Never DEV: no `pnpm db:start`, `db:reset`, `db:test`, `db:types`, `pnpm supabase …`, `e2e:avatar`,
|
||||
`e2e:sheet-assets`; database work only through `pnpm db:sandbox …` (containers `faunosteo_dbsandbox_*`).
|
||||
- The sandbox is shared with the level-1 owner trial stack: Lot B1 runs `pnpm db:sandbox up fresh`, which wipes the
|
||||
trial accounts and data (`scripts/db-sandbox.sh:47-60`). Approving this plan authorises that wipe; no other
|
||||
checkout runs the sandbox during U1.
|
||||
- No change under `crates/`, `supabase/`, `scripts/`, `packages/core-wasm/src/`, `packages/supabase/src/`,
|
||||
`docs/design/v1-2-6/` (AC19 CHECK); `faunosteo-v1-2-6-revue-ux-chatgpt.md` never staged.
|
||||
- No U2-U6 operation (no handle, slider, rectangle, remap, role, opacity, own-colour revert, category fold, view
|
||||
menu), no V1-2.7 control (no « Prévisualiser », no withdrawal), no existing function removed (owner precision 7).
|
||||
- Store rules unchanged: `undoStep()` / `redoStep()`, `HISTORY_LIMIT_BYTES` 8 388 608, one commit per change on
|
||||
blur, confirm or pointer-up (BDR-050), the save request, the recovery copy (C13, C27, C28), conflicts (C12, C29),
|
||||
mode precedence (C38). Store addition: `lastSave` only (Lot E); the count is a selector.
|
||||
- Every string through `useT`, FR/EN key parity (AC20), counts through `usePlural` (`editor/plural.ts`, C36); new
|
||||
labels are proposals (C44) listed in `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md`. Prose naming a
|
||||
place is reworded in the lot that moves that place.
|
||||
- Focus moves only through the navigation hook or a one-shot focus request; no kept-mounted component focuses or
|
||||
scrolls in a mount effect.
|
||||
- Our code: functions at most 25 logic lines, 5 params, 5 locals, 100 columns in TypeScript (project exception).
|
||||
`DraftEditor`, `DraftHeader`, `EditorTabs`, `FindingsTab` and `AppLayout` already exceed 25 lines: each one this
|
||||
plan touches is split along the lines below, never grown.
|
||||
- Browser suites stay green at every lot: each lot from B1 rewrites the e2e assertions its change breaks (mapped in
|
||||
its commit message, R-24) and runs every `apps/app/e2e/shell/editor-*.spec.ts` on the sandbox started in Lot B1
|
||||
(`pnpm db:sandbox e2e-shell <spec>` per spec); a spec that breaks and is not in the lot's list is added to the
|
||||
lot, never skipped. The full suites run in Lot H and in the gate order of Lot I on a new fresh sandbox.
|
||||
- Queries: tests never query labels or text page-wide; they scope to the visible place (`data-place` hook, below)
|
||||
or use role queries, which ignore hidden content.
|
||||
|
||||
## Review focus (failure modes no single lot owns; each pinned by a test in the named lot)
|
||||
|
||||
1. A hidden place answers instead of the visible one: a focus request consumed by a hidden body, a label or text
|
||||
locator matching a hidden copy (« Nom (FR) » labels the sheet, a region and an annotation), a static `id`
|
||||
repeated. Pinned in Lot B2 (requests routed to their owner, unique ids once every place is visited, Chromium spec
|
||||
of the keep-alive and focus rules) and every lot's e2e scoping.
|
||||
2. Undo from another place removes what a kept place still shows: the canvas's current view (with a pending
|
||||
creation or a tracing on it), the selected annotation, the finding the references filter names. Pinned in Lot B1
|
||||
(full canvas reset to the main view) and Lot D (filter falls back to « Tout afficher »).
|
||||
3. The save line says something false: a count after undoing past the save point, after a trim by a commit, an undo
|
||||
or a redo, after a restored copy, after commits or undos during a save; a time from another revision or an old
|
||||
save. Pinned in Lot E (`savedDistance` table, including the sequences the challengers found; `saveLineState`
|
||||
table; `readSaveTime` drops late answers and is skipped on `draft.unchanged`).
|
||||
4. A width change across 1 024 px with a section or the panel open: every place turns read-only in place, unsaved
|
||||
document changes kept, edit mode back on widening, no crash. Creation forms (canvas pending creation and every
|
||||
`!readOnly` form) unmount as today: documented limit, section 2. Pinned in Lot H.
|
||||
5. The references panel over the header: Enregistrer, Annuler and Rétablir must stay clickable with the panel open.
|
||||
Pinned in Lot D (Chromium check at 1 024 and 1 280 px).
|
||||
|
||||
---
|
||||
|
||||
## Architecture (closed decisions)
|
||||
|
||||
### 1. Navigation model (owner precisions 1, 2, 10)
|
||||
|
||||
- New pure module `apps/app/src/editor/navigation.ts`:
|
||||
- `ANNOTATION_SECTIONS = ['drawing', 'views', 'categories', 'regions'] as const`, `AnnotationSection`.
|
||||
- `EditorTarget = { place: 'tab'; tab: EditorTabId; section: AnnotationSection | null; key: ElementKey | null }
|
||||
| { place: 'references'; key: ElementKey | null; citedBy: ElementKey | null }`. One encoding: a target on
|
||||
Annotations always names its section (`'drawing'` for the canvas); `section` is null on the other tabs.
|
||||
- `targetOfKey(key: ElementKey): EditorTarget`: `sheet` → general; `zone`, `finding` → findings; `annotation` →
|
||||
annotations/drawing; `view` → annotations/views; `category` → annotations/categories; `region` →
|
||||
annotations/regions; `reference` → references (citedBy null). The only place a key meets a place.
|
||||
- `FocusRequest = { target: EditorTarget; serial: number }` is defined here (Lot A) and re-exported by
|
||||
`editor/focusRequest.ts` from Lot B1.
|
||||
- `NavigationState = { tab; section; references: { open: boolean; citedBy: ElementKey | null }; visitedTabs:
|
||||
readonly EditorTabId[]; visitedSections: readonly AnnotationSection[]; referencesMounted: boolean; focus:
|
||||
FocusRequest | undefined }`; `initialNavigation(tab)`.
|
||||
- `navigationReducer(state, action)`, actions `select_tab` (manual; keeps the Annotations section; no focus
|
||||
request), `open_section`, `back_to_drawing`, `open_references` (citedBy) and `close_references` (both keep tab and
|
||||
section: the panel opens over whatever is shown), `go_to` (target: sets tab, section or panel; `focus = { target,
|
||||
serial: previous + 1 }`), `focus_consumed` (serial). Visited lists grow, never shrink.
|
||||
- `useFocusRequest(focus, apply: (target) => 'found' | 'kept' | 'none')` reports `consumed(serial, outcome)`
|
||||
through `FocusConsumedContext` (`kept`: the place kept a creation or tracing in progress instead of jumping,
|
||||
section 4); `useRowFocus` returns `found` or `none`. A request is passed only to the body,
|
||||
section or panel its target names; `FindingsTab`'s `focusId` becomes one-shot (cleared once applied,
|
||||
`findings/FindingTree.tsx:31-33`, `tabs/FindingsTab.tsx:47,73,90`), so a later visit never re-focuses the tree and a
|
||||
second « Aller à » to the same finding focuses it again.
|
||||
- New hook `apps/app/src/editor/useEditorNavigation.ts`, called in the new `EditorWorkspace` (rendered only once the
|
||||
version is ready, so `initialTab(previewState, tier)` is known at mount: lazy `useReducer` initialiser, no
|
||||
render-phase `setTab`, no reset action; reloads keep `status: 'ready'`, `editorLoad.ts:136-152`). It owns the DOM
|
||||
side:
|
||||
- stable callbacks (`useCallback` over `dispatch`): `navigate(target, opener?)`, `selectTab(tab)`,
|
||||
`openSection(section, opener)`, `backToDrawing()`, `openReferences(citedBy, opener)`, `closeReferences()`;
|
||||
- before every move (tab click or key, « Plus » item, section entry, « Retour au dessin », panel open, panel close
|
||||
by ✕, Escape or scrim, « Aller à », hint link), `commitFocusedField()` (new in `editor/focusRequest.ts`): when
|
||||
`document.activeElement` is an `input`, `textarea` or `select` inside the editor, `blur()` it, so its
|
||||
`TextField` commits on blur (`TextField.tsx:75-79`) before the place is hidden. Today an unmount commits that
|
||||
text (`TextField.tsx:61-68`); kept-mounted places never unmount, and Safari and iPadOS do not move focus to a
|
||||
tapped button, so the blur is forced rather than assumed (confirmation challenge);
|
||||
- openers kept in a ref (`section`, `references`), never in state;
|
||||
- after each programmatic move, in an effect keyed on the move: focus the request's element, else the section
|
||||
heading, the panel heading, the active tab button `#editor-tab-<id>`, or « Plus » when the active tab sits in
|
||||
the closed « Plus » list (< 640 px); never `body`;
|
||||
- one polite live region text `{ text, serial }` on programmatic moves only (go to, hint links, section open and
|
||||
back, panel open and close): « Annotations · Vues », « Références »; rendered as `<p aria-live="polite"
|
||||
className="sr-only">`, distinct from the save status (AC12); a repeated text alternates a trailing no-break
|
||||
space.
|
||||
- `EditorTabProps` becomes `EditorPlaceProps = { readOnly: boolean; navigate: (target: EditorTarget, opener?:
|
||||
HTMLElement | null) => void; focus?: FocusRequest; reloadSheet: () => void }`. The route computes `readOnly` once
|
||||
and passes `!readOnly` to `useUndoShortcuts` and to the history buttons (no third spelling of the predicate).
|
||||
|
||||
### 2. Kept-mounted places (precision 1: no silent loss on a tab, section or panel change)
|
||||
|
||||
- Each visited tab panel, each visited Annotations section and the references panel once opened stay mounted inside
|
||||
a plain wrapper `<div data-place="…" hidden={!visible}>` (no display class on the wrapper; Tailwind 4 preflight
|
||||
forces `display: none` on `[hidden]`). Hidden content keeps its state (canvas reducer: tool, selection, pending
|
||||
creation, tracing; framing; findings selection and expansion; every `DraftField` form; an open crop group) and
|
||||
leaves the accessibility tree and axe.
|
||||
- Why not React 19.2 `<Activity>`: it re-runs every effect on reveal, which resets zoom and pan
|
||||
(`catalogue/useFraming.ts:69`, `setFraming(FIT)` on mount) and re-focuses the findings tree
|
||||
(`FindingTree.tsx:31-33`)
|
||||
on each return (correctness challenge). With `hidden`, no effect runs on a switch; typed text is committed by the
|
||||
forced blur of section 1 before any move.
|
||||
- One composed copy of a view in the page: the core gives every composition of a view the same id scope
|
||||
(`fv.<view>.`, `crates/core/src/anatomy/compose.rs:164,193`), so the edit drawing (`AnnotationCanvas`) and the
|
||||
views section's `CropCanvas` (`views/CropCanvas.tsx:33`, the parent view) would repeat ids and let `url(#…)`
|
||||
resolve into a hidden copy. The wrapper `KeptPlace({ name, visible, children })` provides `usePlaceVisible()`
|
||||
(nested: parent and own); both canvases detach their composed tree while their place is hidden and rebuild it on
|
||||
show (an effect keyed on that flag; component state, zoom and pan included, stays). The Vues card rows carry no
|
||||
drawing thumbnail for the same reason (visible choice 17).
|
||||
- `data-place` values: `general`, `findings`, `verification`, `annotations.drawing`, `annotations.views`,
|
||||
`annotations.categories`, `annotations.regions`, `references`. The tab panels themselves are
|
||||
`<div role="tabpanel" id="editor-panel-<tab>" aria-label="<tab name>">` (aria-label kept as today, so a panel whose
|
||||
tab sits in the closed « Plus » list still has a name); tabs carry `aria-controls` to their own panel.
|
||||
- Cost control: hidden places re-render on store changes. `editor/sheetDocument.ts` gets a single-entry module cache
|
||||
keyed on the document text, so all places share one `JSON.parse` per commit; the workspace passes stable props
|
||||
(memoised callbacks). Lot H records the commit-to-paint time with every place visited on the equine spec; above the
|
||||
500 ms budget of the UX plan, STOP and report.
|
||||
- Unique ids: grep found `finding-*`, `views-main-title`, `annotation-category`, `conflict-keep-hint`, each in one
|
||||
place; a Lot B2 test visits every place and asserts no `id` repeats.
|
||||
- Documented limit, unchanged from level 1: a width change across 1 024 px or a recovery decision switches between
|
||||
read-only and edit rendering; the canvas's pending creation and every creation form rendered under `!readOnly`
|
||||
(`CategoriesSection.tsx:51`, `ReferencesTab.tsx:44`, `ViewsTab.tsx:65`, `VertebraeTab.tsx:49`,
|
||||
`FindingsTab.tsx:105`) unmount then with their typed text. Keeping them would break precision 5. No tab, section or
|
||||
panel change is involved.
|
||||
|
||||
### 3. Four tabs and the tab row (AC1, AC8)
|
||||
|
||||
- `apps/app/src/editor/tabs.ts`: `EDITOR_TABS = ['general', 'annotations', 'findings', 'verification']`; tiers: wide
|
||||
and medium show the four; small (< 640 px) shows Annotations and Vérification with Général and Constats under the
|
||||
existing « Plus » disclosure (today's rule minus the removed tabs). `initialTab` unchanged in substance (C40 as
|
||||
amended).
|
||||
- `EditorTabs.tsx` split into `EditorTabs` (row), `TabList` (role `tablist`, tabs only, arrows as today) and
|
||||
`MoreTabs` (small tier). The row is `flex`: tablist, « Plus », then the history buttons at the right (Lot E),
|
||||
outside the tablist.
|
||||
- Vérification badge: visible text « n erreur(s) » / « n error(s) » through `usePlural` (keys
|
||||
`editor.tab.errors_one`, `editor.tab.errors_other`), inside the tab's accessible name; the aria-hidden number goes.
|
||||
|
||||
### 4. Annotations: drawing, overview panel, sections (approach A, AC2, T17)
|
||||
|
||||
- `components/editor/tabs/AnnotationsTab.tsx` hosts the drawing workspace and each visited section. The registry
|
||||
`ANNOTATION_SECTION_BODIES: Record<Exclude<AnnotationSection, 'drawing'>, { titleKey; Body }>` in
|
||||
`components/editor/annotations/sections/registry.ts` is the one place later steps edit (U3 replaces `categories`,
|
||||
U4 replaces `views`, U6 adds the vertebra-role path and removes `regions` when the role exists).
|
||||
- Section frame `components/editor/annotations/sections/AnnotationSection.tsx`: « Retour au dessin » first, then an
|
||||
`h2` (tabIndex -1), then the body full width. Opening focuses the `h2` through the hook; « Retour au dessin » →
|
||||
`backToDrawing()`, focus to the overview entry that opens this section when it is rendered, else the canvas box
|
||||
(focusable today for keyboard pan), never `body`.
|
||||
- Bodies reuse the level-1 editors unchanged in behaviour, moved with `git mv`: `tabs/ViewsTab.tsx` →
|
||||
`annotations/sections/ViewsSection.tsx` (views, upload, cleaning, attach and repair, numeric crop editor until U4);
|
||||
`general/CategoriesSection.tsx` leaves `GeneralTab` and becomes the `categories` body (level-1 editor until U3);
|
||||
`tabs/VertebraeTab.tsx` → `annotations/sections/RegionsSection.tsx` (↑/↓ kept, code read-only after creation,
|
||||
C5). No role check is written: before U6 no role exists, so the T17 fallback entry is always shown (a comment at the
|
||||
entry cites T17 and U6).
|
||||
- Overview panel `components/editor/annotations/OverviewPanel.tsx` (board 01 `overviewPanel()`), in the side column
|
||||
when nothing is selected or pending, in edit and read-only modes:
|
||||
- « Vues » (Lot B1): one row per view (name, « Vue principale » or « Vue détaillée », « n annotations »), each a
|
||||
button selecting that view (`aria-current` on the shown one); « Gérer les vues » (read-only « Voir les vues »).
|
||||
Not built: « Nouvelle », ⋮ (U4, U5).
|
||||
- « Catégories » (Lot B1): one chip per category (swatch, name), the count; « Modifier les catégories »
|
||||
(read-only « Voir les catégories ») and « Régions vertébrales » with the region count (T17). Not built: the fold
|
||||
(U3).
|
||||
- « Annotations de la vue » (Lot C, owner choice): annotations of the shown view grouped by category in document
|
||||
order, « Sans catégorie » only if a document holds one, count per group, « Filtrer par nom » (case- and
|
||||
accent-insensitive on the displayed name, through `folded` exported from `catalogue/useCatalogue.ts:53`), every
|
||||
row a button selecting the annotation (`aria-current`), all rows shown. The list under the drawing moves here.
|
||||
- `PropertiesPanel` gains « Toutes les annotations » (edit and read-only, Lot C): clears the selection, shows the
|
||||
overview, focuses the deselected annotation's row.
|
||||
- Counts per view, category and region come from one memoised derivation of the parsed document
|
||||
(`editor/annotations/overview.ts`), no core call, no network.
|
||||
- When the canvas's current view no longer exists (undo, delete in the views section), edit mode dispatches the full
|
||||
reset `{ type: 'view', viewId: main }` (`initialUi` clears pending creation, tracing, selection and hint,
|
||||
`editor/annotations/uiState.ts:55-64`), so a pending point is never inserted on another view
|
||||
(`creationAttempt.ts:38`); the read-only body sets its `viewId` to the main view and clears its selection.
|
||||
The reset is dispatched only when `ui.viewId` names a view absent from the document and the main view exists
|
||||
(`view` always returns a new state, `uiState.ts:57`, so an unconditional dispatch would loop).
|
||||
- « Aller à » an annotation while a creation is pending (`ui.pending`) or a tracing is open (`ui.tracing`: new zone,
|
||||
link or « Remplacer par un polygone »): it is kept, Annotations shows it, `apply` answers `kept`, focus goes to the
|
||||
creation panel heading (`CreationPanel.tsx:90`, tabIndex -1 added) or to the tracing bar, and the live region says
|
||||
a creation or a tracing is in progress (no `view` or `select` dispatch, which would drop it,
|
||||
`EditableAnnotations.tsx:60-65`, `uiState.ts:56-67`); the target can be reached again once it is finished or
|
||||
abandoned.
|
||||
- Retargeted links (Lot B1): `UnmeasuredHint` (`PropertiesPanel.tsx:159-175`) and `ToolNotes`
|
||||
(`EditableAnnotations.tsx`) navigate to `annotations/views` with the view's key; their prose and
|
||||
`no_category`/`no_child_view` are reworded in the same lot.
|
||||
- Layout 1 024-1 279 px (board 13, C25 as amended, Lot C): the side column sits beside the canvas from `lg`
|
||||
(`lg:grid-cols-[minmax(0,1fr)_22rem]`, `EditableAnnotations.tsx:94` and the read-only body), measured before any
|
||||
CSS change (LRN-094).
|
||||
|
||||
### 5. References side panel (AC3; owner choices: non-modal, button in the finding's detail)
|
||||
|
||||
- `components/editor/references/ReferencesPanel.tsx` (from `tabs/ReferencesTab.tsx`, `git mv`, Lot B1 minimal,
|
||||
Lot D complete), mounted at the first opening and kept mounted (`data-place="references"`). A `section` labelled
|
||||
by its `h2` « Références » (tabIndex -1).
|
||||
- Position (board 11, robustness challenge): the panel and its scrim live in a `relative` container that starts after
|
||||
the tab row and holds the tab panels; the panel is `absolute right-0 top-0 bottom-0`, width `min(27rem, 100%)`,
|
||||
with a `sticky top-14` inner box of height `calc(100dvh - 3.5rem)` and its own scroll; it never covers the draft
|
||||
header or the tab row. The scrim covers the tab panels only; while open they get `inert`. Header (Références, save
|
||||
line, Abandonner, Enregistrer), tab row and Annuler/Rétablir stay usable; Ctrl+Z works (no `dialog[open]`). DOM
|
||||
order: header → tab row → panel → tab panels.
|
||||
- Closing: ✕ « Fermer les références », Escape inside the panel, a scrim click; focus returns to the opener when it is
|
||||
connected and visible, else the header « Références » button. A `DeleteDialog` opened from the panel is the only
|
||||
modal on screen (D13 unchanged).
|
||||
- Content (Lot D): chip « Citées par « {nom} » (n) » when opened from a finding, « Tout afficher (N) » clears it;
|
||||
field « Rechercher une référence » (case- and accent-insensitive on citation, DOI and URL, `folded`); per reference
|
||||
its type, « citée n fois » and the level-1 fields and actions (edit, ↑/↓, delete with dependents listed, add form).
|
||||
↑/↓ only when neither filter nor search is active. Read-only modes: no edit control.
|
||||
- The filter is the finding's key, re-read from the current document on each render; a finding that no longer exists
|
||||
clears it.
|
||||
- « Aller à » on a reference: the reducer clears `citedBy`; the panel clears its search on that request, then focuses
|
||||
the card after the commit that shows it (two phases: the card does not exist while a search hides it).
|
||||
- Citation counts: pure `citationCounts(doc): ReadonlyMap<string, number>` in
|
||||
`apps/app/src/editor/references/citations.ts`, counting `reference_ids` over `buildItems(doc)`
|
||||
(`editor/findings/tree.ts:161`, every finding category and node), memoised on the parsed document (precision 6).
|
||||
Boundary note (BDR-043, EVAL-034): a display count read from the document, no rule; the core's `sheet.dependents`
|
||||
stays the authority for refused deletions.
|
||||
- Opening points: header « Références » (all modes, `aria-expanded`, `aria-controls`, Lot B1); in the selected
|
||||
finding's detail (`findings/FindingContent.tsx` Citations block) a button « n référence(s) » when it cites at
|
||||
least one, opening the panel filtered to it (Lot D).
|
||||
|
||||
### 6. Header and history (AC4-AC7, T15, precisions 3, 4, 9)
|
||||
|
||||
- `DraftHeader.tsx` split in Lot B1 (first header control) into `DraftHeader` (title, badges), `HeaderActions`
|
||||
(« Références », separator, save line, discard, « Enregistrer ») and `SaveLine`. Badges, heading focus and the
|
||||
edit-mode-only rule of discard and Enregistrer unchanged; « Prévisualiser » not built; the right group wraps under
|
||||
the title when the width requires it (measured in Lot H).
|
||||
- `components/editor/HistoryButtons.tsx` (Lot E) at the right of the tab row on every tab: glyph + visible
|
||||
« Annuler » / « Rétablir »; accessible name and `title` « Annuler la dernière modification » (T15) and « Rétablir la
|
||||
dernière modification annulée » (proposal); `aria-keyshortcuts` « Control+Z », « Control+Shift+Z »; below 640 px
|
||||
the label is visually hidden (name kept); 44 px targets below 1 280 px (board 13).
|
||||
- Enabled exactly when the route's `!readOnly` (edit mode, no recovery pending: the shortcut's predicate) and the
|
||||
store can step. Saving does not disable them (amendment of AC4, below): the store already accepts a step during a
|
||||
save and keeps such changes unsaved (`editorSave.ts:118`), and Ctrl+Z is unchanged there.
|
||||
- `aria-disabled` instead of `disabled`, so a button that becomes unusable keeps focus.
|
||||
- `onPointerDown`: `commitFocusedField()` (section 1) first; the field's `TextField` commits on blur. The click
|
||||
handler then reads `getState()` and steps when `!readOnly` and the store can step. So typed text is the last
|
||||
change and the undo reverts exactly it (AC5), with an empty history too; keyboard users reach the button with
|
||||
Tab, which blurs the field the same way.
|
||||
- A refused blur commit (the field shows its error, `aria-invalid="true"`, e.g. `editor.field.required_names`): the
|
||||
undo is skipped and focus returns to that field, so an earlier unrelated change is never undone in its place.
|
||||
- No layout shift between press and release: the save line reserves the width of its longest form in both locales
|
||||
(tabular figures), so the tab row does not move when the blur's commit changes the line (LRN-104).
|
||||
- The tool column's pair is removed (`ToolColumn.tsx:83-84`, `:122-133`); ToolColumn's whole glyph map moves to
|
||||
`components/editor/EditorGlyph.tsx` (plus `search`), one glyph table for the editor; `book` and `close` come from
|
||||
`components/ui/Icon.tsx`, unchanged.
|
||||
- Unsaved count, a selector (`apps/app/src/editor/saveLine.ts`, `savedDistance(state)`), no store field: the saved
|
||||
text, the shown text and the history entries are the same strings (`editorLoad.ts:81-82`, `:138-139`;
|
||||
`editorSave.ts:86`; `editorEdit.ts:58`, `:76`; `undo.ts:52-73`). `staleBase` → null; `documentText === savedText` →
|
||||
0; else the 1-based depth of the nearest undo entry whose `text === savedText`, else the same in redo, else null.
|
||||
Memoised on the identities of `documentText`, `savedText`, `undo`, `redo`. It covers load, reload, discard, restore,
|
||||
every trim (commit, undo and redo all call `bounded()`), commits and undos made during a save.
|
||||
- Save line (`saveLineState(state)` in the same module), first match wins:
|
||||
1. a copy issue (cap or quota): today's text;
|
||||
2. `saving`: « Enregistrement… »;
|
||||
3. `unsaved`: « n modification(s) non enregistrée(s) » when `savedDistance` is a positive number, else
|
||||
« Modifications non enregistrées »;
|
||||
4. `lastSave` and `lastSave.revision === savedRevision`: « Enregistré à hh:mm · révision n » when
|
||||
`lastSave.savedAt` is known, else « Enregistré · révision n »;
|
||||
5. « Révision n ».
|
||||
The visible line is a plain `<p>`; a separate visually hidden `role="status"` announces state changes only
|
||||
(unsaved, saving, saved, copy issue), never each count change (robustness challenge).
|
||||
- Store addition `lastSave: { revision: number; savedAt: string | null } | null` (`editor/state/*`): set to
|
||||
`{ revision, savedAt: null }` by `applySaved` (after the server answer: effective confirmation); then, except on
|
||||
`draft.unchanged` (`editorSave.ts:105`, an older save's time would be shown), `void readSaveTime(api, session,
|
||||
revision)` (never awaited, the save outcome is not delayed) reads `getOfficialSheetAdmin` (existing accessor,
|
||||
already used by `readConflict`) and writes `savedAt = draft_last_save.saved_at` only when
|
||||
`draft_version.version_id` is this version, `draft_last_save.revision === revision`, and the session and
|
||||
`lastSave` are unchanged; any failure leaves null (owner choice: server time only). Formatted with
|
||||
`formatParisTime` (`editor/format.ts:18`). Reset by open and reload.
|
||||
- « Abandonner les modifications » (C11 as amended, precision 9): `editor.draft.discard` relabelled; disabled rule,
|
||||
confirmation and `discardChanges({ confirmed: true })` unchanged; when the dialog opens, `copyExists(userId,
|
||||
versionId)` (`editor/state/recovery.ts:80`) decides whether the confirmation adds « La copie locale temporaire de
|
||||
ces modifications sera aussi supprimée. », so a copy left by an earlier write after a quota refusal is named too
|
||||
(`copyWritten` only tells the last write).
|
||||
|
||||
### 7. Shell (AC9, Lot F)
|
||||
|
||||
- `AppLayout.tsx`: on the editor path one of two static class sets (Tailwind needs literal classes): sidebar
|
||||
`hidden xl:flex …`, menu button and brand link `xl:hidden`, top-bar `h1` `hidden xl:block`; elsewhere today's `lg`
|
||||
set. Split (layout, top bar) to stay under the line limit. Today's top bar with the menu button is kept (board 13's
|
||||
merged row is not built).
|
||||
- `MobileDrawer.tsx`: prop `closesFrom: '64rem' | '80rem'` (default '64rem') replaces `LARGE_SCREEN`; the effect,
|
||||
with `closesFrom` in its deps, closes the drawer at setup when the query already matches and on later `change`
|
||||
events. AppLayout passes '80rem' on the editor. The drawer stays open from 1 024 to 1 279 px in the editor; leaving
|
||||
the editor at 1 180 px with the drawer open closes it. Drawer links stay under the capture leave guard (BDR-078).
|
||||
|
||||
### 8. « Aller à » (AC13)
|
||||
|
||||
- `editor/verification.ts`: `ROOT_TAB` and `tabOf` become a table built on `targetOfKey`; `issueTarget` returns
|
||||
`{ target: EditorTarget; name }` (the target carries the key, or the place alone when the key does not resolve).
|
||||
`IssueList` calls `navigate(target)`; its fallback label names the place (« Aller à Vues »).
|
||||
- Focus per target: general, views, categories, regions, findings rows through `focusAttrs`; an annotation: select
|
||||
it, then focus the properties panel heading (`PropertiesPanel.tsx:61`, tabIndex -1 added); a reference: section 5;
|
||||
nothing found: section 1's fallback chain.
|
||||
|
||||
### 9. Narrow read-only (AC11, C16, precision 5)
|
||||
|
||||
- Mode logic unchanged (`mode.ts`). Every moved form takes `readOnly` from the route: the three sections and the
|
||||
panel show no edit control in any read-only mode; overview entries open sections in consultation; history buttons
|
||||
disabled and Ctrl+Z off (same predicate). The store's `canEdit` stays true in narrow mode by design (recovery copy).
|
||||
- No horizontal scroll at 320, 375 and 768 px, panel open included; the tab row uses the small tier and icon-only
|
||||
history below 640 px.
|
||||
|
||||
### 10. i18n (AC16, AC20)
|
||||
|
||||
- Keys renamed in Lot B1: `editor.tab.views|references|vertebrae` → `editor.place.views|references|regions`, plus
|
||||
`editor.place.drawing`, `editor.place.categories`; `editor.tab.general` kept (a group name in
|
||||
`ReviewFigures.tsx:32`); each removed key grepped before deletion, e2e and LAN specs included
|
||||
(`e2e/lan/trial-lan.spec.ts:125,148`; `Dict` is `Record<string, string>`, so typecheck does not catch a removed
|
||||
key).
|
||||
- Prose naming an old tab or « Annuler » reworded in the lot that moves the place: `fr.ts:1218`, `:1510`, `:1515`,
|
||||
`:1516`, `:1420` (Lot B1), `:1400`, `:1425-1426` (Lot E) and EN counterparts (`en.ts:1187`, `:1389`, `:1479` and
|
||||
neighbours in B1; `:1369`, `:1394-1395` in E).
|
||||
|
||||
---
|
||||
|
||||
## Lots
|
||||
|
||||
Each lot: `pnpm typecheck && pnpm lint && pnpm test:run` green, its e2e specs and the two sentinels green on the
|
||||
sandbox, then commit (removed or rewritten assertions mapped in the message) and push.
|
||||
|
||||
### Lot A · Navigation model (pure)
|
||||
|
||||
- Files: create `apps/app/src/editor/navigation.ts`; test `apps/app/tests/unit/editor-navigation.test.ts`.
|
||||
- Produces: `ANNOTATION_SECTIONS`, `AnnotationSection`, `EditorTarget`, `FocusRequest`, `NavigationState`,
|
||||
`NavigationAction`, `initialNavigation`, `navigationReducer`, `targetOfKey`.
|
||||
- Tests: `targetOfKey` for the eight `ElementKey` kinds; `go_to` increments the serial and sets tab, section or
|
||||
panel; `select_tab` keeps section and panel and issues no request; `open_section`, `back_to_drawing`;
|
||||
`open_references` and `close_references` keep tab and section (opened from the views section, the section stays);
|
||||
`focus_consumed` clears only its serial; visited lists only grow.
|
||||
- Commit: `feat(editor): navigation model for the four-tab shell`.
|
||||
|
||||
### Lot B1 · Four tabs, sections with their entries, minimal references panel, « Aller à »
|
||||
|
||||
- Files: `editor/{tabs,focusRequest,verification,useEditorNavigation}.ts`, `editor/annotations/focusTarget.ts`,
|
||||
`components/editor/{EditorTabs,EditorTabBody,DraftHeader,HeaderActions,SaveLine}.tsx`,
|
||||
`components/editor/tabs/{GeneralTab,AnnotationsTab,FindingsTab,VerificationTab}.tsx`,
|
||||
`components/editor/annotations/{EditableAnnotations,PropertiesPanel,OverviewPanel,CreationPanel,TracingBar}.tsx`
|
||||
(OverviewPanel: Vues and Catégories cards with their entries; CreationPanel heading and the tracing bar get
|
||||
tabIndex -1 for the `kept` focus), `components/editor/annotations/sections/{registry.ts,AnnotationSection.tsx,
|
||||
ViewsSection.tsx,RegionsSection.tsx}` (moved), `components/editor/general/CategoriesSection.tsx`,
|
||||
`components/editor/references/ReferencesPanel.tsx` (moved from `tabs/ReferencesTab.tsx`, toggled by the header
|
||||
button, level-1 content), `components/editor/findings/{FindingTree,FindingsTab}` focus one-shot,
|
||||
`components/editor/verification/IssueList.tsx`, `editor/annotations/overview.ts` (counts),
|
||||
`app/routes/app/admin/AdminSheetDraftRoute.tsx` (`DraftEditor` keeps session and mode; new `EditorWorkspace`
|
||||
renders header, notices, tab row, places, live region), i18n keys and prose of the lot;
|
||||
`e2e/support/{editor,warm-up}.ts` (`selectTab` by role with a name pattern, `place(page, name)` returning the
|
||||
visible `data-place`, `openSection`, `backToDrawing`, `openReferences`, `TABS` of four), the specs that select a
|
||||
removed tab (`editor-access:34-42,156-200`, `editor-drawings:57,84,133`, `editor-structures:59-63,73-78,103-109`,
|
||||
`editor-geometry:204,260,347,374,399`, `editor-equine:112-131,288-299`, `editor-journey:82,101,108-111`,
|
||||
`editor-recovery`, `editor-signout`), `e2e/lan/trial-lan.spec.ts:125,148`.
|
||||
- No keep-alive yet: a place unmounts when left, as a tab does today; no level-1 function is unreachable at this
|
||||
commit (views, categories and regions through the overview entries and « Aller à », references through the header).
|
||||
- Sandbox: before the first e2e run, `pnpm db:sandbox up fresh` (wipes the trial data, authorised by this plan).
|
||||
- Tests: `editor-route.test.tsx` (four tab names; tiers at 1 280, 800, 500 px with « Plus » holding Général and
|
||||
Constats; arrows), `editor-mode.test.ts:99-117`, `editor-initial-tab.test.ts`, `editor-focus-request.test.tsx`
|
||||
(each request reaches its owner; annotation target focuses the properties heading; not found → tab, or « Plus »
|
||||
below 640 px, never `body`), `editor-verification.test.tsx` (each issue root → its target; fallback label), new
|
||||
`editor-sections.test.tsx` (entries open each section, `h2` focused, « Retour au dessin » focuses the entry, the
|
||||
region entry present with no role code; read-only labels; undo of a view creation while that view is shown with a
|
||||
pending point and with a tracing → main view, pending and tracing cleared, and no dispatch when the shown view
|
||||
still exists; « Aller à » an annotation while a creation is pending, and while a zone tracing is open, keeps it,
|
||||
focuses its panel or bar and announces it). Tests rendering the moved components import their new paths
|
||||
(`editor-tabs-views`, `editor-drawing-upload:94`, `editor-repair:300`, `editor-tabs-lists`,
|
||||
`editor-tabs-general:105-185`), assertions kept; `editor-findings.test.tsx:32` and
|
||||
`editor-annotations-tab.test.tsx:44` gain `navigate` in their props; `editor-route-recovery:93-97` moves to the
|
||||
header button.
|
||||
- Commit: `feat(editor): four tabs, Annotations sections, references from the header`.
|
||||
|
||||
### Lot B2 · Kept-mounted places
|
||||
|
||||
- Files: `components/editor/{EditorTabBody.tsx,KeptPlace.tsx (new),tabs/AnnotationsTab.tsx}`, route workspace
|
||||
(references wrapper), `components/editor/annotations/AnnotationCanvas.tsx` and
|
||||
`editor/annotations/useCanvasBuild.ts`, `components/editor/views/CropCanvas.tsx` (detach while hidden),
|
||||
`editor/sheetDocument.ts` (single-entry cache),
|
||||
new `apps/app/tests/unit/editor-keep-alive.test.tsx`, new `apps/app/e2e/shell/editor-shell.spec.ts` (first
|
||||
journeys); rewrites `editor-route.test.tsx:135` (the hidden Annotations tab is now in the DOM) and
|
||||
`editor-journey.spec.ts:309` (`getByLabel('Nom (FR)')` scoped to the visible place).
|
||||
- Tests (unit): text typed in the category add form survives Général ↔ Annotations and a section round trip; findings
|
||||
expansion and selection survive a tab change; the canvas tool, selection and zoom survive a tab change and the
|
||||
views section round trip through the unmeasured hint; a field still focused while a programmatic move happens
|
||||
(keyboard shortcut to a tab, « Aller à », Escape closing the panel from a reference field) is committed first (one
|
||||
undo entry, `unsaved` true, leave guard armed); text typed in the reference add form survives closing and reopening
|
||||
the panel; every place visited, a crop group open in the views section → no duplicate `id`, SVG ids included; a
|
||||
request reaches only its owner while others are mounted; after an « Aller à » to a finding, arrowing back onto
|
||||
Constats keeps focus on the tab; one `JSON.parse` per document text across places.
|
||||
- Tests (Chromium, `editor-shell.spec.ts`): the same keep-alive rules for the category form and the zoom; focus after
|
||||
« Aller à », « Retour au dessin » and a tab click checked with `document.activeElement` (happy-dom does not refuse
|
||||
focus on hidden elements).
|
||||
- Commit: `feat(editor): kept-mounted tabs, sections and references panel`.
|
||||
|
||||
### Lot C · Annotation card and side column from 1 024 px
|
||||
|
||||
- Files: `components/editor/annotations/{OverviewPanel,AnnotationList,EditableAnnotations,PropertiesPanel}.tsx`,
|
||||
`components/editor/tabs/AnnotationsTab.tsx` (read-only body), `editor/annotations/overview.ts` (grouping, filter),
|
||||
`apps/app/src/catalogue/useCatalogue.ts` (export `folded`, no other change), i18n keys of the lot; e2e specs that
|
||||
select annotations from the list or query it (`editor-annotations`, `editor-geometry`, `editor-journey`,
|
||||
`editor-equine.spec.ts:281,319`, `editor-structures.spec.ts:288`).
|
||||
- Tests: new `editor-overview.test.tsx` (card in edit and read-only, grouping in category order, filter ignoring case
|
||||
and accents, « Toutes les annotations » returns to the card with focus on the row, view rows switch the canvas
|
||||
view); `editor-annotations-tab.test.tsx` list assertions move to the card (mapping); grid from `lg`; overflow
|
||||
measured at 1 024 and 1 180 px before the CSS change.
|
||||
- Commit: `feat(editor): board 01 annotation card, side column from 1 024 px`.
|
||||
|
||||
### Lot D · References panel complete
|
||||
|
||||
- Files: `components/editor/references/{ReferencesPanel,ReferenceRow,ReferenceForm}.tsx`,
|
||||
`editor/references/citations.ts` (new), `components/editor/findings/{FindingContent,FindingDetail}.tsx` and
|
||||
`components/editor/tabs/FindingsTab.tsx` (the opener passed down), route workspace (container,
|
||||
scrim, `inert`), i18n keys of the lot; `editor-structures.spec.ts` references part; `editor-shell.spec.ts` panel
|
||||
journeys.
|
||||
- Tests (unit): `citationCounts` (nested categories and nodes, several citers, zero); new
|
||||
`editor-references-panel.test.tsx`: opens from the header (focus on heading) and from a finding (chip and count,
|
||||
filtered list, « Tout afficher (N) »), search on citation, DOI and URL ignoring case and accents, ↑/↓ hidden while
|
||||
filtered or searching, Escape, ✕ and scrim close, focus back to the opener or the header button, tab panels `inert`
|
||||
while open, Ctrl+Z reverts a reference edit while open, undo removing the cited finding clears the filter,
|
||||
read-only modes show no edit control, « Aller à » on a reference hidden by an active search clears the search and
|
||||
focuses its card.
|
||||
- Tests (Chromium): Enregistrer, Annuler and Rétablir receive a real click (no interception) with the panel open at
|
||||
1 024 and 1 280 px, page at the top and scrolled; the panel never overlaps the draft header or the tab row.
|
||||
- Commit: `feat(editor): references side panel with filter, search and counts`.
|
||||
|
||||
### Lot E · Header history, save line, Abandonner
|
||||
|
||||
- Files: `components/editor/{HistoryButtons,EditorGlyph,SaveLine,HeaderActions,EditorTabs}.tsx`,
|
||||
`components/editor/annotations/ToolColumn.tsx` (pair removed, glyphs from `EditorGlyph`), `editor/saveLine.ts`,
|
||||
`editor/state/{editorTypes,editorBase,editorSave,editorLoad}.ts` (`lastSave` in `initialData()`, `readSaveTime`),
|
||||
route (`!readOnly` to both), i18n keys and prose of the lot; e2e assertions on the old undo pair, the discard label,
|
||||
« Révision n » and « modifications non enregistrées » (`editor-journey:272-285,345,372`,
|
||||
`editor-annotations:129-155`, `e2e/support/editor.ts` `saveDraft` `:352-363`, `trial-lan.spec.ts:24-29,145`,
|
||||
`editor-structures.spec.ts:229-231` (a `toHaveCount(0)` on the old text would pass vacuously),
|
||||
`editor-recovery.spec.ts:142-146,168-172`). A press on an `aria-disabled` button in Playwright goes through
|
||||
`page.mouse` at the button's box (actionability treats it as disabled).
|
||||
- Tests: `savedDistance` table (load 0; commits; undo and redo around the save point; a commit after undoing past
|
||||
it → null; trim by a commit, an undo and a redo → null; restore → null; save sent at 3, then two undos and three
|
||||
commits in flight → null, and one undo and one commit in flight → null; nearest duplicate wins); `saveLineState`
|
||||
table (five forms, priority); `readSaveTime` (written only for the same version and revision; late answer after
|
||||
another save or a reload dropped; failure → no time; not called on `draft.unchanged` nor on a failed save; the save
|
||||
outcome resolves before the read); new `editor-history-buttons.test.tsx` (names and titles, T15; enabled only in
|
||||
edit mode without pending recovery; disabled in narrow, frozen, rights, inactive, historical, recovery pending;
|
||||
enabled while saving and in step with Ctrl+Z; focus kept when the last undo empties the stack; undo from
|
||||
Annotations reverts a Général change and from Constats a canvas change; typed text then header undo reverts exactly
|
||||
it, with and without earlier history; pointerdown blurs the focused field; a refused blur commit (names required)
|
||||
skips the undo and returns focus to the field; Ctrl+Z inside a field leaves the store
|
||||
untouched; Ctrl+Z ignored while a `DeleteDialog` is open; no pair left in the tool column); save status announces
|
||||
transitions only; discard confirmation with the copy sentence when `copyExists`, including a quota refusal after an
|
||||
earlier write, and without it when no copy exists; cancel keeps changes and copy. Rewritten: `editor-route.test.tsx`
|
||||
(`:104-119`, `:63`, `:93`, `:96`, `:118`), `editor-route-conflict.test.tsx:100,140`,
|
||||
`editor-route-recovery.test.tsx:125`, `editor-annotations-tab.test.tsx:502-515` (mapping).
|
||||
- Commit: `feat(editor): header history, save line and Abandonner les modifications`.
|
||||
|
||||
### Lot F · Editor sidebar from 1 280 px
|
||||
|
||||
- Files: `components/shell/{AppLayout,MobileDrawer}.tsx`, `apps/app/tests/unit/shell.AppLayout.test.tsx`;
|
||||
`editor-shell.spec.ts` sidebar journeys.
|
||||
- Tests: editor path uses the `xl` set, other paths the `lg` set; the drawer closes on the `80rem` query in the
|
||||
editor, on `64rem` elsewhere, and at setup when the query already matches (leaving the editor at 1 180 px with the
|
||||
drawer open); a drawer link with unsaved changes asks before leaving; Chromium: sidebar hidden at 1 024, 1 180,
|
||||
1 279 px, shown at 1 280 px, menu reachable in one tap, drawer staying open at 1 180 px.
|
||||
- Commit: `feat(app): editor sidebar hidden below 1 280 px, menu one tap away`.
|
||||
|
||||
### Lot G · Label proposals and parity
|
||||
|
||||
- Files: `.claude/audits/2026-11-06-v1-2-6-u1-label-proposals.md` (format of
|
||||
`.claude/audits/2026-11-03-v1-2-6-label-proposals.md`: key, FR, EN, board, status « proposal »), dead keys removed
|
||||
after grep.
|
||||
- Tests: AC20 parity command.
|
||||
- Commit: `docs(i18n): U1 label proposals`.
|
||||
|
||||
### Lot H · Browser journeys and full suites
|
||||
|
||||
- Files: `apps/app/e2e/shell/editor-shell.spec.ts` (completed), `docs/development/BROWSER_TESTS.md`.
|
||||
- Journeys: four tabs; cross-tab undo; typed text then header undo; Ctrl+Z outside and inside a field; « Aller à »
|
||||
for each issue kind; save line « n modifications non enregistrées » → « Enregistrement… » → « Enregistré à hh:mm ·
|
||||
révision n »; no horizontal scroll at 1 024, 1 180, 1 279, 1 280 px on the four tabs, the three sections and with
|
||||
the panel open, and at 320, 375, 768 px in read-only; a width change below 1 024 px with a section open and with the
|
||||
panel open (read-only, no edit control, unsaved kept, edit back on widening); keyboard walk header → tab list →
|
||||
Annuler/Rétablir → panel when open → tab panel content (tools, canvas, side column); axe with no serious or critical
|
||||
violation on the four tabs, each section, the open panel and the narrow read-only mode (after animations settle,
|
||||
LRN-082; from the top, LRN-089; dialog count 0 after a close, LRN-111, LRN-116); commit-to-paint time with every
|
||||
place visited on the equine spec, recorded (above 500 ms: STOP).
|
||||
- Regression: the whole shell suite on the sandbox; C13, C14, C16, C34, C41 journeys green (T11);
|
||||
`e2e/lan/trial-lan.spec.ts` run with the trial stack of the Lot I demo, or recorded as not run with the reason.
|
||||
- Commit: `test(app): browser journeys of the four-tab editor shell`.
|
||||
|
||||
### Lot I · Docs, gates, checkpoint
|
||||
|
||||
- Files: `docs/development/V1-2-6_OWNER_TRIAL.md` (U1 demo: create a non-equine sheet in the UI, switch tabs, undo a
|
||||
Général change from Annotations, open References from a finding, « Gérer les vues » and « Retour au dessin »,
|
||||
resize to 1 180 px; `:136`, `:151`, `:155`, `:159`, `:161` reworded), `docs/development/V1-2-6_UX_{PLAN,TESTS}.md`
|
||||
(U1 tooling row and « a stale worker image is refused » moved to U6, per CLARIFICATIONS), `.claude/tasks/TODO.md`,
|
||||
the contract (EVIDENCE lines).
|
||||
- Gates in the AC18 order, each recorded with its command and result: `pnpm typecheck`, `pnpm lint`,
|
||||
`pnpm test:run`, `pnpm build`, `pnpm e2e:ui`, a new `pnpm db:sandbox up fresh` then `pnpm db:sandbox test-db`,
|
||||
`pnpm db:sandbox e2e-shell`, `pnpm db:sandbox test` (LRN-113, EVAL-042), `pnpm check:all`,
|
||||
`pnpm r5:import-equine --check`; the AC19 and AC20 CHECK commands; a fresh verifier on the enriched contract; a
|
||||
fresh security review on `846994b..HEAD`.
|
||||
- Checkpoint report (brief §9): changes, board correspondence, tests run with results, verdicts, limits, sandbox
|
||||
demo, commits and Git state, exit criteria. STOP; no U2.
|
||||
|
||||
---
|
||||
|
||||
## Edge cases (all lots)
|
||||
|
||||
- StrictMode open → close → open: navigation lives in `EditorWorkspace`, which mounts once the version is ready; the
|
||||
route key per version id resets it; the store's session token rules unchanged.
|
||||
- A recovery offer pending at opening: every place is consultation only; history disabled; sections and panel open
|
||||
read-only.
|
||||
- Save in flight while a section or the panel is open: navigation does not depend on `saving`.
|
||||
- Conflict dialog open: page inert (modal), shortcuts off as today; places keep their state behind it.
|
||||
- Leaving the page with the panel open and unsaved changes: leave guard as today (BDR-078).
|
||||
|
||||
## Disposition of memory (claimed by this plan)
|
||||
|
||||
- BDR-102 [in force]: the regions editor sits in Annotations as the T17 fallback entry, always shown before U6, no
|
||||
role logic written.
|
||||
- BDR-101 [in force]: T15 wording: header undo named « Annuler la dernière modification »; « Abandonner les
|
||||
modifications » for C11; dialogs that close without effect keep « Annuler ».
|
||||
- BDR-100 [in force]: level 1 not validated (T11); C13, C14, C16, C34, C41 re-run in Lot H.
|
||||
- BDR-099 [in force]: permission states and their order in the route (`AdminSheetDraftRoute.tsx:175-235`) untouched;
|
||||
fresh stack for the gate run (Lot I).
|
||||
- BDR-096 [in force]: board 05 of v1-2-4 stays the narrow read-only reference (section 9).
|
||||
- BDR-076 [in force]: D13: the panel is non-modal (owner choice), so no `ModalDialog`; every modal stays on it
|
||||
(delete, discard, conflict, leave, drawer).
|
||||
- BDR-078 [in force]: drawer and menu links under the capture leave guard at every width (Lot F test).
|
||||
- BDR-079 [in force]: D11 drawer only, no tab bar; the menu opens the existing drawer.
|
||||
- BDR-050 [in force]: commits on blur, confirm or pointer-up only; the header undo relies on the blur commit, forced
|
||||
at pointerdown.
|
||||
- BDR-006 [pattern kept]: ↑/↓ kept in the panel (unfiltered) and the regions section until U6.
|
||||
- BDR-042 [rule kept]: no element ahead of the boards: « Prévisualiser », the view menu, the category fold and the
|
||||
merged tablet top row are not built.
|
||||
- LRN-017 / AC20: parity in Lot G and Lot I.
|
||||
- LRN-057: the discard sentence reads the stored copy, the saved state the server answer and the admin read.
|
||||
- LRN-082: happy-dom proves wiring only; axe and focus checked in Chromium (Lots B2, D, H).
|
||||
- LRN-085: focus after a drawer navigation unchanged.
|
||||
- LRN-087: wrappers forward `aria-*`; tests find sections and the panel by role and name.
|
||||
- LRN-088: `useT` never an effect dependency (live regions, focus effects).
|
||||
- LRN-094: overflow measured before CSS changes (Lots C, H).
|
||||
- LRN-110, LRN-113, LRN-114, EVAL-042: absolute worktree, fresh sandbox in the order test-db → e2e-shell → test, the
|
||||
tracked ledger, gate commands copied verbatim.
|
||||
- EVAL-034: the citation count stays a TypeScript read of the document (section 5 boundary note).
|
||||
- LRN-111, LRN-115, LRN-116, LRN-089, LRN-104 [already seen]: dialog count 0 after closes, destination landmark
|
||||
awaited, scans from the top, click coordinates recomputed after header or tab-row shifts; LRN-115's class (a locator
|
||||
hitting the wrong copy) is why queries are scoped to the visible place.
|
||||
|
||||
## Visible choices taken in this plan (for the owner at the plan checkpoint)
|
||||
|
||||
Answered by the owner on 2026-11-06 (recorded [gated] in the contract): server time on the save line; non-modal
|
||||
references panel; citation button in the finding's detail; board 01 annotation card with « Toutes les
|
||||
annotations ».
|
||||
|
||||
Taken here, to confirm or change:
|
||||
1. Unsaved count = accepted changes between the shown and the saved document along the history; « Modifications non
|
||||
enregistrées » without a number when the saved text is no longer in the history (restored copy, trim, a change
|
||||
made after undoing past the save).
|
||||
2. After `draft.unchanged`: « Enregistré · révision n », without a time.
|
||||
3. Annuler and Rétablir stay enabled during a save, as Ctrl+Z (amends AC4).
|
||||
4. Typed text then « Annuler »: the typed text is the last change and is undone, even when the history was empty
|
||||
(AC5).
|
||||
5. Below 640 px: Annotations and Vérification shown, Général and Constats under « Plus »; history icon-only.
|
||||
6. From 1 024 to 1 279 px today's top bar with the menu button stays; board 13's merged row is not built; the
|
||||
header's right group wraps under the title when needed.
|
||||
7. Board 12 A's save-failure strip is not built; today's `SaveFailureNotice` stays.
|
||||
8. « Régions vertébrales » sits in the Catégories card; read-only entries read « Voir les vues » and « Voir les
|
||||
catégories ».
|
||||
9. The annotation card shows every row (no « Voir les n annotations » truncation); the filter matches the displayed
|
||||
name.
|
||||
10. Panel: search on citation, DOI and URL; ↑/↓ only on the unfiltered list; focus on its heading at opening.
|
||||
11. Undo that removes the view shown on the canvas: back to the main view, a pending creation or tracing on the
|
||||
removed view is dropped (it can no longer be created there).
|
||||
12. « Aller à » an annotation while a creation is pending or a tracing is open: it is kept and shown, focus on its
|
||||
panel or bar, an announcement; no jump until it is finished or abandoned.
|
||||
13. Keyboard order: header → tab list → Annuler/Rétablir → panel when open → tab panel content in visual order
|
||||
(tools, canvas, side column); the TESTS wording « panel → canvas » would put the DOM order against the visual one.
|
||||
14. Focus after « Retour au dessin »: the section's entry button, else the canvas box.
|
||||
15. Announcements: « {Onglet} » or « {Onglet} · {Section} », « Références »; save status announced on state changes
|
||||
only, not on each count change; the Vérification badge text is part of the tab's name.
|
||||
16. Discard confirmation adds the copy sentence whenever a copy is stored.
|
||||
17. Vues card rows without the drawing thumbnail of board 01: a second composition of each view would repeat the
|
||||
core's ids in the page (section 2); name, kind and annotation count only.
|
||||
18. A typed value the field refuses (e.g. a name left empty) is not followed by an undo: « Annuler » leaves the
|
||||
history alone and returns focus to the field with its message.
|
||||
|
||||
## Contract amendments proposed (applied only on the owner's approval of this plan)
|
||||
|
||||
- AC3: non-modal panel below the tab row (owner answer), content `inert` under a scrim, header and history usable.
|
||||
- AC4: « saving » leaves the list of states that disable Annuler and Rétablir (choice 3).
|
||||
- AC5: typed text undone even with an empty history; pointerdown blur (choice 4).
|
||||
- AC7: count and time rules of section 6 (choices 1, 2; owner answer on the time).
|
||||
- AC17: keyboard order as choice 13.
|
||||
- FILE SCOPE: add `apps/app/src/editor/{navigation,saveLine,useEditorNavigation,sheetDocument}.ts`,
|
||||
`apps/app/src/editor/references/citations.ts`, `apps/app/src/editor/annotations/{overview,useCanvasBuild}.ts`
|
||||
(overview new; the build hook detaches while hidden; the canvas reset
|
||||
uses the existing `view` action of `uiState.ts`, unchanged), `apps/app/src/catalogue/useCatalogue.ts` (export
|
||||
`folded` only),
|
||||
`apps/app/e2e/lan/trial-lan.spec.ts`; `editor/state/*` edits limited to `lastSave` and `readSaveTime`.
|
||||
- Design criteria from the owner's precisions 1-10, tagged [gated] at approval: no loss on a tab, section or panel
|
||||
change (Lots B2, D tests); « Retour au dessin » focus and context; history tests on typed text, shortcuts and
|
||||
section transitions; save shown only after the server answer, time only from the server; read-only below 1 024 px
|
||||
on every moved form and shortcut; counts from the current document without network; no « Prévisualiser », no
|
||||
withdrawal, no removed function; T17 entry without role logic; discard confirmation naming the stored copy;
|
||||
sections replaceable through one registry.
|
||||
- Documented limit (section 2): creation forms unmount on a width change across 1 024 px or a recovery decision, as
|
||||
in level 1.
|
||||
|
||||
## Challenge record (2026-11-06, three blind lenses on the first draft)
|
||||
|
||||
- Correctness CONCERNS(6 MAJOR, 7 MINOR), robustness CONCERNS(5 MAJOR, 10 MINOR), simplicity CONCERNS(2 MAJOR,
|
||||
7 MINOR); no BLOCKER tag. Every MAJOR closed by a named change:
|
||||
- false unsaved count (three lenses): the hand-kept `saveDistance` and `nextSaveDistance` replaced by the
|
||||
`savedDistance` selector over the history (section 6), with the challengers' sequences in Lot E;
|
||||
- `<Activity>` re-runs effects on reveal (zoom reset `useFraming.ts:69`, tree focus `FindingTree.tsx:31-33`):
|
||||
replaced by kept-mounted `hidden` wrappers; `focusId` one-shot; no focus in mount effects (section 2, global
|
||||
constraints);
|
||||
- Lot B depended on Lot D and was too large: split into B1 (tabs, sections with their entries, minimal panel,
|
||||
« Aller à ») and B2 (kept-mounted places); the overview's Vues and Catégories cards move to B1;
|
||||
- e2e red from B to H and blind happy-dom focus: each lot keeps its specs green on the sandbox; Chromium focus and
|
||||
keep-alive spec in B2;
|
||||
- LAN trial spec forgotten: `trial-lan.spec.ts` in B1, E and H;
|
||||
- typed text with disabled buttons contradictory: AC5 followed, pointerdown blur, test rewritten;
|
||||
- panel covering the header: anchored below the tab row, Chromium click checks in Lot D;
|
||||
- pending creation written on the main view after its view vanished: full canvas reset;
|
||||
- discard sentence keyed on `copyWritten`: `copyExists` read at opening;
|
||||
- hidden copies matched by label and text locators: `data-place` scoping, no page-wide non-role query.
|
||||
- MINOR integrated: header split and glyphs in the lots that use them; no `history.ts` (route's `!readOnly`); one
|
||||
glyph table and `Icon` for book and close; counts over `buildItems`, `folded` shared; lazy initial tab, no reset
|
||||
action; prose reworded in the lot that moves each place; one encoding for the drawing; drawer closes at setup when
|
||||
the query matches; save status announces transitions only; panels keep an aria-label and the focus fallback reaches
|
||||
« Plus »; `readSaveTime` not awaited and skipped on `draft.unchanged`; « Aller à » clears the panel search before
|
||||
focusing; shared parse cache and stable callbacks; « Aller à » keeps a pending creation; documented limit widened to
|
||||
every creation form.
|
||||
- Confirmation pass (one fresh correctness challenger on the revised plan): CONCERNS(3 MAJOR, 5 MINOR), no BLOCKER;
|
||||
it confirmed that the `savedDistance` string identity holds on every path. Closed by named changes:
|
||||
- typed text left uncommitted in a hidden field when no blur fires (Safari and iPadOS taps, Escape closing the
|
||||
panel): `commitFocusedField()` before every move (section 1), tests in Lot B2;
|
||||
- « Aller à » dropping a tracing: the keep rule covers `ui.tracing` (section 4, Lot B1 tests);
|
||||
- specs broken outside a lot's list: every lot runs all `editor-*.spec.ts`, the found breakages named in B2, C, E;
|
||||
- MINOR: SVG id scope shared by the drawing and the crop preview (detach while hidden, no thumbnails); refused
|
||||
blur commit skips the undo; reserved save-line width; `page.mouse` on `aria-disabled`; three-outcome `apply`,
|
||||
tabIndex on the creation heading and tracing bar, guarded reset dispatch; `FocusRequest` defined in Lot A, file
|
||||
lists completed (B1, D, E); `open_references` and `close_references` keep tab and section.
|
||||
Per `challenge-plan.md`, no further pass; the owner decides at the gate.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
# PLAN — db:trial owner grant with one verified TOTP factor
|
||||
|
||||
Contract: .claude/tasks/contracts/2026-11-11-trial-owner-one-factor-2050.md
|
||||
|
||||
## Facts (investigated)
|
||||
- scripts/db-trial.sh `grant_platform_role` (≈1719-1747): `local need=1 factors count`, then `[ "$2" != owner ] || need=2`; `factor_count` before the typed confirmation; the grant transaction recounts verified TOTP factors (`>= :need`) and `\gset` fails on zero rows → ON_ERROR_STOP → rollback; operator path `private.assign_platform_role(null, …)` + `private.log_event` audit row.
|
||||
- SQL never requires two: `private.assign_platform_role` checks `has_verified_totp` (≥1) for a non-null actor only; aal2 lives in the RPCs and policies. Nothing SQL changes.
|
||||
- The two-factor rule elsewhere: V1-2_ANATOMICAL_SHEETS.md §5.7.1 (≈416 "two factors on two devices before the first grant on any stack"), §5.7.2 (≈551, ≈591), §5.7.7 (≈688, ≈699); IDENTITY.md ≈189 (recommendation). Production/operator procedure: unchanged.
|
||||
- Harness stub (db-trial-check.sh ≈258-264): `txn-factors` file = the count the transaction finds; `< need` → "no rows returned for \gset", exit 3.
|
||||
|
||||
## Changes
|
||||
1. scripts/db-trial.sh
|
||||
- `grant_platform_role`: drop the owner branch; `local need=1 factors count` stays (owner and admin both need one). Keep `-v need="$need"` and `>= :need` (the recount stays in the transaction). Messages unchanged in shape ("$1 holds $count verified TOTP factor(s), $2 needs $need: …").
|
||||
- [challenge] SQL comment inside the grant heredoc (≈1736-1737) "when one went away since the check, no row comes back" → "when fewer than :need remain since the check, no row comes back" (comment line only).
|
||||
- Comment above `factor_count` (≈1696-1700): "Owner needs two verified TOTP factors, admin one" → one verified factor for owner and admin (owner decision 2026-11-11, db:trial only; a second factor is an optional backup; the rule for other stacks is V1-2 §5.7.1, unchanged).
|
||||
- `cmd_account` hint (≈1693): "(two factors for the owner account)" → "(one factor; a second one is an optional backup)".
|
||||
2. scripts/db-trial-check.sh
|
||||
- ≈1213-1216: `set_factors 0`; owner refused: "owner needs 1" + "nothing was granted"; no role SQL ran. Rename the check names accordingly ("grant owner with no factor: refused (one needed), nothing assigned").
|
||||
- [challenge: placement] Do NOT add the success case right after the zero-factor refusal (its grant SQL would stay in the stub stdin and break the `no_role_assigned` checks at ≈1220/1223). Add it right after the existing `set_factors 1` at ≈1236 and BEFORE the admin grant at ≈1237: `fresh_stdin; fresh_log; trial_tty 'grant owner' grant owner@trial.test owner`, check granted ("owner granted to owner@trial.test", rc 0) and `log_has "-v email=owner@trial.test -v role=owner -v need=1 -v operator="`; then `fresh_stdin` before the existing admin case so the admin checks stay as they are.
|
||||
- ≈1217 `set_factors 2` and the following owner cases stay (wrong phrase, piped phrase, unreadable factors, failing role SQL, granted with factors shown): owner with two factors still granted (the optional backup case).
|
||||
- ≈1234: `need=2` → `need=1`.
|
||||
- ≈1316-1322: `echo 0 > txn-factors` (the transaction finds none: count 1 or 2 before, 0 inside) → nothing granted; check name "count then 0"; then `echo 1 > txn-factors` → granted ("one factor still there in the transaction: granted").
|
||||
- No other check changes; no new helper; no shellcheck directive.
|
||||
3. docs/development/SUPABASE.md §5.2
|
||||
- grant row (≈867): "two for owner, one for admin" → "one for owner and for admin (owner decision 2026-11-11; a second factor is an optional backup)".
|
||||
- first-use step 1 (≈874): "enrol two TOTP factors" → "enrol one TOTP factor (a second is an optional backup)", plus one sentence [challenge]: with one factor, a lost device means the operator recovery of V1-2 §5.7.7 at the trial database, or a new account granted through `grant`.
|
||||
4. docs/development/V1-2_ANATOMICAL_SHEETS.md [challenge: anchor]: the dated note goes right after §5.7.1 step 2 (≈551-552, "the future owner signs in, enrols two TOTP factors on two devices…"), the procedure db:trial cites (script comment, audit reason "V1-2 contract 5.7.1", SUPABASE.md, TRIAL_STACK.md); the §5.6 sentence at ≈415-416 ("The owner enrols two factors on two devices before the first grant on any stack.") gets only a short pointer "(db:trial exception: §5.7.1)". Note text: "db:trial exception (owner, 2026-11-11): on the persistent trial stack of `pnpm db:trial` one verified TOTP factor suffices for the owner grant, as for admin; a second factor is an optional backup. This rule, for every other stack, production included, is unchanged until a distinct study and authorisation." No other contract line changes.
|
||||
|
||||
## Edge cases
|
||||
- Zero factors / no account / unreadable count: refused before the confirmation (unchanged paths).
|
||||
- A factor removed between the check and the transaction: recount `>= 1` → zero rows → rollback (pinned by the txn-factors=0 case).
|
||||
- Admin, catalogue rights (has_verified_totp, is_platform_admin for editor/publisher), sanitised factor names: unchanged.
|
||||
|
||||
## Precondition (orchestrator, owner-approved 2026-11-11)
|
||||
The harness refuses while the trial ports (58xxx, 5194) listen. Before dispatch the orchestrator stops the app and runs `pnpm db:trial stop` (data kept); after the gates it runs `pnpm db:trial start` and the app on 192.168.1.100. The executor never stops or starts anything; grants resume only after ALL PASS.
|
||||
|
||||
## Tests
|
||||
- `bash -n`, `shellcheck -x` on both scripts.
|
||||
- `bash scripts/db-trial-check.sh </dev/null` (fake Docker, ≈2.5 min; the real trial stack's ports must be free: if the harness refuses for a port in use, report BLOCKED, never stop anything).
|
||||
|
||||
## Disposition
|
||||
- [challenge] BDR-083 (ratified 2026-10-28, decisions.md:611) says "first owner: enrol 2 factors first, role assigned last by operator", no stack carve-out: narrowed for db:trial only by a new BDR at CAPITALIZE (owner decision 2026-11-11); production and every other stack keep BDR-083 as is.
|
||||
- `need` stays (fixed at 1) for the in-transaction recount and the stub's txn-factors emulation: the smaller diff.
|
||||
- honors BDR-107..110 (trial stack design) by changing only the trial script's operator gate; honors the owner's "no production rule change" by leaving SQL, IDENTITY.md and the §5.7 procedure text intact with a scoped note; no in-force BDR requires two factors on the trial stack (the rule was a V1-2 §5.7.1 procedure line applied by the script).
|
||||
@@ -0,0 +1,73 @@
|
||||
# PLAN — anomaly B: working-copy dialog checks out of the shared slot (bugfix) — rev 2
|
||||
|
||||
Owner brief 2026-11-12 « Décision sur l'anomalie E2E »: OPTION 1 approved. Rev 2 after challenge (correctness SOLID,
|
||||
robustness CONCERNS(1), simplicity CONCERNS(1)); changes marked [C], [R], [S].
|
||||
|
||||
## Diagnosis
|
||||
- Symptom: `apps/app/e2e/shell/admin.spec.ts` « admin screens: axe and no sideways scroll on every page, desktop and
|
||||
375 px » fails 4 times (fr/en × chromium-desktop/chromium-375): the click on « Créer une copie de travail » times out.
|
||||
- Root cause: the test opens the dialog on the historical sheet `503dc301-…` (slug `faunosteo-cheval`). The working
|
||||
copy exists ONLY for that sheet (`private.historical_sheet_id()` fixed id; `create_sheet_working_copy` refuses
|
||||
any other source `working_copy.source_invalid`; `AdminSheetRoute.tsx:294` renders `WorkingCopyAction` only when
|
||||
`sheet.historical`) and ONE active copy is allowed for the whole database. The test depends on shared, mutable state:
|
||||
(a) on this sandbox the slot is taken by `8c315a12-…`, leaked by `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts`
|
||||
« the working copy and the catalogue reads answer their closed kinds » (`kindOf` discards the created id; `afterAll`
|
||||
deletes the run's accounts, not their sheets); (b) [C] even on a fresh stack, `editor-equine.spec.ts` (beforeAll
|
||||
set-aside + own copy, afterAll restore) flips the slot while `admin.spec` runs in parallel (`fullyParallel`, 8
|
||||
workers). Fixing (a) alone would not fix the test.
|
||||
- `seedOfficialSheet` cannot help (random id, never historical). Owner: business rule unchanged, no SQL.
|
||||
- Note for the owner (not fixed here, out of scope): `editor-equine.spec.ts` set-aside archives and restores
|
||||
pre-existing active copies of the historical sheet (8c315a12 included) on every run; it ran during the R1 follow-up
|
||||
e2e runs today. Not run in this fix.
|
||||
- RELATED MEMORY: LRN-089, LRN-076 (stub vs real service: coverage change documented), LRN-082 (native modal: Tab past
|
||||
last control reaches the browser UI), BDR-114 (decision C). No BLK bears.
|
||||
|
||||
## Fix plan
|
||||
1. NEW `apps/app/e2e/harness/working-copy.html` + `working-copy.tsx` (dev server only, never built, like `dialog.tsx`):
|
||||
`?lang=en` picks the language (localeStore + `documentElement.lang`); under `<StrictMode>` [R] and `MemoryRouter`,
|
||||
renders the REAL `@/components/admin/WorkingCopyAction` twice, each in its own `<section>` with its own heading
|
||||
[R]: slot free (`slug="faunosteo-cheval"`, `sourceVersionId` a fixed fake uuid, `copyActive={false}`) and slot taken
|
||||
(same, `copyActive={true}`); page `<h1>`, `@/styles/index.css`. No network (`getSupabaseClient` only on submit,
|
||||
never triggered; e2e:ui server has empty Supabase env).
|
||||
2. NEW `apps/app/e2e/ui/working-copy.spec.ts` (chromium-desktop 1 280 and chromium-375; fr and en via `?lang`):
|
||||
- page: axe + no horizontal overflow with both states shown; taken button `toBeDisabled()` with accessible
|
||||
description = `admin.working_copy.active` (aria-describedby) [S: no « does not open » click];
|
||||
- free button opened by keyboard (focus + Enter): dialog named `admin.working_copy.create`, description
|
||||
`admin.working_copy.body`, slug input prefilled `faunosteo-cheval-copie-de-travail` (proof it is the real
|
||||
component's proposal);
|
||||
- focus: initial focus inside the dialog; keyboard walk written explicitly like `dialog.spec.ts`
|
||||
[C][R]: Tab order close ✕ → slug input (identified by id `working-copy-slug`, `focusedName` is empty for inputs) →
|
||||
Cancel → Submit → one `'browser'` step → back to ✕, and Shift+Tab the reverse; never `outside:*`;
|
||||
- axe + no horizontal overflow on the open dialog, plus the dialog panel inside the viewport and panel
|
||||
`scrollWidth <= clientWidth` at both widths [R];
|
||||
- Escape closes, focus returns to the opener.
|
||||
3. `apps/app/e2e/shell/admin.spec.ts`: historical page stays in the axe / overflow loop unchanged; the click + dialog
|
||||
block is removed; replaced by a state-consistent check on the historical page [C]: the « Créer une copie de travail »
|
||||
button is visible, and it is disabled exactly when the `admin.working_copy.active` reason is shown and linked
|
||||
through aria-describedby (enabled with no reason otherwise). Comment points to `e2e/ui/working-copy.spec.ts`.
|
||||
4. `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts` [R][C]: every successful `createSheetWorkingCopy` result
|
||||
(both calls) is pushed to a run-owned `copies` list before `kindOf` classification; `afterAll`: when `copies` is
|
||||
non-empty, `update public.anatomical_sheets set status = 'archived', archived_at = now() where id in (<copies>)
|
||||
returning id` as postgres and assert the returned ids equal `copies`; each cleanup step (copies, species, grants +
|
||||
accounts) runs even if an earlier one throws, the first error rethrown at the end. Never touches other rows.
|
||||
5. Docs (same commit) [C]: `docs/development/BROWSER_TESTS.md` (e2e:ui row and harness paragraph: new page and spec;
|
||||
coverage change: the dialog's axe / layout / keyboard checks run in e2e:ui on the real component, no longer in its
|
||||
real server context; the shell keeps the historical page and the button state); `V1-2-6_U1_CORRECTIONS.md` §5 row
|
||||
B (cause (b), fix, limit, « creation branch of the cleanup not yet run on a fresh stack » open check) and the lines
|
||||
saying four admin failures; `playwright.ui.config.ts` header; root `CLAUDE.md` e2e:ui line + folder map harness
|
||||
list. TODO lines in the memory commit.
|
||||
|
||||
## Verification (sandbox only; db:trial and DEV never)
|
||||
- Snapshot BEFORE (read-only `select` through `pnpm db:sandbox sql`): every pre-existing `anatomical_sheets` row
|
||||
(id, status, archived_at, updated_at) [R][C] incl. 8c315a12 and the historical sheet, saved to scratchpad.
|
||||
- BEFORE fix: `pnpm db:sandbox e2e-shell e2e/shell/admin.spec.ts --grep "admin screens"` → 4 failed (expected).
|
||||
- AFTER, pass 1 and pass 2: same grep → 4 passed; `pnpm e2e:ui` full (new spec included).
|
||||
- AFTER once: full `admin.spec.ts`; `pnpm db:sandbox test tests/sandbox/sheets-admin.sandbox.ts` (server refusals
|
||||
still covered; `working_copy.exists` path); typecheck, lint, test:run.
|
||||
- Snapshot AFTER: every pre-existing row identical per id (new rows allowed: A1 creates sheets).
|
||||
- Not run: `editor-equine.spec.ts` (its set-aside touches pre-existing copies).
|
||||
|
||||
## Risks
|
||||
- The creation branch of the cleanup (copies non-empty) is not exercised on this sandbox (slot taken): recorded open.
|
||||
- The dialog is no longer axe-checked inside the admin page chrome; it is a top-layer modal; page chrome stays covered
|
||||
by the shell loop.
|
||||
@@ -0,0 +1,307 @@
|
||||
# R1 (history labels, deselection, Escape) + D6b Implementation Plan — rev 3 (3-lens challenge + re-challenge)
|
||||
|
||||
> For agentic workers: executed task by task by fresh implementers (subagent-driven-development), each task
|
||||
> reviewed before the next. Steps use checkbox syntax.
|
||||
|
||||
**Goal:** V1-2.6 lot R1 complete: « Défaire » / « Refaire », « Désélectionner », the Escape priority, and D6b
|
||||
(a click or tap on the drawing outside any annotation deselects), in the editable editor and its read-only twin.
|
||||
|
||||
**Architecture:** one deselect hook (commit the focused field, clear the selection, move or keep focus, announce)
|
||||
used by the button, Escape and the drawing. Escape needs no registry: only the SHOWN annotation body
|
||||
(`usePlaceVisible()`) listens for Escape on `document` (bubbling, so React-level consumers that stop or mark the key
|
||||
go first), and only while it has a resolved selection and no tracing; the « Plus » disclosure closes itself first
|
||||
through a capture listener while open; the workspace root closes the references panel for an Escape from the header
|
||||
or tab row. D6b decides on the PRESS, not the click target: a tap tracker (pointerdown target, accumulated
|
||||
movement, primary/non-primary pointers anywhere in the page, contextmenu) gives an empty-tap verdict at `pointerup`.
|
||||
Mouse and pen apply it at pointerup (survives the pointer capture of the move gesture, whose click targets the box,
|
||||
and the canvas rebuild a blur commit triggers at mousedown) and swallow the click that follows. Touch applies it in
|
||||
the tap's own click, and only if that click's target carries no `[data-anno-id]` (Chromium builds the touch click
|
||||
after touchend, hit-tests the post-deselect layout and adjusts toward nearby markers: applying at pointerup would
|
||||
let the click land on what moved under the finger). `useFraming` is not touched.
|
||||
|
||||
**Tech stack:** React 19, TypeScript strict, Zustand editor store, Vitest + happy-dom + Testing Library,
|
||||
Playwright Chromium (`pnpm e2e:shell` on `pnpm db:sandbox`).
|
||||
|
||||
**Spec:** `docs/development/V1-2-6_U1_CORRECTIONS.md` §1 (D5, D6, D6b), §3 R1, §6 (A5, A5b, A6); board
|
||||
`docs/design/v1-2-6-r0/26-historique-deselection.png` (normative, BDR-110), `maquettes.html:380-391, :611-667`,
|
||||
`REVUE.md:57-60, :72, :108-111, :129-135`. Contract: `.claude/tasks/contracts/2026-11-12-r1-history-deselect-1141.md`.
|
||||
|
||||
## Global constraints
|
||||
|
||||
- Worktree `/home/bchanot/Documents/faunosteo-v1-2`, branch `feature/v1-2-anatomical-sheets`, commit in place
|
||||
(auto-push); never run anything in `/home/bchanot/Documents/faunosteo`.
|
||||
- No change under `supabase/`, `crates/`, `scripts/`, `docker/`; `apps/app/src/catalogue/useFraming.ts`,
|
||||
`apps/app/src/editor/useUndoShortcuts.ts`, `apps/app/src/app/routes/app/anatomy/SheetRoute.tsx` unchanged;
|
||||
`src/catalogue` and `src/components/catalogue` import nothing from `@/editor`.
|
||||
- Every UI string through `useT()`; fr and en get the same keys; `t` never in effect or callback deps (LRN-088).
|
||||
- Our code: ≤ 25 logic lines per function, ≤ 5 params, ≤ 5 locals, 100 chars per TS line; comments say why.
|
||||
- Kept places: act only on what is shown; no one-shot focus in mount effects (LRN-119); twin ids keep `ro-`.
|
||||
- Unit pointer events in happy-dom carry `isPrimary: true, button: 0, pointerType: 'mouse'` explicitly (happy-dom's
|
||||
default `isPrimary` is false).
|
||||
- Browser suites: `pnpm e2e:shell` against `pnpm db:sandbox` only (up); never db:trial, never DEV; no sandbox
|
||||
reset or `down`; never edit `src` while a browser suite runs (LRN-120).
|
||||
- Commits: Conventional Commits, allowed scopes (`app`, `tests`, `docs`); every rewritten or removed assertion
|
||||
mapped to its replacement in the commit body (R-24). D6b code and its tests only in the D6b commit.
|
||||
|
||||
## Fixed wording (board 26, REVUE.md table)
|
||||
|
||||
| Key | FR | EN |
|
||||
|---|---|---|
|
||||
| `editor.history.undo` | Défaire | Undo (unchanged) |
|
||||
| `editor.history.undo_title` | Défaire la dernière modification | Undo the last change (unchanged) |
|
||||
| `editor.history.redo` | Refaire | Redo (unchanged) |
|
||||
| `editor.history.redo_title` | Refaire la dernière modification défaite | Redo the last undone change (unchanged) |
|
||||
| `editor.history.undo_shortcut` (new) | Ctrl+Z ou ⌘Z | Ctrl+Z or ⌘Z |
|
||||
| `editor.history.redo_shortcut` (new) | Ctrl+Maj+Z ou ⇧⌘Z | Ctrl+Shift+Z or ⇧⌘Z |
|
||||
| `editor.annotations.deselect` (new) | Désélectionner | Deselect |
|
||||
| `editor.annotations.deselected` (new) | Aucune annotation sélectionnée. | No annotation selected. |
|
||||
|
||||
FR prose: `editor.views.drawing.use_parent_body` « … et vous pouvez défaire ce changement (Défaire). … »;
|
||||
`editor.views.repair.body_one` / `_other` « … et un seul Défaire les restaure ensemble. ». EN prose unchanged.
|
||||
`fr.ts:1479` « Annulez, … » and every dialog « Annuler » stay.
|
||||
|
||||
## Gate outcomes (filled at the validation gate before dispatch)
|
||||
|
||||
- G1 Escape focus [gated 2026-11-12, owner]: focus inside the properties panel → A6 (row if visible, else the
|
||||
drawing box); focus elsewhere (canvas box, view chips, tool column, add buttons, tab row) → stays where it is.
|
||||
- G2 « Supprimer » [gated 2026-11-12, owner]: unchanged (filled danger button, no icon), per the board caption
|
||||
« qui garde son style de danger »; only placed to the right of « Désélectionner » in the bordered row.
|
||||
|
||||
## Reviewer checklist (each has its test below)
|
||||
|
||||
Shown body only (Task 3 test 9); replace tracing (Task 2 test 8, Task 3 test 6, Task 4 test 10); pending valid value
|
||||
then a drawing click in a real browser (Task 5 step 7); two-finger tap (Task 4 test 8, Task 5 step 5 with the event
|
||||
count); filtered-out row (Task 2 test 2); selected marker click and jitter (Task 4 test 4, Task 5 step 3).
|
||||
|
||||
---
|
||||
|
||||
### Task 1: history reads « Défaire » / « Refaire » (D5) — commit `feat(app): history reads Défaire / Refaire (R1, D5)`
|
||||
|
||||
**Files:** `apps/app/src/i18n/fr.ts` (:1284-1287, :1444, :1473-1474), `apps/app/src/i18n/en.ts` (new shortcut keys
|
||||
only), `apps/app/src/components/editor/HistoryButtons.tsx`, `EditorTabs.tsx:147` (comment only); tests
|
||||
`tests/unit/editor-history-buttons.test.tsx`, `tests/unit/editor-annotations-tab.test.tsx:514`; e2e titles/comments
|
||||
`e2e/shell/editor-shell-layout.spec.ts:271, :293`, `editor-shell-journeys.spec.ts:152, :160`, `editor-shell.spec.ts:149`,
|
||||
`e2e/support/editor.ts:440`.
|
||||
|
||||
- [ ] Dictionaries per the wording table.
|
||||
- [ ] `HistoryButtons.tsx`: `SHORTCUT = { undo: 'Control+Z Meta+Z', redo: 'Control+Shift+Z Meta+Shift+Z' }`;
|
||||
`aria-label={name}`, `title={`${name} (${t(`editor.history.${direction}_shortcut`)})`}`; comments :41, :53, :121
|
||||
and `EditorTabs.tsx:147` say « Défaire » / « Refaire ».
|
||||
- [ ] Unit: constants and assertions to the new FR names; title = name + « (Ctrl+Z ou ⌘Z) » / « (Ctrl+Maj+Z ou
|
||||
⇧⌘Z) »; `aria-keyshortcuts` the two-form lists; visible labels `['Défaire','Refaire']`; the absence checks (:205,
|
||||
`editor-annotations-tab.test.tsx:514`) become `/Défaire|Refaire/`; one EN test (names unchanged, title with
|
||||
« (Ctrl+Z or ⌘Z) »); FR prose keys contain « Défaire » while `use_parent_cancel` still reads « Annuler ».
|
||||
- [ ] Run `pnpm --filter @faunosteo/app exec vitest run tests/unit/editor-history-buttons.test.tsx tests/unit/i18n.dicts.test.ts tests/unit/editor-annotations-tab.test.tsx`, `pnpm typecheck`, `pnpm lint`. Commit with the R-24 map.
|
||||
|
||||
### Task 2: « Désélectionner » (D6, A6) — part of commit `feat(app): Désélectionner and the Escape priority (R1, D6, A5, A6)`
|
||||
|
||||
**Files:** new `apps/app/src/editor/annotations/deselect.ts`; `src/editor/useEditorNavigation.ts` (export
|
||||
`CANVAS_BOX` only); `src/editor/focusRequest.ts` (export `isTextField(target)`; `commitFocusedField` uses it);
|
||||
`EditorGlyph.tsx` (glyph `deselect`: `M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M9 9l6 6M15 9l-6 6`);
|
||||
`annotations/PropertiesPanel.tsx`; `annotations/EditableAnnotations.tsx` (pass `busy`); i18n keys.
|
||||
|
||||
- [ ] `deselect.ts`:
|
||||
- `focusDrawing(): boolean` — `visibleElement(CANVAS_BOX)` focused with `{ preventScroll: true }`.
|
||||
- `focusRowOrDrawing(id)` — `focusRow({ kind: 'annotation', id }) || focusDrawing()`.
|
||||
- `useDeselect(id: string | null, clear: () => void)` → `{ byButton(), byKey(fromPanel: boolean) }`. `id` is the
|
||||
RESOLVED selection (`selected?.id ?? null`, never the raw `selectedId`, which can name a removed annotation).
|
||||
Each: `id === null` → return false; else `commitFocusedField()`, `flushSync(clear)`, focus (byButton →
|
||||
`focusRowOrDrawing(id)`; byKey → `focusRowOrDrawing(id)` if `fromPanel`, else per G1), `announce(t(…deselected))`
|
||||
(`AnnounceContext`), return true. `t` via a ref.
|
||||
- [ ] `PropertiesPanel`: new optional prop `busy?: boolean` (a tracing runs). After the status actions, one row
|
||||
`<div className="flex flex-wrap gap-2 border-t border-[var(--color-border)] pt-2.5">`: « Désélectionner »
|
||||
(`<Button variant="secondary" size="sm">`, `<EditorGlyph name="deselect" size={16} />`, `t('editor.annotations.deselect')`),
|
||||
not rendered while `busy`; its handler `useDeselect(annotation.id, props.onShowAll).byButton` (the same clear
|
||||
as « Toutes les annotations », no new callback prop); `onMouseDown={(e) => e.preventDefault()}` keeps the focus in
|
||||
a field being typed during the press, so its blur commit (which can change the panel height above the button and
|
||||
lose the click) happens inside byButton's `commitFocusedField()`; then `Deletion` unchanged (G2). Rendered in read-only too
|
||||
(`Deletion` already renders null there). `ShowAll` untouched.
|
||||
- [ ] Edit body passes `busy={ui.tracing !== null}`.
|
||||
- [ ] Unit tests appended to `tests/unit/editor-annotations-tab.test.tsx` (`describe('« Désélectionner » (R1, A6)')`,
|
||||
mount wrapped in an `AnnounceContext` spy, as `editor-sections.test.tsx:172`):
|
||||
1. overview back, focus on the row, announcement, `documentText`, `handleVersion`, undo stack length, `unsaved`
|
||||
unchanged; 2. filter term hiding the row → focus on `[data-testid=annotation-canvas]`, nothing selected;
|
||||
3. undo after it undoes the earlier edit; 4. read-only: « Désélectionner » present, no « Supprimer », it deselects
|
||||
and focuses the `ro-` row; 5. valid typed « Centre x » not blurred → committed once (one undo step);
|
||||
6. refused value not blurred → panel closes, `documentText` unchanged; 7. EN: « Deselect », « No annotation
|
||||
selected. »; 8. replace tracing started → no « Désélectionner » rendered.
|
||||
|
||||
### Task 3: the Escape priority (A5) — rest of the same commit
|
||||
|
||||
**Files:** `annotations/EditableAnnotations.tsx`, `tabs/AnnotationsTab.tsx` (body handlers), `EditorTabs.tsx`
|
||||
(MoreTabs Escape), `EditorWorkspace.tsx` (panel close from outside it), `editor/annotations/usePlacement.ts:79-83`
|
||||
(`event.preventDefault()` when Escape cancels a tracing). `ReferencesPanel.tsx` unchanged (it already stops its Escape).
|
||||
|
||||
- [ ] Every Escape handler below returns early on `event.nativeEvent.isComposing` (or `event.isComposing`).
|
||||
- [ ] `MoreTabs`: local state kept (unmount still resets it); while `open`, an effect adds a `document` keydown
|
||||
listener in the CAPTURE phase: Escape, no `dialog[open]`, not composing → `preventDefault()`, close, focus
|
||||
`#${MORE_BUTTON_ID}`; removed on close or unmount.
|
||||
- [ ] `EditorWorkspace` root `onKeyDown` (bubbling): Escape, not `defaultPrevented`, not composing,
|
||||
`state.references.open` → `nav.closeReferences()` (existing focus return), `preventDefault()`.
|
||||
- [ ] New hook `useEscapeDeselect(active: boolean, onEscape: (event: KeyboardEvent) => boolean)` in
|
||||
`editor/annotations/deselect.ts`: while `active`, a `document` keydown listener (bubbling phase; the latest
|
||||
`onEscape` read through a ref): Escape, not `defaultPrevented`, not composing, `!isTextField(event.target)`, the
|
||||
target is `document.body` or inside `[data-editor-workspace]` (attribute added on the EditorWorkspace root) →
|
||||
`if (onEscape(event)) event.preventDefault()`. React handlers that stop propagation (dialogs, references panel)
|
||||
never reach `document`; the « Plus » capture listener and the workspace panel handler mark the key first.
|
||||
- [ ] Each body calls it with `active = usePlaceVisible() && selected !== undefined && (edit: ui.tracing === null)`
|
||||
and `onEscape = (e) => deselect.byKey(asideRef.current?.contains(e.target as Node) ?? false)`; `asideRef` on
|
||||
the panel column. A hidden body (kept edit body, hidden tab or section) is never active.
|
||||
- [ ] Limit, documented: Escape from outside the editor workspace (sidebar, app header) does nothing.
|
||||
- [ ] Unit tests, new `tests/unit/editor-escape.test.tsx` rendering `EditorWorkspace` with the existing harness
|
||||
(`tests/helpers/editorHarness.ts`, as `editor-keep-alive.test.tsx`): 1. canvas box focused → deselected, focus
|
||||
per G1, announcement; 2. « Marquer comme relu » focused → deselected, focus on the row; 3. select A, then B, then
|
||||
Escape from the panel → focus on B's row; 4. « Nom (FR) » focused → nothing; 5. references panel open, Escape
|
||||
from the tab row → panel closes, selection kept; 6. replace tracing with the canvas box focused → tracing
|
||||
cancelled, selection kept; 7. tracing, focus on the TracingBar → nothing; 8. small tier, « Plus » open, focus in
|
||||
the twin's canvas → « Plus » closes, focus on it, twin selection kept; 9. read-only width with the hidden edit
|
||||
body holding its own selection → only the twin deselects, the hidden body's selection unchanged; 10. delete
|
||||
dialog open → only the dialog's own handling (wiring proof, LRN-082); 11. focus on `body` → deselected; focus on
|
||||
« Défaire » in the tab row → deselected (focus stays there); a target outside the workspace → nothing;
|
||||
12. nothing selected (or the selected annotation deleted) → no announcement, no change.
|
||||
- [ ] Run the new file + `editor-keep-alive`, `editor-annotations-tab`, `editor-overview`; typecheck, lint. Commit
|
||||
tasks 2 + 3 together (R-24 map).
|
||||
|
||||
### Task 4: D6b, an empty tap on the drawing — commit `feat(app): a click on the drawing deselects (R1, D6b)`
|
||||
|
||||
**Files:** new `apps/app/src/catalogue/useEmptyTap.ts`; `src/editor/annotations/useCanvasGestures.ts`;
|
||||
`components/editor/annotations/AnnotationCanvas.tsx` (prop pass-through); `EditableAnnotations.tsx` (CanvasStage);
|
||||
`components/catalogue/CatalogueCanvas.tsx`; `components/editor/tabs/AnnotationsTab.tsx`; `editor/annotations/deselect.ts`
|
||||
(add `byDrawing`).
|
||||
|
||||
- [ ] `useEmptyTap()` (refs, one document listener, cleaned on unmount): `onPointerDown(e)`: primary → reset
|
||||
`{ armed: e.button === 0, onAnnotation: target.closest('[data-anno-id]') !== null, moved: 0, multi: false,
|
||||
last: point, touchPending: false, swallowClick: false }` and, while armed, a `document` capture `pointerdown`
|
||||
listener that sets `multi` for any other pointerId (a second finger outside the box counts); non-primary →
|
||||
`multi = true`. `onPointerMove(e)`: primary and armed → `moved += distance(last, point)`, `last = point`.
|
||||
`onPointerCancel` and `onContextMenu` → disarm. `verdict(e)` (called on EVERY pointerup, before any tool test, so
|
||||
every press disarms and removes the document listener): `'none'` unless primary, armed, `!multi`,
|
||||
`moved <= TAP_SLOP_PX` (4, the same 4 px as `useFraming`'s drag threshold), `!onAnnotation`; else `'now'` for
|
||||
mouse and pen (sets `swallowClick`), `'on_click'` for touch (sets `touchPending`). `takeClick(target)` (called
|
||||
first by the click handler): `swallowClick` → clear it, answer `'swallow'`; `touchPending` → clear it, answer
|
||||
`'deselect'` when the target has no `[data-anno-id]` ancestor, else `'normal'`; otherwise `'normal'`.
|
||||
Both flags are cleared by the next pointerdown.
|
||||
- [ ] `useCanvasGestures`: `GestureInput.onDeselect: () => void`; `composedPointer` also calls the tracker's
|
||||
down/move/cancel; box `onContextMenu` → tracker. `onPointerUp` runs framing and move first, then
|
||||
`const v = tap.verdict(event); if (input.tool === 'select' && v === 'now') input.onDeselect()`.
|
||||
`clickHandler`: `swallowClick()` (framing) first as today, then `tap.takeClick(event.target)`: `'swallow'` →
|
||||
return; `'deselect'` → `if (input.tool === 'select') input.onDeselect()`, return; `'normal'` → today's code
|
||||
unchanged (select on an id, place with a tool).
|
||||
- [ ] Documented behaviour: the vertex handles of a selected polygon are drawn by the overlay with
|
||||
`pointer-events: none` and have no function; a press on a handle's part outside the zone's own fill deselects
|
||||
(pinned by a unit case). A touch tap whose click Chromium drops (rare: the blur commit of a field rebuilds the
|
||||
drawing between the synthesized mousedown and the click) does not deselect; a second tap does (reported from e2e).
|
||||
- [ ] `deselect.ts`: `byDrawing()` — like byButton but focus: `focusDrawing()` unless the visible box already holds
|
||||
the focus; same announcement; returns false when nothing is selected (no dispatch).
|
||||
- [ ] `CanvasStage`: `onDeselect={deselect.byDrawing}` with the resolved selection.
|
||||
- [ ] `CatalogueCanvas`: `onEmpty?: () => void`; viewport handlers compose `handlers.onPointerDown/Move/Up/Cancel`
|
||||
(and `onContextMenu`) with the tracker; on pointerup `if (verdict(e) === 'now' && onEmpty) onEmpty()`; the host
|
||||
click listener calls `takeClick` first only when `onEmpty` is set (`'swallow'` → return, `'deselect'` →
|
||||
`onEmpty()`, `'normal'` → today's code). Without `onEmpty` the listener is byte-for-byte today's path and nothing
|
||||
new is observable (the reader keeps its behaviour, BDR-099 item 5).
|
||||
- [ ] Twin: `onEmpty={deselect.byDrawing}`.
|
||||
- [ ] Unit tests appended to `tests/unit/editor-annotations-tab.test.tsx` (`describe('a tap on the drawing (D6b)')`;
|
||||
helper `tap(el, { dx, upOn, type })`: pointerdown on `el`, optional pointermove, pointerup on `upOn`, then
|
||||
`click` on `upOn`; primary, button 0, `pointerType` mouse by default; extra cases: touch tap on `<rect>` →
|
||||
deselected only at the click; touch tap whose click target is a marker (touch adjustment) → that marker selected,
|
||||
no deselect announcement; mouse tap → deselected at pointerup and the following click on a marker is swallowed;
|
||||
`contextmenu` during the press → kept; a document-level pointerdown with another pointerId during the press →
|
||||
kept; a press on a selected polygon's vertex handle outside its fill → deselected (documented behaviour):
|
||||
1. inner `<rect>` → deselected, focus on the canvas box, announcement, store unchanged (text, version, undo
|
||||
length, unsaved); 2. composed root `<svg>` → deselected; 3. the box itself (margin) → deselected;
|
||||
4. pointerdown on the SELECTED marker, pointerup and click on the box (capture retarget) → kept; same with a 2 px
|
||||
move → kept; 5. another marker → selected (existing click path); a zone polygon interior → selected; a link →
|
||||
selected; 6. nothing selected, pending keyboard creation with a typed name → tap on `<rect>` keeps it;
|
||||
7. 3 px accumulated move → deselects; 6 px → kept; out 5 px and back (net 0) → kept; 8. non-primary pointerdown
|
||||
during the press → kept; the next single tap → deselects; 9. `button: 2` press → kept; 10. replace tracing
|
||||
(tool zone) tap → a vertex added, selection kept; 11. marker drag of the selected point 8 px → moved, still
|
||||
selected (re-query the marker after the rebuild); 12. read-only twin: tap on `<rect>` → deselected, focus on
|
||||
`[data-testid=catalogue-canvas]`; 13. undo after a tap deselect undoes the earlier edit, redo works;
|
||||
14. typed valid « Centre x », focus moved to the box at pointerdown (as mousedown does, triggering the blur
|
||||
commit and the rebuild), pointerup on the new `<rect>` → committed once AND deselected; 15. same with a refused
|
||||
value → panel closes, document unchanged.
|
||||
- [ ] `tests/unit/routes.catalogue.test.tsx`: zone picked, tap on a drawing `<rect>` → zone panel unchanged.
|
||||
- [ ] Run the touched files, typecheck, lint. Commit (D6b only).
|
||||
|
||||
### Task 5: browser tests, gates, docs — commits `test(app): browser checks for R1 and D6b`, `docs(app): R1 delivered`
|
||||
|
||||
**Files:** new `apps/app/e2e/shell/editor-deselect.spec.ts`; `e2e/support/editor.ts` (only helpers it needs);
|
||||
`e2e/shell/editor-equine.spec.ts` (one new test, last); docs per contract criterion 11; `.claude/tasks/TODO.md`.
|
||||
|
||||
- [ ] Fixture: `seedDraft({ shape: shapeWith(point, zone, link) })` with the detail view of
|
||||
`support/editor.ts:235-275` and `DRAWING_SVG`, so revision 1 is the reference (no recovery offer at reload).
|
||||
Coordinates recomputed before every press (LRN-104); presses away from discs (LRN-108); after each negative
|
||||
("kept") check wait two animation frames.
|
||||
- [ ] `editor-deselect.spec.ts` (`chromium-desktop`; the twin test on `chromium-375`):
|
||||
1. button: live region text, focus on the row; reload → `documentText` equal to revision 1;
|
||||
2. Escape: canvas focused → deselected; field focused → nothing; delete dialog → only it closes (wait for it
|
||||
gone, LRN-111); references panel → closes; tracing → cancelled only;
|
||||
3. mouse: click inner circle, inner rect, root (inside viewBox, outside rect), box margin → each deselects;
|
||||
point, zone interior, link → select; click and dblclick and a 2 px jitter on the SELECTED point and zone →
|
||||
still selected (and `editor-annotations.spec.ts:179-186` stays green);
|
||||
4. zoom in, drag-pan 20 px on empty, marker drag, Ctrl+wheel → kept; 2 px jitter on empty → deselects;
|
||||
5. touch (`hasTouch` context, 1280×800, CDP `Input.dispatchTouchEvent` as `editor-geometry.spec.ts:457-465`): tap
|
||||
→ deselected; a tap on empty drawing with an annotation about 40 px below it, and a tap within 36 px of the
|
||||
canvas bottom (above the add buttons) → deselected, nothing else selected, no pending creation; a tap about
|
||||
6 px outside a marker's hitbox → either that marker selected or deselected, never both (no deselect
|
||||
announcement when the marker ends selected); one-finger drag, two-finger tap, pinch → kept; a capture-phase
|
||||
recorder on the document logs pointerdown (primary / non-primary), pointercancel, pointerup and click with the
|
||||
click target's `data-anno-id`, attached as test annotations; the report states which guard each step reached;
|
||||
6. no draft-save request recorded by `page.on('request')` during steps 1-5;
|
||||
7. valid typed « Centre x » (no blur) then ONE click on the drawing → value applied (unsaved +1) AND the overview
|
||||
shown; « Défaire » reverts the value; « Désélectionner » pressed with an unblurred refused value → panel closed
|
||||
in one click, document unchanged; with an unblurred valid value → committed and closed in one click;
|
||||
8. `chromium-375` (twin, `touch-action: pan-x pan-y`): tap a marker, tap the rect → deselected, focus on the
|
||||
catalogue box; one-finger drag and two-finger tap on the twin → kept (recorder shows pointercancel or multi).
|
||||
- [ ] `editor-equine.spec.ts`: a new test placed right AFTER the copy-creation test in the serial group, reusing
|
||||
`copyId`: select an annotation from the list, click a horse path found by `page.evaluate` (bbox centre whose
|
||||
`elementFromPoint` is that path, no `[data-anno-id]` ancestor) → deselected. Setup and teardown unchanged; the
|
||||
gate report names it executed or skipped.
|
||||
- [ ] Gates in the U1 order (CORRECTIONS:44-48): `pnpm typecheck`, `pnpm lint`, `pnpm test:run`, `pnpm build`,
|
||||
`pnpm e2e:ui`; then `impeccable detect` on the changed components and a fresh design review against board 26
|
||||
(fixes, if any, land now); then `pnpm e2e:shell` (whole suite) on the sandbox on the final src commit (named in
|
||||
the report), exact counts against the baseline; any later src change reruns the suite.
|
||||
- [ ] Docs (criterion 11) incl. limits: Escape from outside the editor workspace does nothing; a refused value is lost when
|
||||
the panel closes (as « Toutes les annotations »); « Toutes les annotations » keeps today's focus (falls to the page
|
||||
when its row is filtered out, noted in TODO); iOS Safari unverified; the two-finger guard proven where the event
|
||||
counts show it. TODO R1 line.
|
||||
|
||||
## Disposition
|
||||
|
||||
- honors BDR-107/108/109/110 (D5, D6, A5, A5b, A6, board 26 normative) by the wording table, the Escape order and
|
||||
the row-else-drawing focus; D6b supersedes BDR-107's « left to U2 » (owner 2026-11-12, BDR at capitalize).
|
||||
- honors BDR-099 item 5: `SheetRoute` and the reader's zone panel unchanged (`onEmpty` optional).
|
||||
- honors BDR-101: only the history labels change (« Abandonner » and dialog « Annuler » unchanged).
|
||||
- honors BDR-104/105/106, LRN-121: shell suite on the sandbox as it stands, never reset, exact counts against the
|
||||
baseline (4 failures `admin.spec.ts:717`).
|
||||
- applies LRN-082, LRN-088, LRN-103, LRN-104, LRN-108, LRN-111, LRN-119, LRN-120, LRN-017, EVAL-042 as cited.
|
||||
|
||||
## Challenge record (rev 1 → rev 2)
|
||||
|
||||
- BLOCKER (correctness 1, robustness 1): click on the selected movable marker retargeted to the box by pointer
|
||||
capture → D6b decides on the press at pointerup (`useEmptyTap`), click path unchanged; tests 4.4 and e2e 3.
|
||||
- MAJOR (correctness 2, robustness 2): blur commit at mousedown rebuilds the drawing, the click can be dropped →
|
||||
pointerup decision; unit 4.14 moves focus at pointerdown; e2e 7 asserts the overview after one click.
|
||||
- MAJOR (simplicity 1): Escape registry replaced by per-body bubbling handlers (structural « shown body only »).
|
||||
- Folded minors: resolved selection (c4), « Plus » state kept local with a capture listener (c3, r5), isComposing
|
||||
(c9), byDrawing in the D6b commit (c10, s6), EditorTabs comment (c11), isPrimary-based multi-pointer (s4, c8, r3),
|
||||
hook in `src/catalogue` (s5), button built from `onShowAll` (s2), ShowAll untouched (s3), tests in existing files
|
||||
(s7), one `isTextField` (s8), no ReferencesPanel edit (s9), gate outcomes section (s10), checklist reworded
|
||||
(s11), drag test re-queries the marker (c6), event counts in touch e2e (c7, r4), equine step as its own last test
|
||||
(r6), focus-on-body limit (r7), no « Désélectionner » during a tracing (r8), server-seeded fixture (r9).
|
||||
|
||||
## Re-challenge record (rev 2 → rev 3; correctness CONCERNS(2), robustness FATAL(2))
|
||||
|
||||
- BLOCKER (robustness 1) + MAJOR (correctness 1): a touch deselect at pointerup moves the layout (SelectionTag,
|
||||
hint) before Chromium builds the tap's click, which lands on what moved under the finger → touch applies the
|
||||
verdict in its own click and only on a target without `[data-anno-id]`; mouse/pen apply at pointerup and swallow
|
||||
the next click (`takeClick`); e2e 5 taps near annotations and the canvas bottom with a recorder.
|
||||
- MAJOR (robustness 2): touch adjustment of a near-miss → deselect then reselect → same click-time rule; e2e 5.
|
||||
- MAJOR (correctness 2) + minor (robustness 9): Escape from the header or tab row did not deselect → the shown body
|
||||
listens on `document` while active (target body or inside the workspace); tests 11.
|
||||
- Minors: « Désélectionner » keeps the field focused during the press (c3) with e2e 7; second finger outside the box
|
||||
via a document capture listener (c4, r4); `verdict` on every pointerup (r4); contextmenu disarms (r3); vertex
|
||||
handles documented and pinned (r5); equine test right after the copy creation (r6); recorder with pointercancel,
|
||||
click targets, twin drag and two-finger at 375 (r7); impeccable and design review before the shell suite on the
|
||||
final commit (r8). Rev 3 is not re-challenged (one re-challenge per run); the verifier, the security gate and the
|
||||
code review judge the result.
|
||||
@@ -0,0 +1,412 @@
|
||||
# PLAN — R2 « Références » tab (V1-2.6) — rev 5
|
||||
|
||||
Contract: `.claude/tasks/contracts/2026-11-12-r2-references-tab-1730.md`. Sources: `docs/development/V1-2-6_U1_CORRECTIONS.md`
|
||||
§R2 (D1-D4), `docs/design/v1-2-6-r0/{ARBITRAGES.md A1-A5, REVUE.md, maquettes.html boards 23-27}`, TODO R2 block
|
||||
(a1d4084), BDR-114, BDR-107..110, BDR-113. Read-before digest: analyzer 2026-11-12.
|
||||
Rev 2 = rev 1 + challenge round 1 (correctness FATAL(5), robustness FATAL(7), simplicity CONCERNS(1)); changes tagged
|
||||
[Cn] / [Rn] / [Sn] with the finding number. Rev 3 = challenge round 2 (section at the end). Rev 4 = owner GO 2026-11-12
|
||||
(brief « GO R2 — Plan révision 3 »): panel from a finding only, arbitrations 1-5, full-row data guard (section at the end;
|
||||
in-place edits marked [O4]).
|
||||
|
||||
Plan form (deviation from writing-plans « full code », stated): ~30 files; each task gives files, behaviour, test cases
|
||||
and verification; executors write the code under TDD. Design = owner-validated boards (BDR-110), no brainstorm.
|
||||
|
||||
## Global rules
|
||||
- Limits: 25 logic lines / function, 100 chars, 5 params, 5 locals, no global state; i18n through `useT()` with fr / en
|
||||
parity; edits only through `useEditCommand` → store.commit (one history entry per action).
|
||||
- Never touch supabase/, crates/, scripts/db-trial*, docker/, packages/supabase/src, components/catalogue/ (reader
|
||||
unchanged) [C9]. No db:trial, no DEV.
|
||||
- Shell runs: `pnpm db:sandbox e2e-shell <explicit spec list>`; NEVER `editor-equine.spec.ts` (owner §3).
|
||||
- Data guard [R6] (superseded by rev 4 G3, full rows): before and after each shell session, per-id snapshot of pre-existing rows of `anatomical_sheets`
|
||||
(id, status, archived_at, updated_at) AND `anatomical_sheet_versions` (id, status, the revision / updated_at columns,
|
||||
md5(content::text)); compared per id (changed or missing = stop); new rows counted and their sheet ids listed per run
|
||||
(owner §3 fixture tracking). Select-only through `pnpm db:sandbox sql`.
|
||||
- Key removal [R10]: before removing any i18n key or helper, grep src, tests and e2e INCLUDING editor-equine; equine is
|
||||
reported « updated, not run ».
|
||||
- R-24: every removed or rewritten assertion mapped in the sub-lot commit body.
|
||||
- Design floor: `impeccable detect <changed .tsx>` on R2.1-R2.4.
|
||||
|
||||
## Decisions (owner answers marked [owner])
|
||||
- P1 [S1] The panel is no navigation place: no `EditorTarget` variant. It opens only through the action
|
||||
`open_citations(citedBy, opener)` (renamed `open_references`, `citedBy` required). Its DOM place name is `citations`
|
||||
(`data-place`, PlaceName member only for its heading and focus scope). R2.1 removes the panel target from
|
||||
`EditorTarget`, `placeOf`, `placeKey`, `moveText` and the panel's own focus-request handler.
|
||||
- P2 « Type » sort = REFERENCE_TYPES order, ties in sheet order.
|
||||
- P3 « Aller à » a reference hidden by the tab search: clear the search only, open the tile, focus it (P8); other open
|
||||
tiles stay open (A2).
|
||||
- P4 [C6] « Tout afficher dans l'onglet Références » = its own action `show_all_references`: closes the panel, then
|
||||
(after exit, P9) selects the tab with a reset signal (search and sort reset, open tiles and a tile in edit kept),
|
||||
focus on the tab heading. Vérification's unresolved reference path selects the tab WITHOUT reset.
|
||||
- P5 [O4] The panel opens ONLY from a finding (`finding_node`), never from a family (`finding_category`): owner GO
|
||||
2026-11-12 overrides the pass-B answer « same panel with family words ». The trigger « {n} références » is rendered
|
||||
only in a finding's detail; a family's detail keeps its inline citation list (« Retirer », picker) and loses the
|
||||
trigger it shows today (shared `FindingContent`). `open_citations` refuses a key that is not a finding (no-op).
|
||||
No family words in the panel. Families still count and appear in a tile's « Citée {n} fois, par : » list (A4).
|
||||
- P6 [C2][R2] focus fallbacks, in order: the trigger (re-found by `data-citations-trigger=<element key>`) if shown →
|
||||
else the active tab button via `focusActiveTab()` (« Plus » button below 640 px). Never a missing heading.
|
||||
- P7 panel: no search, add, delete, reorder (board 25).
|
||||
- P8 [C8] focus target of a reference = the tile's disclosure button, carrying only `data-focus-key` (natural tab
|
||||
stop, no `tabIndex=-1`); the tile is opened first.
|
||||
- P9 [C1][R1][R8] Panel closing is uniform: every close (✕, Escape, scrim, « Tout afficher », « Aller à » from a panel
|
||||
tile, element vanished, tab switch) records ONE pending move (target + focus) in the workspace; the panel animates out
|
||||
(`motion/react` AnimatePresence, enter 180 ms decelerate, exit 140 ms accelerate, translateX only, scrim opacity same
|
||||
timings; `useReducedMotion` → no transition); `onExitComplete` lifts the page `inert`, keeps
|
||||
`ReferencesOpenContext` true until then, and applies the pending move. The panel is `inert` during exit and
|
||||
unmounted after. Focus helpers report « found » only when `document.activeElement` is the target. Page inert through
|
||||
exit is kept (approved CORRECTIONS §R2 text, owner « y compris pendant son animation de sortie »).
|
||||
- P10 editor-equine: helper calls updated, never run.
|
||||
- P11 [owner] 640-1 023 px: five tabs, row may wrap, no horizontal scroll.
|
||||
- P12 [R11] tab search: explicit Escape handler: non-empty query → clear + `preventDefault`; empty → let it bubble (A5).
|
||||
- P13 trigger gains `aria-expanded` + `aria-controls="editor-citations-panel"`.
|
||||
- P14 tile ids prefixed by host (`tab-` / `panel-`).
|
||||
- P15 [owner] « Retirer … » marks the element « À confirmer » (core rule); documented; one « Défaire » restores both.
|
||||
- P16 [C4][C5][R5] Geometry: the Places container gets `overflow-x: clip` (never `hidden`: sticky must keep working)
|
||||
and NO open-state `min-h` toggle; the panel wrapper is `absolute inset-y-0 right-0 w-[min(34rem,100%)]`, the panel
|
||||
inner `sticky top-14 h-full max-h-[calc(100dvh-3.5rem)]` with its own scrolling list, so it never exceeds the
|
||||
container: document height and width never change on open / close / during motion. Heading focus on open uses
|
||||
`preventScroll` and happens after enter completes.
|
||||
- P17 labels table file: `docs/development/V1-2-6_R2_LABELS.md`.
|
||||
- P18 [S4] count wording: reword `editor.references.cited_*` in place to « Citée {n} fois » (capital) and add
|
||||
`editor.references.uncited` « Non citée »; no parallel keys.
|
||||
- P19 [S3] one memoised `citersOf(doc): Map<refId, CiterItem[]>` (families and nodes at any depth); tile count =
|
||||
list length; `citationCounts` derived from it (or removed with its last consumer).
|
||||
- P20 [C3][R2] After « Retirer … »: focus the next tile's disclosure button, else the previous, else the panel heading;
|
||||
zero citations left → the panel stays open with the line « Ce constat ne cite plus aucune référence. » (new
|
||||
provisional label) + « Tout afficher » [O4]; close then follows P6 (the
|
||||
trigger is gone when its count is 0).
|
||||
- P21 [C2][R2] Selecting a tab while the panel is open closes it (pending move = the tab; focus on the new tab button).
|
||||
Défaire / Refaire stay usable with the panel open; an undo that removes the element triggers P6.
|
||||
- P22 [R3] Leaving edit is guarded: « Terminer », switching `editingId`, « Ajouter » while another tile is in edit,
|
||||
and closing the panel with a tile in edit first commit the pending field; on refusal the tile stays in edit, the
|
||||
refused field shows its message and takes focus, and the leave is cancelled.
|
||||
- P23 [R4] Pinning: while `editingId` (or the add draft) is set, that tile stays in the shown set at its current index
|
||||
whatever the sort or search, until it leaves edit.
|
||||
- P24 [C12] Add: « Ajouter une référence » resets search and sort, appends a draft tile in edit (Type « Choisir… »,
|
||||
Citation focused); « Ajouter la référence » creates it in one modification; on success the tile stays open, leaves
|
||||
edit, focus on its disclosure button.
|
||||
- P25 [S2] `ReferenceLibrary` (R2.1 extraction) is folded into `ReferencesTab` at R2.4; only `ReferenceTile` is shared.
|
||||
- P26 [C9] links: `editor/references/safeLink.ts` (http / https only; DOI → `https://doi.org/<encoded doi>`);
|
||||
`target="_blank" rel="noopener noreferrer"`; the catalogue's `safeHref` is not touched.
|
||||
|
||||
## R2.0 — rename the panel's DOM place (no visible change) — `refactor(editor): …`
|
||||
Scope [S1][C10]: the `data-place` / KeptPlace `name="references"` literal, the PlaceName member, `headingOf`,
|
||||
`ownedBy` uses, DOM ids `editor-references-panel` / `editor-references-title` → `editor-citations-*`;
|
||||
`editor/annotations/deselect.ts` only if it names the place; tests and e2e literals. Not renamed (deleted in R2.1): the
|
||||
EditorTarget variant, MoveKinds.
|
||||
E2E [S7]: library assertions routed through one helper (`libraryRoot(page)`) in `e2e/support/editor.ts`, so R2.1
|
||||
changes one line; `place(page,'citations')` only at the true panel sites.
|
||||
Proof [R9][C10]: `grep -rnE "['\"]references['\"]" apps/app/src apps/app/tests apps/app/e2e` reviewed hit by hit (each
|
||||
remaining hit justified in the commit body), plus `name="references"` absent.
|
||||
Gate: typecheck, lint, test:run, build; e2e:shell crossing, journeys, shell, structures, deselect, access,
|
||||
shell-layout + data guard. Commit + push.
|
||||
|
||||
## R2.1 — five tabs, navigation, library in the tab — `feat(editor): …`
|
||||
- `tabs.ts` five tabs; `SHOWN.small` unchanged (« Plus » = general, findings, references); `REFERENCES_BUTTON_ID`
|
||||
removed. `EditorTabs.tsx` row may wrap (P11).
|
||||
- `components/editor/tabs/ReferencesTab.tsx` in `EditorTabBody` BODIES; h2 « Références » with `data-place-heading`;
|
||||
hosts `ReferenceLibrary` (list of the current cards, form, DeleteDialog, search), ids `tab-` (P14).
|
||||
- `navigation.ts`: reference keys → `{place:'tab', tab:'references', key}`; panel EditorTarget removed (P1);
|
||||
`open_citations(citedBy, opener)`; `show_all_references` (P4); `select_tab` closes the panel (P21); pending move
|
||||
plumbing (P9) introduced here with the current (non-animated) panel so focus rules hold from R2.1.
|
||||
- `verification.ts` reference issues → tab; `useEditorNavigation.ts` landing on the tab heading; fallbacks P6.
|
||||
- Header button, separator and props removed (HeaderActions, DraftHeader, EditorWorkspace).
|
||||
- Trigger (FindingContent, finding nodes only [O4] P5): `open_citations`, `data-citations-trigger`, `aria-expanded`,
|
||||
`aria-controls` (P13); removed from a family's detail (R-24 row in the commit body, e2e / unit using it remapped).
|
||||
- i18n: `editor.tab.references`; removals per [R10].
|
||||
- E2E [C7][R7]: tier-aware `openTab(page, dict, tab)` (opens « Plus » below 640 px); `TABS` five; each existing
|
||||
`openReferences` call mapped explicitly (R-24 table in the commit body) to `openTab(…,'references')` (library) or
|
||||
`openCitations(page, dict, element)` (panel), keeping today's narrow-width panel axe and overflow checks through
|
||||
`openCitations` at 320 / 375 / 768 / 800 px; `warm-up.ts` uses the tab (same commit).
|
||||
- Unit tests rewritten with R-24 mapping (editor-mode, editor-route, editor-references-panel → finding path only [S2],
|
||||
editor-tabs-lists, editor-navigation, editor-focus-request, editor-keep-alive, editor-escape (A5 panel layer through the
|
||||
trigger), editor-no-loss(-decisions), editor-route-recovery, editor-verification); new: select_tab closes panel,
|
||||
P6 fallbacks, Vérification « Aller à » reference → tab + focused row.
|
||||
Gate: typecheck, lint, test:run, build, e2e:ui, e2e:shell (editor-* except equine, admin, shell, journeys) + data
|
||||
guard; impeccable detect. Commit + push.
|
||||
|
||||
## R2.2 — collapsible tiles — `feat(editor): …`
|
||||
- `ReferenceTile.tsx` (board 23 / 24 C / D / 27): header `<button aria-expanded aria-controls>` (≥ 44 px, P8), 2-line
|
||||
clamp, meta column (type badge, « Citée {n} fois » / « Non citée »), phone meta row; open body `dl` Type / DOI / URL
|
||||
via `safeLink` (P26) else « Aucun » / « Aucune »; « Citée {n} fois, par : » list from `citersOf` (P19) with
|
||||
« famille » badge and « Aller à » (44 px) or the empty line; actions « Modifier »; « Supprimer » only uncited (existing
|
||||
DeleteDialog) else the hint; « Monter » / « Descendre » (R2.3 decides visibility).
|
||||
- Edit mode (24 D): title « Modifier la référence », Type | DOI, Citation textarea focused, « Adresse web (URL) »,
|
||||
cited rows, only « Terminer » with the P22 guard; pinning P23.
|
||||
- Tab state kept mounted (A2): `openIds`, `editingId`; reset on editor reopen.
|
||||
- Read-only (24 C): no edit control; DOI, URL, « Aller à » kept.
|
||||
- Unit: disclosure keyboard, several open, cited hint vs uncited Supprimer, edit hides actions, P22 refusals (schemeless
|
||||
URL, blank citation) keep edit and focus the field, edit survives a tab change, read-only, `javascript:` never a
|
||||
link, counts = list length including families, several findings citing one reference.
|
||||
- E2E: start `e2e/shell/editor-references.spec.ts` (tiles closed / open / edit, read-only twin at 375 via « Plus »,
|
||||
axe on closed / open / edit, keyboard walk through tile headers).
|
||||
Gate: as R2.1 + the new spec. Commit + push.
|
||||
|
||||
## R2.3 — search, sort, count, add, reorder — `feat(editor): …`
|
||||
- `editor/references/sort.ts` `sortReferenceIds` pure (sheet / citation with `Intl.Collator(locale,
|
||||
{sensitivity:'base', numeric:true})` / count desc / type P2; ties in sheet order); new array, inputs untouched.
|
||||
- Toolbar (23 / 24 / 27 B): search + « Effacer la recherche » (focus back) + P12 Escape; « Trier par » external label +
|
||||
native select; count « {n} références » / « {n} références sur {total} »; « Ajouter une référence » (edit modes).
|
||||
- No result (24 B): notice + « Effacer la recherche » button.
|
||||
- A1 move buttons only in sheet order without search, else the hint line.
|
||||
- Add P24; pinning P23; « Aller à » P3 / P8.
|
||||
- Unit: each sort stable on a fixture (equal citations, accents, numbers, mixed types); document text + history length
|
||||
identical before / after every sort and search; clear button; no-result notice; A1 matrix; add flow; P23 (edit under
|
||||
citation sort and under search keeps the tile in place); Vérification « Aller à » hidden tile.
|
||||
- E2E (editor-references.spec): four sorts visible order, search / clear / no result, A1, add, delete uncited, server
|
||||
document and revision unchanged after sorts / searches.
|
||||
Gate: as R2.2. Commit + push.
|
||||
|
||||
## R2.4 — contextual panel — `feat(editor): …`
|
||||
- `CitationsPanel.tsx` (board 25): overlay geometry P16; header book icon + « Références citées » + ✕ 44×44 « Fermer
|
||||
les références »; path line; count line « {n} références citées par ce constat » + « Tout afficher dans l'onglet Références »
|
||||
(P4); tiles (meta 132 px) with « Modifier », « Retirer de ce constat » (P15, P20), « Aller à »; « ce constat » badge;
|
||||
P7; zero state P20 [O4].
|
||||
- Motion and focus P9, P6, P21, P22 (close with a tile in edit); `ReferenceLibrary` folded into `ReferencesTab` (P25).
|
||||
- Unit: open only through a finding's trigger; a family's detail has no trigger and `open_citations` with a family key
|
||||
is a no-op [O4]; filtered; Retirer removes only that id, reference stays, one undo
|
||||
restores (and the review status); P20 focus chain and zero state; P4 reset + heading focus; every close path applies
|
||||
its pending move after exit and the focused element is the expected one (activeElement); P21; P6 after undo; reduced
|
||||
motion (no transition) vs normal; inert page and panel during exit; `ReferencesOpenContext` until exit; read-only: no
|
||||
Modifier / Retirer.
|
||||
- E2E [C11][R7]: `e2e/shell/editor-citations.spec.ts` in THIS sub-lot: desktop + 375 px (full-width panel via
|
||||
« Plus » → Constats): open, filtered, Retirer + Défaire, Tout afficher, each close path with `document.activeElement`
|
||||
checked after exit, Escape (A5), inert during exit (keyboard cannot reach the page), reduced motion
|
||||
(`emulateMedia`), axe open (edit and read-only). Widths / shift only in `editor-shell-layout.spec.ts` [S6]: 1 024,
|
||||
1 180, 1 279, 1 280 + 375, panel ≤ 34 rem and ≤ viewport, `documentElement.scrollWidth` / `scrollHeight` sampled
|
||||
before, during (motion on) and after open and close [R5].
|
||||
Gate: as R2.3 + citations spec + layout spec. Commit + push.
|
||||
|
||||
## R2.5 — non-regression sweep — `test(tests): …` (only if changes are needed)
|
||||
- Full gates on the final state: typecheck, lint, test:run, build, e2e:ui, e2e:shell ALL specs except
|
||||
`editor-equine.spec.ts` (explicit list), the two new specs run twice; data guard; R-24 audit of the whole R2 diff
|
||||
(no assertion lost without a mapped replacement); gaps found here are fixed in this sub-lot.
|
||||
|
||||
## R2.6 — docs, labels, closure — `docs(…): …`
|
||||
- `docs/development/V1-2-6_R2_LABELS.md`: every new / changed / removed key (key, FR, EN provisional, where, ambiguity
|
||||
notes; among them the tile badge « famille » (A4, REVUE) while the editor still says « Catégorie » until U2b F7) [O4].
|
||||
- `RUST_ARCHITECTURE_REVIEW.md` Part II §II.2 rows (class C, phase n/a) for `editor/references/{filter,citations,sort,
|
||||
safeLink}.ts` + §II.3 bullet (BDR-114 A).
|
||||
- `V1-2-6_U1_CORRECTIONS.md` §R2 status (incl. P15 « À confirmer », P20, P21); `BROWSER_TESTS.md` (new specs, equine
|
||||
excluded); `V1-2-6_OWNER_TRIAL.md` R2 db:trial protocol; `CLAUDE.md` tree.
|
||||
- Then STEP 5 (fresh verifier on the enriched contract, security), STEP 6 code review (opus), doc sync, capitalize;
|
||||
stop at the checkpoint.
|
||||
|
||||
## Verification per sub-lot
|
||||
SDD per task (implementer sonnet + spec review + quality review) → sub-lot gate → commit + push; a red gate blocks the
|
||||
commit. Fresh verifier + security + code review on the whole of R2 at the end.
|
||||
|
||||
## Risks kept
|
||||
- Larger R-24 mapping load (13 unit files, 8 specs, warm-up) → per-commit tables.
|
||||
- happy-dom cannot show layout, motion or inert focus loss → each is proven in Chromium in the same sub-lot.
|
||||
- editor-equine updated but unverified until its separate fix.
|
||||
|
||||
## Rev 3 — challenge round 2 (robustness FATAL(5), correctness CONCERNS(2)); these override rev 2 where they differ
|
||||
- G1 [R2-1 BLOCKER] Shell commands use full paths only (`e2e/shell/<name>.spec.ts`), never a bare token (`shell`,
|
||||
`editor-` match every file: Playwright args are regexes on the absolute path). Mandatory preflight before every run:
|
||||
`pnpm db:sandbox e2e-shell --list <same args> | grep -q editor-equine && abort`. Each gate below lists its exact files.
|
||||
- G2 Data guard queries run inside `begin transaction read only; … rollback;` [R2-12].
|
||||
- P22' [R2-2][C2-1] Leave guard covers EVERY edit field of the tile: fields expose their draft through a tile-level
|
||||
registry; leaving re-commits each field whose draft ≠ document value; any refusal blocks the leave and focuses that
|
||||
field. Unit: « A refused, then B committed OK, then Terminer » keeps edit.
|
||||
- P22'' [R2-3][C2-2] The panel registers `canLeave(): boolean` with the workspace; every USER close (✕, Escape, scrim,
|
||||
Tout afficher, Aller à, tab click) calls it before recording the pending move; refusal cancels the whole close (tab not
|
||||
switched). FORCED closes (element vanished, read-only flip, conflict reload) proceed; a refused draft is dropped and
|
||||
announced in the live region (new provisional label « Saisie non appliquée : … »).
|
||||
- P23' [R2-4][R2-14] Pin only when sort ≠ sheet order or a search is active; in read-only the pin is suspended and the
|
||||
tile renders read view; the add draft is kept in an EditOnly-style hidden container and resumes when editable;
|
||||
`openIds` / `editingId` pruned of ids absent from the document on each render.
|
||||
- P27 [R2-5] Panel and workspace Escape handlers ignore `isTextField(target)` and `isComposing` (A5: a field keeps
|
||||
Escape); unit + e2e: Escape in a panel tile textarea neither closes nor commits.
|
||||
- P28 [R2-6][R2-7] During exit: a second close is a no-op; a tab select replaces the pending move; the pending focus is
|
||||
skipped if the user moved focus off `body`; a one-shot fallback timer (exit duration + 100 ms) lifts inert and applies
|
||||
the move if `onExitComplete` has not fired.
|
||||
- P9' [C2-3] `onExitComplete` only sets state (exiting=false + pending move); focus is applied by the existing
|
||||
`useMoveFocus` effect after that commit (never inside the callback).
|
||||
- P16' [R2-8][C2-4][C2-5] `overflow-x: clip` on the panel's absolute wrapper only (translateX on the inner panel); tab
|
||||
content keeps its focus rings. Places gets a PERMANENT (never toggled) `min-h-[calc(100dvh-3.5rem)]` so the panel and
|
||||
scrim reach the bottom as on board 25 and the document height never changes on open / close (shown at the gate).
|
||||
- P29 [C2-6] Reduced motion keeps the same AnimatePresence with zero-duration transitions (callbacks fire); focus on
|
||||
open after enter completes in both modes. Deviation from the CORRECTIONS text (« Tailwind motion-reduce: » + « class »
|
||||
test): `motion/react` `useReducedMotion` (MobileDrawer precedent), shown at the gate.
|
||||
- P30 [R2-9] Dangling citation ids: the panel lists them as « Référence introuvable » rows with « Retirer » (new
|
||||
provisional label); trigger count, panel count and zero state use the same list.
|
||||
- P31 [R2-10][C2-8] Tile UI state, DOM ids and focus keys use position + id (duplicates stay visible and distinct);
|
||||
sort works over positions.
|
||||
- P26' [R2-13][C2-9] DOI link: strip a leading `doi:` / `https://doi.org/` / `http://dx.doi.org/`, link only
|
||||
`^10\.\d{4,9}/\S+$`, encode per segment keeping `/`; test with the seed DOI `10.1892/0891-6640(2002)016<0697:toih>2.3.co;2`.
|
||||
- P6' [R2-11] Trigger re-found by comparing `dataset` values, never a raw attribute selector.
|
||||
- E1 [C2-7] e2e seeded shape gains one reference cited by one finding (counts in other specs checked); the two layout
|
||||
tests that opened the panel over the drawing are remapped: drawing box measured before open and after a P21 switch to
|
||||
Annotations (the panel no longer exists on Annotations).
|
||||
- E2 [R2-15] Timing checks sampled in-page with a rAF loop started before the click (or `page.clock`), asserting the
|
||||
`inert` attribute, not a racing key press.
|
||||
- E3 [C2-10] R2.1 interim panel: its add form and search are dropped; `gone` wired to the P6 close path; `onShowAll`
|
||||
only for « Tout afficher ».
|
||||
|
||||
### Exact shell gate file lists (G1)
|
||||
- R2.0: e2e/shell/editor-shell-crossing.spec.ts e2e/shell/editor-shell-journeys.spec.ts e2e/shell/editor-shell.spec.ts
|
||||
e2e/shell/editor-structures.spec.ts e2e/shell/editor-deselect.spec.ts e2e/shell/editor-access.spec.ts
|
||||
e2e/shell/editor-shell-layout.spec.ts
|
||||
- R2.1-R2.4: the R2.0 list + e2e/shell/editor-annotations.spec.ts e2e/shell/editor-geometry.spec.ts
|
||||
e2e/shell/editor-journey.spec.ts e2e/shell/editor-recovery.spec.ts e2e/shell/editor-drawings.spec.ts
|
||||
e2e/shell/editor-signout.spec.ts e2e/shell/admin.spec.ts e2e/shell/shell.spec.ts + the new R2 specs as they land
|
||||
- R2.5: every file of `ls e2e/shell/*.spec.ts` except editor-equine.spec.ts, written out in full in the command.
|
||||
|
||||
## Rev 4 — owner GO 2026-11-12 (brief « GO R2 — Plan révision 3 »); overrides rev 2 and rev 3 where they differ
|
||||
- O4-1 Panel from a finding only: P5 rewritten in place; criteria 3 and 6 of the contract corrected; the pass-B family
|
||||
answer is superseded (contract CLARIFICATIONS). The library stays reachable from the Références tab (R2.1).
|
||||
- O4-2 [arbitration 1] Places keeps the PERMANENT `min-h-[calc(100dvh-<top bar>)]` (P16'): `dvh` follows the mobile
|
||||
URL bar and every viewport change (rotation, resize, on-screen keyboard); `<top bar>` is the editor's real sticky
|
||||
offset, verified at every tier before use (3.5rem assumed by rev 3; any other value or a tier difference uses the
|
||||
same token as the sticky `top`). No drawing move, no horizontal overflow. E2E (layout spec): 375 × 667, then a
|
||||
height change to 375 × 560 and a rotation to 667 × 375 with the panel open: `scrollWidth` ≤ `clientWidth`, panel
|
||||
bottom = viewport bottom, drawing box unchanged across open / close. Limit stated: Chromium cannot emulate a real URL
|
||||
bar collapse; the resize stands in for it.
|
||||
- O4-3 [arbitration 2] `motion/react` accepted; P29 kept; every close path checks `document.activeElement` after exit
|
||||
in BOTH modes (normal and `emulateMedia({ reducedMotion: 'reduce' })`), unit and e2e.
|
||||
- O4-4 [arbitration 3] Provisional FR labels accepted: « Ce constat ne cite plus aucune référence. », « Référence
|
||||
introuvable », « Saisie non appliquée : … »; EN not ratified one by one; full FR/EN table at the R2.6 checkpoint.
|
||||
- O4-5 [arbitration 4] « Type » sort: REFERENCE_TYPES business order; equal types keep the stored order (position),
|
||||
so the result is deterministic and stable; unit test: same output for every input permutation of equal-type items
|
||||
restored to stored order, and inputs untouched.
|
||||
- O4-6 [arbitration 5] « Tout afficher » resets search and sort only; open tiles and any tile in edit (tab or panel) are
|
||||
kept. A panel tile in edit goes through P22'': a valid draft is committed before the close, a refused draft cancels
|
||||
the close (field focused, message shown): never a lost valid entry, never an unexpected close. Unit + e2e.
|
||||
- G3 [owner data controls] Full-row data guard replaces R6 / G2: `scratchpad/r2/guard.sh` (read-only transaction,
|
||||
`pnpm db:sandbox sql`) hashes EVERY column (metadata included: updated_at, archived_at, status…) of EVERY row of every
|
||||
base table of `public`, `audit`, `storage` and of `auth.users`, keyed by table + id; before / after each shell run;
|
||||
any pre-existing row changed or deleted, in any table = stop and present before the commit; new rows counted per
|
||||
table (fixture tracking). Baseline 2026-11-12: 197 018 rows, two consecutive snapshots identical.
|
||||
- G4 Every shell run goes through `scratchpad/r2/run-shell.sh <label> <full spec paths>`: refuses a bare argument or
|
||||
an editor-equine path, aborts if `--list` names editor-equine, then snapshot, run, snapshot, diff. editor-equine is
|
||||
never run; its helper calls are updated for typecheck only and reported « mis à jour, non exécuté, non vérifié ».
|
||||
|
||||
## Rev 5 — owner corrections 2026-11-13 (brief « décisions sur le bilan R2 »); overrides earlier revs where they differ
|
||||
Owner decisions: read-only flip keeps the panel open (ratified; criterion 15 amended); « Annuler l'ajout » approved;
|
||||
V1-2 contract note authorised; three UX fixes before the db:trial trial; admin.spec: non-destructive diagnosis only,
|
||||
no grant pagination here (RR-13), no reset, no deletion; BDR-115, LRN-133..135, BLK-015 authorised (BDR-115: R2 built,
|
||||
manual validation pending; BLK-015 open). Visible behaviours below are the controller's choices under the owner's
|
||||
delegation (« Prévois un comportement cohérent et vérifiable »), reported at the checkpoint; new labels provisional.
|
||||
Stop and present before any change of architecture or of the document model. Commits: one per task, pushed.
|
||||
|
||||
### C0 — admin.spec diagnosis (controller, no code)
|
||||
Read-only counts (grants per day, accounts); `git diff 65a8fd3..HEAD` on admin sources and shared files; interleaved
|
||||
A/B runs of `admin.spec.ts` alone through the guarded wrapper (`run-shell-wt.sh`): HEAD, pre-R2 worktree 65a8fd3
|
||||
(scratchpad, same lockfile, wasm module copied: no crates change), HEAD, base; duration and free memory per run.
|
||||
Conclusion rule: same failures at base and HEAD on the same data = not R2; base green and HEAD red = R2 regression
|
||||
(stop, fix). Results and the tests still failing documented (C5) and in BLK-015.
|
||||
|
||||
### C1 — dropped drafts never silent, read-only flip without history (owner 1, 5b) — `fix(editor): …`
|
||||
- The drop slot moves from the tile (`useRef` in `ReferenceTile`, `useDropNote`) to the tile state owner
|
||||
(`useTileState`, shared by the tab library and the panel): `dropped: { key, fields } | null`. An edit view unmounted
|
||||
with pending drafts outside an explicit leave (read-only flip; its reference removed by an undo or a reload) records
|
||||
ALL pending fields in `FIELDS` order (no longer only the first). The owner announces once in the polite live region
|
||||
« Saisie non appliquée : {field} » (fields joined by « , »), even when the tile is no longer shown.
|
||||
- Visible note: the tile whose key holds the drop shows the same text in its body (warning style + icon, plain
|
||||
paragraph, not a second live region), in read view and, after a flip back, in the edit view above « Terminer ». The
|
||||
note ends with the next tile action of that owner (toggle, « Modifier », « Terminer », « Ajouter une référence »)
|
||||
or a newer drop.
|
||||
- Pin (P23' amended): no longer suspended while read-only; the tile that entered edit stays shown at its index across
|
||||
the flip whatever the search or the sort (so its note is seen). It still ends at the next search or sort change
|
||||
unless it is the tile in edit, at `reset` and « Tout afficher ». The M3 test is rewritten (R-24 mapping).
|
||||
- Unchanged: the flip commits the focused field first (`useTabTier`), one history entry for that typed change only;
|
||||
the flip itself writes nothing; the panel stays open; a panel forced close (P22'') keeps its own note and is never
|
||||
announced twice.
|
||||
- Tests (unit): (a) refused URL + flip: note visible in the tile, one announcement, `references` deep-equal, undo and
|
||||
redo lengths unchanged, read view shows the document URL; (b) valid focused draft + flip: undo +1 exactly, no note;
|
||||
flip back: +0; (c) nothing pending: +0, no note, silence; (d) search not matching the tile in edit + refused draft +
|
||||
flip: tile still shown with the note (N1 probe); (e) two refused fields: both named; (f) note kept across flip back,
|
||||
cleared by « Terminer », toggle, « Modifier »; (g) panel: flip with a refused draft → note in the panel tile, one
|
||||
announcement; forced close (finding gone) with a refused draft → exactly one announcement; (h) undo removing the
|
||||
reference of a tile in edit with a refused draft → one announcement. E2E (editor-references): search, edit out of
|
||||
the search, refused URL, resize 1 280 → 800: tile and note visible, live region text; back to 1 280: note still
|
||||
there, URL field shows the document value; « Terminer » removes the note.
|
||||
|
||||
### C2 — « Annuler l'ajout » (owner 3) — `feat(editor): …`
|
||||
- Draft tile: secondary button « Annuler l'ajout » (`editor.references.add_cancel`, EN « Cancel adding »,
|
||||
provisional) after « Ajouter la référence ». Escape anywhere inside the draft tile, not during IME composition and
|
||||
not already handled, does the same and marks the event handled.
|
||||
- Cancel: the draft tile unmounts, nothing reaches the document, the « form » error goes with it, undo and redo stacks
|
||||
untouched (a redo available before stays available), focus on the toolbar's « Ajouter une référence »; the search
|
||||
and sort reset by the add (P24) are not restored. A new add starts from an empty form. Read-only: unchanged (hidden).
|
||||
- Tests (unit): button and Escape (citation field, type select, a button): tile gone, `references` identical, undo and
|
||||
redo lengths unchanged incl. a pending redo, focus on the add button, fresh form after a new add; Escape while
|
||||
composing: nothing; cancel after a refusal message; « Défaire » after a cancel undoes the previous real change.
|
||||
E2E (editor-references): add, type, « Annuler l'ajout »: count unchanged, focus on « Ajouter une référence »,
|
||||
Défaire / Refaire states unchanged; same with Escape.
|
||||
|
||||
### C3 — tile outside the search after « Terminer » (owner 5c) — `fix(editor): …`
|
||||
- A shown tile that does not match the search (only a pinned one can) carries a muted line right under its header:
|
||||
« Ne correspond pas à la recherche » (`editor.references.outside_search`, EN « Does not match the search »,
|
||||
provisional), in edit, after « Terminer » and in read-only.
|
||||
- The no-result notice (board 24 B) shows only when no tile at all is shown; while a pinned tile shows outside the
|
||||
search it is not shown (the count « 0 référence sur N » and the tile's line say it; the search field keeps its ✕).
|
||||
- Tests (unit): « Terminer » on a tile edited out of the search: tile shown with the line, no notice, count 0 sur N,
|
||||
focus on its header; next search change: tile gone, notice shown; tile in edit not matching: line; matching pinned
|
||||
tile: no line. E2E: the same journey in editor-references.
|
||||
|
||||
### C4 — landscape 667 × 375 by touch (owner 5a) — `fix(editor): …`
|
||||
- First a failing-or-passing proof (layout spec, phone project, `hasTouch`): 667 × 375 read-only, « Constat A »
|
||||
selected by tap, the trigger brought into view by a touch scroll (CDP `Input.synthesizeScrollGesture`,
|
||||
`gestureSourceType: 'touch'`), hit-testable (`elementFromPoint`), opened by `tap()`; then the panel heading and ✕
|
||||
inside the viewport and hit-testable without a user scroll. Second case: panel open at 375 × 667 scroll 0, rotation
|
||||
to 667 × 375: heading and ✕ visible and hit-testable without a user scroll.
|
||||
- Fix where the proof fails: `CitationsLayer` re-fits on entry and on a viewport WIDTH change while open (never on a
|
||||
height-only change: on-screen keyboard): if the panel's visible height is below min(240 px, viewport − top bar), the
|
||||
window scrolls at once (no smooth scroll) so the Places container's top sits under the top bar (clamped to the
|
||||
page's scroll range). The document size never changes. The user's own scroll back to 0 stays allowed (cramped
|
||||
exception of `expectPanelWithin` kept, comment updated).
|
||||
- If touch cannot reach the trigger at all (covered, inert, layout), stop and present: no layout redesign here.
|
||||
|
||||
### C5 — docs (owner 4) — `docs(docs): …`
|
||||
`V1-2_ANATOMICAL_SHEETS.md`: « **Note 2026-11-13:** … superseded by D1 to D4 of R2 … » before the ~1 361 bullet and
|
||||
before the ~2 804 « Validated UX » paragraph (style of the 2026-11-12 note). `V1-2-6_R2_LABELS.md`: new keys, changed
|
||||
uses, totals; `V1-2-6_OWNER_TRIAL.md` §4.10: steps for cancel add (button, Échap), read-only flip with a refused
|
||||
draft, the outside-search line, landscape by touch; `V1-2-6_U1_CORRECTIONS.md` §R2: corrections wave, admin.spec
|
||||
diagnosis and the tests still failing; `BROWSER_TESTS.md`: new tests, admin.spec status.
|
||||
|
||||
### C6 — closure (controller)
|
||||
Static gates, e2e:ui, e2e:shell every spec but editor-equine through the wrapper (admin.spec in its own run), guard OK
|
||||
each run; fresh verifier on criteria 15 (amended) and 21-29; security gate on 52aac41..HEAD; opus review of the
|
||||
corrections diff; memory entries; contract evidence; checkpoint. editor-equine: never run.
|
||||
|
||||
### Rev 5b — challenge of rev 5 (correctness CONCERNS(2), robustness CONCERNS(2), simplicity CONCERNS(1)); overrides rev 5
|
||||
- C0 [rob-1, cor-9] Done: 4 interleaved runs, identical 3 failures at base and HEAD (ledger). Added: grant count logged
|
||||
before each run, and a POSITIVE dose-response probe with no data change: a temporary, never-committed copy of
|
||||
admin.spec whose `list_catalog_grants` answer is capped by `page.route` to its 753 newest rows (the list is
|
||||
`granted_at desc`, so the test's own grants stay); capped runs vs a full control run. Rule: capped green + full red
|
||||
= accumulation proven; anything else (mixed, both green, both red) = inconclusive, presented as such, never assumed.
|
||||
- C1 [simp-3, cor-1, cor-2, rob-3..7, cor-3..7] The drop slot STAYS in the tile (no lift): a tile-local `useState`
|
||||
replaces the `useRef`; the edit view's unmount cleanup writes it ONLY when fields are pending (never clears it:
|
||||
StrictMode remount in e2e), naming ALL pending fields in `FIELDS` order. With the pin kept in read-only the tab tile
|
||||
stays mounted across the flip, panel tiles are never filtered: the note is always seen on its tile.
|
||||
- `LeaveGuard` returns the list of refused fields (it tries every pending field, focuses the first refused); a user
|
||||
close still refuses; the panel FORCED close note names every refused field (same « , » join). Test with two
|
||||
refused fields (blank citation + schemeless URL) on the forced path.
|
||||
- Pin follows `editingKey` through read-only; `reset` / « Tout afficher » re-pin `editingKey` (if any) at its index
|
||||
in the reset view instead of null; the read-only branch of `pinAfterChange` and the `readOnly` parameter of
|
||||
`useReferenceView` are removed. R-24: rewrite the M3 test and « is suspended in read-only: the tile renders its read
|
||||
view » (editor-references-view.test.tsx ~370-379).
|
||||
- Read-only toggle on the tile still in edit state: ends the edit state AND collapses (openKeys), clears the note;
|
||||
tested with aria-expanded.
|
||||
- Focus on a flip: the field that held the focus inside a tile (tab or panel) gives it to that tile's header (not
|
||||
the tab row); `activeElement` asserted in the flip tests.
|
||||
- Note ends on that tile's toggle, « Modifier », « Terminer », « Ajouter une référence » (tab), or a newer drop.
|
||||
- Unit flips go through `mountDraft` + `setWidth` + resize (`cross()`, editor-no-loss.test.tsx), inside
|
||||
`<StrictMode>`, so the `useTabTier` commit is exercised; announcements counted with a spy / observer.
|
||||
- Stated limits (checkpoint, not built): the reference removed by an undo / reload while its tile holds a refused
|
||||
draft (tile gone, draft gone with its reference); an undo / redo of the same field replacing a pending draft in a
|
||||
mounted view; two drops in the same flip (tab tile + panel tile) share one live-region update, only the last is
|
||||
spoken (both notes stay visible).
|
||||
- C2 [rob-2] Escape cancels from a non-text target of the draft tile (select, buttons, the tile), and from a text field
|
||||
only while the form is pristine (type unset, every field empty); with typed text Escape stays the field's. Composing
|
||||
= `isComposing` or `keyCode === 229`. Unit: typed citation + Escape in the field → draft kept.
|
||||
- C3 [simp-7, rob-10] Notice condition: `shown.positions.length === 0` with references present (the draft tile does not
|
||||
count). The header button carries `aria-describedby` to the outside-search line.
|
||||
- C4 [simp-1, simp-2, rob-8, rob-9, cor-8] Proof only: case 1 (touch scroll of the WORST distance: the trigger's bottom
|
||||
brought just to the viewport bottom, then `tap()`; heading and ✕ in the viewport and hit-testable). If it passes:
|
||||
test + docs, no code. If it fails: the fix scrolls only on the proof's own condition (heading or ✕ outside the
|
||||
viewport), after the commit, on panel entry only; stop and present if more is needed. The rotation-at-scroll-0 case
|
||||
and an auto-scroll are NOT built: offered at the checkpoint as an option, the documented limit kept.
|
||||
- C6 [rob-11] The final sweep includes admin.spec with the other specs (reported as is) AND an isolated admin.spec run;
|
||||
the isolated result never stands for the gate.
|
||||
@@ -0,0 +1,494 @@
|
||||
# R2 UX finish — design and plan (rev 3a: rev 3 approved by the owner 2026-11-13, precisions folded)
|
||||
|
||||
Contract: `.claude/tasks/contracts/2026-11-13-r2-ux-finish-1624.md` (verbatim owner brief 2026-11-13, criteria 1-12).
|
||||
Worktree `/home/bchanot/Documents/faunosteo-v1-2`, branch `feature/v1-2-anatomical-sheets`, base `36c6eb3`. Commit in place,
|
||||
push by hook, never merge. Analysis: `.superpowers/sdd/r2-ux-finish/analysis.md`. Rev 1 challenged (FATAL 10 / FATAL 13 /
|
||||
CONCERNS 3), rev 2 re-challenged (CONCERNS 10 / 8 / 3, no BLOCKER); rev 3 folds every rev 2 MAJOR (record at the end).
|
||||
|
||||
## Global rules (bind every task)
|
||||
- No change under supabase/, crates/, docker/, scripts/, packages/supabase/src. No db:trial or DEV access. No merge, no deploy.
|
||||
- Shell tests only on db:sandbox through the guarded wrapper (preflight refuses editor-equine, full-row guard):
|
||||
`bash /home/bchanot/Documents/faunosteo-v1-2/.superpowers/sdd/r2-ux-finish/gate/run-shell.sh <label> e2e/shell/<spec>.spec.ts …`
|
||||
(untracked copy; the brief checks it exists and stops if not). Never playwright directly, never editor-equine (its
|
||||
helper edits are typecheck-only, said so). admin.spec red under BLK-015, never a gate. Each task's gate runs EVERY shell
|
||||
spec that uses a helper, an i18n key, a test id or a component the task changes (grep, listed in the report), and
|
||||
reports the grants its runs added.
|
||||
- One modal primitive: ModalDialog / Dialog (D13). No hand-written trap, no new dependency. e2e waits for the open dialog
|
||||
count to reach 0 before typing after a close (LRN-111/116). happy-dom 20.10.6 has no `:modal`, no inert, no popover API:
|
||||
code detects open modals with `dialog[open]`, and behaviours needing real top-layer semantics are proved in e2e.
|
||||
- No native modal inside a hidden KeptPlace. One ModalDialog instance per layer, kept across its modes and flips.
|
||||
- Transactional forms on local draft state only (never TextField / blur-commit fields, never the change-commit checkbox):
|
||||
« Abandonner », a move or a flip never commits.
|
||||
- Document history (Défaire/Refaire) and browser history stay separate.
|
||||
- i18n: fr.ts and en.ts, one line per key, no formatter on them (they are exempt from `prettier --check`: 188 pre-existing
|
||||
lines over the print width; stated deviation); new EN labels provisional, rows in V1-2-6_R2_LABELS.md.
|
||||
- Limits 25 logic lines / function, 100 chars / line, 5 params, 5 locals; `prettier --check` on every other touched file.
|
||||
Every removed or rewritten assertion mapped (R-24). Motion: motion/react, reduced motion honoured, no permanent will-change.
|
||||
|
||||
## Design
|
||||
|
||||
### R2F-1 Browser history for the editor (item 5)
|
||||
- History records only the editor VIEW, held by the navigation reducer (single holder): `EditorView = { tab, section,
|
||||
finding: { key, citations: boolean } | { create: { kind, parent } } | null, reference: { edit: id } | { create: true } |
|
||||
null, referenceFilter: ElementKey | null }`. Selection, expansion, search, sort, open tiles and a dialog's edit mode never
|
||||
touch history.
|
||||
- Moves dispatch at once (as today, through `go`); history follows from ONE reconcile effect, mounted as its own hook in
|
||||
EditorWorkspace (no dependency of useEditorNavigation on a router; tolerant of MemoryRouter and a missing `idx`). It
|
||||
compares the new view with the last written entry, read from a ref holding what it wrote (never `useLocation()`, which
|
||||
lags one transition):
|
||||
- a layer, tab or section ADDED by a user move → push `{ view, below }` (`below` = previous view);
|
||||
- a layer REMOVED by a user move → `navigate(-1)` when the top entry's `below` equals the new view, else replace;
|
||||
- replace hints: an arrow-key tab move, the chip removal, a creation turned into its element after « Créer » / save.
|
||||
A second close finds no layer and does nothing; a held Escape is ignored by `event.repeat`; the exiting surface is inert
|
||||
through motion `useIsPresent` (the CitationsLayer pattern). While a `back()` is pending the effect writes nothing; the
|
||||
pending flag clears on the next POP of any kind or after 1 s.
|
||||
- Pushes: a tab chosen by click / Enter / « Plus », an Annotations section, the finding dialog, a finding creation, the
|
||||
citations sheet, the reference dialog (edit or create), « Tout afficher », « Aller à ». The move captures `scrollY`
|
||||
synchronously before its dispatch into a map keyed by the leaving entry; a POP stores the leaving entry's scroll too.
|
||||
- POP (Back / Forward): `restore_view(sanitize(view))` (vanished keys drop their layer; a node creation whose parent vanished
|
||||
dropped), scroll from the map, then focus: a reopened layer → its dialog's first control; a closed layer → its return
|
||||
target; a tab change with no layer → the active tab button. All POP focus uses `preventScroll`; announcements and
|
||||
landings go through `afterModalsClosed` (R2F-2).
|
||||
- Guards (a stack keyed by layer, replacing the single CanLeave slot): a UI close of a dirty form shows the inline
|
||||
confirmation and never moves; « Abandonner » / « Enregistrer » pop their guard before closing; a push that would close a
|
||||
dirty layer (« Tout afficher », « Aller à ») asks first; ANY POP that would remove a dirty layer, or that happens while a
|
||||
non-layer modal (DeleteDialog, ConfirmDialog, ConflictDialog, views dialogs) is open, re-pushes the full pre-POP view
|
||||
(below = the landed view) and keeps everything mounted, then the dirty layer shows its confirmation.
|
||||
- Ownership (owner precision 3): every entry also stores `sheetId` and `userId`; an entry restores only when both match the
|
||||
current sheet and signed-in account, otherwise the default view (a POP or mount onto a foreign entry replaces it).
|
||||
Entries hold navigation only: never typed text, a search term or a draft.
|
||||
- Mount: an entry carrying editor state is restored through sanitize WITHOUT form layers (creation, reference dialog,
|
||||
finding edit mode is local anyway); an entry without one is replaced by the default view.
|
||||
- Write failures: react-router's push turns a refused pushState into a page load; the adapter keeps a write budget
|
||||
(sliding window, well under WebKit's 100 / 10 s) and, past it, keeps the view in memory without writing; replaces are
|
||||
wrapped in try/catch. Stated: a refused push would reload (out of reach at one push per user move).
|
||||
- Limits stated: leaving the editor by Back past its first entry is unguarded (BDR-078; recovery copy); a sheet reopened by
|
||||
Back shows its tiles closed; Chromium's skippable-entry intervention after a script re-push and Android's close-watcher
|
||||
grouping of two restored dialogs are untested (Playwright's goBack bypasses them), checked in the owner's phone trial.
|
||||
|
||||
### R2F-2 Shared dialog primitives
|
||||
- ModalDialog re-shows (`showModal()`) only when its consumer REFUSED a close (`onClose` returns `'kept'`) and the
|
||||
`<dialog>` was closed natively; never during an AnimatePresence exit (useIsPresent) or a history close. Unit: a Dialog
|
||||
set closed then natively closed stays closed.
|
||||
- `returnFocus?: (() => HTMLElement | null) | null`: a function resolves the target (focused with `preventScroll`, falling
|
||||
back to the captured opener then its ancestors when it returns null); `null` skips the restore (the move owns focus).
|
||||
- `afterModalsClosed(fn)`: runs `fn` once no `dialog[open]` remains (flushed from ModalDialog's cleanup / `close` event);
|
||||
used by the announcer (queued messages joined into ONE announcement) and every focus landing that follows a close.
|
||||
`focusRow` reports `found` only when the row actually holds focus.
|
||||
- Escape with `event.repeat` ignored; Dialog's fade honours reduced motion.
|
||||
- Return targets: tree rows get a `data-finding-key` attribute (no tabindex change); « X références » through the existing
|
||||
`triggerOf` + `visibleElement`; tile headers by key; the add buttons by id.
|
||||
- `useBeforeUnload(dirty)` extracted from useLeaveGuard's effect, used by dirty dialogs; leaveGuardStore untouched.
|
||||
- Place-scoped dialogs (DeleteDialog …) stay valid: a POP while one is open is refused by re-push (R2F-1).
|
||||
|
||||
### R2F-3 Finding dialog (items 1, 3)
|
||||
- Rendered by FindingsTab (owns selection, expansion, creation, deletion), gated by the place being visible, driven by
|
||||
`nav.finding`. Row activation (click, Enter, Space) selects the row and opens the dialog. Tree, expansion and scroll never
|
||||
change; on close focus returns to the row (`data-finding-key`, preventScroll). The detail below the tree and the inline
|
||||
creation form are removed.
|
||||
- View mode: type and status, names, descriptions, vet referral (read); « Références citées », « X références » (finding
|
||||
nodes with citations; opens the sheet), « Aucune référence citée », « Citer une référence » (edit tier, immediate, one
|
||||
history entry). No inline citation list for a finding node; a family keeps its list with « Retirer ». Actions (edit tier):
|
||||
« Modifier », mark reviewed / reset, move up / down, « Supprimer » (DeleteDialog stacked, returnFocus null; the deletion
|
||||
closes the finding layer in the same move by replace — no POP — and the nearest-row focus runs via afterModalsClosed).
|
||||
- Edit mode local (no history entry), local draft state: names (required), descriptions, vet referral. « Enregistrer »:
|
||||
pristine → view mode, no command; changed → ONE `update` command (one history entry), refusal on its field (focus
|
||||
there), success → view mode with « Modifications enregistrées » in the dialog's status line. « Annuler » → view mode
|
||||
(dirty: confirmation first).
|
||||
- Creation (AddBar): `{ create: { kind, parent } }`, FindingCreateForm fields on local state; « Créer » → command, entry
|
||||
replaced by `{ key }`, view mode of the new element (the `created` flow expands and selects behind).
|
||||
- Dirty close request (✕, Annuler, Escape, scrim, Back, platform): footer confirmation « Abandonner les modifications ? »,
|
||||
« Continuer la saisie » (focused), « Abandonner ». The confirmation is never inert.
|
||||
- Read-only: view mode without actions. When the mode leaves edit while a form is open, the dialog keeps the draft, fields
|
||||
`readOnly` + `aria-readonly`, « Enregistrer » disabled, and a notice worded from the mode (ModeNotice's wording: width
|
||||
→ « Élargissez la fenêtre … », back on widening; frozen / inactive / rights → only « Abandonner »).
|
||||
releaseEditFocus / refocusIfHidden return early when focus is inside an open dialog.
|
||||
- Gone: if the element vanishes under the dialog (a reload after a conflict), the layer closes by replace with a queued
|
||||
announcement « Ce constat n'existe plus ». « Aller à » (Vérification) opens view mode.
|
||||
- While a dialog is open, Défaire/Refaire and the header save are unreachable (page inert): stated.
|
||||
|
||||
### R2F-4 Citations sheet (items 3, 4, 5)
|
||||
Side sheet on MobileDrawer's pattern at the right edge (min(34 rem, 100 vw), full height, 0.18 s in / 0.14 s out),
|
||||
rendered by the layer host placed AFTER the tab body in tree order (so it calls showModal after the finding dialog; e2e
|
||||
asserts the top dialog after Back and Forward), stacked over the finding dialog; return focus « X références ». Content
|
||||
kept (read tiles, « Modifier », « Retirer de ce constat », « Aller à », « Tout afficher »). « Tout afficher » pushes
|
||||
`{ tab: references, referenceFilter: finding, no layer }` (search cleared, sort kept); « Aller à » pushes the references
|
||||
tab with the tile focused through afterModalsClosed. Gone rule as R2F-3. Deleted with the section (tests mapped):
|
||||
CitationsLayer and its geometry and cramped exception, the tab panels' `inert={open}`, useCitationsExit / PendingClose /
|
||||
`afterExit`, useRequestClose, useCloseMoves, the panel branch of useTabSelect, focusAfterClose and focusIsFree (triggerOf
|
||||
and visibleElement kept), the panel-only parts of useBodyEscape and the workspace Escape handler, the citationsOf gate of
|
||||
useDecisionsOpen, useCloseWhenGone / dropCitations (replaced by the gone rule).
|
||||
Interim until Task 3 (tiles still edit inline in the sheet): the sheet ignores Escape coming from a tile text field (A5 /
|
||||
P27 kept), and every move that unmounts the sheet (✕, scrim, Back, « Tout afficher », « Aller à ») consults the tiles'
|
||||
guard; a refusal cancels the move.
|
||||
|
||||
### R2F-5 Reference dialog and reading tiles (items 2, 9)
|
||||
- Tiles: disclosure, « Modifier », « Supprimer » or the cited hint. Deleted (tests mapped): the inline edit view in tiles,
|
||||
useReferenceEdit drafts and leave guard, DroppedNote / useDroppedDrafts / hostLeaving / `draft_dropped`, NewReferenceTile
|
||||
and the « Annuler l'ajout » tile, useLeaveCheck, the interim sheet rules of R2F-4.
|
||||
- ReferenceDialog (layer host, above the sheet): type, DOI, citation (required), URL (http/https), local draft, same
|
||||
validation. « Enregistrer »: pristine → close, no command; changed → ONE add / update command, refusal on its field;
|
||||
a creation's entry is replaced by `{ edit: id }` before closing. Dirty close and mode change: as R2F-3.
|
||||
- After close: scroll, search, sort, filter, open tiles unchanged; focus to the opener. Edited tile pinned when it no
|
||||
longer matches the search (C3 line kept). After a create: queued announcement and a visible notice « Référence ajoutée :
|
||||
<citation> » with « Afficher » (useReferenceFocus); the list does not move.
|
||||
- Residuals: no inline draft outside a dialog, Défaire/Refaire unreachable during a dialog: residual 9a and 9b cannot occur
|
||||
(tests: an undo shortcut and a mode flip leave an open dialog's draft untouched).
|
||||
|
||||
### R2F-6 References filtered by a finding (item 4)
|
||||
`referenceFilter` passed to shownPositions and the count. `isSheetView` requires no filter (reorder arrows off) and the pin
|
||||
is applied only when there is no filter (a pinned tile outside the filter never shows). Toolbar chip « Références du
|
||||
constat : <name> » with « × » (« Retirer le filtre du constat <name> », replace) and « Revenir au constat » while the filter
|
||||
is set (pops when the entry below shows that finding, else pushes its dialog). Count within the filter; the no-result
|
||||
notice keeps its clear actions; a vanished finding clears the filter with a queued announcement. BDR-114 A row updated in
|
||||
RUST_ARCHITECTURE_REVIEW Part II.
|
||||
|
||||
### R2F-7 « Plus » dropdown (item 6) and sticky sidebar (item 7)
|
||||
- The menu list renders as an overlay `absolute inset-x-0 top-full z-20` in the tab row made `relative` (full width: never
|
||||
off-screen, no measuring, no layout shift), AnimatePresence: opacity + translateY(-4 px) in 0.15 s, out 0.12 s, instant
|
||||
under reduced motion; closing entries are inert and never focused. Closes on selection, outside pointerdown (the closing
|
||||
tap is stopped from reaching the page: no deselection), Escape (useMoreEscape, A5), any tab change, and the platform back request through a `CloseWatcher` created when the menu
|
||||
opens, where the browser offers it (owner precision 4; feature-detected, unit-tested with a stub); without CloseWatcher
|
||||
the Android back gesture goes back in history (stated limit).
|
||||
- Sidebar aside `sticky top-0 h-dvh self-start overflow-y-auto` where shown (lg default, xl editor); drawer unchanged.
|
||||
|
||||
### R2F-8 App-wide review (item 8)
|
||||
| Screen | Decision | Reason |
|
||||
|---|---|---|
|
||||
| Editor Constats, Références | modals | long lists, form far from its item |
|
||||
| Editor categories, views, regions, Vertèbres | kept inline | short lists, form by its list |
|
||||
| Admin species | already a modal | — |
|
||||
| Admin access (grants) | kept: form above the list | nothing to lose; size is RR-13 |
|
||||
| Clients, Animaux lists | pages kept; list context on Back not done | BDR-078 refused keeping the search term (personal data) to survive Back: owner choice |
|
||||
| Relations | kept in-page | §11.4 ratified |
|
||||
| Mon compte | kept inline | sections, no list |
|
||||
|
||||
### R2F-9 Ratified rules this design changes (owner, at the gate)
|
||||
1. BDR-050: transactional forms in the finding and reference dialogs (one entry per changed save); U2b F9 to re-plan.
|
||||
2. D2 / boards 24-25 / P16-P17: the citations panel becomes a modal side sheet over the finding dialog (still from a
|
||||
finding only); its section geometry and the rotation cramped exception disappear.
|
||||
3. A2: the editor's view layers live in the browser's session history; a reload keeps the tab, section, filter and
|
||||
reading layers, never a form.
|
||||
4. A3: « Tout afficher » filters by the finding (owner request). 5. Board 27 A: « Plus » becomes an overlay (owner request).
|
||||
6. Design-reference rule: no new mockups; owner brief + this gate = validation, dated addendum in docs/design/README.md.
|
||||
7. Open: clients/animals list context on Back would keep the search term (personal data) in browser history (BDR-078
|
||||
refused it). Default: not done.
|
||||
|
||||
## Tasks (5)
|
||||
|
||||
### Task 1 — Shared dialog primitives and history foundations (tabs, sections, « Aller à »)
|
||||
ModalDialog / Dialog (R2F-2: kept-refusal re-show, returnFocus, afterModalsClosed, repeat Escape, reduced motion),
|
||||
announcer queue, focusRow check, useBeforeUnload extraction; history reconcile hook (R2F-1) wired to tab, section and
|
||||
« Aller à » moves only (the citations panel and new layers are not in history yet), mount rule, scroll map, guard stack
|
||||
(with the POP-refusal while a non-layer modal is open), write budget; residual 9c formatting. Unit (incl. the 6
|
||||
editor-focus-request tests without a Router and the 14 MemoryRouter suites green) + new e2e/shell/editor-history.spec.ts
|
||||
(tabs and sections back/forward, landing focus, arrow replace, reload, a DeleteDialog open + Back keeps it). Gate: grep-found
|
||||
specs (EditorTabs, sections, dialogs app-wide incl. e2e/ui dialog, shell, clients, animals).
|
||||
|
||||
### Task 2 — Finding dialog and citations sheet (items 1, 3, 4 partly, 5)
|
||||
Owner precision 2: the sheet over the finding dialog is proved by keyboard (Tab through every control, Escape closes the
|
||||
sheet only, focus back on « X références ») and by touch (hasTouch taps at 375, the dialog underneath never activated).
|
||||
R2F-3 and R2F-4 with the interim rules; history for the finding layer, creation, the sheet, « Tout afficher » (tab +
|
||||
search cleared until Task 3 adds the filter) and « Aller à » from the sheet; deletions named; helpers (open a finding =
|
||||
activate its row and wait for its dialog; openCitations / closeCitations on the sheet) and every spec using them. Unit +
|
||||
e2e per R2F-3/R2F-4 (scroll and expansion identical after close at 1280; pristine save no entry, changed save one;
|
||||
Abandonner and a flip commit nothing; dirty Escape and Back ask; flip 1280 → 900 → 1280 keeps draft and focus; delete from
|
||||
the dialog lands on the nearest row; gone rule; sheet at 1280 and 375 read-only; top dialog after Back / Forward; owner
|
||||
steps 1-4 with Back and Forward).
|
||||
|
||||
### Task 3 — Reference dialog, reading tiles, filter by finding, owner journey (items 2, 4, 5, 9)
|
||||
R2F-5 and R2F-6, deletions named (interim sheet rules removed), history for the reference dialog and the filter. Unit +
|
||||
e2e per R2F-5/R2F-6, then the owner's 8 steps at 1280 and on the phone project at 375 (Back → finding A with its sheet
|
||||
open and on top; Forward → filtered tab), Back presses to leave = pushes made (no orphan), double clicks on ✕ and
|
||||
« Enregistrer » and a held Escape pop at most one entry, a real `dialog.close()` on a dirty dialog keeps it with its
|
||||
confirmation, a dirty dialog + Back (one step and a cross-tab jump) keeps the draft, reload then Back.
|
||||
|
||||
### Task 4 — « Plus » dropdown and sticky sidebar (items 6, 7)
|
||||
R2F-7. Unit (open / close, outside pointerdown not reaching the page, Escape order) + e2e at 375 and 320 (boxes identical
|
||||
open vs closed, axe menu open) and at 1280 / 1024 (sidebar first link in view after scrolling; own scroll at 1280 × 500;
|
||||
no sideways scroll; axe from the top).
|
||||
|
||||
### Task 5 — Documentation and closure
|
||||
docs/design/README.md (dated addendum = R2F-9), V1-2-6_U1_CORRECTIONS (§R2 « Finition 2026-11-13 »), V1-2-6_OWNER_TRIAL
|
||||
(§4.11 short db:trial procedure, French, incl. the phone checks of the stated limits), V1-2-6_R2_LABELS, BROWSER_TESTS,
|
||||
CLAUDE.md tree lines.
|
||||
|
||||
## Verification (controller)
|
||||
Static gates, unit, e2e:ui, full shell sweep (all specs but editor-equine; admin.spec reported; grants added reported),
|
||||
gates.sh, fresh verifier, security gate, opus xhigh review, memory, French final report with the db:trial procedure.
|
||||
|
||||
## Challenge record
|
||||
Rev 1 → 2: latch and repeat Escape; below in entries; guard disarm; native-close re-show; return targets; queued
|
||||
announcer; creation kind; finding dialog + sheet in one task; isSheetView; sections; scroll map; writes on view change
|
||||
only; arrow replace; readOnly on flip; pristine save; own beforeunload; lists task dropped (BDR-078); local edit mode;
|
||||
« Aller à » view mode; single filter holder; MobileDrawer and useReferenceFocus reuse; named deletions.
|
||||
Rev 2 → 3: close-first + reconcile effect, no UI latch (sim-1, cor-1, rob-9); one re-push rule, no idx (sim-2, cor-6,
|
||||
rob-5); mount id dropped, landed entry restored (sim-3, cor-3, rob-12); afterModalsClosed for focus and announcements,
|
||||
focusRow checked (sim-4, cor-7, rob-8); push refusal reloads → write budget (sim-6, rob-2, cor-11); finding.citations
|
||||
(sim-7); triggerOf / visibleElement and useBeforeUnload reused (sim-8); 5 tasks, journey in Task 3 (sim-9); plain overlay
|
||||
for « Plus » (sim-5, cor-15, rob-13); re-show only on a kept refusal (rob-1); gone rule kept (rob-3, cor-8); host after
|
||||
the tab body + top-dialog assertion (rob-4, cor-2); interim A5 / guard rules (rob-6, rob-7, cor-13); preventScroll on
|
||||
resolved targets and POP landings, scroll captured before dispatch (rob-11, cor-4); non-layer modal open → POP refused
|
||||
(cor-5); entry read from a ref (cor-10); guard stack (cor-12); happy-dom limits (cor-14); data-finding-key (cor-16);
|
||||
creation replaced before close (cor-17); fr/en prettier exemption stated (cor-18); flip notice from the mode (rob-16);
|
||||
announcer joins messages (rob-17); wrapper copied into the worktree (rob-14); skippable entry untested (rob-10);
|
||||
adapter as its own hook, MemoryRouter-tolerant (rob-15); pin off under a filter (cor-9).
|
||||
|
||||
## Rev 4: owner trial 2026-11-14 (R2 validated; last adjustments, autonomous mandate)
|
||||
|
||||
Owner brief 2026-11-14: R2 main journeys validated. Accepted limits: same-instant move vs Back race, « Aller à » opens in
|
||||
view mode, search kept across tabs, first outside tap only closes « Plus ». Android Back to verify on a real phone.
|
||||
BLK-015 tracked separately. Probe (controller, pinned Chromium 156.0.8078.4, scratch page): a same-document `traverse`
|
||||
`navigate` event is cancelable for a history-menu jump of -3 (CDP Page.navigateToHistoryEntry, userInitiated true), with
|
||||
or without prior activation, and preventDefault keeps the page on its entry.
|
||||
|
||||
### Task 6: citing references moves to the edit mode (owner item 1)
|
||||
- View mode (finding node): « Références citées » + « X références » (opens the side sheet) only; no « Citer une
|
||||
référence », no remove. Family (category, no sheet per D2): label + read-only list, no « Retirer ».
|
||||
- Edit mode (node and family): same label and button, plus the editable list of the DRAFT citations (each « Retirer »)
|
||||
and « Citer une référence ». Citation changes live in the form draft (dirty check, « Abandonner les modifications ? »),
|
||||
and « Enregistrer » writes names, descriptions, flag and citations as ONE undoable operation; pristine save none.
|
||||
- The button always agrees with what the form shows: in edit mode it counts the draft and the sheet opened from the form
|
||||
lists the draft's references. The side sheet becomes read-only for the finding: « Retirer de ce constat » leaves it
|
||||
(removal only in the edit form); « Modifier » (the reference), « Aller à », « Tout afficher » stay.
|
||||
- Creation dialog: no citations (unchanged). Tests: unit (view has no cite control; edit stages add/remove; one undo
|
||||
restores names and citations together; Annuler with only a citation change asks), e2e on the finding dialog.
|
||||
|
||||
### Task 7: deletion, undo and Back; « Plus » keyboard focus (owner item 3, points 1 and 2)
|
||||
- Deleting a finding (from its dialog or anywhere) closes its dialog by popping the dialog entry, never by replace: the
|
||||
first Back after a deletion has a visible effect (limit 1 lifted). A later Forward onto the deleted element's entry
|
||||
follows the existing gone rule.
|
||||
- The first « Défaire » after a deletion restores the finding at once and visibly: its row exists, its branch expanded,
|
||||
selected, scrolled into view and focused (Constats tab shown); no second « Défaire » needed. Same for « Refaire » of a
|
||||
creation. Tests: unit + e2e (delete, one header « Défaire », row visible and selected; one Back after delete moves).
|
||||
- « Plus »: choosing an entry (keyboard, also pointer) moves the focus to the new tab's panel (`role=tabpanel`,
|
||||
`tabIndex=-1`, labelled by its tab) once the overlay is gone; focus ring only for keyboard (`:focus-visible`). Tests
|
||||
unit + e2e at 375 (Enter on an entry: the panel of that tab is focused).
|
||||
|
||||
### Task 8: session tag in history; confirmation before a multi-entry leave (owner item 3, points 3 and 4)
|
||||
- History entries carry `tag` (random 128-bit hex, crypto.getRandomValues) instead of `userId`; `sheetId` stays.
|
||||
The tag lives in sessionStorage with the SHA-256 digest of the account id (crypto.subtle), reused only when the
|
||||
digest matches the signed-in account, rotated on sign-out and on any account mismatch; storage failure → in-memory
|
||||
tag (a reload then restores nothing). No tag yet → no restore (fail closed). The left-draft flag key uses the tag; flags
|
||||
of a rotated tag are cleared. Entries with `userId` (older shape) read as foreign.
|
||||
- Navigation API guard (`navigation` feature-detected): while a finding or reference dialog is dirty, a same-document
|
||||
`traverse` whose destination leaves the editor route is cancelled when `event.cancelable`; the dialog's own
|
||||
« Abandonner les modifications ? » shows; « Continuer la saisie » stays; « Abandonner » traverses to the destination
|
||||
(`navigation.traverseTo(key)`) with no left-draft notice. Not cancelable or no API → the existing flag and notice.
|
||||
In-editor traversals keep the existing refusal path. Tests: unit with a navigation stub; e2e with CDP
|
||||
`Page.navigateToHistoryEntry` (jump of several entries out of the editor with a dirty dialog: confirm shown, URL and
|
||||
draft kept; Abandonner lands on the destination).
|
||||
|
||||
### Task 9: R2 closure docs and the U2 orientation
|
||||
- R2 validated by the owner's trial 2026-11-14: status lines (V1-2-6_U1_CORRECTIONS §R2, V1-2_ANATOMICAL_SHEETS notes),
|
||||
limits (accepted list; lifted: delete dead Back, « Plus » focus to body; changed: tag, leave guard), §4.11 steps
|
||||
adjusted, a §4.12 « Vérifications manuelles finales » list, labels, BROWSER_TESTS.
|
||||
- U2 orientation (controller text, `u2-orientation.md` in the SDD folder) into V1-2-6_UX_PLAN §U2, V1-2-6_UX_DECISIONS
|
||||
and docs/design/README.md (boards 02 to 06 and 13 to redraw at U2 planning, validated before U2 code).
|
||||
|
||||
## Rev 5: owner trial follow-up 2026-11-15 (two UX adjustments before R2 closure, autonomous mandate)
|
||||
|
||||
Owner brief 2026-11-15: the finding dialog's edit mode must not hold citations; a real references dialog, stacked over
|
||||
the finding dialog, replaces the side sheet, with its own « Modifier ». One tab order on every width; « Plus » becomes a
|
||||
vertical dropdown. Keep history, focus, Défaire/Refaire and the unsaved-changes protection (BDR-115, LRN-141).
|
||||
Controller rulings (autonomous mandate, reported to the owner): families (categories) get the same dialog as nodes
|
||||
(both hold citations; the edit form no longer does); the view mode is read only (no « Modifier » on its tiles); the
|
||||
edit mode offers « Nouvelle référence » (created and cited in the draft); on phones the visible tabs are the first two
|
||||
of the order (Général, Annotations), the rest under « Plus » in order.
|
||||
|
||||
### Task 10: one tab order, vertical « Plus » dropdown (owner item 2)
|
||||
- `editor/tabs.ts` small tier: shown = first two of EDITOR_TABS (`general`, `annotations`), « Plus » = the rest in
|
||||
order (`findings`, `references`, `verification`). initialTab and its comment follow (Général now shown on small).
|
||||
- « Plus » shows the blocking-error count of Vérification while that tab sits under it (same text as the tab's badge).
|
||||
- MoreList: a vertical list anchored under « Plus » (right-aligned to it), one entry per line, full-width rows
|
||||
≥ 48 px high, comfortable padding, `rounded-lg` panel with shadow, max width `calc(100vw - 2rem)`, no sideways scroll
|
||||
at 320 and 375 px. Active entry: accent background tint + check icon + `aria-current="true"` (text, not colour only).
|
||||
Motion: opacity + 6 px slide + 0.98 scale from the top, ~160 ms ease-out in, ~120 ms out; none under reduced motion.
|
||||
ArrowDown/ArrowUp (wrap), Home, End move the focus between entries. Every existing dismissal (Escape, outside
|
||||
press, CloseWatcher, Tab-out, tab change) and the panel focus after a keyboard pick unchanged.
|
||||
- Tests: unit (tabsFor order per tier; Plus count; arrows); e2e at 375 (row order, vertical list geometry: entries
|
||||
stacked, each ≥ 44 px, inside the viewport; axe); update every spec that assumed the old small split.
|
||||
|
||||
### Task 11: the references dialog replaces the side sheet (view mode) (owner item 1)
|
||||
- New `CitationsDialog` (components/editor/references): a `Dialog` (ModalDialog, D13) stacked over the finding dialog,
|
||||
title « Références du constat », the finding path under it, hosted where CitationsSheet was (after the tab body,
|
||||
before ReferenceDialog). Same history layer as the sheet (`finding.citations`), so Back, the leave cascade, the
|
||||
reload restore and « Aller à » keep working; returnFocus = « X références ». CitationsSheet and its motion go.
|
||||
- View mode: the cited references as tiles (expand to read, « Aller à » a citer), dangling ids named, « Tout afficher
|
||||
dans l'onglet Références », close (✕, Escape, backdrop per Dialog, Back) back to the finding dialog. No « Modifier »
|
||||
on tiles in this dialog (tile readOnly for edit actions); its own « Modifier » button (edit tier only, hidden when
|
||||
read-only) switches to the edit mode (Task 12).
|
||||
- Citable keys: categories and nodes (`isCitable`, replaces `isFindingNode` for citations, the references filter and
|
||||
history read-back in navigation.ts, useEditorNavigation.ts, history/entry.ts, references/filter.ts as needed).
|
||||
- Finding dialog: view and edit modes both show only « Références citées » + the « X références » button (count of
|
||||
the document's citations, also at 0 so a reference can be added; zones none). FindingEditCitations, CitationList's
|
||||
remove path, the family inline list and `editor/findings/citationDraft.ts` (shortcut store) go. FindingEditForm's
|
||||
draft and patch no longer carry `reference_ids` (its save never rewrites citations).
|
||||
- Tests: unit (dialog shows the cited tiles, no edit controls in view mode, button at 0, family opens it, the finding
|
||||
edit patch keeps the current reference_ids); e2e editor-citations / editor-reference-journey / editor-finding-dialog
|
||||
updated to the dialog (owner journey A → « 2 références » → « Tout afficher » → Back back on A with the references
|
||||
dialog open; keyboard and touch at 375; axe).
|
||||
|
||||
### Task 12: edit mode of the references dialog (owner item 1)
|
||||
- « Modifier » turns the dialog into a form (local mode, no history entry, like the finding dialog): the draft list
|
||||
of cited references, each with « Modifier la référence » (the reference dialog stacked over this one, edits saved
|
||||
by that dialog as today) and « Retirer » (dangling ids removable); « Citer une référence existante » (the library
|
||||
references not cited yet); « Nouvelle référence » (the reference creation dialog stacked over this one: the
|
||||
reducer allows `create_reference` over an open citations layer without leaving the tab; history read-back allows it;
|
||||
on « Créer » the new id is appended to the draft). « Enregistrer » writes ONE `update` of the element's
|
||||
`reference_ids` (one Défaire), pristine save none, then back to the view mode with « Enregistré » and focus on
|
||||
« Modifier ». « Annuler » with changes asks « Abandonner les modifications ? ».
|
||||
- Guard: a new layer name `citations` between `finding` and `reference` (LAYERS order = stacking). A dirty draft
|
||||
refuses ✕, Escape, backdrop, Back and the editor leave cascade like the finding form (useFormDraft with layer
|
||||
`citations`, FormActions, DiscardConfirm); the Back planner counts the citations layer as guarded only when it
|
||||
holds a draft. « Tout afficher » and « Aller à » are not offered in edit mode.
|
||||
- A finding edit draft under it and a references draft are independent (two fields of the same element, two saves,
|
||||
two undo steps, neither overwrites the other). Undo/redo while the form is open follows the existing form rule.
|
||||
- Tests: unit (stage add/remove/new, one save = one undo, pristine none, Annuler asks, guard refuses Back, creation
|
||||
appends the new id, finding draft + references draft both saved); e2e (edit, cite, remove, save, one header
|
||||
« Défaire »; dirty Back asks; stacked reference dialog from the edit list).
|
||||
|
||||
### Task 13: docs
|
||||
- V1-2-6_U1_CORRECTIONS §R2 (subsection « Owner follow-up 2026-11-15 »; fix lines that describe the side sheet or
|
||||
citing in the finding edit form), V1-2-6_OWNER_TRIAL (§4.11/§4.12 adjusted; new §4.13 « Vérification des deux
|
||||
ajustements » short db:trial procedure), V1-2-6_R2_LABELS (keys added/removed), BROWSER_TESTS clauses,
|
||||
docs/design/README.md (board 25 side sheet replaced by the references dialog; board 05 phone split changed by the
|
||||
owner 2026-11-15).
|
||||
|
||||
### Rev 5 challenge rulings (binding on Tasks 10-13; 3 lenses, 2026-11-15)
|
||||
- T10: keep the overlay geometry (`absolute inset-x-0 top-full`, no measuring) as a vertical `flex-col` list, rows ≥ 48 px,
|
||||
accent tint + check icon + `aria-current`; motion unchanged in kind (light fade/slide, none under reduced motion). No
|
||||
arrow-key navigation (Tab moves, Tab-out closes). `initialTab` drops its tier parameter. e2e locates « Plus » without an
|
||||
exact name (it may carry the error count); checks at 320 and 375 (each entry box inside the viewport).
|
||||
- T11: CitationsDialog = `Dialog layer` around CitationsPanel's body (keeps `data-place="citations"`, heading id
|
||||
`editor-citations-title`, path, « Tout afficher », tiles with `readOnly` for edit actions, MissingRow, focus rescue);
|
||||
CitationsSheet goes. `isFindingNode` widened to categories and nodes and renamed in place (`isCitable`). FindingEditCitations
|
||||
and CitationList (with its remove path) MOVE to the dialog's edit mode (Task 12), not deleted. citationDraft.ts goes. If a
|
||||
dirty finding form below refuses « Aller à » / « Tout afficher », the clean citations layer closes first so the question
|
||||
is visible. Support helpers updated (`openTab` split, `findingDialog`, `showCitations`, `closeCitations`), sheet
|
||||
geometry checks → dialog-in-viewport.
|
||||
- T12: edit form keyed by `JSON.stringify(citedBy)`. Draft held as adds and removes, applied to the element's CURRENT
|
||||
list at save (a reload never overwrites citations silently). Reuse useItemMode/useFocusEditButton (button id param),
|
||||
keys `editor.findings.saved`, `editor.findings.reference_add`. Read-only flip: the draft stays, every control disabled,
|
||||
only « Abandonner » (BDR-115). « Nouvelle référence »: the new id reaches the draft through a callback the open edit form
|
||||
registers on the navigation (only for a creation it started); `added` is not set on that path; a `{create}` over the
|
||||
citations layer is never read back from history (POP/reload drop it). A reference created then a draft abandoned stays
|
||||
in the library uncited (its own undo step): tested and documented. Guard sites: `LAYERS` = finding, citations,
|
||||
reference; `LAYERS_TOP_DOWN` (leftDraft.ts) derived from LAYERS; `leavingLayers` gets a citations condition (flag drops
|
||||
or cited key changes); `closeCitations` asks the citations guard (user close refusable); `askLeave` clearAbove and
|
||||
`refusePop` close only the layers above the refusing one (citations → reference). Tests: Back closing only the
|
||||
citations dialog with a draft asks; topDirtyLayer order; citations under a clean reference dialog in POP and cascade;
|
||||
jump-out cascade e2e (editor-leave-confirm) with dirty citations; sign-out flag for a citations draft.
|
||||
- T13: also the CLAUDE.md folder-map line for the citations sheet.
|
||||
|
||||
## Rev 6: owner pre-closure adjustments 2026-11-15 (four items, autonomous mandate on the technique)
|
||||
|
||||
Owner brief 2026-11-15 « Avant la clôture définitive de R2 »: (1) a « Citer » button: the arrow keys only browse the
|
||||
references, a citation joins the draft only on an explicit action; (2) a reference created from the references
|
||||
dialog's edit mode is abandoned with the draft; an independent creation from the Références tab stays; (3) labels
|
||||
follow the context (constat / famille), FR and EN; (4) the modal ✕ gets a 44 × 44 px touch area, harmonised in the
|
||||
shared component. BLK-015 stays separate; the full sweep still fails and is never announced green.
|
||||
Controller rulings (autonomous mandate, reported to the owner):
|
||||
- A pending choice in the select is not part of the draft (no « Abandonner ? » for a choice never cited).
|
||||
- Creation from the edit mode is deferred: the new reference lives in the draft and is written with the citations
|
||||
by « Enregistrer », as ONE undoable operation (`commitBatch`: the inserts, then the element's update; no Rust
|
||||
change). Abandon, Annuler, close, Back or leave drop it with the rest of the draft (asked first when dirty).
|
||||
- « Modifier la référence » on an EXISTING reference keeps saving by its own dialog (a library change seen by every
|
||||
citer, own undo step): stated to the owner as a choice, with the alternative (fold it into the draft).
|
||||
- A reference still pending in the draft can be modified (same dialog, prefilled, nothing written) or removed
|
||||
(« Retirer » drops it entirely).
|
||||
|
||||
### Task 14: « Citer » button, context labels, 44 px close (owner items 1, 3, 4)
|
||||
- CitationsDraftList AddRow: the select (label « Citer une référence existante ») holds a local choice only (not in
|
||||
the draft, not dirty); a « Citer » button (new key `editor.citations.cite`, fr « Citer », en « Cite ») beside it,
|
||||
disabled while nothing is chosen; its click cites the choice, resets the select to the placeholder and puts the
|
||||
focus back on the select. A choice no longer offered (cited, gone after an undo) resets to the placeholder. Arrow
|
||||
keys and a pick on the select never change the draft. Read-only: select and « Citer » hidden (as the select today).
|
||||
- Context labels: every label of the references dialog and of the filtered Références tab that names the cited
|
||||
element gets a family variant chosen from the element's kind (`buildItems` kind / CiterItem.isFamily rule, one
|
||||
helper): `editor.references.dialog_title`, `editor.citations.edit_title`, `editor.references.panel_count_one/other`,
|
||||
`editor.references.panel_empty`, `editor.references.this_finding`, `editor.references.filter_chip`,
|
||||
`editor.references.filter_remove`, `editor.references.filter_back`, `editor.references.filter_gone`. New keys
|
||||
`<key>_family` (fr « Références de la famille », « Modifier les références de la famille », « … citée(s) par cette
|
||||
famille », « Cette famille ne cite aucune référence. », « cette famille », « Références de la famille : {name} »,
|
||||
« Retirer le filtre de la famille {name} », « Revenir à la famille », « La famille n'existe plus : le filtre est
|
||||
retiré »; en the same with « family »). Finding wording unchanged.
|
||||
- Dialog (components/ui/Dialog.tsx) close button: 44 × 44 px box (`grid h-11 w-11 place-items-center rounded-lg`,
|
||||
visible focus ring), the same as MobileDrawer's close; header padding adjusted so the header does not grow more
|
||||
than needed. Every Dialog of the app inherits it.
|
||||
- Tests: unit (arrow/change on the select leaves the draft clean; « Citer » adds once and resets; disabled with no
|
||||
choice; family vs finding titles, empty text, chip; ✕ box classes); e2e (keyboard: ArrowDown on the select then
|
||||
close asks nothing, « Citer » then « Enregistrer » = one Défaire; ✕ bounding box ≥ 44 × 44 at 375 and 1280 in an
|
||||
editor dialog and in the ui Dialog harness; axe).
|
||||
|
||||
### Task 15: a creation from the edit mode belongs to the draft (owner item 2)
|
||||
- `citationEdits.ts`: the draft gains `created: readonly Reference[]` (references made in this draft, absent from the
|
||||
document). Removing a created id drops it from `created` and `added`. `sameEdits` covers it.
|
||||
- Reference dialog over the citations edit mode: a « draft » creation. `ReferenceMoves.start(opener, cite, initial?)`;
|
||||
`cite` now receives the reference VALUE. In that mode ReferenceForm writes nothing: its save validates as today,
|
||||
builds the value under a fresh id (`newElementId('ref')`, or the pending id when modifying a pending one), hands it
|
||||
back, and the layer closes (forced, no replace, no library « added » notice, `held.cite` cleared). Submit label:
|
||||
« Ajouter la référence » for a new one, « Valider » (new key `editor.reference.apply`, en « Apply ») when modifying a
|
||||
pending one; title « Nouvelle référence » in both. An announcement says the reference is cited in the draft and
|
||||
will be written with the citations (new key `editor.citations.created_draft`, `{citation}`).
|
||||
- Draft list: a created reference shows its citation with a « Nouvelle » badge (new key `editor.citations.pending`),
|
||||
« Modifier la référence » (draft mode, prefilled) and « Retirer ».
|
||||
- Save: one `commitBatch` = an `insert` per created reference still cited, then the element's `update` with the
|
||||
applied ids. `useEditCommand` gains `runBatch(field, build)` that regenerates the created ids once on
|
||||
`duplicate_key` (as `runNew`), remapping them in the update. One Défaire undoes both the citations and the new
|
||||
references; Refaire restores both.
|
||||
- Everything else of the Rev 5 rules holds (guard layer `citations`, read-only flip keeps the draft, `{create}` over
|
||||
citations never read back from history, focus).
|
||||
- Tests: unit (create in draft → nothing in the document; save → references and citations in one undo step; abandon →
|
||||
document unchanged; modify pending; remove pending; duplicate id retried; References tab « Ajouter » still writes at
|
||||
once); e2e (owner path: « Nouvelle référence », « Abandonner » → library unchanged; « Nouvelle référence »,
|
||||
« Enregistrer », one « Défaire » removes both).
|
||||
|
||||
### Task 16: docs
|
||||
- V1-2-6_U1_CORRECTIONS §R2 (« Pre-closure adjustments 2026-11-15 »), V1-2-6_OWNER_TRIAL (limit 10 lifted, ✕ and arrow
|
||||
limits lifted, §4.14 short manual checks), V1-2-6_R2_LABELS (new keys, totals), BROWSER_TESTS clauses.
|
||||
|
||||
### Rev 6 challenge rulings (binding on Tasks 14-16; 3 lenses, 2026-11-15)
|
||||
- Family rule: one key helper `isFamilyKey(key) = key.kind === 'finding' && key.path.length === 1`, beside `isCitable`
|
||||
(works for a vanished element). Sites: CitationsDialog titles (view, edit), CitationsPanel summary and empty line,
|
||||
NoResult (new prop for the filtered element), CitersList (the current family row shows « cette famille » only, no
|
||||
second « famille » badge), ReferenceToolbar chip / remove / back, useReferenceLibrary `filter_gone`, and
|
||||
`editor.findings.gone` (family variant when a family's dialog closes because it vanished). Plural keys
|
||||
`editor.references.panel_count_family_one/_other` through the unchanged plural helper; other keys `<key>_family`.
|
||||
Unit: a filtered family removed by an undo announces the family variant.
|
||||
- T14 ✕: `shrink-0` on the button, `min-w-0 break-words` and a gap on the h2; e2e measures the ✕ (≥ 44 × 44) at 320,
|
||||
375 and 1280 with a long title (ui harness long-title case and one editor dialog with a long finding name).
|
||||
- T14 select: the shown value is derived at render (`options.some(o => o.value === choice) ? choice : ''`), driving
|
||||
the select and « Citer » (no effect). The choice state lives in the edit form (needed at save). « Citer » is
|
||||
`type="button"`; its unit asserts the dialog stays in edit mode. « Enregistrer » with a chosen-but-not-cited
|
||||
reference refuses: stays in edit mode, a line at the select (new key `editor.citations.pending_choice`, fr « Référence
|
||||
choisie mais pas encore citée : choisissez « Citer » ou revenez au choix vide. »), focus on « Citer ». Closing with
|
||||
only a choice asks nothing (no draft change).
|
||||
- T15 channel: `ReferenceMoves`/`ReferenceLayer` get `drafting(): { initial: Reference | null, cite } | null` read
|
||||
from `held` (never NavigationState, never history; `initial` cleared at every site that clears `cite`; draft mode
|
||||
decided by `cite !== null` alone). ReferenceForm gets one optional `onValue(value)` that replaces `useWrite`, behind
|
||||
the same once-only latch (double submit = one pending row, tested). Pending edit: ReferenceForm `reference` = the
|
||||
pending value (prefill, id kept), title `editor.reference.new`, submit `common.confirm` (« Valider »); a new one keeps
|
||||
`editor.reference.add`. No `editor.reference.apply` key.
|
||||
- T15 validation: the draft-mode submit dry-runs the insert on the current document text with the pure `applyEdit`
|
||||
(core/editOps.ts, nothing stored) and shows any refusal in the reference form as today. If the batch is refused at
|
||||
« Enregistrer » anyway, the line names the pending reference.
|
||||
- T15 notices: the draft-creation notice (`editor.citations.created_draft`) and a removed pending reference
|
||||
(`editor.citations.pending_removed`, « Nouvelle référence retirée : {citation} ») go to the citations dialog's own
|
||||
`role="status"` line, never `layer.announce`. Test: after an abandon and closing both dialogs, the live region holds
|
||||
no « sera enregistrée ».
|
||||
- T15 draft: one pure helper in citationEdits.ts adds or replaces a created value and its id together (one `set`).
|
||||
`useEditCommand.runBatch(field, build: () => readonly EditCommand[])` calls `build()` once more on `duplicate_key`;
|
||||
the citations save's `build` mints the created ids and maps them; no « still cited » filter (removeId keeps the
|
||||
invariant). Save with the element unreadable (`!item`) is a refusal on the save line that keeps the draft, never the
|
||||
pristine path. Dead Rev 5 write-and-cite path removed (`useCreated` citing branch, `CiteCreated` retyped to the
|
||||
value, comments): `created()` is library-only again.
|
||||
- Tests to update, named: e2e editor-citations.spec.ts:274-282 (`panel_empty` on « Dysfonction A », a family → family
|
||||
text), :441-443 (cite through selectOption → choose + « Citer »); unit editor-citations-edit.test.tsx:185-189 (`cite`
|
||||
helper), :416-440 and :442-459 inverted (CLARIFICATIONS 2026-11-15 b); editor-citations-guards.test.tsx:158-203
|
||||
(cite through `created()` → the draft path).
|
||||
- T16: document the durability change (a pending reference lives only in the open form until « Enregistrer »,
|
||||
protected by the leave guards and beforeunload, no recovery copy), next to the other draft limits.
|
||||
|
||||
## Closure 2026-11-15
|
||||
Owner validated R2 after the §4.13 and §4.14 db:trial checks; both offered choices ratified as built. Plan complete; no further task.
|
||||
@@ -0,0 +1,761 @@
|
||||
# R3 Sheet List and Administration Home Implementation Plan (V1-2.6), rev 2
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use subagent-driven-development to implement this plan task-by-task.
|
||||
> Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Status:** VALIDATED by the owner, 2026-11-16 (brief « Validation du plan R3 révision 2 »): D1 to D4, D6 and D7
|
||||
yes as recommended, D5 no (out of R3, kept as a later navigation improvement), every « Recorded unless the owner
|
||||
objects » item accepted. Development and checks on the sandbox authorised within this plan. `pnpm db:trial migrate`
|
||||
is NOT authorised: Task 2 Step 6 stops on an operational checkpoint (exact operations, backup, downtime, checks
|
||||
after restart) and waits for the owner's go. DEV unchanged. Owner precisions, binding: (P1) the tests cover the
|
||||
real computation of `last_modified_at` on PostgreSQL, drafts and working copies included; (P2) the migration is
|
||||
reviewed and frozen before its first application; (P3) the application never shows an old or wrong date as a
|
||||
reliable last modification; (P4) exact test results kept, the known BLK-015 failures included.
|
||||
Rev 2 = rev 1 + three fresh challenges of 2026-11-16 (correctness CONCERNS(3), robustness CONCERNS(5), simplicity
|
||||
CONCERNS(2)); their findings and what became of them are in « Challenge round » at the end. Rev 2b = the owner's
|
||||
answers: Task 1 gains a dated working copy (P1), Task 2 a whole-stack recomputation check on the sandbox (P1).
|
||||
|
||||
**Goal:** the official sheet list gets a name search, a sort by true last modification (default) or by name, a
|
||||
visible date and a result count; the Administration home card lists the five most recently modified sheets.
|
||||
|
||||
**Architecture:** one SQL read change adds `last_modified_at` to `private.official_sheet_admin_summary` (design
|
||||
accepted, `V1-2-6_R3_SQL_CHECKPOINT.md`). The typed client requires the key. Search, sort and date formatting are pure
|
||||
TypeScript display functions over the loaded list (same class as the R2 Références tab), read by the list page and
|
||||
the home card. No table, policy, privilege, Rust core or worker change.
|
||||
|
||||
**Tech Stack:** PostgreSQL 17 (pgTAP, PGlite), `@faunosteo/supabase` (Zod 3.25), React 19, Tailwind 4, vitest,
|
||||
Playwright + axe.
|
||||
|
||||
**Spec:** `docs/development/V1-2-6_U1_CORRECTIONS.md` §R3 (D7, A7 to A9), `docs/development/V1-2-6_R3_SQL_CHECKPOINT.md`,
|
||||
boards `docs/design/v1-2-6-r0/28-liste-fiches-desktop.png` and `29-liste-fiches-telephone-accueil.png`, labels
|
||||
`docs/design/v1-2-6-r0/REVUE.md:82-84`, rules REVUE.md points 4, 6, 7, 8. Board 30 belongs to R4, not to this plan.
|
||||
|
||||
Plan form (deviation from writing-plans « full code », stated, as the R2 plan did): the SQL, the pgTAP assertions and
|
||||
the pure functions are given in full; the React tasks give files, behaviour, test cases and verification, and the
|
||||
executor writes the JSX under TDD against boards 28 and 29.
|
||||
|
||||
## Audit findings (2026-11-16, read-only, checked again by the correctness challenge at 98178de)
|
||||
|
||||
Worktree `/home/bchanot/Documents/faunosteo-v1-2`, branch `feature/v1-2-anatomical-sheets` at 98178de (R2 closed).
|
||||
|
||||
| # | Finding | Evidence | Consequence |
|
||||
|---|---|---|---|
|
||||
| F1 | The typed client rejects an answer whose shape differs: `parseSheetAnswer` throws `unavailable` on a schema miss, and `OfficialSheetAdminSchema` (sheet page, editor draft route, save and conflict reads) extends the summary schema. The reverse is harmless: the schema is a non-strict `z.object`, so today's code drops an extra key. | `packages/supabase/src/sheets.ts:150-154`, `:381-420`, `:454` | Once the client requires `last_modified_at`, the admin screens and the editor answer « indisponible » on a stack without the migration. Stacks are migrated before the app code, never after. |
|
||||
| F2 | The shell suite runs on the sandbox, which has no forward migration command; the checkpoint recommends applying to the trial stack only. | `scripts/db-sandbox.sh:237-262` (`up fresh`, `up upgrade` only), checkpoint §4 | With path a alone `admin.spec` and every `editor-*` spec fail at load (F1) and nothing proves the date on a real PostgreSQL. Path b (a `migrate` command) is needed too; `migrate_up` already exists (`:188-190`). |
|
||||
| F3 | Checkpoint §4 says « PGlite and `pnpm db:test` need no existing stack ». `pnpm db:test` runs `supabase test db` on the DEV stack, and V1-2 is « sandbox only, not on DEV ». | `package.json:34`, `CLAUDE.md:60` | The real-PostgreSQL pgTAP run is `pnpm db:sandbox test-db` after the sandbox migrate, never `pnpm db:test`. DEV stays untouched. |
|
||||
| F4 | pgTAP files run in one transaction, where `now()` is frozen; `set_updated_at` stamps `now()`. | `supabase/tests/022_sheet_admin_reads.sql:6`, `:229`, `20261008100000_foundation.sql:30-38` | « A draft save moves `last_modified_at` and not `updated_at` » cannot be seen with rows dated `now()`. The new fixture rows are dated in the past at insert (the trigger stamps updates only). |
|
||||
| F5 | RR-13 as recorded covers the rights list only (`list_catalog_grants`, `GrantList`). Two R3 documents lean on it to page the sheet list. | `.claude/tasks/TODO.md` RR-13 line, BDR-106; `V1-2-6_U1_CORRECTIONS.md:616`, checkpoint :32 | The `shortcut:` of the browser-side search and sort points to a track whose written scope does not include the sheet list (decision D4). |
|
||||
| F6 | `admin.spec.ts` « admin screens » visits `/app/admin/access` before `/app/admin/sheets` and is red on the accumulated sandbox (BLK-015). It also holds the only axe scan of `/app/admin`. | `apps/app/e2e/shell/admin.spec.ts:733-750`, `.claude/memory/blockers.md` BLK-015 | R3's browser proof gets its own spec, which never opens the rights screen, scans a searched (short) list and the home page. |
|
||||
| F7 | The date moves, or fails to, in ways the checkpoint does not list: (i) `delete_sheet_version` removes the draft row, so the date can go back (no screen calls it today); (ii) deleting an account that created a draft sets `created_by` to null, an update that stamps the version; (iii) review rounds never move it (by design); (iv) a future data migration that rewrites drafts re-dates every such sheet to the deploy time; (v) at the autumn clock change two saves an hour apart read the same « 02:30 » and sort differently. | `20261028110000_sheet_review_workflow.sql:1304-1332`, `20261008110000_anatomical_sheets.sql:111`, `:143-145`, `20261008100000_foundation.sql:30-38` | Known limits, recorded in the checkpoint document. Only (iii) is reachable from the application today. |
|
||||
| F8 | The home card link is located in three shell tests by the fixed text of `admin.home.all_sheets`, inside the sheets card. | `admin.spec.ts:460-461`, `:671-672`, `editor-journey.spec.ts:58-61` | « Voir les {n} fiches » changes the accessible name: three locators rewritten one for one (R-24), through one helper that keeps the card scope. |
|
||||
| F9 | The sort « Dernière modification » puts the historical sheet last most of the time, so it leaves the home card's five, and with it the card's « Créer une copie de travail » shortcut. | board 29 note « Une fiche historique qui entre dans les cinq garde son action », `AdminHomeRoute.tsx:65-72`, `AdminSheetRoute.tsx:295` | Validated behaviour (A9). The action stays on the historical sheet's own page. Named in the owner trial text. |
|
||||
| F10 | Board 28's note « Sans résultat » settles the empty result with a filter active: the existing filters sentence stays. | board 28 | Followed as drawn. No decision. |
|
||||
| F11 | Search, sort and filters live in component state: opening a sheet and coming back resets them. The owner filed « search not kept on back » as an app-wide product follow-up (BDR-079), and R2 rejected address parameters for view state (BDR-116). | `AdminSheetsRoute.tsx:143`, `.claude/memory/decisions.md` BDR-079, BDR-116 | Out of R3 unless the owner decides otherwise (D5). |
|
||||
| F12 | The trial app is running now (a listener on port 5194) and follows the worktree live (Vite HMR); `pnpm db:trial migrate` refuses while the app runs. | `ss -ltn` 2026-11-16, `scripts/db-trial.sh:641`, `:1455`, `:1884-1887` | From the client change (Task 3) the owner's trial shows « indisponible » on the admin screens and the editor until the trial stack is migrated. The trial is migrated before Task 3, the app stopped during it. |
|
||||
| F13 | A7 is ratified as a delivery in two steps (search and name sort without a date first; the date after the SQL change). | `V1-2-6_U1_CORRECTIONS.md:613-615`, `:635-636`, checkpoint §5, BDR-108, BDR-109 | Building the final state in one lot supersedes that split: an explicit owner decision (D2). |
|
||||
| F14 | Boards 28 and 29 draw a magnifier in the search field. `Icon` has no such glyph, and the two search fields already shipped and validated (catalogue, Références tab) render none. | `components/ui/Icon.tsx:3-23`, `CatalogRoute.tsx:32-40`, `ReferenceToolbar.tsx:93-124` | No magnifier, as the two shipped searches; recorded as a deviation in `docs/design/README.md` unless the owner asks for the glyph. |
|
||||
|
||||
Checked and found sound: the proposed expression (`greatest` ignores a null; both columns are trigger-kept; the unique
|
||||
index `(sheet_id, version_number)` serves the lookup), no PostgREST reload needed (same signature, private function,
|
||||
`jsonb` return, generated types unchanged), the fixture inserts of Task 1 against every insert-time trigger and
|
||||
constraint, `cmd_migrate` against the script's real names, the trial `migrate` command (cold backup first, A15), the
|
||||
ratified date format against Node 24 ICU (`fr-FR` « 9 nov. 2026, 12:06 », `en-GB` « 9 Nov 2026, 12:06 »; `en-US` does
|
||||
not), Zod `datetime({ offset: true })` against the jsonb timestamp format, soft deletion of a draft-only official
|
||||
sheet by an editor.
|
||||
|
||||
## Owner decisions pending
|
||||
|
||||
| # | Question | Recommendation | If answered otherwise |
|
||||
|---|---|---|---|
|
||||
| D1 | Go to write the migration M9 and its pgTAP (PGlite only, no stack touched) | Yes | The ratified « before » state only: search, sort by name, no date, the card's first five by name (Tasks 4 to 7 without the date). |
|
||||
| D2 | One delivery in the final state, superseding A7's two steps | Yes: with D1 and D3 the « before » state is never shown | Step one ships first as A7 says, the date in a second lot. |
|
||||
| D3 | Stacks and order | After M9 passes PGlite and a fresh security review of its two-line diff: the sandbox through a new `pnpm db:sandbox migrate` (forward only, no reset, no row changed), then the trial stack through `pnpm db:trial migrate` on the owner's go at that moment (the trial app stopped, cold backup first, the stack stops a few seconds). Both before any app code that requires the key. M9 is frozen once applied to a stack: a later change ships as a new migration. | Trial only: the key becomes optional in the client and the UI hides the date when absent (a second code path, no real-stack proof). A new sandbox: the current one is removed (inventory and go first). |
|
||||
| D4 | RR-13's written scope | The TODO text says « admin lists: rights and official sheets »; still separate, still not implemented | A new item for the sheet list; the `shortcut:` cites it. |
|
||||
| D5 | Search, sort and filters kept when coming back from a sheet | Not in R3: it is the app-wide follow-up of BDR-079, and the address was rejected for view state in BDR-116 | Its own small lot after R3, on the editor's browser-history mechanism, typed text kept local. |
|
||||
| D6 | The card's link below two sheets (« Voir les {n} fiches » has no singular) | The existing validated label « Toutes les fiches officielles » for zero or one sheet, « Voir les {n} fiches » from two | Another wording: a label change to validate. |
|
||||
| D7 | The R3 browser test removes its own fixtures (soft deletion of the three sheets each run created, ids captured one by one) | Yes: it is the run-scoped cleanup the owner asked to be proposed (TODO, « e2e fixture accumulation ») | The three sheets stay listed on the sandbox, six more per sweep. |
|
||||
|
||||
Recorded unless the owner objects (each follows a validated document or an existing rule):
|
||||
- Boards as drawn: no new badge (published and draft told apart by the detail line), the four filters unchanged,
|
||||
the empty-result note of board 28 literally.
|
||||
- No magnifier in the search field (F14).
|
||||
- The name sort follows the shown name: French names with the French collation in the French interface, English
|
||||
names in the English interface (the board says « ordre alphabétique français » for the French screen).
|
||||
- The date is shown in Paris time, as the editor's « enregistré le … ».
|
||||
- Search and sort stay TypeScript, with their rows in the Rust exception table (class C, display only), as
|
||||
BDR-114 (A) did for the Références tab and as the ratified R3 text prescribes (`folded`, `Intl.Collator`).
|
||||
- The limits of F7 are written into the checkpoint document; (i) is fixed in the write the day a « supprimer le
|
||||
brouillon » screen exists.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Work in `/home/bchanot/Documents/faunosteo-v1-2` on `feature/v1-2-anatomical-sheets`. No merge, no deploy, no DEV.
|
||||
- The trial app serves this worktree live: between tasks it shows work in progress. The owner's verdict is asked
|
||||
only at the final stop.
|
||||
- Never touch: `crates/`, `supabase/migrations/*` other than the one new file, `scripts/db-trial*`,
|
||||
`components/editor/**`, `components/catalogue/**`, `GrantList`, `list_catalog_grants`, `admin.spec.ts` beyond the
|
||||
two locator rewrites of Task 7 (BLK-015 and RR-13 stay separate tracks).
|
||||
- M9 is frozen from its first application to any stack: never edited in place afterwards (the sandbox cannot detect
|
||||
an edited migration).
|
||||
- `scripts/db-sandbox.sh`: additions only, no line removed or changed (`scripts/db-trial-check.sh:627`).
|
||||
- Stack operations: `pnpm db:sandbox migrate` only after D3; `pnpm db:trial migrate` only on the owner's go at that
|
||||
moment; never `db:sandbox down` or `up`, a reset, `pnpm db:trial stop` or `start`, or `editor-equine.spec.ts`.
|
||||
`scripts/db-trial-check.sh` exits 2 while the trial is up and suggests stopping it: report the refusal, stop nothing.
|
||||
- Limits: 25 logic lines per function, 100 chars per line, 5 params, 5 locals, no global state; i18n through
|
||||
`useT()` with fr / en parity; no raw string in JSX.
|
||||
- Labels exactly as `REVUE.md:82-84`: « Rechercher une fiche par son nom », « Trier par », « Dernière modification »,
|
||||
« Nom », « {n} fiches », « {n} fiches sur {total} », « Modifiée le {date} », « Aucune fiche ne contient « {q} » dans
|
||||
son nom. », « Effacer la recherche », « Dernières modifications », « Voir les {n} fiches »; EN « Search a sheet by
|
||||
name », « Sort by », « Last modified », « Name », « {n} sheets », « {n} sheets of {total} », « Modified on {date} »,
|
||||
« No sheet name contains “{q}”. », « Clear the search », « Latest changes », « See the {n} sheets ».
|
||||
- Date (A8): « 9 nov. 2026, 12:06 » / « 9 Nov 2026, 12:06 », Paris time.
|
||||
- No section, filter or rule built on a UUID, a name, a slug or a test convention; generic for every species (D7).
|
||||
- R-24: every removed or rewritten assertion mapped to its replacement in the commit body.
|
||||
- Data guard around every sandbox session (R2 rule G3): per-id snapshot of the pre-existing rows of
|
||||
`anatomical_sheets` and `anatomical_sheet_versions` (full rows, `md5(content::text)`) before and after, through
|
||||
`pnpm db:sandbox sql`, select only; a changed or missing row stops the run. New rows are counted per run.
|
||||
- Commits: Conventional Commits; one coherent change each.
|
||||
- Gates per task in this order: `pnpm typecheck`, `pnpm lint`, `pnpm test:run`, then what the task names.
|
||||
|
||||
## Review Focus
|
||||
|
||||
1. A stack without the migration: the client answers the closed `unavailable` failure, never a list with a missing
|
||||
or invented date. Test in Task 3.
|
||||
2. Two sheets with the same date, or the same name: the order does not depend on the server's order and does not
|
||||
flip between renders. Test in Task 4 (ties by name, then id).
|
||||
3. Search text with replacement patterns (`$&`), brackets, or 100 characters without a space: shown as plain text,
|
||||
no exception, no sideways scroll at 375 px. Tests in Task 5 (unit) and Task 7 (browser).
|
||||
4. A sheet named differently in each language (« Cheval » / « Horse »): found by either name in either interface
|
||||
language; the name sort follows the shown language. Test in Task 4.
|
||||
5. The species read fails while the sheet list answers: the home card still shows, with the species id in place of
|
||||
its name. Test in Task 6.
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
| File | Responsibility |
|
||||
|---|---|
|
||||
| Create `supabase/migrations/20261116100000_sheet_admin_last_modified.sql` | M9: the summary with `last_modified_at` |
|
||||
| Modify `supabase/tests/022_sheet_admin_reads.sql` | 8 new assertions, plan 60 → 68 |
|
||||
| Modify `scripts/db-sandbox.sh` | `migrate` command (additions only) |
|
||||
| Modify `packages/supabase/src/sheets.ts`, `tests/sheets-admin.test.ts` | the summary schema requires the key |
|
||||
| Modify `apps/app/src/catalogue/useCatalogue.ts` | `matchesSheetName` exported, `filterCatalog` calls it (one search rule for both screens) |
|
||||
| Create `apps/app/src/admin/sheetList.ts` | `searchSheets`, `sortSheets`, `SHEET_SORTS` (pure) |
|
||||
| Modify `apps/app/src/admin/labels.ts` | `formatShortParisDateTime`, `sheetDetails` (moved from the route) |
|
||||
| Create `apps/app/src/components/admin/ModifiedDate.tsx` | « Modifiée le … » as a `<time>`, shared by the row and the card |
|
||||
| Modify `apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx` | search, sort, count line, row date, empty states |
|
||||
| Modify `apps/app/src/app/routes/app/admin/AdminHomeRoute.tsx` | the « Fiches officielles » card of board 29 B |
|
||||
| Modify `apps/app/src/i18n/{fr,en}.ts` | the keys of Tasks 5 and 6 |
|
||||
| Create `apps/app/tests/unit/admin.sheetList.test.ts`; modify `admin.labels.test.ts`, `routes.admin.test.tsx` | unit tests |
|
||||
| Create `apps/app/e2e/shell/admin-sheets-list.spec.ts` | the list and the card on the sandbox, fr / en, desktop and 375 px |
|
||||
| Modify `apps/app/e2e/support/admin.ts`, `e2e/shell/{admin,editor-journey}.spec.ts` | `allSheetsLink` helper, three locators |
|
||||
| Modify docs (Task 8) | as built, owner trial, exception table, migration list |
|
||||
|
||||
If the 25-line limit forces it, the route's row and toolbar are extracted to `components/admin/SheetRow.tsx` and
|
||||
`components/admin/SheetListToolbar.tsx`; no other new file.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: SQL read change M9, its pgTAP, its security review (after D1)
|
||||
|
||||
**Files:**
|
||||
- Create: `supabase/migrations/20261116100000_sheet_admin_last_modified.sql`
|
||||
- Modify: `supabase/tests/022_sheet_admin_reads.sql:7` (plan), before `-- ============ Privileges and nature` (:184)
|
||||
|
||||
**Interfaces:**
|
||||
- Produces: `list_official_sheets_admin()` and `get_official_sheet_admin(uuid)` answers carry
|
||||
`last_modified_at` (timestamptz as an ISO 8601 string with offset), never null.
|
||||
|
||||
- [ ] **Step 1: Write the failing assertions.** `select plan(60);` becomes `select plan(72);`, and this section is
|
||||
inserted before « Privileges and nature » (after every existing list assertion, so none changes):
|
||||
|
||||
```sql
|
||||
-- ============ Last modification date (R3, M9) ============
|
||||
-- now() is the transaction's start for the whole file, so these rows are dated
|
||||
-- in the past at insert (the trigger stamps updates only): a later write then
|
||||
-- shows as a newer date.
|
||||
reset role;
|
||||
select set_config('request.jwt.claims', '{"sub":"22000000-0000-0000-0000-00000000000e"}', true);
|
||||
insert into pg_temp.k values
|
||||
('SL', '22200000-0000-0000-0000-000000000007'), ('SL.v1', '22300000-0000-0000-0000-000000000071'),
|
||||
('SN', '22200000-0000-0000-0000-000000000008'),
|
||||
('WK', '22200000-0000-0000-0000-000000000009'), ('WK.v1', '22300000-0000-0000-0000-000000000091');
|
||||
insert into public.anatomical_sheets (id, species_id, name, slug, is_official, visibility, status,
|
||||
created_at, updated_at, working_copy_source_version_id) values
|
||||
(pg_temp.id('SL'), 'equine', 'SL', 'm22-sl', true, 'private', 'active', '2026-01-01T10:00:00Z', '2026-01-01T10:00:00Z', null),
|
||||
(pg_temp.id('SN'), 'equine', 'SN', 'm22-sn', true, 'private', 'active', '2026-01-03T10:00:00Z', '2026-01-03T10:00:00Z', null),
|
||||
-- A second, dated working copy of the historical sheet: the single slot is a
|
||||
-- rule of create_sheet_working_copy, not a constraint, and WC holds it already.
|
||||
(pg_temp.id('WK'), 'equine', 'WK', 'm22-wk', true, 'private', 'active', '2026-01-01T10:00:00Z', '2026-01-01T10:00:00Z',
|
||||
pg_temp.id('h.v'));
|
||||
insert into public.anatomical_sheet_versions (id, sheet_id, version_number, status, document_schema_version, content,
|
||||
created_at, updated_at) values
|
||||
(pg_temp.id('SL.v1'), pg_temp.id('SL'), 1, 'draft', 2, pg_temp.doc('Datée'), '2026-01-02T10:00:00Z', '2026-01-02T10:00:00Z'),
|
||||
(pg_temp.id('WK.v1'), pg_temp.id('WK'), 1, 'draft', 2, pg_temp.doc('Copie datée'), '2026-01-04T10:00:00Z', '2026-01-04T10:00:00Z');
|
||||
update public.anatomical_sheets set last_version_number = 1 where id in (pg_temp.id('SL'), pg_temp.id('WK'));
|
||||
-- The update above stamps both sheet rows with now(): put their dates back in the past.
|
||||
-- (The executor checks whether last_version_number must be set for save_sheet_draft; if not, this update and
|
||||
-- the comment go, and the rows keep their insert dates. If it must, the dates are restored through
|
||||
-- `alter table … disable trigger anatomical_sheets_set_updated_at` around one dated update, re-enabled at once,
|
||||
-- inside this rolled-back transaction only, and the executor reports it.)
|
||||
-- One date of a sheet's admin answer.
|
||||
create function pg_temp.at(p_key text, p_field text) returns timestamptz language sql as $$
|
||||
select (public.get_official_sheet_admin(pg_temp.id(p_key)) ->> p_field)::timestamptz
|
||||
$$;
|
||||
grant execute on function pg_temp.at(text, text) to authenticated;
|
||||
|
||||
select pg_temp.as_user('E', 'aal2');
|
||||
select is(pg_temp.at('SL', 'last_modified_at'), '2026-01-02T10:00:00Z'::timestamptz,
|
||||
'a version newer than the sheet row gives the last modification');
|
||||
select is(pg_temp.at('SN', 'last_modified_at'), '2026-01-03T10:00:00Z'::timestamptz,
|
||||
'a sheet without a version answers its own date');
|
||||
select is(pg_temp.val($$ select public.save_sheet_draft(pg_temp.id('SL.v1'), 0, pg_temp.doc('Datée 2'), 'r3') ->> 'revision' $$),
|
||||
'1', 'E saves the dated draft');
|
||||
select is(pg_temp.at('SL', 'last_modified_at'), now(), 'a draft save moves last_modified_at');
|
||||
select is(pg_temp.at('SL', 'updated_at'), '2026-01-01T10:00:00Z'::timestamptz, 'a draft save leaves the sheet row''s date');
|
||||
reset role;
|
||||
update public.anatomical_sheets set name = 'SN 2' where id = pg_temp.id('SN');
|
||||
select pg_temp.as_user('E', 'aal2');
|
||||
select is(pg_temp.at('SN', 'last_modified_at'), now(), 'a sheet change moves last_modified_at');
|
||||
select is(pg_temp.at('SN', 'updated_at'), now(), 'a sheet change moves updated_at too');
|
||||
select is((public.get_official_sheet_admin(pg_temp.id('WK')) ->> 'working_copy')::boolean, true,
|
||||
'the dated fixture is a working copy');
|
||||
select is(pg_temp.at('WK', 'last_modified_at'), '2026-01-04T10:00:00Z'::timestamptz,
|
||||
'a working copy is dated by its own draft');
|
||||
select is(pg_temp.val($$ select public.save_sheet_draft(pg_temp.id('WK.v1'), 0, pg_temp.doc('Copie datée 2'), 'r3') ->> 'revision' $$),
|
||||
'1', 'E saves the working copy''s draft');
|
||||
select is(pg_temp.at('WK', 'last_modified_at'), now(), 'a working copy''s draft save moves its last_modified_at');
|
||||
select is(pg_temp.val($$ select count(*)::text from jsonb_array_elements(public.list_official_sheets_admin()) e
|
||||
where e ->> 'last_modified_at' is null $$), '0', 'every listed sheet carries last_modified_at');
|
||||
```
|
||||
|
||||
The call rights of the checkpoint's list are the existing assertions that follow, re-run unchanged.
|
||||
|
||||
- [ ] **Step 2: Run and watch it fail.** `pnpm --filter @faunosteo/supabase test:run -- pgtap`. Expected in 022:
|
||||
seven of the new assertions fail (the six on `last_modified_at`, the null count) and five pass (the two saves, the
|
||||
two on `updated_at`, the working copy flag); the 60 earlier ones pass.
|
||||
|
||||
- [ ] **Step 3: Write the migration.** The file replaces `private.official_sheet_admin_summary` with the body of
|
||||
`20261102100000_sheet_admin_reads.sql:40-93` copied character for character, plus the two lines of one key after
|
||||
`'updated_at'`:
|
||||
|
||||
```sql
|
||||
-- V1-2.6 R3 M9 `sheet_admin_last_modified`: a true last-modification date in
|
||||
-- the administration reads. docs/development/V1-2-6_R3_SQL_CHECKPOINT.md
|
||||
-- (design accepted by the owner 2026-11-09, BDR-109, arbitration A7).
|
||||
--
|
||||
-- The admin list dated a sheet by `anatomical_sheets.updated_at`, which a
|
||||
-- draft save does not move: `save_sheet_draft` writes
|
||||
-- `anatomical_sheet_versions` only. The summary now also answers
|
||||
-- `last_modified_at`, the newest of the sheet row's `updated_at` and its
|
||||
-- versions' `updated_at`, both kept by the existing `set_updated_at`
|
||||
-- triggers. Review rounds and audit rows do not count. Read change only: body
|
||||
-- otherwise identical to M7, no table, policy, index or privilege change;
|
||||
-- `updated_at` keeps its meaning.
|
||||
|
||||
create or replace function private.official_sheet_admin_summary(p_sheet_id uuid)
|
||||
returns jsonb
|
||||
language sql
|
||||
stable
|
||||
security definer
|
||||
set search_path = ''
|
||||
as $$
|
||||
select jsonb_build_object(
|
||||
'sheet_id', s.id,
|
||||
'species_id', s.species_id,
|
||||
'slug', s.slug,
|
||||
'status', s.status,
|
||||
'archived_at', s.archived_at,
|
||||
'created_at', s.created_at,
|
||||
'updated_at', s.updated_at,
|
||||
'last_modified_at', greatest(s.updated_at, (
|
||||
select max(v.updated_at) from public.anatomical_sheet_versions v where v.sheet_id = s.id)),
|
||||
-- (here: M7 lines 55 to 92 as they are, from `'name', coalesce(…` through the closing parenthesis of
|
||||
-- jsonb_build_object, the from clause and `where s.id = p_sheet_id;`; this comment is not kept)
|
||||
$$;
|
||||
|
||||
-- Kept by `create or replace`, stated again so this file stands alone.
|
||||
revoke all on function private.official_sheet_admin_summary(uuid) from public, anon, authenticated, service_role;
|
||||
```
|
||||
|
||||
The comment stands for M7 lines 55 to 92, copied, not retyped (40 lines retyped by hand are a transcription risk
|
||||
in a `security definer` function; dropping the `where` would answer an arbitrary sheet). Check:
|
||||
`diff <(sed -n 40,93p supabase/migrations/20261102100000_sheet_admin_reads.sql) <(sed -n '/^create or replace/,/^\$\$;/p' supabase/migrations/20261116100000_sheet_admin_last_modified.sql)`
|
||||
shows the two added lines and nothing else.
|
||||
|
||||
- [ ] **Step 4: Run and watch it pass.** `pnpm --filter @faunosteo/supabase test:run`. Expected: 022 at 72 of 72,
|
||||
the other pgTAP files and `schema-types.test.ts` unchanged.
|
||||
|
||||
- [ ] **Step 5: Fresh security review of the SQL**, before any stack sees it: `security-auditor` on the migration
|
||||
and the test diff. A requested change is made now, never after Task 2.
|
||||
|
||||
- [ ] **Step 6: Commit.** `feat(supabase): last_modified_at in the admin sheet summary (M9)`.
|
||||
|
||||
### Task 2: `pnpm db:sandbox migrate`, the sandbox then the trial stack migrated (after D3)
|
||||
|
||||
**Files:**
|
||||
- Modify: `scripts/db-sandbox.sh` (a `cmd_migrate` function with its comment, one `case` line before `sql)`)
|
||||
- Modify: `docs/development/SUPABASE.md` §5.1 (the command)
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: `migrate_up` (:188), `load_secrets`, `sb_psql`, `$DB`, `die`.
|
||||
- Produces: `pnpm db:sandbox migrate`: the branch's pending migrations on the running sandbox; no reset, no seed,
|
||||
no container recreated. Both persistent stacks at `20261116100000`.
|
||||
|
||||
- [ ] **Step 1: Add the command** (additions only). The script's own help prints header lines 2 to 36 and that
|
||||
line may not change, so the command is documented by its comment and in `SUPABASE.md`, not in the header:
|
||||
|
||||
```bash
|
||||
# pnpm db:sandbox migrate: forward only, on the running sandbox; the branch's
|
||||
# pending migrations and nothing else (no reset, no seed, no container recreated).
|
||||
cmd_migrate() {
|
||||
[ $# -eq 0 ] || die "migrate takes no argument"
|
||||
docker ps --format '{{.Names}}' | grep -qx "$DB" || die "sandbox not up (pnpm db:sandbox up fresh)"
|
||||
load_secrets
|
||||
local last='select max(version) from supabase_migrations.schema_migrations'
|
||||
echo "== before: $(sb_psql -t -A -c "$last")"
|
||||
migrate_up .
|
||||
echo "== after: $(sb_psql -t -A -c "$last")"
|
||||
}
|
||||
```
|
||||
|
||||
and in the dispatch: `migrate) shift; cmd_migrate "$@" ;;`.
|
||||
|
||||
- [ ] **Step 2: Static checks.** `shellcheck -e SC1090,SC1091,SC2016 scripts/db-sandbox.sh` clean;
|
||||
`git diff --numstat -- scripts/db-sandbox.sh` shows 0 removed lines. Commit
|
||||
`feat(supabase): db:sandbox migrate, forward only on the running sandbox`.
|
||||
|
||||
- [ ] **Step 3: Data guard, before.** The per-id snapshot of the Global Constraints, saved to the scratchpad.
|
||||
|
||||
- [ ] **Step 4: Migrate the sandbox** in a quiet window (no suite running). `pnpm db:sandbox migrate`. Expected:
|
||||
before `20261103100000`, after `20261116100000`; a second run prints the same version twice and applies nothing.
|
||||
Record `select md5(pg_get_functiondef('private.official_sheet_admin_summary(uuid)'::regprocedure))`.
|
||||
|
||||
- [ ] **Step 5: Data guard, after, and real-PostgreSQL pgTAP.** The snapshot is identical (a function replace
|
||||
changes no row). `pnpm db:sandbox test-db`: file 022 at 72 of 72 is the gate; the other files' result is reported
|
||||
exactly as it stands on the accumulated sandbox. `pnpm db:sandbox types --check`: no drift.
|
||||
|
||||
- [ ] **Step 5b: The real computation on every sheet of the sandbox (P1), select only** through
|
||||
`pnpm db:sandbox sql`: for every official sheet not deleted, `private.official_sheet_admin_summary(id)
|
||||
->> 'last_modified_at'` equals `greatest(s.updated_at, max(v.updated_at))` computed directly (count of
|
||||
differences = 0); report the number of sheets checked, of working copies among them, and of sheets whose date now
|
||||
differs from `updated_at` (the checkpoint read 28 of 219 on 2026-11-09).
|
||||
|
||||
- [ ] **Step 6: STOP, operational checkpoint for the trial stack (owner go required, not yet given).** Present to
|
||||
the owner, in French: the exact commands (`pnpm db:trial status`; the app stopped; `pnpm db:trial migrate`;
|
||||
`pnpm db:trial status`; the app restarted), the backup `migrate` takes (cold, both volumes and the secrets, kept,
|
||||
never pruned, A15) and how to restore it, the downtime estimated from the script and from the last `backup` run,
|
||||
and the checks after restart (applied version `20261116100000`, function md5 equal to the sandbox's, the R3
|
||||
recomputation of Step 5b on the trial stack, accounts and the equine sheet unchanged, the app answering on the LAN
|
||||
address). Only on the owner's go: run it. Today's app code keeps working on the migrated stacks (it drops the
|
||||
extra key). Task 3 starts only after this step, whatever its outcome is (no go: Task 3 waits).
|
||||
|
||||
### Task 3: The typed client requires the key
|
||||
|
||||
**Files:**
|
||||
- Modify: `packages/supabase/src/sheets.ts:388` (one entry after `updated_at`)
|
||||
- Modify: `packages/supabase/tests/sheets-admin.test.ts` (the `summary` fixture, one test beside :194)
|
||||
|
||||
**Interfaces:**
|
||||
- Produces: `OfficialSheetAdminSummary['last_modified_at']: string` (ISO 8601 with offset, checked at the boundary).
|
||||
|
||||
- [ ] **Step 1: Write the failing test.** The `summary` fixture gains
|
||||
`last_modified_at: '2026-11-09T11:06:00.123456+00:00'`, and:
|
||||
|
||||
```ts
|
||||
it('refuses a summary without last_modified_at, or with one that is no timestamp, as unavailable', async () => {
|
||||
const answer = (data: unknown) => stubClient({ rpc: { data } }).client
|
||||
const before = Object.fromEntries(Object.entries(summary).filter(([key]) => key !== 'last_modified_at'))
|
||||
expect(await kindOf(listOfficialSheetsAdmin(answer([before])))).toBe('unavailable')
|
||||
expect(await kindOf(listOfficialSheetsAdmin(answer([{ ...summary, last_modified_at: 'nope' }])))).toBe('unavailable')
|
||||
})
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run, watch it fail** (`pnpm --filter @faunosteo/supabase test:run -- sheets-admin`): both read
|
||||
« no failure ».
|
||||
|
||||
- [ ] **Step 3: Implement.** After `updated_at: z.string(),`:
|
||||
|
||||
```ts
|
||||
/** The newest of the sheet's and its versions' `updated_at` (M9): what « dernière modification » sorts and shows. */
|
||||
last_modified_at: z.string().datetime({ offset: true }),
|
||||
```
|
||||
|
||||
The siblings are plain strings because they are only printed; this one is sorted on and formatted by `Intl`, which
|
||||
throws on an invalid date, so it is checked where it enters.
|
||||
|
||||
- [ ] **Step 4: Run, watch it pass;** then `pnpm test:run`: the app fixtures that feed the fake RPC
|
||||
(`routes.admin.test.tsx` `summary()` and `historical()`, found by the run, not by the compiler) gain the key, and
|
||||
`tests/helpers/editorRoute.tsx` `adminAnswer()` too, for a truthful fixture.
|
||||
|
||||
- [ ] **Step 5: Real answer.** `pnpm db:sandbox test sheets-admin` (parses the migrated sandbox's answers): result
|
||||
reported exactly.
|
||||
|
||||
- [ ] **Step 6: Commit.** `feat(supabase): admin sheet summary carries last_modified_at`.
|
||||
|
||||
### Task 4: Search, sort and date format (pure)
|
||||
|
||||
**Files:**
|
||||
- Modify: `apps/app/src/catalogue/useCatalogue.ts:57-71`, `apps/app/src/admin/labels.ts`,
|
||||
`apps/app/tests/unit/admin.labels.test.ts`
|
||||
- Create: `apps/app/src/admin/sheetList.ts`, `apps/app/tests/unit/admin.sheetList.test.ts`
|
||||
|
||||
**Interfaces:**
|
||||
- Produces:
|
||||
- `matchesSheetName(name: { fr: string; en: string }, query: string): boolean` (`@/catalogue/useCatalogue`)
|
||||
- `SHEET_SORTS = ['modified', 'name'] as const`, `type SheetSort`
|
||||
- `searchSheets(sheets: readonly OfficialSheetAdminSummary[], query: string): OfficialSheetAdminSummary[]`
|
||||
- `sortSheets(sheets: readonly OfficialSheetAdminSummary[], sort: SheetSort, locale: Locale): OfficialSheetAdminSummary[]`
|
||||
- `formatShortParisDateTime(iso: string, locale: Locale): string`
|
||||
|
||||
- [ ] **Step 1: Write the failing tests.**
|
||||
|
||||
```ts
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { OfficialSheetAdminSummary } from '@faunosteo/supabase'
|
||||
import { searchSheets, sortSheets } from '@/admin/sheetList'
|
||||
|
||||
const sheet = (id: string, fr: string, en: string, at: string) =>
|
||||
({ sheet_id: id, name: { fr, en }, last_modified_at: at }) as OfficialSheetAdminSummary
|
||||
const A = sheet('a', 'Âne, squelette', 'Donkey, skeleton', '2026-11-03T10:02:00+00:00')
|
||||
const C = sheet('c', 'Cheval (tête)', 'Horse (head)', '2026-11-09T11:06:00.123456+00:00')
|
||||
const E = sheet('e', 'Émeu', 'Emu', '2026-11-05T15:20:00+00:00')
|
||||
const Z = sheet('z', 'Zèbre', 'Zebra', '2026-11-05T15:20:00+00:00')
|
||||
const ids = (list: OfficialSheetAdminSummary[]) => list.map((s) => s.sheet_id).join('')
|
||||
|
||||
describe('searchSheets', () => {
|
||||
it('matches the French or the English name, accents and case ignored', () => {
|
||||
expect(ids(searchSheets([A, C, E, Z], 'ane'))).toBe('a')
|
||||
expect(ids(searchSheets([A, C, E, Z], 'HORSE'))).toBe('c')
|
||||
expect(ids(searchSheets([A, C, E, Z], 'émeu'))).toBe('e')
|
||||
})
|
||||
it('ignores surrounding spaces; an empty search keeps every sheet; brackets are plain text', () => {
|
||||
expect(ids(searchSheets([A, C], ' cheval '))).toBe('c')
|
||||
expect(ids(searchSheets([A, C], ' '))).toBe('ac')
|
||||
expect(ids(searchSheets([A, C], '(tête)'))).toBe('c')
|
||||
})
|
||||
})
|
||||
|
||||
describe('sortSheets', () => {
|
||||
it('modified: newest first, equal dates by name', () => {
|
||||
expect(ids(sortSheets([A, Z, E, C], 'modified', 'fr'))).toBe('ceza')
|
||||
})
|
||||
it('name: the collation of the interface language, not code points', () => {
|
||||
expect(ids(sortSheets([Z, E, C, A], 'name', 'fr'))).toBe('acez')
|
||||
expect(ids(sortSheets([Z, E, C, A], 'name', 'en'))).toBe('aecz')
|
||||
})
|
||||
it('equal names fall back to the id, whatever the input order', () => {
|
||||
const twin = { ...A, sheet_id: 'b' }
|
||||
expect(ids(sortSheets([twin, A], 'name', 'fr'))).toBe('ab')
|
||||
expect(ids(sortSheets([A, twin], 'modified', 'fr'))).toBe('ab')
|
||||
})
|
||||
it('returns a new array and leaves its input alone', () => {
|
||||
const input = [Z, A]
|
||||
expect(sortSheets(input, 'name', 'fr')).not.toBe(input)
|
||||
expect(ids(input)).toBe('za')
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
In `admin.labels.test.ts`:
|
||||
|
||||
```ts
|
||||
describe('formatShortParisDateTime (A8)', () => {
|
||||
it('reads « 9 nov. 2026, 12:06 » in French and « 9 Nov 2026, 12:06 » in English, in Paris time', () => {
|
||||
expect(formatShortParisDateTime('2026-11-09T11:06:00.123456+00:00', 'fr')).toBe('9 nov. 2026, 12:06')
|
||||
expect(formatShortParisDateTime('2026-11-09T11:06:00.123456+00:00', 'en')).toBe('9 Nov 2026, 12:06')
|
||||
})
|
||||
it('follows the Paris summer offset', () => {
|
||||
expect(formatShortParisDateTime('2026-07-01T22:30:00+00:00', 'fr')).toBe('2 juil. 2026, 00:30')
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run, watch them fail** (`pnpm --filter @faunosteo/app test:run -- admin.sheetList admin.labels`).
|
||||
|
||||
- [ ] **Step 3: Implement.** In `catalogue/useCatalogue.ts`, the name rule leaves `filterCatalog` for a shared
|
||||
function (behaviour identical, the catalogue suites unchanged and green):
|
||||
|
||||
```ts
|
||||
/** A sheet name contains the search, in French or in English, accents and case ignored. */
|
||||
export function matchesSheetName(name: { fr: string; en: string }, query: string): boolean {
|
||||
const term = folded(query.trim())
|
||||
return term === '' || folded(name.fr).includes(term) || folded(name.en).includes(term)
|
||||
}
|
||||
```
|
||||
|
||||
with `filterCatalog` returning `entries.filter((entry) => (speciesId === null || entry.species_id === speciesId)
|
||||
&& matchesSheetName(entry.name, query))`. Then `apps/app/src/admin/sheetList.ts`:
|
||||
|
||||
```ts
|
||||
import type { OfficialSheetAdminSummary } from '@faunosteo/supabase'
|
||||
import { matchesSheetName } from '@/catalogue/useCatalogue'
|
||||
import type { Locale } from '@/i18n/types'
|
||||
|
||||
// shortcut: search and sort run in the browser on the whole list; they move to
|
||||
// the server with the list's paging (RR-13, TODO.md).
|
||||
|
||||
/** The display orders of the admin list; `modified` is the default (D7). */
|
||||
export const SHEET_SORTS = ['modified', 'name'] as const
|
||||
export type SheetSort = (typeof SHEET_SORTS)[number]
|
||||
|
||||
type Sheet = OfficialSheetAdminSummary
|
||||
|
||||
/** Search on the sheet name only, as the catalogue does (D7). */
|
||||
export function searchSheets(sheets: readonly Sheet[], query: string): Sheet[] {
|
||||
return sheets.filter((sheet) => matchesSheetName(sheet.name, query))
|
||||
}
|
||||
|
||||
/**
|
||||
* Display order only: a new array, the input untouched. `modified` puts the
|
||||
* newest `last_modified_at` first; equal dates, and `name`, follow the name in
|
||||
* the interface language, then the id, so the order never depends on the
|
||||
* server's.
|
||||
*/
|
||||
export function sortSheets(
|
||||
sheets: readonly Sheet[],
|
||||
sort: SheetSort,
|
||||
locale: Locale,
|
||||
): Sheet[] {
|
||||
const collator = new Intl.Collator(locale, { sensitivity: 'base', numeric: true })
|
||||
const time = (sheet: Sheet) => Date.parse(sheet.last_modified_at)
|
||||
const byName = (a: Sheet, b: Sheet) =>
|
||||
collator.compare(a.name[locale], b.name[locale]) ||
|
||||
a.sheet_id.localeCompare(b.sheet_id)
|
||||
return [...sheets].sort(
|
||||
(a, b) => (sort === 'modified' ? time(b) - time(a) : 0) || byName(a, b),
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
and in `apps/app/src/admin/labels.ts`, beside `formatDay` (one formatter per language, built once: the list
|
||||
formats hundreds of rows at each keystroke):
|
||||
|
||||
```ts
|
||||
import { PARIS_TIME_ZONE } from '@/lib/dates'
|
||||
|
||||
function shortDateTime(tag: string): Intl.DateTimeFormat {
|
||||
return new Intl.DateTimeFormat(tag, {
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
timeZone: PARIS_TIME_ZONE,
|
||||
})
|
||||
}
|
||||
const SHORT_DATE_TIME: Record<Locale, Intl.DateTimeFormat> = {
|
||||
fr: shortDateTime('fr-FR'),
|
||||
en: shortDateTime('en-GB'),
|
||||
}
|
||||
|
||||
/** « 9 nov. 2026, 12:06 » / « 9 Nov 2026, 12:06 », in Paris time (A8). */
|
||||
export function formatShortParisDateTime(iso: string, locale: Locale): string {
|
||||
return SHORT_DATE_TIME[locale].format(new Date(iso))
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Run, watch them pass** (the catalogue suites included). If the runner's ICU prints another
|
||||
separator than the ratified string, stop and report: the ratified text wins, never the expectation.
|
||||
|
||||
- [ ] **Step 5: Commit.** `feat(app): search, sort and date format of the admin sheet list`.
|
||||
|
||||
### Task 5: The list page (board 28, board 29 A)
|
||||
|
||||
**Files:**
|
||||
- Modify: `apps/app/src/app/routes/app/admin/AdminSheetsRoute.tsx`, `apps/app/src/admin/labels.ts`
|
||||
(`sheetDetails`, the route's `details` moved with the species first), `apps/app/src/i18n/{fr,en}.ts`,
|
||||
`apps/app/tests/unit/routes.admin.test.tsx`
|
||||
- Create: `apps/app/src/components/admin/ModifiedDate.tsx`
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: Task 4's functions, `filterSheets`, `usePlural` (`@/editor/plural`), `Input`, `Select`, `Icon`.
|
||||
- Produces:
|
||||
- `sheetDetails(t, sheet, species, locale): string` (the « Cheval · Active · version publiée 3 · … » line)
|
||||
- `<ModifiedDate iso={string} />`: `<time dateTime={new Date(iso).toISOString()}>` around the whole phrase
|
||||
« Modifiée le {date} » (a valid HTML time value has at most three fraction digits)
|
||||
- i18n keys `admin.sheets.search`, `admin.sheets.clear_search`, `admin.sheets.sort_by`,
|
||||
`admin.sheets.sort.modified`, `admin.sheets.sort.name`, `admin.sheets.count_one`, `admin.sheets.count_other`,
|
||||
`admin.sheets.count_of_one`, `admin.sheets.count_of_other`, `admin.sheets.modified`, `admin.sheets.no_result`
|
||||
(texts: Global Constraints; singular « {count} fiche », « {count} fiche sur {total} », « {count} sheet »,
|
||||
« {count} sheet of {total} »).
|
||||
|
||||
**Behaviour:**
|
||||
- The search text and the sort are two `useState` beside the existing filters state; the rows shown are
|
||||
`sortSheets(searchSheets(filterSheets(sheets, filters), query), sort, locale)`.
|
||||
- Order on the page (board 28): heading and « Nouvelle fiche »; the search field and « Trier par » on one line
|
||||
from 640 px, stacked below (board 29 A: search, sort, then the four filters, each full width, 44 px targets);
|
||||
the four filters unchanged; the count line; the list.
|
||||
- Search field: `type="search"`, the label as `aria-label` and placeholder, `maxLength={100}`,
|
||||
`autoComplete="off"` (as the catalogue), no magnifier (F14); a « × » button only while the field is not empty
|
||||
(accessible name « Effacer la recherche »); Escape on a non-empty field empties it and stops there (REVUE
|
||||
point 4), on an empty field does nothing. Clearing, by either way, returns the focus to the field.
|
||||
`// shortcut:` same markup as `ReferenceToolbar`'s search (R2, closed and validated, not reopened here); fold
|
||||
both onto one component when the editor is next opened.
|
||||
- Search is instant, on the name only; it combines with the four filters.
|
||||
- « Trier par »: a native select, « Dernière modification » (default) and « Nom ».
|
||||
- Count line, `aria-live="polite"`: « {n} fiches » when everything is shown, « {n} fiches sur {total} » otherwise
|
||||
(`total` = the loaded list; « 0 fiche sur 12 », « 0 sheets of 12 », through `usePlural`). Shown once the list is
|
||||
ready and not empty.
|
||||
- Row (board 28): the whole row is one link; name and badges; the detail line; the date top right from 640 px, on
|
||||
its own line under the detail below (board 29 A). The name wraps anywhere (`[overflow-wrap:anywhere]`). No new
|
||||
badge, no highlight of the found text.
|
||||
- Empty states (board 28 note, literally): no official sheet at all: « Aucune fiche officielle pour le moment. »;
|
||||
nothing shown while a filter is active: « Aucune fiche ne correspond à ces filtres. »; nothing shown with a
|
||||
search and no filter: a block « Aucune fiche ne contient « {q} » dans son nom. » with the button « Effacer la
|
||||
recherche ». The block is a plain element, not `Notice` (a live region; the count line announces the result);
|
||||
the search text is the trimmed text, inserted with a function replacement (`.replace('{q}', () => query)`) and
|
||||
wrapping anywhere.
|
||||
|
||||
**Test cases** (`routes.admin.test.tsx`, « Official sheets list »; three sheets with distinct names and dates; the
|
||||
existing test keeps its assertions):
|
||||
1. Default order is by last modification, newest first; a row reads « Modifiée le 9 nov. 2026, 12:06 » and its
|
||||
`time` carries `2026-11-09T11:06:00.123Z`.
|
||||
2. Typing « chev » narrows the list and the count reads « 1 fiche sur 3 ».
|
||||
3. The clear button appears with text, empties the field, restores « 3 fiches », and the field has the focus;
|
||||
Escape does the same on a non-empty field and nothing on an empty one.
|
||||
4. « Nom » reorders the rows.
|
||||
5. The three empty states; a search of `$&` shows `$&` in the sentence.
|
||||
6. The English interface reads « 1 sheet of 3 », « Modified on 9 Nov 2026, 12:06 », « Sort by ».
|
||||
|
||||
**Verification:** `pnpm typecheck && pnpm lint && pnpm test:run && pnpm build`; `impeccable detect` on the changed
|
||||
`.tsx`.
|
||||
|
||||
- [ ] Steps: failing tests → run (fail) → implement → run (pass) → verification → commit
|
||||
`feat(app): search, sort, count and date on the official sheet list`.
|
||||
|
||||
### Task 6: The Administration home card (board 29 B)
|
||||
|
||||
**Files:**
|
||||
- Modify: `apps/app/src/app/routes/app/admin/AdminHomeRoute.tsx`, `apps/app/src/i18n/{fr,en}.ts`,
|
||||
`apps/app/tests/unit/routes.admin.test.tsx`
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: `sortSheets`, `sheetDetails`, `ModifiedDate`, `SheetBadges`, `WorkingCopyAction`.
|
||||
- Produces: i18n `admin.home.latest` (« Dernières modifications » / « Latest changes »), `admin.home.see_all`
|
||||
(« Voir les {count} fiches » / « See the {count} sheets »); `admin.home.all_sheets` kept for fewer than two (D6).
|
||||
|
||||
**Behaviour:**
|
||||
- The card reads the sheet list and the species names together; a failed species read falls back to an empty list
|
||||
(`listCatalogSpecies(client).catch(() => [])`, so `speciesLabel` shows the id), the card never fails for it. A
|
||||
rights refusal of the sheet list still hides the card.
|
||||
- Under « Brouillons, revues, versions. »: the sub-heading « Dernières modifications » (shown with at least one
|
||||
sheet), then at most five sheets, `sortSheets(sheets, 'modified', locale)`: the name as a link with the badges,
|
||||
the detail line, the date; the historical sheet, when among the five and for an editor, keeps its working copy
|
||||
action under its line (unchanged component). No new badge.
|
||||
- Footer link to `/app/admin/sheets`: « Voir les {n} fiches » with the total from two sheets; « Toutes les fiches
|
||||
officielles » for zero or one (D6).
|
||||
|
||||
**Unit test cases:** seven sheets give five items in date order and « Voir les 7 fiches »; one sheet and no sheet
|
||||
give « Toutes les fiches officielles » (and the empty sentence for none); the historical sheet outside the five
|
||||
shows no working copy action on the card, inside the five it does (editor only); the detail line and the date are
|
||||
those of the list for the same sheet; the species read refused: the card shows with « equine » in the detail line;
|
||||
English texts.
|
||||
|
||||
- [ ] Steps: failing tests → run (fail) → implement → run (pass) → gates, `impeccable detect` → commit
|
||||
`feat(app): Administration home lists the latest modified sheets`.
|
||||
|
||||
### Task 7: The browser proof on the sandbox
|
||||
|
||||
**Files:**
|
||||
- Create: `apps/app/e2e/shell/admin-sheets-list.spec.ts`
|
||||
- Modify: `apps/app/e2e/support/admin.ts` (`allSheetsLink`), `apps/app/e2e/shell/admin.spec.ts:460-461`,
|
||||
`:671-672`, `apps/app/e2e/shell/editor-journey.spec.ts:58-61` (locator only)
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: `editorActor(locale)` (`e2e/support/editor.ts:64`, returns `{ account, secret, aal2 }`),
|
||||
`seedOfficialSheet(names, 'draft')` (`e2e/support/catalogue.ts:141`, returns `{ id, names }`), `sql()` and
|
||||
`rpc(fn, args, token)` of the sandbox helpers, `stepUpAdmin`, `expectAccessible`, `expectNoHorizontalOverflow`.
|
||||
- Produces: `allSheetsLink(scope: Page | Locator, dict: Dict): Locator`: the link of `scope` named by
|
||||
`admin.home.all_sheets` or by `admin.home.see_all` with any number; the three call sites pass the same card
|
||||
locator they use today.
|
||||
|
||||
**Spec** (needs the sandbox migrated; never opens `/app/admin/access`; serial; one actor per project):
|
||||
- Fixtures, once per project: three official draft sheets named with a run token, « R3 {token} Alpha »,
|
||||
« R3 {token} Émeu », « R3 {token} Zèbre » (English names with the same token), seeded in that order, each id
|
||||
pushed to the cleanup list as soon as it exists; then Alpha's draft id and content read with `sql()` and one more
|
||||
save through `save_sheet_draft` with the actor's aal2 token.
|
||||
- Teardown (D7): each listed id soft-deleted through `delete_anatomical_sheet` with the same token, the returned id
|
||||
checked, each step independent of the others' failure.
|
||||
- fr and en, desktop and 375 px:
|
||||
1. Search the token: three rows; the count line's total equals the length of the `list_official_sheets_admin`
|
||||
answer captured in that same load (`page.waitForResponse`); order Alpha, Zèbre, Émeu (Alpha's sheet row is
|
||||
the oldest of the three: only the true date puts it first); each row's date matches the ratified format.
|
||||
2. « Nom »: Alpha, Émeu, Zèbre.
|
||||
3. A search of the token followed by 100 characters without a space cut to the field's limit: the search
|
||||
sentence, no sideways scroll; « Effacer la recherche » empties, focuses the field and restores the count.
|
||||
4. axe and no sideways scroll on the searched list, on the empty state and on `/app/admin` (never on the
|
||||
unsearched list of the accumulated sandbox).
|
||||
5. Home: the sub-heading; at most five items; their `time[datetime]` values non-increasing by `Date.parse`; the
|
||||
footer link carries a number and opens the list.
|
||||
- Each sweep adds two accounts and two catalogue grants to the sandbox (BLK-015 counts grants: stated, not
|
||||
hidden); no sheet is left listed.
|
||||
|
||||
**Verification:** `pnpm db:sandbox e2e-shell admin-sheets-list.spec.ts` under the data guard, then the explicit
|
||||
spec list of the full sweep without `editor-equine.spec.ts`, with its exact counts. Expected failures are named,
|
||||
not grouped: `admin.spec.ts` A0 « the rights screen with grants » and « admin screens … », with « Target crashed »
|
||||
at `/app/admin/access` (BLK-015). A1 and « access per right » (the two rewritten locators) must be green in both
|
||||
languages. Any other red is R3's until proven otherwise.
|
||||
|
||||
- [ ] Steps: helper and the three locator rewrites (R-24 map in the commit body) → the spec → verification →
|
||||
commit `test(app): shell proof of the sheet list search, sort and dates`.
|
||||
|
||||
### Task 8: Documents and closing gates
|
||||
|
||||
**Files:** `docs/development/V1-2-6_U1_CORRECTIONS.md` (§R3 as built, the A7 split superseded per D2),
|
||||
`V1-2-6_R3_SQL_CHECKPOINT.md` (status, the corrections F2, F3, F4, the limits F7, the owner's answers),
|
||||
`V1-2-6_OWNER_TRIAL.md` (a French §4.15), `V1-2_ANATOMICAL_SHEETS.md` §12.3 (M9), `SUPABASE.md` §5.1,
|
||||
`BROWSER_TESTS.md` (the new spec, the named expected failures), `RUST_ARCHITECTURE_REVIEW.md` Part II (class C rows
|
||||
for `admin/sheetList.ts` and the date format), `docs/design/README.md` (the magnifier deviation), `CLAUDE.md`
|
||||
(migration list, new files), `CHANGELOG.md`, `.claude/tasks/TODO.md` (R3 block, RR-13 wording per D4, the
|
||||
`shortcut:` lines harvested).
|
||||
|
||||
- [ ] Owner trial text §4.15 (French, on `db:trial`): the search and its clear button; the two sorts; a draft saved
|
||||
moves its sheet to the top and changes its date; a search without result; a search with a filter; the home
|
||||
card's five and its link; the same at 375 px; the note that the historical sheet's working copy button is on its
|
||||
own page when it is not among the five (F9).
|
||||
- [ ] Closing gates, each by a fresh agent: `verifier` on the contract written after the owner's answers;
|
||||
`security-auditor` on the whole diff (the script change, search text rendered, the client boundary); a fresh
|
||||
design review of the two screens against boards 28 and 29 at 1 280 and 375 px; a fresh code review of the range.
|
||||
- [ ] `pnpm check:all` result reported exactly; nothing is called green that is not.
|
||||
- [ ] STOP: the owner's trial on `db:trial` (already migrated at Task 2). No merge.
|
||||
|
||||
## Out of scope, tracked
|
||||
|
||||
- BLK-015 (rights screen under axe on accumulated grants) and RR-13 (server paging): untouched, still open, their
|
||||
lines kept; R3 adds no dependency on them beyond the `shortcut:` of Task 4.
|
||||
- R4 (integrity warning in catalogue cards, board 30): next lot, its own go.
|
||||
- Anomaly A (fictitious fingerprints) and the `editor-equine` set-aside risk: unchanged.
|
||||
- List state kept on return (D5): BDR-079's follow-up.
|
||||
|
||||
## Challenge round (2026-11-16, three fresh `plan-challenger` agents, read-only)
|
||||
|
||||
| Lens | Finding | Outcome in rev 2 |
|
||||
|---|---|---|
|
||||
| correctness 1, simplicity 12 | A7's two-step delivery dropped without saying so; « no go: nothing starts » contradicts the ratified fallback | F13, D2; D1's fallback is the « before » state |
|
||||
| correctness 2, simplicity 2 | Board 28 already settles the empty result with a filter; the plan recommended a deviation | F10 corrected, the note followed literally, the question removed |
|
||||
| correctness 2, simplicity 10 | « Voir la fiche » and a hidden link are labels no board validates | D6 on already validated labels; a link stays at zero |
|
||||
| correctness 3, robustness 9 | The spec's helpers give no aal2 token; ids not captured one by one; run-scoped cleanup is an open owner item | `editorActor`, `seedOfficialSheet`, `sql()`; D7 |
|
||||
| correctness 4 to 9 | Test snippet not fitting the file and failing lint; fixtures found by the run; red count; M7 line range and diff; missing grant; help header | Tasks 1 to 3 corrected |
|
||||
| correctness 11, robustness 10 d | `<time dateTime>` with six fraction digits is invalid HTML | `toISOString()`; the spec compares `Date.parse` |
|
||||
| correctness 12, robustness 4 | The total compared across two loads of a changing sandbox | Compared within one load; format only on the card |
|
||||
| correctness 13 | The name sort in the English interface is a choice | Listed under « Recorded unless the owner objects » |
|
||||
| correctness 14 | F2 overstated, F11 line | Corrected |
|
||||
| robustness 1, 6; simplicity 1 | The address as source of truth of a typed field drops characters (react-router transitions); stale parameters; against BDR-079 and BDR-116 | Task removed; D5 recommends no |
|
||||
| robustness 2 | The owner's trial app breaks from the client change until the trial is migrated | F12; the trial is migrated in Task 2, before Task 3 |
|
||||
| robustness 3 | M9 reached the sandbox before its security review; an edited migration is never re-applied there | Review in Task 1; M9 frozen once applied; function md5 recorded |
|
||||
| robustness 5 | « Expected red: admin.spec » could hide R3's own regressions; no passing axe scan of the home page | Failures named by test; A1 and « access per right » must be green; axe on `/app/admin` in the R3 spec |
|
||||
| robustness 7 | `Notice` is a live region; long text without a space; `$` patterns in `.replace` | Plain block, wrapping, function replacement, tests |
|
||||
| robustness 8 | The card failed whole on a failed species read | Fallback to ids, Review Focus 5 |
|
||||
| robustness 10 a to c | Three more limits of the date | F7 (iv), (v); the lock-wait case judged negligible and not recorded |
|
||||
| robustness 11 | A formatter built per row per keystroke | One per language, built once |
|
||||
| robustness 12 | The locator helper lost the card scope | `allSheetsLink(scope, dict)` |
|
||||
| robustness 13 | `db-trial-check.sh` suggests stopping the trial | Not run; Global Constraints |
|
||||
| simplicity 3 | Four of eight decisions already answered by validated documents | Moved to « Recorded unless the owner objects »; D4 kept (the owner's own track) |
|
||||
| simplicity 4, 5 | Seven new app files, a single-use `SearchField` | Two new app files; the field inline with its `shortcut:` |
|
||||
| simplicity 6 | The search rule copied from the catalogue | `matchesSheetName` shared |
|
||||
| simplicity 7 | `.datetime()` on one field only | Kept, with its reason (sorted and formatted by `Intl`, which throws) |
|
||||
| simplicity 8 | A third Paris literal, a near-twin name | `PARIS_TIME_ZONE`, `formatShortParisDateTime` |
|
||||
| simplicity 9 | The same behaviour proven at three levels | Pure rules in unit tests; route tests for wiring; the spec for the real date, layout and axe |
|
||||
| simplicity 11 | Magnifier, `<time>` wrapping, field limits left open | F14, Task 5 |
|
||||
@@ -0,0 +1,298 @@
|
||||
# R4 Catalogue Card Integrity Warning Implementation Plan (V1-2.6), rev 3
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use subagent-driven-development to implement this plan task-by-task.
|
||||
> Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Status:** VALIDATED by the owner, 2026-11-17 (brief « Je valide le plan R4 avec les décisions suivantes »): D1
|
||||
ALTERNATIVE (a version over the size limits shows the existing caps text, no « Réessayer », told apart from an
|
||||
integrity failure); D2, D3, D4 as recommended; R-2 to R-7 accepted. Owner precisions, binding: (P1) the trial
|
||||
procedure says how to tell the anomalies already on the sandbox from R4's own behaviour; (P2) the spec cleans only
|
||||
the sheets and the right it created, identity checked, no pre-existing row changed. Implementation authorised on the
|
||||
sandbox. DEV unchanged, no merge. BLK-015 and RR-13 stay separate tracks. Rev 3 = rev 2 + the owner's answers. Rev 2 = rev 1 + three fresh challenges of 2026-11-16 (correctness
|
||||
FATAL(4), robustness FATAL(4), simplicity FATAL(3)); what became of each finding is in « Challenge round » at the end.
|
||||
|
||||
**Goal:** a catalogue card whose published version fails the core's integrity check says so inside the card, with
|
||||
« Consulter » kept; a card whose load failed for another reason has its own line and « Réessayer »; nothing is
|
||||
hidden and the check is never bypassed.
|
||||
|
||||
**Architecture:** UI only. `useCardDetails` keeps the failure kind it drops today and offers a retry. A pure
|
||||
function in `catalogue/failure.ts` sorts the closed kinds into « integrity » and « other ». A new `CardFailure`
|
||||
component renders the line board 30 draws through `Notice`, which gains a `warning` tone, an optional glyph and an
|
||||
option to not be a live region (defaults keep its 114 call sites as they are). One new glyph. No SQL, no Rust, no
|
||||
worker, no change to the sheet page or to `CatalogueFailureNotice`.
|
||||
|
||||
**Tech Stack:** React 19, Tailwind 4, vitest + happy-dom (real core through `CataloguePreview`), Playwright + axe on
|
||||
`pnpm db:sandbox`.
|
||||
|
||||
**Spec:** `docs/development/V1-2-6_U1_CORRECTIONS.md` §3 « R4 — Integrity warning in catalogue cards (D9 C,
|
||||
independent fix) » and §5 row C; board `docs/design/v1-2-6-r0/30-catalogue-carte-integrite.png` (approved as is,
|
||||
2026-11-09); arbitration A10 (`docs/design/v1-2-6-r0/ARBITRAGES.md`, wording ratified); labels
|
||||
`docs/design/v1-2-6-r0/REVUE.md:85`; REVUE point 9 (caps and view « restent à classer »: D1, D2).
|
||||
|
||||
Plan form (as R2 and R3): pure functions in full; React tasks give files, behaviour, test cases and verification,
|
||||
the executor writes the JSX under TDD against board 30.
|
||||
|
||||
## Audit findings (2026-11-16, read-only, at dc67c4a; checked again by the three challenges)
|
||||
|
||||
| # | Finding | Evidence | Consequence |
|
||||
|---|---|---|---|
|
||||
| F1 | The card already runs the full check: `loadVersion` reads the version, downloads the drawings and builds `CataloguePreview` (hashes, fingerprint, caps). On `!load.ok` the hook returns without state: the card keeps name, « Version n » and « Consulter », silently. | `apps/app/src/catalogue/useCardDetails.ts:31-33`, `catalogue/catalogue.ts:197-220` | The failure kind is already computed; R4 keeps it. No new read, no second check. |
|
||||
| F2 | The closed kinds exist: `CatalogueFailure` (11 kinds), `serverFailure`, `coreFailure` (which folds `internal`, a trap, into `core_unavailable`). The sheet page phrases them through `catalogue.failure.<kind>` and `CatalogueFailureNotice`, which offers « Réessayer » for every kind it shows. | `catalogue/failure.ts:9-58`, `CatalogueFailureNotice.tsx:17-35` | The card reuses the kinds and texts; one new label only (A10). Retry policy aligned on the page's. |
|
||||
| F3 | `Notice` has three tones; its glyph is chosen from the tone (`check` or `alert`), no glyph prop; `error` is `role="alert"`, the others `role="status"`. Board 30 draws the network line in a warning tone with a « no network » glyph; `Icon` has none. | `components/ui/Notice.tsx:4-28`, `components/ui/Icon.tsx:26-50` | `Notice` gains tone `warning`, `icon?: IconName` and `live?: boolean`, defaults unchanged; `Icon` gains `wifi-off`. |
|
||||
| F4 | The publication date comes from a second read, `listSheetVersions(...).catch(() => [])`: its failure only drops the date. That read is a GET, which postgrest-js retries 3 times after a fetch failure (1, 2, 4 s): with the network really down a card settles after about 7 s. | `useCardDetails.ts:28-29`, `packages/supabase/src/sheets.ts:510-515`, postgrest-js 2.117.3 `fetchWithRetry` | Date kept silent (R-6). The retry state must hold for seconds (R-3), and the owner's offline step names the wait. |
|
||||
| F5 | When the version passes but the main view cannot be composed, `thumbnail` stays null: counts without a picture and without a word. `preview.canvas` answers a closed refusal, or `core_unavailable` / `internal` when the engine fails. | `useCardDetails.ts:35-40`, `catalogue/preview.ts:114-118, 186-192` | « À classer »: D2. If shown, the engine kinds go to the core line with its retry, never to « vue refusée ». |
|
||||
| F6 | `caps` is a core refusal, not listed by board 30 among the integrity failures. | `failure.ts:38-44`, board 30 note « Portée » | « À classer »: D1. |
|
||||
| F7 | The existing first unit test asserts a card whose version id is unknown keeps « Version 1 » and its link: that card's load fails with `denied`. | `tests/unit/routes.catalogue.test.tsx:139-141` | Extended, not removed: the card now also shows its line (R-5). |
|
||||
| F8 | The trial stack has no published version (2 drafts): its catalogue is empty. The sandbox lists 156 published entries, 4 of them current versions with the fictitious fingerprint of test anomaly A, which fail the check today. | read-only counts 2026-11-16 | Where the owner tries R4: D3. Anomaly A stays a separate track. |
|
||||
| F9 | The catalogue e2e seeds official sheets by SQL as postgres, « prior owner actions » (`seedOfficialSheet`), and never cleans them. `delete_anatomical_sheet` refuses any sheet that ever had a published version (`sheet.published_history`) and requires aal2 and `sheet_editor`; R3's D7 only ever deleted draft sheets. The catalogue lists `status = 'active'` sheets only. | `e2e/support/catalogue.ts:141-190`, `20261028110000_sheet_review_workflow.sql:1275-1294, 1625-1646`, `20261028100000_sheet_access_hardening.sql:42` | A published test sheet cannot be deleted; left listed, each run adds a broken card to the shared catalogue. Cleanup: D4. |
|
||||
| F10 | Each card loads once, at mount (effect keyed on sheet and version ids); cards are keyed by `sheet_id`. Going offline after the list loaded changes nothing; a card shows a network failure only if it mounts while offline (a search hides it, then shows it again). | `useCardDetails.ts:24-53`, `CatalogRoute.tsx:66-68` | The e2e and the owner's step remount the card by search, never by reload. |
|
||||
| F11 | The core runtime does not retry a failed first load by itself: `ready()` answers false until `coreRuntime().retry()` is called; the sheet page and `CatalogueCanvas` call it before reloading. Each trap spends one of three recoveries for the whole tab. | `packages/core-wasm/src/runtime.ts:142-184`, `catalogue/useSheetVersion.ts:85-88`, `CatalogueCanvas.tsx:100-104` | The card's retry for `core_unavailable` calls `coreRuntime().retry()` first (R-2). |
|
||||
| F12 | e2e: the app talks to a fake `.invalid` origin served only by the `routeToSandbox` context route; Playwright runs the last route first. Every card loads at mount (156+ on the sandbox). | `e2e/support/sandbox.ts:12, 33-40`, `CatalogRoute.tsx:68` | A route that aborts one version must `route.fallback()` the rest and be removed alone; the spec searches its tag before any check (as `catalogue.spec.ts`). |
|
||||
|
||||
## Owner decisions (answered 2026-11-17: D1 ALTERNATIVE, D2 to D4 recommendation)
|
||||
|
||||
| # | Question | Recommendation | Alternative(s) | Cost if wrong |
|
||||
|---|---|---|---|---|
|
||||
| D1 | `caps` (a version over the size limits) in a card | Integrity line, error tone, A10 text, no « Réessayer »: the core refuses the version itself and a retry cannot change it. | Its own line, existing text `catalogue.failure.caps` (« Cette version dépasse les limites de taille d'une fiche. »), error tone, no retry. | One mapping line. ANSWER: alternative (own caps line, no retry). |
|
||||
| D2 | The version passes the check but its main view cannot be drawn (no thumbnail) | Say it: a neutral line (tone `info`, not a live region) with the existing text `catalogue.failure.view`; counts and « Consulter » kept; when the engine itself failed (F5) the core line with its retry instead. Nothing left silent, no new wording. | (a) Silent as today (no code). (b) A new shorter text for the card, to ratify (e.g. « L'aperçu de cette fiche ne peut pas être affiché. »). | One component branch and its test; built only if chosen. ANSWER: recommendation. |
|
||||
| D3 | Where the owner tries R4 | `pnpm db:sandbox trial` (the automated-test stack served for a manual trial, used on 2026-11-09): its 4 failing entries show the integrity line as they are; the network line by hiding a card with a search, going offline in DevTools, clearing the search, waiting about 7 s, going back online, « Réessayer ». No write by Claude on any stack. The page loads slowly there (156 cards each load their version). | (a) Seed two published test sheets on the trial stack (one sound, one with a wrong stored fingerprint) through a new `db:trial` step: a script change and a write on the owner's trial data, its own go. (b) Both. | (a) adds a script and a write; the recommendation adds none. ANSWER: recommendation; P1 on the procedure. |
|
||||
| D4 | Cleanup of the browser spec's own data on the persistent sandbox (F9): published test sheets cannot be deleted | The spec archives its own sheets at the end, by SQL as postgres under the seed owner, the same « prior owner action » form as its seed (status `archived`, read back per id), and revokes its own catalogue grant the same way; it touches no other row. Archived sheets leave the catalogue. | (a) No cleanup, as `catalogue.spec.ts` today: every run leaves one broken card listed on the sandbox (and in the D3 trial). (b) Archive through the application RPC with an aal2 publisher account: one more account and grant per run (BLK-015). | (a) grows the shared catalogue with broken cards; the recommendation writes only the run's own rows. ANSWER: recommendation (soft deletion and grant removal authorised; ruling in Task 2). |
|
||||
|
||||
## Recorded unless the owner objects
|
||||
|
||||
- R-1 Integrity class (error tone, A10 text in bold, glyph `alert`, no retry): `fingerprint_mismatch`,
|
||||
`drawing_hash_mismatch`, `drawing_missing`, `invalid_document` (board 30 note « Portée »). D1 (owner): `caps` is NOT
|
||||
integrity: its own line, existing text `catalogue.failure.caps` (« Cette version dépasse les limites de taille
|
||||
d'une fiche. »), error tone, glyph `alert`, no « Réessayer » (a retry cannot change the version). `drawing_missing` includes Storage answering « not found » for the drawing (400 or 404, folded by
|
||||
`classifyDrawingError`): an illustration the server does not give is missing (board 30 « illustration manquante »).
|
||||
The executor checks which Storage answers fold there and pins them in a test.
|
||||
- R-2 Other class (warning tone, existing text, « Réessayer » for that card): every other kind; texts
|
||||
`catalogue.failure.<kind>`, `access_denied.title` for `denied`, the core's text and retry label for
|
||||
`core_unavailable` (its retry calls `coreRuntime().retry()` before reloading, F11). Retry offered unless the kind is
|
||||
integrity or `caps`, or the engine stopped for good (the page's own rule, plus D1). A version that traps the core spends one of
|
||||
the tab's three recoveries per click, as on the sheet page (accepted, same blast radius).
|
||||
- R-3 Announcements and focus: the lines are not live regions (no burst of announcements at load when several
|
||||
cards fail). During a retry the line and « Réessayer » stay in place, the button `aria-disabled` and the card
|
||||
`aria-busy`, clicks ignored (no parallel loads); the focus stays on the button. If the retry fails again, a
|
||||
visually hidden polite region of the card, cleared at each attempt, says the line again. If it succeeds, the focus
|
||||
moves to the card's « Consulter » only if it was still on that card's « Réessayer » or on `body`.
|
||||
- R-4 Glyph: `wifi-off` for `network` (board 30), `alert` for every other line.
|
||||
- R-5 `denied` in a card (listed entry, version read refused): other class, « Accès non autorisé », with retry.
|
||||
- R-6 The publication date missing after a failed `listSheetVersions` stays silent (F4).
|
||||
- R-7 Engine-wide failure: when the core does not load, each card shows the core line with its own retry (the board
|
||||
draws per-card lines only); one card's retry restarts the engine and reloads that card, the others reload on their
|
||||
own retry. Accepted limit, recorded in the docs.
|
||||
- R-8 Rust by default: sorting closed kinds for display is display formatting (CLAUDE.md « kept as is »); one row in
|
||||
the review's Part II exception table, class C, as R3 did.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- The integrity check is the core's (`CataloguePreview` / `check_published`); never bypassed, weakened or skipped.
|
||||
- Card text FR « Contrôle d'intégrité échoué : cette version ne peut pas être affichée. », EN « Integrity check
|
||||
failed: this version cannot be displayed. » (A10, REVUE.md:85), key `catalogue.card.integrity_failed`.
|
||||
- The card stays in the list; « Publiée » stays; « Consulter » stays enabled and focusable in every state.
|
||||
- The sheet page (`SheetRoute`, `CatalogueFailureNotice`) is unchanged; `Notice` keeps today's role and glyph at
|
||||
every existing call site.
|
||||
- All UI strings through `useT()`, same keys in `fr.ts` and `en.ts`.
|
||||
- Max 25 logic lines per function, 100 columns for TypeScript; `shortcut:` comments harvested into TODO.md.
|
||||
- Tests never edit a pre-existing row; the spec's cleanup (D4) touches only the ids it created, read back per id;
|
||||
the spec never opens the rights screen (BLK-015). Never run `editor-equine.spec.ts`. No sandbox reset.
|
||||
- No merge, no deploy, DEV unchanged; no write on the trial stack (D3 recommendation).
|
||||
|
||||
## Review Focus
|
||||
|
||||
1. Several cards fail at once: one line per card, no burst of announcements, each « Réessayer » reloads its card
|
||||
only. Test: Task 1 test 4.
|
||||
2. A retry still running when the card unmounts (a search hides it): no state set after unmount, blob URLs created
|
||||
and revoked in balance, one `free()` per preview built. Test: Task 1 test 6 (deferred answer, spies).
|
||||
3. A retry that fails again: focus stays on « Réessayer », the polite region says the line again. Test: Task 1 test 3.
|
||||
4. The core's first load fails, then « Réessayer » succeeds (runtime retried). Test: Task 1 test 7.
|
||||
5. Phone width: the line wraps, « Réessayer » and « Consulter » 44 px high, no sideways scroll. Test: Task 2 at 375 px.
|
||||
|
||||
## File Structure
|
||||
|
||||
- Modify `apps/app/src/catalogue/failure.ts`: `cardFailure(failure, stopped)` (pure, below).
|
||||
- Modify `apps/app/src/catalogue/useCardDetails.ts`: returns `{ state, retry }`.
|
||||
- Create `apps/app/src/components/catalogue/CardFailure.tsx`: the line, its glyph, « Réessayer », the polite region.
|
||||
- Modify `apps/app/src/components/catalogue/CatalogueCard.tsx`: the failure in place of counts and thumbnail.
|
||||
- Modify `apps/app/src/components/ui/Notice.tsx`: tone `warning`, `icon?: IconName`, `live?: boolean`.
|
||||
- Modify `apps/app/src/components/ui/Icon.tsx`: glyph `wifi-off`.
|
||||
- Modify `apps/app/src/i18n/fr.ts`, `en.ts`: `catalogue.card.integrity_failed`.
|
||||
- Tests: `tests/unit/routes.catalogue.test.tsx` (cards, `cardFailure` exhaustiveness), `Notice` defaults.
|
||||
- E2E: `apps/app/e2e/support/catalogue.ts` (option `storedFingerprint`, archive and revoke helpers per D4),
|
||||
`apps/app/e2e/shell/catalogue-integrity.spec.ts`.
|
||||
- Docs (Task 3).
|
||||
|
||||
### Task 1: The card says its failure (board 30)
|
||||
|
||||
**Files:** as File Structure, app side.
|
||||
|
||||
**Interfaces:** Produces
|
||||
|
||||
```ts
|
||||
// catalogue/failure.ts
|
||||
export function cardFailure(
|
||||
failure: CatalogueFailure,
|
||||
stopped: boolean,
|
||||
): { integrity: boolean; refused: boolean; retry: boolean }
|
||||
|
||||
// catalogue/useCardDetails.ts
|
||||
export type CardState =
|
||||
| { status: 'loading' }
|
||||
| { status: 'ready'; details: CardDetails }
|
||||
| { status: 'failed'; failure: CatalogueFailure; retrying: boolean; attempt: number }
|
||||
export function useCardDetails(entry: CatalogEntry): { state: CardState; retry: () => void }
|
||||
```
|
||||
|
||||
```ts
|
||||
const INTEGRITY: ReadonlySet<CatalogueFailure> = new Set([
|
||||
'fingerprint_mismatch',
|
||||
'drawing_hash_mismatch',
|
||||
'drawing_missing',
|
||||
'invalid_document',
|
||||
])
|
||||
|
||||
/**
|
||||
* How a catalogue card treats its failure (board 30, A10, owner D1): never hidden; `refused` when the
|
||||
* version itself is refused (integrity, or over the size limits), retried only where a retry can work.
|
||||
*/
|
||||
export function cardFailure(failure: CatalogueFailure, stopped: boolean) {
|
||||
const integrity = INTEGRITY.has(failure)
|
||||
const refused = integrity || failure === 'caps'
|
||||
const retry = !refused && !(failure === 'core_unavailable' && stopped)
|
||||
return { integrity, refused, retry }
|
||||
}
|
||||
```
|
||||
|
||||
`CardFailure` derives the rest at its one render site: text (`catalogue.card.integrity_failed` for integrity, `catalogue.failure.caps` for caps,
|
||||
`coreFailureMessage(t, 'sheet.core_unavailable')` for the core, `access_denied.title` for `denied`, else
|
||||
`catalogue.failure.<kind>`), tone (`error` when `refused`, else `warning`), glyph (`wifi-off` for `network`, else `alert`), retry label
|
||||
(`sheet.core_retry` for the core, else `common.retry`).
|
||||
|
||||
Hook behaviour: today's loading and freeing order kept (preview freed once the canvas is composed, blob URL revoked
|
||||
on cleanup, `live` guard of each effect run). `retry()`: ignored while `retrying`; for `core_unavailable` it calls
|
||||
`coreRuntime().retry()` first; it sets `retrying: true` (the `failed` state stays, so the line and button stay
|
||||
mounted) and bumps the attempt in the effect's dependencies. Within 25 logic lines per function: split the load
|
||||
into a plain async function and the hook.
|
||||
|
||||
- [ ] **Step 1: Write the failing tests** in a new `describe('catalogue cards (R4, board 30)')` reusing the file's
|
||||
`serveVersions`, `versionAnswer` and Storage mocks:
|
||||
1. integrity, one row per kind (fingerprint `'a'.repeat(64)`, one drawing byte altered, Storage answering not
|
||||
found, `{ schema_version: 2 }`): the card shows `fr['catalogue.card.integrity_failed']`, no `role="alert"` or
|
||||
`role="status"` inside the card, no « Réessayer » in it, « Consulter Cheval » with its href, « Publiée ».
|
||||
2. network: `get_sheet_version` answers `{ error: { message: 'network' } }` (`classifySheetError` gives `network`
|
||||
for that message, a `TypeError` or status 0): text `catalogue.failure.network`, one « Réessayer »; serve the
|
||||
version again, click: the line goes, the counts appear, the focus is on « Consulter Cheval ».
|
||||
3. retry fails again: the button stays mounted and focused, `aria-disabled` while the attempt runs; afterwards the
|
||||
polite region holds the line text (cleared then set).
|
||||
4. two failing cards, retry one: the other id's `get_sheet_version` call count is unchanged.
|
||||
5. a second click while the attempt runs starts no second load.
|
||||
6. unmount during retry: `get_sheet_version` held on a deferred promise; click « Réessayer », type a search that
|
||||
removes the card, resolve: no state update warning, `URL.createObjectURL` / `URL.revokeObjectURL` calls balanced,
|
||||
`CataloguePreview.prototype.free` once per preview built.
|
||||
7. core first load fails (`coreRuntime().ready` stubbed to `false` once): the core line with `sheet.core_retry`;
|
||||
click: `coreRuntime().retry` called, the card loads.
|
||||
8. `session_expired` and `denied`: their texts, with « Réessayer ».
|
||||
8b. caps (D1): a document over a size limit (or `coreFailure('caps')` through a stubbed preview state): the card
|
||||
shows `fr['catalogue.failure.caps']`, error tone, NOT the integrity text, no « Réessayer », « Consulter » kept.
|
||||
9. the existing first test: « Chien, rachis » also shows `fr['access_denied.title']` (F7).
|
||||
10. English: the integrity line reads the EN text.
|
||||
11. `cardFailure` exhaustiveness: every member of `CatalogueFailure` gives the expected pair (the test lists the
|
||||
union's members and fails on a new one).
|
||||
12. `Notice` defaults: `error` keeps `role="alert"` and `alert`, `success` keeps `check`; `live={false}` removes the
|
||||
role; `icon` overrides the glyph.
|
||||
13. D2 (owner, validated): the main view's canvas refused shows `catalogue.failure.view` (tone `info`, no role) with the
|
||||
counts; the canvas answering `core_unavailable` shows the core line with its retry.
|
||||
- [ ] **Step 2: Run, expect FAIL** `pnpm --filter @faunosteo/app exec vitest run tests/unit/routes.catalogue.test.tsx`.
|
||||
- [ ] **Step 3: Implement** `cardFailure`, `Notice`, `Icon`, the hook, `CardFailure`, the card, the two dictionary lines.
|
||||
- [ ] **Step 4: Run, expect PASS**; then `pnpm --filter @faunosteo/app test:run`, `pnpm typecheck`, `pnpm lint`,
|
||||
`pnpm build`.
|
||||
- [ ] **Step 5: Commit** in two: `feat(ui): notice warning tone, glyph and non-live option` (Notice, Icon, test 12),
|
||||
then `feat(app): catalogue cards say an integrity or load failure (board 30)`.
|
||||
|
||||
### Task 2: The browser proof on the sandbox
|
||||
|
||||
**Files:** Modify `apps/app/e2e/support/catalogue.ts`; Create `apps/app/e2e/shell/catalogue-integrity.spec.ts`.
|
||||
|
||||
- `seedOfficialSheet(names, shape, options?: { storedFingerprint?: string })`: when given, the versions get that
|
||||
fingerprint instead of the core's (additive; `catalogue.spec.ts` unchanged).
|
||||
- Fixtures (`beforeAll`): one tag per run; one `listed` sheet with the core's fingerprint (« R4 <tag> saine »), one
|
||||
with `storedFingerprint: '0'.repeat(64)` (« R4 <tag> altérée »); one catalogue reader account and grant as
|
||||
`catalogue.spec.ts` does. Ids kept in the run's own list.
|
||||
- Cleanup (`afterAll`), D4 (owner, validated): each own sheet id archived on its own by SQL as postgres, through
|
||||
`private.set_sheet_status(<seed owner>, <id>, 'active', 'archived', 'anatomical_sheet.archived')` (the migrations'
|
||||
own path, audit row included), then read back `status = 'archived'` for that id; the run's own catalogue grant
|
||||
revoked by id (`update public.anatomical_catalog_grants set revoked_at = now(), revoked_by = <its account>,
|
||||
revocation_reason = 'e2e cleanup' where id = <the grant id captured at seed> and revoked_at is null returning id`),
|
||||
read back. Every statement names one id the run captured; nothing matches by pattern. Failures listed, then
|
||||
asserted empty. `seedGrant` returns the grant id (additive). The run's account stays (accounts are not cleaned by
|
||||
any suite; tracked with BLK-015).
|
||||
Ruling (controller): archive, not soft delete, although the owner authorised soft deletion: the application
|
||||
never deletes a sheet that had a published version (§6.9, `delete_anatomical_sheet`), so a deleted row with
|
||||
published history is a state no screen can reach; archiving is reachable, takes the sheet out of the catalogue and
|
||||
stays inside the owner's authorisation. Cost if wrong: archived test sheets remain visible in the admin sheet
|
||||
list under « Archivée » (one line per run, tagged « R4 <tag> »).
|
||||
- Integrity, per locale (fr, en) and project (desktop, chromium-375): sign in, open the catalogue, search the tag;
|
||||
the altered card shows the integrity line, its « Consulter » focusable and opening the sheet page, which shows its
|
||||
unchanged `catalogue.failure.fingerprint_mismatch` notice; the sound card shows its counts; axe on the searched
|
||||
list; no sideways scroll at 375 px; « Consulter » at least 44 px high.
|
||||
- Network, fr only, both projects: `context.route('**/rest/v1/rpc/get_sheet_version', handler)` aborting the
|
||||
request whose body names the sound version's id and calling `route.fallback()` for every other; remount the sound
|
||||
card by searching a term that hides it, then the tag again (never a reload); it shows the network line and
|
||||
« Réessayer » (44 px); `context.unroute` of that handler only; click: the counts appear and the focus is on its
|
||||
« Consulter »; axe with the line shown.
|
||||
- [ ] Run only `pnpm db:sandbox e2e-shell e2e/shell/catalogue-integrity.spec.ts` (sandbox up, never reset), then the
|
||||
existing `e2e/shell/catalogue.spec.ts` alone (the support change is additive). Record exact counts, and read back
|
||||
that no row other than the run's own changed (guard query before and after).
|
||||
- [ ] Commit `test(app): catalogue card integrity and retry on the sandbox`.
|
||||
|
||||
### Task 3: Documents and closing gates
|
||||
|
||||
- Mandatory: `V1-2-6_U1_CORRECTIONS.md` §R4 as built (classes, R-1 to R-8, D1 to D4 answers) and §5 row C closed;
|
||||
the review's Part II row (R-8); `CHANGELOG.md`; `.claude/tasks/TODO.md` (one line per run, shortcuts harvested).
|
||||
- One line each: `BROWSER_TESTS.md` (the new spec), `docs/design/README.md` (only if a deviation from board 30).
|
||||
- D3 (owner, validated): `V1-2-6_OWNER_TRIAL.md` §4.16 in French, no em-dash, on `pnpm db:sandbox trial`, with the
|
||||
remount and the wait of the offline step. P1: it names the sandbox's pre-existing failing entries (anomaly A: the
|
||||
current versions stored with the fictitious fingerprint, listed by name from a read-only query at Task 3, and any
|
||||
other entry the catalogue shows failing, classified by kind) and says what is R4's own behaviour (the line inside
|
||||
the card, « Consulter » kept, the unchanged sheet page, « Réessayer » on a load failure) as opposed to the data's
|
||||
fault (why those versions fail, which R4 does not fix).
|
||||
- Gates, in order: task reviews, design review against board 30 (screenshots desktop and 375 px from the spec run),
|
||||
final code review, security review of the diff, fresh verifier on the contract, `pnpm check:all`.
|
||||
- Commit `docs(docs): R4 catalogue card integrity warning as built`.
|
||||
|
||||
## Out of scope, tracked
|
||||
|
||||
- Test anomaly A (fictitious fingerprints of worker stand-ins): separate, own go.
|
||||
- Every card loading its version at once (156+ on the sandbox): with RR-13.
|
||||
- BLK-015 (rights screen on the accumulated sandbox) and RR-13: separate, open.
|
||||
- `catalogue.spec.ts` leaving its published sheets listed: existing accumulation, a follow-up line (D4 applies to the
|
||||
new spec only).
|
||||
- Keeping catalogue search on back (BDR-079 follow-up).
|
||||
|
||||
## Challenge round (2026-11-16, three fresh `plan-challenger` agents, read-only, on rev 1)
|
||||
|
||||
| Lens | Finding | Rev 2 |
|
||||
|---|---|---|
|
||||
| all three | Cleanup by `delete_anatomical_sheet` cannot work (published history, aal2, editor right); R3's D7 covered drafts only | F9, D4 (owner), Task 2 cleanup |
|
||||
| correctness, simplicity | `Notice` picks its glyph from the tone: `wifi-off` had no way to the screen | F3, `icon?` prop, test 12 |
|
||||
| correctness, robustness | Offline step of the trial cannot show the line (cards load once at mount) | F10, D3 recipe |
|
||||
| correctness, robustness | Focus and announcement unspecified for a retry that fails again; a `loading` reset unmounts the focused button | R-3, hook keeps `failed` with `retrying`, tests 3 and 5 |
|
||||
| robustness | Core retry never works without `coreRuntime().retry()` | F11, R-2, test 7 |
|
||||
| robustness | GET retries make an offline card settle after about 7 s | F4, D3 recipe |
|
||||
| correctness, robustness | e2e abort must `route.fallback()` the rest; no reload (156+ cards) | F12, Task 2 network step |
|
||||
| robustness | Focus move on success could steal focus | R-3 condition |
|
||||
| robustness | Same text not re-announced | R-3 cleared region |
|
||||
| correctness, robustness | D2 hid engine failures as « vue refusée » | F5, D2 recommendation, test 13 |
|
||||
| robustness | A trap spends a recovery per click | R-2, accepted as on the sheet page |
|
||||
| robustness | `drawing_missing` may come from Storage | R-1, pinned by test |
|
||||
| robustness | One engine failure shown N times | R-7, accepted limit |
|
||||
| robustness | Unmount test could pass vacuously | test 6 deferred, spies |
|
||||
| robustness | Grant per run feeds BLK-015 | D4 revokes the run's grant |
|
||||
| correctness | `'Failed to fetch'` is classified `unavailable` | test 2 uses `'network'` |
|
||||
| simplicity | `NO_RETRY` diverged from the page | removed, retry aligned (R-2, R-5) |
|
||||
| simplicity | Task 1 too ceremonial, struct derivable | merged into Task 1, `cardFailure` returns two booleans |
|
||||
| simplicity | D2 built ahead of the owner | test 13 and its branch conditional on D2 |
|
||||
| simplicity | e2e network case in every locale | fr only, both projects |
|
||||
| simplicity | Docs fan-out | mandatory set plus one-liners, trial text per D3 |
|
||||
| simplicity | Hidden polite region beyond existing retries | kept, narrowed to a repeated failure (correctness and robustness both need it) |
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,6 +3,7 @@ crates/core/tests/oracles/
|
||||
crates/core/tests/conformance/
|
||||
crates/core/tests/fixtures/
|
||||
apps/app/tests/fixtures/goldens/
|
||||
apps/app/e2e/fixtures/interior-probe.json
|
||||
packages/core-wasm/types/
|
||||
packages/core-wasm/pkg/
|
||||
packages/core-wasm/pkg-proofs/
|
||||
|
||||
Loaded 100 of 852 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user