') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [finding] Two comments still describe the walled platform-admin elevation gate that L4 retired — one of them ships in the types package declarations · Issue #13661 · objectstack-ai/objectstack · GitHub
Skip to content

[finding] Two comments still describe the walled platform-admin elevation gate that L4 retired — one of them ships in the types package declarations #13661

Description

@claude

Found while re-verifying the platform-admin doc claims against merged code for #11976 (L7). Not a runtime defect on either site — both are comments — but both ship or steer, and both now describe a gate that #11974 (L4) retired.

1. packages/types/src/email-verified.ts — the module docblock names a retired consumer

The docblock over isEmailVerifiedUserRow still says, verbatim:

ONE resolution, two consumers, by design (#12751): the walled platform-admin elevation gate (plugin-securitybootstrapPlatformAdmin, where the check REFUSES an unverified owner match) and the walled owner-verification boot diagnostic (plugin-authwalled-owner-verification-path.ts …)

After L4 the walled arm of bootstrapPlatformAdmin writes no grant row and performs no elevation — it reports. The predicate's real consumers now include matchesConfiguredPlatformAdmin in packages/core/src/security/platform-admin.ts (the derivation site) and resolvePlatformAdminStanding in plugin-security/src/platform-admin-service.ts (the audit surface).

Why it is worth a card rather than a shrug: this docblock is exported prose — it reaches consumers in the package's type declarations — and it tells the next reader that the drift risk is between two named callers, when the real set is larger and includes the authorization derivation itself. The "two must answer identically or a boot warning forecasts a refusal the gate will not make" argument now under-describes the invariant.

2. packages/plugins/plugin-auth/src/last-admin-guard.ts — the active reasoning is grant-only

The comment above PERMISSION_SET_STANDING_KEYS says:

It now drops a DEACTIVATED set before any derivation, so active: false on admin_full_access un-makes every platform admin at once

That is true for the grant anchor only. resolve-authz-context.ts §6b-config sets hasPlatformAdminGrant from configuration and the caller's own sys_user row without consulting psRows or isRowActive at all, and its capability envelope comes from the shipped ADMIN_FULL_ACCESS_CAPABILITIES declaration rather than the stored set row. So deactivating the set does not un-make a configured, verified administrator.

The guard's behaviour is unaffected and correct: keeping active in the standing keys is an over-approximation, which fails in the safe direction, and the enumeration in resolveAdminUserIds does have a config-derived arm. It is the stated reason that is now wrong, and it is the reason a future reader would use to decide whether the key can be dropped.

Suggested shape

One comment-only change touching both files, no behaviour. Worth pairing with whichever leg next edits these files rather than a standalone PR.

Scope note

Deliberately not fixed inside #11976: that card is docs-body-prose only and declared no packages/ surface, so touching either file there would have been unrecorded scope creep.

Context: #11663 (design), #11970 (L2), #11974 (L4).


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions