fix(project): a module resref names a file, not a resource #93

Merged
archvillainette merged 1 commits from module-resref-is-a-filename into main 2026-08-01 08:59:26 +00:00
Owner

module.resref is the name of the built .mod on disk, so the 16-byte resref limit never applied to it — NWN:EE module file names are routinely longer. The blanket check rejected ShadowsOverWestgate (19 characters) and blocked sow-module#60:

crucible module build
  module.resref "ShadowsOverWestgate" exceeds 16 characters

What changed

internal/project/project.gomodule.resref is validated as a file name now, which still rejects a resref that is a path or empty.

The 16-character limit is kept where the value really does become a resref: a project with paths.assets and no haks[] names its single generated HAK after the module resref (build.go:1144), and a HAK name is a resref the engine loads. That case now says what to do about it instead of refusing every long module name.

Verified

  • 3 new tests in internal/project: a long module name validates and produces ShadowsOverWestgate.mod; a resref containing a path is rejected; a long resref that would name a generated HAK is still rejected.
  • make check green.
  • crucible module build in sow-module writes module/ShadowsOverWestgate.mod (70 resources).
  • crucible topdata validate in sow-topdata still passes — its assets live under topdata.assets, not paths.assets, so the HAK guard does not bite.

Merge this first: sow-module's rename PR cannot go green in CI until this lands and its flake.lock is bumped.

Refs ShadowsOverWestgate/sow-module#60

🤖 Generated with Claude Code

`module.resref` is the name of the built `.mod` on disk, so the 16-byte resref limit never applied to it — NWN:EE module file names are routinely longer. The blanket check rejected `ShadowsOverWestgate` (19 characters) and blocked sow-module#60: ``` crucible module build module.resref "ShadowsOverWestgate" exceeds 16 characters ``` ## What changed `internal/project/project.go` — `module.resref` is validated as a **file name** now, which still rejects a resref that is a path or empty. The 16-character limit is kept where the value really does become a resref: a project with `paths.assets` and no `haks[]` names its single generated HAK after the module resref (`build.go:1144`), and a HAK name is a resref the engine loads. That case now says what to do about it instead of refusing every long module name. ## Verified - 3 new tests in `internal/project`: a long module name validates and produces `ShadowsOverWestgate.mod`; a resref containing a path is rejected; a long resref that would name a generated HAK is still rejected. - `make check` green. - `crucible module build` in sow-module writes `module/ShadowsOverWestgate.mod` (70 resources). - `crucible topdata validate` in sow-topdata still passes — its assets live under `topdata.assets`, not `paths.assets`, so the HAK guard does not bite. Merge this **first**: sow-module's rename PR cannot go green in CI until this lands and its `flake.lock` is bumped. Refs ShadowsOverWestgate/sow-module#60 🤖 Generated with [Claude Code](https://claude.com/claude-code)
archvillainette added 1 commit 2026-08-01 08:03:59 +00:00
module.resref is the name of the built .mod on disk, so the 16-byte resref
limit never applied to it — NWN:EE module file names are routinely longer.
The blanket check rejected ShadowsOverWestgate (19 characters) and blocked
sow-module#60.

It is now validated as a file name instead, which still rejects a resref
that is a path or an empty string.

The limit is kept where the value really does become a resref: a project
with paths.assets and no haks[] names its single generated HAK after the
module resref, and a HAK name is a resref the engine loads. That case now
says what to do about it rather than refusing every long module name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
archvillainette scheduled this pull request to auto merge when all checks succeed 2026-08-01 08:09:52 +00:00
xtul approved these changes 2026-08-01 08:59:23 +00:00
archvillainette merged commit 3cac6e9484 into main 2026-08-01 08:59:26 +00:00
archvillainette deleted branch module-resref-is-a-filename 2026-08-01 08:59:26 +00:00
Sign in to join this conversation.