This directory holds one Xum (mux) durable workflow script, build-phase.js. It is an agent-orchestration conductor, not part of the Go service. No Go code, script, or CI job in the repository imports or runs it. An operator starts it by hand from a Xum workspace:
workflow_run({
script_path: "./workflows/build-phase.js",
args: { phase: "p0-spike", isolated: true, brief: "optional operator guidance" },
});One run builds one roadmap phase of the open.storage backend. The run spawns agents for each step and ends with a go/no-go gate report. The human gate is between runs: the operator reads the report and then launches the next phase. Step order of workflow, as named by its phase(...) calls:
planslice-planimplement-foundation(only when the slice plan names a foundation)implement-slicesintegrate-slicesverify, thenfix-round-Nandverify-round-Nuntil validation passes or the round limit is reachedcode-reviewfix-review-findings(only when P0 or P1 findings exist)dogfooddocumentgate-report
The specRefs strings in [build-phase.js:PHASES] cite the living docs docs/README.md, docs/reference/http-api.md, docs/reference/authentication.md, docs/reference/webhooks.md, docs/explanation/git-protocol-and-namespaces.md, docs/explanation/domain-model.md, and docs/explanation/streaming-commit-protocols.md. The p0-spike spec also cites the archive page docs/archive/phases/07-implementation-roadmap.md as historical context only. No specRefs string cites docs/upstream/openapi.yaml. That file appears in the module-private [build-phase.js:SPEC_POINTER] text that the plan prompt includes, in the wire-conformance lane of [build-phase.js:REVIEW_LANES], and as openapi.yaml in one p3-read-api acceptance string.
-
[build-phase.js:meta]Exported workflow metadata:descriptionandargsSchema(built with the globalmux.schema,additionalProperties: false). -
[build-phase.js:meta]Run arguments (meta.argsSchema):Arg Type Required Notes phaseenum yes p0-spike,p1-skeleton-auth,p2-git-http,p3-read-api,p4-write-api,p5-eventing-sync,p6-lfs-polish,customspecobject when phaseiscustomFields id,title,specRefs,deliverables,acceptance(string array, at least 1),dogfoodbriefstring no Appended as operator guidance to the plan, foundation, and slice prompts maxFixRoundsnumber no Default 2, clamped to 1..4 isolatedboolean yes, no default true: worktree-isolated children, patch fan-in.false: shared working tree -
[build-phase.js:PHASES]Built-in phase specs. Each hastitle,specRefs,deliverables,acceptance, anddogfood:p0-spike: de-risk spike (git push to S3, Postgres CAS, clone from a second node).p1-skeleton-auth: service skeleton, JWT middleware, repo CRUD, error envelope.p2-git-http: git smart HTTP, namespaces, ref-policy hooks.p3-read-api:git:readendpoints (files, branches, tags, commits, diff, blame, grep, archive).p4-write-api: NDJSON commit-pack and diff-commit, merge, branches, tags, notes.p5-eventing-sync: webhooks, upstream mirrors, forking.p6-lfs-polish: LFS batch API, named-repo routes, repo-urls, rate limits.
-
[build-phase.js:REVIEW_LANES]Four parallel review lanes:correctness-concurrency,wire-conformance,security,tests-and-slop. -
[build-phase.js:workflow]Default export. Takes the runtime context{ args, phase, log, agent, parallel, applyPatch }. Returns{ reportMarkdown, structuredOutput }. -
[build-phase.js:gateReport]Builds the return value.structuredOutputhasphase,gate("go"or"no-go"),reason,verifyPassed,dogfoodPassed,openBlocking(the recheck agent's unresolved issue list), andevidencePaths. -
[build-phase.js:sliceSchema],[build-phase.js:verifySchema],[build-phase.js:reviewSchema],[build-phase.js:recheckSchema],[build-phase.js:dogfoodSchema]Module-private structured-output schemas for the slice, verify, review, recheck, and dogfood agents. Review severity is the enumP0,P1,P2,P3.
[build-phase.js:workflow]The run throws whenphaseiscustomandargs.specis missing.[build-phase.js:workflow]The run throws unlessargs.isolatedis a boolean. The code comment records why: a missing value once dropped a whole phase's implementation (p6, 2026-08-12).[build-phase.js:workflow]phaseIdisargs.spec.idforcustom, elseargs.phase. The code does not sanitize a customidbefore it uses it in the evidence path.[build-phase.js:workflow]maxFixisMath.max(1, Math.min(args.maxFixRounds ?? 2, 4)). The verify loop runs rounds0..maxFix. It stops on the first pass or after the last round. A fix agent runs only between failed rounds.[build-phase.js:workflow]When validation still fails after the last round, the run returns a no-go gate report at once. Code review, dogfood, and document steps do not run.[build-phase.js:sliceSchema]The slice plan has 1 to 4 slices.[build-phase.js:sanitizeName]turns each slice name into an IDs<N>-<name>(lowercase, non-alphanumerics to-).[build-phase.js:workflow]Disjoint slice file ownership is a prompt rule only. The code does not checkownedPathsfor overlap.[build-phase.js:workflow]Slice implementation runs withmaxParallel: 4whenisolatedistrue, elsemaxParallel: 1(sequential). Review lanes run withmaxParallel: 4.[build-phase.js:workflow]Only P0 and P1 review issues go to the fix agent. P2 and P3 issues appear in the gate report but are not fixed.[build-phase.js:workflow]The gate is go only whenverify.passed && dogfood.passed && unresolvedBlocking === 0. After review fixes,verifyholds theverify-after-findingsresult.[build-phase.js:workflow](applyChildPatch) Patch fan-in is a no-op whenisolatedisfalse. Whenisolatedistrue, a failedapplyPatchis logged and the run continues.
[build-phase.js:workflow]Spawns agents with these IDs:plan(agentplan),slice-plan(agentexplore),implement-foundation(conditional),implement-slice-<id>(one per slice),integrate-slices,verify-<round>,fix-<round>,review-<lane>(agentexplore),fix-findings,verify-after-findings,recheck-findings(agentexplore),dogfood, anddocument.[build-phase.js:gateReport]spawnsgate-report.[build-phase.js:workflow]Writing agents (foundation, slices, integrate, fix, document) change repository files. Whenisolatedisfalse, they write into the shared checkout. Whenisolatedistrue, they write in their own forks, andapplyPatchapplies their work with IDsapply-foundation,apply-slice-<id>,apply-integrate,apply-fix-<round>,apply-fix-findings, andapply-document.[build-phase.js:commitRule]Whenisolatedistrue, the prompt tells each writing agent to commit all changes on the current branch (git add -A && git commit) and never push. Uncommitted child work is lost at fan-in.[build-phase.js:workflow]Whenisolatedisfalse, the slice prompt tells agents to stay on the current branch, nevergit reset, rebase, or switch branches, and keep scratch files in/tmp.[build-phase.js:workflow]The dogfood prompt tells the agent to bring up Docker Compose with Postgres and MinIO and to save evidence under/tmp/openstorage-evidence/${phaseId}/.[build-phase.js:workflow]The document prompt tells the agent to update living pages underdocs/and the README quickstart (if setup changed), and never editdocs/archive/.[build-phase.js:workflow]Callslogwith"Slicing decision"and"patch not applied cleanly: <agentId>".
- No automated check exists for this directory.
- The repository has no test, lint, or CI command for JavaScript files.
go test ./...does not cover this directory. A real check is aworkflow_runof the script in a Xum workspace.