Skip to content

feat: add lazy thread sync#31

Merged
galligan merged 2 commits into
mainfrom
feat/lazy-thread-sync
Jun 5, 2026
Merged

feat: add lazy thread sync#31
galligan merged 2 commits into
mainfrom
feat/lazy-thread-sync

Conversation

@galligan

@galligan galligan commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bump package version to 0.3.0 for the lazy sync feature release
  • make dispatch lane attach <thread-id> metadata-only via thread/read(includeTurns:false) and add --sync for optional quick indexing
  • add explicit dispatch lane sync <lane> / --full, registry schema v2 sync tables, and sync state on lane get/list outputs
  • persist attach registration, initial sync state, and attach audit in one registry transaction with rollback coverage
  • keep JSONL sync lazy under real long-thread conditions: fixed byte-window top reads and scanner work offloaded from the async event loop
  • make just check clean stale local wheel/sdist artifacts before building so package inspection is deterministic
  • keep attached lanes observe-only on daemon restart by resuming owned lanes only and metadata-reading attached lanes
  • document the behavior in usage docs, design docs, skills, and ADR-0017

Verification

  • uv run dispatch --version -> dispatch 0.3.0
  • uv run dispatch doctor --no-app-server --json | jq -r '.version' -> 0.3.0
  • uv run pytest tests/core/test_sync.py tests/registry/test_store.py tests/core/test_handlers.py tests/daemon/test_supervisor.py tests/client/test_models.py tests/surfaces/test_parity.py tests/surfaces/test_mcp_routing.py tests/test_doctor.py -q -> 76 passed
  • uv run pytest tests/registry/test_store.py tests/core/test_handlers.py -q -> 49 passed
  • uv run pytest tests/core/test_sync.py tests/core/test_handlers.py tests/registry/test_store.py -q -> 52 passed
  • uv run dispatch schema "lane sync" | jq -r '.op, (.input.properties | keys | join(",")), .output.title' -> sync, full,lane, LaneSyncResult
  • DISPATCH_HOME=/tmp/dispatch-lazy-sync.qfYNZH safe smoke: dispatch up, lane list --unmanaged, lane attach <id> --sync, lane get, lane list, lane sync, doctor --no-app-server, dispatch down
  • post-review temp-home smoke: attach/sync succeeded against a real persisted Codex thread with a 2.6 MB JSONL source; sync state partial, no sync error
  • seeded stale dist/stale-review-loop.{whl,tar.gz} then ran just check; it removed stale artifacts and left only outfitter_dispatch-0.3.0 wheel/sdist
  • just check -> ruff, format check, mypy, pytest 167 passed / 8 deselected, build outfitter_dispatch-0.3.0, package contents check

Review loop

Fixed during final local review:

  • P2: scanner disk I/O ran inside async handlers -> moved scan work through asyncio.to_thread
  • P2: top-window parser could read one huge first JSONL line despite byte cap -> switched to fixed byte-window reads and ignored incomplete trailing records
  • P3: stale local dist artifacts could break version-bump checks -> just check now cleans wheel/sdist artifacts before build

No unresolved P0/P1/P2 from local review.

Notes

  • quick sync intentionally reports unknown whole-file line count; exact counts are reserved for lane sync --full
  • no attached-lane write authority, live sends, stops, renames, archives, broad unattached indexing, transcript bulk copy, merge, publish, or release action in this slice

galligan commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@galligan galligan changed the title docs: plan lazy thread sync feat: add lazy thread sync Jun 5, 2026
@galligan galligan force-pushed the feat/lazy-thread-sync branch 4 times, most recently from 739217c to 1a89b79 Compare June 5, 2026 16:57
@galligan galligan force-pushed the feat/lazy-thread-sync branch from 1a89b79 to a9514a5 Compare June 5, 2026 17:06
@galligan galligan marked this pull request as ready for review June 5, 2026 17:27

galligan commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jun 5, 5:27 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 5, 5:27 PM UTC: @galligan merged this pull request with Graphite.

@galligan galligan merged commit 9e267bf into main Jun 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant