Repository navigation
Description
API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.
Part of #857. Stack rank 1 of 13. Depends on: nothing — this is the root of the epic.
Color
The one live defect: three secrets are published as required schema properties (Webhook.secret, ApiKey.key_hash, TaskInstance.token_hash) while the runtime guard is a comment on a hand-written struct (pg.rs::WebhookRow: "the secret is never listed"). The TypeScript bindings overclaim the same way (bindings/Webhook.ts declares secret: string). This ticket moves the guard into the entity framework so it cannot be forgotten per-handler. P0 because every later ticket builds on the wire structs, and because the published document is currently asserting a leak.
Scope
er-entity-spec:Column.visibility(publicdefault |internal),Visibilityenum intypes.rs. The struct isdeny_unknown_fields, so this is the one deliberate spec change; all 50 existing entities parse unchanged via the default.er-entity-gen/src/rust.rs: for everywire: [json]entity emit<Name>Wire(public columns only, declaration order) +impl From<&<Name>>, derivingSerialize + utoipa::ToSchemawith#[schema(as = <Name>)]so component-schema names never move (verified supported in the pinned utoipa 6).ToSchemacomes OFF the row struct — uniformly, even where the two are identical — soApiDoccan only ever reference wire structs and addingvisibility: internallater needs no edit anywhere else.er-entity-gen/src/typescript.rs: json-wire bindings emit public columns only.er-entity-lint: V18 (error) — on awire: [json]entity, a secret-shaped column (secret,*_secret,token_hash,key_hash,password,*_token) must declarevisibility: internal; and akey/natural_keycolumn may not be internal (a resource whose id is hidden cannot be described). One rule file underrules/, one registry line, one fixture dir;references/entity-lint-rules.mdregenerates from the registry.- Declare
visibility: internalonwebhook.secret,api_key.key_hash,task_instance.token_hash. - Replace
pg.rs::WebhookRowwith the generatedWebhookWire. LeaveConfigVersionRow/ScheduleRowalone — those are payload-size trims, not secrecy, andvisibilitymust not mean two things. - Regenerate all artifacts; point
openapi.rsregistrations at the wire structs. - Skills in this PR:
entity-frameworkreferences gain thevisibilityfield;securitygains the visibility-guard row.
Out of scope
Paths, audiences, any handler response typing, key self-service (later tickets).
Testing
- V18 fixture tests in both directions, and observe the gate failing: remove one declaration, watch V18 name the column, restore it. A lint rule whose precondition always holds is decoration.
- Diff proof that
secret/key_hash/token_hashleft all three layers:openapi.json,schema.d.ts,bindings/*.ts. er-openapi-checkwill report the property removals — expected, advisory, and the point of the gate.- Grep proof no frontend code read the removed fields (pre-verified: none does;
webhooks-content.tsxreads the create response, not the entity binding). make check(which runser-entity verify: V-rules, byte-exact staleness, orphans, E0xx).
Definition of done
Epic DoD, plus: the three secrets are absent from all three generated layers; V18 appears in er-entity lint --list with --explain V18 reasoning and worked examples; a new secret-shaped column cannot ship undeclared; WebhookRow is gone.
Lint-code allocation correction
The refreshed main branch already uses V18 for append-list columns (er-entity-lint fixtures). Select the next available append-only lint code from the live registry when implementing visibility; the historical V18 proposal in this ticket is not a reservation.
Activity
athvin commentedon Nov 9, 2026
Claimed — working in #1019 (draft), created 2026-11-09T04:46:10Z. Closing that PR releases the claim.
wip: claim #858 — generated public wire types
fix(entities): generate public wire types without internal columns (#858