[Feat] Add Linear issues to Brain recall - #1759
Conversation
|
No new code issues found. See task
Reviewed 8366133 |
| const { pages, itemUpdates } = pagesAndItems({ | ||
| source, | ||
| issues: result.issues, | ||
| seenAt: sweepStartedAt, |
There was a problem hiding this comment.
persistCollectorItemUpdates ultimately calls upsertBrainCollectorItems, which uses onConflictDoNothing for an existing (collectorId, itemId). That means this census never refreshes lastSeenAt for issues already inventoried. On the next daily census, every still-visible issue has a timestamp older than sweepStartedAt, so the retire phase treats all of them as stale and deletes their Brain pages. The inventory write needs to update lastSeenAt (or use a collector-specific refresh path) for items observed during the sweep.
There was a problem hiding this comment.
This finding conflates two different persistence helpers. The census returns itemUpdates, the BullMQ engine passes them to upsertBrainCollectorItems, and that helper uses onConflictDoUpdate to set last_seen_at = excluded.last_seen_at. Only seedBrainCollectorItems, which this path does not call, uses onConflictDoNothing. The focused database regression finds only items missing from a completed sweep passes and proves a re-observed inventory row is not returned by listBrainCollectorItemsBefore. No code change is needed.
|
Resolved the failed review as a false positive. The census already refreshes existing inventory through |
…in-collector-3f9rht2ejf4wn
What changed
Why this change was made
Linear holds durable product context that was unavailable to Brain recall. The collector follows the decomposed per-source architecture without adding another credential or client path, and separates update-time freshness from stable full-workspace visibility checks.
Impact
Deployments with both Brain and Linear connected can recall visible Linear issues automatically. API work is bounded per collector pass, checkpoints advance only after page writes, and deleted or newly invisible issues converge safely without treating partial API responses as deletions.
Verification evidence: focused collector, Linear client, source availability, registry, settings-summary, and engine tests passed; public docs validation and broken-link checks passed; full repository lint, all-package typechecking, and pre-push oxlint, residual lint, fast typechecking, and knip checks passed.