Skip to content

test(posture): restore stance-claim enforcement lost when internal/gascity removed (ag-ddrb #posture-tests)#791

Merged
boshu2 merged 1 commit into
mainfrom
chore/ag-ddrb-posture-tests
Jun 6, 2026
Merged

test(posture): restore stance-claim enforcement lost when internal/gascity removed (ag-ddrb #posture-tests)#791
boshu2 merged 1 commit into
mainfrom
chore/ag-ddrb-posture-tests

Conversation

@boshu2
Copy link
Copy Markdown
Owner

@boshu2 boshu2 commented Jun 6, 2026

What

Adds cli/internal/posture/posture_test.go — the package had zero tests.

Why

internal/posture/posture.go is pure and deterministic but 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"

internal/gascity was deleted (ag-hfc, 3.1 teardown — confirmed in CLAUDE.md), so that enforcing test no longer exists. The AgentOps stance declaration has been unguarded since. TestAgentOpsStance here 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-range
  • Layer bit-position values (the shift-amount contract LayerSet depends on)
  • LayerSet NewLayerSet/Has/Union — idempotence, commutativity, empty-set identity
  • AllLayers / ExternalLayers exact membership ("Bead is universal")
  • Kind.String() — 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

No coverage-padding: every assertion checks exact behavior or a documented invariant.

Verification

go test ./internal/posture/ -cover  → ok  100.0% of statements (10 pass)
go vet ./internal/posture/          → clean
golangci-lint run ./internal/posture/ → 0 issues
gofmt -l                            → clean

Closes-scenario: ag-ddrb#posture-tests
Bounded-context: BC5-Runtime
Evidence: go test ./internal/posture/ -cover → 100.0%

…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)
@github-actions github-actions Bot added the cli label Jun 6, 2026
@boshu2 boshu2 merged commit a3457c0 into main Jun 6, 2026
16 checks passed
@boshu2 boshu2 deleted the chore/ag-ddrb-posture-tests branch June 6, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant