docs: scope check-dupes to paths-only; add depot pipeline migration charter
check-dupes ports directory mode only; the --manifests hak-scoped check is manifest-integrity and moves to the depot pipeline migration. Add that follow-up as a charter spec (import/sync/export + mdl gate + manifest dupes into `crucible depot`), marked draft pending its own brainstorming. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,8 +30,8 @@ Seven commands:
|
||||
model-name mismatches (read-only).
|
||||
- `crucible assets fix-mdl` — lowercase `.mdl` filenames and rewrite ASCII
|
||||
model/root names to match each file's stem.
|
||||
- `crucible assets check-dupes` — report runtime-name (basename) collisions in
|
||||
directories, or hak-scoped collisions across `assets/*.yml` manifests.
|
||||
- `crucible assets check-dupes` — report runtime-name (basename) collisions
|
||||
across directories.
|
||||
- `crucible assets clean-dupes` — delete files from a "clean" tree whose
|
||||
basename collides with anything in a "primary" tree.
|
||||
|
||||
@@ -235,21 +235,21 @@ candidate only if it needs a content fix (name mismatch) or a filename
|
||||
lowercase, so the expensive per-file read/rewrite runs only on the few that
|
||||
matter, not the whole tree.
|
||||
|
||||
## `crucible assets check-dupes [--manifests] <dir>…`
|
||||
## `crucible assets check-dupes <dir>…`
|
||||
|
||||
Port of `check-duplicate-names.sh`. Read-only. NWN packs hak entries by
|
||||
basename, not path, so files at different paths with the same basename
|
||||
(case-insensitively) silently clobber on pack. This flags them.
|
||||
|
||||
- Directory mode (default): across all `<dir>` args, report any two files whose
|
||||
lowercased basename matches.
|
||||
- `--manifests`: additionally read every `assets/*.yml` in the current repo and
|
||||
report basename collisions **within the same hak** (`.assets[].path` grouped
|
||||
by `.assets[].hak`), reusing Crucible's existing `gopkg.in/yaml.v3` parsing.
|
||||
Requires no external `yq`.
|
||||
Port of `check-duplicate-names.sh`'s **directory mode only**. Read-only. NWN
|
||||
packs hak entries by basename, not path, so files at different paths with the
|
||||
same basename (case-insensitively) silently clobber on pack. Across all `<dir>`
|
||||
args, report any two files whose lowercased basename matches.
|
||||
|
||||
Exit non-zero if any collision is found.
|
||||
|
||||
The script's `--manifests` mode (hak-scoped collisions read from `assets/*.yml`)
|
||||
is **not** ported here — it inspects manifest structure, not files on disk, so
|
||||
it belongs with the manifest/depot tooling. It moves in the follow-up spec (see
|
||||
Out of scope); until then `sow-assets-manifest` keeps
|
||||
`check-duplicate-names.sh` solely for that mode.
|
||||
|
||||
## `crucible assets clean-dupes [--dry-run] <primary> <clean>`
|
||||
|
||||
Port of `clean-duplicate-names.sh`. Deletes files from the `<clean>` tree whose
|
||||
@@ -269,22 +269,24 @@ Exit zero on success with a count of removed (or would-remove) files.
|
||||
(`crucible.sh`) and uses `crucible depot` from its Makefile, so it resolves a
|
||||
released `crucible` with zero extra setup.
|
||||
|
||||
- **Delete** the four folded driver scripts: `scripts/check-ascii-mdl.sh`,
|
||||
`scripts/fix-mdl-model-names.sh`, `scripts/check-duplicate-names.sh`,
|
||||
`scripts/clean-duplicate-names.sh`.
|
||||
- **Delete** the three fully-folded driver scripts: `scripts/check-ascii-mdl.sh`,
|
||||
`scripts/fix-mdl-model-names.sh`, `scripts/clean-duplicate-names.sh`.
|
||||
- **Repoint** the Makefile targets to the wrapper:
|
||||
- `check-mdl` → `./crucible.sh assets check-mdl …`
|
||||
- `fix-mdl` → `./crucible.sh assets fix-mdl [--dry-run] …`
|
||||
- `check-dupes` → `./crucible.sh assets check-dupes …` and
|
||||
`./crucible.sh assets check-dupes --manifests`
|
||||
- `check-dupes` — its directory scan → `./crucible.sh assets check-dupes …`;
|
||||
the `check-duplicate-names.sh --manifests` line stays as-is.
|
||||
- `clean-dupes` → `./crucible.sh assets clean-dupes [--dry-run] <PRIMARY> <CLEAN>`
|
||||
- the `haks` target's `check-duplicate-names.sh --manifests` guard →
|
||||
`./crucible.sh assets check-dupes --manifests`
|
||||
- **Keep for now:** `scripts/mdl-scan.awk` and `scripts/mdl-name-lib.sh`. They
|
||||
are still sourced by `import.sh` for its batched pre-import gate (~28× faster
|
||||
than per-file, on a hot path). They retire in the follow-up below. Because
|
||||
both the awk classifier and the Go `mdl` module must agree, the port keeps
|
||||
detection byte-for-byte identical (a shared fixture set checks this).
|
||||
- **Keep for now:**
|
||||
- `scripts/check-duplicate-names.sh` — kept **only** for its `--manifests`
|
||||
mode, still called by the `check` and `haks` targets. Its directory mode is
|
||||
superseded by `crucible assets check-dupes`. Ported and deleted in the
|
||||
follow-up.
|
||||
- `scripts/mdl-scan.awk` and `scripts/mdl-name-lib.sh` — still sourced by
|
||||
`import.sh` for its batched pre-import gate (~28× faster than per-file, on a
|
||||
hot path). They retire in the follow-up too. Because both the awk classifier
|
||||
and the Go `mdl` module must agree, the port keeps detection byte-for-byte
|
||||
identical (a shared fixture set checks this).
|
||||
|
||||
Nothing in `sow-assets-manifest` is committed by this project's plan except the
|
||||
script deletions and Makefile edits; that repo's change lands as its own commit
|
||||
@@ -292,12 +294,15 @@ once the new `crucible` release with `assets` is available.
|
||||
|
||||
## Out of scope — follow-up spec
|
||||
|
||||
Moving the **depot-interacting pipeline** (`import.sh`, `sync-assets.sh`,
|
||||
`export.sh`, and the inline mdl gate) into `crucible depot` is a separate
|
||||
project with its own spec. When `import.sh` becomes `crucible depot import`, its
|
||||
gate uses the in-process `internal/assets/mdl` module and
|
||||
`scripts/mdl-scan.awk` + `scripts/mdl-name-lib.sh` are deleted. This spec
|
||||
deliberately stops at the standalone integrity tools to keep one focused plan.
|
||||
Moving the **depot-interacting pipeline** into `crucible depot` is a separate
|
||||
project with its own spec
|
||||
(`2026-07-12-crucible-depot-pipeline-migration-design.md`). It covers
|
||||
`import.sh`, `sync-assets.sh`, `export.sh`, the inline mdl gate, and the
|
||||
`check-duplicate-names.sh --manifests` manifest-collision check. When that lands:
|
||||
its gate uses the in-process `internal/assets/mdl` module, and
|
||||
`scripts/mdl-scan.awk`, `scripts/mdl-name-lib.sh`, and
|
||||
`scripts/check-duplicate-names.sh` are all deleted. This spec deliberately stops
|
||||
at the standalone, file-on-disk integrity tools to keep one focused plan.
|
||||
|
||||
## Error handling
|
||||
|
||||
@@ -327,8 +332,7 @@ Go tests in `internal/assets`:
|
||||
a model that then passes `CheckNames`. A parity fixture set shared in intent
|
||||
with `mdl-scan.awk` so the Go port and the still-present awk agree.
|
||||
- `check-dupes`/`clean-dupes`: temp trees asserting basename-collision
|
||||
detection (case-insensitive), the `--manifests` hak-scoped path against a
|
||||
small `assets/*.yml` fixture, the overlap guard, and `--dry-run` mutating
|
||||
detection (case-insensitive), the overlap guard, and `--dry-run` mutating
|
||||
nothing.
|
||||
|
||||
External engine/upscaler calls are exercised through the `run` indirection with
|
||||
|
||||
Reference in New Issue
Block a user