milestone 33: contract closure — samples, file-authority enumeration, dead code, bundle ceiling
Gates / frontend (push) Successful in 1m34s
Gates / test (push) Successful in 2m3s
Gates / test-aarch64 (push) Failing after 3h13m33s
Gates / package (push) Successful in 5m20s
Gates / container (push) Successful in 15s
CI / gates (push) Failing after 6h30m45s
Gates / frontend (push) Successful in 1m34s
Gates / test (push) Successful in 2m3s
Gates / test-aarch64 (push) Failing after 3h13m33s
Gates / package (push) Successful in 5m20s
Gates / container (push) Successful in 15s
CI / gates (push) Failing after 6h30m45s
This commit is contained in:
@@ -5,7 +5,7 @@ import { AuthProvider } from "@/auth/store";
|
||||
import { createQueryClient } from "@/lib/queryClient";
|
||||
import { createAppRouter } from "@/routes";
|
||||
import type { QueryDetail } from "@/lib/types";
|
||||
import { provenance } from "@/features/queries/provenanceFixture";
|
||||
import { provenance } from "@/features/provenance/provenanceFixture";
|
||||
import { health } from "@/lib/healthFixture";
|
||||
|
||||
function detail(id: number, sections: Parameters<typeof provenance>[0] = {}): QueryDetail {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { createQueryClient } from "@/lib/queryClient";
|
||||
import { createAppRouter } from "@/routes";
|
||||
import { health } from "@/lib/healthFixture";
|
||||
import type { Client, Coverage, QueriesPage, QueryRow } from "@/lib/types";
|
||||
import { queryRow } from "@/features/queries/provenanceFixture";
|
||||
import { queryRow } from "@/features/provenance/provenanceFixture";
|
||||
|
||||
function client(id: number, ip: string, name: string, learnedName: string): Client {
|
||||
return {
|
||||
|
||||
@@ -15,7 +15,7 @@ import InlineError from "@/lib/InlineError";
|
||||
import { queriesInfiniteQuery } from "@/lib/queries";
|
||||
import type { QueryRow } from "@/lib/types";
|
||||
import { useClientNames } from "@/features/clients/clientNames";
|
||||
import { summarizeRow } from "@/features/queries/querySummary";
|
||||
import { summarizeRow } from "@/features/provenance/querySummary";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
import { ActivityCells, ActivityTableHead, activityDomainLink } from "./cells";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { AuthProvider } from "@/auth/store";
|
||||
import { createQueryClient } from "@/lib/queryClient";
|
||||
import { createAppRouter } from "@/routes";
|
||||
import type { Client } from "@/lib/types";
|
||||
import { provenance, queryRow } from "@/features/queries/provenanceFixture";
|
||||
import { provenance, queryRow } from "@/features/provenance/provenanceFixture";
|
||||
import { health } from "@/lib/healthFixture";
|
||||
import { FakeEventSource } from "./fakeEventSource";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import * as stylex from "@stylexjs/stylex";
|
||||
import { useClientNames } from "@/features/clients/clientNames";
|
||||
import { summarizeEvent } from "@/features/queries/querySummary";
|
||||
import { summarizeEvent } from "@/features/provenance/querySummary";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
import { ActivityCells, ActivityTableHead, activityDomainLink } from "./cells";
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
qclassName,
|
||||
rcodeName,
|
||||
routeKindLabel,
|
||||
} from "@/features/queries/provenanceCopy";
|
||||
import { qtypeName } from "@/features/queries/qtype";
|
||||
} from "@/features/provenance/provenanceCopy";
|
||||
import { qtypeName } from "@/features/provenance/qtype";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import type { QueryRow } from "@/lib/types";
|
||||
import type { ClientNames } from "@/features/clients/clientNames";
|
||||
import { queryRow } from "@/features/queries/provenanceFixture";
|
||||
import { summarizeRow, type QuerySummary } from "@/features/queries/querySummary";
|
||||
import { queryRow } from "@/features/provenance/provenanceFixture";
|
||||
import { summarizeRow, type QuerySummary } from "@/features/provenance/querySummary";
|
||||
import { ACTIVITY_COLUMNS, ActivityCells, ActivityTableHead, resultLabel, routeLabel } from "./cells";
|
||||
|
||||
const noNames: ClientNames = new Map();
|
||||
|
||||
@@ -17,9 +17,9 @@ import * as stylex from "@stylexjs/stylex";
|
||||
import { formatMicros, formatTime } from "@/lib/format";
|
||||
import type { RouteKind } from "@/lib/types";
|
||||
import { ClientName, type ClientNames } from "@/features/clients/clientNames";
|
||||
import { rcodeShortName } from "@/features/queries/provenanceCopy";
|
||||
import { qtypeName } from "@/features/queries/qtype";
|
||||
import type { QuerySummary } from "@/features/queries/querySummary";
|
||||
import { rcodeShortName } from "@/features/provenance/provenanceCopy";
|
||||
import { qtypeName } from "@/features/provenance/qtype";
|
||||
import type { QuerySummary } from "@/features/provenance/querySummary";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import { diagnosticsBounds, relatedBounds, RELATED_WINDOW_SECONDS } from "./relatedLinks";
|
||||
import { queriesFilterOf, validateActivitySearch } from "./search";
|
||||
|
||||
const TS = 1_700_000_000;
|
||||
|
||||
test("an unbounded origin falls back to the window either side of the query", () => {
|
||||
expect(relatedBounds(TS, { since: undefined, until: undefined })).toEqual({
|
||||
since: TS - RELATED_WINDOW_SECONDS,
|
||||
until: TS + RELATED_WINDOW_SECONDS,
|
||||
});
|
||||
});
|
||||
|
||||
test("a bounded origin carries both of its bounds through unchanged", () => {
|
||||
expect(relatedBounds(TS, { since: 1, until: 2 })).toEqual({ since: 1, until: 2 });
|
||||
});
|
||||
|
||||
test("a half-bounded origin keeps its half and falls back on the other", () => {
|
||||
expect(relatedBounds(TS, { since: 1, until: undefined })).toEqual({
|
||||
since: 1,
|
||||
until: TS + RELATED_WINDOW_SECONDS,
|
||||
});
|
||||
expect(relatedBounds(TS, { since: undefined, until: 2 })).toEqual({
|
||||
since: TS - RELATED_WINDOW_SECONDS,
|
||||
until: 2,
|
||||
});
|
||||
});
|
||||
|
||||
test("an origin bound of zero is a bound, not a missing one", () => {
|
||||
expect(relatedBounds(TS, { since: 0, until: 0 })).toEqual({ since: 0, until: 0 });
|
||||
});
|
||||
|
||||
test("the diagnostics window is the fixed window either side of the query, never inherited", () => {
|
||||
expect(diagnosticsBounds(TS)).toEqual({ since: TS - RELATED_WINDOW_SECONDS, until: TS + RELATED_WINDOW_SECONDS });
|
||||
expect(diagnosticsBounds(0)).toEqual({ since: -RELATED_WINDOW_SECONDS, until: RELATED_WINDOW_SECONDS });
|
||||
});
|
||||
|
||||
/**
|
||||
* The admin half of the server's `since <= ts < until` window contract
|
||||
* (queries_repo.zig): what a related link emits has to survive the validation
|
||||
* the Activity route puts every search through, or the link would silently open
|
||||
* a wider window than it named. Inclusion at the edges is the server's property
|
||||
* and is tested there; this pins that the bounds arrive intact.
|
||||
*/
|
||||
test("bounds emitted by a related link round-trip through the Activity search to the same filter", () => {
|
||||
const origin = { since: undefined, until: TS + 3_600 };
|
||||
const emitted = { mode: "history", domain: "ads.example.com", ...relatedBounds(TS, origin) };
|
||||
|
||||
const applied = validateActivitySearch(emitted);
|
||||
|
||||
expect(applied.mode).toBe("history");
|
||||
expect(applied.since).toBe(emitted.since);
|
||||
expect(applied.until).toBe(emitted.until);
|
||||
expect(queriesFilterOf(applied)).toEqual({
|
||||
domain: "ads.example.com",
|
||||
since: TS - RELATED_WINDOW_SECONDS,
|
||||
until: TS + 3_600,
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Provenance, QueryRow } from "@/lib/types";
|
||||
import { provenance, queryRow } from "@/features/queries/provenanceFixture";
|
||||
import { provenance, queryRow } from "@/features/provenance/provenanceFixture";
|
||||
import { RING_CAPACITY, mergeGap, pushRow, summaryOf, type LiveRow } from "./ringBuffer";
|
||||
|
||||
function streamed(key: number, ts: number, domain: string, sections: Parameters<typeof provenance>[0] = {}): LiveRow {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LiveQueryEvent, QueryRow } from "@/lib/types";
|
||||
import { summarizeEvent, summarizeRow, type QuerySummary } from "@/features/queries/querySummary";
|
||||
import { summarizeEvent, summarizeRow, type QuerySummary } from "@/features/provenance/querySummary";
|
||||
|
||||
/**
|
||||
* A row in the live buffer. `key` is a client-side monotonic counter, because
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { act, renderHook, waitFor } from "@testing-library/react";
|
||||
import { ApiError } from "@/lib/api";
|
||||
import type { QueriesPage, QueryRow } from "@/lib/types";
|
||||
import { provenance, queryRow } from "@/features/queries/provenanceFixture";
|
||||
import { provenance, queryRow } from "@/features/provenance/provenanceFixture";
|
||||
import { summaryOf, type LiveRow } from "./ringBuffer";
|
||||
import { FakeEventSource } from "./fakeEventSource";
|
||||
import { CAP_ERROR_THRESHOLD, useLiveQueries } from "./useLiveQueries";
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as stylex from "@stylexjs/stylex";
|
||||
import { useNavigate, useSearch } from "@tanstack/react-router";
|
||||
import CoverageNotice from "@/lib/CoverageNotice";
|
||||
import InlineError from "@/lib/InlineError";
|
||||
import { qtypeName } from "@/features/queries/qtype";
|
||||
import { qtypeName } from "@/features/provenance/qtype";
|
||||
import type { Period, StatsRoutes, StatsTypes } from "@/lib/types";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
|
||||
Reference in New Issue
Block a user