ConstructCraft

Pipe Catalog, Stage 1 (Core and Data) Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Pipe series (sizes with outside/inside diameters and walls, plus the fittings sold for them with their dimensions) live in the project. A built-in catalog of 22 series (Brazil, Europe, US) and series files can be imported. Pipe types point to a series row, the templates use series, older files are linked on load (format 29), and sizing uses real inside diameters within the run’s series.

Spec: docs/superpowers/specs/2026-11-16-pipe-catalog-design.md (this plan covers its “Plan shape” item 1; fittings matching, IFC and the app are stages 2 and 3).

Data: already in the worktree. crates/cc_core/assets/pipes/*.json is 22 series in file format 1 (mm), and assets/pipes/notes/{br,eu,us}.md holds the research notes. The data is not edited by this plan except to fix what the validation test finds; any fix is recorded in the notes.

Global constraints

Names (new, must not clash)

Decisions (where the spec is open)

Model

Bounds

constant value
MAX_SERIES 200
MAX_SIZES 100
MAX_FITTINGS 2000
MAX_TEXT 200 chars
MAX_SOURCES 50
MAX_FILE_BYTES 2 MB
de 1 mm to 2 m, and 0 < e < de/2
fitting lengths 0 to 2 m
angles 1–180

Pipe type fields

TypeData::Pipe gains:

Two methods read it:

Sync and repair

Built-in catalog

Import

pipe_series_import:

Templates

Format 29

FORMAT_VERSION = 29. On load of a file before 29:

Sizing (cc_geom::sizing)

mep_size_apply

For a run of a series:

Runs without a series keep pipe_type_for, restricted to types without a series.

Engine commands

i18n keys (all 12 languages)

Check before adding error messages: if the engine’s existing error messages are English literals rather than keys, follow that.

Tasks

Task 1: Model, file format and catalog (cc_core)

Files:

Task 2: Pipe types, sync, repair, templates, format 29 (cc_core)

Files: types.rs (TypeData::Pipe), project.rs (template, pipe_row), template_spec.rs, document.rs (sync_pipe_series in finish), repair.rs, persist.rs, new pipe_series_project.rs (the impl Project helpers and tests).

Task 3: Sizing by inside diameter (cc_geom, cc_engine mep_size_apply)

Task 4: Engine commands

Files: new crates/cc_engine/src/commands/pipes.rs, commands/mod.rs, registry.rs, commands/types.rs (type_set series and size; derived), refs.rs (pipe_series by id, code or name), i18n, docs/commands.md.

Task 5: Docs and full check

Self-review checklist