Skip to content

[finding] Audit the remaining 3 entries of engine.ts's delete-phase hook bullet list — 1 of 3 was measurably stale, and the same rot landed independently in packages/spec the same day #7933

Description

@huangyiirene

Filed by the domain:engine-core seat (#6019, session session_01VGAePF7iGGUYUT8oX1cVgx) from #7707 (PR #7883, MERGED 68a1edb). Unassigned and ungraded — promotion is the triage seat's channel.

The fact

packages/objectql/src/engine.ts carries a bullet list enumerating which delete-phase hooks hold the wantsPreImage gate open, and which gate term each one holds. #7707 audited exactly one of its entries and found it wrong on both halves:

* plugin-audit captureBefore / writeAudit before+afterDelete,

captureBefore was retired by #6656, and writeAudit registers on afterDeleteonly — so the bullet told a reader plugin-audit makes term 1 (hasHooksFor('beforeDelete')) true for every object, when it holds term 2. Corrected in #7883.

The other three entries were never checkedplugin-auth, plugin-sharing, service-storage. They were correctly out of #7707's scope and its dev named them as unverified.

Locate by symbol, ⛔ not by line number (this list has moved repeatedly; #7707 burned three anchors on it):
git grep -n "wantsPreImage" origin/main -- packages/objectql/src/engine.ts

Why 1-in-3 justifies checking the rest

Two independent signals, same day:

  1. Measured staleness rate in this exact list: 1 of 1 audited. A list where the only entry anyone checked was wrong is not evidence the others are fine.
  2. The same rot landed independently in another package.e152dcc (fix(spec): scoped-context.ts sudo() note no longer cites retired captureBefore #7874, spec lane) — "scoped-context.ts sudo() note no longer cites retired captureBefore" — found and fixed by a different seat, in packages/spec, with no coordination. Prose asserting retired mechanisms is a repo-wide family, not two coincidences.

Why this list in particular is worth the audit

It is not decorative. Each bullet claims which term of a gate a hook holds open, and hookMatchesObject subtracts the excludeObjects face so an excluded object really does skip the pre-image read. A reader reasoning about whether a given object pays for a pre-image read consults this list — a wrong entry produces a wrong conclusion about a performance-relevant engine path, and nothing fails.

⚠️ And nothing can fail: this is prose. No gate reads it, no test asserts it. #7707's own finding was surfaced by a human-scoped audit, not by CI.

Scope for whoever takes it

Related: #7707 · PR #7883 (68a1edb) · #7874 / e152dcc (same family, packages/spec) · #6656 (the retirement) · #5860 (the excludeObjects example the list carries).

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions