2.6 KiB
2.6 KiB
Migrating from nwn-tool to Crucible (operator cutover)
The legacy toolchain lives at gitea/sow-tools as a single nwn-tool binary
(entry cmd/nwn-tool, logic under internal/). This repo is the Crucible
rewrite. Per the migration hard rules, the internal/ source is not
transplanted automatically — the operator migrates it. This is the checklist.
Why a clean scaffold first
- The hard rules forbid copying old-repo source into the migration tree
(
build from scratch; reference, don't transplant). - The downstream skeletons (
sow-module,sow-topdata) already fail closed until they can resolve a Crucible binary; the scaffold satisfies that contract without faking artifacts. - The scaffold pins the shape (module path, dispatcher, multi-binary layout, container, CI) so the migrated logic drops into a stable frame.
Cutover steps
- Move the internal packages. Bring
internal/{app,pipeline,project,erf, gff,topdata,music,changelog,validator}fromgitea/sow-toolsinto this repo. Re-homeinternal/appcommand wiring behindinternal/dispatchinstead of the old flag parser incmd/nwn-tool. - Restore dependencies. Add
golang.org/x/textandgopkg.in/yaml.v3back togo.mod; commit the resultinggo.sum. (docker/Dockerfilealready tolerates an absentgo.sumfor the scaffold; it will be present after this.) - Wire each builder. In
internal/dispatch, register a handler per builder and remove it from the unwired fail-closed path. Map the legacy commands percommand-surface.md. - Kill the home-dir /
NWN_ROOTdefaulting. Honor only explicit env/flag roots perconsumer-contract.md. - Drop the committed binary. Delete
nwn-tool/tools/sow-toolkitfrom the source tree;.gitignorealready excludes them. Binaries become CI artifacts and image layers only. - Carry the determinism test. Port
TestBuildNativeKeepsGeneratedIDsStableAcrossRepeatedBuildsand keep it green. - Runtime base for music. If music conversion is wired, switch the final
Docker stage from
distroless/staticto a debian-slim base that includesffmpeg. - Update
make smoke. Once a builder is wired, change the smoke expectation for it from exit70to a real success path.
Wrapper contract carried over
Consumer repos keep the SCRIPT_WRAPPER_CONTRACT resolution behavior, now
pointed at Crucible binaries — see consumer-contract.md.
The old SOW_TOOLS_DEV_BINARY dev override maps to $CRUCIBLE /
$SOW_MODULE_BUILD / $SOW_TOPDATA_BUILD.