Show proposal apply state in Leo KB bridge
Some checks are pending
CI / lint-and-test (push) Waiting to run
Some checks are pending
CI / lint-and-test (push) Waiting to run
This commit is contained in:
parent
5e9b493c01
commit
cc9ce1c0f3
2 changed files with 7 additions and 0 deletions
|
|
@ -947,6 +947,8 @@ def print_proposal(proposal: dict[str, Any]) -> None:
|
|||
if proposal.get("source_ref"):
|
||||
print(f"- source_ref: `{proposal['source_ref']}`")
|
||||
print(f"- created_at: `{proposal.get('created_at')}`")
|
||||
print(f"- reviewed_at: `{proposal.get('reviewed_at') or '-'}`")
|
||||
print(f"- applied_at: `{proposal.get('applied_at') or '-'}`")
|
||||
print("\n## Rationale\n")
|
||||
print(proposal["rationale"])
|
||||
payload = proposal.get("payload") or {}
|
||||
|
|
@ -977,6 +979,8 @@ def print_proposal_list(rows: list[dict[str, Any]]) -> None:
|
|||
print(f"- type: `{row['proposal_type']}`; status: `{row['status']}`")
|
||||
print(f"- proposed_by: `{row.get('proposed_by_handle') or '-'}`; channel: `{row.get('channel') or '-'}`")
|
||||
print(f"- created_at: `{row.get('created_at')}`")
|
||||
print(f"- reviewed_at: `{row.get('reviewed_at') or '-'}`")
|
||||
print(f"- applied_at: `{row.get('applied_at') or '-'}`")
|
||||
if row["proposal_type"] == "add_edge":
|
||||
print(
|
||||
f"- edge: {markdown_claim_link(payload.get('from_claim'), truncate(payload.get('from_text'), 80))} "
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ def test_vps_bridge_proposal_list_prints_rationale_for_non_edge_rows(capsys) ->
|
|||
"proposed_by_handle": "leo",
|
||||
"channel": "telegram",
|
||||
"created_at": "2026-07-09 00:00:00+00",
|
||||
"reviewed_at": "2026-07-09 00:10:00+00",
|
||||
"applied_at": None,
|
||||
"payload": {"title": "Helmer 7 Powers"},
|
||||
"rationale": "Revised Helmer packet should remain visible as approved but unapplied.",
|
||||
}
|
||||
|
|
@ -129,6 +131,7 @@ def test_vps_bridge_proposal_list_prints_rationale_for_non_edge_rows(capsys) ->
|
|||
|
||||
assert "attach_evidence" in output
|
||||
assert "approved" in output
|
||||
assert "applied_at: `-`" in output
|
||||
assert "Revised Helmer packet" in output
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue