refactor(world): derive capability and fault vocabulary - #106
Open
mfw78 wants to merge 2 commits into
Open
Conversation
AI Assistance: Claude Fable 5 used for implementation and tests
AI Assistance: Claude Opus 5 used for red-team review and fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the stringly-typed capability and fault vocabulary in
nexum-worldwith strum-derived enums, so capability names and fault kinds are validated at compile time instead of via hand-maintained string tables.Why
Closes #43
The capability and fault vocabulary was previously scattered across hand-written match arms and string constants, which let the runtime and manifest checks drift out of sync. Deriving the vocabulary end to end removes that duplication and pins the operator-facing unknown-capability wording with a dedicated test.
Testing
"Independent gate on nullislabs/nexum-runtime @ types/t1-world-vocab, run from a fresh clone in a temp dir (/tmp/tmp.feut5LEkr7/repo), detached at FETCH_HEAD = 84aa228 (identical to origin/types/t1-world-vocab). Base origin/main = db39b6c, which is also the merge-base, so the branch is a clean 2-commit fast-forward on the current main tip. Working tree clean throughout. Everything below ran inside
nix develop(rustc 1.94.0, cargo-nextest 0.9.127, mold, sccache).\n\nResults (all exit 0, captured via PIPESTATUS/explicit $? so no truncated-output false green):\n- cargo fmt --all -- --check: exit 0, no diffs.\n- Em-dash scan of added lines over origin/main..HEAD (rg for U+2014/2013/2015/2012 on^\+lines): 0 matches.\n- cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: exit 0, clean finish.\n- just build (engine + example + price-alert/balance-tracker/http-pAI Assistance
Implementation by claude-fable-5, red-team review by claude-opus-5, PR by claude-sonnet-5.