Skip to content

Avoid string aliases for Actor definition fragment references - #60

Open
djhenry wants to merge 1 commit into
cjab:mainfrom
djhenry:codex/wld-actor-model-name
Open

djhenry wants to merge 1 commit into
cjab:mainfrom
djhenry:codex/wld-actor-model-name

Conversation

@djhenry

@djhenry djhenry commented Oct 22, 2026

Copy link
Copy Markdown

Prevent positive Actor definition references from being looked up as string-table offsets. When a fragment index happens to equal an occupied string offset, ObjectLocation::model_name() can otherwise return an unrelated model name.

Return None for the unsupported positive fragment-reference form and document the limitation. Preserve existing nonpositive lookup behavior, including zero. Keep the parser's raw field, public method signature and generic string lookup unchanged; this does not implement Actor-definition graph resolution.

Fixes djhenry#11.

Validation:

  • Workspace tests: 136 passed, 0 failed, 1 ignored. WLD serde tests: 120 passed, 0 failed, 1 ignored. Formatting passed.
  • Four committed regression tests exercise the public parser/accessor with authored synthetic WLD data. Removing the guard reproduces the misleading model name.
  • Independent acceptance used separate raw-byte fixtures, verified reference edge cases and unchanged generic string lookup, and repeated the compiled guard-removal check. Its workspace checks also passed (134 all-target tests plus 2 documentation tests; 1 documentation test ignored).
  • Strict workspace Clippy fails on three unchanged upstream useless_borrows_in_formatting warnings. The same failures reproduce without this change; tracked in Fix WLD Clippy errors on Rust 1.98 djhenry/libeq#6. WLD all-target Clippy passes when only that existing lint is allowed.

This is library-level validation; no native-asset or live-client validation is claimed.

This contribution is based on upstream main and contains no unrelated fork changes. It does not update an asset-server dependency pin or activate client behavior. The baker's separate raw lookup is tracked in djhenry/eqoxide_asset_server#96.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distinguish Actor definition indexes from string offsets in model_name

1 participant