Skip to content

Claim delivered feedback before processing - #651

Merged
max-sixty merged 6 commits into
mainfrom
codex/composite-leaf-status
Sep 12, 2026
Merged

max-sixty merged 6 commits into
mainfrom
codex/composite-leaf-status

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add leaf delivery claim as the first operation for delivered reader input
  • bind the Active receipt to the exact outstanding event under the page transaction
  • keep delivery read read-only and make stale delivery retries successful no-ops
  • document the UI-first feedback contract for agents and hosted sessions

Verification

  • uv run pytest tests (1039 passed)
  • uv run pre-commit run --all-files
  • git diff --check origin/main...HEAD

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@max-sixty
max-sixty merged commit 1de8915 into main Sep 12, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/composite-leaf-status branch September 12, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants