Uh oh!
There was an error while loading. Please reload this page.
') + ')', '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); } })(); })();
There was an error while loading. Please reload this page.
IHttpResponse literals — they were masked by the request literals, not absent #13454
Filed unassigned and ungraded by the
domain:clidev seat, sessionsession_01TvqBFLRzXdSPcbusDoED9k, while implementing #13377. Not graded, not routed.A dedup search over open issues finds no card for this; the only hit for both the control query and the dedup query is #13377 itself (
total_count: 1each), which is the request half, not this.How it surfaced
#13377 named 4 ledgered
TS2345in this package's test layer, all of them request literals handed to a route handler. Repairing all 4 did not empty the ledger. Two errors appeared insrc/rest.test.tsat the same two call sites — on the second argument:⭐ The
resexpression at both sites is byte-identical to what is onmain— the #13377 branch edits only argument 1. So these two errors were not created by that repair; they were masked by it. tsc reports at most one argument-assignability error per call expression, so a bad argument 1 hides a bad argument 2 entirely. That is the mechanism worth carrying forward: an EXACT per-file ledger count can stay constant while the errors underneath it are replaced wholesale.src/rest.test.tswas recorded at 2 before and measures 2 after, and not one of the four is the same error.The defect
IHttpResponse(packages/spec/src/contracts/http-server.ts) declares four required members —json,send,status,header— plus optionalwriteandend. The literal supplies two:Two independent reasons it does not conform, and the second is the interesting one:
sendandheaderare absent.status(code: number): IHttpResponse— the contract saysstatusreturns the response, which is what makesres.status(404).json(...)chain.vi.fn().mockReturnThis()is typedMock<Procedure>, i.e. returningany/unknownrather thanIHttpResponse. So even a literal that added the two missing members would still need itsstatusto be typed as returning the interface.Why this is a card and not a rider
The same reason #13377 gave for the request side, in the mirror. A response fixture is not inert data: these tests assert on the spies (
expect(res.json).toHaveBeenCalledWith(...), and amakeRes()elsewhere in the package recordsstatusCodeandbodyoffstatus/json). So a builder here has to decide what a mock response records and what a test may assert on it — that is a test-semantics design question, not an annotation. Deciding it inside a paydown, or inside #13377, would be inventing a second contract on the way past.⛔ The in-repo alternative remains
as any, which the ledger paydown rules out.Scope, measured
src/rest.test.tsholds 28 occurrences of the inlineconst res = { json: vi.fn(), ... }shape. Only the 2 above are red today; the other 26 sit behind an argument-1 error or anas any, exactly as these two did..handler(call sites insrc/*.test.ts, so a zero on either count would read as an instrument failure rather than a finding.meta-public-book-grant.test.ts,rest-batch-size-cap.test.ts) build theirresthrough a localmakeRes()typedany, so they are green for the forbidden reason rather than conforming.Re-check
Requires the #13377 repair to be present; before it, argument 1 masks both.
Refs
as any#13377 — removed the request half of this class and left the ledger's authored_notepointing here. Its scope was the request literals only; the response half was not visible when it was written.Severity not judged; no urgency claimed — the debt is pinned by an EXACT shrink-only ratchet either way.
Generated by Claude Code