fix: 完成只读状态预算验证
This commit is contained in:
@@ -527,6 +527,7 @@ export async function statusPipelinesAsCodeLane(config: UniDeskConfig, options:
|
||||
ok: runtimeProbe.value.exitCode === 0 && pacStatus.ok === true && blockers.length === 0,
|
||||
command: "agentrun control-plane status",
|
||||
mode: "pipelines-as-code-migrated-lane",
|
||||
mutation: false,
|
||||
configPath: target.configPath,
|
||||
readCaptureBudget: spec.status.readOnlyCapture,
|
||||
target: options.full || options.raw ? agentRunLaneSummary(spec) : compactAgentRunLaneStatusTarget(spec),
|
||||
@@ -902,6 +903,7 @@ export async function statusYamlLane(config: UniDeskConfig, options: StatusOptio
|
||||
ok: sourceProbe.value.exitCode === 0 && runtimeProbe.value.exitCode === 0 && mirrorProbe.value.exitCode === 0 && blockers.length === 0,
|
||||
command: "agentrun control-plane status",
|
||||
mode: "yaml-declared-node-lane",
|
||||
mutation: false,
|
||||
configPath: target.configPath,
|
||||
readCaptureBudget: spec.status.readOnlyCapture,
|
||||
target: options.full || options.raw ? agentRunLaneSummary(spec) : compactAgentRunLaneStatusTarget(spec),
|
||||
|
||||
@@ -75,6 +75,7 @@ export function renderAgentRunControlPlaneStatusSummary(result: Record<string, u
|
||||
const next = record(result.next);
|
||||
const disclosure = record(result.disclosure);
|
||||
const timings = record(result.timings);
|
||||
const readCaptureBudget = record(result.readCaptureBudget);
|
||||
const blockers = Array.isArray(summary.blockers) ? summary.blockers.map(String) : [];
|
||||
const warnings = Array.isArray(summary.warnings) ? summary.warnings.map(String) : [];
|
||||
const migration = record(summary.migration);
|
||||
@@ -130,8 +131,15 @@ export function renderAgentRunControlPlaneStatusSummary(result: Record<string, u
|
||||
displayValue(pacRead.exitCode),
|
||||
displayValue(pacFirstBreak.code),
|
||||
]]),
|
||||
` budget-config: ${displayValue(pacRead.configPath)}`,
|
||||
` next-read-only: ${displayValue(pacRead.next)}`,
|
||||
"",
|
||||
"AGENTRUN READ CAPTURE BUDGET",
|
||||
renderTable(["TIMEOUT_MS", "CONFIG_PATH"], [[
|
||||
displayValue(readCaptureBudget.timeoutMs),
|
||||
displayValue(readCaptureBudget.configPath),
|
||||
]]),
|
||||
"",
|
||||
warnings.length === 0 ? "WARNINGS\n-" : ["WARNINGS", ...warnings.map((warning) => `- ${warning}`)].join("\n"),
|
||||
"",
|
||||
"NEXT",
|
||||
@@ -176,6 +184,12 @@ export function renderAgentRunControlPlaneStatusSummary(result: Record<string, u
|
||||
],
|
||||
),
|
||||
"",
|
||||
"AGENTRUN READ CAPTURE BUDGET",
|
||||
renderTable(["TIMEOUT_MS", "CONFIG_PATH"], [[
|
||||
displayValue(readCaptureBudget.timeoutMs),
|
||||
displayValue(readCaptureBudget.configPath),
|
||||
]]),
|
||||
"",
|
||||
warnings.length === 0 ? "WARNINGS\n-" : ["WARNINGS", ...warnings.map((warning) => `- ${warning}`)].join("\n"),
|
||||
"",
|
||||
"NEXT",
|
||||
|
||||
@@ -5,6 +5,7 @@ import { resolve } from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import { sentinelPublishImageBuildShell } from "./hwlab-node-web-sentinel-cicd-jobs";
|
||||
import type { SentinelCicdState } from "./hwlab-node-web-sentinel-cicd-shared";
|
||||
import { renderAgentRunControlPlaneStatusSummary } from "./agentrun/public-exposure";
|
||||
import { compactHistoryJson, compactStatusSummary, pacReadOnlyCaptureObservation, renderDebugStep, renderHistory, renderStatus } from "./platform-infra-pipelines-as-code";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
@@ -87,6 +88,41 @@ describe("PaC 失败证据合同", () => {
|
||||
expect(output).toContain("next-read-only:");
|
||||
});
|
||||
|
||||
test("AgentRun status 文本披露 lane 与 PaC 两层 YAML capture 预算", () => {
|
||||
const output = renderAgentRunControlPlaneStatusSummary({
|
||||
ok: false,
|
||||
target: { node: { id: "NC01" }, lane: "nc01-v02" },
|
||||
summary: {
|
||||
migration: { migrated: true, sourceAuthority: "gitea-pipelines-as-code" },
|
||||
pac: {
|
||||
readObservation: {
|
||||
stage: "status-remote-observe",
|
||||
status: "timeout",
|
||||
elapsedMs: 25001,
|
||||
timeoutMs: 25000,
|
||||
configPath: "config/platform-infra/pipelines-as-code.yaml#observability.readOnlyCapture.timeoutMs",
|
||||
exitCode: 124,
|
||||
firstBreak: { code: "pac-read-timeout" },
|
||||
next: "bun scripts/cli.ts platform-infra pipelines-as-code status --full",
|
||||
},
|
||||
},
|
||||
blockers: ["pac-not-ready"],
|
||||
warnings: [],
|
||||
nextAction: {},
|
||||
},
|
||||
readCaptureBudget: {
|
||||
timeoutMs: 20000,
|
||||
configPath: "config/agentrun.yaml.controlPlane.lanes.nc01-v02.status.readOnlyCapture.timeoutMs",
|
||||
},
|
||||
next: {},
|
||||
timings: {},
|
||||
}).renderedText;
|
||||
expect(output).toContain("PAC READ OBSERVATION");
|
||||
expect(output).toContain("config/platform-infra/pipelines-as-code.yaml#observability.readOnlyCapture.timeoutMs");
|
||||
expect(output).toContain("AGENTRUN READ CAPTURE BUDGET");
|
||||
expect(output).toContain("config/agentrun.yaml.controlPlane.lanes.nc01-v02.status.readOnlyCapture.timeoutMs");
|
||||
});
|
||||
|
||||
test("feature-config warning 在 status、history、debug-step 同构有界投影", () => {
|
||||
const observation = extractPacSourceObservation([
|
||||
{
|
||||
|
||||
@@ -307,6 +307,7 @@ interface PacReadOnlyCaptureObservation {
|
||||
readonly stage: string;
|
||||
readonly elapsedMs: number;
|
||||
readonly timeoutMs: number;
|
||||
readonly configPath: string;
|
||||
readonly exitCode: number;
|
||||
readonly stdoutBytes: number;
|
||||
readonly stderrBytes: number;
|
||||
|
||||
Reference in New Issue
Block a user