Skip to content

fix(entities): generate public wire types without internal columns (#858) - #1019

Merged
athvin merged 2 commits into
mainfrom
issue/858-column-visibility
Nov 9, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/858-column-visibility

Conversation

@athvin

@athvin athvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #858

Claimed by agent — 2026-11-09T04:46:09.731729+00:00, session Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baa on Mac.lan. This open draft PR is the claim.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Generate public-only Rust JSON wire types and TypeScript bindings from column visibility. V19 rejects undeclared secret-shaped columns and hidden identity columns; ApiDoc registers wire types with unchanged schema names.

Why

The published contract currently describes webhook secrets, API key hashes and task token hashes as public properties. A shared entity-level declaration replaces the hand-written webhook projection and keeps these fields out of generated public contracts.

Proof

The contract regression failed on Webhook.secret before the fix. V19 rejected the three missing declarations, and removing the webhook declaration again failed by name. Generator/spec/lint tests and all nine OpenAPI tests pass; make frontend passed (909 unit/component tests, 569 browser tests, 139 existing skips). The full real Postgres/DuckLake tier passed (61 CLI tests, 197 server units, 135 server integration tests; 2 existing integration ignores), and make check passed. Rust CI 42565477342 and frontend CI 42565477245 passed on 32adfe7. Fresh-context review passed on rebased head 339ac00; exact-head Rust CI 42567325111 and frontend CI 42567325109 passed, with all 15 live required contexts satisfied and no failed detect. Merged as cac010d; post-merge verification completed; see the closed ledger below.

Risk & rollback

Expected advisory breaking changes remove three secret properties; all other schema names and properties remain unchanged. Storage rows, DDL and Arrow schemas retain their columns. Revert this PR to restore the prior generation behavior.

Post-merge ledger

Closed by: agent · session Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baa on Mac.lan · 2026-11-09T06:20:27.909960+00:00

Specific to this change

Context — plan, discoveries, measurements, files

Plan

  • Add default-public column visibility and allocate V19 (V18 is already append-column validation). Test strict parsing and lint secret-shaped public fields plus hidden identity columns, including observed failing cases.
  • Emit declaration-ordered public-only Rust wire types for JSON entities, preserving schema names; remove row ToSchema. Filter JSON TypeScript bindings through the same visibility decision while keeping storage/Arrow transport intact.
  • Replace the hand-maintained WebhookRow with generated WebhookWire and register only wire types in ApiDoc. Keep existing endpoint payload selection and non-secret size-trim DTOs.
  • Regenerate entity artifacts, OpenAPI and TypeScript. Prove secret removal from all three generated layers, stable remaining schema names, and real wire serialization. Update entity-framework, API-contract and security references.
  • Run make check, full real Postgres/DuckLake tests and make frontend; inspect the expected advisory API diff and run fresh-context house review.
  • Complete exact-head CI, merge and post-merge verification; ledger closed after the watch.

Files: er-entity-spec types/model, er-entity-gen Rust/TS emitters, er-entity-lint rule/fixtures, three entity YAMLs, er-server pg/openapi and regression tests, generated artifacts and routed skills.

Selection: #858 is the unclaimed prerequisite at product rank 1 (#857/#1008), ahead of the other P0 In progress cards (ranks 4–6). PR #1006 is merged; its deployment ledger and #999 remain blocked by peer-owned #1004/#1005 while main CI is monitored.

Discoveries

Fresh-context review at BASE ab349d1 / HEAD 339ac00 found no candidates across instrumentation, tier, reuse and SQL. The large generated diff was divided into generator/spec/lint and runtime/generated-output passes, with separate reviewers per dimension. Reviews excluded gate-covered issues, intended contract removals and pre-existing response projections. The rebase adds only the peer repair’s two Dockerfile changes relative to the locally gated tree.

The advisory checker reports five diagnostics for exactly three removed properties (two were required, task_instance.token_hash was optional); no schema was renamed and no other property changed.

The existing workspace asset guard counts raw braces in test strings; an escaped opening brace made it misclassify the test-only OpenAPI include. The TypeScript check now explicitly parses the declaration prefix and opening object brace; all nine contract tests and the boundary guard pass. Independent scanner hardening is tracked in #1022. Failure preserved at /tmp/visibility-boundary-red.log.

V18 was already allocated to append binding; visibility is V19. JSON+Arrow entities retain the Arrow storage schema while their TS decoder projects the same public fields as the JSON binding. The three expected property removals are the entire OpenAPI shape diff. The existing webhook HTTP list remains its four-field response; only its internal row projection is replaced.

Measurements

Files

@athvin
athvin marked this pull request as ready for review November 9, 2026 05:26
@athvin
athvin force-pushed the issue/858-column-visibility branch from 32adfe7 to 339ac00 Compare November 9, 2026 05:26
@athvin
athvin merged commit cac010d into main Nov 9, 2026
47 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.

Column visibility: visibility:internal in entity.yaml, generated wire structs, V18 lint

2 participants