@@ -235,7 +235,8 @@ jobs:
235235 # removed, so the job that executes repository-owned test code no longer
236236 # carries an OIDC capability it cannot use. Coverage floors below remain
237237 # the blocking gates. Reintroduce upload in a separate job consuming a
238- # coverage.xml artifact if external reporting is ever enabled.
238+ # .artifacts/coverage/coverage.xml artifact if external reporting is ever
239+ # enabled.
239240 permissions :
240241 contents : read
241242 steps :
@@ -248,6 +249,8 @@ jobs:
248249 - name : Install dependencies
249250 run : |
250251 bash scripts/ci_sync.sh test-integrations
252+ - name : Verify SDK/integrations joint installability
253+ run : python scripts/check_cross_package_install.py
251254 - name : Prepare pytest temp directory
252255 run : mkdir -p .tmp
253256 - name : Run unit and property tests with coverage
@@ -256,9 +259,10 @@ jobs:
256259 # --cov-branch turns the floor into a combined line+branch metric — local baseline
257260 # 2026-05-25 is 62% (7716 lines / 2010 branches measured on HEAD `22b1be9`), so the
258261 # 60% gate stays passing with a 2pp cushion. Raise the gate once that cushion grows.
259- python -m pytest tests/unit/ tests/property/ -v --tb=short --cov=src/agentflow_runtime --cov=sdk --cov-branch --cov-report=xml --cov-report=term-missing --cov-fail-under=60
262+ mkdir -p .artifacts/coverage
263+ python -m pytest tests/unit/ tests/property/ -v --tb=short --cov=src/agentflow_runtime --cov=sdk --cov-branch --cov-report=xml:.artifacts/coverage/coverage.xml --cov-report=term-missing --cov-fail-under=60
260264 - name : Enforce changed-code coverage
261- run : diff-cover coverage.xml --compare-branch=origin/main --fail-under=80
265+ run : diff-cover .artifacts/coverage/ coverage.xml --compare-branch=origin/main --fail-under=80
262266 - name : Run quality validators coverage gate
263267 run : |
264268 python -m pytest tests/unit/test_validators.py -v --tb=short --cov=agentflow_runtime.quality.validators --cov-report=term-missing --cov-fail-under=90
@@ -296,27 +300,57 @@ jobs:
296300 run : |
297301 # Security-critical auth manager (key match/verify, tenant isolation,
298302 # rate-limit/failed-auth windows, rotation grace) and a mutmut target;
299- # the gate runs its dedicated unit files. Module coverage is 94 % so the
303+ # the gate runs its dedicated unit files. Module coverage is 97 % so the
300304 # 90% gate keeps a cushion; the remaining gap is the platform-divergent
301- # SIGHUP handler and bcrypt rotation paths the integration/e2e auth
302- # suites cover.
305+ # SIGHUP handler, the two read-only-store branches load() reaches only
306+ # when the store flips between probe and write, and the thin
307+ # KeyRotator/usage-table delegations the integration/e2e auth suites
308+ # cover.
309+ #
310+ # This list IS the gate: a dedicated unit file that is not named here
311+ # buys the module nothing. test_key_store_readonly.py arrived with the
312+ # read-only Secret mount work (F-02 B, 2026-08-23) and was never added,
313+ # which by itself took the module from 94% to 82% -- unnoticed, because
314+ # an earlier step in this job was failing and this one never ran.
303315 #
304316 # NOTE: unlike the other per-module gates this uses `coverage run` +
305317 # `coverage report --include`, NOT `pytest --cov=<module>`. The auth
306318 # manager pulls in duckdb (usage table), and pytest-cov's source
307319 # instrumentation of a duckdb-importing module trips duckdb's lazy
308320 # `_duckdb._sqltypes` import at COLLECTION time, both locally and on CI
309321 # runners. `coverage run` imports duckdb normally and avoids the break.
310- python -m coverage run -m pytest tests/unit/test_auth.py tests/unit/test_auth_manager_pure_logic.py tests/unit/test_auth_manager_memory_bounds.py tests/unit/test_auth_hashed_key_guidance.py tests/unit/test_auth_argon2_lookup.py -p no:schemathesis
322+ python -m coverage run -m pytest \
323+ tests/unit/test_auth.py \
324+ tests/unit/test_auth_manager_pure_logic.py \
325+ tests/unit/test_auth_manager_memory_bounds.py \
326+ tests/unit/test_auth_hashed_key_guidance.py \
327+ tests/unit/test_auth_argon2_lookup.py \
328+ tests/unit/test_auth_key_store_probe.py \
329+ tests/unit/test_auth_manager_key_resolution.py \
330+ tests/unit/test_key_store_readonly.py \
331+ -p no:schemathesis
311332 python -m coverage report --include="*/serving/api/auth/manager.py" --show-missing --fail-under=90
312333 - name : Run key rotation coverage gate
313334 run : |
314335 # Security-critical key-rotation lifecycle (create/rotate/revoke,
315336 # grace-period scheduling, rotation status) and a mutmut target. Like
316337 # the auth manager gate it pulls in duckdb, so it uses coverage run +
317338 # coverage report --include (not pytest --cov) to avoid the
318- # duckdb _duckdb._sqltypes collection break. Module coverage is 93%.
319- python -m coverage run -m pytest tests/unit/test_key_rotation.py -p no:schemathesis
339+ # duckdb _duckdb._sqltypes collection break.
340+ #
341+ # Module coverage is 100%. It was 89.6% on test_key_rotation.py alone
342+ # -- passing only because coverage rounds to 90 before comparing, so
343+ # one more defensive line would have turned this gate red without
344+ # anyone changing its behaviour. test_key_rotation.py pins the happy
345+ # lifecycle; the revoke_and_failures file adds what it never reached:
346+ # revoke_key_by_id (the only revoke path the admin router calls since
347+ # F-02 A), the read-only vs merely-broken key-store split, and the
348+ # grace-period cleanup failure that runs on a timer thread with no
349+ # caller left to see it.
350+ python -m coverage run -m pytest \
351+ tests/unit/test_key_rotation.py \
352+ tests/unit/test_key_rotation_revoke_and_failures.py \
353+ -p no:schemathesis
320354 python -m coverage report --include="*/serving/api/auth/key_rotation.py" --show-missing --fail-under=90
321355 - name : Run outbox coverage gate
322356 run : |
@@ -411,6 +445,38 @@ jobs:
411445 CLICKHOUSE_LIVE_DATABASE : agentflow
412446 AGENTFLOW_TEST_PG_DSN : postgresql://agentflow:agentflow@localhost:5432/agentflow
413447 run : pytest tests/integration/ -v --tb=short
448+ - name : Control-plane critical-set coverage gate (audit F-12)
449+ # The repository floor is one number over hundreds of files, so a
450+ # surface can sit at 21% while the aggregate reads 78%. These adapters
451+ # carry the lease / SKIP LOCKED / one-transaction semantics whose
452+ # regressions are silent in production, so they get their own floors
453+ # (scripts/check_control_plane_coverage.py holds the table).
454+ #
455+ # Unit and live coverage go into ONE data file on purpose: most
456+ # branches in these modules only execute against a real server, so a
457+ # unit-only number measures the absence of a database rather than the
458+ # absence of tests. -p no:cov keeps pytest-cov from double-instrumenting
459+ # the `coverage run` (the auth/outbox gate pattern).
460+ env :
461+ AGENTFLOW_TEST_PG_DSN : postgresql://agentflow:agentflow@localhost:5432/agentflow
462+ run : |
463+ coverage erase
464+ coverage run --append -m pytest -q -p no:cov tests/unit/test_control_plane_store.py tests/unit/test_control_plane_capabilities.py tests/unit/test_postgres_enqueue_lease_contract.py tests/unit/test_query_analytics_retention.py tests/unit/test_analytics_middleware.py tests/unit/test_embedded_usage_analytics.py tests/unit/test_audit_publisher.py tests/unit/test_usage_db_connection_reuse.py tests/unit/test_usage_write_off_request_path.py tests/unit/test_node_ingest.py
465+ coverage run --append -m pytest -q -p no:cov tests/integration/test_control_plane_postgres_live.py tests/integration/test_exceptions_inbox.py tests/integration/test_stuck_orders.py tests/integration/test_tenant_isolation.py tests/integration/test_node_topology.py
466+ mkdir -p .artifacts/coverage
467+ coverage xml -o .artifacts/coverage/coverage-control-plane.xml --include="*/serving/control_plane/*,*/routers/ops.py,*/semantic_layer/reconciliation.py,*/serving/node/ingest.py"
468+ python scripts/check_control_plane_coverage.py
469+ - name : Publish control-plane coverage
470+ # Separate from the repository-wide report on purpose (audit F-12 asks
471+ # for integration coverage to be published without folding it into the
472+ # general floor, which would raise the aggregate without covering
473+ # anything new).
474+ if : always()
475+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
476+ with :
477+ name : coverage-control-plane
478+ path : .artifacts/coverage/coverage-control-plane.xml
479+ if-no-files-found : warn
414480
415481 helm-schema-live :
416482 runs-on : ubuntu-latest
@@ -424,6 +490,10 @@ jobs:
424490 - name : Install dependencies (frozen lock profile)
425491 run : bash scripts/ci_sync.sh dev-tools
426492 - uses : azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
493+ with :
494+ version : v3.16.3
495+ - name : Report Helm version
496+ run : helm version --short
427497 - uses : helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
428498 with :
429499 install_only : true
@@ -459,11 +529,14 @@ jobs:
459529 import re
460530 from pathlib import Path
461531
462- report_path = Path("docs /benchmark.md")
532+ report_path = Path(".artifacts/benchmark /benchmark.md")
463533 report = report_path.read_text(encoding="utf-8")
464534 lines = [line.strip() for line in report.splitlines() if line.startswith("|")]
465535 if len(lines) < 3:
466- raise SystemExit("Benchmark results table not found in docs/benchmark.md")
536+ raise SystemExit(
537+ "Benchmark results table not found in "
538+ ".artifacts/benchmark/benchmark.md"
539+ )
467540
468541 generated_at_match = re.search(r"Generated: `([^`]+)`", report)
469542 endpoints = {}
@@ -502,12 +575,12 @@ jobs:
502575
503576 terraform-validate :
504577 runs-on : ubuntu-latest
505- timeout-minutes : 10
578+ timeout-minutes : 20
506579 steps :
507580 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
508581 - uses : hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
509582 with :
510- terraform_version : " 1.8.0 "
583+ terraform_version : " 1.15.4 "
511584 - name : Terraform fmt check
512585 run : terraform fmt -check -recursive infrastructure/terraform/
513586 - name : Terraform init
@@ -518,6 +591,18 @@ jobs:
518591 run : |
519592 cd infrastructure/terraform
520593 terraform validate
594+ # h1: hashes in the lock file carry no platform label. This step is the
595+ # guard that linux_amd64 (ubuntu-latest) is actually covered; it uses the
596+ # same three-platform command the module README documents (re-run
597+ # 2026-09-05: no lock rewrite). Three provider zips (~0.7 GB) plus
598+ # terraform init is why this job's timeout-minutes is 20, not 10.
599+ # It has not been observed on a GitHub runner until the owner pushes.
600+ - name : Provider lock covers linux_amd64
601+ run : |
602+ cd infrastructure/terraform
603+ terraform providers lock -platform=linux_amd64 -platform=darwin_arm64 -platform=windows_amd64
604+ git ls-files --error-unmatch .terraform.lock.hcl
605+ git diff --exit-code .terraform.lock.hcl
521606
522607 sdk-ts :
523608 # Audit P1-5: typecheck/tests/build for the TypeScript SDK previously ran
0 commit comments