Skip to content

Commit 47f29df

Browse files
author
Grace Lee Rui Yue
committed
Route SAT diagnostics through public capabilities
1 parent 7f5a035 commit 47f29df

3 files changed

Lines changed: 28 additions & 6 deletions

File tree

src/jacobian/sat_smt/cadical.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,9 @@ def _resolve_request(
544544
schema_uri=sat.installation.cnf_schema_uri,
545545
expected="one valid canonical CNF artifact and enforceable budget",
546546
hint=(
547-
"Create the instance with SatArtifactService.put_cnf and use "
548-
"only the advertised wall-time and conflict limits."
547+
"Use math.find for sat.cnf.materialize to create the canonical "
548+
"CNF, then pass its cnf_uri with only the advertised wall-time "
549+
"and conflict limits."
549550
),
550551
)
551552
) from exc

src/jacobian/sat_smt/sat_capabilities.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,10 @@ def invoke(self, request: CapabilityRequest) -> CapabilityResult:
417417
"to one canonical CNF"
418418
),
419419
hint=(
420-
"Create the assignment with SatArtifactService.put_assignment "
421-
"against the intended canonical CNF."
420+
"Use math.find for sat.model.find to produce an assignment "
421+
"artifact for the intended canonical CNF. If that optional "
422+
"producer is unavailable, install the CaDiCaL provider; do "
423+
"not invent an assignment URI."
422424
),
423425
)
424426
) from exc
@@ -630,8 +632,10 @@ def invoke(self, request: CapabilityRequest) -> CapabilityResult:
630632
"lineage to one canonical CNF"
631633
),
632634
hint=(
633-
"Create the proof with SatArtifactService.put_proof against "
634-
"the intended canonical CNF."
635+
"Use math.find for sat.unsat_proof.find to produce a proof "
636+
"artifact for the intended canonical CNF. If that optional "
637+
"producer is unavailable, install the CaDiCaL provider; do "
638+
"not invent a proof URI."
635639
),
636640
)
637641
) from exc

tests/composition/runtime/test_sat_assignment_verification.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ def test_sat_assignment_verifier_declares_its_typed_artifact_route(
7979
)
8080

8181

82+
def test_invalid_assignment_diagnostic_routes_through_public_capabilities(
83+
authorized_complete_runtime,
84+
) -> None:
85+
result = _verify(
86+
authorized_complete_runtime,
87+
"artifact://sha256/" + "0" * 64,
88+
)
89+
90+
assert result.execution.status is ExecutionStatus.ERROR
91+
assert result.diagnostics[0].code == "INVALID_SAT_ASSIGNMENT"
92+
hint = result.diagnostics[0].hint or ""
93+
assert "math.find" in hint
94+
assert "sat.model.find" in hint
95+
assert "CaDiCaL" in hint
96+
assert "SatArtifactService" not in hint
97+
98+
8299
def test_sat_assignment_is_verified_by_an_authorized_clean_process(
83100
authorized_complete_runtime,
84101
monkeypatch: pytest.MonkeyPatch,

0 commit comments

Comments
 (0)