Parent
- Program: ENG2 — GoudEngine v2 Rebuild (see the pinned master tracking issue)
- Phase / Milestone: Phase 9 — Authoring, Platforms, Examples & Polish (
eng2-p9-authoring)
- Batch / Group: Batch 9.2 — Examples, docs, agent configs (4 groups, parallel), Group A
- Runbook spec:
docs/src/runbook/phases/phase-9.md (committed with the roadmap)
Summary
Add compiled Rust examples under the engine crate — today there are zero .rs examples anywhere in the engine, so the v2 API has no first-party Rust-native usage sample.
Architecture Context
Layer: Layer 4/5 — examples live at the crate's examples/ convention (Cargo [[example]]), exercising the engine's own public Rust API/SDK surface. (see tools/lint_layers.rs — downward-only deps).
Modules/types touched:
goud_engine/examples/ (new — standard Cargo examples directory; currently does not contain any .rs files).
- Rust SDK (
sdks/rust/, ENG2-P1-08) — examples should exercise the real Rust SDK surface once it exists, not internal engine types directly, matching the thin-wrapper principle.
Boundary constraints (only those that apply):
- Examples MUST use the public SDK/engine API surface, never reach into internal modules across layers (
.agents/rules/examples.md: "example games use the SDK API, never internal engine types" — the same rule applies to compiled Rust examples).
Pattern to follow: examples/rust/ conventions already documented in .agents/rules/examples.md; mirror the existing SDK-example structure used by other languages, adapted to Cargo's native examples/ mechanism.
Scope
Acceptance Criteria
Breaking Change & Throne Follow-up
None — additive.
Blocked By
None.
Files Likely Touched
- New/Modified/Generated:
goud_engine/examples/*.rs (new), CI workflow update to build/run examples, .agents/rules/examples.md (documentation update)
Agent Notes
- Confirmed: the engine crate currently has zero
.rs examples — this is a plain gap, not a broken/stale example set to fix. Verify this is still true at implementation time per the discovery-first rule before assuming the count.
- This issue blocks ENG2-P9-07 (the example-games refresh), since that issue's SDK-language example games should be able to point back at a working native Rust reference example for parity checks.
Verification
cargo check && cargo fmt --all -- --check && cargo clippy -- -D warnings
cargo test
./codegen.sh && git diff --exit-code
cargo build --examples
Parent
eng2-p9-authoring)docs/src/runbook/phases/phase-9.md(committed with the roadmap)Summary
Add compiled Rust examples under the engine crate — today there are zero
.rsexamples anywhere in the engine, so the v2 API has no first-party Rust-native usage sample.Architecture Context
Layer: Layer 4/5 — examples live at the crate's
examples/convention (Cargo[[example]]), exercising the engine's own public Rust API/SDK surface. (seetools/lint_layers.rs— downward-only deps).Modules/types touched:
goud_engine/examples/(new — standard Cargo examples directory; currently does not contain any.rsfiles).sdks/rust/, ENG2-P1-08) — examples should exercise the real Rust SDK surface once it exists, not internal engine types directly, matching the thin-wrapper principle.Boundary constraints (only those that apply):
.agents/rules/examples.md: "example games use the SDK API, never internal engine types" — the same rule applies to compiled Rust examples).Pattern to follow:
examples/rust/conventions already documented in.agents/rules/examples.md; mirror the existing SDK-example structure used by other languages, adapted to Cargo's nativeexamples/mechanism.Scope
cargo run --example <name>Rust example demonstrating core v2 API usage (context creation, entity spawn, basic render loop).cargo build --examples/cargo run --example).AGENTS.md/.agents/rules/examples.md.goud_engine/tests/spec/+ unit/isolation coverage for the new code paths..agents/rules/*ordocs/src/*.Acceptance Criteria
.rsexample exists and builds/runs viacargo run --examplein required CI (closing the current zero-.rs-examples gap).cargo check && cargo fmt --all -- --check && cargo clippy -- -D warningsclean;cargo testgreen;./codegen.sh && git diff --exit-code(drift gate)Breaking Change & Throne Follow-up
None — additive.
Blocked By
None.
Files Likely Touched
goud_engine/examples/*.rs(new), CI workflow update to build/run examples,.agents/rules/examples.md(documentation update)Agent Notes
.rsexamples — this is a plain gap, not a broken/stale example set to fix. Verify this is still true at implementation time per the discovery-first rule before assuming the count.Verification