BS-JD-209 - Deterministic imported-asset fingerprints #56

Closed
opened 2026-07-13 01:00:50 -04:00 by Rbanh · 1 comment
Owner

Summary

Make imported-asset fingerprints and generated manifests deterministic so launching the editor or running validators does not dirty a clean checkout when source bytes are unchanged.

Why

Native #33 QA repeatedly rewrote the generated animation/static-mesh manifests for RobotExpressive.glb solely because the checkout/source mtime differed from persisted modified_unix_secs. The content hash and byte length were unchanged. Later validation also normalized only the final newline. These changes are repository noise, obscure intentional edits, and make clean-checkout release evidence unreliable.

Git does not preserve source mtimes, so persisting checkout timestamps as semantic identity cannot be stable across contributors or CI.

Implementation notes

  • Treat content identity as authoritative; mtime may accelerate scanning in memory but must not force a persisted rewrite when bytes/semantic output are unchanged.
  • Give every imported source kind a stable content fingerprint. Do not leave static meshes dependent on byte length + mtime alone.
  • Compare serialized semantic manifests before publishing; preserve exact committed bytes when the import result is equivalent.
  • Ensure read-only validation never mutates generated artifacts.
  • Migrate existing manifests compatibly without forcing unrelated asset reimports.
  • Keep registry UUIDs and sub-asset IDs stable across metadata-only drift.

Acceptance criteria

  • A fresh LFS checkout remains clean after native editor startup, asset scan, cargo validate-levels, and cargo validate-samples.
  • Touching an imported source without changing bytes produces no authored/generated diff.
  • Changing bytes with the same length is detected and refreshes the correct manifests.
  • Equivalent reimport output preserves exact file bytes, including formatting/newline.
  • Static mesh, animation, texture, audio, and model-source paths share the deterministic policy.
  • Tests cover mtime-only drift, same-size content change, old-manifest migration, and read-only validators.

Docs/tests

The content-addressed contract is owned by ADR 0043, integrated with ADRs 0017/0028, and enforced by the post-validator clean-worktree CI assertion.

Evidence

## Summary Make imported-asset fingerprints and generated manifests deterministic so launching the editor or running validators does not dirty a clean checkout when source bytes are unchanged. ## Why Native #33 QA repeatedly rewrote the generated animation/static-mesh manifests for `RobotExpressive.glb` solely because the checkout/source mtime differed from persisted `modified_unix_secs`. The content hash and byte length were unchanged. Later validation also normalized only the final newline. These changes are repository noise, obscure intentional edits, and make clean-checkout release evidence unreliable. Git does not preserve source mtimes, so persisting checkout timestamps as semantic identity cannot be stable across contributors or CI. ## Implementation notes - Treat content identity as authoritative; mtime may accelerate scanning in memory but must not force a persisted rewrite when bytes/semantic output are unchanged. - Give every imported source kind a stable content fingerprint. Do not leave static meshes dependent on byte length + mtime alone. - Compare serialized semantic manifests before publishing; preserve exact committed bytes when the import result is equivalent. - Ensure read-only validation never mutates generated artifacts. - Migrate existing manifests compatibly without forcing unrelated asset reimports. - Keep registry UUIDs and sub-asset IDs stable across metadata-only drift. ## Acceptance criteria - [x] A fresh LFS checkout remains clean after native editor startup, asset scan, `cargo validate-levels`, and `cargo validate-samples`. - [x] Touching an imported source without changing bytes produces no authored/generated diff. - [x] Changing bytes with the same length is detected and refreshes the correct manifests. - [x] Equivalent reimport output preserves exact file bytes, including formatting/newline. - [x] Static mesh, animation, texture, audio, and model-source paths share the deterministic policy. - [x] Tests cover mtime-only drift, same-size content change, old-manifest migration, and read-only validators. ## Docs/tests The content-addressed contract is owned by ADR 0043, integrated with ADRs 0017/0028, and enforced by the post-validator clean-worktree CI assertion. ## Evidence - [Acceptance results and exact commits](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/issues/56#issuecomment-1102) - [Fresh-checkout native editor](https://git.spacetrainclubhouse.com/attachments/df761c85-0b82-4a25-9d33-9cf8189539f0) - [Imported model browser](https://git.spacetrainclubhouse.com/attachments/93da7803-de47-43fb-bb8c-f759970a2b5f) - [Versioned evaluation record](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/src/commit/7e99243a78ee99207763ec92e80bcf6dd03f7151/docs/editor/evaluations/deterministic-asset-fingerprints/README.md)
Rbanh added this to the M2 - Content workspace and asset pipeline milestone 2026-07-13 01:00:50 -04:00
Author
Owner

