fix: compact noisy cli health outputs
This commit is contained in:
@@ -119,17 +119,26 @@ export function runCodeQueueQueuesShapeContract(): JsonRecord {
|
||||
assertQueuesShape("full", full, "full");
|
||||
const fullQueues = asRecord(asRecord(full).queues);
|
||||
assertCondition(!Array.isArray(fullQueues), "full queues payload must be an object, not the deprecated array shape", fullQueues);
|
||||
assertCondition(fullQueues.bounded === false, "full without --limit should preserve complete queue listing semantics", fullQueues);
|
||||
const deprecatedFullArray = asArray(fullQueues.deprecatedFullArray);
|
||||
assertCondition(deprecatedFullArray.length === 3, "full should expose deprecated array only under a compatibility field", fullQueues);
|
||||
assertCondition(fullQueues.bounded === true, "full queues output should now be paged by default", fullQueues);
|
||||
assertCondition(fullQueues.deprecatedFullArray === undefined, "full should not expose deprecated unbounded array by default", fullQueues);
|
||||
const compatibility = asRecord(fullQueues.compatibility);
|
||||
assertCondition(compatibility.stablePath === "data.queues.items[]", "compatibility metadata should document stable path", compatibility);
|
||||
assertCondition(compatibility.deprecated === true, "compatibility metadata should mark old array path deprecated", compatibility);
|
||||
assertCondition(compatibility.deprecatedFullArrayOmitted === true, "compatibility metadata should explain deprecated array omission", compatibility);
|
||||
|
||||
const limitedFull = codexQueuesQueryForTest(["--full", "--limit", "2"], fetcher);
|
||||
const limitedFullQueues = asRecord(asRecord(limitedFull).queues);
|
||||
assertCondition(limitedFullQueues.bounded === true, "full with explicit --limit should be bounded", limitedFullQueues);
|
||||
assertCondition(asArray(limitedFullQueues.items).length === 2, "full with explicit --limit should limit data.queues.items[]", limitedFullQueues);
|
||||
assertCondition(limitedFullQueues.hasMore === true, "limited full should expose next page", limitedFullQueues);
|
||||
const limitedCommands = asRecord(limitedFullQueues.commands);
|
||||
assertCondition(String(limitedCommands.next ?? "").includes("--offset 2"), "limited full should expose offset pagination command", limitedCommands);
|
||||
|
||||
const offsetFull = codexQueuesQueryForTest(["--full", "--limit", "2", "--offset", "2"], fetcher);
|
||||
const offsetFullQueues = asRecord(asRecord(offsetFull).queues);
|
||||
assertCondition(offsetFullQueues.offset === 2, "offset full should preserve offset", offsetFullQueues);
|
||||
assertCondition(offsetFullQueues.hasPrevious === true, "offset full should expose previous page", offsetFullQueues);
|
||||
assertCondition(asRecord(asArray(offsetFullQueues.items)[0]).id === "gamma", "offset full should return second page rows", offsetFullQueues);
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
@@ -138,8 +147,9 @@ export function runCodeQueueQueuesShapeContract(): JsonRecord {
|
||||
"summary queue metadata",
|
||||
"full data.queues.items[] shape",
|
||||
"full queue metadata",
|
||||
"deprecated full array compatibility field",
|
||||
"full explicit limit remains bounded",
|
||||
"deprecated full array omitted from default output",
|
||||
"full explicit limit remains bounded and paged",
|
||||
"offset pagination",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user