ADR 0007: Workspace Subcrates Compiled Into cougr-core
Status
Accepted
Context
Cougr is adding three competitive layers (ZK circuit builders, session UX, game
testing sandbox). They need compile-time isolation without publishing separate
crates.io packages, so download metrics stay unified under cougr-core.
Decision
-
Add a Cargo workspace with three internal members under
internal/:cougr-core-circuitscougr-core-sessioncougr-core-test
-
Each internal member sets
publish = false. -
Each layer's implementation lives in
src/{circuits,session,test}/inner.rs. The public modulesinclude!that file; internal workspace members point their[lib] pathat the sameinner.rsfor isolatedcargo check -pruns. This avoids:- circular dependencies (session needs
authfrom the same crate) cargo publishfailures on unpublished path deps- missing files in the published tarball
- circular dependencies (session needs
-
Public API:
cougr_core::circuits- always availablecougr_core::session- always availablecougr_core::test-testutilsfeature only
-
The test sandbox uses
no_std+alloc, notstd. It runs in Sorobantestutilsenvironments the same way contract tests do today.
Consequences
- One
cargo add cougr-corefor all capabilities - Internal folders can still be checked with
cargo check -p cougr-core-session cargo publishshipsinternal/**sources inside thecougr-coretarball- Feature
testutilskeeps sandbox code out of contract WASM builds