test(posture): restore stance-claim enforcement lost when internal/gascity removed (ag-ddrb #posture-tests)#791
Merged
Merged
Conversation
…scity removed (ag-ddrb #posture-tests)
internal/posture/posture.go (pure, deterministic, 106 LOC) had zero tests.
Its doc comment promises the AgentOps stance claim "must either update this
value or fail the integration test in cli/internal/gascity/bridge_test.go" —
but internal/gascity was deleted (ag-hfc, 3.1 teardown), so that guard is gone.
Adds behavioral table-driven tests (100% statement coverage):
- Layer.String() for all six layers + sentinel/out-of-range
- Layer bit-position values (shift-amount contract)
- LayerSet NewLayerSet/Has/Union (idempotence, commutativity, identity)
- AllLayers / ExternalLayers exact membership ("Bead is universal")
- Kind.String() for all families + out-of-range
- AgentOps stance invariant: Kind=Distribution, owns exactly
{Role,Skill,Ledger,Distribution}, does NOT own Loop, Bead is external
- owned ⊆ AllLayers structural invariant
TestAgentOpsStance is the replacement regression guard for the deleted
bridge_test.go: a silent edit to the AgentOps stance now fails CI.
Closes-scenario: ag-ddrb#posture-tests
Bounded-context: BC5-Runtime
Evidence: go test ./internal/posture/ -cover → 100.0% (10 tests pass)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
cli/internal/posture/posture_test.go— the package had zero tests.Why
internal/posture/posture.gois pure and deterministic but its doc comment promises:internal/gascitywas deleted (ag-hfc, 3.1 teardown — confirmed in CLAUDE.md), so that enforcing test no longer exists. TheAgentOpsstance declaration has been unguarded since.TestAgentOpsStancehere is the replacement regression guard: a silent edit to the stance now fails CI.Coverage
Behavioral, table-driven, 100.0% statement coverage (10 tests):
Layer.String()— all six + sentinel/out-of-rangeLayerSetdepends on)LayerSetNewLayerSet/Has/Union— idempotence, commutativity, empty-set identityAllLayers/ExternalLayersexact membership ("Bead is universal")Kind.String()— all families + out-of-rangeAgentOpsstance invariant:Kind=Distribution, owns exactly{Role,Skill,Ledger,Distribution}, does not ownLoop,Beadis externalAllLayersstructural invariantNo coverage-padding: every assertion checks exact behavior or a documented invariant.
Verification
Closes-scenario: ag-ddrb#posture-tests
Bounded-context: BC5-Runtime
Evidence: go test ./internal/posture/ -cover → 100.0%