Skip to content

fix(state): sidecar convergence and complete per-tuple failure isolation - #870

Merged
steipete merged 1 commit into
mainfrom
fix/normalize-tuple-isolation
Jul 26, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/normalize-tuple-isolation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Converge record-tuple sidecars from the authoritative primary: no primary drops plan and packet, a closed primary drops plan, and a cleared packet pointer drops packet.
  • Route every per-tuple projection failure through the existing dead-letter disposition instead of aborting unrelated tuple publication.
  • Preserve publish-fatal handling for transport and parse corruption, with fencing, digest, and revision semantics unchanged.

Incident

Run 30199610295 aborted the whole cycle on keeps a packet after clearing its pointer. Normalize-phase tuple validation was still outside the isolation introduced by #867, so one invalid tuple prevented every independent repair from publishing.

The shared convergence helper now makes the primary record authoritative over its sidecars before validation and reconciliation. The publisher reports isolated tuple failures back to materialization, which records the normal dead-letter disposition without weakening repository-wide corruption handling.

Throw-site audit

Failure site Scope Disposition
Tuple filename/key resolution One record tuple Dead-letter that tuple; continue independent tuples
Structural tuple validation during normalization One record tuple Dead-letter that tuple; continue independent tuples
Reconciliation winner arbitration One record tuple Dead-letter that tuple; continue independent tuples
Push-race rebuild resolution, validation, or arbitration One record tuple Dead-letter that tuple; continue independent tuples
Git transport failure or repository/batch parse corruption Whole publish Remain publish-fatal

Proof

  • Autoreview: CLEAN at 0.96 confidence; TruffleHog clean.
  • State materializer targeted suite: 15/15 passed.
  • Git publisher targeted suite: 65/65 passed, with the known local credential-fixture caveat unchanged.
  • Unit suite: 1,614 passed.
  • pnpm run check: code-owned checks green; only known environment failures remained.

…ection failure

run 30199610295 aborted whole cycles on "keeps a packet after clearing its pointer" because normalize-phase tuple validation sat outside #867's isolation; shared convergence now deletes sidecars orphaned by the authoritative primary (no-primary → drop plan+packet; closed → drop plan; pointer cleared → drop packet), and a full throw-site audit routes every per-tuple failure (filename resolution, structural validation, winner arbitration, push-race rebuild) through dead-letter disposition while transport/parse corruption stays publish-fatal; fencing/digest/revision semantics unchanged.
@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Jul 26, 2026
@steipete
steipete merged commit 3ecc41e into main Jul 26, 2026
12 checks passed
@steipete
steipete deleted the fix/normalize-tuple-isolation branch July 26, 2026 12:27
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Jul 26, 2026
@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 26, 2026, 8:24 AM ET / 12:24 UTC.

ClawSweeper review

What this changes

The branch makes primary state records authoritative over plan and decision-packet sidecars, and isolates individual record-tuple projection failures so independent tuples can continue publishing.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep this PR open for normal review. It addresses a concrete state-publication failure and is not evidenced as already implemented on current main; the patch is focused, but merge should wait for inspectable after-fix behavior proof in addition to the reported tests.

Priority: P2
Reviewed head: 537943cde8752689956eb91c550c7c434794901f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage are coherent from the supplied diff, but the real-behavior merge gate currently has only reported test output.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports tests and checks, but no directly inspectable after-fix runtime transcript, log, or artifact shows the incident path succeeds. Attach redacted terminal or workflow evidence; updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports tests and checks, but no directly inspectable after-fix runtime transcript, log, or artifact shows the incident path succeeds. Attach redacted terminal or workflow evidence; updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Focused implementation: The branch adds shared sidecar convergence so absent or closed primary records and cleared packet pointers remove stale dependent files before strict tuple validation.
Failure isolation coverage: The branch updates the Git publisher to report individual tuple failures and extends focused publisher tests for orphan cleanup and malformed-tuple isolation.
Related merged provenance: The PR explicitly follows the merged record-tuple projection isolation work in #867, addressing a remaining normalization-phase path rather than replacing that earlier work.
Findings None None.
Security None None.

