Diese Seite wurde maschinell übersetzt und wurde noch nicht von einer Person überprüft. Englisch ist die Referenz; Korrekturen auf GitHub sind willkommen. GitHub

Cookwala / SDK und Szenarien / 092

The hub's self-declared claim and the reference report with 137 vectors

A hub answers GET /v1/conformance with the classes it claims and a pointer to a report. The reference hub claims executor and has no report: self-declared. The reference report (claim verifier, 15 suites, 137 vectors, all passed on 2026-10-04) is the shape a certifier reads.

Zielgruppe: certifier · Ziel: Roboter für Menschen · Level: intermediate

Zuerst lesen: /docs/CERTIFICATION/ /docs/CORE/

Schritte

  1. Ask the hub what it claims. report is null: a claim without a report is a self-declaration, which the note says plainly. conformance

  2. Validate the reference ConformanceReport produced by tools/run_conformance.py. The reference hub's validate checks the document against the schema file's root; this schema keeps its kinds under $defs, so today this call reports ok for any document, and `cookwala validate` (the CLI line) is the real check. validate

  3. Hash the report; this is the value a DirectoryEntry or a registry entry points at (scenario 091). hash

Ergebnis

You can tell a self-declared claim from a report, and you know a report proves behaviour on the vectors on one day, not safety in every kitchen (CERTIFICATION section 4). Next: 093 reads the operation vocabulary the vectors test.

Kommandozeile

curl -s ${COOKWALA_HUB:-http://localhost:7878}/v1/conformance
cookwala conformance --report report.json
jq '[.suites[].total] | add' examples/conformance/report-reference.json

Aufgezeichnete Ausgabe

Status: ok

[1] conformance: {"claims": ["executor"], "report": null, "note": "reference hub, self-declared; run tools/run_conformance.py --report"}
[2] validate: {"ok": true, "errors": []}
[3] hash: {"hash": "sha256:85da323d7ac0c25cf8ff5e7041c266c894c83382deee8b80e9fe24640985bc58"}

Code

Ausführen: python scenarios/out/092-conformance-claim-and-reference-report/python.py

# Scenario 092: The hub's self-declared claim and the reference report with 137 vectors
# A hub answers GET /v1/conformance with the classes it claims and a pointer to a report. The reference hub claims executor and has no report: self-declared. The reference report (claim verifier, 15 suites, 137 vectors, all passed on 2026-10-04) is the shape a certifier reads.
# Run a hub first: python hub/cookwala_hub.py --recipes examples
import json, os
from cookwala.client import CookwalaClient, CookwalaProblem

def load(path):
    with open(path, encoding="utf-8") as f:
        return json.load(f)

def pick(obj, path):
    for part in path.replace("]", "").replace("[", ".").split("."):
        obj = obj[int(part)] if part.isdigit() else (len(obj) if part == "length" else obj.get(part))
    return obj

c = CookwalaClient(os.environ.get("COOKWALA_HUB", "http://localhost:7878"))


# Step 1: Ask the hub what it claims. report is null: a claim without a report is a self-declaration, which the note says plainly.
claim = c.conformance()
assert pick(claim, "claims") == ["executor"], pick(claim, "claims")
print("ok", "claims", "=", ["executor"])
assert pick(claim, "report") == None, pick(claim, "report")
print("ok", "report", "=", None)

# Step 2: Validate the reference ConformanceReport produced by tools/run_conformance.py. The reference hub's validate checks the document against the schema file's root; this schema keeps its kinds under $defs, so today this call reports ok for any document, and `cookwala validate` (the CLI line) is the real check.
report = c.validate("conformance", load("examples/conformance/report-reference.json"))
assert pick(report, "ok") == True, pick(report, "ok")
print("ok", "ok", "=", True)

# Step 3: Hash the report; this is the value a DirectoryEntry or a registry entry points at (scenario 091).
h = c.hash(load("examples/conformance/report-reference.json"))
assert pick(h, "hash") == "sha256:85da323d7ac0c25cf8ff5e7041c266c894c83382deee8b80e9fe24640985bc58", pick(h, "hash")
print("ok", "hash", "=", "sha256:85da323d7ac0c25cf8ff5e7041c266c894c83382deee8b80e9fe24640985bc58")

print("scenario complete")

scenarios/092-conformance-claim-and-reference-report.json

Zurück: 091 Weiter: 093