Repository navigation
Closed
Labels
factory:pr-openPR is open and passed the gatePR is open and passed the gate
Description
Outcome
The fork records every run in the same files and format as softfac, so softfac runs list and softfac retro read the fork's runs with no changes.
Acceptance criteria
apps/server/src/factory/ledger/writes run files<data>/runs/<owner>__<repo>__<issue>__<attempt>.jsonland the machine log<data>/events.jsonl, as softfac'sdocs/reference/ledger.mddescribes. Lines are{"ts","ms","event","data","cause"}(causeleft out in the machine log), names are lowercased, files are append-only, each line is one write followed by fsync, and a new run file is created only if it does not exist.<data>is the factory data dir frompaths.tswhen that exists, else a parameter.- The reader returns a file's events in order and treats a torn last line the way softfac's reader does.
- Event names and data fields are the ones in
ledger.md. The writer refuses an event name the doc does not list. - The format and crash-rule cases from the tests in softfac's
src/ledger.rsare ported and pass.
Depends on
Notes
After merge a person checks compatibility by hand: write a few runs with a test, then softfac runs list --data-dir <that dir> and softfac retro --data-dir <that dir> read them.
Reference
- softfac, the Rust factory this ports, pinned at
rawphp/softfac@bf273a1. Read it from a separate clone:git clone --filter=blob:none https://github.com/rawphp/softfac /tmp/softfac-ref && git -C /tmp/softfac-ref checkout bf273a1d93651992b4fc95b4dd6c111f8f3322cf. Itsdocs/lifecycle.md,docs/reference/ledger.mdanddocs/issues.mddescribe the behaviour; its tests pin it. - Design:
factory/docs/design.mdin this repo. - Upstream's
AGENTS.mdapplies. Run only the tests and typechecks for the paths you touch (vp test run <path>,vp run --filter t3 typecheck), never the repo-wide checks. - Edit no upstream file that is not listed in
factory/SEAMS. A new seam needs a line infactory/SEAMSand a reason in the PR body. - Port behaviour, not code: port the named test cases first (TypeScript, vitest /
@effect/vitest), then make them pass. Exact comment and ledger wording is ported as is.
Metadata
Metadata
Assignees
Labels
factory:pr-openPR is open and passed the gatePR is open and passed the gate
Activity
rawphp commentedon Oct 15, 2026
Factory status: pr-open
test(factory): gate attempts count only a gate_command that fully parses
fix(factory): count a gate command only when every field parses
test(factory): machine log writes an issue key as softfac's IssueKey …
fix(factory): write a machine-log issue key as softfac's IssueKey does
fix(factory): restore the LedgerOptions type dropped by the gate-atte…
test(factory): open never creates a run file
fix(factory): Ledger.open opens without creating the file
test(factory): the write path cleans a hand-built cause
fix(factory): clean cause text on the write path
refactor(factory): one open-and-repair helper for the run file and ma…
fix(factory): write the u64 bound as 2 ** 64 for the gate-attempt check
refactor(factory): check the event field tables cover every data key