Conversation
Implements the Sweettest integration suite for NondominiumIdentity (NDO Layer 0) as specified in issue #76. Covers 8 test scenarios across creation, retrieval, lifecycle progression, hibernation, deprecation, discovery anchors, and validation. ## New files - dnas/nondominium/tests/src/nondominium/mod.rs — module grouping for NDO test modules - dnas/nondominium/tests/src/nondominium/ndo_layer0/mod.rs — 8 integration tests ## Modified files - dnas/nondominium/tests/Cargo.toml — add [[test]] nondominium binary - dnas/nondominium/tests/src/lib.rs — add pub mod nondominium ## Test coverage 1. ndo_create_and_get — creation and retrieval via stable action hash 2. ndo_lifecycle_forward_progression — monotonic Ideation→Specification→Development; verifies immutable fields unchanged after update (REQ-NDO-L0-04) 3. ndo_invalid_lifecycle_transitions — step-skipping and Hibernating self-loop rejected 4. ndo_hibernation_cycle — hibernation_origin set on suspend, cleared on resume 5. ndo_deprecated_requires_successor — coordinator pre-flight rejects missing hash 6. ndo_deprecation_with_successor — full Deprecated→EndOfLife path; tombstone guarantee 7. ndo_cross_agent_discovery — two agents, await_consistency, get_all_ndos / by_stage / get_my_ndos 8. ndo_lifecycle_anchor_moves_on_update — mutable stage anchor vs immutable nature/regime anchors ## Known limitations (TODOs in test file) - Direct mutation of immutable fields (name, property_regime, resource_nature) cannot be triggered through update_lifecycle_stage; requires a future test-only coordinator fn - Delete enforcement not testable without a delete_ndo coordinator function
… tests - TEST_COMMANDS.md: update heading from scaffold to primary, list 3 active [[test]] binaries (misc/person/nondominium), add --test nondominium commands - Testing_Infrastructure.md: update current-status sentence and Sweettest directory tree to include person/ and nondominium/ndo_layer0/ modules Addresses documentation gap flagged in PR #86 review.
| @@ -1 +1,2 @@ | |||
| pub mod common; | |||
| pub mod nondominium; | |||
There was a problem hiding this comment.
🔴 pub mod nondominium in lib.rs re-introduces a previously fixed bug causing test binary self-import
Adding pub mod nondominium; to dnas/nondominium/tests/src/lib.rs re-introduces the exact same problem that was already identified and fixed for the person module in commit bd059b0 ("fix(sweettest): remove person from lib.rs — test binaries are standalone"). That commit's message explicitly states: "Adding pub mod person to lib.rs caused the lib to try to self-import, which fails. Only common/ belongs in lib.rs." The nondominium module is a [[test]] binary target (dnas/nondominium/tests/Cargo.toml:31-33), not a library module. Declaring it in lib.rs causes the library crate to include the test module, which imports back from the library via use nondominium_sweettest::common::*; (dnas/nondominium/tests/src/nondominium/ndo_layer0/mod.rs:20), creating the same self-import / double-compilation issue. At best this causes the 8 NDO tests to run twice under cargo test -p nondominium_sweettest; at worst it causes compilation failures as seen with the person module.
| pub mod nondominium; |
Was this helpful? React with 👍 or 👎 to provide feedback.
Intent
Implements the Sweettest integration suite for
NondominiumIdentity(NDO Layer 0) as specified in issue #76. The NDO Layer 0 implementation is feature-complete (PRs #80, #82, #84 merged) and this PR adds the missing test coverage.Changes
New files:
dnas/nondominium/tests/src/nondominium/mod.rs— module grouping for all NDO-related test modules (future ndo_layer1, ndo_layer2 go here)dnas/nondominium/tests/src/nondominium/ndo_layer0/mod.rs— 8 integration tests with local mirror typesModified files:
dnas/nondominium/tests/Cargo.toml— adds[[test]] name = "nondominium"binarydnas/nondominium/tests/src/lib.rs— addspub mod nondominiumTest coverage (8 scenarios)
ndo_create_and_getget_ndoresolves update chainndo_lifecycle_forward_progressionndo_invalid_lifecycle_transitionsndo_hibernation_cyclehibernation_originset on suspend, cleared on resumendo_deprecated_requires_successorsuccessor_ndo_hash(REQ-NDO-LC-06)ndo_deprecation_with_successorndo_cross_agent_discoveryawait_consistency,get_all_ndos/get_ndos_by_lifecycle_stage/get_my_ndosndo_lifecycle_anchor_moves_on_updateDecisions
zome_resource_integrity. Follows the pattern established inperson/mod.rs.call_falliblefor validation tests: used instead of#[should_panic]to verify specific error conditions cleanly.// TODO(#76-immutability).nondominium/module grouping: NDO Layer 1 and Layer 2 tests will be added asnondominium/ndo_layer1/mod.rsetc., all under the samenondominiumtest binary.How to test
nix develop bun run build:happ CARGO_TARGET_DIR=target/native-tests cargo test --test nondominiumRun a single scenario:
CARGO_TARGET_DIR=target/native-tests cargo test --test nondominium ndo_cross_agent_discoveryRelated
Closes #76
Documentation
documentation/TEST_COMMANDS.md: refreshed section heading and description to reflect the three active Sweettest binaries; addednondominiumtest target with NDO Layer 0 run commands.documentation/Testing_Infrastructure.md: updated "Current status" and Sweettest directory tree to includeperson/andnondominium/ndo_layer0/modules.