Repository navigation
Commit 1fa9a1f
committed
fix(node): address four reviewer findings on #26 split 1/4
- P1-A: add startup reconcile step that promotes `prepared` rows to
`applied` when the on-disk ref matches the row's `new_sha`. The
recovery drain (which only reads `applied` rows) can now pick up
a ref that landed when the live handler's
`mark_pending_ref_transitions_applied` call errored or was
interrupted. Strict SHA equality is the load-bearing check — a
`prepared` row whose target did NOT actually land stays
`prepared`.
- P1-B: route the live handler's cert issuance through
`cert::issue_ref_certificate` (the upsert) instead of
`issue_ref_certificate_idempotent` (DO NOTHING). A re-push to the
same ref now updates the cert's `old_sha` / `new_sha` /
`pusher_did` / `issued_at` / `signature` to the new transition
while preserving the deterministic `cert_id`. The recovery drain
keeps the idempotent variant; both paths collapse to one row.
- P2-A: refactor the drain into a `drain_pending_ref_transitions_with`
testable seam that does per-row log-and-continue, and add
`drain_pending_ref_transitions_all` that loops
`DRAIN_PER_PASS_LIMIT=1000` rows for `DRAIN_MAX_PASSES=10` passes.
A failing row no longer stalls the batch; a backlog above 1000
rows is fully processed across passes.
- P2-B: add a `first_ref_name` column to `pending_ref_transitions`
via migration v28. The live handler hoists a `first_ref_name`
local and persists it on every row of the same `request_id`. The
drain's `derive_one` keys the push event id on
`row.first_ref_name` instead of `row.ref_name`, so live and
recovery produce the same id and `ON CONFLICT (id) DO NOTHING`
collapses a multi-ref push to one push event row (and one trust-
score bump). Cert and anchor ids stay per-ref / per-transition.1 parent 07109f4 commit 1fa9a1f
5 files changed
Lines changed: 1398 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2279 | 2279 | | |
2280 | 2280 | | |
2281 | 2281 | | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2282 | 2296 | | |
2283 | 2297 | | |
2284 | 2298 | | |
| |||
2290 | 2304 | | |
2291 | 2305 | | |
2292 | 2306 | | |
| 2307 | + | |
2293 | 2308 | | |
2294 | 2309 | | |
2295 | 2310 | | |
| |||
2464 | 2479 | | |
2465 | 2480 | | |
2466 | 2481 | | |
2467 | | - | |
2468 | | - | |
2469 | | - | |
2470 | | - | |
2471 | | - | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
2472 | 2488 | | |
2473 | 2489 | | |
2474 | 2490 | | |
| |||
2484 | 2500 | | |
2485 | 2501 | | |
2486 | 2502 | | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
2487 | 2519 | | |
2488 | 2520 | | |
2489 | | - | |
| 2521 | + | |
2490 | 2522 | | |
2491 | 2523 | | |
2492 | 2524 | | |
| |||
2497 | 2529 | | |
2498 | 2530 | | |
2499 | 2531 | | |
2500 | | - | |
| 2532 | + | |
2501 | 2533 | | |
2502 | 2534 | | |
2503 | | - | |
2504 | | - | |
2505 | | - | |
2506 | 2535 | | |
2507 | 2536 | | |
2508 | 2537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | | - | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
27 | 46 | | |
28 | 47 | | |
29 | 48 | | |
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
33 | 52 | | |
| 53 | + | |
34 | 54 | | |
35 | | - | |
36 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
37 | 65 | | |
38 | 66 | | |
39 | 67 | | |
| |||
0 commit comments