Skip to content

feat(store): expose eligible pending mutation high-water - #1539

Merged
dnlrsls merged 1 commit into
Gentleman-Programming:feat/prompt-inbox-foundation-trackerfrom
dnlrsls:feat/pending-mutation-high-water
Sep 29, 2026
Merged

dnlrsls merged 1 commit into
Gentleman-Programming:feat/prompt-inbox-foundation-trackerfrom
dnlrsls:feat/pending-mutation-high-water

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Sep 29, 2026

Copy link
Copy Markdown
Member

🔗 Linked Issue

Closes #1458

Child of tracker #1464. Target feat/prompt-inbox-foundation-tracker, not main; no remote delete behavior is enabled by this helper alone.

🏷️ PR Type

  • type:bug — Bug fix
  • type:feature — New feature
  • type:question — Question requiring tracked work
  • type:docs — Documentation only
  • type:refactor — Code refactoring
  • type:chore — Maintenance
  • type:breaking-change — Breaking change

📝 Summary

  • Add a read-only, target-scoped maximum eligible pending mutation sequence for a future bounded autosync pass.
  • Test that stale sync_state.last_enqueued_seq does not hide pending eligible rows; exclude other targets, unenrolled, acknowledged and quarantined rows.

📂 Changes

File Change
internal/store/store.go Query max seq using the same target/enrollment/pending predicates as the existing pager; return zero for no eligible row.
internal/store/store_test.go Direct-SQL eligibility and stale-state regression.

71 additions, no transient artifacts. Documentation N/A: the new store read is not wired to autosync until a separate client preflight PR.

🧪 Test Plan

  • Focused regression: go test ./internal/store -run '^TestMaxPendingSyncMutationSeq$' -count=1 — RED compile before implementation, GREEN afterward; independent PASS.
  • Affected package: go test ./internal/store -count=1 — independent PASS.
  • Other: go vet ./internal/store, git diff --check, CRLF-normalized gofmt comparison — independent PASS. Native review review-7c24726375ab72ae approved/acknowledged.
  • GitHub full unit/E2E/plugin/lint/Windows and policy checks — pending until run.

🤖 Automated Checks

All pending after opening; do not infer CI from local tests. Required checks must pass before normal merge.

✅ Contributor Checklist

💬 Notes for Reviewers

Compare this query with ListPendingSyncMutationsAfterSeq: the predicates must agree. It is a prerequisite for a bounded autosync traversal that can skip an unverified full first page without starving later healthy rows. T4b3a2b will integrate it; T4b3b explicitly reauthorizes old/imported sources via per-source CLI; T4c still gates deletes remotely. Tracker #1464 stays outside main queue.

@dnlrsls dnlrsls added the type:feature New feature label Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 79f6596f-0f45-4bce-b794-c194b3da8360

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@dnlrsls
dnlrsls merged commit e7f5c14 into Gentleman-Programming:feat/prompt-inbox-foundation-tracker Sep 29, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant