chore: sync the frontend template from a0fbafb to 5434760
Carries eight template commits: the provider sandbox actually running, release
admission to a named environment, the product feature manifest with its runtime
kill switch, architecture and documentation rules that match what is enforced,
the removability fixtures, and the browser, visual and performance evidence.
Product identity is unchanged. `package.json` keeps `tech-log-frontend` and the
catalog keeps the Tech Log naming; the home page was not in the delta. The
visual baselines are this product's own — the template's were excluded from the
transplant and these were regenerated here, where the only difference is the
platform overview's new product-feature section.
What this repository gains operationally: `config/runtime/{local,development,
staging,production}.json` with `FE-GATE-027` refusing an artifact whose runtime
document does not match the environment it is being admitted to, and
`FEATURE_OVERRIDES` for taking an installed feature out of service without a
rebuild.
Verified here: eight gates green, build green, visual 5/5, and 1,858 of 1,859
tests in the suites that do not need a sandbox — the one failure passes in
isolation and is a jsdom lazy-chunk timeout under parallel load. The provider
suites cannot run on this machine at all: `kernel.apparmor_restrict_unprivileged
_userns=1` makes `bwrap --unshare-net` fail, reproducible without any code from
either repository.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
325a2a0843
commit
bdee07a93b
@@ -66,6 +66,76 @@ async function flushMicrotasks(): Promise<void> {
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
describe("runtime request deadline ceiling", () => {
|
||||
/**
|
||||
* `REQUEST_TIMEOUT_MS` was validated by the runtime config schema and then
|
||||
* never handed to the V3 executor, so the deployment dial did nothing and
|
||||
* every operation ran on its contract's own deadline. It is a ceiling: it may
|
||||
* tighten an operation, never loosen one.
|
||||
*/
|
||||
async function settlesWithin(
|
||||
contractDeadlineMs: number,
|
||||
ceilingMs: number | undefined,
|
||||
advanceMs: number,
|
||||
): Promise<boolean> {
|
||||
vi.useFakeTimers();
|
||||
try {
|
||||
const executor = createContractHttpExecutor({
|
||||
baseUrl: "https://api.example/",
|
||||
maxRetryAttempts: 0,
|
||||
...(ceilingMs === undefined ? {} : { requestDeadlineCeilingMs: ceilingMs }),
|
||||
attachCredentials: () => ({ kind: "READY", headers: {} }),
|
||||
// A request that only ever ends by being cut off, so what settles it is
|
||||
// exactly the deadline under test.
|
||||
fetcher: (_input, init) =>
|
||||
new Promise((_resolve, reject) => {
|
||||
const signal = (init as RequestInit | undefined)?.signal;
|
||||
signal?.addEventListener(
|
||||
"abort",
|
||||
() => reject(new DOMException("aborted", "AbortError")),
|
||||
{ once: true },
|
||||
);
|
||||
}),
|
||||
});
|
||||
let settled = false;
|
||||
const pending = executor
|
||||
.execute(operation({ deadlineMs: contractDeadlineMs }), {}, {
|
||||
routeId: ROUTE_ID,
|
||||
scope,
|
||||
})
|
||||
.then(
|
||||
() => { settled = true; },
|
||||
() => { settled = true; },
|
||||
);
|
||||
await vi.advanceTimersByTimeAsync(advanceMs);
|
||||
await flushMicrotasks();
|
||||
const observed = settled;
|
||||
if (!observed) await vi.advanceTimersByTimeAsync(contractDeadlineMs + 1_000);
|
||||
await pending;
|
||||
return observed;
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
}
|
||||
|
||||
it("applies the tighter of the contract and deployment bounds", async () => {
|
||||
await expect(settlesWithin(5_000, 500, 800)).resolves.toBe(true);
|
||||
await expect(settlesWithin(5_000, undefined, 800)).resolves.toBe(false);
|
||||
});
|
||||
|
||||
it("never extends a contract deadline", async () => {
|
||||
await expect(settlesWithin(500, 60_000, 800)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("ignores a ceiling that is not a usable duration", async () => {
|
||||
for (const ceiling of [0, -1, Number.NaN]) {
|
||||
await expect(settlesWithin(5_000, ceiling, 800), String(ceiling)).resolves.toBe(
|
||||
false,
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("descriptor-driven HTTP execution lifetime", () => {
|
||||
it("normalizes a read-side 429 to the non-applicable effect vocabulary", async () => {
|
||||
const executor = createContractHttpExecutor({
|
||||
|
||||
Reference in New Issue
Block a user