GeezerVison is showing github.com — Config: the factory's machine config and a repo's factory block by rawphp · Pull Request #19866 · pingdotgg/t3code
Conversation
Closes #11
Contract
- done:
apps/server/src/factory/config.ts parses the machine config (<base>/factory/config.yml) and a .dw/config.yml factory block with softfac's fields, defaults and messages; an unknown machine key is an error that names it; a non-empty required_checks is required_checks is not supported yet; both loaders read the file again on every call; a missing machine config makes FactoryLayer log no factory config at <path> once per server start and stay idle; softfac's project-block tests from src/config.rs (pinned bf273a1) are ported and pass.
- out: using the config in passes and claims, the Linear tracker, the
users block, self_update/fleet/retro, warnings for unknown project keys, caching.
- risk: none
- test:
vp test run apps/server/src/factory → pass (5 files, 104 tests)
Readings the issue left open
max_concurrent_runs: the issue says "softfac's defaults" for it and max_concurrent_gates, but softfac has no default for max_concurrent_runs (required, at least 1). The port keeps softfac's rule: max_concurrent_runs: is missing when absent. max_concurrent_gates defaults to 2. If a default of 1 was meant, it is one line in machineFrom.
- Unknown machine key: one file-level error per key,
<file>: unknown key <dotted path>, after the field errors, at the top level and inside each repos[i] (softfac's warning wording, as an error).
- An invalid machine config logs each formatted error at error level and the factory stays idle (the issue only names the missing-file case).
- softfac's
project_required_checks_are_read_in_order is replaced by the not-supported case; [] still loads.
Acceptance criteria
-
config.ts reads <base>/factory/config.yml with gh_config_dir, poll_seconds 60, max_concurrent_runs, max_concurrent_gates 2, model_instance claudeAgent, model, repos of {repo, path}; an unknown key is an error that names it — config.test.ts "machine valid resolves every field and the defaults", "machine unknown top-level key is one file-level error", "machine unknown key inside a repo is named by its path"; the path comes from ServerConfig.baseDir in t3/paths.test.ts
- A missing
config.yml leaves the factory idle and logs no factory config at <path> once per server start — index.test.ts "logs that there is no config when the machine file does not exist" (the layer is built once per start)
- A function parses
.dw/config.yml text into the factory block with softfac's fields and defaults (minutes 180, gate_retries required, regates 5, checks_minutes 30, interruption_resumes 2) and softfac's messages — parseProjectConfig; config.test.ts "project valid resolves all fields" and the ported // ---- project: sections
- A non-empty
required_checks is required_checks is not supported yet — config.test.ts:204
- Both are read again on every call; nothing is cached —
config.test.ts "loadMachineConfig reads the file on every call", "loadProjectConfig reads the file on every call"
- Uses the
yaml package apps/server already depends on, no new dependency — package.json and the lockfile are unchanged in this branch
- softfac's project-block cases from
src/config.rs are ported and pass — one it per Rust #[test] in config.test.ts; the correctness reviewer checked each has a counterpart of equal or stronger strength
Gate
vp test run apps/server/src/factory → exit 0
vp run --filter t3 typecheck → exit 0
Models
- maker: claude-sonnet-5-5 (host)
- checker: claude-opus-5-5 (host)
Review
- cycles: 1
- personas: correctness (approve, 0 findings), maintainability (approve, 1 nit, fixed in
7265e29d6), testing (approve; 11 of 12 named mutants killed, the twelfth was equivalent as written and its intended form was killed too)
- fixed:
ConfigError and the ConfigErrors schema defined the same shape twice → one ConfigErrorSchema
- leftovers: two testing nits, dropped as out of scope:
ConfigErrors.message is never asserted; the must be a list of strings message text is never asserted (the ported softfac tests assert only the field for that case)
Notes
- Worktree was behind
origin/main at launch (e4bcce9f6); fast-forwarded to f1dba9a17 before provisioning.
- Red phase confirmed: at
aa0abf236 the suite fails (3 of 5 files); green from 45a137e8f.
- No seam touched. No upstream file outside
apps/server/src/factory/ changed. All seven factory:* labels already existed; none created.
Lessons
- Read the branch from the worktree, not from the launch context. Symptom: the first push failed with "src refspec does not match any". Cause: the session's git status snapshot named a branch (
t3/ffe914e1) that was not the worktree's branch (t3/factory-issue-11). Default: at Isolate run git branch --show-current in the worktree and use that name for every push and the PR.
Commits
aa0abf236 test(factory): port config parsing tests and the config-driven start — Make slice (red)
45a137e8f feat(factory): load the machine config and start only when it is valid — Make slice (green)
7265e29d6 refactor(factory): define the config error shape once — Check cycle 1
Files
apps/server/src/factory/config.ts — machine config and project factory block parsing, loaders
apps/server/src/factory/config.test.ts — ported softfac project cases, machine cases, loader cases
apps/server/src/factory/paths.ts — FactoryPaths service tag (factory-owned, no T3 import)
apps/server/src/factory/t3/paths.ts — FactoryPaths from ServerConfig.baseDir
apps/server/src/factory/t3/paths.test.ts — path derivation
apps/server/src/factory/index.ts — FactoryRuntime reads the config at build; FactoryLayer wires the paths
apps/server/src/factory/index.test.ts — the three start states
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chore: factory block for softfac
Red: ./index.ts does not exist yet, so the import fails.
Issue: #1
Green: factory started is logged once.
Issue: #1
Red: factory/scripts/check-seams.sh does not exist yet, so both cases fail.
Issue: #1
Green: both check-seams cases pass.
Issue: #1
No red phase: the tree already complies, so the real-tree test passes on
arrival. The synthetic cases show each rule catching a violation.
Issue: #1
Typecheck could not resolve the bare vitest module; the repo imports it via vite-plus/test.
Issue: #1
…order-free
Red: "names an upstream file renamed into an allowed path" fails because
check-seams.sh lets git rename detection hide the deleted upstream path.
The fail case now changes server.ts itself, and the boundary real-tree
test asserts server.ts imports ./factory/index.ts; both already pass.
Issue: #1
A git mv of an upstream file into an allowed path listed only the new
path, so the deleted upstream file passed the seam check. --no-renames
lists both sides.
Issue: #1
- boundary.test.ts flags factory code outside factory/t3/ that imports the
server's workspace packages (@t3tools/*, effect-acp, ...), read from
apps/server/package.json.
- check-seams.sh captures the diff before the loop, so a failed git diff
fails the script instead of passing with nothing checked.
- README and the script header say the check covers committed HEAD only.
- check-seams tests cover apps/web/src/factory/ and a failing diff.
- Node built-ins imported as NodeFS/NodePath/... per namespace-node-imports.
Factory skeleton: an empty FactoryLayer wired in through one seam
Red: config.test.ts, index.test.ts and t3/paths.test.ts fail because
./config.ts, ./paths.ts, t3/paths.ts and FactoryRuntime do not exist yet.
Issue: #11
Adds config.ts (project and machine config parsing ported from softfac,
plus loaders), the FactoryPaths service with its T3 layer, and makes the
factory log no-config, config errors, or started. Also fixes test-helper
slips in the ported tests (repos error path, 90.0 fixture, layer wiring).
Issue: #11
|
Factory catalog cross-reference — 2026-10-26. Prior-work history: this PR is cataloged for its work on machine and repository factory configuration in the public original-solutions factory, acknowledged in our catalog. No code from that effort was copied into this derivative. This historical cross-reference requests no reopening and implies neither quality rejection nor an installation dependency.
Factory Ideas · Pinned fork source/guide · Source release. Version-pinned community experimental source preview; full lifecycle acceptance remains open. No upstream endorsement or current-PR-head test acceptance is claimed.
Prepared with GPT-6.1 Sol through Codex in T3 Code.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XL
500-999 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
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.
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.
|