diff --git a/pmoves/configs/pytest_ratchet/_known_failures.yaml b/pmoves/configs/pytest_ratchet/_known_failures.yaml index 3439bbd3ca..b9616b1a19 100644 --- a/pmoves/configs/pytest_ratchet/_known_failures.yaml +++ b/pmoves/configs/pytest_ratchet/_known_failures.yaml @@ -14,6 +14,24 @@ # goal; adding one should require saying why in the PR. A fixed test that is # still listed here fails the gate as a STALE entry, so the count only goes down. # +# 2026-11-25 -- 151 -> 167 (+17, -1). Chunk `pmoves [4]` of the gate had never +# produced a test result: pmoves/tools/test_all_tts_engines.py (a CLI whose name +# matches test_*.py) called sys.exit(1) at import, pytest aborted the session +# with INTERNALERROR during collection and still wrote a report holding only +# what it had collected so far, and the ratchet took that partial report as +# complete. The abort itself was the one entry `ERROR|pytest|internal` (pytest's +# junit record of an internal error); every test the chunk should have measured +# read as passing. When a new test file shifted the chunk boundary, 11 baselined +# test_cache entries moved into the aborted chunk and the gate called them STALE. +# #3517 makes the CLI skip under pytest and teaches the ratchet that exit 3 is a +# lost chunk (isolate per file, record the aborting file), so the chunk ran for +# the first time and surfaced 17 real failures: 9 FAIL in semantic-cache +# test_cipher_layer and 8 ERROR in test_proxy, the same undefined +# `pmoves.services.semantic_cache` alias as the 11 test_cache entries (#3529). +# Recorded from that CI run's log (run 45567996955); the stale +# `ERROR|pytest|internal` dropped. The baseline recorded the silence again; +# this is what it contained. +# # 2026-08-16 — 182 -> 125. Adding `python-multipart` to # .github/requirements-tests.txt fixed 57 entries at once. flute-gateway/main.py # declares a fastapi Form() endpoint, and FastAPI raises at route-definition time @@ -148,7 +166,6 @@ known_failures: - "ERROR|docs.PMOVES.AI PLANS.PMOVES.yt.test_integration|test_youtube_info" - "ERROR|docs.PMOVES.AI PLANS.PMOVES.yt.test_n8n_workflow|test_workflow" - "ERROR|pmoves/tests/integration/test_voice_relay_e2e.py|" - - "ERROR|pytest|internal" - "ERROR|services.channel-monitor.tests.test_monitor|" - "ERROR|services.clap-embed.tests.test_app|" - "ERROR|services.clap-embed.tests.test_embedder|" @@ -181,6 +198,14 @@ known_failures: - "ERROR|services.semantic-cache.tests.test_cache.TestCacheStore|test_store_failure_is_non_blocking" - "ERROR|services.semantic-cache.tests.test_cache.TestCacheStore|test_store_new_entry" - "ERROR|services.semantic-cache.tests.test_cache.TestCacheTTL|test_ttl_expired_entries_not_returned" + - "ERROR|services.semantic-cache.tests.test_proxy.TestHealthEndpoint|test_health_endpoint" + - "ERROR|services.semantic-cache.tests.test_proxy.TestMetricsEndpoint|test_metrics_endpoint" + - "ERROR|services.semantic-cache.tests.test_proxy.TestPassthroughNonCacheable|test_passthrough_more_than_three_messages" + - "ERROR|services.semantic-cache.tests.test_proxy.TestPassthroughNonCacheable|test_passthrough_tools" + - "ERROR|services.semantic-cache.tests.test_proxy.TestPassthroughNonCacheable|test_passthrough_high_temperature" + - "ERROR|services.semantic-cache.tests.test_proxy.TestCacheHit|test_cache_hit_cipher_l0" + - "ERROR|services.semantic-cache.tests.test_proxy.TestCacheHit|test_cache_hit_pgvector_l1" + - "ERROR|services.semantic-cache.tests.test_proxy.TestCacheMissForward|test_cache_miss_forwards_to_tensorzero" - "ERROR|services.sso-auth.tests.test_jwt_verify|" - "ERROR|services.sso-auth.tests.test_login|" - "ERROR|services.sso-auth.tests.test_oidc|" @@ -205,6 +230,15 @@ known_failures: - "FAIL|services.deepresearch.tests.test_parsing|test_prepare_result_normalises_sources[sources1-expected_urls1]" - "FAIL|services.nats_event_bus.tests.test_app|test_read_events_limit_is_respected" - "FAIL|services.nats_event_bus.tests.test_app|test_subscriber_disabled_when_nats_url_empty" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherSearch|test_search_hit" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherSearch|test_search_miss" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherSearch|test_search_disabled" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherSearch|test_search_http_error_fail_open" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherStore|test_store" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherStore|test_store_failure_is_non_blocking" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherStore|test_store_network_exception_fail_open" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherLifecycle|test_init" + - "FAIL|services.semantic-cache.tests.test_cipher_layer.TestCipherLifecycle|test_close" - "FAIL|tests.a2ui.test_bridge.TestMetricsEndpoint|test_metrics_returns_prometheus_format" - "FAIL|tests.fresh_start.test_chit_integration.TestCHITManifestV2|test_manifest_entries_have_tier" - "FAIL|tests.fresh_start.test_env_layout.TestCHITManifestV2|test_manifest_v2_entries_have_tier" diff --git a/pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md b/pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md index f9e20a3b1f..f698b4c834 100644 --- a/pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md +++ b/pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md @@ -3675,6 +3675,9 @@ VILLAGE RULE: delivery delegated to a delivery-agent body; control and memory ar - `2026-11-22T03:25:38Z` NOTE `5090-CLAUDE` branch: `feat/pmoves-launcher-generator` · scope: Correction to the 2026-09-22T16:25:00Z RELEASE of feat/pmoves-launcher-generator (line 3112): on origin/main the PowerShell twin mavis_sdk_env.ps1 carries NO audit-log append and no bash/ps1 twin audit-log ratchet exists. Both were in branch commit 4c7316d653c but were deleted by merge 0a033c59b62 (2026-09-28, conflict resolution inside #3184, which merged 3 s before GitHub auto-marked #3149 MERGED). Bash audit log and pmoves/tools/mavis_sdk_audit.py did land. Restored by lane fix/mavis-sdk-ps1-audit-and-twin-ratchet-2026-11-21. - `2026-11-22T04:27:57Z` RELEASE `5090-CLAUDE` · scope: All-lanes closeout of 5090-CLAUDE after verifying delivered content on origin/main (not PR state). Delivered via merged PRs: docs/5090-runbook-surfaces-2026-11-06 (#3462), fix/fork-sync-utf8-decode-and-pipecat-provenance (#3429), fix/mcp-inventory-endpoint-ratchet (#3428), fix/ratchet-upstream-matrix-and-shim-origin (#3427), docs/cipher-capacity-profiles (#3355), docs/overlay-anti-pattern-reviewer-gate (#3347), fix/cipher-mcp-streamable-roster (#3339), feat/test-ratchet-kilo-minimax (#3095), feat/pmoves-cipher-cli-and-mcp (#3093), fix/mavis-sdk-ps1-audit-and-twin-ratchet-2026-11-21 (#3513, merge 0d981049ddb). Mavis SDK lanes: feat/pmoves-mavis-sdk-env (two rows) and feat/pmoves-launcher-env-parity-rerun landed through #3092 and #3149 under feat/pmoves-launcher-generator; feat/mavis-launcher-parity-crush and feat/mavis-sdk-audit-log landed partially through #3149 and were completed by #3513, which restored the PowerShell audit append and bash/ps1 twin ratchet dropped by merge 0a033c59b62, and fixed the restored block so it writes a line under PowerShell 5.1 and 7 (format-string braces, -AsUTC), with a behavioural test. See the NOTE correcting line 3112. CHIT trail unsigned on this host. - `2026-11-22T05:19:01Z` NOTE `5090-CLAUDE` · scope: ACK for the 2026-11-22T04:27:57Z all-lanes RELEASE row (5090-CLAUDE). Handoff fields: graphiti_mark: sitrep.5090-claude.2026-11-22T04:27Z; branch: fix/mavis-sdk-ps1-audit-and-twin-ratchet-2026-11-21 plus the nine delivered lanes and four Mavis SDK rows named in the RELEASE; pr_numbers: #3513 (merge 0d981049ddb, mergedAt 2026-11-22T04:27:08Z), #3462 #3429 #3428 #3427 #3355 #3347 #3339 #3095 #3093, #3092/#3149 for the Mavis SDK rows; scope: delivered content verified on origin/main (ToUniversalTime, doubled -f braces, log_parent, matches_across_twins, MavisSdkEnvPs1AuditTest, test_mavis_sdk_env_audit.ps1 all present at 0d981049ddb); risks: the ps1 audit block had never written a line before #3513, so any audit-log consumer assuming PowerShell history before 2026-11-22 has none; next_actions: operator decides the node main checkout catch-up (177 behind, inventory presented 2026-11-21) and the fork v* tag; chit_artifact_path: CHIT trail SIGNED via make sign-trail (HMAC-SHA256, kid chit-signing-v01, hmac EtnZSkXJvFq4gpYOb46TWpqvwDyxjfBrWIJd9xXsD9E=), which corrects the RELEASE row's 'unsigned on this host' line; agent_signature: ACK::5090-CLAUDE::ALL-LANES-RELEASE-2026-11-22. Filed on PR 3514 for codex P1 thread PRRT_kwDOPkuAKM66gUPB. +- `2026-11-22T16:25:01Z` CLAIM `spark-claude` branch: `fix/httpx-stub-test-pollution` · **TTL 24h (expires `2026-11-23T16:25:01Z`)** · scope: Main python-tests red: 43 flute-gateway failures (SimpleNamespace has no Client/ConnectError), also failing #3490/#3388. Suspect module-level sys.modules httpx stubs in other services tests leaking across the session. Scope httpx stubs per-test; tests only, no service code. +- `2026-11-25T06:23:51Z` RELEASE `5090-CLAUDE` branch: `fix/httpx-stub-test-pollution` · baton-from: `spark-claude` · scope: Baton: spark-claude opened this lane 2026-11-22T16:25:01Z with TTL 24h; it expired 2026-11-23T16:25:01Z with no renewal, no RELEASE, and no push after bcc2619, and PR #3517 sat DIRTY against main. The operator assigned the open lane to 5090 on 2026-11-25. Closing the holder row so 5090-CLAUDE can re-claim; the fix itself (test_formatting.py httpx shim gated on find_spec, test_shim_isolation.py) is carried forward unchanged. +- `2026-11-25T06:23:56Z` CLAIM `5090-CLAUDE` branch: `fix/httpx-stub-test-pollution` · **TTL 72h (expires `2026-11-28T06:23:56Z`)** · scope: Adopt PR #3517 (closes #3510). Re-anchor on main by merge; drop the 11 semantic-cache entries the Merge Gate ratchet reported STALE at bcc2619 (140 findings, 0 new, 11 no longer fail: the httpx shim was breaking those too); land so the standing tests (3.11) advisory waivers (#3368, #3498, #3521 pending) stop. Tests and ratchet baseline only, no service code. - `2026-11-22T17:35:47Z` CLAIM `Mavis (mvs_ce8c1e6e34434db1ba42d3b822ecbd15)` branch: `fix/silent-bind-declared-host-ports-2026-11-22` · **TTL 72h (expires `2026-11-25T17:35:47Z`)** · scope: Static silent-bind ratchet + smoke-suite silent-bind wiring for the PMOVES published-host-port class. DELIVERS (1) pmoves/tools/silent_bind_ratchet.py -- a STATIC, CI-runnable twin of the house's EXISTING runtime auditor (make -C pmoves net-reality, pmoves/scripts/audit_network_reality.sh), which needs a running Docker daemon and therefore cannot run on a GitHub-hosted runner. Measured on the house compose scope: 63 files in scope, 25 out of scope, 73 (file, service) pairs across 39 services whose published host port cannot activate. Mechanism and upstream provenance: moby/moby#36174 (OPEN; maintainer: by design) -- the issue's own docker container inspect output shows HostConfig.PortBindings holding the REQUESTED binding while NetworkSettings.Ports is empty, so detection compares the two maps PER KEY; a text search for a null HostPort misses the whole-entry-null shape. House doctrine: pmoves/docs/operations/DOCKER_NETWORK_HARDENING.md Rule 5 (there is no publish-without-egress; front it with a gateway) and the network table naming pmoves_public as the host-reachable egress tier. Merge semantics from compose-spec 13-merge.md (mappings merge, so a service's network set across files is the union) and the sibling ratchet's as-deployed model. Network internality is resolved per file in a fixed order -- the file's own external marker, then the file's own internal flag, then INHERITANCE from the canonical declarations in docker-compose.yml plus docker-compose.base.yml -- because ten files in the scope redeclare the pmoves tier networks without an internal key and a first-declaration-wins map silently degrades them to unknown. (2) pmoves/scripts/smoke-tests.sh -- the house detector _silent_bind_owner was wired into test_tcp_connectivity only, while test_http_endpoint collapsed a refused connection into a WARNING; the live run therefore reported 41 tests, 22 passed, 20 warnings, 0 failed while four of those warnings WERE silent binds and a grep for SILENT BIND matched nothing. It now separates the two causes and FAILS on a silent bind, using a new _http_port helper that resolves the URL port (the colon inside a substitution defeats a naive split, and that was found by the test rather than by reading the code). (3) pmoves/configs/silent_bind/_known_gaps.yaml -- the baseline: 73 entries, each with a written reason; the list may only SHRINK, a recorded gap that no longer exists fails as stale, and a recorded gap whose reason is still the placeholder fails too. The baseline key carries the path relative to pmoves/ rather than the bare filename, because two files in the house scope share the name docker-compose.core.yml (pmoves/docker-compose.core.yml and pmoves/compose/docker-compose.core.yml); all 73 recorded gaps live in top-level files, so the committed baseline is byte-identical. (4) Tests: pmoves/tools/tests/test_silent_bind_ratchet.py (20 cases), test_silent_bind_ratchet_mutation_kill.py (9 mutations, GREEN-RED-GREEN with a byte-exact restore, 55.46s and 62.44s measured on two consecutive runs), test_smoke_http_port_parser.py (12 cases) and test_smoke_silent_bind_cache.py (4 cases), which EXTRACT the shell functions from the house script rather than copying them. The gate also measures the BASE revision (--base-ref): the base revision's compose files are materialized into a temporary tree and scanned with the SAME code, so the comparison is between two MEASUREMENTS rather than two intentions, and a baseline entry for a gap that did not exist at the base is a BASELINE_ADDITION. That follows the house's own shape for the same question -- the damage-control differential sweep materializes the base version of the guard under test and diffs the two verdicts, and its workflow resolves the base SHA from the PR base SHA over a fetch-depth 0 checkout. (5) .github/workflows/silent-bind-ratchet.yml, and the measured slow-file allowance in pmoves/configs/pytest_ratchet/_slow_files.yaml. CONFORMANCE NOTE: this lane's first PR lands INSTRUMENTS, not remediation. PMOVES's own precedent on this class is three commits that repaired the DETECTION and left the compose remediation as a separate decision (6baaaa1 and fec0a97 on the auditor, de27bdb on the smoke suite). The compose remediation -- the 73 measured gaps, of which 37 ENTRIES (across 20 of the 39 services) bind wide or implicitly wide -- is a separate lane, gated on the operator's tier decision: attaching pmoves_public grants outbound internet to a currently air-gapped service, and for the wide group it makes the service reachable on the tailnet for the first time. CORRECTED 2026-11-23: this row originally said "37 of them bound to 0.0.0.0", which conflated gap ENTRIES with SERVICES and counted only the mappings whose TEXT names 0.0.0.0. MEASURED by the ratchet's own --bind-shape report: 80 published port slots = 34 explicit 0.0.0.0 + 7 with NO host address (Docker's default host address is 0.0.0.0, so those are wide at runtime) + 39 loopback; 37 ENTRIES across 20 SERVICES are wide-or-implicit and 19 SERVICES are loopback-only. The DECISION is unchanged -- every affected service attaches pmoves_public and every wide-or-implicit port gets an explicit 127.0.0.1 -- because the action never depended on the count. - `2026-11-22T17:37:32Z` RELEASE `Mavis (mvs_ce8c1e6e34434db1ba42d3b822ecbd15)` branch: `fix/silent-bind-declared-host-ports-2026-11-22` · scope: Lane closed: the static silent-bind gate, its baseline and its CI wiring are delivered in PR #3518, and the house smoke suite now FAILS on a silent bind instead of warning about it. DELIVERED, on branch fix/silent-bind-declared-host-ports-2026-11-22 (commits d05f45ea84d and 19b5f03d145, PR #3518): pmoves/tools/silent_bind_ratchet.py -- the STATIC twin of the house's existing runtime auditor (make -C pmoves net-reality, which needs a Docker daemon and so cannot run on a GitHub-hosted runner); pmoves/configs/silent_bind/_known_gaps.yaml -- the baseline, 73 entries each with a written reason, shrink-only, a stale entry fails and a placeholder reason fails; pmoves/scripts/smoke-tests.sh -- the house detector _silent_bind_owner was wired into test_tcp_connectivity only, and test_http_endpoint collapsed a refused connection into a WARNING, so the live run reported 41 tests, 22 passed, 20 warnings, 0 failed while four of those warnings WERE silent binds and a grep for SILENT BIND matched nothing -- it now separates the two causes and FAILS, via a new _http_port helper that resolves the URL port (the colon inside a substitution defeats a naive split, and that was found by the test rather than by reading the code); pmoves/tools/tests/test_silent_bind_ratchet.py (20 cases), test_silent_bind_ratchet_mutation_kill.py (9 mutations, GREEN-RED-GREEN with a byte-exact restore, 55.46s and 62.44s measured on two consecutive runs), test_smoke_http_port_parser.py (12 cases) and test_smoke_silent_bind_cache.py (4 cases), which EXTRACT the shell functions from the house script rather than copying them; .github/workflows/silent-bind-ratchet.yml; the measured slow-file allowance in pmoves/configs/pytest_ratchet/_slow_files.yaml; pmoves/docs/AGENTS/silent_bind_ratchet_LEARNINGS.md. MEASURED on the house compose scope: 63 files in scope, 25 out of scope, 73 (file, service) pairs across 39 services whose published host port cannot activate. The gate's own count was cross-checked against an independent measurement script written separately from the tool -- both report 73 pairs across 39 services. Local test runs: 36 passed (20 ratchet, 12 URL-port, 4 cache), mutation harness 10 passed (9 named kills proven). The gate now also measures the BASE revision: against origin/main the base measures 73 gaps and the rule reports 0 baseline additions, so all 73 recorded gaps pre-date this lane; a probe baseline carrying one entry for a gap absent at the base is REJECTED (BASELINE_ADDITION, exit 1), and an unreadable base ref fails CLOSED (exit 3). REVIEW FINDINGS ACCEPTED: the Codex review of commit d05f45ea84d raised two, both verified against the code and both real. P1 -- the baseline was compared with the gaps measured in the SAME checkout, so a change that added a new gap AND its baseline entry compared clean, which meant the tool's own stated invariant was not enforceable by its mechanism; the gate now measures the base revision with the SAME code, following the house's own damage-control differential-sweep pattern, and the baseline key was corrected to a pmoves-relative path while the fix was in hand. P2 -- the smoke suite's silent-bind map was built inside a command substitution, so the assignment was discarded when the substitution ended and every refused probe rebuilt it with a docker ps plus a batched docker inspect over every container in the project; the build and the lookup are now separate functions and the map is filled in the PARENT shell. A hand-rolled compose transformer written earlier in this lane was DELETED rather than shipped: pmoves/scripts/split_compose.py generates the split overlays and pmoves/scripts/inject_pmoves_networks.py mirrors each service's networks into PMOVES_NETWORKS, so both hand edits would have been undone by the house's own gates (make -C pmoves compose-networks-check and compose-split-check, both verified passing on origin/main today). NOT IN THIS LANE, BY DESIGN: no compose file is changed here. The remediation -- the 73 measured gaps, of which 37 ENTRIES (across 20 of the 39 services) bind wide or implicitly wide -- is a separate lane gated on the operator's tier decision. Attaching pmoves_public is what makes the binding activate, but it grants outbound internet to a currently air-gapped service, and DOCKER_NETWORK_HARDENING.md Rule 5 requires that egress be accepted deliberately and in writing; for the wide group it makes the service reachable on the tailnet for the first time. CORRECTED 2026-11-23: this row originally said "37 of them bound to 0.0.0.0" and "the 37 services bound to 0.0.0.0". MEASURED by the ratchet's --bind-shape report: 80 port slots = 34 explicit 0.0.0.0 + 7 implicit (no host address in the mapping, so Docker binds 0.0.0.0) + 39 loopback; 37 ENTRIES across 20 SERVICES are wide-or-implicit, 19 SERVICES are loopback-only. Gateway-fronting, Rule 5's preferred option, does not apply to most of these -- they are raw TCP ports (NATS 8131, PostgreSQL 54329/6543), not HTTP behind Kong. PMOVES's own precedent on this class is to repair the detection first and treat the compose remediation as a separate decision (6baaaa1 and fec0a97 on the auditor, de27bdb on the smoke suite). The baseline records every gap with the reason it is still there, so the count only goes down. - `2026-11-22T07:20:12Z` CLAIM `5090-CLAUDE` branch: `fix/model-sync-db-name-from-container` · **TTL 48h (expires `2026-11-24T07:20:12Z`)** · scope: models_sync.py _db_json_query hardcodes psql -U postgres -d postgres; the node DB is OSTGRES_DB (pmoves on 5090), so the SQL fallback for pmoves_core.v_service_models fails with relation does not exist on every node whose database is not named postgres, and --check exits 2 UNDECIDED. Fix: resolve db name and user from the container env (POSTGRES_DB / POSTGRES_USER) with MODEL_SYNC_DB_NAME / MODEL_SYNC_DB_USER overrides, test with a fake docker. Also retract the false registry-view-missing claim 5090-CLAUDE wrote on 2026-11-19 (AGENT_ZERO_API.md, agent-zero README, A0_DARKXSIDE handoff, register rows): the view exists in db pmoves; my probe used -d postgres. @@ -3690,3 +3693,4 @@ VILLAGE RULE: delivery delegated to a delivery-agent body; control and memory ar - `2026-11-23T20:45:43Z` CLAIM `pmoves-hermes-elder` branch: `docs/register-wave-zero-1106` - **TTL 48h (expires `2026-11-25T20:45:43Z`)** - scope: WAVE-ZERO lane renewal - campaign concluded 2026-11-20 (board #462 final wrap), lane disposition idle; manual renewal after cron cadence stall (last cron renewal c3c33173c); register maintenance standing duty - `2026-11-23T21:02:58Z` NOTE `pmoves-hermes-elder` branch: `docs/register-wave-zero-1106` · scope: ERRATUM to CLAIM 2026-11-23T20:45:43Z (commit 75af5f8bc): its commit-message wording "cadence stall detected" is WRONG — register-renew-cron (job 22bbf1bc530b) healthy (720m cadence, guard renews only at expiry-6h; 2026-11-23T13:16:48Z run SKIPped correctly, ~10.9h margin); manual renewal pre-empted a PROJECTED ~71min lapse gap (prior expiry 2026-11-24T00:05:45Z; projected next fire ~2026-11-24T01:16Z lands post-expiry); no stall existed; structural: 6h guard threshold < 12h fire cadence guarantees a lapse window every 48h cycle (cron receipts flagged it 4 consecutive runs) — threshold/cadence fix proposed to operator, pending word - `2026-11-24T13:36:51Z` RELEASE `5090-CLAUDE` branch: `fix/openroom-root-redirect-2026-11-23` · scope: DELIVERED PR #3527: PMOVES-OpenRoom gitlink 9233894 -> aec292e (fork #19 merged: absolute_redirect off). Root cause: nginx absolute redirects carried the CONTAINER port 3000 through the 5173:3000 publish mapping, so the operator's bare-root URL landed on the wrong host service. Reviewed APPROVE by code-review body with live nginx A/B on the Dockerfile image; two nits taken (topology trimmed from public comment, PR body records the implicit directory-redirect fix); lint-and-build green. 5090 rebuilt via build-svc + recreate-svc: GET / -> 301 Location: /webuiapps/ -> 200, same via the tailnet name. Awaiting checks + Control ACK + closeout merge. +- `2026-11-25T07:20:02Z` NOTE `5090-CLAUDE` branch: `fix/httpx-stub-test-pollution` · scope: Scope correction for the 06:23:56Z CLAIM: the 11 semantic-cache entries the Merge Gate reported STALE at bcc2619 are NOT fixed and will NOT be dropped. Measured locally with the ratchet chunking (pytest 9.2.0, 20-file chunks of the pmoves group): the new test file shifts chunk boundaries, moving test_cache.py into chunk [4], and pmoves/tools/test_all_tts_engines.py calls sys.exit(1) at import when gradio_client is absent, so chunk [4] aborts with INTERNALERROR during collection and pytest writes a partial junit (3 sso-auth collection errors, nothing else). The ratchet reads absence as fixed. On main that chunk has never produced a test result (19 files unmeasured every run). Lane now also: guard that script so it skips under pytest, make the ratchet treat pytest exit 3 as a lost chunk (isolate per file, record an finding), and baseline what CI then surfaces, with a header note. The test_cache errors themselves are an alias gap (pmoves.services.semantic_cache is not in the services shim), separate issue to follow. diff --git a/pmoves/services/publisher-discord/tests/test_formatting.py b/pmoves/services/publisher-discord/tests/test_formatting.py index ea670f658d..d8845dbebf 100644 --- a/pmoves/services/publisher-discord/tests/test_formatting.py +++ b/pmoves/services/publisher-discord/tests/test_formatting.py @@ -1,3 +1,4 @@ +import importlib.machinery import sys from pathlib import Path from types import ModuleType, SimpleNamespace @@ -14,7 +15,20 @@ async def __aexit__(self, exc_type, exc, tb): return False -sys.modules.setdefault("httpx", SimpleNamespace(AsyncClient=_DummyAsyncClient)) +# Stub httpx ONLY when it is not installed. A bare setdefault() also fired when +# httpx was installed but not yet imported, replacing it for the whole pytest +# session and breaking later importers (google-genai 3.x reads httpx.Client at +# import; 43 flute-gateway failures on main, 2026-11-21). See +# test_shim_isolation.py. +# +# PathFinder, not importlib.util.find_spec: the latter consults sys.modules +# first and RAISES ValueError when the entry there has no __spec__, which is +# exactly what a sibling suite's stub looks like (channel-monitor's +# test_monitor.py installs a bare ModuleType("httpx") and sorts before this +# file in the same ratchet chunk). PathFinder answers the only question asked +# here -- is the package on sys.path -- and never raises. +if importlib.machinery.PathFinder.find_spec("httpx") is None: + sys.modules.setdefault("httpx", SimpleNamespace(AsyncClient=_DummyAsyncClient)) class _DummyFastAPI: diff --git a/pmoves/services/publisher-discord/tests/test_shim_isolation.py b/pmoves/services/publisher-discord/tests/test_shim_isolation.py new file mode 100644 index 0000000000..ba2661a108 --- /dev/null +++ b/pmoves/services/publisher-discord/tests/test_shim_isolation.py @@ -0,0 +1,52 @@ +"""The formatting tests' import shims must not shadow an installed httpx. + +test_formatting.py runs in the same pytest session as other services' tests +(python-tests.yml "Run all service tests"). A module-level +``sys.modules.setdefault("httpx", SimpleNamespace(...))`` replaced httpx for +the WHOLE session whenever nothing had imported the real one yet, so any later +import that reads ``httpx.`` at import time broke -- google-genai 3.x's +``HttpxClient = httpx.Client`` failed 43 flute-gateway tests on main +(2026-11-21). The shim is for minimal environments where httpx is absent. +""" + +import importlib.machinery +import os +import subprocess +import sys +from pathlib import Path + +import pytest + +TEST_FILE = Path(__file__).with_name("test_formatting.py") + + +@pytest.mark.skipif( + # PathFinder ignores sys.modules, so a sibling suite's spec-less httpx stub + # cannot make this raise at collection (importlib.util.find_spec would). + importlib.machinery.PathFinder.find_spec("httpx") is None, + reason="httpx not installed: the shim is supposed to apply", +) +def test_formatting_shim_leaves_installed_httpx_alone(): + # Fresh interpreter, so the real httpx has NOT been imported yet -- the + # exact state in which setdefault() used to install the stub. + probe = ( + "import importlib.util, sys\n" + f"spec = importlib.util.spec_from_file_location('tf', {str(TEST_FILE)!r})\n" + "mod = importlib.util.module_from_spec(spec)\n" + "spec.loader.exec_module(mod)\n" + "import httpx\n" + "assert hasattr(httpx, 'Client'), type(httpx).__name__\n" + ) + pmoves_dir = TEST_FILE.parents[3] # tests -> publisher-discord -> services -> pmoves + env = dict(os.environ) + env["PYTHONPATH"] = os.pathsep.join( + p for p in (str(pmoves_dir), env.get("PYTHONPATH", "")) if p + ) + result = subprocess.run( + [sys.executable, "-c", probe], + capture_output=True, + text=True, + cwd=pmoves_dir, + env=env, + ) + assert result.returncode == 0, result.stderr[-2000:] diff --git a/pmoves/tests/tools/test_pytest_ratchet.py b/pmoves/tests/tools/test_pytest_ratchet.py index 1c61da453c..9c65ab3aa9 100644 --- a/pmoves/tests/tools/test_pytest_ratchet.py +++ b/pmoves/tests/tools/test_pytest_ratchet.py @@ -510,22 +510,38 @@ def test_a_prose_line_outside_the_block_is_not_reported(self): # that actually hang. class _FakeRun: - """Stands in for run_pytest: writes a report for every file except the hangs.""" + """Stands in for run_pytest: writes a report for every file except the hangs. - def __init__(self, hangs, chunk_times_out=True): + `aborts` names files that make pytest exit 3 (INTERNALERROR). Like the real + thing, an aborting run still WRITES a report -- partial -- which is the + whole trap: a chunk containing one abort returns 3 with a report present. + """ + + def __init__(self, hangs, chunk_times_out=True, aborts=(), abort_writes_report=True): self.hangs = set(hangs) + self.aborts = set(aborts) self.chunk_times_out = chunk_times_out + self.abort_writes_report = abort_writes_report self.calls = [] + def _abort(self, junit): + if self.abort_writes_report: + junit.write_text("", encoding="utf-8") + return 3, "INTERNALERROR> SystemExit: 1" + def __call__(self, files, junit, timeout=None): self.calls.append(([str(f) for f in files], timeout)) if len(files) > 1: + if any(str(f) in self.aborts for f in files): + return self._abort(junit) if self.chunk_times_out: return -1, "TIMEOUT" junit.write_text("", encoding="utf-8") return 0, "" if str(files[0]) in self.hangs: return -1, "TIMEOUT" + if str(files[0]) in self.aborts: + return self._abort(junit) junit.write_text("", encoding="utf-8") return 0, "" @@ -613,3 +629,101 @@ def test_budget_exhaustion_reports_the_rest_as_unmeasured(monkeypatch, tmp_path) findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "b.py"], fake) assert set(dead) == {"a.py", "b.py"} assert len(fake.calls) == 1 # chunk only; no file ever ran + + +# ── a chunk aborted by pytest INTERNALERROR (exit 3) ──────────────────────── +# +# Unlike a timeout, an aborted session still writes its JUnit report, holding +# only what was collected before the abort. Measured 2026-11-25 (Merge Gate +# python-tests, run 45044058125): pmoves/tools/test_all_tts_engines.py called +# sys.exit(1) at import, chunk `pmoves [4]` returned 3 with a report of 3 +# collection errors, and the other 19 files read as having no failures. When a +# new test file shifted the chunk boundary, 11 baselined errors moved into that +# chunk and were reported STALE -- "fixed". A partial report is not a report. + +def _internal_errors(findings): + return [f for f in findings if f["name"] == ""] + + +def test_partial_report_after_an_abort_is_not_trusted(monkeypatch, tmp_path): + """The trap: exit 3 WITH a report present. The chunk must still be isolated.""" + fake = _FakeRun(hangs=[], aborts=["abort.py"]) + findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "abort.py", "c.py"], fake) + assert len(fake.calls) == 1 + 3 # chunk, then one per file + assert dead == [] # nothing is unmeasured: we know what aborted + + +def test_the_aborting_file_is_a_finding_keyed_on_the_file(monkeypatch, tmp_path): + fake = _FakeRun(hangs=[], aborts=["abort.py"]) + findings, _ = _run_fallback(monkeypatch, tmp_path, ["a.py", "abort.py", "c.py"], fake) + errs = _internal_errors(findings) + assert [f["where"] for f in errs] == ["abort.py"] + assert errs[0]["kind"] == "ERROR" + assert pytest_ratchet._key(errs[0]) == "ERROR|abort.py|" + assert "SystemExit" in errs[0]["detail"] + + +def test_siblings_of_an_aborting_file_keep_their_results(monkeypatch, tmp_path): + """The point of isolating: one sys.exit must not cost 19 files their results.""" + fake = _FakeRun(hangs=[], aborts=["abort.py"]) + finding = {"kind": "FAIL", "where": "x", "name": "y", "detail": ""} + findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "abort.py"], fake, + parsed=[finding]) + # a.py reports its finding; abort.py reports its (partial) report AND the abort + assert findings.count(finding) == 2 + assert len(_internal_errors(findings)) == 1 + assert dead == [] + + +def test_single_file_abort_is_recorded_not_dead(monkeypatch, tmp_path): + fake = _FakeRun(hangs=[], aborts=["only.py"]) + findings, dead = _run_fallback(monkeypatch, tmp_path, ["only.py"], fake) + assert dead == [] + assert [f["where"] for f in _internal_errors(findings)] == ["only.py"] + assert len(fake.calls) == 1 + + +def test_abort_and_hang_in_one_chunk_are_told_apart(monkeypatch, tmp_path): + fake = _FakeRun(hangs=["hang.py"], aborts=["abort.py"]) + findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "abort.py", "hang.py"], fake) + assert dead == ["hang.py"] + assert [f["where"] for f in _internal_errors(findings)] == ["abort.py"] + + +def test_abort_without_any_report_is_still_a_finding(monkeypatch, tmp_path): + """pytest usually writes a partial report on INTERNALERROR; when it does not + (killed harder, or junitxml itself is what broke), the abort is still keyed + on the file rather than lost.""" + fake = _FakeRun(hangs=[], aborts=["abort.py"], abort_writes_report=False) + finding = {"kind": "FAIL", "where": "x", "name": "y", "detail": ""} + findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "abort.py"], fake, + parsed=[finding]) + assert dead == [] + assert findings.count(finding) == 1 # a.py only; abort.py had no report + assert [f["where"] for f in _internal_errors(findings)] == ["abort.py"] + + +def test_single_file_abort_without_a_report_is_recorded_not_dead(monkeypatch, tmp_path): + fake = _FakeRun(hangs=[], aborts=["only.py"], abort_writes_report=False) + findings, dead = _run_fallback(monkeypatch, tmp_path, ["only.py"], fake) + assert dead == [] + assert [f["where"] for f in _internal_errors(findings)] == ["only.py"] + + +def test_every_file_aborting_alone_is_one_dead_group_not_n_findings(monkeypatch, tmp_path): + """A conftest or plugin hook raising fails identically for every file. That is + the session, not a file; N per-file findings would key one breakage N ways.""" + fake = _FakeRun(hangs=[], aborts=["a.py", "b.py", "c.py"]) + findings, dead = _run_fallback(monkeypatch, tmp_path, ["a.py", "b.py", "c.py"], fake) + assert dead == ["grp"] + assert findings == [] + assert len(fake.calls) == 1 + 3 # it still had to look, per file + + +def test_internal_error_detail_is_the_last_output_line_capped(monkeypatch, tmp_path): + out = "junk\nINTERNALERROR> " + "x" * 400 + "\n\n" + f = pytest_ratchet._internal_error_finding(Path("abort.py"), out) + assert f["detail"].startswith("INTERNALERROR>") + assert len(f["detail"]) == 160 + assert pytest_ratchet._internal_error_finding(Path("abort.py"), "")["detail"] \ + == "pytest exited 3 (INTERNALERROR)" diff --git a/pmoves/tools/pytest_ratchet.py b/pmoves/tools/pytest_ratchet.py index fc4e55a77f..d8da5cf161 100644 --- a/pmoves/tools/pytest_ratchet.py +++ b/pmoves/tools/pytest_ratchet.py @@ -444,17 +444,51 @@ def write_baseline(findings: List[dict]) -> None: BASELINE.write_text("\n".join(lines) + "\n", encoding="utf-8") +# pytest's ExitCode.INTERNAL_ERROR. Raised for an exception that escapes the +# session itself -- the one that matters here is SystemExit during COLLECTION: +# a `test_*.py` that is really a CLI script and calls `sys.exit(1)` at import +# when a dependency is missing. `--continue-on-collection-errors` does not cover +# it (it is not a collection error, it is the interpreter being told to stop). +# pytest still writes the JUnit report on the way out, holding ONLY what was +# collected before the abort, so the report is partial and looks complete. +# +# MEASURED 2026-11-25 (Merge Gate python-tests, run 45044058125): +# pmoves/tools/test_all_tts_engines.py did exactly this to chunk `pmoves [4]`. +# Every test in that 20-file chunk was unmeasured on every run on record, and +# when a new test file elsewhere shifted the chunk boundary, 11 baselined +# semantic-cache errors moved INTO the aborted chunk and this tool reported +# them as STALE -- "fixed" -- with the recommended remedy being to drop them. +# A partial report after exit 3 is therefore never taken at face value. +PYTEST_INTERNAL_ERROR = 3 + + +def _internal_error_finding(path: Path, output: str) -> dict: + """The abort itself, as a finding: visible, keyed on the file, ratchetable.""" + lines = [ln for ln in output.strip().splitlines() if ln.strip()] + detail = lines[-1].strip() if lines else "pytest exited 3 (INTERNALERROR)" + return { + "kind": "ERROR", + "where": str(path).replace(chr(92), "/"), + "name": "", + "detail": detail[:160], + } + + def run_chunk_with_fallback(group: str, gfiles: List[Path], tmp: Path, index: int) -> tuple[List[dict], List[str]]: - """Run a group; if it times out, re-run it one file at a time. + """Run a group; if it is lost, re-run it one file at a time. Returns (findings, dead_labels). `dead_labels` names whatever stayed unmeasured -- the whole group if the fallback could not run, or the specific files that hang. - A timed-out chunk is killed before pytest writes its JUnit report, so - treating the timeout as one opaque "no report" discards every result in the - chunk. Isolating per file narrows the loss to the file that actually hangs. + A chunk is LOST two ways. A timed-out chunk is killed before pytest writes + its JUnit report, so treating the timeout as one opaque "no report" discards + every result in the chunk. A chunk that pytest aborts with INTERNALERROR + (exit 3) DOES get a report, but a partial one, and reading it as complete + turns every uncollected test into a silent pass. Isolating per file narrows + either loss to the file that actually hangs or aborts; an aborting file is + recorded as an `` finding rather than as nothing. The per-file budget is FALLBACK_FILE_TIMEOUT plus the file's own declared allowance, so a file that is merely SLOW is measured in the isolation pass @@ -462,12 +496,19 @@ def run_chunk_with_fallback(group: str, gfiles: List[Path], tmp: Path, """ junit = tmp / f"report-{index}.xml" rc, output = run_pytest(gfiles, junit) - if junit.is_file(): + if junit.is_file() and rc != PYTEST_INTERNAL_ERROR: return parse_junit(junit), [] - if rc != -1 or len(gfiles) <= 1: - # Not a timeout (unimportable conftest, usage error, crash), or nothing - # left to split. Per-file isolation cannot help either case. + if rc == PYTEST_INTERNAL_ERROR and len(gfiles) <= 1: + # Nothing left to split. Keep whatever the partial report holds and + # record the abort against the file, so it cannot read as passing. + sys.stderr.write("--- %s aborted pytest (exit 3) ---%s%s%s" % ( + group, chr(10), output[-1500:], chr(10))) + return parse_junit(junit) + [_internal_error_finding(gfiles[0], output)], [] + + if rc not in (-1, PYTEST_INTERNAL_ERROR) or len(gfiles) <= 1: + # Not a timeout or an abort (unimportable conftest, usage error, crash), + # or nothing left to split. Per-file isolation cannot help either case. sys.stderr.write("--- no report for %s (exit %d) ---%s%s%s" % ( group, rc, chr(10), output[-1500:], chr(10))) return [], [group] @@ -476,12 +517,14 @@ def run_chunk_with_fallback(group: str, gfiles: List[Path], tmp: Path, # declared-slow file can consume more than the flat default on its own, # so the pass must be able to afford it. pass_budget = fallback_budget_seconds(gfiles) + reason = "timed out" if rc == -1 else "aborted pytest (exit 3)" sys.stderr.write( - "--- %s timed out; isolating %d files (budget %ds) ---%s" % ( - group, len(gfiles), pass_budget, chr(10))) + "--- %s %s; isolating %d files (budget %ds) ---%s" % ( + group, reason, len(gfiles), pass_budget, chr(10))) findings: List[dict] = [] dead: List[str] = [] + aborted: List[str] = [] spent = 0.0 for j, f in enumerate(gfiles): if spent >= pass_budget: @@ -497,13 +540,32 @@ def run_chunk_with_fallback(group: str, gfiles: List[Path], tmp: Path, start = time.monotonic() frc, foutput = run_pytest([f], sub, timeout=file_timeout_seconds(f)) spent += time.monotonic() - start + label = str(f).replace(chr(92), "/") if sub.is_file(): findings.extend(parse_junit(sub)) + if frc == PYTEST_INTERNAL_ERROR: + # The report (if any) holds what was collected before the abort; + # the abort itself is the finding. Not a dead label: we know + # exactly which file did it and why. + sys.stderr.write("--- %s aborted pytest (exit 3) ---%s%s%s" % ( + label, chr(10), foutput[-600:], chr(10))) + findings.append(_internal_error_finding(f, foutput)) + aborted.append(label) + continue + if sub.is_file(): continue - label = str(f).replace(chr(92), "/") sys.stderr.write("--- no report for %s (exit %d) ---%s%s%s" % ( label, frc, chr(10), foutput[-600:], chr(10))) dead.append(label) + if len(gfiles) > 1 and len(aborted) == len(gfiles): + # EVERY file aborts alone: that is not one file's sys.exit, it is the + # session itself (a conftest or plugin hook raising). Per-file findings + # would key the same breakage N ways and churn the baseline; the group + # is reported once, the same way an unimportable conftest is. + sys.stderr.write( + "--- every file in %s aborts pytest alone; reporting the group ---%s" % ( + group, chr(10))) + return [], [group] return findings, dead diff --git a/pmoves/tools/test_all_tts_engines.py b/pmoves/tools/test_all_tts_engines.py index de5406f99e..ca28854093 100644 --- a/pmoves/tools/test_all_tts_engines.py +++ b/pmoves/tools/test_all_tts_engines.py @@ -55,6 +55,20 @@ try: from gradio_client import Client except ImportError: + if "pytest" in sys.modules: + # This is a CLI against a live TTS Studio, not a pytest suite, but its + # name matches `test_*.py`, so the python-tests ratchet collects it. + # Under pytest, `sys.exit(1)` here is an INTERNALERROR during + # collection: it aborted the whole 20-file chunk this file sat in and + # pytest wrote a partial report that read as "no failures" for every + # other file in the chunk (measured 2026-11-25, Merge Gate run + # 45044058125). A module-level skip says what happened instead. + import pytest + + pytest.skip( + "CLI script, not a test module; gradio_client is not installed", + allow_module_level=True, + ) print("ERROR: gradio_client required. Install with: pip install gradio_client") sys.exit(1)