feat(P-001, P-002): 0pt→N0D quality delegation + internal OpenAPI
Security Scan (SIAX Cloud) / security (push) Successful in 14s
CI (SIAX Cloud) / security (pull_request) Successful in 18s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 18s
CI (SIAX Cloud) / quality (pull_request) Failing after 20s
CI (SIAX Cloud) / quality (push) Failing after 23s
CI (SIAX Cloud) / integration (pull_request) Failing after 26s
CI (SIAX Cloud) / integration (push) Failing after 29s
CI (SIAX Cloud) / security (push) Successful in 29s
Security Scan (SIAX Cloud) / security (push) Successful in 14s
CI (SIAX Cloud) / security (pull_request) Successful in 18s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 18s
CI (SIAX Cloud) / quality (pull_request) Failing after 20s
CI (SIAX Cloud) / quality (push) Failing after 23s
CI (SIAX Cloud) / integration (pull_request) Failing after 26s
CI (SIAX Cloud) / integration (push) Failing after 29s
CI (SIAX Cloud) / security (push) Successful in 29s
P-001 (owner-seam): - Add runDataQuality(input: RunDataQualityInput) to N0dClient → POST /v1/n0d/quality/run (n0dRunDataQuality operation) - Replace generic createJob in quality-service.ts with runDataQuality — N0D OWNS quality execution; 0pt delegates via the specific route - MockN0dClient + HttpN0dClient implementations - Add contract test: runDataQuality → /v1/n0d/quality/run P-002 (internal OpenAPI): - Add 5 quality operations to contracts/openapi.yaml: 0pt.quality.run, 0pt.quality.list_runs, 0pt.quality.bridge_run, 0pt.quality.checks, 0pt.quality.reports - Add 0pt.n0dGetJobResult (P-001 retrieval endpoint) - Add P-002 fixture verifying n0dGetJobResult registration + round-trip delegation (runDataQuality → getJobResult) 29 operations in catalog (was 21). 0pt now has a complete quality-internal OpenAPI with honest N0D delegation boundary.
This commit is contained in:
@@ -7,6 +7,7 @@ import { describe, it, expect } from "vitest";
|
||||
import { QualityService } from "@/src/quality/quality-service";
|
||||
import { ExpectationEngine } from "@/src/quality/expectation-engine";
|
||||
import { SiaxError } from "@/src/platform/errors";
|
||||
import { createN0dClient } from "@/src/clients/n0d-client";
|
||||
|
||||
const ROWS = [
|
||||
{ org_nr: "5560360793", name: "Volvo", employees: 1000 },
|
||||
@@ -226,4 +227,32 @@ describe("QualityService — GE delegation (§11 DQ, never faked)", () => {
|
||||
expect(finished.results[0].executed_by).toBe("great_expectations");
|
||||
await expect(q.recordDelegatedResults(run.run_id, "t_a", [])).rejects.toMatchObject({ code: "CONFLICT" });
|
||||
});
|
||||
|
||||
it("P-002: n0dGetJobResult is registered in the 0pt OpenAPI catalog (0pt.n0dGetJobResult)", () => {
|
||||
// Verify that the n0dGetJobResult operationId is present in the 0pt internal
|
||||
// OpenAPI contract (contracts/openapi.yaml) — it is the P-001 owner-seam
|
||||
// retrieval endpoint for delegated quality jobs.
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const catalog = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../contracts/openapi.yaml"),
|
||||
"utf8"
|
||||
);
|
||||
expect(catalog).toContain("operationId: 0pt.n0dGetJobResult");
|
||||
expect(catalog).toContain("/api/0pt/n0d/results/{jobId}");
|
||||
expect(catalog).toContain("0pt.quality.run");
|
||||
expect(catalog).toContain("0pt.quality.checks");
|
||||
expect(catalog).toContain("0pt.quality.reports");
|
||||
});
|
||||
|
||||
it("P-002: quality delegation round-trip — runDataQuality then n0dGetJobResult", async () => {
|
||||
const q = await withRules();
|
||||
const run = await q.runQuality({ tenant_id: "t_a", project_id: "p_1", dataset_id: "ds_companies" });
|
||||
expect(run.status).toBe("delegated");
|
||||
// n0dGetJobResult: the 0pt consumer polls N0D for the delegated job result.
|
||||
// In production this is GET /v1/n0d/jobs/:id/result (n0d job-lifecycle).
|
||||
const client = createN0dClient();
|
||||
const result = await client.getJobResult(run.delegated_job_id, "t_a");
|
||||
expect(result).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user