Skip to content

registry: cars apart from chargers, their ops and car.which - #92

Merged
frahlg merged 1 commit into
mainfrom
claude/registry-car
Oct 16, 2026
Merged

frahlg merged 1 commit into
mainfrom
claude/registry-car

Conversation

@frahlg

@frahlg frahlg commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What

A car belongs to its owner, not to the home, and visits chargers. These are the names for it, edited here first as the registry rule says. The design is design/vehicles/car-entity-2026-10-15.md in the FTW stack workspace (Fredrik, 15 Oct 2026); the wire and the rules are docs/cars.md in srcfl/ftw (the paired PR below). Rebased onto main after #90 (agents) as one commit. Two reviews shaped it.

  • car_fields: id (128 bits; the owner's app mints it), boxMinted, a reserved ownerId, name, make, VIN, capacity, the car's own charger limits, the level (socPermille, socSource, socAgeS, energySinceWh, socEstimate, chargeLimitPermille), the goal (targetPermille, readyByMin, days, finishAtLimit), surplusOnly, identifiers and sources. socPermille is the car's own number until socEstimate. Ages count from send, never the box's wall clock.
  • car_soc_sources: vehicle, manual, assumed. A visitor gets no level at all. A level read before the car last left a charger is an estimate.
  • car_identified_by: charger, car, only, tap, asking, none. asking is the box waiting for a tap after car.which.
  • charger_car_fields: session (the plug-in's id, which a tap names), carId, carIdentifiedBy, carCorrected, carCorrectedFrom, choose (at most four cars a tap may pick).
  • Ops: car.goal.set, car.soc.set and session.car.set under ftw.dispatch.write, so a watch can make the one tap. car.add, car.update and car.remove under ftw.cars.write, which only the owner role carries. Arguments follow the box's convention: snake_case, id, fractions; car.goal.set takes its goal flat (target, ready_by_min, days, finish_at_limit, clear), as agent_args needs.
  • Agents: car.goal.set and car.soc.set carry agent: ftw.goals.request, with agent_args naming the car by kind car (new; the opaque id from cars.get) or the charger by kind loadpoint. session.car.set and car CRUD stay closed to agents.
  • Scopes ftw.cars.read (the unredacted list) and ftw.cars.write. Refusals E_DUPLICATE; an unknown car or charger is registry: agents, their scopes, refusals and push kinds #90's E_NOT_FOUND. Capability der.car. Push kind car.which.

In this app: contract.ts gets the scopes, messages.ts the op constants and the refusals, kinds.ts the push toggle, and the simulator answers the car ops with E_UNKNOWN_OP, as a box without der.car does. registry-contract.test.ts checks the car blocks' shape. Nothing visible changes until a box sends car.which.

With #90 (agents)

#90 landed first. This branch is rebased onto it: one E_NOT_FOUND, the agent keys and agent_args above, agreed with the core-agent-role session. Core resolves kind car once srcfl/ftw#1646 (agents in Core) and srcfl/ftw#1650 have both landed; whichever is second wires it.

Paired PRs

Merge order: this PR, then srcfl/ftw#1647 and srcfl/ftw-app#70, then srcfl/ftw#1650. The pair lines name commits rather than branches, so they still resolve once the other side has merged and its branch is gone.

Contract-pair: srcfl/ftw@a515d7d

Tests

  • npm run verify on the rebased commit 9433bdc: 1,104 tests passed, 1 skipped, with svelte-check and the build.
  • The three registry copies are byte-identical on their branches.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T17:38:25.908924Z 1aad863 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

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

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 9433bdc Commit Preview URL

Branch Preview URL
Oct 15 2026, 08:36 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aad863d03

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread contract/push-catalogue.yaml Outdated
Comment on lines +66 to +70
# and more than one car. Once per plug-in. The event names the charger
# and the cars by opaque id; the phone shows one button per car, fills
# in their names from its own table, and a tap sends session.car.set.
title: Which car is plugged in?
body: "Tap the car so the box plans for its level and goal."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Implement the car selection flow before advertising this push

When a box emits car.which, the promised interaction cannot occur: src/sw.ts only preserves loadpoint_id for charging.* notifications, supplies no notification actions, and handles a click by opening the root page, while no app code reads the car IDs or sends session.car.set. The user therefore sees “Tap the car” but has no car to tap, leaving the session unidentified and preventing planning from using the intended level and goal. Wire this event to a picker/action handler, or defer the event until that flow exists.

Useful? React with 👍 / 👎.

A car belongs to its owner and visits chargers. The registry names the
car, its level and goal, the ops that set them, the session a tap names,
how the box knows which car is on a charger, and the car.which push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg
frahlg force-pushed the claude/registry-car branch from 0907c27 to 9433bdc Compare October 15, 2026 20:35
@frahlg
frahlg merged commit bd5565e into main Oct 16, 2026
6 of 7 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