feat(orchestrator): observe Page Data validation

This commit is contained in:
john
2026-07-25 14:16:57 +08:00
parent e02495a6c0
commit 417aa9c78b
17 changed files with 784 additions and 16 deletions
+27 -1
View File
@@ -76,12 +76,38 @@ test('orchestrator HTTP API exposes health and authenticated run endpoints', asy
assert.equal(created.status, 202);
assert.equal((await created.json()).status, 'succeeded');
const validation = await fetch(
`${server.baseUrl}/v1/runs/http-shadow-1/validation-observations`,
{
method: 'POST',
headers: {
authorization: 'Bearer test-service-token',
'content-type': 'application/json',
},
body: JSON.stringify({
idempotencyKey: 'http-shadow-1:page-data-delivery:v1',
taskType: 'page_data_dev',
required: true,
checks: [
{ id: 'agent_run_completion', status: 'passed' },
{ id: 'page_data_binding', status: 'passed' },
{ id: 'page_data_storage_policy', status: 'passed' },
],
metrics: { pageCount: 1, publicationCount: 1 },
observedAt: 123,
}),
},
);
assert.equal(validation.status, 200);
assert.equal((await validation.json()).validation.verdict, 'passed');
const events = await fetch(`${server.baseUrl}/v1/runs/http-shadow-1/events?after=1`, {
headers: { authorization: 'Bearer test-service-token' },
});
const eventBody = await events.json();
assert.equal(events.status, 200);
assert.deepEqual(eventBody.events.map((event) => event.sequence), [2, 3]);
assert.deepEqual(eventBody.events.map((event) => event.sequence), [2, 3, 4]);
assert.equal(eventBody.events.at(-1).type, 'workflow_validation_observed');
const jobId = 'http-shadow-1:executor-preview';
const executorJob = await fetch(