Skip to content

docs(objectql): correct two comments that still assert plugin-audit's retired captureBefore (#7707) - #7883

Merged
huangyiirene merged 1 commit into
mainfrom
claude/issue-7707-stale-capturebefore-comments
Aug 12, 2026
Merged

docs(objectql): correct two comments that still assert plugin-audit's retired captureBefore (#7707)#7883
huangyiirene merged 1 commit into
mainfrom
claude/issue-7707-stale-capturebefore-comments

Conversation

@huangyiirene

Copy link
Copy Markdown
Collaborator

Fixes#7707

Comments only. No executable line changes — the whole diff is 5 added / 2 removed // lines, mechanically asserted below.

Premise: HOLDS — but only in part, and that part matters

Located by symbol, per the card's own instruction (git grep -n "captureBefore" -- packages/objectql/src). Every line number written on the card and in its comments had drifted again; the three sites on b313fde are engine.ts:9109, plugin.ts:980, plugin.ts:984.

Of the three mentions, two were stale and one is true history that stays.

Evidence that captureBefore is genuinely retired

Not taken from the card — measured in the tree:

  • packages/plugins/plugin-audit/src/audit-writers.ts:1343-1345 — the plugin's only write-path registrations are afterInsert / afterUpdate / afterDelete on writeAudit, each with excludeObjects: AUDIT_EXCLUDED_OBJECTS. There is nobeforeUpdate / beforeDelete registration left.
  • audit-writers.ts:1031⛔ RETIRED — captureBefore on beforeUpdate / beforeDelete (#6656, ADR-0049 enforce-or-remove).
  • captureBefore has zero live (non-comment) occurrences anywhere in plugin-audit/src.
  • .changeset/hook-ctx-previous-stash-limb-removed.mdcaptureBefore was the only writer of ctx.__previous in the repo; plugin-audit captureBefore still fetches its own pre-image — retire the second read once the engine binds ctx.previous before every before* dispatch #6656 retired it, leaving that channel with zero producers.

(packages/rest/src/import-runner.ts has an unrelated local named captureBefore — different symbol, out of scope.)

Site 1 — engine.tsstale, corrected

The enumeration of delete-phase hooks that hold the wantsPreImage gate open listed:

* plugin-audit captureBefore / writeAudit before+afterDelete,

Both halves are wrong today: captureBefore no longer exists, and writeAudit is afterDelete only. The bullet's job in that paragraph is to explain which gate term the hook holds open, so a reader trusting it concludes plugin-audit still makes term 1 (hasHooksFor('beforeDelete')) true for every object. It does not — it holds term 2.

Corrected rather than deleted, because the rest of the bullet is still live and load-bearing: plugin-audit's excludeObjects face (#5860) is the paragraph's worked example of a hook that narrows at the engine face, which is exactly what lets hookMatchesObject subtract it so an excluded object really does skip the read. Deleting the bullet would take that example with it.

Site 2 — plugin.ts:980NOT stale, deliberately left

Inside the ⛔ RETIRED — sys_fetch_previous_update block, the #5846 measurement reads "What it cost while it stood … read the same row THREE times — this builtin, plugin-audit's captureBefore, and the engine's own gated read."

This is past-tense history of a state that really existed, explicitly scoped by "while it stood". It is accurate as written and is the argument the retirement block exists to preserve. Left untouched.

Site 3 — plugin.ts:984stale, corrected

The same paragraph closed with:

`captureBefore`'s now-redundant read is the identity lane's follow-up.

Present tense, advertising pending work. That follow-up landed in #6656 (merged 2026-08-09). Restated to record the outcome, so a reader stops going looking for an open card and for a captureBefore that is no longer there. The historical sentences above it are unchanged.

Scope fence honoured

packages/plugins/plugin-audit is untouched. This PR deletes stale prose that mentions the redundant read; acting on the read itself was the identity lane's card (#6022) and was already done by #6656. Nothing here follows the comment into another lane.

Verification

  • Comment-only, asserted mechanically: every added/removed line in git diff -U0, excluding file headers, matches ^[+-]\s*//. Zero non-comment lines.
  • packages/objectql vitest — 187 files / 3312 tests passed, 0 failed.
  • pnpm check:query-options-erasure — exit 0, ratchet holds, baseline key set verified against b313fde, no files added.
  • pnpm check:type-check-debt — exit 0, 33 ledger entries re-measured, none above its recorded number. Ledger not raised and not lowered. (Requires the built closure first — pnpm exec turbo run build --filter='./packages/*' --filter='./packages/*/*', 70/70 successful — exactly as lint.yml does.)
  • Gates derived with node scripts/pm/dispatch-gates.mjs, all exit 0: check:adr-anchors, check:durability-log-level, check:engine-double-contract, check:stack-collection-maps, node scripts/check-engine-split-ratio.mjs.

Changeset

None — recommend the skip-changeset label. Comments only; nothing is released, and no empty-frontmatter changeset was added (check-empty-changeset.mjs rejects newly-added ones, #5471). content/docs/releases/ untouched.


Generated by Claude Code

… retired `captureBefore` (#7707)
`captureBefore` was retired by #6656 (ADR-0049 enforce-or-remove) and its
last consumer limb deleted by PR #7081. Two comments in `packages/objectql`
still described it as live. Comments only — no executable line changes.
`engine.ts`: the enumeration of delete-phase hooks that hold the
`wantsPreImage` gate open listed `plugin-audit` as
`captureBefore / writeAudit before+afterDelete`. `plugin-audit` now
registers `writeAudit` on `afterInsert`/`afterUpdate`/`afterDelete` only
(`audit-writers.ts:1343-1345`), so it holds term 2 of the gate open and no
longer term 1. The `excludeObjects: AUDIT_EXCLUDED_OBJECTS` face (#5860)
that makes it the worked example for an engine-face narrowing is unchanged,
so the bullet is corrected rather than dropped.
`plugin.ts`: inside the `sys_fetch_previous_update` retirement block, the
#5846 measurement ("read the same row THREE times") is past-tense history
and stays as written. Its closing clause pointed at
"`captureBefore`'s now-redundant read is the identity lane's follow-up" —
that follow-up has since landed, so the clause is restated to record #6656
instead of advertising pending work.
⛔ Scope fence honoured: `packages/plugins/plugin-audit` is untouched. This
change deletes stale prose about the redundant read; acting on the read
itself was already done by the identity lane in #6656.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G2TwHzwbY5Zg6RvuTSzhZa
@vercel

vercelBot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectstackIgnoredIgnoredAug 12, 2026 1:58am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx(via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx(via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx(via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx(via @objectstack/objectql)
  • content/docs/kernel/contracts/data-engine.mdx(via @objectstack/objectql)
  • content/docs/kernel/runtime-services/examples.mdx(via packages/objectql)
  • content/docs/kernel/services-checklist.mdx(via @objectstack/objectql)
  • content/docs/kernel/services.mdx(via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx(via @objectstack/objectql)
  • content/docs/permissions/system-context.mdx(via packages/objectql)
  • content/docs/plugins/index.mdx(via @objectstack/objectql)
  • content/docs/plugins/packages.mdx(via @objectstack/objectql)
  • content/docs/protocol/kernel/index.mdx(via @objectstack/objectql)
  • content/docs/protocol/objectql/query-syntax.mdx(via packages/objectql)
  • content/docs/protocol/objectql/state-machine.mdx(via @objectstack/objectql)

1 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/implementation-status.mdx(via @objectstack/objectql)

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

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

Labels

size/xsskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] Two stale captureBefore comments in objectql assert a mechanism retired by #6656 (engine.ts:7842, plugin.ts:918)

2 participants

@huangyiirene@claude