Skip to content

feat(index): add authenticated semantic execution facts - #633

Merged
mohanagy merged 5 commits into
nextfrom
agent/issue-632-semantic-execution-index
Jul 31, 2026
Merged

feat(index): add authenticated semantic execution facts#633
mohanagy merged 5 commits into
nextfrom
agent/issue-632-semantic-execution-index

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • index authenticated, ordered body-level facts for calls, literals, conditions, loops, parallel groups, returns, mutations, persistence, and throws
  • model exact queue, job, and event channels with typed producer → channel → consumer topology and bounded two-hop wrapper substitution
  • validate compact execution facts and channel proofs against the current source snapshot before retrieval can use the query index
  • preserve the existing madar.retrieve v1 response; [P0][Retrieval]: Plan obligations and return strict answer-ready workflow dossiers #630 owns the v2 retrieval cutover

Testing

  • npm run test:run — exact-head hosted Ubuntu/Node 22 coverage suite in run 30622792952; local split proved 761 unique tests without claiming a single clean local invocation on the busy Darwin host
  • npm run typecheck
  • npm run build
  • npm pack --dry-run
  • all six hosted matrix jobs in run 30622792952
  • 196 focused execution/index/authentication/retrieval tests
  • 18 Core Reset governance tests
  • Registry validation, release hygiene, packed parity, baseline/isolation, audit, demo evaluation, and git diff --check

Core Reset contract

Reset scope checks

Exact candidate

  • protected base: next at 9043320cfa08370e5cdd3911bfb9283005aa9912
  • protected base tree: f51d6e75e3b806dec6caf9ff0be43fc2ab5713fc
  • exact head: c9d2c6f730c5e4e426d6f2f4b1aa4c0623bb4067
  • exact tree: c46b93c85c415ec0036fbe5a5fe2cee06abc1e99
  • target: protected next, never main
  • no dependency, version, script, lockfile, retrieval-budget, provider, publication, release, Registry, or tag change

Measurements

  • production: 44 TypeScript files / 15,934 LOC; +3,667/-187, net +3,480 against the +3,500 ceiling
  • package: 102 files / 145,254 packed / 638,736 unpacked bytes
  • npm shasum: 9f0c66e663f703afbb9a5e68f6037f9e211cba58
  • npm integrity: sha512-3yYpFxnym0r9DF66IfS8w1MI01DMLU+hX6uQi6aQoBQvbeu6jHn8j059N6ml3MwMx3wvlj41Y3yAMIX3D2N2Aw==
  • GoValidate: 1,649/1,649 indexed; 12,313 nodes / 32,717 edges / 60,267,088 bytes; artifact ratio 1.2291718874663748
  • exact topology: six queue channels; 42 typed edges (35 publishes_to, 7 consumed_by); the removed nine edges were duplicate outer-callsite projections
  • indexing trials: 14.83 / 12.99 / 13.05 / 14.16 / 13.17 seconds; median 13.17; beta.4 ratio 0.5943140794223827
  • 100 warm retrievals: median 156.740 ms / p95 177.585 ms / max 183.077 ms
  • deterministic graph SHA-256: 77270a6f0330a3ce85fbc42b90e7a3e99f8bf37776f6e65f5da8aad1bad3caaf
  • beta.4 v1 retrieval remains byte-identical: 15,294 bytes; SHA-256 87b4ef75473834708b20f1d2580b31470a710d797d7bdf55eee1d0876827a173

Superseded stop disposition

Stopped heads 9fe3c244…, c977de03…, and f4ae6440… did not merge. The exact current head retains the prior corrections and adds dedicated generic regressions for all nine f4ae6440… false-proof classes: mutable Map channel identity, dead-tail reachability, computed credential targets, wrapper persistence multiplicity, switch fallthrough, nested secret taint, reassigned injected queues, mutated Promise inputs, and reassigned typed EventEmitter scope. The durable exact-head receipts are on #632.

CodeRabbit completed substantive review on the byte-identical production candidate and its valid governance-cohort omission was corrected in this head. A genuine post-correction CodeRabbit rerun remains required; a summary refresh or temporary rate-limit status is not treated as completed review.

Checklist

Related issues

Closes #632
Related: #629
Successor after merge: #630

Summary by CodeRabbit

  • New Features

    • Added deeper TypeScript execution analysis, including control flow, asynchronous work, persistence, queues, events, and data channels.
    • Improved search and context retrieval with richer evidence, source verification, and safer handling of invalid or outdated data.
    • Added more reliable detection of updated graph artifacts and query indexes.
  • Bug Fixes

    • Prevented unsupported, oversized, malformed, or unauthenticated data from affecting results.
    • Improved deterministic indexing and protection of sensitive values.
  • Documentation

    • Updated release records and roadmap for the published beta.4 release and upcoming execution-index work.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: daa33fe2-24fd-4624-8f18-8592ddcc1446

📥 Commits

Reviewing files that changed from the base of the PR and between bff482c and c9d2c6f.

📒 Files selected for processing (2)
  • docs/core-reset/removal-manifest.yml
  • tests/unit/core-reset-governance.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/core-reset/removal-manifest.yml

📝 Walkthrough

Walkthrough

The PR adds authenticated execution facts, queue/job/event channels, persistence evidence, immutable query indexes, and artifact-identity caching. Retrieval validates source and graph evidence. Release governance records beta.4 publication and phase ordering.

Changes

Semantic execution indexing

Layer / File(s) Summary
Index contracts and validation
src/domain/index/*, src/domain/query/*
The canonical index moves to version 4. It defines bounded execution facts, channel nodes, evidence, serialization, integrity checks, immutable operation maps, and channel maps.
Execution fact collection and graph integration
src/adapters/typescript/*
The TypeScript indexer extracts control flow, calls, mutations, persistence, concurrency, queue/job/event channels, routing edges, diagnostics, and authenticated evidence.
Artifact caching and authenticated retrieval
src/adapters/filesystem/graph-artifact.ts, src/adapters/mcp/server.ts, src/application/retrieve-context.ts
Graph artifact identities support cache reuse. Retrieval validates source hashes, UTF-8 content, ranges, fact proofs, channel proofs, and relationship endpoints.
Execution and integrity validation tests
tests/unit/canonical-index-execution*.test.ts, tests/unit/query-index-execution-validation.test.ts
Tests cover extraction, channel matching, persistence, redaction, determinism, immutability, malformed facts, forged evidence, and corrupt indexes.
Release and phase governance
docs/core-reset/*, docs/roadmap.md, tests/unit/core-reset-governance.test.ts
Governance records beta.4 as published, phase #632 as active, phases #630 and #631 as pending, and updated measurements and package rules.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TypeScriptIndexer
  participant ExecutionCollector
  participant CanonicalGraph
  participant QueryIndex
  participant RetrieveContext
  TypeScriptIndexer->>ExecutionCollector: collect execution facts and channels
  ExecutionCollector->>CanonicalGraph: write encoded facts and graph edges
  CanonicalGraph->>QueryIndex: load and validate canonical index
  QueryIndex->>RetrieveContext: provide immutable operation and channel maps
  RetrieveContext->>RetrieveContext: authenticate source excerpts and relationships
Loading

Possibly related issues

Possibly related PRs

  • mohanagy/madar#586 — Introduced the canonical TypeScript index extended by this PR.
  • mohanagy/madar#598 — Defined the authenticated source-excerpt validation contract used by retrieval changes.
  • mohanagy/madar#583 — Introduced graph-artifact infrastructure extended with identity-based caching.

Suggested labels: roadmap, core-reset

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding authenticated semantic execution facts to the index.
Description check ✅ Passed The description includes the required summary, testing, Core Reset contract, checklist, and related issues with detailed verification results.
Linked Issues check ✅ Passed The changes implement the linked issue objectives for authenticated execution facts, exact channels, persistence, validation, determinism, and immutable query indexes.
Out of Scope Changes check ✅ Passed The changes remain within the linked issue scope, including required documentation, packaging validation, implementation, and regression tests.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/issue-632-semantic-execution-index

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/core-reset/scorecard.md (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Two summaries overstate what is missing for the #632 candidate. Both sites group "candidate" together with the genuinely pending CI/review/merge/publication receipts, but docs/core-reset/removal-manifest.yml's semantic-execution-index-632 item already records concrete interim candidate data (149 focused tests passed, graph/channel counts, indexing-median ratio, warm-retrieval p95) and its own notes say those receipts "are recorded above," listing only CI, independent review, zero-thread, merge, and publication as absent.

  • docs/core-reset/scorecard.md#L46-53: change the Evidence cell from "no candidate, CI, review or merge receipt yet" to match line 206's more precise "No candidate final receipt, CI result, review result, merge commit... is claimed here."
  • docs/roadmap.md#L166-170: reword "Candidate, CI, review, merge, and publication receipts remain pending" so it does not imply that no candidate measurement exists yet, consistent with the recorded candidate.local_verification data in the manifest.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/core-reset/scorecard.md` at line 1, Update the `#632` evidence summary in
scorecard.md to distinguish the existing interim candidate data from the missing
candidate final, CI, review, merge, and publication receipts, matching the
precise wording used near the manifest reference. Reword the corresponding
roadmap entry so it states that the candidate final receipt and remaining
CI/review/merge/publication receipts are pending without implying that candidate
measurements are absent; preserve the documented manifest data and scope the
changes to these two summaries.
🧹 Nitpick comments (5)
src/adapters/typescript/execution.ts (2)

1968-1984: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Precompute the sort keys in sortEdges.

The comparator calls JSON.stringify(left) and JSON.stringify(right) on every comparison, so serialization runs O(n log n) times over all execution edges. Serialize each edge once, then sort on the precomputed key.

♻️ Proposed change
-    return [...retained, ...structuralRoutes.values()].sort((left, right) => compareText(JSON.stringify(left), JSON.stringify(right)));
+    return [...retained, ...structuralRoutes.values()]
+        .map((edge) => [JSON.stringify(edge), edge] as const)
+        .sort(([left], [right]) => compareText(left, right))
+        .map(([, edge]) => edge);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adapters/typescript/execution.ts` around lines 1968 - 1984, Update
sortEdges to precompute each edge’s JSON serialization once and retain it
alongside the edge, including when selecting structuralRoutes representatives;
use those cached strings for both compareText calls and return the edges in the
existing sorted order.

151-167: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Reuse the scanner in structuralText. Use a module-local scanner and call setLanguageVariant(sf.languageVariant) and setText(node.getText(sf)) before each scan. Keep boundedText unchanged; its loop is capped at MAX_TEXT_BYTES (256 by default and 96 for switch arms), so it is not quadratic in input length. Do not remove every trailing \uFFFD, because valid replacement characters can occur at the truncation boundary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adapters/typescript/execution.ts` around lines 151 - 167, Update
structuralText to reuse a module-local TypeScript scanner instead of creating
one per call; before scanning, call setLanguageVariant(sf.languageVariant) and
setText(node.getText(sf)). Keep boundedText unchanged, including its existing
truncation behavior and valid trailing replacement characters.
src/domain/index/model.ts (1)

386-403: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Export the shared scalar validators instead of re-implementing them in the query layer.

safeInt, validText, orderCmp, SHA256 and MAX_TEXT are duplicated in src/domain/query/index-status.ts (lines 45-46, 72-85, 230-236). The copies have already diverged: the safeInt in index-status.ts omits the Object.is(value, -0) rejection that this version applies. Both files validate the same wire values, so the two definitions must stay identical.

Export these helpers from model.ts and import them in index-status.ts.

♻️ Proposed export surface
-function safeInt(value: unknown, minimum = 0): value is number {
+export function safeInt(value: unknown, minimum = 0): value is number {
   return typeof value === 'number'
     && Number.isSafeInteger(value)
     && !Object.is(value, -0)
     && value >= minimum
 }
-function validText(value: unknown, maxBytes = MAX_TEXT): value is string {
+export function validText(value: unknown, maxBytes = MAX_TEXT): value is string {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/domain/index/model.ts` around lines 386 - 403, Export the shared
validators and constants safeInt, validText, orderCmp, SHA256, and MAX_TEXT from
model.ts, then remove their duplicate definitions in index-status.ts and import
the exported symbols there. Ensure query validation uses the model
implementations, including safeInt’s -0 rejection, while preserving existing
behavior.
tests/unit/query-index-execution-validation.test.ts (1)

515-523: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the integrity subject so each case reaches its intended validator.

The assertion checks only state: 'corrupt'. Three cases therefore pass through an earlier check and leave the validator they name uncovered:

  • 'a missing job parent' (lines 487-494) changes parent_channel_id, so channelFrom recomputes a different indexChannelId and validation fails at canonical channel node. The canonical job parent channel branch is never reached.
  • 'an unscoped event' (lines 507-514) deletes scope, which triggers the same id mismatch instead of canonical event channel scope.
  • 'reversed publish endpoints' (lines 496-500) adds an edge with no evidence, so edgeProof fails at canonical channel evidence instead of the publishes_to endpoint check.

Add an expected subject per case, and give the reversed-endpoint case the authenticated channelEvidence payload so it reaches the endpoint check.

💚 Proposed change
     {
       name: 'reversed publish endpoints',
+      subject: 'canonical publishes_to endpoints',
       mutate: ({ graph, runId, jobId }: Fixture) => {
-        graph.addEdge(jobId, runId, { relation: 'publishes_to' })
+        graph.addEdge(jobId, runId, {
+          relation: 'publishes_to',
+          ...channelEvidenceFor(graph, runId),
+        })
       },
     },
-  ])('rejects $name as corrupt after re-signing', ({ mutate }) => {
+  ])('rejects $name as corrupt after re-signing', ({ mutate, subject }) => {
     const value = fixture()
     mutate(value)
     resign(value.graph)
 
     expect(inspectQueryIndex(value.graph)).toMatchObject({
       state: 'corrupt',
+      subject,
     })
   })

Export the evidence payload from fixture() so a case can reuse it, and set the expected subject for the job-parent and event-scope cases to the value they intend to exercise.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/query-index-execution-validation.test.ts` around lines 515 - 523,
Update the parameterized corruption test around fixture() and
inspectQueryIndex() to assert each case’s expected subject, including the
canonical job parent channel and canonical event channel scope cases. Export or
expose fixture()’s authenticated channelEvidence so the reversed publish
endpoints mutation reuses it when adding the edge, allowing validation to reach
the publishes_to endpoint check.
src/domain/query/index-status.ts (1)

68-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Include the offending node or edge identifier in the integrity subject.

inspectQueryIndex returns error.message as the corrupt subject. Every fail() call passes a fixed category string, so an operator sees canonical operation control reference without the owner, fact, channel, or edge identity. Diagnosing a corrupt artifact then requires re-deriving the failure by hand.

Accept an optional detail argument and append it to the subject.

♻️ Proposed change
-function fail(subject: string): never {
-  throw new QueryIndexIntegrityError(subject)
+function fail(subject: string, detail?: string): never {
+  throw new QueryIndexIntegrityError(detail ? `${subject}: ${detail}` : subject)
 }

Then pass the identity at each call site, for example fail('canonical operation control reference', fact.id).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/domain/query/index-status.ts` around lines 68 - 70, Update fail and every
call site in inspectQueryIndex to accept and pass the offending node or edge
identifier as an optional detail, appending it to the integrity subject while
preserving the existing category text. Use the relevant identities such as
fact.id, owner, channel, or edge identifier so QueryIndexIntegrityError and
inspectQueryIndex expose the specific corrupt artifact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/core-reset/scorecard.md`:
- Around line 46-53: Update the Semantic execution index `#632` Evidence cell in
the scorecard table to say “no candidate final receipt” instead of “no candidate
receipt,” while preserving the existing CI, review, and merge wording and all
other content.

In `@docs/roadmap.md`:
- Around line 166-170: Revise the receipt statement in the “semantic execution
index `#632`” roadmap entry so it acknowledges that candidate measurements are
already recorded, while keeping exact-head CI, independent review, merge, and
publication receipts pending and prohibited from being inferred from local work.

In `@src/adapters/typescript/execution.ts`:
- Around line 1930-1967: Update attachFacts so every encodeIndexBodyFactTable or
decodeIndexBodyFactTable failure is converted into the same per-owner error
diagnostic and omission behavior as IndexBodyFactBoundsError. Remove the rethrow
for non-bounds errors, preserve the diagnostic context for symbol.name and
symbol.range, and ensure one invalid owner does not abort
buildCanonicalTypeScriptIndex.
- Around line 449-470: Update callableOwner so binary-assigned closures are only
indexed when declSymbol(node, file, ctx) resolves to a symbol whose range
exactly matches the function node’s range; otherwise return null instead of
treating the enclosing callable as the owner. Add regression coverage for
property-assigned closures such as this.handler = (job) => ..., verifying their
effects and parameter mappings are not attributed to the enclosing method.

---

Outside diff comments:
In `@docs/core-reset/scorecard.md`:
- Line 1: Update the `#632` evidence summary in scorecard.md to distinguish the
existing interim candidate data from the missing candidate final, CI, review,
merge, and publication receipts, matching the precise wording used near the
manifest reference. Reword the corresponding roadmap entry so it states that the
candidate final receipt and remaining CI/review/merge/publication receipts are
pending without implying that candidate measurements are absent; preserve the
documented manifest data and scope the changes to these two summaries.

---

Nitpick comments:
In `@src/adapters/typescript/execution.ts`:
- Around line 1968-1984: Update sortEdges to precompute each edge’s JSON
serialization once and retain it alongside the edge, including when selecting
structuralRoutes representatives; use those cached strings for both compareText
calls and return the edges in the existing sorted order.
- Around line 151-167: Update structuralText to reuse a module-local TypeScript
scanner instead of creating one per call; before scanning, call
setLanguageVariant(sf.languageVariant) and setText(node.getText(sf)). Keep
boundedText unchanged, including its existing truncation behavior and valid
trailing replacement characters.

In `@src/domain/index/model.ts`:
- Around line 386-403: Export the shared validators and constants safeInt,
validText, orderCmp, SHA256, and MAX_TEXT from model.ts, then remove their
duplicate definitions in index-status.ts and import the exported symbols there.
Ensure query validation uses the model implementations, including safeInt’s -0
rejection, while preserving existing behavior.

In `@src/domain/query/index-status.ts`:
- Around line 68-70: Update fail and every call site in inspectQueryIndex to
accept and pass the offending node or edge identifier as an optional detail,
appending it to the integrity subject while preserving the existing category
text. Use the relevant identities such as fact.id, owner, channel, or edge
identifier so QueryIndexIntegrityError and inspectQueryIndex expose the specific
corrupt artifact.

In `@tests/unit/query-index-execution-validation.test.ts`:
- Around line 515-523: Update the parameterized corruption test around fixture()
and inspectQueryIndex() to assert each case’s expected subject, including the
canonical job parent channel and canonical event channel scope cases. Export or
expose fixture()’s authenticated channelEvidence so the reversed publish
endpoints mutation reuses it when adding the edge, allowing validation to reach
the publishes_to endpoint check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9762ec6b-fa32-4ae3-9bd9-5201f2094241

📥 Commits

Reviewing files that changed from the base of the PR and between 9043320 and 9fe3c24.

📒 Files selected for processing (21)
  • docs/core-reset/removal-manifest.yml
  • docs/core-reset/scorecard.md
  • docs/roadmap.md
  • package.json
  • src/adapters/filesystem/graph-artifact.ts
  • src/adapters/mcp/server.ts
  • src/adapters/typescript/execution.ts
  • src/adapters/typescript/index.ts
  • src/application/retrieve-context.ts
  • src/domain/index/build-state.ts
  • src/domain/index/model.ts
  • src/domain/query/index-status.ts
  • src/domain/query/rank.ts
  • tests/unit/canonical-index-execution-hardening.test.ts
  • tests/unit/canonical-index-execution.test.ts
  • tests/unit/core-reset-governance.test.ts
  • tests/unit/graph-artifact.test.ts
  • tests/unit/query-index-execution-validation.test.ts
  • tests/unit/retrieve-context.test.ts
  • tests/unit/retrieve-evidence-skeleton-adversarial.test.ts
  • tests/unit/retrieve-evidence-skeleton-regression.test.ts
💤 Files with no reviewable changes (1)
  • package.json

Comment thread docs/core-reset/scorecard.md Outdated
Comment thread docs/roadmap.md Outdated
Comment thread src/adapters/typescript/execution.ts Outdated
Comment thread src/adapters/typescript/execution.ts Outdated
@mohanagy

Copy link
Copy Markdown
Owner Author

Corrective head c977de03ecba7958d03966df728abed9f1b36ff7 (tree 8de021e252141f90ceb15b606d9fec05aa1bd619) supersedes the independently blocked first head. Exact measurements and the twelve-class correction are recorded in #632 (comment). Please review this exact head; merge remains gated on all six CI jobs, fresh independent no-blocker review, CodeRabbit completion, and zero unresolved threads.

@mohanagy

Copy link
Copy Markdown
Owner Author

Exact-head stop receipt

Fresh independent review reproduced nine false-proof classes on the exact head:

  1. Map.delete() / Map.clear() retained stale exact queue topology.
  2. Dead text after an abrupt exit hid the surviving conditional continuation.
  3. Computed credential-target mutations exposed plaintext values.
  4. Multiple persistence effects behind one wrapper call collapsed.
  5. Switch fallthrough omitted predecessor entry paths.
  6. Nested object values lost inherited secret taint.
  7. Reassigned @InjectQueue properties retained stale exact queue identity.
  8. Mutated constant arrays retained stale Promise lane counts and inputs.
  9. Reassigned typed EventEmitter properties retained stale exact event scope.

The prior binary-assigned deferred-closure and malformed-owner codec corrections are retained, but they do not clear these blockers. No candidate pass, merge, publication, release, Registry metadata, tag, or main action is authorized by this receipt. A later head must fix the generic semantic rules, pass the unchanged source/package/performance gates, receive fresh exact-head independent and CodeRabbit review, pass all six CI jobs, and have zero unresolved threads before merge can be considered.

@mohanagy

Copy link
Copy Markdown
Owner Author

Corrective candidate receipt

This receipt supersedes stopped heads 9fe3c2448958c6b8cead2452758077fef093cf4e, c977de03ecba7958d03966df728abed9f1b36ff7, and f4ae64402d89ccf639bf698687b3767678ab708c. None of those heads merged.

Frozen source:

  • 44 production TypeScript files / 15,934 LOC
  • +3,667/-187, net +3,480 against the protected base
  • src/adapters/typescript/execution.ts SHA-256: cf43e183f9d001764f4fdd22b073bef8854f9d949fef5793905291b870d3404b
  • Canonical nine-source git diff --binary --full-index SHA-256: e712d06a2c43cc0223c2c4219691ddc860f2f05d26c689b19b8ade2d180c99a6
  • No dependency, version, script, lockfile, retrieval-budget, CLI/MCP public-surface, provider, publication, release, Registry, tag, or main change

Package gate:

  • 102 files / 145,254 packed bytes / 638,736 unpacked bytes
  • npm shasum: 9f0c66e663f703afbb9a5e68f6037f9e211cba58
  • npm integrity: sha512-3yYpFxnym0r9DF66IfS8w1MI01DMLU+hX6uQi6aQoBQvbeu6jHn8j059N6ml3MwMx3wvlj41Y3yAMIX3D2N2Aw==
  • Tarball SHA-256: b49bf7a1eae2b230da4d0b7a778f6112e1bc9d986c083573bc3bd7296a99c670

Real GoValidate gate:

  • Indexed 1,649/1,649 files
  • Graph: 12,313 nodes / 32,717 edges / 60,267,088 bytes
  • Artifact ratio: 1.2291718874663748
  • Five indexing trials: 14.83 / 12.99 / 13.05 / 14.16 / 13.17 seconds; median 13.17, ratio 0.5943140794223827
  • Five identical graph hashes: 77270a6f0330a3ce85fbc42b90e7a3e99f8bf37776f6e65f5da8aad1bad3caaf
  • 100 warm retrievals: median 156.7398119999998 ms / p95 177.5851354499996 ms / maximum 183.07708300000013 ms
  • Six exact queue channels, zero job/event channels, 42 typed edges: 35 publishes_to, seven consumed_by
  • The prior 51-edge count included nine duplicate outer-callsite projections through dispatchWave and checkAndDispatchNext; every unique producer, channel, consumer, and call link remains.

Retrieval compatibility:

  • Broad workflow query: exact 10-node spine, 10 files / 10 snippets / 3,669 tokens / four honest disconnected async boundaries; 13,376 bytes, SHA-256 ca003cd8eb0be3273589b556ad0acaf2c49588a1d9e00dccf4e5f36da795b996
  • Beta.4 v1 response remains byte-identical at 15,294 bytes, SHA-256 87b4ef75473834708b20f1d2580b31470a710d797d7bdf55eee1d0876827a173

Local verification:

  • Typecheck, production build, evaluation build, Registry validation, release hygiene, packed-runtime parity, npm audit, Core Reset baseline, package isolation, demo graph, evaluation regression, governance tests, and git diff --check passed.
  • All 143 focused tests passed.
  • The latest default-fork coverage run passed 79 files / 707 tests before this busy Darwin host failed to start the final retrieve-context worker. That sole unstarted file then passed 54/54 alone under the same default-fork mode, proving 761 unique passing tests without claiming a clean single-invocation full suite.
  • Two independent frozen-source/full-diff audits found no blocker.

Still mandatory and pending on this exact head:

  1. all six clean hosted CI jobs;
  2. completed CodeRabbit review (a rate-limit or skip is not represented as review);
  3. independent exact-head review with no blocker;
  4. zero unresolved review threads.

No merge is authorized unless every gate passes. This receipt authorizes no npm publication, GitHub Release, Registry metadata, tag, provider activity, or main action.

@mohanagy mohanagy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent exact-head review for bff482c6fef28217d18021561038b406599c990a / tree 4a4710e56db949b2082270c1f3cb4d8ec8b3da27: NO BLOCKER.

The review covered the complete frozen implementation and governance diff, including lexical-capture/public-schema preservation after byte compaction, authenticated control/order/value facts, alias invalidation, persistence receiver proof, wrapper bounds, channel identity, switch/try/Promise semantics, stale-value removal, package/source ceilings, and the real GoValidate topology. The 51→42 change removes exactly nine duplicate outer-callsite projections; no unique producer→channel→consumer obligation is lost. Exact source, package, graph, retrieval, performance, and governance receipts match the candidate.

Local runner caveat is recorded without overclaim: default forks completed 79 files / 707 passing tests; the sole unstarted retrieve-context file passed 54/54 alone. A clean single-invocation full suite remains mandatory in hosted CI. Merge remains blocked on all six exact-head CI jobs, completed CodeRabbit review, and zero unresolved threads.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/unit/canonical-index-execution-review-regressions.test.ts (1)

236-241: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify the arm helper.

The helper calls control.find three times and then casts the frame. A single lookup with a narrowing check gives the same result and removes the cast.

♻️ Proposed refactor
-    const arm = (name: string): string | undefined =>
-      byName.get(name)?.control.find((frame) =>
-        frame.kind === 'branch')?.kind === 'branch'
-        ? (byName.get(name)!.control.find((frame) =>
-            frame.kind === 'branch') as { arm: string }).arm
-        : undefined
+    const arm = (name: string): string | undefined => {
+      const frame = byName.get(name)?.control
+        .find((candidate) => candidate.kind === 'branch')
+      return frame?.kind === 'branch' ? frame.arm : undefined
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/canonical-index-execution-review-regressions.test.ts` around lines
236 - 241, Update the arm helper to perform one control.find lookup for the
requested name, narrow the returned frame by checking its kind, and return its
arm directly when it is a branch; otherwise return undefined. Remove the
repeated byName.get/control.find calls and the type cast.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/core-reset/removal-manifest.yml`:
- Around line 2233-2241: Update the verification list for the
semantic-execution-index-632 cohort to include both modified retrieval test
files, alongside the existing entries, so the manifest covers every changed
test.

In `@tests/unit/core-reset-governance.test.ts`:
- Line 2129: Update the git diff argument in the relevant test to use
--full-index instead of --abbrev=7, and replace the expected
EVIDENCE_SKELETON_RETRIEVAL_DIFF_SHA256 digest with
753ae098393b52f2c57ea4ffdc282ef19a28c0bb8e81698816af2c1f38df7570.

---

Nitpick comments:
In `@tests/unit/canonical-index-execution-review-regressions.test.ts`:
- Around line 236-241: Update the arm helper to perform one control.find lookup
for the requested name, narrow the returned frame by checking its kind, and
return its arm directly when it is a branch; otherwise return undefined. Remove
the repeated byName.get/control.find calls and the type cast.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9117487-4f92-41c0-b6af-0217fba5b29c

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe3c24 and bff482c.

📒 Files selected for processing (10)
  • docs/core-reset/removal-manifest.yml
  • docs/core-reset/scorecard.md
  • docs/roadmap.md
  • src/adapters/typescript/execution.ts
  • src/domain/index/model.ts
  • src/domain/query/index-status.ts
  • tests/unit/canonical-index-execution-hardening.test.ts
  • tests/unit/canonical-index-execution-review-regressions.test.ts
  • tests/unit/core-reset-governance.test.ts
  • tests/unit/query-index-execution-validation.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/roadmap.md
  • tests/unit/canonical-index-execution-hardening.test.ts
  • docs/core-reset/scorecard.md
  • src/domain/query/index-status.ts
  • src/domain/index/model.ts

Comment thread docs/core-reset/removal-manifest.yml
Comment thread tests/unit/core-reset-governance.test.ts
@mohanagy

Copy link
Copy Markdown
Owner Author

CodeRabbit correction candidate receipt

This head supersedes bff482c6fef28217d18021561038b406599c990a after CodeRabbit’s exact-head review found one valid governance-cohort omission.

  • Exact candidate head: c9d2c6f730c5e4e426d6f2f4b1aa4c0623bb4067
  • Exact candidate tree: c46b93c85c415ec0036fbe5a5fe2cee06abc1e99
  • Protected base/target remain next at 9043320cfa08370e5cdd3911bfb9283005aa9912
  • Target remains next, never main

The sole correction adds the two modified retrieval-evidence test files to #632’s verification list and records the exact focused cohort as 196 passing tests. Those added files pass 53/53; the governance contract passes 18/18.

Production is byte-identical to the prior reviewed candidate:

  • execution.ts SHA-256: cf43e183f9d001764f4fdd22b073bef8854f9d949fef5793905291b870d3404b
  • Canonical nine-source full-index diff SHA-256: e712d06a2c43cc0223c2c4219691ddc860f2f05d26c689b19b8ade2d180c99a6
  • Source/package/real-GoValidate/performance/retrieval receipts in the prior candidate receipt are unchanged.

CodeRabbit’s other new suggestion would rewrite the already accepted #625 historical diff-hash format from its recorded --abbrev=7 representation to a different --full-index representation. #632 does not rewrite immutable completed-phase evidence, so that suggestion is intentionally not applied.

Run 30621903759 proved all six jobs green for bff482c6…, including the clean Ubuntu/Node 22 single-invocation coverage suite. It is not claimed for this new head. All six jobs, completed CodeRabbit review, independent exact-head no-blocker review, and zero unresolved threads must pass again for c9d2c6f7… before merge.

No publication, release, Registry metadata, tag, provider activity, or main action is authorized.

@mohanagy mohanagy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent exact-head correction review for c9d2c6f730c5e4e426d6f2f4b1aa4c0623bb4067 / tree c46b93c85c415ec0036fbe5a5fe2cee06abc1e99: NO BLOCKER.

The delta changes only the #632 verification manifest and matching governance expectation. The newly enumerated adversarial and regression files pass 25 and 28 cases respectively, making the exact cohort 143 + 53 = 196. Every test path changed from protected base is now covered, plus the relevant stdio test. Production, package, graph, performance, retrieval, and source hashes remain byte-identical to the prior reviewed candidate.

The separate CodeRabbit suggestion to change completed #625 from its recorded --abbrev=7 diff representation to --full-index is correctly rejected as an immutable historical-receipt rewrite outside #632; the historical hash still reproduces. Merge remains blocked on all six CI jobs, a completed CodeRabbit review of this exact two-file delta rather than its current rate-limit skip, and zero unresolved threads.

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mohanagy
mohanagy merged commit e7bd30c into next Jul 31, 2026
7 checks passed

Copy link
Copy Markdown
Owner Author

Protected-next merge receipt

  • reviewed head: c9d2c6f730c5e4e426d6f2f4b1aa4c0623bb4067
  • reviewed tree: c46b93c85c415ec0036fbe5a5fe2cee06abc1e99
  • squash merge commit: e7bd30ce384cf743dbda3e8ee7f15b171a0ea649
  • merge tree: c46b93c85c415ec0036fbe5a5fe2cee06abc1e99
  • parent: 9043320cfa08370e5cdd3911bfb9283005aa9912
  • target: protected next, never main

All six exact-head CI jobs passed in run 30622792952; independent review found no blocker; CodeRabbit correction review run daa33fe2-24fd-4624-8f18-8592ddcc1446 produced no actionable comments; and zero review threads remained unresolved.

No npm publication, GitHub Release, Registry metadata, tag, provider activity, or main action occurred. #630 is the next dependency-ordered workstream and starts from this exact merge commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant