Measured during #8468 (PR #8556) while answering a PM review question about whether that PR's negative guards had positive controls. The answer turned out to be "yes, but not individually", and the measurement is worth keeping because the conclusion is not what either of us predicted.
⚠️ This is defence in depth, not a defect today. sys_team, sys_business_unit and sys_member are genuinely protected right now. The finding is about attribution, and about what a future refactor can remove without being told.
How it was measured
Six targeted ablations of legacyUniqueReplacements in packages/drivers/driver-sql/src/schema-drift.ts, each predicted before running. Two of three single-guard predictions were wrong, which is what started the rest:
| ablation |
predicted |
measured |
| C1 — remove the explicitly-named-index guard |
RED |
RED ✓ |
C2 — remove legacyName === replacement.name (the ADR-0120 S6 guard) |
RED |
GREEN 17/17 |
C3 — let the bare unique: true spelling through the filter |
RED |
GREEN 17/17 |
Then, to find out why the two negatives could not be made to fail:
| ablation |
measured |
D1 — S6 guard + the #3955 declaredNames guard |
RED on the S6 test |
| D2 — bare-spelling filter + S6 guard |
still GREEN |
D3 — bare-spelling filter + S6 guard + declaredNames guard |
RED on both the S6 and bare-spelling tests |
So: the S6 composite is double-guarded, and the bare spelling is triple-guarded.
Why it is worth recording
The protection is real, and the tests do pin it — but no test attributes it to a single line. A refactor that removes any one of those guards gets a fully green suite, including the tests whose names say they cover exactly that case:
claims nothing when the legacy name IS the replacement name (the S6 composite) passes with the S6 guard deleted.
claims nothing for the BARE spelling — an unrespelled declaration is untouched (#5082) passes with the bare-spelling filter deleted.
That is the "green pin narrower than its name" pattern inverted: here the pins are broader than any one guard, so each guard is individually unpinned while collectively covered. The failure mode is sequential — two refactors months apart, each green, and the third guard may not cover what the other two did.
What is behind those guards matters: the S6 guard is what stops the arm proposing to drop the hand-written organization composites on sys_team, sys_business_unit and sys_member — three shipped platform objects, on the ADR-0120 S6 spelling that is valid indefinitely.
Suggested shape
Per-guard unit tests on legacyUniqueReplacements — one input per guard, constructed so that only that guard can reject it — so removing any single guard turns exactly one test red and names it. The existing object-level tests stay as they are; this is about adding attribution, not replacing coverage.
Provenance note
The dev that measured this judged it defence-in-depth and chose not to file, recording it as an observation instead. That was a defensible call and I am overriding it as the lane PM, because the risk sentence in its own report — "a future refactor could delete one of those guards with every test still green" — is durable, the objects behind the guard are shipped, and an observation inside a completed agent's report is not somewhere the next author will look.
Related
Filed unassigned by the domain:metadata PM seat; the arm is in driver-sql, so triage should route the domain.
Measured during #8468 (PR #8556) while answering a PM review question about whether that PR's negative guards had positive controls. The answer turned out to be "yes, but not individually", and the measurement is worth keeping because the conclusion is not what either of us predicted.
sys_team,sys_business_unitandsys_memberare genuinely protected right now. The finding is about attribution, and about what a future refactor can remove without being told.How it was measured
Six targeted ablations of
legacyUniqueReplacementsinpackages/drivers/driver-sql/src/schema-drift.ts, each predicted before running. Two of three single-guard predictions were wrong, which is what started the rest:legacyName === replacement.name(the ADR-0120 S6 guard)unique: truespelling through the filterThen, to find out why the two negatives could not be made to fail:
declaredNamesguarddeclaredNamesguardSo: the S6 composite is double-guarded, and the bare spelling is triple-guarded.
Why it is worth recording
The protection is real, and the tests do pin it — but no test attributes it to a single line. A refactor that removes any one of those guards gets a fully green suite, including the tests whose names say they cover exactly that case:
claims nothing when the legacy name IS the replacement name (the S6 composite)passes with the S6 guard deleted.claims nothing for the BARE spelling — an unrespelled declaration is untouched (#5082)passes with the bare-spelling filter deleted.That is the "green pin narrower than its name" pattern inverted: here the pins are broader than any one guard, so each guard is individually unpinned while collectively covered. The failure mode is sequential — two refactors months apart, each green, and the third guard may not cover what the other two did.
What is behind those guards matters: the S6 guard is what stops the arm proposing to drop the hand-written organization composites on
sys_team,sys_business_unitandsys_member— three shipped platform objects, on the ADR-0120 S6 spelling that is valid indefinitely.Suggested shape
Per-guard unit tests on
legacyUniqueReplacements— one input per guard, constructed so that only that guard can reject it — so removing any single guard turns exactly one test red and names it. The existing object-level tests stay as they are; this is about adding attribution, not replacing coverage.Provenance note
The dev that measured this judged it defence-in-depth and chose not to file, recording it as an observation instead. That was a defensible call and I am overriding it as the lane PM, because the risk sentence in its own report — "a future refactor could delete one of those guards with every test still green" — is durable, the objects behind the guard are shipped, and an observation inside a completed agent's report is not somewhere the next author will look.
Related
sys_position.nameis the third instance of the #8323 class: an admin-authored name on a tenant-scoped RBAC object carries an installation-wide unique index #8468 / PR fix(plugin-security,spec): scope sys_position.name uniqueness per organization (#8468) #8556 — where this was measured.check:engine-double-contractcounts declaration sites, so a behaviourally-distinct engine double built byObject.assignover an existing one is not counted #8553 — a different detector-precision finding from the same shift.Filed unassigned by the
domain:metadataPM seat; the arm is indriver-sql, so triage should route the domain.