From 16aa3f41b99b03cb9dabd2e38009bf837d948f8f Mon Sep 17 00:00:00 2001 From: twentyOne2x Date: Tue, 14 Jul 2026 02:23:06 +0200 Subject: [PATCH] fix named proposal response validation --- hermes-agent/leoclean-bin/kb_tool.py | 3 ++- tests/test_hermes_leoclean_kb_bridge_source.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hermes-agent/leoclean-bin/kb_tool.py b/hermes-agent/leoclean-bin/kb_tool.py index 32492aa..c875d7a 100755 --- a/hermes-agent/leoclean-bin/kb_tool.py +++ b/hermes-agent/leoclean-bin/kb_tool.py @@ -1245,7 +1245,8 @@ def compile_operational_response(contracts: list[dict[str, Any]]) -> str | None: f"{lead}\nFresh live readback.\n{format_database_count_readback(status_data)}\n" f"{format_proposal_readback(primary)}\nProposal states are applied: {states.get('applied', 0)}, " f"approved: {states.get('approved', 0)}, pending_review: {states.get('pending_review', 0)}, canceled: " - f"{states.get('canceled', 0)}. {state_sentence} A proposal row is not canonical knowledge without " + f"{states.get('canceled', 0)}. Approved is not applied. {state_sentence} A proposal row is not " + "canonical knowledge without " "the guarded apply receipt and row-level public.* postflight.\n\n" "Next proof-changing follow-up: inspect the matching proposal payload and exact source binding, " "complete human review, obtain explicit guarded-apply authorization, then return non-null applied_at " diff --git a/tests/test_hermes_leoclean_kb_bridge_source.py b/tests/test_hermes_leoclean_kb_bridge_source.py index 84bf1c8..c3ff5d8 100644 --- a/tests/test_hermes_leoclean_kb_bridge_source.py +++ b/tests/test_hermes_leoclean_kb_bridge_source.py @@ -21,6 +21,7 @@ from scripts.working_leo_open_ended_benchmark import ( ROOT = Path(__file__).resolve().parents[1] BRIDGE_DIR = ROOT / "hermes-agent" / "leoclean-bin" +DB_CONTEXT_PLUGIN = ROOT / "hermes-agent" / "leoclean-plugins" / "vps" / "leo-db-context" / "__init__.py" def test_leoclean_bridge_files_are_present_and_parseable() -> None: @@ -492,9 +493,11 @@ def test_vps_bridge_named_document_question_matches_exact_proposal_and_compiles_ assert f"proposal: {corrected['id']}; status: pending_review; applied_at: none" in response assert corrected["source_ref"] in response assert "proposal states are applied: 2, approved: 3, pending_review: 16, canceled: 8" in response.lower() + assert "Approved is not applied." in response assert "has not reached canonical apply" in response assert "telegram_file_refs" not in response assert len(re.findall(r"\b\w+(?:[-']\w+)*\b", response)) <= 200 + assert _load_module(DB_CONTEXT_PLUGIN).response_contract_issues(response, contracts) == [] def test_vps_bridge_oos_intents_preserve_specific_contracts_and_negated_actions() -> None: