Skip to content

contract-stateless: a test-seal-gated module is test code (stacked on #996) - #1002

Draft
MattJackson wants to merge 3 commits into
predevfrom
lane-cabi-test-seal-stateless
Draft

MattJackson wants to merge 3 commits into
predevfrom
lane-cabi-test-seal-stateless

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

CONTRACT-ABI lane, item 3 (contract statics, part 3). STACKED on #996, which is stacked on #994, because all three strike adjacent rows of qa/contract-stateless.toml. It stays DRAFT until #996 lands (rule 19).

Coordinator ruling 2026-10-14 (ruling 1, option (a)): test-seal-gated modules count as test code in contract-stateless, because test_seal_is_dev_only.rs proves it by construction. Add a RED that the same static outside test-seal still fails the gate.

THE DESIGN A.8 (docs/design/BUSBAR-1.6.0.md l.3701): busbar-contract has no static, OnceLock, LazyLock or thread_local outside tests. testkit is declared at crates/busbar-contract/src/lib.rs:136 as #[cfg(any(test, feature = "test-seal"))] pub mod testkit;, and tests/test_seal_is_dev_only.rs refuses any non-dev edge that enables test-seal. Its log double's serialization statics (warn_capture.rs ONCE, GATE, OnceLock) are therefore never shipped state. The gate read them as production because it filters #[cfg(test)] scopes only inside a file and never looked at the parent module's declaration.

  • xtask/src/gates/contract_stateless.rs: test_seal_modules reads every contract file for a mod declared directly under #[cfg(any(test, feature = "test-seal"))] or #[cfg(feature = "test-seal")], and the scan skips those modules' files (<m>.rs, <m>/…). Nothing else changes: any other gate, or none, is still scanned.
  • qa/contract-stateless.toml strikes the three testkit/warn_capture.rs rows: 40 → 37 on top of contract: delete the write-only scope-kind registry static (stacked on #994) #996.

RED (selftest), with the same planted static PLANTED_SEAL_STATE in a planted src/planted_seal/mod.rs:

  • declared in lib.rs behind #[cfg(any(test, feature = "test-seal"))]: GREEN;
  • declared with no gate: RED, naming the file and the static;
  • declared behind #[cfg(feature = "planted-feature")]: RED, naming the file and the static.

Shared file: #944 (this lane) also edits contract_stateless.rs in disjoint hunks (a const after CONTRACT_SRC, and selftest cases after the #[cfg(test)] green case). merge-tree is clean against #944 and #942.

No dependency change.

…oves out of busbar-contract

THE DESIGN A.8 "Statelessness" (BUSBAR-1.6.0.md l.3701) and C.2 (l.3893: "Contract statics
(codec.rs, records.rs:94, ids.rs:330): deleted, with host tables used instead"). The image's one
vocabulary is process state, so it is the host's: busbar_kernel::vocabulary holds
Registration, MAX_VOCABULARY, VOCABULARY and FROZEN, moved verbatim but for the docs that
reasoned about a plugin reaching the interner (a plugin's closure is the contract, which now
holds none of it). Callers in the composition root and busbar-llm name busbar_kernel::Registration;
plane crates' docs name the host's interner in prose. qa/contract-stateless.toml strikes the
three ids.rs rows (LazyLock, FROZEN, VOCABULARY) this drains.

RED: the vocabulary tests move with it (busbar-kernel tests/vocabulary_{cap,freeze,resolve,intern}.rs),
naming busbar_kernel::Registration; the contract-stateless ledger no longer forgives ids.rs.
…ire carries every kind as data

THE DESIGN A.8 "Statelessness" (BUSBAR-1.6.0.md l.3701) and C.2 (l.3893, "records.rs:94 ...
deleted"). records::scope_kinds::REGISTERED was write-only: since 1.6.0 SDK-SCOPEKINDS the wire
serializes every kind (registered or not) under its own allowed_{kind}s field, and nothing in the
workspace read is_registered but its own test. The registry, register/is_registered and
register_scope_kind go; the kernel's plane fold stops registering scope kinds; the store
conformance fold's scope-kind round trip runs as before over the key's own data.
qa/contract-stateless.toml strikes the records.rs REGISTERED row this drains.
…eature is test code

Coordinator ruling 2026-10-14 (ruling 1 (a)): the gate counts busbar-contract state "outside test
code" (BUSBAR-1.6.0.md l.3701), and a module its parent declares under
construction: tests/test_seal_is_dev_only.rs refuses every non-dev edge that enables the feature.
The scan skips such a module's files; qa/contract-stateless.toml strikes the three testkit
warn_capture rows (OnceLock, GATE, ONCE) that were never shipped state.

RED (selftest): the same planted static in a module declared with no gate, or behind another
feature, is RED naming it; behind the test-seal gate it is green.

This branch has not been deployed

No deployments
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