Skip to content

fix(tests): httpx shim stops shadowing an installed httpx; the ratchet stops reading an aborted chunk as green - #3517

Merged
POWERFULMOVES merged 7 commits into
mainfrom
fix/httpx-stub-test-pollution
Nov 25, 2026
Merged

POWERFULMOVES merged 7 commits into
mainfrom
fix/httpx-stub-test-pollution

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Why main's tests (3.11) is red (#3510)

Since 2026-11-21 main fails 43 flute-gateway tests with 'types.SimpleNamespace' object has no attribute 'Client'. Two things together:

  1. The trap (fixed here). publisher-discord/tests/test_formatting.py ran sys.modules.setdefault("httpx", SimpleNamespace(AsyncClient=...)) at import. setdefault only checks whether httpx has been imported, not whether it is installed, so inside a shared pytest session the stub replaced the real httpx for every file collected after it.
  2. The trigger (fixed in docs(plans): 4-lane operator roadmap research + dry-run plan #3353). The CI dependency union drops version pins, so google-genai==2.10.0 resolved to 3.6.1, which runs HttpxClient = httpx.Client at import, and flute-gateway's import chain hit the stub.

The shim now applies only when httpx is not installed, the same way channel-monitor's stub works. test_shim_isolation.py proves it in a fresh interpreter: it fails on the old shim and passes on the fix. tests (3.11) is green on this branch.

What the red Merge Gate python-tests on this branch actually was

The ratchet reported 0 new failures and 11 baselined entries that "no longer fail", all services.semantic-cache.tests.test_cache.*, and told the author to drop them. They are not fixed. Reproduced locally with the ratchet's own chunking (pytest 9.2.0, 20-file chunks of the pmoves group):

  • Adding test_shim_isolation.py shifts every later chunk boundary by one file, moving test_cache.py from chunk [3] into chunk [4].
  • Chunk [4] holds pmoves/tools/test_all_tts_engines.py, a CLI against a live TTS Studio whose name matches test_*.py. It called sys.exit(1) at import when gradio_client is absent. Under pytest that is an INTERNALERROR during collection: the session aborts, pytest still writes the junit with whatever was collected before the abort (the 3 baselined sso-auth collection errors), and every other test in the chunk is simply absent. The ratchet read absence as fixed.
  • On main that chunk has produced zero test results on every run on record: 19 files unmeasured, every run.
  • The test_cache errors were never httpx-related either: the tests patch pmoves.services.semantic_cache.*, a snake_case alias the services shim does not define. Separate issue, linked below.

Fix (tests and tooling only, no service code)

  • pmoves/tools/pytest_ratchet.py: pytest exit 3 is a lost chunk like a timeout. The partial report is not taken as the result; the chunk is isolated per file, and the file that aborts is recorded as ERROR|<file>|<internal-error> so it is visible and ratchetable instead of silently green.
  • pmoves/tools/test_all_tts_engines.py: under pytest a missing gradio_client is a module-level skip that says what the file is. As a CLI it still prints the install hint and exits 1.
  • pmoves/tests/tools/test_pytest_ratchet.py: six cases for the abort path. 49 pass.
  • publisher-discord/tests/test_formatting.py + test_shim_isolation.py: the original shim fix, unchanged.
  • Baseline: whatever the now-measured chunk [4] surfaces in CI is recorded with a dated header note, same precedent as the 2026-08-19 timeout-fallback entries. The 11 semantic-cache entries stay.

Evidence

  • Local re-run of chunk [4] with the ratchet's exact options after the change: no INTERNALERROR, the CLI skipped with its reason, the 11 test_cache errors present (so they will not read as stale), 3 sso-auth collection errors as baselined.
  • python pmoves/tools/test_all_tts_engines.py --help without gradio_client: prints the install hint, exit 1 (unchanged CLI contract).
  • Register: baton RELEASE from spark-claude (24h CLAIM expired 2026-11-23, no push since), 5090-CLAUDE CLAIM, and a NOTE with the scope correction.

Follow-ups (not in this PR)

Closes #3510.

🤖 Generated with Claude Code

https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

… httpx

Root cause of main's red python-tests (43 flute-gateway failures since
2026-11-21): test_formatting.py ran
`sys.modules.setdefault("httpx", SimpleNamespace(AsyncClient=...))` at
import. setdefault only checks "already imported", not "installed", so in
the shared "Run all service tests" pytest session it replaced the real
httpx for every later test file. google-genai 3.x (unpinned by the CI
union) reads `httpx.Client` at import, so flute-gateway's import chain
died on the SimpleNamespace.

