GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(factory): a ledger failure once the attempt is counted is a GateRecordError by tomkaczocha · Pull Request #45 · original-solutions/t3code-factory

Conversation

@tomkaczocha

@tomkaczocha tomkaczocha commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #43, which merged before its f8 review finding was fixed.

When the gate records a pass, it appends one gate_command line per command. If an append failed partway through, the lines already written stayed in the ledger, but run returned a plain LedgerError, which callers read as "no attempt used". A retry then reused the attempt number and wrote duplicate lines.

Now, once a line has gone in, a ledger failure fails the gate with GateRecordError, which carries the attempt number, so the caller knows that attempt is used. This also covers a failed sync, and the merge-conflict line goes through the same path. If no line went in, the error stays the ledger's own and no attempt is used. ledger.ts is unchanged; the only new option is the test-only ledgerIo on GateOptions.

Tests cover a write failing after one line, the first line's sync failing, the first line's write failing, and the conflict line's sync failing. The factory suite passes (529 tests), and typecheck and lint pass. The local review-gate round on this head scored 5/5 with nothing open.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rawphp
fix(factory): a ledger failure once the attempt is counted is a GateR…
706ac98
…ecordError

The gate_command lines go into the ledger one at a time. When an append
fails after the ledger already counts the attempt (an earlier line went in,
or the failed one did: a failed sync leaves the line in the file), run now
fails with GateRecordError, which carries the attempt number, so the caller
knows the attempt was used. A failure before any line went in is still the
ledger's own error. The merge-conflict line goes through the same path.
GateOptions.ledgerIo lets a test fail an append.
@tomkaczocha
tomkaczocha merged commit a618ea5 into main Oct 15, 2026
@rawphp
rawphp deleted the t3/factory-issue-18 branch October 28, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tomkaczocha @rawphp
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.