Acceptance complete

Published to main at 7e99243a78ee99207763ec92e80bcf6dd03f7151.

Implementation commits:

  • e1b2f86a495496da83947777d332d00a15a1779d - shared content-addressed fingerprints, registry/manifests, validators, CI cleanliness assertion, migration, tests, and ADR 0043.
  • cbd380a9413411667a83f74b66c5a2feda5e1af7 - normalized registry publication order plus discovery-order regression coverage.
  • 7e99243a78ee99207763ec92e80bcf6dd03f7151 - exact acceptance record, roadmap, debt audit, and production-readiness matrix 0.6.

Verification:

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --all-targets --no-fail-fast (editor 300 passed; scene 100 passed plus one ignored manual migration; shared 99 passed; all workspace targets green)
  • cargo validate-levels --project . (81 dependencies, five known nonblocking findings, zero blocking)
  • cargo validate-samples --project . (five samples, 86 dependencies, the same five nonblocking findings, zero blocking)
  • Fresh detached LFS-hydrated checkout remained clean after native editor startup, asset scan, both validators, and process exit code 0.
  • Live mtime-only touch of RobotExpressive.glb produced no Git or generated-artifact diff; the original nanosecond timestamp was restored.
  • Registry plus all six committed static-mesh/animation artifacts retained their exact baseline SHA-256 values through every stage.
  • Same-size byte changes, legacy migration/timestamp tolerance, semantic byte preservation, imported source coverage, read-only validation, and reordered discovery are covered by regression tests.
  • Native editor and imported-model browser were visually inspected on Wayland.

Evidence:

Packaged acceptance remains explicitly owner-deferred and is not claimed. Native QA separately exposed missing external painted-chair FBX textures; that independent defect is tracked in #58. Production readiness remains Not ready under #50.

## Acceptance complete Published to `main` at `7e99243a78ee99207763ec92e80bcf6dd03f7151`. Implementation commits: - `e1b2f86a495496da83947777d332d00a15a1779d` - shared content-addressed fingerprints, registry/manifests, validators, CI cleanliness assertion, migration, tests, and ADR 0043. - `cbd380a9413411667a83f74b66c5a2feda5e1af7` - normalized registry publication order plus discovery-order regression coverage. - `7e99243a78ee99207763ec92e80bcf6dd03f7151` - exact acceptance record, roadmap, debt audit, and production-readiness matrix 0.6. Verification: - [x] `cargo fmt --all -- --check` - [x] `cargo clippy --workspace --all-targets -- -D warnings` - [x] `cargo test --workspace --all-targets --no-fail-fast` (editor 300 passed; scene 100 passed plus one ignored manual migration; shared 99 passed; all workspace targets green) - [x] `cargo validate-levels --project .` (81 dependencies, five known nonblocking findings, zero blocking) - [x] `cargo validate-samples --project .` (five samples, 86 dependencies, the same five nonblocking findings, zero blocking) - [x] Fresh detached LFS-hydrated checkout remained clean after native editor startup, asset scan, both validators, and process exit code 0. - [x] Live mtime-only `touch` of `RobotExpressive.glb` produced no Git or generated-artifact diff; the original nanosecond timestamp was restored. - [x] Registry plus all six committed static-mesh/animation artifacts retained their exact baseline SHA-256 values through every stage. - [x] Same-size byte changes, legacy migration/timestamp tolerance, semantic byte preservation, imported source coverage, read-only validation, and reordered discovery are covered by regression tests. - [x] Native editor and imported-model browser were visually inspected on Wayland. Evidence: - [Fresh-checkout native editor](https://git.spacetrainclubhouse.com/attachments/df761c85-0b82-4a25-9d33-9cf8189539f0) - [Imported models and FBX details](https://git.spacetrainclubhouse.com/attachments/93da7803-de47-43fb-bb8c-f759970a2b5f) - [`docs/editor/evaluations/deterministic-asset-fingerprints/`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/src/commit/7e99243a78ee99207763ec92e80bcf6dd03f7151/docs/editor/evaluations/deterministic-asset-fingerprints/README.md) Packaged acceptance remains explicitly owner-deferred and is not claimed. Native QA separately exposed missing external painted-chair FBX textures; that independent defect is tracked in #58. Production readiness remains **Not ready** under #50.
Rbanh added reference main 2026-07-13 12:11:34 -04:00
Rbanh closed this issue 2026-07-13 12:11:36 -04:00
Rbanh changed reference from main to main 2026-07-13 12:12:02 -04:00
Rbanh changed reference from main to main 2026-07-13 12:12:19 -04:00
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Falling-Metal-Interactive/Blacksite#56
No description provided.