Skip to content

feat(contract): role watch and capability cmd.exchange - #84

Merged
frahlg merged 1 commit into
mainfrom
feat/watch-registry
Oct 14, 2026
Merged

frahlg merged 1 commit into
mainfrom
feat/watch-registry

Conversation

@frahlg

@frahlg frahlg commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Step 2 of srcfl/ftw ADR 0009, accepted 14 October 2026. The wire is in docs/watch-exchange.md (#83). Two names go into contract/registry.yaml:

  • Role watch: ftw.live.read, ftw.plan.read, ftw.events.read and ftw.dispatch.write. An owner phone adds the watch and is its parent. Each check keeps only the scopes the parent holds at that moment.
  • Capability cmd.exchange: the box opens the relay's exchange socket and mints watch codes. Without it the phone offers no Add watch.

No new error codes. contract.ts gains the role, so tests/registry-contract.test.ts still reads both directions. The web app uses neither name otherwise; a watch in the device list reads Watch.

Contract-pair: srcfl/ftw@feat/watch-registry

Paired pull requests. All three carry the same file, byte for byte.

  • srcfl/ftw: srcfl/ftw#1623. It regenerates the Go constants and refuses role watch at both of the box's doors until step 3.
  • srcfl/ftw-app: srcfl/ftw-app#40. Contract.swift gains the names.

Merge this one and the srcfl/ftw one together: while both are open, each CI compares against the other's branch.

Tests

npm run verify                                   exit 0: 107 files, 1076 passed, 1 skipped; build clean
npx vitest run tests/registry-contract.test.ts   12 passed
node scripts/check-contract-drift.mjs ../FTW/.worktrees/watch-registry/contract/registry.yaml
  contract/registry.yaml matches … 14356 bytes, byte for byte
  contract/push-catalogue.yaml matches … 3196 bytes, byte for byte
cmp contract/registry.yaml ../ftw-app/.worktrees/watch-registry/protocol/registry.yaml   identical

🤖 Generated with Claude Code

ADR 0009 step 2. An owner phone adds an Apple Watch that works without
the phone. The box names it with role watch, which carries
ftw.live.read, ftw.plan.read, ftw.events.read and ftw.dispatch.write,
and says it can take one with capability cmd.exchange.

contract.ts gains the role, so the registry test still reads both
directions. The app uses neither name otherwise.

Paired with srcfl/ftw and srcfl/ftw-app, which copy the file byte for
byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T08:17:26.053690Z 2095aba PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp 2095aba Commit Preview URL

Branch Preview URL
Oct 14 2026, 08:14 AM

@frahlg
frahlg merged commit 17b1a56 into main Oct 14, 2026
3 checks passed
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