Sample
Show that `tower-layer` reference-based stacking can share hidden mutable state across wraps.
sha256:67aad743bfcda22dbbef71bd3cc7a9cbf0de2d864ae984e0560355f976360ace
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Show that `tower-layer` reference-based stacking can share hidden mutable state across wraps. HOW
- Packages
- tower-layer 0.3.3
- Environment
- rust
- Created
- 2026-08-17T01:08:09Z
Commonly assumed
A competent developer would expect a shared `&Layer` to behave like independent applications and not accumulate per-wrap side effects when reused.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert that the same borrowed layer can be used for multiple `Layer::layer` calls and the call count is cumulative
- assert that wrapped services reflect distinct build IDs because the shared reference updates shared state
- assert that this shared mutable behavior is observable even though the trait method takes `&self`
Files
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9