The shim now applies only when httpx is not installed (channel-monitor's
pattern). #3353 separately pins google-genai in the CI union, which
removes the trigger; this removes the trap for the next importer.

Evidence:
- new test_shim_isolation.py fails on the old shim
  (AssertionError: SimpleNamespace), passes on the fix
- google-genai 3.6.1 venv: main's test_formatting.py then `from google
  import genai` -> AttributeError 'SimpleNamespace' ... 'Client' (CI's
  exact error); fixed file -> import OK
- publisher-discord 7/7; flute-gateway local failures identical with and
  without publisher-discord in the session (local numpy.long, env-only)

Also carries this lane's register CLAIM row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4qEbP262ySna8x9izc
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized keys: "branches", "excluded_branches" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T16:30:27.088317Z bcc2619 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added docs Documentation services Service source under pmoves/services/ governance AGNOTE register / agent definitions / damage-control hooks labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ORGSIM-MIRROR drift check (advisory, fail-soft)

vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 1cb658595178

Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcc2619326

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

POWERFULMOVES and others added 2 commits November 25, 2026 01:24
…park-claude (TTL expired 2026-11-23)

spark-claude's 24h CLAIM on fix/httpx-stub-test-pollution expired with no
renewal, RELEASE, or push after bcc2619; PR #3517 sat DIRTY against main.
Operator assigned the open lane to 5090 on 2026-11-25. Baton RELEASE then
CLAIM, per the register tool's handoff grammar.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Baton handoff (register): spark-claude's 24h CLAIM on this lane expired 2026-11-23T16:25:01Z with no renewal, RELEASE, or push after bcc2619, and the PR has sat DIRTY against main since. The operator assigned the open lane to 5090 on 2026-11-25, so 5090-CLAUDE filed a baton RELEASE naming spark-claude and re-claimed it (rows at the register tail on this branch). The fix is carried forward unchanged.

What the red Merge Gate actually said at bcc2619: python-tests ran the pytest ratchet and found 0 new failures and 11 baselined entries that no longer fail, all services.semantic-cache.tests.test_cache.*. The ratchet fails on stale entries by design so the baseline can only shrink. So this fix also cured semantic-cache; next push drops those 11 entries from pmoves/configs/pytest_ratchet/_known_failures.yaml.

tests (3.11) (the job #3510 is about) is already green on this branch.

-- 5090-CLAUDE

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Correction to my previous comment (5090-CLAUDE): the 11 semantic-cache entries are not fixed. I reproduced the Merge Gate chunking locally (same pytest 9.2.0, same 20-file chunks of the pmoves group): adding test_shim_isolation.py shifts every later chunk boundary by one file, which moves semantic-cache/tests/test_cache.py from chunk [3] (where it ran, and errored, next to test_formatting.py) into chunk [4]. Chunk [4] contains pmoves/tools/test_all_tts_engines.py, which calls sys.exit(1) at import when gradio_client is absent. Under pytest that is an INTERNALERROR during collection: the session aborts, pytest still writes the junit with whatever was collected before the abort (the 3 baselined sso-auth collection errors), and every test after that point is simply absent. The ratchet reads "absent" as "no longer fails" and reports STALE.

So the test_cache errors were never httpx-related either (the test patches pmoves.services.semantic_cache.*, a snake_case alias the services shim does not define). Dropping them from the baseline would have recorded silence as a fix. I am not doing that. Next push keeps the baseline, and deals with the abort so chunk [4] is actually measured.

-- 5090-CLAUDE

POWERFULMOVES and others added 2 commits November 25, 2026 02:25
…; the TTS CLI skips under pytest

The python-tests ratchet trusted any JUnit report that existed. pytest writes
one even when the session aborts with INTERNALERROR (exit 3), holding only
what was collected before the abort, so every later test in the chunk was
read as "no failures here".

Measured 2026-11-25 on Merge Gate run 45044058125: pmoves/tools/
test_all_tts_engines.py is a CLI against a live TTS Studio whose name matches
test_*.py, and it called sys.exit(1) at import when gradio_client is absent.
That aborted chunk `pmoves [4]` on every run on record (19 files, zero test
results, 3 sso-auth collection errors recorded before the abort). When this
branch added a test file earlier in the sort order, the chunk boundary moved,
11 baselined semantic-cache errors landed in the aborted chunk, and the gate
reported them STALE -- fixed -- and told the author to drop them.

- pytest_ratchet.py: exit 3 is a LOST chunk like a timeout. The partial report
  is not returned as the result; the chunk is isolated per file, and the file
  that aborts is recorded as an `ERROR|<file>|<internal-error>` finding so it
  is visible and ratchetable instead of silently passing.
- test_all_tts_engines.py: under pytest, a missing gradio_client is a
  module-level skip that says what the file is. As a CLI it still prints the
  install hint and exits 1.
- test_pytest_ratchet.py: six cases for the abort path (partial report not
  trusted, aborting file keyed as a finding, siblings keep results, single-file
  abort, abort vs hang in one chunk, detail cap). 49 pass.

Chunk `pmoves [4]` re-run locally with the ratchet's options after this change:
no INTERNALERROR, the CLI skipped, and the 11 test_cache errors are present --
they patch `pmoves.services.semantic_cache.*`, an alias the services shim does
not define, and were never httpx-related. The baseline is unchanged here; what
the measured chunk surfaces in CI is recorded in the next commit with a note.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
…im lane (STALE entries were an aborted chunk, not fixes)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
@POWERFULMOVES POWERFULMOVES changed the title fix(tests): publisher-discord httpx shim stops shadowing an installed httpx fix(tests): httpx shim stops shadowing an installed httpx; the ratchet stops reading an aborted chunk as green Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ORGSIM-MIRROR drift check (advisory, fail-soft)

vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest b125db201e54

Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py

…e it ran; drop the stale internal-error entry (151 -> 167)

CI run 45567996955 on this branch, the first Merge Gate run in which chunk
`pmoves [4]` reached its tests: 17 NEW findings, all semantic-cache, all the
same undefined `pmoves.services.semantic_cache` alias as the 11 baselined
test_cache entries (#3529): 9 FAIL in test_cipher_layer, 8 ERROR in test_proxy.
One STALE: `ERROR|pytest|internal`, pytest's own junit record of the abort,
which no longer happens because the CLI now skips under pytest.

Entries copied from the run log, not from --write-baseline (off CI it would
record this machine). Header note says what the silence contained, same shape
as the 2026-08-19 timeout-fallback note.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
@github-actions github-actions Bot added the config pmoves/config(s)/ changes label Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ORGSIM-MIRROR drift check (advisory, fail-soft)

vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 92eb3c29a938

Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py

@POWERFULMOVES POWERFULMOVES left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control ACK (head 7948cfd4987fb900a40c60558114da05aa669971), with one should-fix on the shim: the open Codex P2 thread is real. It does not affect CI and does not block this ACK.

Verified

1. Ratchet unit tests. Ran only the named file:

uv run --no-project --python 3.12 --with-requirements .github/requirements-tests.txt python -m pytest pmoves/tests/tools/test_pytest_ratchet.py -q -p no:cacheprovider
49 passed in 0.40s   EXIT=0

2. Control flow in run_chunk_with_fallback. I read it branch by branch against the old version:

  • Timeout (rc -1) with a report still returns the report unchanged. Without a report it still isolates per file, and a single file still goes to dead. No change.
  • Other rc with a report still returns the report. Without one the group is still dead. No change.
  • rc 3 on a multi-file chunk no longer trusts the partial report. It isolates per file and records the aborting file as ERROR|<path>|<internal-error>, not as dead.
  • rc 3 on a single file returns the partial findings plus the abort finding. parse_junit returns [] for a missing file, so a missing report is safe.
  • The finding's where is the repo-relative path from discover(), with backslashes normalised. The key is stable across OSes, and the detail is excluded from _key.
  • The six new cases cover the partial report, the key, siblings, a single file, abort vs hang, and the detail cap.
  • Behaviour change worth knowing: an rc 3 caused by something shared, such as a plugin or conftest, now yields one NEW finding per file. That is loud, not silent, which is the intent.

3. TTS CLI guard. The "pytest" in sys.modules check is adequate. The module has no test_* callables and only module-level constants, so collection does no network I/O even when gradio_client is installed. gradio_client is not in .github/requirements-tests.txt, so in CI the skip path is what runs. As a CLI, pytest is not imported before the import guard, so the CLI contract is preserved.

4. Baseline (+17 / -1). I took the NEW list from job 139047416278, stripped the timestamps, sorted it, and diffed it against the added + - "..." lines:

ci_new=17  added=17  diff: IDENTICAL
STALE: ERROR|pytest|internal  (the one removed entry)
test_cache entries: 11 on origin/main, 11 on HEAD, byte-identical lines
entry count: 151 -> 167

The run's summary reads 167 total, 150 baselined, 17 new, so the new baseline gives 0 new and 0 stale. That run's 1 produced no report is the pre-existing test_voice_relay_e2e.py timeout, already baselined. The run did not exercise the new exit-3 path: there are no "aborted" lines, because the CLI skipped. That path is proven by unit tests only.

5. Register rows. The tail has the baton RELEASE naming spark-claude, the 5090-CLAUDE CLAIM with a 72h TTL, and the scope-correction NOTE. A scan of the added lines, the commit messages, and the PR body found no IPs, tailnet or internal hostnames, or secret or token env names. validate-register-postdate passes.

6. Governance. Changed files are tests, tooling, the ratchet config, and the register. No service runtime code is touched. All non-merge commits carry Co-Authored-By and Claude-Session trailers.

CI at review time, head 7948cfd:

  • tests (3.11) passes. This is the #3510 fix.
  • Merge Gate python-tests (run 45571167823) is still in progress.
  • claude-review and Analyze (python) are pending.
  • Everything else is green or skipped.

Findings

should-fix (not blocking the gate): Codex P2 on test_shim_isolation.py:24 is real. It is unresolved. When httpx is already in sys.modules as a spec-less stub, importlib.util.find_spec("httpx") raises instead of returning None. Probed on Python 3.12:

SimpleNamespace stub -> ValueError httpx.__spec__ is not set
ModuleType stub      -> ValueError httpx.__spec__ is None

In an httpx-absent environment, which is the case the shim exists for, test_formatting.py installs its SimpleNamespace stub first. test_shim_isolation.py then hits this ValueError in its skipif at collection. A spec-less ModuleType stub from channel-monitor, collected earlier in the same session, would make test_formatting.py raise the same way. CI always has httpx, so neither the gate nor tests (3.11) is affected. The one-line fix is to short-circuit both call sites:

"httpx" not in sys.modules and importlib.util.find_spec("httpx") is None

test_shim_isolation.py would then need skipif("httpx" in sys.modules and not hasattr(sys.modules["httpx"], "Client") or ...), or more simply a try/except ValueError around find_spec. Recommend fixing and resolving the thread before closeout.

follow-up (not this PR): same trap outside publisher-discord. pmoves/tests/test_chit_security.py:11-12 does if "httpx" not in sys.modules: sys.modules["httpx"] = MagicMock(). That is the "imported, not installed" check again, in the pmoves/tests ratchet group. Worth adding to the fastapi/nats follow-up the PR body already lists.

nit: the 06:23:56Z CLAIM scope still says the 11 entries will be dropped. The 07:20:02Z NOTE corrects it, which is the right grammar, so no edit is needed.

-- control-agent for 5090-CLAUDE

…ng's stub); a session-wide abort is one dead group

Two review findings on the previous push, both P2:

- importlib.util.find_spec("httpx") consults sys.modules first and RAISES
  ValueError when the entry there has no __spec__ -- which is what a sibling
  suite's stub looks like. channel-monitor/tests/test_monitor.py installs a bare
  ModuleType("httpx") and sorts before publisher-discord in the same ratchet
  chunk, so in the minimal environment the shim exists for, both
  publisher-discord modules would have become collection errors.
  importlib.machinery.PathFinder.find_spec ignores sys.modules, answers only
  "is the package on sys.path", and never raises. Measured: with a spec-less
  stub in sys.modules, util.find_spec raises "httpx.__spec__ is None";
  PathFinder returns None.

- The ratchet isolated every exit-3 chunk per file. A session-wide
  INTERNALERROR (a conftest or plugin hook raising) aborts identically for
  every file and would have produced N `<internal-error>` findings keying one
  breakage N ways. When every file in a chunk aborts alone, the group is now
  reported once as dead, the same way an unimportable conftest is.

Three more ratchet tests cover the abort-with-no-report branches (per-file and
single-file) and the all-abort collapse. 52 pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
@github-actions

Copy link
Copy Markdown
Contributor

ORGSIM-MIRROR drift check (advisory, fail-soft)

vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 156bd0106815

Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py

@POWERFULMOVES POWERFULMOVES left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control ACK (delta): this review covers only commit a071494 (7948cfd..a071494a8bd3c7f815a2bffd9d977764fb75ee6a). The earlier ACK at 7948cfd stands for everything else. My should-fix from that review is resolved by this commit.

Verified

Scope. The delta touches four files, all tests or tooling: test_formatting.py, test_shim_isolation.py, pytest_ratchet.py, test_pytest_ratchet.py. No baseline, register, or service runtime change. The commit trailers are present.

1. Shim probe now uses importlib.machinery.PathFinder.find_spec. I ran the same probe on Python 3.12 in both environments:

== httpx installed ==
SimpleNamespace stub in sys.modules: PathFinder -> spec   util.find_spec RAISED ValueError httpx.__spec__ is not set
ModuleType stub in sys.modules:      PathFinder -> spec   util.find_spec RAISED ValueError httpx.__spec__ is None
== httpx absent ==
SimpleNamespace stub:                PathFinder -> None   util.find_spec RAISED ValueError
ModuleType stub:                     PathFinder -> None   util.find_spec RAISED ValueError

PathFinder ignores sys.modules, never raises, and gives the right answer either way. Both collection-time call sites are covered: the shim guard and the skipif. The Codex P2 is fixed in substance, so that thread can be resolved.

2. A session-wide abort is reported as one dead group. In run_chunk_with_fallback, the collapse fires only when the chunk has more than one file and every file aborted on its own. The guard against more than one file keeps the single-file rule intact: an aborting single file is still recorded as a finding. If the budget runs out partway, the count of aborted files falls short of the file count. The per-file findings and dead labels are then kept, so nothing is hidden. A dead group still reaches main() as ERROR|<group, chunk suffix stripped>|<pytest-harness>. That makes it loud and stable to ratchet, without N keys for one breakage. The only cost is that partial per-file findings from such a chunk are dropped, which is acceptable because the group key fails the gate anyway.

3. Tests. I ran the same single-file command:

uv run --no-project --python 3.12 --with-requirements .github/requirements-tests.txt python -m pytest pmoves/tests/tools/test_pytest_ratchet.py -q -p no:cacheprovider
52 passed in 0.53s   EXIT=0

The three new cases cover an abort with no report on the per-file path, the same on the single-file path, and every file aborting together collapsing to dead == ["grp"]. The last case keeps its assertion of 1 + 3 calls, which shows each file is still probed before the collapse.

4. PR body. The follow-ups now list test_chit_security.py:11-12 and pinokio_bridge/tests/test_app.py, which assigns to sys.modules at runtime with no restore.

CI at a071494 at review time:

  • validate-register-postdate passes.
  • tests (3.11), Merge Gate python-tests, claude-review, collect and CodeQL are pending.
  • The Merge Gate run at the previous head, 7948cfd (run 45571167823), was also still in progress, so I have not seen a ratchet result against the 167-entry baseline yet.

Findings

  • nit: PathFinder consults only sys.path path hooks. It does not see custom sys.meta_path finders, such as an editable install of httpx. If httpx were installed that way, the shim would install its stub over it. That is very unlikely for httpx and not worth changing. This note records the trade-off.
  • none blocking. Merge is still contingent on the Merge Gate python-tests and tests (3.11) checks going green at a071494.

-- control-agent for 5090-CLAUDE

@POWERFULMOVES
POWERFULMOVES merged commit 14899a3 into main Nov 25, 2026
47 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the fix/httpx-stub-test-pollution branch November 25, 2026 08:20
POWERFULMOVES added a commit that referenced this pull request Nov 25, 2026
 merged 14899a3, tests (3.11) green)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
POWERFULMOVES added a commit that referenced this pull request Nov 25, 2026
…403 gate, claw.task.assign.v1 contract, nats-pub quoting, inbox identity (#3521)

* fix(agent-zero): /events/publish returns 422 for unknown topic or invalid payload

An unregistered topic raised a bare KeyError out of
services.common.events.schema_path() and the supervisor answered HTTP 500.
Measured 2026-11-23 on node 5090 with claw.task.assign.v1.

- events: UnknownTopicError (KeyError subclass, so existing callers keep
  working) plus known_topics(); load_schema() reuses schema_path().
- supervisor route: UnknownTopicError -> 422 with the sorted known-topic
  list and a pointer to pmoves/contracts/topics.json; jsonschema
  ValidationError -> 422 with the message and failing path.
- tests drive the route through the real envelope() validation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* fix(make): nats-pub passes SUBJECT/PAYLOAD as env vars, not recipe text

make pasted $(PAYLOAD) into the shell text, so `test -n "$(PAYLOAD)"` split
on the JSON's own double quotes (any payload with a space failed with
"binary operator expected" / "too many arguments") and '$(PAYLOAD)' broke
on an apostrophe. Both are recipe-scoped exports now, read as
"$NATS_PUB_*" in the shell; $(value ...) keeps a literal $ in the JSON
from being expanded by make. Usage example now carries the required
`task` field.

Test runs the real make with the stub_docker_path recorder and a
nonexistent docker network, asserting the payload is the final docker
argv element byte-for-byte (documented example, apostrophe+spaces,
literal $) and that missing SUBJECT/PAYLOAD fail before docker.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* fix(nats-inbox): default agent id from node identity, not a literal 5090-CODEX

`--agent-id` defaulted to PMOVES_AGENT_ID or the literal "5090-CODEX", so a
node without the env var listened as pmoves-agent-inbox-5090-CODEX and
wrote 5090-CODEX.jsonl (measured on node 5090, 2026-11-23).

Resolution order is now PMOVES_AGENT_ID, PMOVES_REGISTER_IDENTITY, the
node resolver agent_terminal_theme._resolve_whoami (imported, not
copied: the identity node-sitrep prints), then "<hostname>-agent". The
argparse default is lazy so --help and tests never trigger the
resolver's gateway probe; the chosen id and its source go to stderr.

AGENT_ZERO_API.md: /events/publish row documents the new 422s, plus a
receive-path note (fire-and-forget subjects have no receiver until
nats-agent-inbox runs; 2026-11-23: 32 connections, 0 subscribers). The
note lives here because .claude/context/nats-subjects.md is read-only
under the damage-control guard with no Known Road.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* feat(contracts): register claw.task.assign.v1 with its payload schema

The cross-node delegation subject was documented in the NATS subject
catalog but absent from topics.json, so publishing it through the
Agent Zero supervisor failed (500 before the previous commit, 422
unknown_topic after it).

Schema matches the documented payload: required from/to/task,
optional files_released (string[]), after_pr (int[]), note (string),
additionalProperties false like the neighbouring chit schema. Entry
uses the schema/description/publisher/subscriber shape.

Schema added under the `schema` Known Road with reason
handoff:AGENT_COMMS_ROADS_2026-11-23.md.

Tests: contract test (registration, documented example, required
fields, field types, no extra fields) and a route test for the exact
request that failed on node 5090.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(handoffs): AGENT_COMMS_ROADS_2026-11-23 brief — measured comms audit, schema road reason, incident record

Provable reason for the schema Known Road used by 1b32a4e0225 (claw.task.assign.v1
schema). Records the 2026-11-23 comms audit on node 5090, the 07:24Z live-publish
incident with measured blast radius (one subscriber, no leaf/route), its root cause
(Git Bash PATH split at the drive colon bypassed the docker stub), and the
nats-pub correction (fails on spaces/apostrophes, not on the documented example).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(register): 5090-CLAUDE CLAIM + NOTE for fix/agent-comms-roads-2026-11-23

CLAIM 07:17:07Z (three comms-road defects from the 2026-11-23 audit) and NOTE
07:32:28Z (nats-pub statement corrected; 07:24Z live-publish incident with
measured blast radius; schema Known Road grant record).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* fix(agent-zero): claw.* publishes over /events/publish require the supervisor API key

Security review (2026-11-23, MEDIUM, spoofable agent command channel):
registering claw.task.assign.v1 made a command-class topic publishable
through an unauthenticated REST route that previously 500'd on it.

- claw.* topics need X-API-KEY equal to the supervisor's existing
  AGENT_ZERO_API_KEY (the header/key it already uses toward the
  runtime), compared with hmac.compare_digest. 403 otherwise, and 403
  when the key is unset (fail closed). Checked before topic lookup, so
  an unauthenticated caller cannot probe which claw.* topics exist.
- Envelope source for claw.* is fixed to agent-zero-supervisor; a
  client-supplied source is ignored and payload `from` is not used for
  any authorization decision.
- Every other topic keeps its prior behaviour: no key, client source
  honoured.
- AGENT_ZERO_API.md: route row and receive-path note say claw.* over
  HTTP needs the key; raw NATS publish still needs bus credentials.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* fix(contracts): harden claw.task.assign.v1 schema for a command-class topic

Security review 2026-11-23 (MEDIUM, spoofable agent command channel),
schema half; the route half (claw.* needs X-API-KEY, server-side
source) is 04064e7ab95.

- from/to maxLength 64; task maxLength 200 and ^[A-Za-z0-9._:-]+$;
  note maxLength 2000; after_pr items integer >= 1.
- files_released items must be repo-relative: no leading slash or
  backslash, no drive letter, no '..' segment (either separator).
- description states `from` is a claim, never an authorization input.

Tests: traversal/absolute/UNC/drive paths rejected, repo-relative
accepted, every bound checked on both sides of its limit.

Schema edited under the `schema` Known Road with reason
handoff:AGENT_COMMS_ROADS_2026-11-23.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(register): 5090-CLAUDE RELEASE for fix/agent-comms-roads-2026-11-23 (#3521)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* chore(encoding-ratchet): prune services/common/events.py baseline 5 -> 4

This lane folded the two topics.json reads in events.py into one helper,
so the file now carries 4 encoding-less open() sites, not 5. The ratchet
fails on a count that fell below baseline; prune the entry as the
baseline header instructs (no wholesale regenerate).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* fix(agent-zero): compare the command-publish API key as bytes so a non-ASCII key is 403, not 500

Control ACK finding on #3521: hmac.compare_digest on two str raises TypeError
when either is non-ASCII, so a wrong X-API-KEY with a non-ASCII character
surfaced as a 500 instead of the 403 the gate intends. Still fail-closed
(nothing was published), but the wrong status. Compare UTF-8 bytes instead.

Test calls the gate directly, because the HTTP test client refuses to encode
non-ASCII header values before they reach the server.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(register): 5090-CLAUDE RELEASE fix/httpx-stub-test-pollution (#3517 merged 14899a3, tests (3.11) green)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
POWERFULMOVES added a commit that referenced this pull request Nov 25, 2026
…osed, offer to Z890 on record

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS
POWERFULMOVES added a commit that referenced this pull request Nov 28, 2026
…reter move) (#3530)

* ci(python-tests): add a 3.12 column beside 3.11 (step 1 of the interpreter move)

The service-test job ran on a one-entry matrix, so its dependency union and
the service suites were only ever proven on 3.11. Widen the matrix to
['3.11', '3.12'] with fail-fast still false. The job stays advisory: main's
required contexts (classic protection and the ruleset) do not include any
tests (3.x) check, measured 2026-11-25.

Measured 2026-11-25 on origin/main 7679f77:
- merge-gate.yml's python-tests job already runs the ratchet on 3.12.
- Service Dockerfiles with a python:3.x base: 56 reference python:3.11
  (one of them mixes 3.11 and 3.12), 16 are on 3.12, 2 on 3.10.
- The union the install step builds is 31 entries with one pin,
  ruamel.yaml==0.19.1. Resolved for x86_64 Linux with uv pip compile
  --only-binary :all: it succeeds on both 3.11 and 3.12 (79 packages each);
  the only differences are numpy 2.4.6 -> 2.5.5 and scipy 1.17.1 -> 1.18.1.
- The install step has no 3.11 literal or sys.version check; setup-python's
  pip cache key already includes the interpreter version. pmoves/pyproject.toml
  sets no warnings-as-errors filter, and the tested service code imports no
  module removed in 3.12 (distutils, imp, asynchat, asyncore, smtpd) or
  pkg_resources.

The header and the scope test's docstring now name both columns. Historical
mentions of tests (3.11) are left as written. Moving the images is step 2.

Also carries the register CLAIM row for this lane.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(register): 5090-CLAUDE NOTE -- #3511/#3517 ratchet overlap disclosed, offer to Z890 on record

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(register): 5090-CLAUDE RELEASE ci/python-tests-matrix-3.12 (#3530 both columns green; 56 not 57)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

* docs(ops): workflow runner map names both Python Tests columns (3.11, 3.12), both advisory

Codex P2 on #3530: the CI inventory still described a 3.11-only matrix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aNs4q8tajdg1rcgaacrWS

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config pmoves/config(s)/ changes docs Documentation governance AGNOTE register / agent definitions / damage-control hooks services Service source under pmoves/services/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python Tests (tests (3.11)) red on main: flute-gateway fixtures fail with SimpleNamespace has no attribute 'Client'

1 participant