chore(wp-0070): dashboard metering header + 8h zero-window evidence
apiFetch sends X-StateHub-Component for legacy-meter attribution. Captured legacy-meter-weekly-review-20260712.json (0 calls / 8h).
This commit is contained in:
parent
34016ee9ac
commit
1acad4c02c
3 changed files with 1694 additions and 2 deletions
|
|
@ -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}`;
|
||||
|
|
|
|||
1682
docs/evidence/legacy-meter-weekly-review-20260712.json
Normal file
1682
docs/evidence/legacy-meter-weekly-review-20260712.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue