Skip to content

test(blackbox): stop stale commands from resurrecting TTL-destroyed slots - #670

Merged
JeroenSoeters merged 2 commits into
mainfrom
fix/ttl-supersedes-stale-commands
Aug 22, 2026
Merged

test(blackbox): stop stale commands from resurrecting TTL-destroyed slots#670
JeroenSoeters merged 2 commits into
mainfrom
fix/ttl-supersedes-stale-commands

Conversation

@JeroenSoeters

Copy link
Copy Markdown
Collaborator

Summary

Fixes a seed-dependent FullChaos failure surfaced by the first combined property run after #658 (observed on #659's CI): inventory=NotExist but model expects Exists for a cross-stack slot.

The mechanism, traced from the failing run's log: ForceCheckTTLAndWait folds an observed TTL destroy into the model directly rather than leaving the destroy command in AcceptedCommands, so the drain's per-pass corrected map never represents it and the "newest command wins" ordering breaks across correction passes. The authoritative-slot mark stood in for that ordering, but the correction path deliberately lets creates clear authoritative status (so post-TTL re-creates work). A command accepted before the destroy that finished Failed while carrying a create-Success RU for a destroyed slot therefore cleared the mark and resurrected the slot in the model, while the agent's cascade had already removed the inventory row. Cross-stack dependents of an expired provider stack were the visible victims: the existing supersession purge only drops commands whose slots all live on the destroyed stack, so commands on other stacks escaped it. Pre-#658 this was invisible because cross-stack slots were excluded from model-vs-inventory assertions.

The fix restores the ordering information instead of adding another special case: when a TTL destroy is observed, every command still in AcceptedCommands predates it, so its destroyed slots (the stack's own and the cascade-destroyed cross-stack dependents) are marked superseded on those commands. Corrections skip superseded slots in both the RU pass and the unmentioned-slot revert.

The regression test reproduces the exact shape (stale Failed command with a create-Success RU for a cascade-destroyed cross-stack slot) and fails without the fix. Full non-property suite green; FullChaos green at 25 checks locally.

Blocks #659's CI (which hit this on a rebase re-run) and #668; neither PR's content is related to the failure.

…lots

ForceCheckTTLAndWait folds a TTL destroy into the model directly instead
of leaving the destroy command in AcceptedCommands, so the drain's
per-pass corrected map never learns about it and the recency ordering
(newest command wins) breaks across passes. The authoritative-slot mark
stood in for that ordering, but the correction path lets a create clear
authoritative status, so a command accepted before the destroy that
finished Failed while carrying a create-Success RU for a destroyed slot
would clear the mark and resurrect the slot in the model, while the
agent's cascade had already removed the inventory row. Cross-stack
dependents of an expired provider stack were the visible victims: the
existing purge only drops commands whose slots all live on the destroyed
stack, so commands on other stacks escaped it.

When a TTL destroy is observed, every command still in AcceptedCommands
predates it. Mark the destroyed slots (the stack's own and the
cascade-destroyed cross-stack dependents) as superseded on those
commands; corrections skip superseded slots in both the RU pass and the
unmentioned-slot revert, restoring the ordering the corrected map
provides within a single pass.
@JeroenSoeters
JeroenSoeters merged commit 4e7dce9 into main Aug 22, 2026
56 of 58 checks passed
@JeroenSoeters
JeroenSoeters deleted the fix/ttl-supersedes-stale-commands branch August 22, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant