Skip to content

refactor(controller): read controller fields through fieldsOf - #86

Merged
Upd4ting merged 3 commits into
campaign/integrationfrom
fix/controller-instance-object
Nov 2, 2026
Merged

Upd4ting merged 3 commits into
campaign/integrationfrom
fix/controller-instance-object

Conversation

@Upd4ting

@Upd4ting Upd4ting commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Why

Antony's goal: delete every AntelopeJS guardrails.ratchet.json through verified PRs on campaign/integration, each contract change proven by tarball against every consumer, with no fallback. interface-api#68 defaults ControllerClass to object, so interface-data-api no longer compiles: it indexes controller instances by string in ten places (Checks: 7 passed, 2 failed. in the proof against the tarball).

What changed

  • Pins interface-api fcc62d2 (producer ref fcc62d229e78d7584ec696495cff2bafe32d5e24, sha256 1a29379d519467fdd438ee411a93519956f1e024d4f457f0d447cac67af61099, packed 0.3.0).
  • fieldsOf(instance) in src/internal/prototypes.ts narrows a controller instance to the existing RowFields, whose values are unknown. Reads of meta.modelKey and modifier key fields, and the writes on the { ...obj } copy, go through it. It returns the same object, so inherited accessors still run on the instance.
  • c.prototype[key] = func becomes Object.assign(c.prototype, { [key]: func }), which performs the same [[Set]].
  • A test covers own fields, inherited accessors, an absent field and the refusal.

Proofs

  • pnpm run checks in CI state, after merging integration 65afb35 (chore(ratchet): delete the interface-data-api guardrail ratchet #85, ratchet deleted): Checks: 8 passed, 0 failed.
  • Surface diff against integration: one added @internal declaration, fieldsOf in dist/internal/prototypes.d.ts; runtime export keys identical: 4 entries. api-diff cannot judge this PR because its base half does not build against the new pin (TS7053 in the base worktree).

Attention

  • fieldsOf adds no new dictionary type or suppression: RowFields carries the counted disable chore(ratchet): delete the interface-data-api guardrail ratchet #85 landed. It is named for table rows and used here for controller fields, because both hold values of unknown type. A verifier should judge that reuse.
  • holdsFields narrows to RowFields after only an object check. That holds because any object answers any string key.
  • fieldsOf throws for a function, where the old index read did not. A controller instance is never a function.

@Upd4ting
Upd4ting marked this pull request as ready for review November 2, 2026 17:12
@Upd4ting
Upd4ting merged commit 354dfaf into campaign/integration Nov 2, 2026
7 checks passed
@Upd4ting
Upd4ting deleted the fix/controller-instance-object branch November 2, 2026 17:12
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