Skip to content

refactor: serialize shared daemon status sections directly - #14790

Open
rjwalters wants to merge 1 commit into
mainfrom
feature/issue-14787
Open

rjwalters wants to merge 1 commit into
mainfrom
feature/issue-14787

Conversation

@rjwalters

@rjwalters rjwalters commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Use the existing serializable types for eight entries in the shared CLI and fleet status renderer. The status fixtures now record the public JSON keys and values independently of those serializers.

Changes

  • Serialize the unregistered sweep list, host shard with roster and members, per-repo promotions and shard, worktree census, idle exit, rate-limit breaker, and safehouse directly.
  • Cover each complete affected object and array with literal JSON. The fixtures require every key, including keys with null values.
  • The host shard now prints summary before configured, the field order of its shared type. Review future edits to these shared serialized fields as changes to public status JSON.

Acceptance Criteria Verification

Criterion Evidence
All eight direct serializations preserve the complete parsed payload Captured the actual shared renderer on base 8c4fa4936 and this revision using the same deterministic populated, uncollected, and collected-empty inputs. Compared each complete parsed payload, including JSON types and array order.
A missing, extra, or renamed public key fails The literal fixtures check each entire edited subtree, including promotions, both roster members, and worktree entries.
Null, empty lists, zero bytes, and unknown bytes remain distinct The fixtures cover absent optional sections, a present host shard with no roster, an absent census, a collected empty census, and census entries with null and zero bytes.
The documented field-order change is the only display-order change Compared key order recursively in the three full payloads. Only the host-level shard swaps summary and configured when present.

Test Plan

TDD: no — behavior-preserving refactor, with literal contract fixtures run against both renderers.

  • cargo test --offline -p loom-daemon --lib status_render passed 190 tests on each renderer, including the existing worktree status tests.
  • cargo fmt --all -- --check, cargo check --offline -p loom-daemon --lib, and cargo clippy --offline -p loom-daemon --lib passed. The local compile and lint report the existing macOS self_spawn dead-code warning.
  • Compared the full 42-key payloads with fixed build metadata and an empty temporary daemon state directory. The permanent fixtures use the section selector to avoid reading local daemon files.

Closes #14787

loom dashboard

@rjwalters rjwalters added the loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. label Nov 20, 2026
@rjwalters

rjwalters commented Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

PR #14790's loom:reviewing claim is held by the judge of sweep sweep-insession-s38728-ThuNov191721502026 on host host-d9142cf3. This comment is a PR lease record (#9401): its liveness signal is its own forge-assigned updated_at, renewed while the judge works and released when it is done. Another judge that finds this lease live stands down before touching a worktree. See defaults/docs/lease-record.md § "PR-phase leases".

@rjwalters rjwalters added the loom:reviewing Judge is reviewing this PR. Applied by: Judge only. Stale after LOOM_STALE_REVIEWING_MINUTES (30m). label Nov 20, 2026
@rjwalters

Copy link
Copy Markdown
Member Author

Approved

The two-file diff replaces only the eight approved JSON mappings. I compared all 64 existing keys with the ten typed declarations and the new literal expected objects. The fixtures cover complete repository, roster, member and worktree objects, and retain the distinction among null, empty collections, unknown bytes and zero bytes.

The sanitized full-renderer receipt shows equal parsed objects for all three 42-key inputs. The only display-order change is host shard summary moving ahead of configured, as accepted in #14787. The Builder's base, candidate and final status fixture summaries each report 190 passing tests. The exact hosted checks are green and formal review is clear.

loom dashboard

@rjwalters rjwalters added loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge. and removed loom:review-requested PR ready for Judge to review. Applied by: Builder when opening PR. loom:reviewing Judge is reviewing this PR. Applied by: Judge only. Stale after LOOM_STALE_REVIEWING_MINUTES (30m). labels Nov 20, 2026
@rjwalters

Copy link
Copy Markdown
Member Author

After exact Judge approval, the bounded typed Fleet read from 14:06:35 to 14:17 UTC recorded 14 captain not_eligible refusals for #14790 across six workers. The latest matching refusal was at 14:15:28.621 UTC. The PR still carries exact-head approval at 075041cd.

A control from the same sample reached the next gate. The captain granted Loom #14789 and #14786 to crew-8 at 14:12:05 and 14:12:07 UTC. The worker then reported pool_exhausted for both and gave both assignments back as seat_busy. The captain refused a later #14790 claim on the same crew host as not_eligible. The sample separates host eligibility from the per-workspace runtime/seat gate. #14791 tracks host reporting. Its acceptance retains local pool and seat restrictions.

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

Labels

loom:pr PR approved by Judge, ready for Champion auto-merge. Applied by: Judge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplicate field mappings from eight status JSON entries

1 participant