Skip to content

#445 — SourceMap on the spine; derive compiled_sql + CodeMapPayload - #453

Merged
cmbays merged 4 commits into
mainfrom
domain-445-source-map-spine
Jun 22, 2026
Merged

cmbays merged 4 commits into
mainfrom
domain-445-source-map-spine

Conversation

@cmbays

@cmbays cmbays commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

S2 of the source-map spine (epic #442). Grows the per-model source-map primitive and makes the faithful full compiled text the single source of truth that compiled_sql now derives from.

  • NEW src/domain/source_map.rs — SpanRole (CteBody/Zone, #[non_exhaustive]), ZoneKind, SourceMapEntry (is_compiled_in), the reserved 3-state Presence enum, and SourceMap with the compiled_slices() / node_spans() derived projections, plus the pure-domain from_cte_graph assembler (the cute-dbt#40 retain-don't-recompute fold over the S1-retained per-CTE spans — no re-parse).
  • ModelPayload.compiled_sql is now a DERIVED projection of the source map; new Serialize-only CodeMapPayload (compiled + node_spans + reserved raw_zones) on ModelPayload, present for every compiled model (None — key omitted — for a seed/source with no compiled code, so older fixtures stay byte-stable).

Key fix — the no-WITH / empty-graph path

A WITH-less model emits no DAG nodes, so the assembler synthesizes ONE terminal CteBody entry over the whole text. compiled_sql now keys by the stable terminal id (was the bare model name), so node_spans.keys() == compiled_sql.keys() by construction. Blocker-1 holds: the terminal slice byte-equals the legacy post-trim terminal text (S1 advanced start.byte past the leading-trim prefix at construction).

Serde note

The verbatim Zone { kind: ZoneKind } field collides with the internally-tagged enum's kind discriminant; the field is renamed on the wire to zone_kind so Deserialize derives (ruling C6 — --context-out round-trips, the Claude Design harness re-ingests).

Gates run (all green, judged by raw exit code)

  • cargo fmt --all -- --check, cargo clippy --all-targets --locked -- -D warnings, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked, cargo deny check — clean.
  • cargo nextest run — 2412 passed, 135 skipped.
  • cargo test --test bdd — 242 scenarios / 1645 steps passed.
  • Headless (real file:// Chromium): headless_zero_egress 12 passed (zero external requests against the regenerated goldens); headless_toggle 123 passed.
  • crap4rs strict — source_map.rs added to the strict (<=15) set; max CRAP 3.14, exit 0.
  • cargo-mutants — source_map.rs added to the targeted examine set; all source_map.rs mutants CAUGHT + both from_source_map mutants CAUGHT, 0 survivors in the slice. (One pre-existing unrelated survivor render.rs:1196 ManifestColumnPayload is outside this diff.)

TDD-first

16 domain tests (compiled byte-equality, no-WITH terminal entry, key-set agreement, span invariants, serde round-trip, Zone round-trip despite the inner kind field) written before the impl, plus render tests: byte-equal slice per node, the dag-node-has-a-CteBody-entry fitness check, the inlined-data assertion + code_map omission for uncompiled nodes, and the Zone-projection arm.

Golden impact (consequence, not driver)

The 6 compiled-model report goldens REGEN with the additive inlined code_map block (jaffle-shop, playground, diff-showcase, seed-showcase, prdiff-minidag, comments-showcase). macro-heavy + diff-showcase-findings.json are unchanged. The 3 explore tests.html goldens regen too — they embed the same ModelPayload, so the data-spine fact ripples into both arms (regen + byte-verify BOTH). The render_integration insta snapshot is updated; its diff is exactly the additive code_map.{compiled,node_spans} block (byte-equality verifiable from the data: e.g. node_spans["(final select)"] byte 227..248 = the post-trim terminal slice). No paired dbt-project/ construct change — S2 adds no new dbt-construct rendering surface (it is the data spine that S3 consumes); the existing showcase fixtures already exercise the code_map.

Closes #445

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added source-map completeness validation to CI pipeline to verify code-to-model node mapping coverage.
  • Tests

    • Enhanced test suite validating code mapping consistency and DAG node coverage.

cmbays and others added 2 commits June 22, 2026 01:45
…deMapPayload

S2 of the source-map spine (epic #442). Grows the per-model source-map
primitive (src/domain/source_map.rs): SpanRole (CteBody/Zone, non_exhaustive),
ZoneKind, SourceMapEntry, the reserved 3-state Presence enum, and SourceMap +
the compiled_slices()/node_spans() derived projections. The faithful full
compiled text becomes the single source of truth; per-node compiled_sql is now
a DERIVED projection of (compiled, entries) via SourceMap::from_cte_graph (the
cute-dbt#40 retain-don't-recompute fold over the S1-retained per-CTE spans —
no re-parse, no new compute).

Adds the thin Serialize-only CodeMapPayload render projection on ModelPayload
(near compiled_sql, render.rs); every compiled model now carries
code_map.{compiled,node_spans} (None — key omitted — for a seed/source with no
compiled code, so older fixtures stay byte-stable).

KEY FIX (the no-WITH / empty-graph path): a WITH-less model emits no DAG nodes,
so the assembler synthesizes ONE terminal CteBody entry over the whole text —
compiled_sql now keys by the stable terminal id (was the bare model name), so
node_spans.keys() == compiled_sql.keys() by construction. Blocker-1 holds: the
terminal slice byte-equals the legacy post-trim terminal text (S1 advanced
start.byte past the leading-trim prefix at construction).

Serde note: the verbatim Zone { kind: ZoneKind } field collides with the
internally-tagged enum's `kind` discriminant; renamed on the wire to
`zone_kind` so Deserialize derives (ruling C6 — --context-out round-trips).

TDD-first: 16 domain tests (byte-equality, no-WITH terminal entry, key-set
agreement, span invariants, serde round-trip) + render tests (byte-equal slice
per node, the dag-node-has-an-entry fitness check, the inlined-data + code_map
omission assertions, the Zone-projection arm). source_map.rs enters the strict
crap set (<=15) + the cargo-mutants targeted set: all 10 source_map mutants +
both from_source_map mutants CAUGHT, 0 survivors.

Goldens (consequence): the 6 compiled-model report goldens REGEN with the
code_map block; the 3 explore tests.html regen too (they embed the same
ModelPayload — the data-spine fact ripples into both arms). macro-heavy +
diff-showcase-findings.json unchanged. Headless zero-egress (12) + toggle (123)
green against the regenerated goldens.

Closes #445

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0199AmBCec5kyVEEF1Qd7TSF
…st doc (clippy::doc_markdown)

The from_source_map_projects_zone_entries_into_raw_zones test doc comment
referenced SourceMap/Zone/CteBody without backticks; the pre-push clippy hook
(doc_markdown, -D warnings) caught it. Doc-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0199AmBCec5kyVEEF1Qd7TSF
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cmbays, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d00237a2-bdd0-415a-b3df-1d6af8e22690

📥 Commits

Reviewing files that changed from the base of the PR and between 34161cd and afae646.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • src/adapters/render.rs
  • src/domain/source_map.rs
📝 Walkthrough

Walkthrough

Introduces src/domain/source_map.rs defining SpanRole, ZoneKind, SourceMapEntry, Presence, and SourceMap as per-model domain primitives. The renderer projects these into new RawZonePayload and CodeMapPayload structs added to ModelPayload. build_compiled_sql is refactored to derive output from SourceMap::compiled_slices. A new CI job enforces DAG-node completeness in committed example HTML payloads, and quality tooling configuration is updated accordingly.

Changes

SourceMap domain primitive and render projection

Layer / File(s) Summary
SourceMap domain types and module wiring
src/domain/source_map.rs, src/domain/mod.rs
Defines SpanRole, ZoneKind, Presence, SourceMapEntry, and SourceMap with from_cte_graph, compiled_slices, node_spans, and whole_text_span. Declares the source_map submodule and re-exports all types at the domain root. Includes a comprehensive unit/serde test suite.
CodeMapPayload render structs and ModelPayload wiring
src/adapters/render.rs
Adds RawZonePayload and CodeMapPayload serialize-only structs, implements CodeMapPayload::from_source_map, adds the optional code_map field to ModelPayload, and updates build_model_payload to assemble a SourceMap and wire code_map into the output.
build_compiled_sql refactor and render tests
src/adapters/render.rs
Refactors build_compiled_sql to take Option<&SourceMap> and derive slices from it, keying fallback SQL under TERMINAL_NODE_NAME. Extends tests with byte-level correctness, no-WITH-clause, unparseable-code, raw_zones projection, and serialization assertions.
CI completeness gate, quality config, and example fixtures
.github/workflows/ci.yml, .cargo/mutants.toml, crap4rs.toml, examples/*
Adds source-map-completeness CI job validating that all DAG node IDs appear in code_map.node_spans across committed HTML payloads. Adds source_map.rs to cargo-mutants scope and a strict crap4rs override. Regenerates five example HTML payloads with updated code_map/node_spans data.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • #445 (linked): This PR directly implements the acceptance criteria for issue #445 — introduces src/domain/source_map.rs with all specified PODs verbatim, adds ModelPayload.code_map: Option<CodeMapPayload>, derives compiled_sql from SourceMap::compiled_slices(), enforces the no-WITH terminal entry invariant, and adds the fitness gate CI job for DAG node completeness.

Possibly related PRs

  • breezy-bays-labs/cute-dbt#452: This PR's SourceMapEntry fields (raw: Option<SourceSpan>, compiled: Option<SourceSpan>) and node_spans() return type directly depend on the SourceSpan vocabulary introduced by #452.
  • breezy-bays-labs/cute-dbt#113: Both PRs extend ModelPayload in src/adapters/render.rs at the report-payload rendering layer — #113 adds sql_diff, this PR adds code_map with source-map-derived compiled spans.
  • breezy-bays-labs/cute-dbt#284: Both PRs add optional serialized fields to ModelPayload in src/adapters/render.rs with skip_serializing_if guards for omission.

Suggested labels

type:feature

🐇 A new map was drawn today,
Each node gets a span, hip-hooray!
compiled_slices() checks byte by byte,
The DAG and the SQL stay tight.
No node left unmapped — what a delight! 🗺️✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: implementing SourceMap on the spine and deriving compiled_sql and CodeMapPayload from it, which aligns with the primary objectives.
Linked Issues check ✅ Passed The PR implements all requirements from issue #445: new SourceMap domain types, NodeFacts spine field, CodeMapPayload render projection, byte-faithful compiled text, no-WITH terminal entry synthesis, fitness gate CI job, strict CRAP scoring, cargo-mutants validation, and golden report regeneration.
Out of Scope Changes check ✅ Passed All changes are in scope: SourceMap domain primitives, render projection updates, configuration for testing/quality gates, CI fitness validation, and golden report updates align with the linked issue #445 and PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch domain-445-source-map-spine

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new per-model source-map primitive (SourceMap) in src/domain/source_map.rs as the single source of truth for raw-to-compiled code mapping, replacing the dual storage of compiled SQL and node spans. The changes include rendering projections (CodeMapPayload), integration into the model payload, and extensive unit tests. Feedback on the changes suggests using safe string slicing (.get(start..end)) instead of direct indexing in compiled_slices to prevent potential runtime panics from out-of-bounds indices or non-UTF-8 boundaries.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/domain/source_map.rs
@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

📄 Rendered report preview

All golden examples regenerated cleanly.

🟡 Golden examples

Committed to examples/ and byte-identity gated — the canonical reports contributors and consumers browse. Stable across PRs.

Report View Download
prdiff-minidag-report.html ▶ Open ↗ ⬇ Download
macro-heavy-report.html ▶ Open ↗ ⬇ Download
jaffle-shop-report.html ▶ Open ↗ ⬇ Download
playground-report.html ▶ Open ↗ ⬇ Download
diff-showcase-report.html ▶ Open ↗ ⬇ Download
seed-showcase-report.html ▶ Open ↗ ⬇ Download

🐶 Live dogfood preview

This PR doesn't touch dbt-project/, so there's no live dogfood preview.

🧭 Explore preview

The two-page cute-dbt explore explorer — dag.html (model lineage) + tests.html (unit-test viewer). Same golden/live split as the report.

🟡 Golden explore

The committed examples/explore/ playground golden (the full synthetic playground manifest). Byte-identity gated in Example report check. Stable across PRs.

Page View Download
explore/dag.html ▶ Open ↗ ⬇ Download
explore/tests.html ▶ Open ↗ ⬇ Download

🐶 Live explore

This PR doesn't touch dbt-project/, so there's no live explore preview.

▶ Open ↗ opens the report or explorer in your browser in one
click — published to this repo's GitHub Pages under
/pr-453/.
⬇ Download fetches the same self-contained HTML as a workflow
artifact (auth-gated; works fully offline). Either way the report
makes zero external resource requests.

The Pages preview may take ~1 min to update after this comment
posts. On PRs from forks the Open link is unavailable (read-only
token) — use Download.

Alternative: GitHub CLI
# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27934007197 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.html

Posted by report-preview.yml for afae646fa85d2248521a0803c4a497ab2685590e. Affordance only — never blocks merge.

…act + honest docstring

Council merge_after_must_fix follow-ups on S2 (SourceMap on the spine):

FIX 1 (must) — wire the mandated fitness gate (AC item 6, the
EdgeType-completeness-guard shape). Adds a `source-map-completeness` CI
job that, over every committed example payload (the inlined
`<script id="cute-dbt-data">` JSON in `examples/*-report.html` and
`examples/explore*/tests.html`), asserts every `dag.nodes[].id` is a key
in that model's `code_map.node_spans` (⊆), or the model has no compiled
code. python3 + checkout only (no new third-party action). The unit-level
`every_dag_node_has_a_code_map_entry` docstring now references the
now-wired job by name instead of asserting a gate that did not exist.

FIX 2 (should) — strip the transient `assertion_line:` insta header from
the committed jaffle-shop chrome snapshot (non-deterministic; should not
be committed). The snapshot test still passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0199AmBCec5kyVEEF1Qd7TSF

@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: 3

🧹 Nitpick comments (1)
src/adapters/render.rs (1)

389-394: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Update the compiled_sql docs for parse-failure payloads.

Line 390 still says parse failures leave compiled_sql empty, but the new unparseable-code test asserts a terminal-keyed slice and verbatim code_map.compiled. This stale comment contradicts the S2 source-map behavior.

📝 Proposed doc update
-    /// Per-node compiled SQL, keyed by node id (CTE name or the stable
-    /// terminal id for the final select). Empty when the CTE engine could
-    /// not parse (the model card still renders the metadata + tests + an
-    /// empty DAG). A DERIVED PROJECTION of [`Self::code_map`]'s source map
+    /// Per-node compiled SQL, keyed by node id (CTE name or the stable
+    /// terminal id for the final select). For compiled models, this is a
+    /// DERIVED PROJECTION of [`Self::code_map`]'s source map; parse failures
+    /// can still surface a terminal-keyed fallback slice while the DAG is empty.
🤖 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/render.rs` around lines 389 - 394, The documentation comment for
the compiled_sql field incorrectly states that it is empty when the CTE engine
fails to parse, but the new unparseable-code test demonstrates that compiled_sql
actually contains a terminal-keyed slice of verbatim code_map.compiled data even
in parse-failure scenarios. Update the doc comment for the compiled_sql field to
accurately reflect this behavior, removing the statement about being empty on
parse failures and clarifying that it contains a terminal-keyed slice of
code_map.compiled consistent with the S2 source-map behavior, as verified by the
existing test.
🤖 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 @.github/workflows/ci.yml:
- Around line 311-336: Add a validation check to fail the job when zero DAG-node
checks are executed. After the existing checks for empty files and violations,
add a condition that checks if node_checks equals zero and prints an error
message using the same pattern as the other error handlers (print with ::error::
prefix and sys.exit(1)). This ensures that if all models lack code_map due to a
regression or glob drift, the job fails rather than silently reporting success
with the misleading node_checks value of zero in the final message.

In `@src/adapters/render.rs`:
- Around line 3914-3915: The `None if !full_compiled_code.is_empty()` match arm
in the `build_compiled_sql` function is unreachable dead code that should be
removed since `SourceMap::from_cte_graph` returns `None` only when `compiled` is
empty, making the guard condition always false in that case. Remove this match
arm from the `build_compiled_sql` function definition, then remove the unused
`model_name` parameter from the function signature. Finally, update the call
site at line 3914 to remove the `&bare_name` argument from the
`build_compiled_sql` invocation since that parameter is no longer needed.

In `@src/domain/source_map.rs`:
- Around line 156-180: The condition checking `entries.is_empty()` is incorrect
because it will also match graphs where nodes exist but all their source_span()
values are None, causing the code to incorrectly synthesize a terminal span
mapping when it should preserve the absence of spans. Replace the
entries.is_empty() check with a check on the graph itself
(graph.nodes().is_empty()) to ensure terminal span synthesis only happens when
the graph truly has no nodes, not when nodes exist but lack span information.

---

Nitpick comments:
In `@src/adapters/render.rs`:
- Around line 389-394: The documentation comment for the compiled_sql field
incorrectly states that it is empty when the CTE engine fails to parse, but the
new unparseable-code test demonstrates that compiled_sql actually contains a
terminal-keyed slice of verbatim code_map.compiled data even in parse-failure
scenarios. Update the doc comment for the compiled_sql field to accurately
reflect this behavior, removing the statement about being empty on parse
failures and clarifying that it contains a terminal-keyed slice of
code_map.compiled consistent with the S2 source-map behavior, as verified by the
existing test.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c905ac3-3a8e-4ca7-b1f2-f2b2f4731bad

📥 Commits

Reviewing files that changed from the base of the PR and between ce105bd and 34161cd.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/render_integration__rendered_chrome_jaffle_shop.snap is excluded by !**/*.snap
📒 Files selected for processing (15)
  • .cargo/mutants.toml
  • .github/workflows/ci.yml
  • crap4rs.toml
  • examples/comments-showcase-report.html
  • examples/diff-showcase-report.html
  • examples/explore-macro/tests.html
  • examples/explore-seed/tests.html
  • examples/explore/tests.html
  • examples/jaffle-shop-report.html
  • examples/playground-report.html
  • examples/prdiff-minidag-report.html
  • examples/seed-showcase-report.html
  • src/adapters/render.rs
  • src/domain/mod.rs
  • src/domain/source_map.rs

Comment thread .github/workflows/ci.yml
Comment thread src/adapters/render.rs Outdated
Comment thread src/domain/source_map.rs
… dead compiled_sql fallback, honest terminal-synthesis on graph emptiness

Three independently-verified CodeRabbit review fixes on the S2 source-map
spine:

- ci.yml source-map-completeness gate now FAILS CLOSED: track
  models_with_code_map and exit(1) if models_with_code_map == 0 or
  node_checks == 0. A regression dropping code_map from every compiled
  model would otherwise report a silent false pass. Committed examples
  execute 509 checks over 10 payloads (106 code_map-bearing models), so
  zero checks is a real regression signal. The glob-drift tripwire stays.

- render.rs build_compiled_sql: remove the dead `None if
  !full_compiled_code.is_empty()` arm. SourceMap::from_cte_graph returns
  None ONLY when the compiled string is empty, so that guard is never
  reachable (the same compiled_code feeds both). Drops the now-unused
  model_name + full_compiled_code params; clippy --all-targets --locked
  stays green.

- source_map.rs from_cte_graph: gate terminal-span synthesis on
  graph.nodes().is_empty() instead of entries.is_empty(). entries is also
  empty when the graph HAS nodes but every source_span() is None, where
  the old code FABRICATED a whole-text terminal span (a false claim);
  preserve honest absence instead. Adds a regression test. Zero golden
  movement (every parsed node in the committed examples retains a span).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0199AmBCec5kyVEEF1Qd7TSF
@cmbays
cmbays merged commit 156db77 into main Jun 22, 2026
45 checks passed
@cmbays

cmbays commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

✅ Merged S2 (#445) — the SourceMap on the spine.

What landed: the per-model SourceMap primitive (src/domain/source_map.rs), with the faithful compiled text as the single source of truth and compiled_sql now a DERIVED projection (dual-storage gone). A CodeMapPayload rides the shared ModelPayload, so the code_map byte-anchor fact surfaces in both the report and explore arms automatically (per design §3.5/D2) — this is the primitive S3's bidirectional DAG↔code sync needs, in place across views with no per-view duplication.

Quality: council review (cao/ceng/cqo clean, cpo concerns) → merge_after_must_fix. The build agent caught + fixed a real latent serde defect in the design's verbatim PODs (a Zone{kind} tag collision → zone_kind rename). The must-fix — a test docstring that claimed an always-on CI gate that didn't exist (the third instance this run of a doc-comment overstating its own coverage) — was closed the right way: the real source-map-completeness fitness gate is now wired (every DAG node has a code anchor, mirroring edge-vocab-completeness). Report + explore goldens regenerated and byte-verified. Gemini's panic-on-bad-span concern was dispositioned as follow-up #454 (sound-by-construction in S2; the deserialize path is S3+).

Follow-ups filed: #454 (fallible get(range) accessor for deserialized maps), #455 (re-home SourceMap onto NodeFacts when the ContextData/IR spine lands).

Merged autonomously under the overnight build mandate. Next: S3+CLL-1 (#446) — bidirectional sync + column context — and CLL-2 (#447), both building on this.

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.

Add the SourceMap on the spine; derive compiled_sql + CodeMapPayload from it

1 participant