Skip to content

feat(acquire): collect Slack history from before a channel's first interval - #346

Open
vincentkoc wants to merge 2 commits into
mainfrom
feat/slack-backfill-window
Open

vincentkoc wants to merge 2 commits into
mainfrom
feat/slack-backfill-window

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

slacrawl acquire stops with "since differs from completed source horizon" when asked for history older than a channel's first collected interval. The OpenClaw report source started at October 1, so report days from March 30 to September 30 cannot get their Slack messages.

User Impact

Operators can backfill a PostgreSQL Slack source to an earlier start with an explicit --since and an --until at the start of the channel's earliest completed interval. Ordinary collection is unchanged.

Why This Change Was Made

The collector now admits an explicit window that ends at or before the completed horizon and sends it to the receiver. The receiver decides whether it ends exactly where completed coverage starts (merged receiver PR). Window selection is a small function, so it is tested on its own. An older receiver refuses such a run with a conflict, so no data is written.

Evidence

  • Tested client 39a73d55 with receiver f27a0470 from crawl-remote #173. Both PostgreSQL HTTP integration tests passed with a disposable local database. They cover earlier adjacent windows, unchanged forward collection, rejected gaps and overlaps, and the collector-to-receiver path.
  • GOWORK=off go test -race -count=1 ./internal/acquisition passed, including the default continuation, explicit backfill, overlap and reversed-window cases.
  • GOWORK=off make tidy-check vulncheck passed on the updated branch. Current main supplies the patched dependency from the previously failing check.

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codex review: blocked before merge.

What this changes

Allows explicitly bounded Slack acquisition windows before a channel’s completed horizon, subject to receiver admission.

Example: Channel C1 has completed coverage from October 1 through November 20, 2026.

  • Before: Acquiring March 30 through October 1 fails locally because the start differs from November 20.
  • After: The collector submits that earlier window to a receiver supporting backfill admission.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and has no definite introduced bug, but helper-only validation does not demonstrate the new receiver-dependent behavior.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot collect older Slack messages into an already-started PostgreSQL source.
Reason: The feature has a concrete historical-data use case, reuses existing flags, and has owner direction through the maintainer-authored PR.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this maintainer-authored PR open: it adds useful backfill capability absent from main, and source review found no definite introduced correctness defect.

Reviewed head: b45099f39153bbcb685a546f09114decfca34fa1

Before merge

  • Resolve merge risk - Maintainers must establish the cause and disposition of the failing deps check before landing; the available annotations do not establish whether it is independent of this PR.

Findings

None.

Tests

  • Low-value test internal/acquisition/collect_test.go: The added group tests only the extracted runWindow helper; replace it with coverage through the existing acquisition HTTP boundary so accepted bounds and receiver interaction are exercised together.
  • Missing end-to-end proof: Provide a redacted acquire trace against a backfill-capable receiver showing an earlier contiguous window completing, existing coverage preserved, and subsequent forward continuation; no base-fail/head-pass integration result was supplied.
Agent review details

How this fits together

The acquire CLI passes explicit bounds and server checkpoints to the collector, which obtains receiver admission before fetching Slack history and committing normalized pages to PostgreSQL.

flowchart LR
  CLI[Acquire CLI] --> Collector[Collector]
  Collector --> Admission[Receiver admission]
  Admission --> History[Slack history]
  History --> Pages[Normalized pages]
  Pages --> Storage[PostgreSQL receiver]
Loading

Technical review

Best possible solution:

Retain the focused collector exception and receiver-owned admission, with demonstrated contiguous backfill and unchanged forward continuation.

Do we have a high-confidence way to reproduce the issue?

Main deterministically rejects an earlier explicit start whenever completedThrough is present and different; no target code was executed.

Is this the best way to solve the issue?

The collector is the correct owner for relaxing its local restriction, while the receiver remains the existing owner of coverage admission; no new configuration or parallel collection path is needed.

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning medium; reviewed against a8ed4bd20a97.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the focused collector exception and receiver-owned admission, with demonstrated contiguous backfill and unchanged forward continuation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

  • Acquisition window admission changes intended behavior with a stated reason (e4d1cf3: The original PostgreSQL acquisition implementation and SPEC define subsequent runs as continuation from the completed horizon; no associated PR was returned by the commit-to-pulls lookup.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main behavior: The introduced diff relaxes only new-run window admission; main rejects every explicit start differing from completedThrough. Active-run matching, receiver admission, history transport, reconciliation, and commits remain unchanged. (internal/acquisition/collect.go:178, b45099f39153)
  • Admission precedes history collection: Collect calls Begin and verifies the retained run before requesting conversations.history; publisher and Slack credential selection are unchanged. (internal/acquisition/collect.go:65, b45099f39153)
  • Feature ownership and provenance: Feature-scoped history and GitHub commit metadata identify vincentkoc’s prior acquisition implementation and subsequent scheduling work. The original contract required forward continuation from the completed horizon; this PR explicitly explains its bounded-backfill exception. (internal/acquisition/collect.go:52, e4d1cf38f557)
  • Supplied proof and discussion: The full PR body supplies a package-test claim and cites receiver tests; both discussion comments are review-status messages, with no terminal trace or artifact demonstrating backfill through acquire. (internal/acquisition/collect_test.go:36, b45099f39153)
  • Explicit receiver dependency and access limit: The PR explicitly depends on https://github.com/openclaw/crawl-remote/pull/173 for contiguous backfill admission and cites its HTTP test as evidence, establishing a contract dependency. The supplied GitHub access returned HTTP 404, so that implementation, discussion, tests, and repository policy could not be inspected.
  • Dependency check needs attribution: The failing deps check reports websocket call chains in share, provider, MCP, and Socket Mode code. Main’s older deps check passed, so the available evidence does not establish a matching base failure; detailed job logs were blocked by the artifact-host allowlist. (.github/workflows/ci.yml:29, b45099f39153)

Likely related people:

  • Vincent Koc: Raw commit e4d1cf3 adds internal/acquisition/collect.go:48 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e4d1cf38f557; files: internal/acquisition/collect.go)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the backfill and forward-continuation trace described in the proof assessment.
  • Replace helper-only coverage with acquisition HTTP-boundary coverage.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 25, 2026, 2:02 AM ET / 07:02 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. other P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant