2code icon indicating copy to clipboard operation
2code copied to clipboard

Herdr contract docs still say Task 4 must detach the server

Open AkaraChen opened this issue 2 months ago • 1 comments

Summary

Parent: #394. Found while reviewing server discovery (#406) on task-4-server-discovery; extended while reviewing runtime snapshot sync (#411) on task-6-runtime-sync.

docs/herdr-integration.md is stale in two later-task rows that later tasks already implemented:

  1. It still says Task 4 must spawn a detached process so GUI exit does not take the server, and that Task 4 must detach the process. Task 4 on task-4-server-discovery now detaches foreground herdr server into the dedicated 2code session and GUI exit drops client helpers without herdr server stop.
  2. The Later-task capabilities row still says the full bootstrap race (subscribe → snapshot → drain) is documented by Herdr, not separately race-tested. Task 6 on task-6-runtime-sync now implements that bootstrap and tests events arriving during snapshot, reconnect replace, and stale-event drop in src-tauri/crates/service/src/runtime_sync.rs.

This does not block Task 7. The contract file is stale relative to accepted #406 and #411. Do not treat remaining Task 4 process-lifetime work or Task 6 bootstrap race coverage as open.

Current text

  • Isolated reproduction: "Task 4 must spawn a detached process so GUI exit does not take the server with it."
  • Gaps: "herdr server is foreground (detached_server_daemon: false) — verified. Task 4 must detach the process."
  • Later-task capabilities / Subscriptions: "events.subscribe ack + live tab.created verified. Full bootstrap race (subscribe → snapshot → drain) is documented by Herdr, not separately race-tested."

Needed

  • Record that 2code now detaches the foreground herdr server into session 2code and that GUI exit leaves that server running
  • Keep detached_server_daemon: false as the Herdr binary capability (the server itself is still not a daemon)
  • Record that Task 6 race-tested subscribe → snapshot → drain (mock: events during snapshot, reconnect drops stale events). Keep Task 1’s live Herdr probe claim unchanged unless a live race is added there.
  • Do not treat remaining Task 4 process-lifetime work or Task 6 bootstrap coverage as open

Do not treat the #395 contract as still waiting on Task 4 for server lifetime, or on Task 6 for a subscribe-snapshot drain test.

AkaraChen avatar Sep 15 '26 05:09 AkaraChen

Still stale on task-10-launch-adopt for the Later-task Subscriptions row; corrected on task-1-verify-gaps (e256f67). Task 4 detach was already recorded as shipped on this tip. v0.9.0 pin unchanged.

  • Subscriptions row docs/herdr-integration.md:457 now quotes runtime_sync.rs tests bootstrap_applies_events_that_arrive_during_snapshot and disconnect_rebuilds_and_drops_stale_events. Explicitly not a live Herdr race probe.
  • Task 4 detach already accurate: docs/herdr-integration.md:264 and :474 ("already detaches the sidecar" / "Detach is already implemented"). No "Task 4 must detach" remaining.
  • Pin unchanged: src-tauri/crates/infra/src/herdr/mod.rs:25 PINNED_TAG = "v0.9.0"; src-tauri/crates/infra/tests/fixtures/herdr/pin.json tag: v0.9.0.
  • Test: runtime_sync::tests::herdr_contract_docs_record_bootstrap_unit_tests.

AkaraChen avatar Sep 16 '26 19:09 AkaraChen