Repository navigation
Claim delivered feedback before processing - #651
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
leaf delivery claim writes the new handling record into status.json, but the public status reading in skills/leaf/scripts/leaf/presence.py still filters only {"work", "stream"} — the set is spelled if key not in {"work", "stream"} inside presence_with_activity. So the raw private record crosses the state boundary intact, beside the typed envelope claim_update_sources already emits for it. Against a page with one standing claim, page state (and every browser seat, since full_state spreads the presence reading) carries both:
"status": {"state": "working", "detail": "Reading your feedback", "after": 1,
"handling": {"id": "32d27897", "target": {"kind": "thread", "id": "first"},
"event": "first", "after": 1, "agent": "Claude", "session": "…"}},
"claims": [{"id": "32d27897", "scope": "interaction", "target": {"kind": "thread", "id": "first"},
"event": "first", "log_floor": 1, "source": "claim", "action": "working", …}]That is what the exclusion exists to stop. claim_update_sources states the rule — "The browser and page state receive typed source envelopes instead, so every downstream consumer reads the same target and lifecycle vocabulary" — and presence_with_activity says keeping a private record out of that dictionary "makes it unavailable to every browser-facing consumer by construction". handling is the third private status key and the first one served raw, so the next consumer that wants the exact Active receipt can read status.handling and get a shape with no scope, no log_floor, and no settlement discipline. Adding "handling" to that set is the whole fix; the line sits outside this diff, so say the word and I will push the commit.
…status # Conflicts: # tests/test_interact_layer.py
Summary
leaf delivery claimas the first operation for delivered reader inputdelivery readread-only and make stale delivery retries successful no-opsVerification
uv run pytest tests(1039 passed)uv run pre-commit run --all-filesgit diff --check origin/main...HEAD