Skip to content

[AAASM-4800] ✅ (test): Fail-open conformance matrix across adapters × scenarios × modes#276

Merged
Chisanan232 merged 2 commits into
masterfrom
v0.0.1/AAASM-4800/failopen_conformance
Jul 17, 2026
Merged

[AAASM-4800] ✅ (test): Fail-open conformance matrix across adapters × scenarios × modes#276
Chisanan232 merged 2 commits into
masterfrom
v0.0.1/AAASM-4800/failopen_conformance

Conversation

@Chisanan232

@Chisanan232 Chisanan232 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a parametrized fail-open CONFORMANCE test — every governing adapter × 8 fault scenarios × 4 enforcement modes — backed by an adapter-driver registry, so a new or regressed adapter cannot ship ungoverned. This is the systemic fix that ends the per-round fail-open whack-a-mole (openai_agents AAASM-4734 → AAASM-4782, langchain AAASM-4790): instead of one bespoke regression test each time a single adapter is caught failing open, all 11 governing adapters are driven through the same faults under the same postures.

How it works. Each adapter has a driver that builds a fake framework tool whose real body flips a ran flag, invokes the adapter's real governance wrapper (_apply_* / callback helper) against a fake interceptor whose behaviour is set per scenario, and reports whether the underlying tool actually ran.

Invariant asserted. Under an enforce posture (explicit enforce and the None/omitted default — resolved via the production _local_posture_is_enforce, pinning that omitted → enforce), every fault (S1–S5) and every deny (S6–S7) blocks the tool; only the explicit-allow control (S8) runs. Under the observe / disabled dry-run postures the faults fail open by design (tool runs), while an authoritative deny still blocks — so the modes are pinned in both directions.

Scenarios: S1 gateway-unreachable (no verdict), S2 governance/transport error, S3 malformed decision, S4 missing check method, S5 pending-approval fault, S6 deny + deny-audit raises, S7 explicit deny, S8 explicit allow.

Anti-whack-a-mole guard. A completeness test enumerates the adapter packages on disk and fails if any lacks a registered driver or a justified exemption (langgraph — lineage-only, no pre-exec tool gate; _shared — shared helper, not a framework adapter). A brand-new adapter package therefore fails CI until it gets a driver.

Type of Change

  • ✅ Tests

Breaking Changes

  • No

Related Issues

Testing

  • Unit tests added (test/unit/adapters/test_failopen_conformance.py, harness in failopen_conformance.py)

Local run of the new file only: 361 passed (352 matrix cells + completeness/disjoint guards + 6 named regression cells). ruff check, ruff format, and mypy all clean on the new files. Wired into CI by placement — ci.yaml runs test/**/*.py.

Regression guards confirmed to PASS on this base (both fixes are merged to master) and confirmed non-vacuous: reintroducing the AAASM-4782 audit-guard bug makes the observe cell report ran=True, which fails the guard.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • All tests passing

Fault-injection harness + DRIVERS registry that drives each adapter's real
governance wrapper against a fake interceptor per scenario, reporting whether
the underlying tool ran. Refs AAASM-4800.
…s × modes

Parametrize every governing adapter × 8 fault scenarios × 4 enforcement modes,
asserting no adapter fails open under enforce/None and pinning the observe/
disabled dry-run postures. A completeness test fails if a new/regressed adapter
package ships without a driver or a justified exemption (langgraph, _shared).
Named guards pin the openai_agents (AAASM-4782/4734) and langchain (AAASM-4790)
regressions. Closes AAASM-4800.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code — PR review

Scope (AAASM-4800): systemic fail-open conformance — parametrized matrix (11 adapter drivers × 8 scenarios × 4 modes) + adapter-driver registry with a completeness guard.

  1. CI — ✅ real jobs green: unit-test, integration-test, and the LangChain contract test all SUCCESS on 3.13; CodeQL pass. Only sonarcloud_finish is still aggregating (acceptance-tier, waived). 361 local assertions pass.
  2. Scope — ✅ complete: DRIVERS (11) drives each adapter's real wrapper against per-scenario fake interceptors with a ran flag; langgraph (lineage-only) + _shared documented exemptions; completeness test enumerates adapter packages on disk so a NEW adapter without a driver fails CI. Mode resolution uses the production _local_posture_is_enforce (pins omitted/None → enforce). Regression guards for 4782/4734 (proven non-vacuous — reintroducing the audit-guard bug flips a cell) and 4790.
  3. Side effects — none. Test-only; no agent_assembly/ behavior changed.
  4. FE — n/a.

Verdict: ready to merge pending Pioneer approval. This is the anti-whack-a-mole guard that ends the per-round fail-open findings.

@Chisanan232
Chisanan232 merged commit bd1589a into master Jul 17, 2026
22 checks passed
@Chisanan232
Chisanan232 deleted the v0.0.1/AAASM-4800/failopen_conformance branch July 17, 2026 13:46
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