Problem
The Factory visualization currently shows at most one artifact box per phase (architecture, planning, implementation). We can't see who produced which artifacts or how many there are.
Current limitations
buildArtifacts() creates at most 3 artifacts (one each for architecture, planning, implementation), collapsing multiple planning artifacts into a single box
artifactPosition() returns a single fixed position per station — no support for multiple artifacts at one station
- Artifact size (15x15) is hardcoded in
ArtifactActor
- Phases
codeSimplifier and holisticReview are ignored despite having artifact fields in the data model
- Positioning uses magic numbers (+30 x-offset, -60 y-offset) rather than named constants
Proposed solution
Create a visual box for each individual artifact, with configurable constants for size, position, and spacing:
- Position of the agent can be specified relative to the center of the station
- Position of the first artifact can be specified relative to the center of the station and its primary y coordinate
- Size of each artifact is specified in a
{ height: number, width: number } constant; use the same units as those used for other dimensions in the Factory
- Gap between artifacts is specified in a constant
Multiple artifacts at the same station are arranged horizontally (left-to-right).
The eventual goal (out of scope for this ticket) is to allow the user to view any of the artifacts by clicking on its box.
Key design decisions
Dual-source data strategy: The CanonicalRunStatus has artifact data in two places:
- Top-level
artifacts: ArtifactEntry[] (v2 format) — rich metadata per artifact with filename, agent, phase, etc.
- Per-phase fields (e.g.,
architecture.artifact, planning.artifacts[]) — simpler, always present
Use the top-level array when populated (one visual box per entry), falling back to phase fields for v1 compatibility. The fallback now also covers codeSimplifier and holisticReview.
Horizontal layout: Artifacts at the same station are arranged in a horizontal row. With default sizing (12px width + 4px gap = 16px per artifact), 5 artifacts span 80px — well within the 150px station spacing.
Acceptance criteria
Files to modify
| File |
Change |
packages/factory/src/client/game/layout/platform-layout.ts |
Add layout constants, update artifactPosition signature, expose artifactSize |
packages/factory/src/client/game/mappers/run-to-scene.ts |
Add indexAtStation to ArtifactConfig, rewrite buildArtifacts() with dual-source logic |
packages/factory/src/client/game/actors/ArtifactActor.ts |
Accept optional size, add color entries for simplifier/holistic |
packages/factory/src/client/game/scenes/FactoryScene.ts |
Update rendering to use new artifactPosition signature |
packages/factory/src/client/game/layout/__tests__/platform-layout.test.ts |
Update and add artifact position tests |
packages/factory/src/client/game/actors/__tests__/ArtifactActor.test.ts |
Add size and color tests |
packages/factory/src/client/game/mappers/__tests__/run-to-scene.test.ts |
Add comprehensive multi-artifact tests |
Problem
The Factory visualization currently shows at most one artifact box per phase (architecture, planning, implementation). We can't see who produced which artifacts or how many there are.
Current limitations
buildArtifacts()creates at most 3 artifacts (one each for architecture, planning, implementation), collapsing multiple planning artifacts into a single boxartifactPosition()returns a single fixed position per station — no support for multiple artifacts at one stationArtifactActorcodeSimplifierandholisticRevieware ignored despite having artifact fields in the data modelProposed solution
Create a visual box for each individual artifact, with configurable constants for size, position, and spacing:
{ height: number, width: number }constant; use the same units as those used for other dimensions in the FactoryMultiple artifacts at the same station are arranged horizontally (left-to-right).
The eventual goal (out of scope for this ticket) is to allow the user to view any of the artifacts by clicking on its box.
Key design decisions
Dual-source data strategy: The
CanonicalRunStatushas artifact data in two places:artifacts: ArtifactEntry[](v2 format) — rich metadata per artifact with filename, agent, phase, etc.architecture.artifact,planning.artifacts[]) — simpler, always presentUse the top-level array when populated (one visual box per entry), falling back to phase fields for v1 compatibility. The fallback now also covers
codeSimplifierandholisticReview.Horizontal layout: Artifacts at the same station are arranged in a horizontal row. With default sizing (12px width + 4px gap = 16px per artifact), 5 artifacts span 80px — well within the 150px station spacing.
Acceptance criteria
{ width, height }constant (not hardcoded in the actor)codeSimplifierandholisticReviewartifacts are rendered when presentCanonicalRunStatus.artifacts(top-level array) is populated, it is used as primary data sourceFiles to modify
packages/factory/src/client/game/layout/platform-layout.tsartifactPositionsignature, exposeartifactSizepackages/factory/src/client/game/mappers/run-to-scene.tsindexAtStationtoArtifactConfig, rewritebuildArtifacts()with dual-source logicpackages/factory/src/client/game/actors/ArtifactActor.tspackages/factory/src/client/game/scenes/FactoryScene.tsartifactPositionsignaturepackages/factory/src/client/game/layout/__tests__/platform-layout.test.tspackages/factory/src/client/game/actors/__tests__/ArtifactActor.test.tspackages/factory/src/client/game/mappers/__tests__/run-to-scene.test.ts