How this fits together

ClawSweeper's state materializer projects review records into durable item, closed-item, plan, and decision-packet files, then the Git publisher reconciles and pushes them to the state repository. A malformed record tuple should be quarantined without preventing independent state updates from being published.

flowchart LR
  A[Review record events] --> B[State materializer]
  B --> C[Record tuple projection]
  C --> D[Sidecar convergence]
  D --> E[Tuple validation]
  E --> F[Git reconciliation]
  F --> G[State repository]
  E --> H[Dead-letter disposition]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports tests and checks, but no directly inspectable after-fix runtime transcript, log, or artifact shows the incident path succeeds. Attach redacted terminal or workflow evidence; updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Merging changes cleanup rules for durable plan and decision-packet sidecars; maintainers should confirm that valid sidecars are never removed when their primary remains authoritative.
  • Resolve merge risk (P1) - The reported checks are useful but do not provide directly inspectable after-fix runtime evidence that one malformed tuple is dead-lettered while an independent valid tuple publishes.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 5 files affected; 499 added, 109 removed The patch changes durable record projection and reconciliation behavior, so sidecar deletion and isolation boundaries need focused review.
Focused coverage 236 test lines added across 2 test files The added coverage exercises both materialization and Git publishing behavior for the repaired tuple paths.

Merge-risk options

Maintainer options:

  1. Add isolated publish proof (recommended)
    Attach redacted terminal or workflow output showing a malformed tuple reaches dead-letter disposition while an independent valid tuple is committed.
  2. Accept test-only evidence
    Merge based on the focused tests and checks while accepting that the incident path has no directly inspectable runtime proof in this PR.

Technical review

Best possible solution:

Retain strict repository-wide transport and parse failures, and merge tuple-level convergence only after focused proof shows orphaned sidecars are removed while valid sibling tuples still publish.

Do we have a high-confidence way to reproduce the issue?

Yes, from the supplied source diff and incident description: a primary record that clears its decision-packet pointer while a packet sidecar remains can fail tuple normalization. This review did not execute a current-main reproduction path.

Is this the best way to solve the issue?

Yes, provisionally: one shared convergence helper before validation is narrower and less drift-prone than duplicating cleanup rules in materialization and reconciliation, provided it preserves the stated publish-fatal boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4f1d7d6caa42.

Labels

Label changes:

  • add P2: This is a bounded but important reliability fix for state-publication cycles that can block independent repair records.
  • add merge-risk: 🚨 session-state: The PR changes reconciliation and deletion behavior for durable record tuples, plans, and decision packets.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests and checks, but no directly inspectable after-fix runtime transcript, log, or artifact shows the incident path succeeds. Attach redacted terminal or workflow evidence; updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded but important reliability fix for state-publication cycles that can block independent repair records.
  • merge-risk: 🚨 session-state: The PR changes reconciliation and deletion behavior for durable record tuples, plans, and decision packets.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests and checks, but no directly inspectable after-fix runtime transcript, log, or artifact shows the incident path succeeds. Attach redacted terminal or workflow evidence; updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Authored both the merged predecessor tuple-projection work and this follow-up, showing direct recent involvement in the affected materialization and reconciliation paths. (role: recent area contributor; confidence: medium; commits: 722a6b923b1a, 537943cde875; files: src/repair/git-publish.ts, src/repair/record-tuple.ts, src/repair/state-materializer.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted after-fix output demonstrating one malformed tuple is dead-lettered while an independent valid tuple commits.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…ection failure (openclaw#870)

run 30199610295 aborted whole cycles on "keeps a packet after clearing its pointer" because normalize-phase tuple validation sat outside openclaw#867's isolation; shared convergence now deletes sidecars orphaned by the authoritative primary (no-primary → drop plan+packet; closed → drop plan; pointer cleared → drop packet), and a full throw-site audit routes every per-tuple failure (filename resolution, structural validation, winner arbitration, push-race rebuild) through dead-letter disposition while transport/parse corruption stays publish-fatal; fencing/digest/revision semantics unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant