feat(sync): support bounded updated windows#7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for bounded Intercom “updated” windows so historical backfills can sync a from..to range without repeatedly re-crawling the most recent tail, while keeping the tail high-water mark monotonic.
Changes:
- Adds
fincrawl sync --updated-before(requires--updated-since) and validates window bounds in the CLI. - Prevents the Intercom tail
HighWaterMarkfrom moving backwards after a bounded historical run. - Updates agent describe output and documentation with bounded backfill examples; adds regression tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents bounded backfill example using --updated-since + --updated-before. |
| internal/syncer/intercom.go | Advances tail high-water mark monotonically via advanceHighWaterMark. |
| internal/syncer/intercom_test.go | Adds test ensuring older bounded windows don’t regress HighWaterMark. |
| internal/cli/cli.go | Adds --updated-before, parsing/validation, and passes bounded window to syncer. |
| internal/cli/cli_test.go | Adds CLI usage + dry-run tests for bounded window validation/output. |
| internal/cli/agent_dx.go | Exposes new flag in describe schema and examples. |
| docs/roadmap.md | Updates roadmap wording to reflect bounded window support. |
| docs/architecture.md | Adds bounded backfill example to architecture doc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/syncer/intercom.go">
<violation number="1" location="internal/syncer/intercom.go:265">
P2: When `candidate` fails to parse but `current` is valid, this returns the malformed `candidate`, overwriting a good high water mark. The error-handling branch should preserve `current` when `candidateErr != nil` and `current` is parseable.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Fix all with cubic | Re-trigger cubic
7a357aa to
1038ed3
Compare
1038ed3 to
b0ab474
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a bounded Intercom updated window so historical backfills can crawl
from..toranges instead of repeatedly including the recent tail.Changed
fincrawl sync --updated-beforealongside--updated-sinceRisks
Verification
go test ./internal/cli ./internal/syncer ./internal/intercom./scripts/verify$HOME/.agents/skills/codex-review/scripts/codex-review --mode localclean after fixing the accepted watermark findingComplexity
Reduced for large backfills: callers can crawl older ranges without noisy overlap against already-crawled recent data.
Summary by cubic
Adds a bounded sync window to Intercom syncs so you can backfill a specific updated range without crawling the live tail. High-water marks now advance safely and never move backward.
New Features
--updated-beforeto pair with--updated-sincefor a[from..to]window.--updated-beforerequires--updated-sinceand must be after it.updated_after/updated_beforeand rawupdated_since/updated_before_input.agent describewith examples, e.g.fincrawl sync --updated-since 180d --updated-before 90d --limit 0.Bug Fixes
Written for commit b0ab474. Summary will update on new commits. Review in cubic