CNA-BUG-272: misc/cnj.md's native-extension table omits .gltf and .glb, its sourceFile matrix omits Texture3D, AnimationClip and Curve, and one sentence says CNA has no JSON object type although Json.hpp defines JsonValue
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
CNA's .cnj design note lists no glTF extension although ModelTypeReader accepts .gltf and .glb, lists only three of the six readers that reject sourceFile in its capability matrix, and says CNA has no JSON object type, only hand-rolled helpers, although CNA/Internal/Json.hpp is a complete JsonValue parser that the note's own status block names.
- Identifier
CNA-BUG-272- Category
- Bug
- Subsystem
- Documentation & release tooling
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- misc/cnj.md: the native-extension table, the sourceFile capability matrix and the statements that CNA has no general JSON library or JSON object type
Expected behaviour
The design note that the code was built from states, for each reader, what the code enforces, and does not deny facilities the code has.
Actual behaviour at TARGET
cnj.md's table “Native extensions (the .cnj-absent fallback)” lists .png, .jpg/.jpeg, .bmp, .dds, .wav and .ogg/.mp3 and no glTF, and says a new native format is “just adding one more row here”, while ModelTypeReader::GetExtensions in ContentManager.cpp returns .cnj, .gltf and .glb. Its “sourceFile capability matrix” has rows for Texture2D, SoundEffect and TextureCube (supported) and for SpriteFont, Effect and Model (rejected), while RejectSourceFileForSelfContainedCnj is called for six self-contained readers: Texture3D, Effect, SpriteFont, AnimationClip, Curve and Model, so the rejecting readers Texture3D, AnimationClip and Curve have no row. In its paragraph on RegisterCnjLoader the note says “CNA has no JSON object type, only the hand-rolled string-scanning helpers”, and earlier it says the existing readers use hand-rolled helpers, “not a general JSON library”, and that a migration could “adopt a real JSON library at that point”. Json.hpp defines JsonValue, a complete parsed value for objects, arrays, strings, numbers, booleans and null, which ContentManager.cpp parses with ParseJson for the Texture3D, SpriteFont and stock-effect readers. The note's own status block names Json.hpp and says the envelope “parses via a real recursive-descent JSON parser”, so the note contradicts itself; the hand-rolled helpers still exist and other readers still use them.
Source locations
misc/cnj.md— native-extension table, sourceFile capability matrix, the no-JSON-library statementsmodules/content/src/Xna/ContentManager.cpp— ModelTypeReader::GetExtensions and the RejectSourceFileForSelfContainedCnj call sitesmodules/content/include/CNA/Internal/Json.hpp— JsonValue, a complete parsed JSON value
Evidence
Read at 009d40f5; nothing was executed. The rest of the note is not re-audited here; CNA-BUG-245 covers a different statement in the same file (the content manifest). The sentence denying a JSON object type was true when RegisterCnjLoader was added (CNB-24) and became stale when Json.hpp arrived (CNB-35).
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
The behaviour the note describes is tested (CnjCapabilityMatrixTests.cpp for sourceFile rejection, RuntimeGltfModelTests.cpp for .gltf and .glb loading through ModelTypeReader, JsonTests.cpp for the parser); nothing compares the note's tables with the code.
Regression test
Add the glTF row and the three matrix rows, and correct the sentence about a JSON object type; or mark the note as a historical design sketch.
Blast radius
Contributors who read misc/cnj.md as the specification of the format: they would not learn that a model can be loaded from a native glTF file or which readers reject sourceFile.
Workaround
Read the site's CNJ documents Deep Dive, which states the enforced behaviour.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- ContentManager
- Internals
- Content runtime internals
- Deep dives
- CNJ documents · ContentManager resolution rules
- Known issues
- Bug index