Skip to content

api: namespace generated bindings — x3d::core + x3d::nodes (API-1 + API-2)#26

Merged
delta9000 merged 15 commits into
mainfrom
api/namespace-generated-bindings
Jun 27, 2026
Merged

api: namespace generated bindings — x3d::core + x3d::nodes (API-1 + API-2)#26
delta9000 merged 15 commits into
mainfrom
api/namespace-generated-bindings

Conversation

@delta9000

Copy link
Copy Markdown
Owner

Moves the 685 generated binding types out of the global namespace into two namespaces, physically mirrored by header subdirs. Closes API-1 (global-namespace dump) and API-2 (flat install layout). Design: docs/superpowers/specs/2026-06-27-namespace-generated-bindings-design.md; rationale: ADR-0039.

What changed

  • x3d::core (generated_cpp_bindings/x3d/core/) — the value/reflection vocabulary: SF*/MF* types, FieldInfo/FieldTable/NodeVisitor/RangeDiagnostic/X3DFieldType/AccessType, bounded enums.
  • x3d::nodes (generated_cpp_bindings/x3d/nodes/) — X3DNode base, all abstract X3D*Node, all concrete node classes, the factory, the interface registry.
  • Headers use #pragma once; uniform include spelling in-tree and installed (#include "x3d/nodes/Transform.hpp"). Cross-namespace seam: x3d::core::SFNode = std::shared_ptr<x3d::nodes::X3DNode>.
  • Clean break, no shim. Consumers qualify asymmetrically: a using namespace x3d::core; for the small vocabulary set (scoped, never global), but explicit x3d::nodes::Foo / a per-file namespace xn = x3d::nodes; alias for the 685 node types — no blanket nodes directive. The x3d::sdk façade re-exports core + nodes aliases.

X3D string identity is unchanged (nodeTypeName() still returns "Transform"); the binding-hash golden was re-blessed, the behavioral goldens/conformance view did not change.

Scope

~190 consumer files (qualification + include paths), the emitter (src/x3d_cpp_gen/), CMake layout/install, and the out-of-band tooling that read generated artifacts by hardcoded flat path (conformance scanner, .gitignore, the generator's pytest suite).

Verification

mise run ci green: 111/111 ctests (incl. the new x3d_namespace_taxonomy lock test), 305 pytest passed, golden + conformance-gate + coverage-gate (39 ADRs) pass, cli-gate-regression no regressions (+1 improvement). Strict mise run docs-build clean.

Merge is yours.

delta9000 added 15 commits June 27, 2026 10:13
…R-0039)

The 14 failing tests were asserting on the old flat output layout and
pre-namespace header content. The emitter output is correct; the tests
were stale. Updated:

- test_emission.py: rendered fixture writes core headers (X3Dtypes.hpp,
  X3Denums.hpp) to x3d/core/; _read() routes core headers to x3d/core/
  and all node headers/.cpp to x3d/nodes/.
- test_decl_def_split.py: factory source include-path assertions updated
  to x3d/nodes/ spelling; node header/source reads routed to x3d/nodes/.
- test_enums.py: #ifndef include guard assertion replaced with #pragma once
  + namespace x3d::core check to match the new gen_enums_header output.
- test_golden_smoke.py: golden and produced paths now resolve through
  x3d/core/ (X3Dtypes.hpp) or x3d/nodes/ (Box.hpp); write_types_header
  targets x3d/core/; generate_cpp_bindings called with namespace="x3d::nodes"
  to match the committed golden.
- test_version.py: synthetic-4.1 tests write core headers to x3d/core/,
  read QuantumWidget.hpp from x3d/nodes/, and read X3Denums.hpp from x3d/core/.
@delta9000 delta9000 merged commit 156bd49 into main Jun 27, 2026
13 of 14 checks passed
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.

1 participant