<?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"><channel><title><![CDATA[Mohd Haseeb Uddin]]></title><description><![CDATA[Mohd Haseeb Uddin]]></description><link>https://haseebreviewmemory.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Mohd Haseeb Uddin</title><link>https://haseebreviewmemory.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 07:18:17 GMT</lastBuildDate><atom:link href="https://haseebreviewmemory.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Keeping Hindsight Review Memory Within Its Intended Scope]]></title><description><![CDATA[Two boundary reviews, zero supplied facts, zero memory citations. In our fixed eight-case synthetic suite, Hindsight-backed ReviewMemory excluded saved webhook conventions from 2/2 out-of-scope review]]></description><link>https://haseebreviewmemory.hashnode.dev/keeping-hindsight-review-memory-within-its-intended-scope</link><guid isPermaLink="true">https://haseebreviewmemory.hashnode.dev/keeping-hindsight-review-memory-within-its-intended-scope</guid><category><![CDATA[hindsight]]></category><category><![CDATA[code review]]></category><category><![CDATA[agent-memory]]></category><dc:creator><![CDATA[Mohd Haseeb Uddin]]></dc:creator><pubDate>Mon, 28 Sep 2026 08:31:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aba1432f1d33ee06b71e43e/00791961-b3af-4206-9564-c964ead83d25.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Two boundary reviews, zero supplied facts, zero memory citations.</strong> In our fixed eight-case synthetic suite, Hindsight-backed <a href="https://reviewmemory.onrender.com">ReviewMemory</a> excluded saved webhook conventions from <strong>2/2 out-of-scope reviews</strong>. All <strong>6/6 applicable memory reviews</strong> received <strong>three facts each</strong>. We completed <strong>16/16 paced requests</strong>, one review per condition for each case.</p>
<table>
<thead>
<tr>
<th>Fixed check</th>
<th>Baseline</th>
<th>With memory</th>
</tr>
</thead>
<tbody><tr>
<td>Boundary cases with zero facts and citations</td>
<td><strong>2/2</strong></td>
<td><strong>2/2</strong></td>
</tr>
<tr>
<td>Exact account mapping</td>
<td><strong>0/3</strong></td>
<td><strong>3/3</strong></td>
</tr>
<tr>
<td>All required literal fixes in a defect case</td>
<td><strong>1/4</strong></td>
<td><strong>3/4</strong></td>
</tr>
<tr>
<td>Exact await-call syntax</td>
<td><strong>3/3</strong></td>
<td><strong>2/3</strong></td>
</tr>
</tbody></table>
<p>Baseline skips recall; the memory boundary result tests exclusion after retaining decisions. Those checks overlap and have different denominators. They do not add up to a general accuracy or security score. The await regression remains part of the result.</p>
<p><a href="https://hindsight.vectorize.io/">Hindsight</a> stores and retrieves the facts. The <a href="https://github.com/CodeMasterAhmed/reviewmemory">application</a> checks visitor identity, repository and file scope around that retrieval. The billing contracts are authored fixtures. Reusing their wrapper-verification rule for a direct HTTP endpoint would erase the condition that justified it.</p>
<h2>Give each workspace a separate bank</h2>
<p>Two visitors can both enter <code>acme/billing-service</code>; their saved decisions must remain separate.</p>
<p>The evaluated guest path creates a random workspace identifier and derives a Hindsight bank from it. This excerpt comes from <a href="https://github.com/CodeMasterAhmed/reviewmemory/blob/7248f92/server/session.ts">guest session creation</a>:</p>
<pre><code class="language-ts">const id = randomUUID();
const value = `v1.${id}.${Math.floor(now / 1000) + SESSION_SECONDS}`;
return { token: `${value}.${signature(value, secret)}`, bank: `rm-${id}` };
</code></pre>
<p>In that guest path, the browser receives a signed cookie; it cannot choose an arbitrary bank in an API payload. The server verifies the HMAC signature and expiration before using the identifier. The cookie is HTTPOnly, uses SameSite Strict, and is Secure in production. Its lifetime is thirty days.</p>
<p>The fixed suite used anonymous workspaces: Hindsight held decisions; browser storage held session history. The current account flow adds PostgreSQL-backed identity, workspace settings and review history. After sign-in, the server resolves the account’s persistent Hindsight bank; client-supplied IDs cannot select another user’s bank. Hindsight still stores decision facts. <a href="https://github.com/CodeMasterAhmed/reviewmemory/blob/main/tests/accounts.test.ts">Ten PostgreSQL integration tests</a> cover account persistence, isolation and errors; they do not rerun the eight-case review evaluation.</p>
<p>Guest workspace reset has a specific meaning: it creates a new identity. It does not delete the previous Hindsight bank. Clearing a cookie can remove access from that browser while leaving provider-side records stored. A deletion feature would need to handle those records through the provider.</p>
<h2>Require the right repository and file scope</h2>
<p>Within a bank, every saved decision receives a repository tag and a <code>review-decision</code> tag. Recall requires both, using this actual <a href="https://github.com/CodeMasterAhmed/reviewmemory/blob/7248f92/server/providers.ts">request configuration</a>:</p>
<pre><code class="language-ts">types: ['world', 'experience'],
tags: [repositoryTag(input.repository), 'review-decision'],
tags_match: 'all_strict',
budget: 'mid',
</code></pre>
<p>Repository matching is only the first filter. Each retained document also carries a <code>scope:</code> tag. For the example wrapper decisions, its value is <code>src/webhooks/**</code>. The application supports relative file paths, component wildcards, and a terminal <code>/**</code> for descendant paths; it validates that limited grammar.</p>
<p>The server examines returned tags and rejects a response containing evidence from a different repository. Before assembling the model prompt, it requires a single usable scope that matches a changed path:</p>
<pre><code class="language-ts">if (paths) {
  if (
    scopes.length !== 1 ||
    !paths.some((path) =&gt; scopeMatches(scopes[0], path))
  ) {
    excludedByScope++;
    continue;
  }
}
</code></pre>
<p>This check removes an inapplicable fact before the model can read it. The review trace reports how many facts the scope filter excluded, so an empty evidence panel has an inspectable explanation.</p>
<p>A mixed-file diff needs another check. It could change both a webhook handler and a direct route, allowing a webhook fact into the prompt for a legitimate reason. ReviewMemory validates each finding's memory references against that finding's file. It rejects a response that cites the wrapper convention on a file outside the convention's scope.</p>
<p>That validation checks declared references. It cannot prove that the model never generalized from evidence without citing it. The prompt also states the scope rule, but semantic correctness still requires inspection.</p>
<p><img src="https://raw.githubusercontent.com/CodeMasterAhmed/reviewmemory/29e53ff/docs/images/memory-ledger.jpg" alt="Memory ledger displaying an account-routing fact with its scope and document reference" /></p>
<p><em>The ledger after retaining three example decisions. The account-routing fact includes its file scope and document identifier.</em></p>
<h2>Test both inclusion and exclusion</h2>
<p>The fixed <a href="https://github.com/CodeMasterAhmed/reviewmemory/tree/main/evaluation">evaluation</a> used eight synthetic scenarios: four defect cases, two handlers satisfying the stated contracts, and two boundary controls. Each ran once in baseline mode and once with retained decisions, using the same model and prompt. All 16/16 requests completed in the paced run on September 28, 2026.</p>
<p>The <strong>2/2</strong> boundaries test different conditions. One changes <code>src/routes/refund-callback.ts</code>, outside the saved scope; its trace records <strong>three exclusions and zero supplied facts</strong>. The other uses a different repository. We check prompt evidence and declared references, without grading their route findings as correct.</p>
<p>The <strong>3/3</strong> exact <code>connectedAccount: event.account</code> suggestions each cited the corresponding decision. For the primary check, the scorer required every expected literal fix in each of four defective handlers. That passed <strong>1/4 baseline and 3/4 with memory</strong>; it is a narrower claim than overall review quality.</p>
<p>Exact await-call syntax fell <strong>3/3 to 2/3</strong>. One response recommended awaiting in prose but omitted the literal call; the frozen scorer kept that failure. Zero-findings controls passed <strong>1/2 and 2/2</strong>. We did not execute generated patches or use an LLM judge.</p>
<p>An earlier <a href="https://github.com/CodeMasterAhmed/reviewmemory/blob/7248f92/scripts/verify-live.ts">integration check</a> also verified fresh-visitor isolation and later retrieval. The paired evaluation adds repeatable contract checks, but one billing domain and one repeat cannot establish broad accuracy. Its baseline lacks prior decisions by design; it does not compare against another tool given the same context directly.</p>
<p><img src="https://raw.githubusercontent.com/CodeMasterAhmed/reviewmemory/29e53ff/docs/images/scope-boundary.jpg" alt="Direct route review with zero applicable facts and three facts excluded by scope" /></p>
<p><em>The interactive direct-route example receives zero facts. Its trace records three facts excluded by file scope; this capture is separate from the fixed evaluation.</em></p>
<h2>Replace a decision without accumulating old versions</h2>
<p>Remembering feedback also creates an update problem. If a maintainer changes a convention, retaining both versions as current guidance can make the next review less reliable.</p>
<p>ReviewMemory derives a stable document identifier from the normalized repository name, decision title, and scope. Saving an edited rationale under that same identity sends a replacement. The retained item includes these fields:</p>
<pre><code class="language-ts">document_id: documentId,
update_mode: 'replace',
tags: [
  repositoryTag(decision.repository),
  'review-decision',
  `scope:${decision.scope}`,
],
</code></pre>
<p>The <a href="https://github.com/vectorize-io/hindsight">Hindsight implementation</a> provides document replacement behavior. The application's choice of stable identity makes an edit target the earlier source instead of creating an unrelated new document. Recall requests use source facts of the <code>world</code> and <code>experience</code> types rather than derived observations.</p>
<p>The identity rule has an important limit: changing the title or scope creates a different document identifier. It is not general contradiction resolution. Two decisions with different names can still disagree. The reviewer instructions ask the model to acknowledge unresolved conflicts; a maintainer must inspect and reconcile them.</p>
<p>A provider write can finish after a local timeout. The backend reports uncertainty without retrying on its own. An explicit retry uses the stable identifier; a successful response triggers a document-specific list request to verify extracted facts.</p>
<h2>Separate valid references from correct reasoning</h2>
<p>The review generator must return structured JSON. The server validates its shape, checks that cited identifiers came from the supplied evidence, and checks file locations against the diff. Malformed output or invented references produce errors rather than replacement findings.</p>
<p>Those checks do not validate meaning. The <a href="https://github.com/CodeMasterAhmed/reviewmemory/blob/main/evaluation/semantic-audit.md">qualitative audit</a> records memory responses that supplied correct fixes but invented duplicate processing after a premature commit or unsupported validation failures. Extracted facts also compressed details from the original decisions. Inspect the source rationale as well as the recalled text; a passing identifier check cannot establish that either was interpreted correctly.</p>
<p>The reviewer cannot inspect unseen wrapper code. Examine the saved rationale, recalled fact, file scope and patch before accepting a change.</p>
<p>Operational failure is part of the record too. The unpaced pilot produced 26/32 <code>PROVIDER_BUSY</code> errors. Those outputs remain available; they were not pooled into an effectiveness score. Before the paced run, an amendment reduced repeats from two to one and introduced 65-second gaps. The sanitized errors did not identify the exact upstream quota. No semantic failure triggered a retry.</p>
<p>Use non-confidential samples on the public app. Recall sends a diff excerpt to Hindsight, and the review request sends code to Groq. Neither a scoped convention nor valid citations establish that unseen code is safe.</p>
<p>Vectorize's <a href="https://vectorize.io/what-is-agent-memory">agent memory overview</a> offers background. Here, inspect the boundary result alongside the behavior result: <strong>2/2</strong> boundaries excluded facts, <strong>3/3</strong> account mappings matched, and <strong>one of three</strong> await-syntax checks failed. Scope and citations make evidence inspectable; they cannot certify the reasoning.</p>
<p>Related developer tooling: <a href="https://code.in/">Code.in</a>.</p>
]]></content:encoded></item></channel></rss>