Uh oh!
There was an error while loading. Please reload this page.
fix(metadata-protocol): attribute a revert commit to the scope of the commit it reverts - #8427
Conversation
…driver Measured on real ObjectQL + SqlDriver: before the fix a different organization's listCommits showed the env-wide apply commit with no compensation, while the artifact was already withdrawn env-wide. Refs #7860
…ert-commit-org-attribution
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 1 package(s): 3 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also reference the affected code. These are read-only:
|
os-zhuang
commented
Aug 13, 2026
PM note before review — a contradiction in my dispatch, and a second false alarmTwo things to put on the record while CI runs. Neither changes the verdict; both are mine, not the PR's. 1. My dispatch ruling contradicted triage, and the dev was right not to pick a sideMy brief opened with "⛔ This is NOT filed as a defect, and you must not treat it as one." I took that from #7860's own body, which says so explicitly. But the triage comment of 2026-08-13 06:02 had already promoted the card to It handled that correctly: it did not pick a side, it ran the measurement both instructions agreed on first, and let the result select. That is the right resolution of a contradictory brief, and it is the reason the framing conflict cost nothing. Ruled: option A. The fork in ruling 2 was binding and self-executing, and the measurement met its first branch on evidence — a different organization saw the env-wide publish with no visible compensation. The card's own words are that this is the condition under which it "stops being a design question". Nothing about the #7559 asymmetry was chosen here; the row-derived attribution is forced by the measurement, not preferred on taste. ⛔ The PR is not premature. The seat-level lesson is the one this seat has now paid for twice today: a card's body is not its state. I re-read #8323's comments before dispatching precisely because I had been burned on that at 12:05Z, then wrote this brief from #7860's body anyway. 2. The premise-gate alarm is FALSE — and that is the second one todayMy notes flagged that a That is structurally identical to the alarm on #7748 earlier today, where a comment had relocated into On the #8333 adjacencyAgreed with the dev's option A: land whichever is ready. It verified by reading #8333's actual diff — that hunk ends at the
Generated by Claude Code |
os-zhuang
commented
Aug 13, 2026
ACCEPT — PM review, |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#7860
revertCommitrecorded its compensating commit under the requesting session's organization.packageIdon that samerecordPackageCommitcall is already read off the revertedrow; the org was the one field still taken from whoever asked. It now readsrow.organization_id ?? null— the rule #7559 gave this function's items (resolveMetaItemOrgScope) and #7819 tier 2 gaveduplicatePackage's copies, applied to the commit record that documents them.One functional line. The rest of the
protocol.tsdiff is the comment stating the invariant and the measured numbers.The card was NOT filed as a defect — the measurement settled it
#7860 was explicit that the behaviour is self-consistent for the caller who performed the revert, and asked for a measurement before choosing between "attribute to the request" and "attribute to the reverted row". Run on a real ObjectQL +
SqlDriver(better-sqlite3) through the real publish path, after an org-scoped revert of an env-wide commit:org_active)[revert, apply][revert, apply][apply][revert, apply][revert, apply][revert, apply]The middle row is the fork the card named: a different org could still see the original env-wide publish with no visible compensation, which makes this a concrete reporting defect rather than a design question — so the intent question was never mine to pick.
What makes it more than cosmetic is the artifact state measured alongside it:
sys_metadataheld no row for the reverted view afterwards. Items revert in the row's scope (#7559), so the artifact really was withdrawn env-wide — the effect was global while the record was private, and another organization saw anapplythat was never compensated for an artifact already gone. Since #7814,rollbackToPackageCommitplans fromlistCommits, so this list is not merely an observability surface.The mirror direction, same line
A no-org caller reverting an org-scoped commit stamped the revert env-wide, so every other organization read a dangling
Revert: ...whoseparentCommitIdnames a commit that door cannot see. Measured before:[revert]for an unrelated org; after:[].Both collapse to one invariant: a revert commit is visible to exactly the readers who can see the commit it reverts.
Verification
packages/runtime/src/package-revert-commit-attribution-org-scope.integration.test.ts— real engine, real driver (a stubbedengine.findcannot see NULL semantics; that is this family's repeated lesson).Ablation, with a rebuild between measurements because these suites resolve
metadata-protocolthrough itsdistwhile stack traces map back tosrc. Direction predicted before running: restoring the request-derivedorgIdshould turn the two defect-direction cases plus the raw-row case red and leave the actor/no-org case green. Measured: exactly that — 3 failed, 1 passed, the survivor being the predicted one.Restored byte-identical (empty
git diff HEAD), rebuilt, re-run green. Sibling #7819 and #7814 suites stay green: 18/18 across the three files.@objectstack/metadata-protocolfull suite: 1170 passed (80 files).Gates derived from the actual changed paths via
scripts/pm/dispatch-gates.mjsand run locally —check:nul-bytes,check:changeset-gate-self-tests,check:cross-package-test-inputs,check:durability-log-level,check:filter-alias-parity,check:objectui-changeset,check:query-options-erasure,check:type-check-coverage,check-changeset-no-major: all pass.check:objectui-pin-freshis red, and is red identically on an unmodified checkout — a pre-existing release-time pin chore, not this diff.Coordination
#8333 is still open and in flight against this same function. Its
revertCommithunk ends at thecatchblock's closing brace; this change is theorgIdargument roughly three lines below, so the two do not touch the same lines — but they are adjacent enough that whichever lands second may want a look.origin/mainwas merged in at4827e915d1: clean, and no merged commit touchedprotocol.ts.Generated by Claude Code