th-19cca5: th pearls sync — two-way sync with Smoo Projects work items - #529
Open
brentrager wants to merge 3 commits into
Open
brentrager wants to merge 3 commits into
brentrager wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: d149ec2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
force-pushed
the
th-19cca5-pearls-sync
branch
from
September 8, 2026 16:27
3e8081c to
438eb30
Compare
brentrager
enabled auto-merge (squash)
September 8, 2026 16:27
Pearls moved to a local SQLite file (th-d3e842) and lost Dolt push/pull. The platform's work-items API is the shared home now, so this adds one explicit reconcile verb instead of a second replication system: - `th pearls sync --project <KEY>` binds a checkout (stored in the store's config table), then `th pearls sync [--pull-only|--push-only] [--dry-run] [--json]` pulls, pushes, and reconciles deps (blocks links) + comments. - New `sync_map` table (pearl_id ↔ remote_id + per-side updated_at baselines). Pushed items carry `externalRef = th-xxxxxx@<checkout-dir>` so other machines adopt instead of duplicate. - Field map: status closed↔done / deferred↔blocked (remote in_review / cancelled never demoted), priority inverted (P0 ↔ 4), epic survives as a label, comments carry a `pearl-comment:<id>` marker to stop echoes. - "Changed" = differs from the last-sync baseline (laptop/server clock skew must not hide an edit); timestamps only break ties; conflicts are listed, never silent. Nothing is ever deleted on either side. - push/pull notices now point at `th pearls sync`; smooth-diver's Jira client stays (docs mark it legacy — `smoo work jira import` + sync). Tests: mapping round-trips, an in-process axum mock of the work-items API covering pull-create, push-create, updates both ways, conflict, adoption by external ref, dry-run, push-only, and delete-safety. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M9HmiTg9pYARWUdaXYasqq
brentrager
force-pushed
the
th-19cca5-pearls-sync
branch
from
September 9, 2026 13:48
438eb30 to
ea7ccb3
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.
Problem
Pearls moved to a machine-local SQLite file (#522, th-d3e842) and lost Dolt's push/pull. The Smoo Projects work-items API (
smoo work, 09766e3) is the shared home now; smooth-diver's direct Jira client is the wrong seam oncesmoo work jira importexists.Solution
th pearls sync [--project <KEY|uuid>] [--pull-only|--push-only] [--dry-run] [--json] [--org]— one explicit, offline-first reconcile verb (crates/smooth-cli/src/pearls_sync.rs).sync_maptable inpearls.db(pearl_id ↔ remote_id + per-sideupdated_atbaselines). Pushed items carryexternalRef = th-xxxxxx@<checkout-dir>; a fresh machine adopts by ref (and keeps the pearl id when free) instead of duplicating. Project binding lives in the store's per-projectconfig(sync.project_id/sync.project_key);sync.last_pull_atis theupdatedSincecursor.closed↔done,deferred↔blocked(in_review/cancelledfold in on pull and are never demoted on push); priority inverted (pearl P0 ↔ work item 4);epicsurvives as a label; deps →blockslinks on the blocker; comments both ways with apearl-comment:<id>first line to stop echoes.conflict:— never silent. Create-on-first-sight both ways. Nothing is ever deleted on either side; orphans are reported underskipped:.th pearls push/pullnotices now point atth pearls sync. smooth-diver is left in place; docs markth jira synclegacy.Depends on the smooai side (SmooAI/smooai PR for SMOODEV-3128:
labels,external_ref,externalRef/label/updatedSincelist filters). Against today's prod API a sync still works but can't adopt by ref (noexternalRefyet) and pulls full pages instead of incrementally.Verification
cargo fmt --check,cargo clippy(no new hits in touched files),cargo test -p smooai-smooth-cli -p smooai-smooth-pearls→ 796 + 203 pass,pnpm format:check.th pearls sync --project SMOODEV --dry-run --jsonfrom the smooth checkout → would create 3027 local pearls (the Jira-imported SMOODEV items) and push 1541 pearls; 0 conflicts; ~10s. A real first run should target a dedicated Smoo project per repo (e.g. keySMOOTH), not SMOODEV.Landing
Rebased onto main after #522 landed; auto-merge armed. Checkpoints (th-9483e8,
smooth-checkpoint:comments) ride along through comment sync. Pearl th-19cca5.🤖 Generated with Claude Code
https://claude.ai/code/session_01M9HmiTg9pYARWUdaXYasqq