Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ All notable changes to vouch are documented here. Format follows
artifact the caller could not already retrieve, and it touches no write path.

### Fixed
- **session crystallize summary lists approved goals** (#741):
`_approved_artifact_ids_for_session` hard-coded claim/page/entity/relation,
so a goal approved in-session never appeared under "Crystallized
artifacts" after goals landed (#427). GOAL is included with the other
create kinds; DELETE stays excluded (no new artifact id).
- **`extract` no longer fractures file paths/URLs into auto-approved
garbage claims** (#702): the sentence segmenter only skipped a `.` as a
boundary when it was flanked by digits on both sides (decimals/versions
Expand Down
15 changes: 12 additions & 3 deletions src/vouch/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,20 @@ def _build_summary_body(sess: Session, ids: list[str]) -> str:


def _approved_artifact_ids_for_session(store: KBStore, session_id: str) -> list[str]:
# Every create-kind proposal belongs on the summary. DELETE is inverse
# (no new artifact id). GOAL must be included — omitting it after #427
# left approved objectives invisible on the crystallize page.
_SUMMARY_KINDS = frozenset({
ProposalKind.CLAIM,
ProposalKind.PAGE,
ProposalKind.ENTITY,
ProposalKind.RELATION,
ProposalKind.GOAL,
})
ids = {
str(pr.payload.get("id"))
for pr in store.list_proposals(ProposalStatus.APPROVED)
if pr.session_id == session_id and pr.kind in {
ProposalKind.CLAIM, ProposalKind.PAGE, ProposalKind.ENTITY, ProposalKind.RELATION,
} and pr.payload.get("id")
if pr.session_id == session_id and pr.kind in _SUMMARY_KINDS
and pr.payload.get("id")
}
return sorted(ids)
16 changes: 15 additions & 1 deletion tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest

from vouch import sessions as sess_mod
from vouch.proposals import approve, propose_claim
from vouch.proposals import approve, propose_claim, propose_goal
from vouch.storage import KBStore


Expand Down Expand Up @@ -246,3 +246,17 @@ def now(tz: object = None) -> _dt.datetime:
body2 = store.get_page(second["summary_page_id"]).body

assert body1 == body2


def test_crystallize_summary_includes_approved_goals(store: KBStore) -> None:
"""Approved GOAL proposals are create-kind artifacts — must list on summary."""
sess = sess_mod.session_start(store, agent="agent", task="ship")
pr = propose_goal(
store, title="land the release", proposed_by="agent", session_id=sess.id,
)
goal = approve(store, pr.id, approved_by="human")
sess_mod.session_end(store, sess.id)

result = sess_mod.crystallize(store, sess.id, approver="human")
body = store.get_page(result["summary_page_id"]).body
assert f"`{goal.id}`" in body
Loading