Skip to content

fix: fail closed on stored values no writer produces - #78

Merged
voyagi merged 5 commits into
mainfrom
chore/pass-3-attack
Oct 25, 2026
Merged

voyagi merged 5 commits into
mainfrom
chore/pass-3-attack

Conversation

@voyagi

@voyagi voyagi commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Closes #76.
Closes #77.

I ran a stress pass over the close path, and four stored values got through when they should have refused. A Send item with a mail time that isn't an integer slipped past the hold check, another lane's window end below zero didn't refuse the close, an email at its attempt limit with no claim stayed unsent with no error, and two different intrinsic actions merged into one permission entry. Each of those now fails closed. The new adversarial tests cover them, plus the guards that already held.

I also added live run 1's failed operator email as an example, its incident items exactly as saved with a test that they're unedited, and the website's record of processing.

Tests pass, and the tests for the four fixes failed before them.

- The hold check counts a Send item whose mail time is not an integer,
  so a corrupt item can no longer let it write closed.
- Another lane's opening window end below 0 refuses the close as
  newer-incident-elsewhere, as one that is not an integer already does.
- An email at its attempt limit that holds no claim is marked failed
  (errorName AttemptsSpent), so it no longer stays unsent with no error
  line.
- The permission list renders an intrinsic action as canonical JSON, so
  two different intrinsics no longer merge into one entry.
- Adversarial tests for these, and for the closure, pause pointer,
  decision, reopen payload, counter and closeability guards that held.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
  • review-ready

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0402aaa5-cfd0-4154-b90d-e2e82149386d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T06:37:02.125082Z 9dd4bd5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@voyagi voyagi added the risk-lane Needs two different reviewers label Oct 25, 2026
@voyagi

voyagi commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@voyagi-house-review voyagi-house-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

House review of bc8c2e4, its first house review.

The PR makes four guards fail closed on stored values no writer produces. The hold fold now counts a
Send whose mail time isn't a safe integer, isNewerElsewhere refuses a negative opening window end,
emailAttemptsSpent marks an email failed when it has used every attempt and holds no claim (logged
as AttemptsSpent), and permission snapshots render intrinsic actions as canonical JSON instead of
"[object Object]". It also adds adversarial tests, the live-run-1 example and the website's record
of processing. I checked each code change against its callers (action.ts
sendClaimed/failStrandedEmail/operatorEmails, the fixture and live event stores, permissions.ts) and
the doc's claims against the site's wrangler config, _headers and storage list. All of it is sound;
the only defect is a small test gap: the "unedited" check covers only the evidence record.

1 finding: 1 minor. It is a thread on this pull request, marked resolved once it is handled:

1. minor, test-gap packages/functions/src/live-run/failed-email-artifact.test.ts:41 The "unedited" check covers only the EVIDENCE item, not the CLOSURE, DECISION, STATE or COUNTER items the README and issue say are kept exactly as saved, a thread on its line

@voyagi

voyagi commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 9dd4bd5578

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@voyagi-house-review voyagi-house-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

House review of 9dd4bd5, a re-review after bc8c2e4, review 2 of 3.

The pull request makes the close path fail closed on four stored values that no writer produces. A
Send whose mail time isn't a safe integer now counts in the hold check, another lane's window end
below zero refuses the close, an email at its attempt limit with no claim is marked failed and
logged as AttemptsSpent, and two different intrinsic IAM actions stay as two separate permission
entries. It also adds adversarial tests, the live run 1 failed-email example with a test on it, and
the website's record of processing. Earlier finding 1 is fixed: the new commit adds a SHA-256 check
over the whole saved file, so the CLOSURE, DECISION, STATE and COUNTER items are now covered too.
The hash holds on every clone because .gitattributes forces LF checkout (`* text=auto eol=lf`), and
no formatter is configured that could rewrite the file. I found no new defects in the new commits
and no unlisted critical or major problems elsewhere in the pull request.

No findings.

Not reviewed

  • .jscpd.json
Neither issue asks for this. It is minor supporting work that keeps the duplicate-code checker off
the new examples JSON.
  • tracked-paths.json
Supporting work that registers the new docs and example files. Neither issue asks for it explicitly.

@voyagi
voyagi merged commit 6c1ae36 into main Oct 25, 2026
5 checks passed
@voyagi
voyagi deleted the chore/pass-3-attack branch October 25, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-lane Needs two different reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the failed live run and the site's processing record Close path accepts stored values no writer produces

1 participant