Skip to content

docs(eve): research - propose channel operation gates - #1412

Open
AndrewBarba wants to merge 3 commits into
mainfrom
barba/channel-operation-gates-research
Open

docs(eve): research - propose channel operation gates#1412
AndrewBarba wants to merge 3 commits into
mainfrom
barba/channel-operation-gates-research

Conversation

@AndrewBarba

@AndrewBarba AndrewBarba commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • propose defineChannel gates for session resume, input response, and proactive receive
  • define target-owned delivery receipts, normalized HITL policy input, and mutation isolation
  • keep first-party channel factories, cancellation, and reset outside the initial contract

Proposed API

export default defineChannel({
  gates: {
    "session.resume": async (input, channel, ctx) =>
      (await permissions.mayResume(ctx.session.auth.current, ctx.session.id))
        ? { type: "allow" }
        : { type: "deny" },

    "input.response": (_input, _channel, ctx) =>
      ctx.session.auth.current?.principalId ===
      ctx.session.auth.initiator?.principalId
        ? { type: "allow" }
        : {
            type: "deny",
            reason: "Only the initiating user may respond.",
          },

    "channel.receive": async (input, ctx) =>
      (await permissions.mayReceive(input.auth, ctx.source))
        ? { type: "allow" }
        : { type: "deny" },
  },

  routes,
  receive,
});

Gates run before the protected operation. Missing gates allow; configured gates require an explicit tagged decision and fail closed when they throw or return an invalid value.

Validation

  • pnpm exec oxfmt --check research/channel-operation-gates.md
  • pnpm guard:invariants
  • git diff --check

Refs #1021

Signed-off-by: Andrew Barba <barba@hey.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview Jul 30, 2026 5:20pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
eve-docs-4759 Skipped Skipped Jul 30, 2026 5:20pm

@AndrewBarba
AndrewBarba marked this pull request as ready for review July 30, 2026 17:02
@AndrewBarba
AndrewBarba marked this pull request as draft July 30, 2026 17:03
@AndrewBarba
AndrewBarba marked this pull request as ready for review July 30, 2026 17: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.

1 participant