Fix newborns funding a second birth in their own tick
Births validated each parent against the progressively modified candidate, so a child allocated earlier in the same batch was already active and could fund a further birth. Two generations could appear in one tick, which ADR-0028 forbids. The contract was already correct; the implementation did not enforce it. Fix parent eligibility on entry to the reproduction phase, after terminal facts and feeding, and check every intent before applying any birth. A rejected cascade leaves the whole tick unchanged, as before. The regression test admits one intent whose parent is created by the preceding intent and requires unborn_actor with balances, progress, receipts and slot states untouched. It fails against the unguarded implementation and passes with the guard. The same pair succeeds across two ticks and records the grandchild ancestry. Native Release, clang-tidy analysis, ASan and format checks were rerun and pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -296,6 +296,18 @@ and independently recomputed conservation. A u64-maximum investment endows exact
|
||||
and conserves. Default zero capacity leaves the M2.4 reservoir layout, feeding,
|
||||
producer, ledger and particle tests unchanged; golden `d61ad5bf0c928c76` is intact.
|
||||
|
||||
Review of `c84a701` found one defect (2026-09-22): births validated each parent
|
||||
against the progressively modified candidate, so a child allocated earlier in the
|
||||
same batch was already active and could fund a second birth. Two generations could
|
||||
therefore appear in one tick, which ADR-0028 forbids. Eligibility is now fixed on
|
||||
entry to the reproduction phase, after terminal facts and feeding, and checked for
|
||||
every intent before any birth is applied. The contract itself was already correct
|
||||
and did not change. The regression test admits one intent whose parent is created
|
||||
by the preceding intent and requires `unborn_actor` with the entire tick unchanged;
|
||||
it was confirmed to fail against the unguarded implementation and to pass with the
|
||||
guard. The same pair succeeds across two ticks, recording the grandchild ancestry.
|
||||
All four native configurations were rerun after the fix.
|
||||
|
||||
Allocation-failure injection, serialized recovery of states/parents/origins and
|
||||
long-run ecosystem behavior were not exercised. This fixture defines no
|
||||
reproductive strategy, fecundity, mutation, gestation, spatial placement or account
|
||||
|
||||
Reference in New Issue
Block a user