<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elie Laloum on Medium]]></title>
        <description><![CDATA[Stories by Elie Laloum on Medium]]></description>
        <link>https://medium.com/@pro_12272?source=rss-77dedce89715------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3cJRedul_2XCS2a8Jz4KaA.jpeg</url>
            <title>Stories by Elie Laloum on Medium</title>
            <link>https://medium.com/@pro_12272?source=rss-77dedce89715------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:56:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pro_12272/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Debugging is the work that makes software reliable]]></title>
            <link>https://medium.com/@pro_12272/debugging-is-the-work-that-makes-software-reliable-54be3df84812?source=rss-77dedce89715------2</link>
            <guid isPermaLink="false">https://medium.com/p/54be3df84812</guid>
            <category><![CDATA[programming-paradigms]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Elie Laloum]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-08-24T06:01:01.334Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSK_oHAl38Exeg6MS3IspQ.png" /></figure><p>A customer says their invoice total changed after they refreshed the page. The test suite is green. The calculation looks correct. No one touched the billing code this week.</p><p>At that point, typing speed has no value. Neither does a library recommendation or a polished pull request template. Someone has to turn a vague report into a chain of facts: which request ran twice, which record changed, and why the system allowed it.</p><p>That work is debugging. It is where software engineering stops being assembly and becomes investigation.</p><h3>A program is a set of assumptions</h3><p>Every feature begins with assumptions that are easy to miss:</p><ul><li>a request will arrive once;</li><li>data from another service has the shape its documentation describes;</li><li>clocks agree closely enough;</li><li>a retry will not change the result;</li><li>the production configuration matches the one used for testing.</li></ul><p>Most failures come from an assumption meeting a condition that the code did not account for. The difficult part is that the condition may live outside the file in front of you: a queue consumer, a proxy timeout, a stale cache entry, a browser extension, a migration from six months ago.</p><p>Consider an endpoint that creates an order:</p><pre>app.post(&quot;/orders&quot;, async (req, res) =&gt; {<br>  const order = await db.orders.insert({<br>    customerId: req.body.customerId,<br>    amount: req.body.amount,<br>  });<br><br>  await payments.charge(order.customerId, order.amount);<br>  res.status(201).json(order);<br>});</pre><p>The code reads well. It still permits a costly failure. If the network drops after the payment provider accepts the charge but before the server responds, a client may retry the request. The application can create a second order and a second charge.</p><p>No amount of copying a familiar endpoint pattern identifies that risk. An engineer has to ask a different set of questions: What happens when the client retries? Does the provider support idempotency keys? Can the database enforce one order per request key? What evidence would distinguish a duplicate request from a duplicate worker?</p><p>Debugging trains that habit of questioning the system rather than trusting the happy path.</p><h3>The output is an explanation</h3><p>A bug report often arrives as a symptom: “export is empty,” “login sometimes hangs,” or “the dashboard is slow.” A fix begins only after the symptom becomes an explanation that another engineer can check.</p><p>A useful explanation has four parts:</p><ol><li><strong>Scope</strong>: who or what is affected?</li><li><strong>Trigger</strong>: which input, state, or sequence produces the failure?</li><li><strong>Mechanism</strong>: how does that trigger lead to the observed behavior?</li><li><strong>Proof</strong>: which log, trace, query, or reproduction supports the mechanism?</li></ol><p>This changes the quality of a debugging session. “I think the cache is involved” is a starting point. “Requests with an expired session cookie receive a cached 302 because the cache key omits Cookie; disabling that route cache removes the loop” gives the team a decision they can act on.</p><p>The code change may take ten minutes. Building the explanation may take most of a day. The explanation is the valuable part because it prevents a plausible but wrong patch.</p><h3>Start with a boundary, not a hunch</h3><p>Under pressure, engineers tend to open the component they changed last. That can work, but it also produces a long trail of edits that hide the original signal.</p><p>A more dependable approach starts by drawing a boundary around the failure.</p><p>For a web request, that boundary might include:</p><pre>browser → CDN → load balancer → API → database → message queue → worker</pre><p>Then collect one observation from each side of the boundary. Compare request IDs. Check timestamps. Inspect the stored row, not only the API response. Look for retries and timeouts. Ask whether the failure follows an account, a region, a deployment, or a particular input.</p><p>Each observation should eliminate possibilities. If the API logs show one request but the queue has two messages with the same correlation ID, the bug is no longer “somewhere in checkout.” The investigation has narrowed to the handoff between the API and the queue.</p><p>That discipline matters more than knowing a long list of debugger shortcuts. Tools help you see. Reasoning tells you where to look next.</p><h3>The best debuggers make small experiments</h3><p>Large fixes are hard to evaluate because they alter too many variables. Good investigations prefer experiments with a clear prediction.</p><p>Suppose a background job runs twice. Instead of adding a lock, changing the retry policy, and redeploying, test one claim at a time:</p><ul><li>Log the job ID and delivery attempt number.</li><li>Run the worker with retries disabled in a non-production environment.</li><li>Pause the worker after it completes its side effect and observe the acknowledgement.</li><li>Query whether duplicate jobs share a message ID or receive new IDs.</li></ul><p>Every result updates the model of the system. A failed hypothesis is progress if it rules out a path.</p><p>This is why debugging feels slow from the outside. The engineer is buying certainty in small increments. Shipping a patch before that certainty exists may reduce an alert while preserving the fault.</p><h3>Reliable teams treat failures as system knowledge</h3><p>A bug fixed once and forgotten will return in a different form. Teams get better when they leave behind artifacts that reduce the next investigation:</p><ul><li>an alert that names the failed dependency and request ID;</li><li>a dashboard that separates queue delay from processing time;</li><li>a regression test for the sequence that caused the defect;</li><li>an idempotency constraint at the data boundary;</li><li>a short incident note that records the trigger and the guardrail.</li></ul><p>These are not administrative leftovers. They alter the economics of future work. A teammate who can find a correlated trace in two minutes has time to solve the problem rather than reconstruct its context.</p><p>The same principle applies to code review. Ask “How will we know this failed?” alongside “Does this work?” A feature with no observable failure mode becomes expensive the first time production disagrees with its assumptions.</p><h3>Why this skill compounds with experience</h3><p>Experience does not grant access to a secret collection of fixes. It builds a catalog of failure shapes: stale reads after a write, timeouts that trigger retries, partial deploys, incompatible schemas, shared mutable state, missing permissions, time-zone boundaries.</p><p>Recognizing a shape accelerates the first hypothesis. It does not replace evidence. A senior engineer who declares the answer from memory can send a team toward the same trap as a junior engineer guessing from a stack trace.</p><p>The advantage comes from knowing which questions expose the shape quickly, and from staying calm when the answer is not in the codebase.</p><p>That is also why AI-assisted coding raises the value of debugging. Tools can generate an implementation, suggest an API call, and repair a syntax error. They cannot observe your production traffic unless you provide it, judge whether an explanation fits the evidence, or accept responsibility for a risky change. Faster generation creates more changes to validate and more assumptions to inspect.</p><h3>Practice before the incident</h3><p>You do not need a production outage to improve. Build the habit into ordinary work:</p><ol><li>Before merging a feature, name one way it could fail after deployment.</li><li>Add enough structured context to logs that a request can be followed across services.</li><li>Reproduce one bug locally before changing code, even if the reproduction is ugly.</li><li>Write the suspected cause as a sentence, then state what result would disprove it.</li><li>After fixing the issue, add a guardrail where the system can enforce one.</li></ol><p>The last step separates a repair from a lesson. If an API must never create the same order twice, enforce that rule in a durable boundary, not only in a comment or a teammate’s memory.</p><p>Writing software is visible work. Debugging is the work that earns trust in the software after reality applies pressure. Learn to turn symptoms into evidence, evidence into an explanation, and explanations into guardrails. That is how a codebase becomes safer with age instead of more fragile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54be3df84812" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Before adding Redis, ask whether PostgreSQL already has the job covered]]></title>
            <link>https://medium.com/@pro_12272/before-adding-redis-ask-whether-postgresql-already-has-the-job-covered-6d692de773c0?source=rss-77dedce89715------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d692de773c0</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[message-queue]]></category>
            <dc:creator><![CDATA[Elie Laloum]]></dc:creator>
            <pubDate>Thu, 20 Aug 2026 14:22:55 GMT</pubDate>
            <atom:updated>2026-08-20T14:22:55.376Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x8H15Z87nz5ni-4U.jpg" /><figcaption>is redis always the right tool ?</figcaption></figure><p>A Redis dependency can arrive in a codebase with almost no discussion.</p><p>A route needs a cache. A worker needs a queue. The product team asks for a live update. Someone adds Redis, a client library, a managed instance, dashboards, backup settings, alerts, and another failure mode.</p><p>That architecture can be the right call. It can also be a costly reflex.</p><p>For an application that already runs on PostgreSQL, the database can often carry a cache, a durable work queue, and lightweight cross-process notifications. Consolidating those workloads can remove coordination bugs and operational work. It does <strong>not</strong> make PostgreSQL a universal Redis replacement.</p><p>The useful question is narrower: does this workload need Redis’s latency, throughput, data structures, and independent scaling, or does it need a small, reliable mechanism close to the data?</p><h3>Start with the workload, not the product category</h3><p>“Caching,” “messaging,” and “queues” hide important differences.</p><p>A cache for a few expensive database-backed API responses behaves nothing like a cache that receives hundreds of thousands of requests per second. A queue that sends invoice emails behaves nothing like a high-volume stream with consumer groups. A browser notification fan-out behaves nothing like an audit trail that must survive an outage.</p><p>PostgreSQL fits well when these conditions hold:</p><ul><li>The data already lives in PostgreSQL, and keeping related writes in one transaction helps.</li><li>The workload is moderate enough that extra database reads and writes do not threaten the primary workload.</li><li>A little more latency is acceptable.</li><li>You value one backup, monitoring, and failover story over a specialized component.</li></ul><p>Redis earns its place when low, predictable latency and high throughput are central requirements; when you need its native data structures; or when the workload must scale separately from the transactional database. Rate limiting at a busy edge, session storage for a large fleet, shared counters, leaderboards, and large real-time fan-out are common Redis territory.</p><p>The point is not to minimize the number of technologies at all costs. The point is to avoid paying for a second system before its strengths solve a real constraint.</p><h3>A small cache can live in an UNLOGGED table</h3><p>A cache row needs a key, a value, and an expiry time. PostgreSQL can store that directly.</p><pre>CREATE UNLOGGED TABLE api_cache (<br>  cache_key text PRIMARY KEY,<br>  value jsonb NOT NULL,<br>  expires_at timestamptz NOT NULL<br>);</pre><pre>CREATE INDEX api_cache_expires_at_idx ON api_cache (expires_at);</pre><p>UNLOGGED tables skip write-ahead logging. That reduces write overhead, but it changes the durability contract: PostgreSQL truncates an unlogged table after a crash or unclean shutdown. They are also not replicated to standby servers. Those properties make them suitable for data you can safely rebuild, which is exactly what a cache should be.</p><p>Reading a valid entry is ordinary SQL:</p><pre>SELECT value<br>FROM api_cache<br>WHERE cache_key = $1<br>  AND expires_at &gt; now();</pre><p>Writing a refreshed entry uses an upsert:</p><pre>INSERT INTO api_cache (cache_key, value, expires_at)<br>VALUES ($1, $2::jsonb, now() + interval &#39;10 minutes&#39;)<br>ON CONFLICT (cache_key) DO UPDATE<br>SET value = EXCLUDED.value,<br>    expires_at = EXCLUDED.expires_at;</pre><p>Expired rows still need cleanup. Run it on a schedule and tune the cadence to the volume:</p><pre>DELETE FROM api_cache<br>WHERE expires_at &lt; now();</pre><p>This pattern works best for bounded caches with a clear TTL, especially where a cache miss can fall back to data in the same database. It also gives you transactional options. A write to the source record and an invalidation of the cache row can happen in the same transaction.</p><p>Do not treat this as a free cache. PostgreSQL still spends connections, CPU, buffer cache, I/O, and vacuum effort on those rows. A cache that shields PostgreSQL from read pressure should not become another source of PostgreSQL pressure. If the cache is hot enough to dominate the database, move it out.</p><h3>LISTEN and NOTIFY work for signals, not a durable event bus</h3><p>PostgreSQL clients can subscribe to a channel with LISTEN and send a message with NOTIFY.</p><pre>LISTEN user_events;</pre><pre>SELECT pg_notify(<br>  &#39;user_events&#39;,<br>  json_build_object(&#39;user_id&#39;, 42, &#39;type&#39;, &#39;profile_updated&#39;)::text<br>);</pre><p>The notification becomes visible when the surrounding transaction commits. That detail is valuable: a listener does not receive a signal for a transaction that later rolls back.</p><p>It is a useful fit for cache invalidation, telling a WebSocket service to reload state, or waking workers that poll a jobs table. Keep the payload small and treat it as a hint. PostgreSQL limits NOTIFY payloads to less than 8,000 bytes by default, and notifications are not a durable log for consumers that are offline.</p><p>For work that must be processed, record the work in a table and use NOTIFY only to reduce polling latency. The table carries the durable fact; the notification asks an available process to look.</p><pre>BEGIN;</pre><pre>INSERT INTO outbox_events (topic, payload)<br>VALUES (&#39;user.updated&#39;, jsonb_build_object(&#39;user_id&#39;, 42));</pre><pre>SELECT pg_notify(&#39;outbox_wakeup&#39;, &#39;user.updated&#39;);</pre><pre>COMMIT;</pre><p>That pairing avoids a familiar split-brain failure: publishing an event after committing application data can fail, while publishing before the commit can expose data that never committed. A transactional outbox preserves the work item with the data change. A worker can retry delivery from the table.</p><p>Use a broker or a streaming platform when consumers need replay, long retention, delivery across services, or large-scale fan-out. NOTIFY is deliberately small and ephemeral.</p><h3>A PostgreSQL queue can be durable and concurrent</h3><p>Many background tasks need a database row more than they need a queue server: send an email, generate a report, retry a webhook, process an import.</p><p>Create a table that makes each job’s state visible:</p><pre>CREATE TABLE jobs (<br>  id bigserial PRIMARY KEY,<br>  kind text NOT NULL,<br>  payload jsonb NOT NULL,<br>  status text NOT NULL DEFAULT &#39;ready&#39;,<br>  run_at timestamptz NOT NULL DEFAULT now(),<br>  attempts integer NOT NULL DEFAULT 0,<br>  locked_at timestamptz,<br>  completed_at timestamptz,<br>  last_error text,<br>  created_at timestamptz NOT NULL DEFAULT now()<br>);</pre><pre>CREATE INDEX jobs_ready_idx<br>  ON jobs (run_at, id)<br>  WHERE status = &#39;ready&#39;;</pre><p>Several workers can claim jobs without picking the same row. FOR UPDATE SKIP LOCKED tells a worker to move past rows held by another transaction.</p><pre>WITH next_job AS (<br>  SELECT id<br>  FROM jobs<br>  WHERE status = &#39;ready&#39;<br>    AND run_at &lt;= now()<br>  ORDER BY run_at, id<br>  FOR UPDATE SKIP LOCKED<br>  LIMIT 1<br>)<br>UPDATE jobs<br>SET status = &#39;running&#39;,<br>    locked_at = now(),<br>    attempts = attempts + 1<br>WHERE id IN (SELECT id FROM next_job)<br>RETURNING id, kind, payload, attempts;</pre><p>A worker commits that claim before it performs an external side effect. After it sends the email or calls the webhook, it marks the row complete. If it fails, it schedules another attempt with backoff. If a worker dies after claiming a job, a reaper can return stale running jobs to ready.</p><pre>UPDATE jobs<br>SET status = &#39;ready&#39;,<br>    run_at = now() + interval &#39;5 minutes&#39;,<br>    locked_at = NULL<br>WHERE status = &#39;running&#39;<br>  AND locked_at &lt; now() - interval &#39;15 minutes&#39;;</pre><p>The database gives you durable enqueueing and transactionally consistent job creation. It does not provide exactly-once execution. No queue can make an HTTP call or send an email exactly once without cooperation from the downstream system. Use idempotency keys, a stable job identifier, and handlers that tolerate retries.</p><p>At higher volumes, watch the queue as you would any heavily updated table. Status updates create dead tuples; long-running transactions hold locks; a poor index makes each worker scan too much. Monitor autovacuum, table and index growth, lock waits, claim latency, and the queue depth. If queue traffic competes with customer-facing queries, isolate the workload or adopt a dedicated queue.</p><h3>The consistency win is often the best reason</h3><p>The strongest case for PostgreSQL is rarely a benchmark. It is reducing the gap between a business change and the asynchronous work that follows it.</p><p>Consider an order creation flow. The application inserts the order, invalidates an aggregate cache, and schedules a receipt email. With independent systems, each step can succeed or fail alone. You then need retries, reconciliation, and a plan for stale cache data or missing jobs.</p><p>A transaction can record the order, update or invalidate database-backed cache state, and insert an outbox event together. After commit, workers handle delivery. The system still needs retries, but it has one source of truth for the work that must happen.</p><p>That is a tangible trade: fewer moving parts and stronger local consistency in exchange for placing more responsibility on PostgreSQL.</p><h3>Make the choice explicit</h3><p>Use PostgreSQL for cache-like data, queues, and notifications when the workload is bounded, close to transactional data, and operational simplicity has real value. Build the tables with expiry, retry, cleanup, and monitoring from the first version.</p><p>Keep Redis when its strengths match your constraint: sub-millisecond access on hot paths, high operation rates, specialized in-memory structures, independent scaling, or broad real-time distribution.</p><p>A mature architecture does not add Redis because an application has a cache or a queue. It writes down the latency target, failure semantics, volume, and recovery plan. Then it picks the smallest system that can meet them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d692de773c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why TypeScript Errors Bloat]]></title>
            <link>https://medium.com/@pro_12272/why-typescript-errors-bloat-2e6dab81aefe?source=rss-77dedce89715------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e6dab81aefe</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-tools]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Elie Laloum]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 18:21:19 GMT</pubDate>
            <atom:updated>2026-07-28T19:31:39.779Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*NyyKWnrsXeTk0jbH-8LlKQ.png" /><figcaption>TS errors for human</figcaption></figure><p>A one-line type change can produce 153 TypeScript errors across 31 files.</p><p>That sounds like a large repair. Often, it is one missing argument.</p><p>Imagine a shared factory function gains a required origin parameter. Every old call to that function now fails with TS2554: Expected 2 arguments, but got 1. The compiler reports each call site because each call site is invalid. An engineer who knows the codebase spots the changed signature, updates the callers, and moves on.</p><p>An agent running tsc --noEmit in a shell receives a wall of repeated diagnostics. It has to infer that 152 lines are consequences of the same declaration, find that declaration, and avoid spending turns “fixing” call sites before it understands the change.</p><p>That is the problem <a href="https://github.com/elie-laloum/tssift">tssift</a> targets: TypeScript diagnostics contain useful facts, but their default presentation is flat. A flat list makes a cascade look like a queue of independent tasks.</p><h3>TypeScript reports errors where it can prove them</h3><p>tsc is doing the correct job. It checks every affected expression and emits a diagnostic at each location that violates the program’s types.</p><p>Consider this change:</p><pre>// Before<br>export const auditEvent = (action: string) =&gt; ({ action });</pre><pre>// After<br>export const auditEvent = (action: string, actor: string) =&gt; ({ action, actor });</pre><p>Every existing caller now has a real error:</p><pre>// accounts/session.ts<br>await auditEvent(&quot;session-created&quot;);</pre><pre>// billing/refund.ts<br>await auditEvent(&quot;refund-issued&quot;);</pre><pre>// admin/impersonation.ts<br>await auditEvent(&quot;impersonation-started&quot;);</pre><p>A normal compiler report names each caller. That is valuable when you need to confirm every affected location. It is a poor first view when you need to decide what to inspect first.</p><p>The same pattern appears in several forms:</p><ul><li>An interface field changes name, so property reads, object literals, and function arguments fail in different files.</li><li>A barrel file stops exporting a symbol, so imports from that barrel fail throughout the project.</li><li>A union changes shape, so code written for the old members fails at each access site.</li><li>A function signature changes, so every old invocation produces the same arity error.</li></ul><p>The diagnostic count is accurate. The <em>attention model</em> is wrong for triage. One broken declaration can generate dozens of valid reports that all point back to the same place.</p><h3>The bloat gets worse in agent workflows</h3><p>In an editor, diagnostics arrive with surrounding code, navigation, type hovers, and a human’s memory of the last change. A terminal-based agent often starts with none of that context. Its first artifact is text.</p><p>Repeated diagnostics create two costs.</p><p>First, they consume context. A typecheck with 150 near-identical lines leaves less room for the source code, tests, and prior tool output needed to make a safe repair.</p><p>Second, they distort priority. A list sorted by file position or compiler emission order does not say which error explains the most others. The agent can begin editing a downstream file because it appears first, then discover the shared declaration several turns later.</p><p>This is why prettier terminal output alone does not solve the problem. Color, shorter paths, and cleaner wrapping can make diagnostics easier to read, while preserving the same flat structure. The agent still has to reconstruct causality from a list of symptoms.</p><h3>tssift changes the unit of attention</h3><p>tssift runs TypeScript through its API, preserves the compiler’s diagnostic data, and then builds a second view over it.</p><p>Its core move is deliberately narrow: when multiple diagnostics resolve to the <em>same declaration site</em>, tssift groups them under that declaration and ranks the groups by how many diagnostics they explain.</p><p>For the changed function example, the output can lead with the shared cause rather than an arbitrary call site:</p><pre>[1] cause: function &#39;auditEvent&#39; declared at src/audit/event.ts:13:1<br>    4 diagnostics, all TS2554<br>    src/accounts/session.ts:4:17 error TS2554: Expected 2 arguments, but got 1.<br>    src/accounts/session.ts:9:17 error TS2554: Expected 2 arguments, but got 1.<br>    src/admin/impersonation.ts:4:17 error TS2554: Expected 2 arguments, but got 1.<br>    +1 more site (--all for every one)</pre><p>The errors have not disappeared. The report now says that they share a declaration, names that declaration, shows a few representative sites, and folds the rest behind a count. --all restores every diagnostic as a full line, and the JSON output retains the complete diagnostic table.</p><p>That distinction matters. Suppressing errors would hide information. Declassing repeated symptoms changes the reading order without pretending they do not exist.</p><h3>Grouping needs proof, not pattern matching</h3><p>It is tempting to group diagnostics that share a code, filename, or identifier. That can produce a report that looks smart and sends you to the wrong edit.</p><p>tssift avoids that trade-off by using a strict causal threshold. Its grouping logic relies on a structural link captured from the TypeScript program: an identical declaration location. It also rejects declaration sites outside the analyzed program, such as TypeScript library files or node_modules, because unrelated mistakes can share a dependency declaration.</p><p>That conservatism produces under-grouping. Some related errors remain separate because TypeScript does not expose a safe shared declaration link for them. The project treats that as the safer failure mode.</p><p>Over-grouping is worse. If two independent failures get folded under one header, an agent may edit a correct file, overlook another bug, or assume a counter represents work that has been solved. A report that is shorter but misleading has failed its purpose.</p><p>The repository includes a fixture built to defend against this: two independent roots must remain two entries. It also documents a case where relatedInformation points to code that explains a diagnostic but is not the underlying cause. Reusing that pointer as a grouping key would merge only part of a cascade and head it with a line that needs no change.</p><h3>The reduction shows up when cascades are large</h3><p>The project’s deterministic evaluation compares raw tsc --noEmit --pretty false output with tssift’s agent-text output. These measurements are project-specific, not a claim about every TypeScript codebase.</p><p>The clearest results come from a fixed corpus of real code modified with one intentional breaking change:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKwJxQtyeSfB3ARcYDw80Q.png" /><figcaption>tssift benchmark</figcaption></figure><p>The 153-error case is the shape tssift is built for: one declaration explains almost every report, and the default output can name that declaration once instead of repeating 152 similar sites.</p><p>Small projects tell a more nuanced story. If a cascade has only three short errors, the cause header and added context can make the tssift output longer than raw tsc. That is an honest outcome. There is little volume to remove, though the grouped view can still make the cause easier to locate.</p><p>The project also does not claim to group every cascade. In its fixture suite, four of ten single-cause cascades group under the current strict rules. That boundary is visible by design: the tool prefers a flat report to an invented causal relationship.</p><h3>A better first question after tsc fails</h3><p>When a typecheck fails, the first useful question is rarely “Which error appeared first?” It is: “Which fact explains the most failures?”</p><p>tssift turns that question into the top-level structure of the report. It keeps TypeScript’s raw messages for traceability, retains every diagnostic in JSON and --all, then gives shell-based agents a compact default view centered on known shared causes.</p><p>Try it against a branch with a noisy typecheck. Look at the first group, inspect the declaration it names, and rerun the check after addressing that cause. If the error count collapses, the compiler was never describing 153 separate repairs. It was describing one change from 153 places.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e6dab81aefe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>