Skip to content

[engine-double-contract] Pin the 29 baseline entries #8639 first-measured — each needs a signature widening, a tripwire judgement, a body conversion, or one devDependency #8651

Description

@qq9340100

Follow-up to #8639 (PR #8650). Filed unassigned; nobody is on it.

Blocked-by: #8639

#8639 taught implOf to unwrap a mock constructor's sole function argument, which moved
check-engine-double-contract's discovery from 379 doubles to 435. Of the 56 newly discovered
engine-shaped doubles, 21 were pinned in that PR — every one whose pin was a single call —
and 29 (file, verb) pairs entered scripts/engine-double-contract.baseline.json as first
measurements
. This card is the remainder.

Same shape as #5855, which closed the six entries #5619's sinking had unlocked.

Why each was not pinned in the same pass, measured

The 29 pairs fall into four classes, and the class is what decides the work:

  • Signature widening (the bulk). The implementation declares fewer than two parameters, so it
    has no binding to hand the predicate — delete: vi.fn(async () => ({ deleted: 1 })). A pin
    must first add the options bag / payload the fake omits, which changes the double rather than
    routing it. Mostly packages/metadata-protocol/src/seed-loader-*.test.ts.
  • Deliberate tripwire doubles.protocol.validate-data.test.ts and two doubles in
    seed-loader-driver-text.test.ts open their body by throwing, because the test asserts the path
    performs no write at all. Routing them through the predicate changes which error the assertion
    sees, so pinning needs the author's intent read, not a mechanical insert.
  • Concise arrow bodies.protocol.dropped-fields.test.ts and seed-loader-env-scope.test.ts
    have expression-bodied arrows — no statement list to insert in front of, so the body must be
    converted to a block first.
  • @objectstack/mcp (6 pairs). The package depends on neither@objectstack/metadata-core
    nor@objectstack/objectql, so a pin is not one call: it needs a devDependency first. Those
    implementations also declare no parameters, so they need widening too.

Notes for whoever takes it

  • Each baseline entry already carries its own why and closes naming its specific obstacle.
  • These entries are first measurements, not a raised ratchet — the doubles were always there,
    the scan could not reach them. Removing an entry is the ratchet tightening, squarely the
    author's job; the baseline is shrink-only and the checker reconciles in both directions, so a
    pinned double's entry must be deleted in the same PR.
  • Worth doing per package rather than in one sweep: each pin can flip a suite red, and a red here
    is a real finding (exercised looseness), not a nuisance to be worked around.
  • All four packages touched by the fix(scripts): check-engine-double-contract discovers doubles whose write verb is vi.fn(...) #8650 pins were run green there, so the harnesses are known good.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions