Reviewed-on: #21 Co-authored-by: vickydotbat <vickydotbat@tutamail.com> Co-committed-by: vickydotbat <vickydotbat@tutamail.com>
3.0 KiB
Migrating from nwn-tool to Crucible (cutover — DONE)
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. The cutover below has been performed: the internal/ packages are
migrated and the module/topdata/hak/wiki builders delegate to them. The
checklist is kept as the record of what was done.
Status. Steps 1–8 are complete.
depotis the one remaining unwired builder (no legacy source — it was shellmc/S3). The open follow-up is the consumer flag contract:sow-module/sow-topdata/sow-assets-manifestwrappers invokecrucible-<name>with--manifest/--source/--outstyle flags (seeconsumer-contract.md), whereas the migrated commands use the legacy CWD/project model. Reconciling the two is the Phase-6 consumer task and is not part of this cutover.
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,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. - 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.