Skip to content

docs(atlas): per-source delta detection + non-doubling join semantics (#6028) - #8336

Merged
dezren39 merged 3 commits into
mainfrom
queue/14409-6028-delta-join
Nov 14, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/14409-6028-delta-join

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Design record for the #6028 remainder (task 14409), companion to the landed #6036 offset-matching record:

Inputs from #6035 (span-table schema), #6037 (chunk-boundary policy v2), and #6040 (CDC feasibility) are stated as parameters, not re-decided.

Refs #6028 — no closing keyword: #6035/#6037/#6040 remain open and the implementation follow-ons are still to be filed, so #6028 stays open.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Documentation
    • Added a design record outlining how changes are detected across Git sources, plain trees, and row stores.
    • Documented span anchoring, overlap handling, and paragraph assembly rules to avoid duplicate text.
    • The record also covers unchanged-object handling, results for retired versions, and limits on detection and span processing.

@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 23:05
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request adds a design record for source-specific change detection, byte-anchored spans, and paragraph assembly. It specifies detection ledgers, occurrence handling, reconstruction rules, and result behavior. It does not include implementation changes.

Changes: Atlas detection and join design

Layer / File(s) Summary
Source detection and ledger
doc/2026-11-10T22-56-00Z_design_atlas_delta_detection_join/..., doc/README.md
The design record specifies detection for Git sources, plain trees, and row stores. It defines per-object verdicts and ledger updates, including no writes for unchanged objects.
Span anchors and occurrences
doc/2026-11-10T22-56-00Z_design_atlas_delta_detection_join/...
The record defines byte-offset anchors, re-anchoring, overlap handling, and rules for recording occurrences and embedding literal content.
Paragraph assembly and result handling
doc/2026-11-10T22-56-00Z_design_atlas_delta_detection_join/...
The record specifies reconstruction from the requested version’s text, the J1 byte-equality invariant, cold and retired-version results, and a worked example.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Moderate · up to 66faf

This PR adds only a design record, so nothing in production changes now. Several specified rules would cause missed updates, lost retained versions, duplicated paragraph bytes, or an unverifiable delta-only guarantee if implemented as written. Fix these in the doc before it becomes the implementation contract.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T12:22:13.455069Z
We couldn’t complete this review. Comment @codex review to try again.
2f9c8e6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22b93dfe9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +116 to +120
- Each ingested table declares a **watermark column** — a monotonically
increasing key the store itself maintains (rowid, `updated_at` with a
tiebreaker key, or an append-only sequence). Detection reads
`max(watermark)` and the row count cheaply (an index probe, not a
scan); rows at or below the landed watermark are presumed unchanged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require an update-sensitive watermark for mutable tables

For a mutable table using the explicitly allowed rowid watermark, updating an existing row does not advance its rowid, so the row remains below the landed watermark and is never selected for hash comparison. The tombstone sweep cannot catch this either because the key still exists. Consequently, edits to existing session records can remain invisible indefinitely. Restrict rowid/append-only watermarks to immutable append-only tables; mutable tables need a watermark that advances on every update or the full row-hash fallback.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 66fafaa: the watermark must now be update-sensitive — bare rowid/append-only sequence watermarks are restricted to tables immutable and append-only by construction; mutable tables must declare an update-sensitive watermark (updated_at + tiebreaker, or a store-maintained version that bumps on update) or fall back to hash-every-row. The invisible-edit hole is closed in §2.3.

Comment on lines +178 to +182
≥ 0.9 covered by spans already landed for the same logical file is
not embedded as a near-duplicate: it is recorded as an *occurrence*
of the covering spans (the #5733 ≥ 0.9 dedup edge, #3125 occurrence
semantics) and the version's span list references those spans with
this version's offsets. Below 0.9, the non-covered residue is a

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the uncovered residue above the dedup threshold

When a new span is 90–99% covered by existing spans, this branch records only occurrences of the covering spans, while literal handling is specified only below 0.9. For example, a 1,000-byte span with 950 reused bytes and 50 genuinely new bytes receives no embedding for those 50 bytes, making the new material unsearchable even though version-text reconstruction can still display it. Suppress the near-duplicate whole-span embedding, but retain literal processing and embedding of the uncovered residue on both sides of the threshold.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 66fafaa: the 0.9 ceiling now suppresses only the near-duplicate whole-span embedding — the non-covered residue is cut and embedded as a literal span at any coverage level, so genuinely new bytes in a 90-99% covered span are searchable content, not just reconstructable text.

Comment on lines +215 to +216
- emit `S`'s bytes from `max(S.start, c)` to `S.end`; set
`c = S.end`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clip intersecting spans to the paragraph before emission

When a span crosses a paragraph boundary, step 1 includes it, but this emission rule writes through S.end even when that exceeds P.end. For example, assembling paragraph [0,100) with an intersecting span [50,150) emits bytes through 150, including the next paragraph and violating J1. Intersect each span with the paragraph extent before emission and cursor advancement so the result cannot extend beyond P.end.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 66fafaa: §4.1 assembly now clips intersecting spans to the paragraph extent before emission (emit to min(S.end, P.end); cursor advances to min(S.end, P.end)), so assembly cannot write past P.end — J1 holds by construction.

Comment on lines +124 to +125
rows with an existing key are *edits* (the row's new version lands;
the old row version is retired, not mutated), rows with new keys are

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve superseded versions until retention permits retirement

When an existing row is edited before its previous version qualifies for retention, this instruction retires that version immediately. The explicitly adopted content-versioning/retention record (§4.1) permits retirement only when both a retention trigger and the class policy allow it; supersession alone is not a trigger. Since §4.3 here reduces retired-version hits to snippet tombstones, an ordinary edit would prematurely remove historical full-paragraph rendering. Record the successor relationship and leave retirement to the retention policy; the source-deletion rule in §2.1 should likewise create a lineage tombstone rather than automatically retire retained versions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 66fafaa: the old row version is now superseded, not retired — §2.3 states supersession alone is not a retirement trigger and the superseded version is preserved until the retention record permits retirement (trigger fired AND class policy allows).

)

rowid watermarks restricted to immutable append-only tables (mutable tables require an update-sensitive watermark); superseded row versions preserved until the retention record permits retirement (supersession is not a trigger); uncovered residue above the 0.9 dedup ceiling is still cut and embedded as a literal span; join assembly clips intersecting spans to the paragraph extent before emission (J1).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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