Skip to content

fix(kv): reject unconfirmed Redis batches and retain validation evidence - #2649

Open
rickylabs wants to merge 5 commits into
mainfrom
fix/redis-atomic-unconfirmed
Open

rickylabs wants to merge 5 commits into
mainfrom
fix/redis-atomic-unconfirmed

Conversation

@rickylabs

@rickylabs rickylabs commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Problem and resulting behavior

Redis MULTI/EXEC can apply some commands while another command fails. The adapter validates every command receipt before success or notification and exposes a payload-free, possibly-applied uncertainty error. The pinned ioredis driver returns a failed command as a one-element [Error] tuple; that real shape now reports command_failed. Invalid tuples remain malformed_result, and null EXEC retains bounded optimistic-conflict semantics.

Closes #2648

Review corrections and validation support

  • Tests use a source-proven normalization fixture from pinned ioredis5.11.1 wrapMultiResult and feed it into the actual Redis adapter with inert transport. First/middle/last command failures preserve privacy, do not notify or retry, and retain the original uncertainty when task cleanup fails.
  • The database CLI remains the direct child of the original command executor. A typed evidence observer runs only after that executor settles. It launches no command or signal and cannot replace success, failure or timeout. The reported nested restart exit remains distinct from the executor result.
  • Safe diagnostics are constructed at known write sites and staged into a flat runner-owned artifact directory. Both runtime uploads select only its exact safe filenames. They do not recursively traverse scaffold data. Missing/ambiguous/unreadable logs and incomplete collection remain explicit; raw logs, cleanup receipts, environment arrays and private payloads are excluded.
  • The complete canonical inventory was imported as a generated artifact:1047 rows,0 unmatched,+5/-0. Its preceding-source phase-one execution completed normally with13.5.3,1044 checked,0 failures and manifest freshness true. This correction preserves the generator's path-match membership and version literals. No manual row synthesis or parity exemption is used.
  • Existing canonical export-corpus, strict source-reader/locked documentation support and bounded exact-byte comparison remain unchanged. There is no package/version/dependency/lock change or cleanup lifecycle change.

Local source evidence

  • Reviewed-validator baseline with the real driver shape:11 pass/3 named assertion failures. Corrected owning adapter:19 pass; existing codec controls included in final execution.
  • Final affected execution:51 pass,0 fail,0 ignored, native exit0. Separate native type check selected seven actual source/test entrypoints and completed with exit0. No-check execution is not type evidence.
  • Four new mutations restore the old tuple validator, insert an intermediate child, replace the original result from an observer failure, or restore a recursive upload glob. Each produces its intended assertion failure, followed by exact guarded-source restoration.
  • Filesystem controls deny reads of three synthetic nested data trees while staging their safe diagnostics successfully:3 pass, native exit0. Foreign workspace/target requests refuse; both workflow upload selections are pinned.
  • Root KV and CLI owning lint partitions analyze every selected file without drops. Scoped format, changed-source quality and both applicable doctrine checkers complete with exit0; doctrine warnings remain recorded. The unchanged supplementary tooling lint evidence is separate from the root gate.
  • Prior zero-test, wrapper, type-narrowing, resource and transport failures remain failed/insufficient attempts. No green result is inferred from them.

Hosted evidence and remaining acceptance

On the preceding source head, canonical MCP export, generated assets and publish assets passed. The hosted unfiltered test shard explicitly selected the changed generator test module and completed with1891 passed,0 failed,22 ignored. The write-mode and freshness tests are unconditional declarations; individual success TAP rows are not retained by that compact report.

The full Postgres runtime E2E command reported124 passed,0 failed,0 skipped and its step succeeded, but the job failed while recursively uploading artifacts from protected data. The SQLite/Garnet lane succeeded. The flat staging correction addresses that upload path; the final-head hosted runtime plus upload and quality gates are still required. This PR does not turn the previous job into a pass or bypass acceptance/closing gates.

The initial MUST_FIX verdict remains retained at its exact head. Subsequent corrections received exact-head source approvals; those do not cover this new delta. A new exact-head review is required. No merge, package release or deployment approval is claimed.

Direct documented-command evidence correction

The subsequent reviewed source completed SQLite and both artifact uploads, while the Postgres documented walkthrough failed before its variant verdict during database generation. The dashboard restart cause is still undetermined. That call directly awaited its original native command rather than using the generic command gate, so it had no restart diagnostic.

The walkthrough now observes that same command only after it settles and uses the existing safe flat artifact collector. It adds no process, stop, restart, retry or tolerance. Inert controls exercise the actual walkthrough command selection and native-output boundary: success, nonzero, original native rejection and collector failure preserve the original outcome. Two mutations removing observation or allowing collection to replace the outcome fail, then restored controls pass. This three-file delta has 25 affected tests and three native type entrypoints passing, plus owning lint/format/quality/doctrine checks. The project compiler was pinned explicitly with native cache-only resolution; the prior parser failure remains failed evidence.

The independent MERGE verdict applies to the preceding exact source head. This delta still requires independent review and final hosted acceptance. Issue acceptance and final DoD boxes remain open.

