Skip to content

feat(id): Notion importer slice 4a — comment claims + coverage accounting - #14150

Merged
dezren39 merged 3 commits into
mainfrom
xaltha/13524-notion-slice4-comments
Nov 24, 2026
Merged

dezren39 merged 3 commits into
mainfrom
xaltha/13524-notion-slice4-comments

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

First sub-slice of #13524 (Notion importer slice 4, design #6436 §2.4): comment claims plus comments-coverage accounting — the §8 check-7 half of slice 4.

  • comments::convert_comments (pkgs/id/crates/id-import-notion/src/comments.rs) records every comment the acquisition path can see as a claim on the expected note: author as Notion user provenance (ID + display name), timestamp, body blob; block-anchored comments name the block identity; replies chain by manifest-recorded parent comment ID; resolved discussions carry the resolution as a recorded provenance fact.
  • Pages the acquisition path cannot see record CommentsCoverage::Unavailable and make no comments-endpoint call; covered pages with zero comments are distinct from unavailable ones. Fails closed on missing note ID, missing availability, a foreign page parent, an unknown anchor block, a non-comment object, and a repeated comment ID.
  • NotionApi gains comments() with a default empty-list implementation, so existing transports keep compiling (including slice 3's branch). The manifest gains comment_claims / comments_coverage, both #[serde(default)] for older manifests.
  • New integration test recorded_comments.rs (registered in the suite registry) asserts §8 check 7 on recorded fixtures: a discussion with replies across paginated responses, a resolved discussion, a block-anchored comment, an unavailable page, and a covered-but-empty page; re-running reproduces identical claims and coverage.

Refs #13524 (does not close it: degradation completion and the export reader remain as follow-up slices).

Decide-and-proceed (recorded, not owner-gated)

  • Reply chaining: the Notion list-comments response carries no parent-comment ID; replies share a discussion_id with their root. This slice derives the chain — within one discussion the earliest-created comment is the root, every later comment chains to it — and records it explicitly in the manifest, so a later reader never re-derives it. Documented in comments.rs.
  • Resolution: the public list-comments response carries no resolution field. resolved is parsed when a transport supplies it and defaults to false; a transport that cannot see resolution records no resolved facts rather than inventing them.

Evidence

Not built here; verified by remote dispatch on the pushed commit 4823c50ff (GitHub-hosted runner, fleet-build image):

runuser -u vscode -- env HOME=/home/vscode bash -lc 'git config --global --add safe.directory "$PWD" && cd pkgs/id && CARGO_TARGET_DIR=/tmp/id-target nix --extra-experimental-features "nix-command flakes" develop --command cargo test -p id-import-notion'

Run: https://github.com/developing-today/fleet/actions/runs/45338647720 — success.

  • lib unit tests: 17 passed; 0 failed (incl. new comments::tests::replies_chain_to_the_earliest_comment_in_the_discussion and the fail-closed cases)
  • integration: recorded_comments 2 passed, recorded_content 2 passed, recorded_inventory 1 passed
  • bash .github/scripts/check-suite-registry.sh prints no FAIL lines for recorded_comments.rs (verified locally — read-only check). Note: the pre-existing FAIL for recorded_content.rs is still present on this branch; it is fixed by feat(id): Notion importer slice 3 — database note identity and per-source schema claims #14026 (slice 3), which registers that file — left to that PR to avoid a registry-entry conflict.

Before: no comments module, no comment_claims / comments_coverage — the new test references symbols absent on origin/main, so it fails there for the reason this slice fixes, not for a missing fixture.

First verification attempt (run 45336250129) failed to compile the lib test target on a missing Inventory import in the unit-test module (E0433); fixed in 4823c50ff; the re-run above is green.

fleet queue dispatch itself is still blocked from this seat by TLS defect #13185, so verification went through the fleet-command.yml fallback.

Merge Danger

Low. Additive: one new module, two #[serde(default)] manifest fields (old manifests load unchanged), one default trait method (no existing implementor changes), one registry entry extended. No changes to slice 1/2 behavior; convert_page is untouched. Comment attachments (blobs named by the claim, §4) are a follow-up, not this slice.

Next slice (same "after this PR" form)

After this PR, cargo test -p id-import-notion shows the §2.5 degraded classes converting structurally — toggle/callout/column/table/equation structure preserved with presentation attributes dropped-and-counted, embeds degraded to URL + link reference, synced blocks as typed references — with the fidelity report's per-class counts equal to the corpus's known counts (§8 check 4).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T06:32:17Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-13524-xaltha",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-13524-xaltha",
      "repo": "developing-today/code",
      "branch": "xaltha/13524-notion-slice4-comments",
      "sha": "4823c50ff7744b101f000297b01eb51123888eb8"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

…ting

Refs #13524 (does not close it: degradation completion and the
export reader remain as follow-up slices).

- comments::convert_comments records every comment the acquisition
  path can see as a claim on the expected note (author provenance,
  timestamp, body blob), block-anchored where the parent names a
  block, with replies chained to the discussion root by
  manifest-recorded parent comment id and resolved discussions
  carrying the resolution fact (design #6436 §2.4, §8 check 7).
- Pages the acquisition path cannot see record
  CommentsCoverage::Unavailable and make no comments-endpoint call;
  covered pages with zero comments are distinct from unavailable
  ones. Fails closed on missing note id, missing availability, a
  foreign page parent, an unknown anchor block, a non-comment
  object, and a repeated comment id.
- NotionApi gains comments() with a default empty-list
  implementation, so existing transports keep compiling; the
  manifest gains comment_claims / comments_coverage (serde-defaulted
  for older manifests).
- New integration test recorded_comments.rs, registered in the
  suite registry.
The remote verification run 45336250129 failed to compile the lib
test target: E0433 cannot find type Inventory in comments.rs
tests. Import it in the test module.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf9547b7-48d3-43f5-9f87-f4d7a3cc06af
Commits

Reviewing files that changed from the base of the PR and between 813da2b and 00ce812.

Files selected for processing: 4

  • .github/test-suite-registry.json
  • pkgs/id/crates/id-import-notion/src/comments.rs
  • pkgs/id/crates/id-import-notion/src/lib.rs
  • pkgs/id/crates/id-import-notion/tests/recorded_comments.rs
  • 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

Keep both sides of the test-suite-registry paths and the lib.rs module list.
Verified: cargo test -p id-import-notion via fleet shell (all suites green).
@dezren39
dezren39 merged commit 0a622e2 into main Nov 24, 2026
1 check passed
@dezren39
dezren39 deleted the xaltha/13524-notion-slice4-comments branch November 24, 2026 08:30
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