Side finding (29 Oct): pruefwerk-agent-stage logged platform token rejected: failed to decode JWT header: InvalidToken about 12 times per burst.
Diagnosis (SigNoz):
The 401s were root spans (no traceparent), always 5× POST /api/v1/platform/tenants/{id}/provision and then 1× GET …/targets, spread over ~4 minutes, at irregular times.
They matched the registry test runs: CI on #106 at 17:15 UTC, and my local suite run at 17:33 UTC.
Cause:
The migrations seed the real catalog URLs (0005: https://pruefwerk-stage.breakpilot.com/api/v1/platform/tenants/{id}/provision).
The test config's Env: "dev" reads as stage in Server.env().
So every postgres test that activates Prüfwerk for a tenant provisioned at the live stage Prüfwerk, using the Keycloak mock's non-JWT token. The memory store has no provision URLs, so its half of the tests never did.
Fix:newPostgresHarness clears provision_urls after migrating, so both stores behave the same, and tests that need a URL set it themselves. The tests no longer depend on the network, and they no longer send fictitious test tenants to stage.
Checked: the full suite passes (memory + postgres via testcontainers), and that local run left no request in pruefwerk-agent-stage's traces (before: 6 per run).
Side finding (29 Oct): `pruefwerk-agent-stage` logged `platform token rejected: failed to decode JWT header: InvalidToken` about 12 times per burst.
**Diagnosis (SigNoz):**
- The 401s were root spans (no traceparent), always 5× `POST /api/v1/platform/tenants/{id}/provision` and then 1× `GET …/targets`, spread over ~4 minutes, at irregular times.
- They matched the registry test runs: CI on #106 at 17:15 UTC, and my local suite run at 17:33 UTC.
**Cause:**
- The migrations seed the real catalog URLs (0005: `https://pruefwerk-stage.breakpilot.com/api/v1/platform/tenants/{id}/provision`).
- The test config's `Env: "dev"` reads as `stage` in `Server.env()`.
- So every **postgres** test that activates Prüfwerk for a tenant provisioned at the live stage Prüfwerk, using the Keycloak mock's non-JWT token. The memory store has no provision URLs, so its half of the tests never did.
**Fix:** `newPostgresHarness` clears `provision_urls` after migrating, so both stores behave the same, and tests that need a URL set it themselves. The tests no longer depend on the network, and they no longer send fictitious test tenants to stage.
**Checked:** the full suite passes (memory + postgres via testcontainers), and that local run left **no** request in pruefwerk-agent-stage's traces (before: 6 per run).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
pruefwerk-agent-stage logged 'platform token rejected: failed to decode
JWT header' in bursts of five provisions and one targets read, each time
the registry's tests ran (CI and local). The migrations seed the real
provision URLs (0005: pruefwerk-stage), a test config's env 'dev' reads
as 'stage', so every postgres test that provisioned a tenant called the
live endpoint with the Keycloak mock's non-JWT token and got 401.
The postgres harness clears provision_urls after migrating, as the
memory store has none; tests that need one set it themselves. Checked:
a full local run with postgres left no request in Prüfwerk's traces.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
sharang
changed title from test: the postgres harness no longer provisions at the live stage Prüfwerk to test: postgres harness no longer provisions at the live stage Prüfwerk2026-10-30 07:31:12 +00:00
sharang
merged commit 1691bf1be3 into main2026-10-30 07:58:35 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Side finding (29 Oct):
pruefwerk-agent-stageloggedplatform token rejected: failed to decode JWT header: InvalidTokenabout 12 times per burst.Diagnosis (SigNoz):
POST /api/v1/platform/tenants/{id}/provisionand then 1×GET …/targets, spread over ~4 minutes, at irregular times.Cause:
https://pruefwerk-stage.breakpilot.com/api/v1/platform/tenants/{id}/provision).Env: "dev"reads asstageinServer.env().Fix:
newPostgresHarnessclearsprovision_urlsafter migrating, so both stores behave the same, and tests that need a URL set it themselves. The tests no longer depend on the network, and they no longer send fictitious test tenants to stage.Checked: the full suite passes (memory + postgres via testcontainers), and that local run left no request in pruefwerk-agent-stage's traces (before: 6 per run).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
1442355a52toe8fc5c4293test: the postgres harness no longer provisions at the live stage Prüfwerkto test: postgres harness no longer provisions at the live stage Prüfwerk