Skip to content

objectql engine.ts: retire the four facade-gate exception rows #30147 hands over #30975

Open

Description

@objectstack-fleet

domain:devx#1 · os-elon-musk · session_016WV4cxm997Tr9c3JFQTKGj

What

scripts/facade-delegation-registry.json holds four exception rows for packages/objectql/src/engine.ts that cite #30147. The maintainer ruling on #30147 (comment 6687801899, option A, 2026-11-06T14:55Z) hands them to this card, so #30147 can close with its protocol.ts work. The 3b PR of #30147 re-points the four rows' card to this issue; their reasons stay as written until this card retires each row.

Class Member Current reason (abridged)
ObjectQL homeAmountServing codemod limit: field-call (calls a field as a function)
ObjectQL projectHomeAmountsOntoPatch codemod limit: a parameter default computes (calls this.homeAmountServing)
ScopedContext derive codemod limit: foreign-private, writes appAuthored on another instance
ScopedContext [APP_AUTHORED_HOOK_API] codemod limit: symbol-keyed method; also writes appAuthored on another instance

Serial behind #30747

⛔ Do not start while #30747 is open: that draft (security hardening) edits engine.ts, and so does #30940. Start from a main that carries #30747's merge (or its close), and re-check open pulls touching packages/objectql/src/engine*.ts first.

Measurement (from #30147 phase 3c, main 616311c, 2026-11-06)

Line numbers below are main 1b3e22f02 and will move.

  • ObjectQL has 61 instance fields; exactly one is called as a function: homeLocalizationResolver (declared ~line 2621). It is called once, in homeAmountServing (~2661, this.homeLocalizationResolver?.(organizationId)), never read as a value, and written by setHomeLocalizationResolver through the host setter (~10393-10394).
  • projectHomeAmountsOntoPatch's body is already moved (to engine-references-and-master-detail.ts, Codemod split: generate the objectql engine.ts split with a deterministic script, verified byte-identical #29986); only its stub's parameter default serving: HomeAmountServing = this.homeAmountServing(context) (~2722) still computes on the class.
  • ScopedContext.derive (~10720) and [APP_AUTHORED_HOOK_API] (~10757) write the private appAuthored on another ScopedContext instance, which a module function cannot reach.

Proposed plan (from the #30147 report, for the owner to confirm)

  1. projectHomeAmountsOntoPatch: move the default into the facet (the stub passes serving through, undefined when the caller passes none, and the facet computes host.homeAmountServing(context)). A private signature; no public .d.ts change.
  2. homeAmountServing: a receiver-form hand move that reads homeLocalizationResolver off the instance (the only called-only field, so no general field-forwarding rule is needed), with an undo proof like the codemod's.
  3. derive and [APP_AUTHORED_HOOK_API]: likely accepted exceptions with written reasons (the foreign-private write is the point of both); that needs a maintainer ruling like Facade codemods: retire the codemod-limit exception rows in the facade gate registry (protocol.ts, engine.ts, sql-driver.ts) #30147's (a recorded exception to ruling 6624345766 item 3), or a design that moves the write.

Acceptance

  • Each row is retired (its member moved and the row deleted) or carries a maintainer-ruled accepted-exception reason.
  • node scripts/check-facade-delegation-only.mjs exit 0; pnpm --filter @objectstack/objectql typecheck exit 0; objectql vitest base and head; the public .d.ts surface of @objectstack/objectql unchanged.

Filed unclaimed for triage.

Activity

  1. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: audit · p3 · domain:server · pm:blocked · 2026-11-06T15:59Z

    ⛔ Not a claim.


    Generated by Claude Code

  2. added
    pm:queueReady for the PM dispatch loop
    and removed
    pm:blockedBlocked by another issue/PR — body carries Blocked-by: #N
    on Nov 7, 2026
  3. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: unblock · pm:blocked → pm:queue · 2026-11-07T16:18Z

    ⛔ Not a claim.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions