Skip to content

Photon migration - #32

Open
tecxbro wants to merge 13 commits into
browserbase:mainfrom
tecxbro:photon-migration
Open

tecxbro wants to merge 13 commits into
browserbase:mainfrom
tecxbro:photon-migration

Conversation

@tecxbro

@tecxbro tecxbro commented Oct 27, 2026

Copy link
Copy Markdown

No description provided.

cognition-team and others added 12 commits October 27, 2026 00:37
Stage A of the Linq->Photon Advanced gRPC migration. Pins eve@0.82.0 and
@photon-ai/advanced-imessage@2.4.0 with gRPC runtime peers, and freezes
the shared contracts all workstreams build on: the Postgres schema
(migrations/004), versioned event/command envelopes, canonical identity
encoding, admission policy, the store facade, managed-credential client
discovery, and the shared verified-messaging principal predicate.
Rewrites the messaging-provider references ahead of cutover: README table,
repository map, link/onepassword/browser-runtime/baselayer guides, agent
instructions (now covering the photon_* tool semantics), and a new
docs/photon.md setup guide. docs/linq.md stays until the channel code is
removed at cutover.
- Add agent/channels/photon.ts with private internal routes for dispatch,
  event reads, retire and health, verified with the internal bearer secret
- Derive session auth and binding identity from the durable store and
  frozen identity helpers; never trust payload claims
- Enforce persisted 24h absolute session deadlines via
  agent/lib/session-lifetime.ts and intent-keyed idempotent dispatch
- Add agent/lib/photon.ts helpers: browser event spread, timing-safe
  internal auth, prompt-context strings and durable lifecycle notices
- Enable Eve workflow retention "default" in agent/agent.ts so completed
  runs stay re-readable for the output projector
- linkOwner, sandboxToken, ownerOf require issuer photon and
  the photon:<sha256> principal pattern; retired linq grants orphan.
- linkPrincipal/onePasswordPrincipal derive from the shared
  verifiedMessagingPrincipal predicate, direct audience only;
  group sessions resolve to {type:"app"} and fail closed.
- vault guards deny every verified messaging principal.
- browserScope(ctx) derives {audience, ownerId, bindingId}; group
  sessions get isolated runtimes: fresh per-task Contexts tagged
  ownerId+audience, env mask strips BROWSERBASE_CONTEXT_ID and
  personal extension id from launches, serialized globally.
- initiating principal is immutable per task (conversation
  initiatingPrincipal preferred, else first verified caller) and
  membershipVersion bumps stale pending approvals.
- reusable context create/select/save/list/promote paths deny
  group sessions and group-tagged Contexts; close releases the
  isolated Context and unbinds the task.
- Shared helper verifies the Photon principal, resolves the bound
  conversation, validates args against frozen contracts and enqueues
  typed commands; reads poll the command row with an 8s bound.
- Eleven tools cover messages, media, reactions/stickers, polls,
  mini-app cards, chats, groups, history, addresses, locations and
  contact cards; groups fail closed and private-only reads are gated.
- Bytes stage as durable artifacts (bounded, sanitised) and command
  results surface compact projections instead of raw provider JSON.
Cover the frozen Photon contracts end to end: identity, config,
policy admission, command schemas, durable inbox, dispatch,
outbox, interactions and absolute deadlines. Pipeline modules
that parallel workstreams have not landed yet skip cleanly via
optional imports. Link and 1Password tests now assert the
photon principal contract; their sources migrate elsewhere.
…ntity' and 'photon/wt-verify' into photon-migration
Reconcile blind-written photon tests against the real factory APIs
(createOutbox/createDispatcher) instead of guessed free functions, and
extend the PhotonDb seam so dispatch, outbox, media and commands are
exercisable in memory:

- Add dispatchableScopes/dispatchableForChat to the store contract so
  the dispatcher no longer bypasses PhotonDb with raw pool queries
- Relax outbox, commands and media deps to PhotonDb; add an executor
  injection seam and exported collectDownload/buildUploadInput helpers
- Export projectEvent/retireDueSessions for direct coverage
- Reject expired interactions at match time rather than only on sweep
- Sanitize provider-supplied artifact filenames
- Bump vitest timeout for legitimately multi-second browser tests

Delete the retired Linq channel, lib, test and doc. Surviving linq
references are deliberate: rejection tests asserting linq: principals
are denied, and comments documenting orphaned linq: owner rows.
Ignore generated .photon-worker output in eslint.
@tecxbro
tecxbro requested a review from a team as a code owner October 27, 2026 21:55
@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedeve@​0.79.1 ⏵ 0.82.099 +1100100 +19880
Addednice-grpc-common@​2.0.41001008381100
Addednice-grpc@​2.1.1810010010089100
Added@​grpc/​grpc-js@​1.14.6971009794100
Added@​photon-ai/​advanced-imessage@​2.4.010010010098100

View full report

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