Scoped restart evidence and settlement-state correction

The next Postgres report recorded 55 passed, one failed, zero skipped: the documented walkthrough passed, while the separate database-generation gate failed when an application consumer restart reported that its physical executable could not stop. Both uploads succeeded and SQLite passed. This does not identify the underlying process/controller cause or establish an earlier failure's cause.

Two owning diagnostic defects are corrected: the pinned CLI's canonical log root is used, and generated consumer names come from the actual run's canonical naming rule rather than a fixed-name-only parser. Exact target/remedy, filesystem ownership, single-reference and command-window guards remain. An earlier linked AppHost file contributes only through the selected command log and timestamped records within that command interval. Only closed, scoped lifecycle templates or allowlisted structured fields survive; raw paths, arbitrary messages and credentials do not.

The command adapter samples the existing cancellation signal at settlement and retains the executor exit code. A fired deadline fails the gate even if the command exits zero, and a deadline kill is classified as a timeout. The restore gate can consequently take an additional attempt within its existing three-attempt limit. The change adds no timer, process, stop or restart command. A reported nested restart exit is recorded separately from the executor exit.

Owning baseline: eight passed and two intended assertion failures. Corrected affected execution: 32 passed, native exit 0. Separate native types select all ten changed source/test files and pass; owning lint analyzes all ten, formatting/quality/doctrine pass. Five named mutations detect loss of generated scope, the old log root, unscoped old host records, erased deadline state and foreign-name admission, followed by exact source restoration. Prior failures remain retained.

Final-head hosted acceptance and delta review are still required. The currently unresolved discriminator is invocation-scoped evidence for the physical executable/controller's failed stop; this PR does not guess that cause or neutralize its failing gate.

Golden rules

  • Idiomatic NetScript: preserve the existing Redis adapter, public error owner, conflict loop, canonical generators and native command executor; KV package.
  • SOLID: separate receipt validation, child policy, safe projection and owned artifact publication; use a typed observation at the existing executor boundary; module guidance.
  • Performance: linear receipt validation, bounded static documentation and diagnostic reads, no additional stop, restart or probe from the observer, and no uncertain-write replay; runtime failures.
  • Doctrine: explicit uncertainty, lifecycle ownership, source identity and public-surface limits; public surface.

Limits and follow-ups

Inert transport is not a live Redis test. There is no rollback, portable mutation-capacity or exactly-once transport guarantee. Reconnect resend/WATCH behavior, richer payload-free error classification, the Redis-subpath export, documentation read-set/check-mode details and conservative log parsing remain separate follow-ups. A safe diagnostic can still report unknown resource/cause; diagnostic unavailability never changes the original invocation result.

Published0.0.9 is unchanged. Consumers require an owner-issued supported release and durable intent/reconciliation before using the new outcome. No cache patch, package publish, local distributed runtime or protected resource operation occurred.

Definition of Done

  • Implementation and generated-source corrections recorded with focused native evidence.
  • Required independent findings addressed in source and owning controls.
  • Final-head required hosted quality, full CLI runtime/upload and issue acceptance completed.
  • New independent exact-head review completed before merge.

Independent source review approved b804381. Hosted SQLite passed. Hosted Postgres failed during dashboard refresh. The diagnostic captured the reported restart exit but found no matching stop records. The process exit and reason for the failed stop remain unconfirmed.

Validate complete command receipts before success or watch notifications.
Keep partial or unknown outcomes separate from CAS conflicts and preserve
the original failure across cleanup.

Closes #2648
@rickylabs rickylabs added this to the Backlog / Triage milestone Nov 17, 2026
@rickylabs rickylabs added the e2e-cli-gate Run the toolchain-heavy e2e-cli workflow (scaffold-static + scaffold-runtime) on this PR. label Nov 17, 2026 — with ChatGPT Codex Connector
@rickylabs
rickylabs marked this pull request as ready for review November 17, 2026 19:36
Regenerate the canonical export corpus for the new atomic uncertainty error.
Add strict source-reader and locked documentation options, bounded exact-byte
assertions, and safe diagnostics for existing E2E stop/restart invocations.

Refs #2648
@rickylabs rickylabs changed the title fix(kv): reject unconfirmed Redis EXEC command results fix(kv): reject unconfirmed Redis batches and retain validation evidence Nov 17, 2026
…ship

Use the pinned driver error tuple, collect diagnostics after the original
command settles, and stage safe artifacts outside scaffold data. Import the
complete canonical surface inventory without changing version policy.

Refs #2648
Observe the original awaited command at the walkthrough call site and reuse
the safe flat artifact collector without changing execution or cleanup.

Refs #2648
Use the canonical log root and declared generated consumer names. Filter
linked host evidence to the command interval and retain actual cancellation
state without changing lifecycle calls, budgets or failure propagation.

Refs #2648

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:kv packages/kv e2e-cli-gate Run the toolchain-heavy e2e-cli workflow (scaffold-static + scaffold-runtime) on this PR. priority:p1 High status:impl type:fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redis atomic: reject unconfirmed EXEC command results

1 participant