Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
4350c92
feat(web): add favorite model shortcuts above conversations
Mjones13 Sep 29, 2026
9fc359c
feat(web): add composer reasoning effort shortcuts
Mjones13 Sep 29, 2026
5497608
docs(usage): propose request-level token analysis boundary
Mjones13 Oct 1, 2026
83330df
feat(usage): add short presets and custom date ranges
Mjones13 Oct 1, 2026
1ec4639
feat(web): review delayed voice prompts before sending
Mjones13 Oct 1, 2026
6d98169
Merge guarded native creation source into voice review UI
Mjones13 Oct 2, 2026
d1b513e
Register voice review integration checks
Mjones13 Oct 2, 2026
91a2214
Qualify voice bridge native boundaries with Effect diagnostics
Mjones13 Oct 2, 2026
8a727bc
fix(web): size expanded markdown tables to their content
Mjones13 Oct 2, 2026
4ecca48
fix(web): preserve thread titles when host badges do not fit
Mjones13 Oct 2, 2026
48997db
Merge pull request #46 from Jones-Systems/work/table-content-width-20…
Mjones13 Oct 2, 2026
5b8f0ad
Merge pull request #45 from Jones-Systems/work/voice-prompt-review-20…
Mjones13 Oct 2, 2026
ec92778
feat(updates): stage and explicitly install qualified Jones main builds
Mjones13 Oct 2, 2026
7317092
Merge main into qualified Jones updater
Mjones13 Oct 2, 2026
f62b8fe
fix(updates): preserve shared routes during main integration
Mjones13 Oct 2, 2026
6b4daa0
fix(updates): observe state after environment connection becomes ready
Mjones13 Oct 2, 2026
b7506df
test(updates): model a pending host state subscription
Mjones13 Oct 2, 2026
0aad9e3
fix(updates): qualify packaging types and missing host identity
Mjones13 Oct 2, 2026
87ba8d9
Merge pull request #47 from Jones-Systems/work/netdata-header-fit-202…
Mjones13 Oct 2, 2026
d358fee
fix(web): send the next queued message on empty composer Enter
Mjones13 Oct 2, 2026
a62e2b7
test(updates): qualify legacy update fixtures and Jones bulk exclusion
Mjones13 Oct 2, 2026
f7a309d
Merge branch 'main' into feat/programmatic-token-info-proposal
Mjones13 Oct 2, 2026
fcfaff7
Merge branch 'main' into feat/favorite-model-shortcuts-20260929
Mjones13 Oct 2, 2026
3ff278d
Merge pull request #50 from Jones-Systems/work/queued-empty-enter-202…
Mjones13 Oct 2, 2026
54b0a6e
fix(updates): preserve Release eligibility and desktop continuation p…
Mjones13 Oct 2, 2026
d39ef5e
Merge commit '3ff278d48d59b4e2827fc4af788b473b34e5f6b8' into work/jon…
Mjones13 Oct 2, 2026
172b9f4
fix(usage): render short ranges and preserve exact DST bounds
Mjones13 Oct 2, 2026
ee26c7c
Merge branch 'main' into feat/favorite-model-shortcuts-20260929
Mjones13 Oct 2, 2026
0e8e215
Merge pull request #49 from Jones-Systems/work/jones-qualified-update…
Mjones13 Oct 2, 2026
157eb30
Merge pull request #32 from Jones-Systems/feat/programmatic-token-inf…
Mjones13 Oct 2, 2026
9cd4570
feat(web): add compact provider account shortcuts beside composer
Mjones13 Oct 2, 2026
cef9b3c
Merge commit '157eb30a74a10066df075e203f412634c60e0fa6' into feat/fav…
Mjones13 Oct 2, 2026
be97255
Merge current provider controls into reasoning shortcuts
Mjones13 Oct 2, 2026
ba3a036
feat(web): expand provider and model usage details
Mjones13 Oct 2, 2026
03b5f5a
Merge commit '157eb30a74a10066df075e203f412634c60e0fa6' into work/usa…
Mjones13 Oct 2, 2026
cce64e1
fix(web): keep Antigravity shortcuts on the session account
Mjones13 Oct 2, 2026
e5a31ac
Merge pull request #51 from Jones-Systems/work/usage-provider-details…
Mjones13 Oct 2, 2026
c9eb153
Merge commit 'e5a31aceec91484b64315c63dcce80f6e7581604' into feat/fav…
Mjones13 Oct 2, 2026
f2b2eca
fix(web): keep composer shortcut implementation exports private
Mjones13 Oct 2, 2026
f6090d7
feat(web): align reasoning shortcuts with provider model traits
Mjones13 Oct 2, 2026
d8a7b29
feat(web): add editable image zoom controls
Mjones13 Oct 2, 2026
25201ea
Merge commit 'f2b2eca953e7008d3c7aac5c065f6f2ed54dfa8d' into feat/rea…
Mjones13 Oct 2, 2026
61a972e
fix(desktop): hash native Jones bundles outside the ASAR filesystem
Mjones13 Oct 2, 2026
74f0858
Merge pull request #52 from Jones-Systems/feat/image-zoom-controls-20…
Mjones13 Oct 2, 2026
499e199
fix(server): inspect and stage native ASAR bytes under Electron
Mjones13 Oct 2, 2026
1d02f1f
feat: add bounded saved token accounting server reader
Mjones13 Oct 2, 2026
eb6c638
Merge current usage details into saved accounting reader
Mjones13 Oct 2, 2026
375b16d
feat(contracts): classify operating native threads consistently
Mjones13 Oct 2, 2026
fcd42e4
Merge pull request #53 from Jones-Systems/work/jones-settings-persist…
Mjones13 Oct 2, 2026
045ad02
docs(updates): explain stable home and profile continuity
Mjones13 Oct 2, 2026
59257e0
docs(updates): distinguish profile recovery from cross-host authentic…
Mjones13 Oct 2, 2026
8c26990
feat(web): filter sidebar threads by operating activity
Mjones13 Oct 2, 2026
d4e992b
Merge commit '375b16d0746a303194a935955985851f765e57ac' into work/act…
Mjones13 Oct 2, 2026
0f28500
fix(web): use themed activity pill colors and tooltip
Mjones13 Oct 2, 2026
e96a505
Merge pull request #55 from Jones-Systems/work/jones-settings-persist…
Mjones13 Oct 2, 2026
b3563a8
feat: display explicitly loaded saved accounting reports
Mjones13 Oct 2, 2026
5ab745a
feat(web): add PDF side-panel zoom and simplify image controls
Mjones13 Oct 2, 2026
da603a6
Merge pull request #15 from Jones-Systems/feat/favorite-model-shortcu…
Mjones13 Oct 2, 2026
5142754
Merge remote-tracking branch 'refs/remotes/origin/main' into feat/rea…
Mjones13 Oct 2, 2026
eeeed1a
Merge pull request #58 from Jones-Systems/feat/side-panel-zoom-20261002
Mjones13 Oct 2, 2026
2bfbe07
test(web): model immutable accounting presentation updates
Mjones13 Oct 2, 2026
9739db9
feat(mcp): expose bounded decision snapshots and native activity counts
Mjones13 Oct 2, 2026
a1cf302
Merge commit 'eeeed1a3fbc4d62199f6438c2fd46938e52d4ee1' into work/dec…
Mjones13 Oct 2, 2026
9810712
Merge commit 'a1cf3024a91b93e22f9ca5f0fe67571b678a1fbb' into work/act…
Mjones13 Oct 2, 2026
ca3c0d2
Merge pull request #17 from Jones-Systems/feat/reasoning-shortcuts-20…
Mjones13 Oct 2, 2026
622cd50
feat(workstreams): integrate native registration and guarded enrollment
Mjones13 Oct 2, 2026
53250d3
Merge commit 'ca3c0d2401a11bdb44d0bbff2d70bac099022af2' into work/nat…
Mjones13 Oct 2, 2026
c3817e9
Merge pull request #54 from Jones-Systems/work/saved-token-accounting…
Mjones13 Oct 2, 2026
81c167d
test(workstreams): qualify the six-entry fork migration ledger
Mjones13 Oct 2, 2026
0ec8261
Merge commit 'c3817e91a3a9f9ebe2b9496cb226e3607d82f619' into work/nat…
Mjones13 Oct 2, 2026
8de693b
Merge pull request #60 from Jones-Systems/work/native-workstreams-con…
Mjones13 Oct 2, 2026
fa521d2
Overlap native counts with snapshot collectors and preserve nested cl…
Mjones13 Oct 2, 2026
e64acc2
Merge commit '8de693b103e6fb69e7a8b07775a9dbbab8d0f149' into work/dec…
Mjones13 Oct 2, 2026
6f0af5c
Merge commit 'e64acc260ceea8e000f2b43478a6822934aa223f' into work/act…
Mjones13 Oct 2, 2026
daa3d69
Merge pull request #56 from Jones-Systems/work/decision-telemetry-202…
Mjones13 Oct 2, 2026
1481183
Merge pull request #57 from Jones-Systems/work/active-thread-sidebar-…
Mjones13 Oct 2, 2026
e3cf5cb
feat: compose contextual voice review and stable queue contracts
Mjones13 Oct 2, 2026
7b3990f
Merge commit '14811831cc8ca090257d3b8ddd127a2841179c40' into work/voi…
Mjones13 Oct 2, 2026
806ef12
style: format merged affected-check catalog
Mjones13 Oct 2, 2026
1f71f79
fix(voice-review): remove unused client exports
Mjones13 Oct 2, 2026
a90a41c
fix(voice-review): use native test and tooltip conventions
Mjones13 Oct 2, 2026
3a1bfef
chore(upstream): sync T3 Code before New Orchestrator
Mjones13 Oct 2, 2026
3be4ace
Use Effect clocks and tagged failures in voice review
Mjones13 Oct 2, 2026
5c79e0d
Merge pull request #65 from Jones-Systems/work/voice-system-board-202…
Mjones13 Oct 2, 2026
372112d
fix(ci): restore isolated client-runtime test step
Mjones13 Oct 2, 2026
cbc1632
Merge pull request #67 from Jones-Systems/sync/upstream-before-orches…
Mjones13 Oct 3, 2026
d0bb50a
chore(upstream): publish new orchestrator integration checkpoint
Mjones13 Oct 3, 2026
1adefad
docs: clarify Jones Code guidance and source setup
Mjones13 Oct 3, 2026
2974ea1
docs: align README navigation table formatting
Mjones13 Oct 3, 2026
ca7c110
Merge pull request #79 from Jones-Systems/docs/repository-guidance-20…
Mjones13 Oct 3, 2026
30ba460
chore(orchestrator): checkpoint upstream integration with Jones behavior
Mjones13 Oct 4, 2026
14c6033
fix(server): complete orchestrator runtime and fixture integration
Mjones13 Oct 4, 2026
4516003
fix(orchestrator): publish verified runtime integration checkpoint
Mjones13 Oct 4, 2026
101a484
fix(orchestration): reconcile current main with V2 runtime
Mjones13 Oct 4, 2026
ae25e5d
fix(orchestration): publish main-compatible V2 integration
Mjones13 Oct 4, 2026
729666a
feat(web): add submitted-work queue mock page
Mjones13 Oct 3, 2026
a23b4f8
feat(web): add mock item pause and submitted history
Mjones13 Oct 3, 2026
a73f9e0
fix(web): open queue preview without required pairing
Mjones13 Oct 3, 2026
ebe9f5b
test(web): cover both bundled queue startup branches
Mjones13 Oct 4, 2026
361b945
Show authenticated sampled agent queue metadata in Submitted work
Mjones13 Oct 4, 2026
cbffbe7
Preserve producer wire bytes in cross-language metadata fixture
Mjones13 Oct 4, 2026
348ba8c
Classify queue sample freshness after reading and honor Effect checks
Mjones13 Oct 4, 2026
7f9c99a
Align queue metadata checks with Effect and lint conventions
Mjones13 Oct 4, 2026
94006d8
Document raw JSON fixture diagnostic exception
Mjones13 Oct 4, 2026
b9f4971
fix(contracts): preserve Workstreams schema byte pins
Mjones13 Oct 4, 2026
0071978
test(contracts): allow synchronous pinned fixture byte checks
Mjones13 Oct 4, 2026
05f464f
feat(jones): port authenticated queue metadata into isolated modules
Mjones13 Oct 7, 2026
67596c3
merge: preserve PR113 history while superseding obsolete inherited so…
Mjones13 Oct 7, 2026
f3d7b62
merge: adapt PR113 queue metadata above native metadata
Mjones13 Oct 7, 2026
8b94b4f
merge: carry parent manifest formatting into PR113
Mjones13 Oct 7, 2026
6371d0a
style(jones): format converted queue contract and manifest
Mjones13 Oct 7, 2026
b07fb5f
merge: preserve HTTP registration repair in queue metadata
Mjones13 Oct 7, 2026
8396802
Merge commit 'd4a8f85c7cf97215106d285e2a2dff34a8dc3c7f' into work/jon…
Mjones13 Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/server/src/environment/ServerEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ export const make = Effect.gen(function* () {
serverVersion: packageJson.version,
orchestrationProtocolVersion: ORCHESTRATION_PROTOCOL_VERSION,
capabilities: {
workQueueMetadata: true,
repositoryIdentity: true,
connectionProbe: true,
worktreeDefaultBase: true,
Expand Down
5 changes: 5 additions & 0 deletions apps/server/src/jones/http/registration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as ProjectionStoreV2 from "../../orchestration-v2/ProjectionStore.ts";
import * as ServerEnvironment from "../../environment/ServerEnvironment.ts";
import * as WorkQueueMetadataService from "../workQueueMetadata/WorkQueueMetadataService.ts";
import { workQueueMetadataHttpApiLayer } from "../workQueueMetadata/http.ts";
import * as Layer from "effect/Layer";
import { conversationLibraryHttpApiLayer } from "../../conversations/http.ts";
import * as HostStatus from "../../hostStatus/HostStatus.ts";
Expand All @@ -13,6 +15,9 @@ export { voiceReviewResponseHeadersLayer } from "../../voiceReview/http.ts";

export const provideConversationAndVoiceReview = <A, E, R>(api: Layer.Layer<A, E, R>) =>
api.pipe(
Layer.provide(
workQueueMetadataHttpApiLayer.pipe(Layer.provide(WorkQueueMetadataService.layer)),
),
Layer.provide(conversationLibraryHttpApiLayer),
Layer.provide(
voiceReviewHttpApiLayer.pipe(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
// @effect-diagnostics nodeBuiltinImport:off preferSchemaOverJson:off - Synthetic native JSON fixtures exercise malformed shapes, exact digest bytes, descriptor permissions, symlink rejection, and scoped cleanup at the reader boundary.
import { describe, expect, it } from "@effect/vitest";
import { vi } from "vite-plus/test";
import * as Effect from "effect/Effect";
import * as Clock from "effect/Clock";
import * as Fiber from "effect/Fiber";
import * as Schema from "effect/Schema";
import * as TestClock from "effect/testing/TestClock";
import * as NodeCrypto from "node:crypto";
import * as NodeFSP from "node:fs/promises";
import * as NodeOS from "node:os";
import * as NodePath from "node:path";
import { WorkQueueMetadata, WORK_QUEUE_METADATA_MAX_BYTES } from "@t3tools/contracts";
import * as Service from "./WorkQueueMetadataService.ts";
import { workQueueMetadataConfig, type WorkQueueMetadataConfig } from "./config.ts";

const decodeMetadata = Schema.decodeUnknownSync(WorkQueueMetadata);
const sampledNow = 100_000;
const source = {
queue_id: "queue",
host_id: "host",
environment_ref: "environment",
exporter_instance_id: "exporter",
};
function artifact(change: Record<string, unknown> = {}) {
const value = {
schema: "codex.t3-work-queue-metadata/v1",
source,
observed_at_ms: sampledNow - 10,
coverage: "complete",
items: [],
authority_effect: "none",
...change,
};
const canonical = (input: unknown): string =>
Array.isArray(input)
? `[${input.map(canonical).join(",")}]`
: input !== null && typeof input === "object"
? `{${Object.entries(input)
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
.map(([key, child]) => `${JSON.stringify(key)}:${canonical(child)}`)
.join(",")}}`
: JSON.stringify(input);
return {
...value,
snapshot_token: NodeCrypto.createHash("sha256").update(canonical(value)).digest("hex"),
};
}
const read = (config: WorkQueueMetadataConfig) =>
Effect.flatMap(Service.WorkQueueMetadataService, (service) => service.snapshot).pipe(
Effect.provide(Service.layerWithConfig(config)),
);
const fixture = <A, E, R>(
run: (path: string, config: WorkQueueMetadataConfig) => Effect.Effect<A, E, R>,
) =>
Effect.acquireUseRelease(
Effect.promise(() =>
NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "work-queue-metadata-test-")),
),
(directory) =>
Effect.gen(function* () {
yield* TestClock.setTime(sampledNow);
const path = NodePath.join(directory, "snapshot.json");
return yield* run(path, { status: "configured", path, source, maxAgeMs: 30_000 });
}),
(directory) => Effect.promise(() => NodeFSP.rm(directory, { recursive: true, force: true })),
);

describe("configured queue metadata service", () => {
it.effect.each([
[1_500, "ready"],
[500, "stale"],
] as const)(
"classifies observation %i using the clock after asynchronous artifact reading",
([observedAt, status]) =>
fixture((path) =>
Effect.gen(function* () {
const value = artifact({ observed_at_ms: observedAt });
yield* Effect.promise(() =>
NodeFSP.writeFile(path, JSON.stringify(value), { mode: 0o600 }),
);
let now = 1_000;
const baseClock = yield* Clock.Clock;
const clock: Clock.Clock = {
...baseClock,
currentTimeMillisUnsafe: () => now,
currentTimeMillis: Effect.sync(() => now),
};
const result = yield* read({ status: "configured", path, source, maxAgeMs: 1_000 }).pipe(
Effect.provideService(Clock.Clock, clock),
Effect.forkChild({ startImmediately: true }),
);
now = 2_000;
expect(yield* Fiber.join(result)).toEqual({
status,
snapshot: value,
expires_at_ms: observedAt + 1_000,
});
}),
),
);
it.effect(
"validates the exact Python producer bytes and digest while reporting their sample as stale",
() =>
fixture((path) =>
Effect.gen(function* () {
const bytes = yield* Effect.promise(() =>
NodeFSP.readFile(
new URL(
"../../../../../packages/contracts/src/jones/fixtures/work_queue_metadata_v1.json.fixture",
import.meta.url,
),
),
);
const snapshot = decodeMetadata(JSON.parse(bytes.toString("utf8")));
yield* Effect.promise(() => NodeFSP.writeFile(path, bytes, { mode: 0o600 }));
expect(
yield* read({ status: "configured", path, source: snapshot.source, maxAgeMs: 30_000 }),
).toEqual({
status: "stale",
snapshot,
expires_at_ms: 30_100,
});
}),
),
);
it.effect("returns explicit unconfigured and invalid configuration outcomes", () =>
Effect.gen(function* () {
expect(yield* read(workQueueMetadataConfig({}))).toEqual({
status: "unconfigured",
reason: "not_configured",
});
for (const env of [
{ T3CODE_WORK_QUEUE_METADATA_PATH: "relative" },
{
T3CODE_WORK_QUEUE_METADATA_PATH: "/synthetic",
T3CODE_WORK_QUEUE_METADATA_MAX_AGE_MS: "NaN",
},
])
expect(yield* read(workQueueMetadataConfig(env))).toEqual({
status: "unavailable",
reason: "invalid_configuration",
});
}),
);
it.effect(
"distinguishes complete, partial and stale samples and preserves observation identity",
() =>
fixture((path, config) =>
Effect.gen(function* () {
for (const [change, status] of [
[{}, "ready"],
[{ coverage: "partial" }, "partial"],
[{ observed_at_ms: sampledNow - 60_000 }, "stale"],
] as const) {
const value = artifact(change);
yield* Effect.promise(() =>
NodeFSP.writeFile(path, JSON.stringify(value), { mode: 0o600 }),
);
expect(yield* read(config)).toMatchObject({
status,
snapshot: value,
expires_at_ms: value.observed_at_ms + 30_000,
});
}
}),
),
);
it.effect("rejects wrong source, future sample, corrupted digest and private metadata", () =>
fixture((path, config) =>
Effect.gen(function* () {
for (const [value, reason] of [
[artifact({ source: { ...source, host_id: "other" } }), "source_mismatch"],
[artifact({ observed_at_ms: sampledNow + 60_000 }), "future_sample"],
[{ ...artifact(), snapshot_token: "0".repeat(64) }, "invalid_artifact"],
[artifact({ prompt: "private text" }), "invalid_artifact"],
] as const) {
yield* Effect.promise(() =>
NodeFSP.writeFile(path, JSON.stringify(value), { mode: 0o600 }),
);
expect(yield* read(config)).toEqual({ status: "unavailable", reason });
}
}),
),
);
it.effect(
"never treats missing, malformed, oversized, symlinked or permissive files as an empty queue",
() =>
fixture((path, config) =>
Effect.gen(function* () {
expect(yield* read(config)).toEqual({
status: "unavailable",
reason: "source_unavailable",
});
yield* Effect.promise(() => NodeFSP.writeFile(path, "not json", { mode: 0o600 }));
expect(yield* read(config)).toEqual({
status: "unavailable",
reason: "invalid_artifact",
});
yield* Effect.promise(() => NodeFSP.writeFile(path, Buffer.from([0xff, 0xfe])));
expect(yield* read(config)).toEqual({
status: "unavailable",
reason: "invalid_artifact",
});
yield* Effect.promise(() =>
NodeFSP.writeFile(path, Buffer.alloc(WORK_QUEUE_METADATA_MAX_BYTES + 1)),
);
expect(yield* read(config)).toEqual({
status: "unavailable",
reason: "source_unavailable",
});
yield* Effect.promise(() => NodeFSP.writeFile(path, JSON.stringify(artifact())));
yield* Effect.promise(() => NodeFSP.chmod(path, 0o644));
expect(yield* read(config)).toEqual({
status: "unavailable",
reason: "source_unavailable",
});
yield* Effect.promise(() => NodeFSP.chmod(path, 0o600));
const link = `${path}.link`;
yield* Effect.promise(() => NodeFSP.symlink(path, link));
expect(
yield* read({ status: "configured", path: link, source, maxAgeMs: 30_000 }),
).toEqual({ status: "unavailable", reason: "source_unavailable" });
const uid = process.getuid?.();
if (uid !== undefined) {
yield* Effect.acquireUseRelease(
Effect.sync(() => vi.spyOn(process, "getuid").mockReturnValue(uid + 1)),
() =>
read(config).pipe(
Effect.tap((result) =>
Effect.sync(() => {
expect(result).toEqual({
status: "unavailable",
reason: "source_unavailable",
});
}),
),
),
(owner) => Effect.sync(() => owner.mockRestore()),
);
}
const directory = `${path}.directory`;
yield* Effect.promise(() => NodeFSP.mkdir(directory));
const directoryLink = `${path}.directory-link`;
yield* Effect.promise(() => NodeFSP.symlink(directory, directoryLink));
yield* Effect.promise(() =>
NodeFSP.writeFile(
NodePath.join(directory, "snapshot.json"),
JSON.stringify(artifact()),
{ mode: 0o600 },
),
);
expect(
yield* read({
status: "configured",
path: NodePath.join(directoryLink, "snapshot.json"),
source,
maxAgeMs: 30_000,
}),
).toEqual({ status: "unavailable", reason: "source_unavailable" });
expect(
yield* read({ status: "configured", path: directory, source, maxAgeMs: 30_000 }),
).toEqual({ status: "unavailable", reason: "source_unavailable" });
const response = JSON.stringify(
yield* read({
status: "configured",
path: `${path}.missing`,
source,
maxAgeMs: 30_000,
}),
);
expect(response).not.toContain(path);
}),
),
);
});

describe("queue metadata configuration bounds", () => {
const configured = {
T3CODE_WORK_QUEUE_METADATA_PATH: "/synthetic/snapshot.json",
T3CODE_WORK_QUEUE_METADATA_QUEUE_ID: "queue",
T3CODE_WORK_QUEUE_METADATA_HOST_ID: "host",
T3CODE_WORK_QUEUE_METADATA_ENVIRONMENT_REF: "environment",
T3CODE_WORK_QUEUE_METADATA_EXPORTER_INSTANCE_ID: "exporter",
};
it("uses the exact source environment names and the 30 second default", () => {
expect(workQueueMetadataConfig(configured)).toEqual({
status: "configured",
path: "/synthetic/snapshot.json",
source,
maxAgeMs: 30_000,
});
expect(workQueueMetadataConfig({})).toEqual({ status: "unconfigured" });
for (const name of Object.keys(configured)) {
const missing: Record<string, string | undefined> = { ...configured, [name]: undefined };
expect(workQueueMetadataConfig(missing)).toEqual({ status: "invalid" });
}
});
it("accepts inclusive 1 millisecond and 24 hour bounds and rejects invalid ages", () => {
for (const age of ["1", "86400000"]) {
expect(
workQueueMetadataConfig({
...configured,
T3CODE_WORK_QUEUE_METADATA_MAX_AGE_MS: age,
}),
).toMatchObject({ status: "configured", maxAgeMs: Number(age) });
}
for (const age of ["", "0", "-1", "1.5", "01", "NaN", "86400001", "9007199254740992"]) {
expect(
workQueueMetadataConfig({
...configured,
T3CODE_WORK_QUEUE_METADATA_MAX_AGE_MS: age,
}),
).toEqual({ status: "invalid" });
}
});
});
Loading
Loading