Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/jacobian/sat_smt/cadical.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,9 @@ def _resolve_request(
schema_uri=sat.installation.cnf_schema_uri,
expected="one valid canonical CNF artifact and enforceable budget",
hint=(
"Create the instance with SatArtifactService.put_cnf and use "
"only the advertised wall-time and conflict limits."
"Use math.find for sat.cnf.materialize to create the canonical "
"CNF, then pass its cnf_uri with only the advertised wall-time "
"and conflict limits."
),
)
) from exc
Expand Down
12 changes: 8 additions & 4 deletions src/jacobian/sat_smt/sat_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@ def invoke(self, request: CapabilityRequest) -> CapabilityResult:
"to one canonical CNF"
),
hint=(
"Create the assignment with SatArtifactService.put_assignment "
"against the intended canonical CNF."
"Use math.find for sat.model.find to produce an assignment "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invoke artifact producers with math.run

When an invalid assignment URI triggers this diagnostic, following the hint only inspects sat.model.find: math.find is read-only discovery and cannot produce the promised assignment artifact. The same misleading wording appears in the new CNF and SAT/SMT proof hints. Direct callers to the public MCP surface therefore remain unable to complete the stated recovery unless they already know to make a separate math.run call; explicitly say to inspect the producer with math.find and execute it with math.run, or point directly to math.run.

AGENTS.md reference: AGENTS.md:L58-L62

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in ce16268: recovery hints now say "inspect with math.find and execute with math.run" instead of just "use math.find", so callers can complete the stated artifact recovery.

"artifact for the intended canonical CNF. If that optional "
"producer is unavailable, install the CaDiCaL provider; do "
"not invent an assignment URI."
),
)
) from exc
Expand Down Expand Up @@ -630,8 +632,10 @@ def invoke(self, request: CapabilityRequest) -> CapabilityResult:
"lineage to one canonical CNF"
),
hint=(
"Create the proof with SatArtifactService.put_proof against "
"the intended canonical CNF."
"Use math.find for sat.unsat_proof.find to produce a proof "
"artifact for the intended canonical CNF. If that optional "
"producer is unavailable, install the CaDiCaL provider; do "
"not invent a proof URI."
),
)
) from exc
Expand Down
6 changes: 4 additions & 2 deletions src/jacobian/sat_smt/smt_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def invoke(self, request: CapabilityRequest) -> CapabilityResult:
"lineage to one exact pinned-profile SMT query"
),
hint=(
"Create the proof with smt.unsat_proof.find or "
"SmtArtifactService.put_proof against the intended query."
"Use math.find for smt.unsat_proof.find to produce a proof "
"artifact for the intended query. If that optional producer "
"is unavailable, install the cvc5 provider; do not invent a "
"proof URI."
),
)
) from exc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,27 @@ def _verify(runtime: JacobianRuntime, proof_uri: str):
)


def test_invalid_proof_diagnostic_routes_through_public_capabilities(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
executable = _fake_carcara(
tmp_path,
"print('valid')\nraise SystemExit(0)",
)
runtime = _runtime_with_runtime(tmp_path, monkeypatch, executable)

result = _verify(runtime, "artifact://sha256/" + "0" * 64)

assert result.execution.status is ExecutionStatus.ERROR
assert result.diagnostics[0].code == "INVALID_SMT_UNSAT_PROOF"
hint = result.diagnostics[0].hint or ""
assert "math.find" in hint
assert "smt.unsat_proof.find" in hint
assert "cvc5" in hint
assert "SmtArtifactService" not in hint


def test_unsat_proof_is_verified_by_authorized_strict_carcara(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
Expand Down
17 changes: 17 additions & 0 deletions tests/composition/runtime/test_sat_assignment_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ def test_sat_assignment_verifier_declares_its_typed_artifact_route(
)


def test_invalid_assignment_diagnostic_routes_through_public_capabilities(
authorized_complete_runtime,
) -> None:
result = _verify(
authorized_complete_runtime,
"artifact://sha256/" + "0" * 64,
)

assert result.execution.status is ExecutionStatus.ERROR
assert result.diagnostics[0].code == "INVALID_SAT_ASSIGNMENT"
hint = result.diagnostics[0].hint or ""
assert "math.find" in hint
assert "sat.model.find" in hint
assert "CaDiCaL" in hint
assert "SatArtifactService" not in hint


def test_sat_assignment_is_verified_by_an_authorized_clean_process(
authorized_complete_runtime,
monkeypatch: pytest.MonkeyPatch,
Expand Down
Loading