chore(wp-0070): dashboard metering header + 8h zero-window evidence
Some checks failed
CI Smoke / host-smoke (push) Successful in 2s
CI Smoke / container-smoke (push) Failing after 12m58s

apiFetch sends X-StateHub-Component for legacy-meter attribution.
Captured legacy-meter-weekly-review-20260712.json (0 calls / 8h).
This commit is contained in:
tegwick 2026-07-12 01:09:43 +02:00
parent 34016ee9ac
commit 1acad4c02c
3 changed files with 1694 additions and 2 deletions

View file

@ -89,7 +89,11 @@ export async function waitForVisible(ms) {
export async function apiFetch(path, options = {}) {
const url = path.startsWith("http") ? path : `${API}${path}`;
const timeout = options.timeout ?? FETCH_TIMEOUT;
const {timeout: _timeout, cache = "no-store", ...fetchOptions} = options;
const {timeout: _timeout, cache = "no-store", headers: callerHeaders, ...fetchOptions} = options;
const headers = new Headers(callerHeaders ?? {});
if (!headers.has("X-StateHub-Component")) {
headers.set("X-StateHub-Component", "state-hub.dashboard");
}
const ctrl = new AbortController();
let timedOut = false;
const timer = setTimeout(() => {
@ -97,7 +101,7 @@ export async function apiFetch(path, options = {}) {
ctrl.abort();
}, timeout);
try {
return await fetch(url, {cache, ...fetchOptions, signal: ctrl.signal});
return await fetch(url, {cache, headers, ...fetchOptions, signal: ctrl.signal});
} catch (error) {
if (timedOut || error?.name === "AbortError") {
const message = `Request timed out after ${Math.round(timeout / 1000)}s: ${url}`;

File diff suppressed because it is too large Load diff

View file

@ -155,6 +155,12 @@ Fixed `the-custodian/runtime/actions.py` + daily triage prompt to emit
`workplan_id`; rebuilt dashboard `dist/` (removed stale `extensions.html`
`/workstreams/` caller).
Progress 2026-07-12: Fresh 8h capture (`legacy-meter-weekly-review-20260712.json`)
**0 calls** in window for all 18 legacy interfaces; retirement candidates
at max. Dashboard `apiFetch` now sends `X-StateHub-Component: state-hub.dashboard`;
`dist/` rebuilt. MCP alias removal (T03) still gated on 7 consecutive 8h zero
windows (streak ≥3 since 2026-07-10 decline).
## Task: Closeout and fleet gate
```task