Repository navigation
feat(autonudge): quarantine a row with an unsafe addressing field instead of dropping it - #11154
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Undescribed in-flight-cycle claim schema ships with no producer: WatchScope smuggled from the #7996 split: the diff adds Suggestions
[DESIGN-REVIEWED] af37d3e |
GPT 5.6 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)Reviewed Opus 4.8 adjudication downgraded every blocking finding to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions. Review detailsBLOCKING -- src/kiro_crew/autonudge.py:1277 -- quarantine retention is unbounded FINDING -- src/kiro_crew/autonudge.py:1227 -- Adjudication (Opus 4.8) — is blocking on each finding proportionate?I've reviewed the finding against the diff (the changed lines) and the surrounding base code. F1 — quarantine retention unbounded ( Conditions the failure requires:
Recovery / visibility: sidecar and store are ordinary files; repairing or deleting them clears the set, and compaction retires enumerated+held rows ( Harm rung: LOW — a recoverable, visible degradation gated on an operator-corrupted store, bounded by a store whose row count is already unbounded independent of this PR. The proposed remedy ("bound row count and every retained string/container before copying") directly contradicts the PR's central invariant — rows are held VERBATIM so an operator can repair them (patch:130-132, |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo blocking findings; one advisory. FINDING — src/kiro_crew/autonudge.py:~5317 — the new [OPUS-REVIEWED] af37d3e |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The in-flight cycle-claim machinery rides along undeclared with zero producers — nothing writes Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: stop the auto-nudge store silently losing rows it cannot vet, by holding them aside for repair instead of dropping or overwriting them — a FIX to silent data loss, though the addressing vetting itself is new against base (the "was dropped" behavior exists only in unmerged parent #7996).
(One smaller item over the cap: load-path log lines now pass store values through [FIRST-PRINCIPLES-REVIEWED] af37d3e |
240a803 to
4cf8013
Compare
…tead of dropping it A loaded row whose addressing field cannot be vetted is now held out of the live loop set and written to a sidecar file, so the operator can still see and correct it.
4cf8013 to
af37d3e
Compare
cixuuz
left a comment
There was a problem hiding this comment.
Large but carefully reasoned fail-closed persistence design for a real data-loss bug (a corrupt/unsafe row was silently dropped, and a partially-vetted load could then overwrite the rows it failed to read). The quarantine sidecar keeps held-aside rows durable and out of every serving/egress path (addressing fields are exempt from the display scrub, which is exactly why an unsafe row must never be armed). Write ordering (sidecar synced before the main store swap, dir-fsync after commit, compaction only after a successful write) prevents the crash-window data loss the docstrings describe. Verified PlatformCompositionError/redact_log_via_context exist in kiro_crew.platform. 21 tests target exactly the failure modes named (fsync-before-compact ordering, compaction-failure survival, corrupt-root refusal). Deliberate duplication of redact_store_value with #10967 is disclosed and justified (independent compilability of a deliberate split of oversized #7996).
…tead of dropping it (kirodotdev#11154) A loaded row whose addressing field cannot be vetted is now held out of the live loop set and written to a sidecar file, so the operator can still see and correct it.
Problem / Motivation
When the auto-nudge store is loaded, a persisted row whose addressing field holds a value the
service cannot safely use was dropped. The row vanished with only a log line behind it, so
there was nothing left to inspect and no way to tell a corrupt write from a row that had never
existed. A partially-vetted load could then be persisted back, overwriting the rows it had
failed to read.
Why it matters
Silent loss is the worst outcome for a store that is the only record of a user's armed loops.
A row that cannot be vetted is evidence, not garbage: preserving it is what makes the failure
diagnosable, and refusing to persist over an unvetted load is what stops one bad read from
destroying the rows it could not parse.
What changed
A quarantine sidecar. A row with an unsafe addressing field is now held out of the live
loop set and written to a sidecar file next to the store, instead of being discarded:
_write_quarantine_sidecar/_read_quarantine_sidecarpersist and recover held rows, keyedby
_quarantine_row_keyso a repaired row keeps its held-aside copy._compact_quarantine_sidecarprunes entries that no longer apply. A compaction failureafter the main store has committed does not report the landed write as failed.
_move_aside_unreadable_sidecarpreserves an unreadable sidecar rather than truncating it, sorecovery can never end the process at boot.
_refuse_writes_and_preserve_sidecarlatches a persist refusal when the last load could notvet the store, raising
AutoNudgeStoreUnvettedfrom both the persist entry point and thetimer fire path.
This PR is one unit of a split of the oversized #7996, cut to be reviewable on its own. It
carries
redact_store_valueas an identical copy also present in #10967 — that duplication isdeliberate, and is what lets each unit compile and test independently rather than imposing a
merge order between them.
Tests
test/test_autonudge_quarantine_sidecar.py— 20 tests, all passing, covering the sidecarwrite path, id-colliding held rows, recovery from an unreadable sidecar at startup, and the
write refusal being reachable with rows already in memory.
The tests are extracted from the parent change and were baselined against it: each one passes
at the parent head before extraction, so a failure here would be an extraction defect rather
than a pre-existing one.
flake8is clean on both changed files.