Repository navigation
Description
What to build
Give received Fleet Inbox rows one module that checks and retains the owning machine’s facts. The CLI and Console should use those facts for ordering and display, so a change to row identity, timing or nesting can be made and tested in one place. Mixed-version Fleet machines should keep their current status output and compatibility behavior.
Acceptance criteria
- A received version-2 status Document is checked through the same row module for CLI and Console reads. Fleet sorting and the Console’s Landing references use checked facts directly. CLI text and Console HTML each render from those facts without decoding rows again or building presentation rows to validate a peer.
- Retain the current CLI and Console acceptance rules and Fleet error classifications for an incompatible version, malformed rows and malformed Console-only fields. A failed read continues to leave the last good Console answer available under the existing stale and action rules.
- Preserve status JSON and the local HTTP/CLI twin, including unknown peer fields, machine tags, active-run counts, source-specific fields, optional metadata and the received Command tree. Keep owning-machine grouping, source-specific display, Landing references, and Ready for review identity, checks, member order and recorded finish handling.
- Dismiss or Undo removes exactly the selected Command from the cached Document, whether top-level or under children, dispatched Runs or collapsed entries. The raw and checked views agree after omission, unrelated rows and owner accounting stay intact, and the fresh owning-machine answer can restore the row or show a newly uncovered Needs you kind.
- Tests exercise the checked interface with a mixed v2 Document and an older selector fallback, malformed tree and presentation cases, omission, and raw JSON preservation. Existing status, Fleet and Console Dismissal regressions still pass.
Blocked by
None (can start immediately).
Decisions
- Put the seam at status Document preparation. Keep the owning machine’s Inbox evaluation, local Console enrichment and History selection in their existing modules. ADR 0023 gives the owning machine the group and kept GitHub facts. ADRs 0016 and 0026 preserve the CLI twin, per-machine records, and local handling of activity, Session links and actions.
- Have the row module produce typed facts for the top-level Inbox metadata and the corresponding record, recovered History or reservation payload. Own the source interpretation, selector and legacy selector fallback, Ready title input, freshness and order there. Keep source-specific fields and child facts behind the same interface. Preserve existing source and fallback rules, including optional nested row metadata, old record/log path handling, estimated finish provenance, and the priority of dispatched Runs before children in presentation. This gives sorting and both renderers the same inputs while preserving their existing output.
- Keep the version-2 JSON payload as the serialization source, including unknown fields and distinctions between absent and empty fields. Associate the checked tree with it inside the module and expose immutable facts to readers. Keep local JSON production on its serialization path. Prepare local rows for text or Fleet ordering only when those paths need them. This preserves wire compatibility and avoids adding a render prerequisite to serving local status JSON.
- Check peer version, tree structure and the CLI-required row shape during admission, with the current failure precedence. Check the Console’s additional fields when admitting a peer for Console use, before retaining its answer. Keep
unsupported Inbox version or rowsfor the existing version and CLI row failures andincompatible Inbox presentationfor the Console’s additional checks. Keep the CLI-only and Console-only checks explicit because a peer the CLI can show today can have fields the Console cannot render. Move the checks out of both renderers. Keep machine-, account- and viewer-specific permissions and all target-link checks where their facts are available today. - Keep Dismissal omission on the Document interface. Apply the same selector-based removal to the wire tree and checked facts as one operation. Traverse children, dispatched Runs and collapsed entries for omission, and keep collapsed entries out of rendered children. Leave timestamps and owner counts intact. Retain input facts for the cached answer so the Console can calculate elapsed time, derived child summaries and enabled actions each time it displays the edited tree. The existing Fleet Inbox read-ordering module still admits and fences reads for each pairing and viewer.
- Test through the Document admission, projection and omission interface with deterministic fixtures. Check what the readers see and what JSON goes back out. Cover CLI-compatible input rejected for Console presentation, a malformed nested tree, missing optional nested metadata, and selectors for record, legacy and reservation rows. Keep the real CLI and Console checks for mixed machines, JSON parity, Other-account Commands, grouped Ready for review and late Dismiss/Undo reads because they verify behavior across the existing transport seam.
- Deliver the row preparation and both production readers together in one Ticket. The change is within the status presentation modules and their Fleet callers, with no release dependency or new domain decision. Update the domain-to-code index with the new module owner when it lands.
Architecture review
Strength: Strong · Dependencies: in-process
Files: src/logs/status/fleet.rs, src/logs/status/text.rs, src/logs/status/inbox.rs, src/logs/status.rs, src/console/fleet_inbox.rs, src/console/fleet_inbox/reads.rs, tests/console/fleet.rs
Before
flowchart LR
D["Fleet status Document"] --> F["Fleet admission and ordering"]
F -. validation and sort .-> T["CLI text"]
F -. Console validation .-> H["Console Inbox"]
H -. Landing facts .-> T
D --> T
D --> H
classDef leak stroke:#dc2626,stroke-width:2px
class F,T,H leak
After
flowchart LR
D["Fleet status Document"] --> F["Fleet admission and ordering"]
F --> R["Checked Inbox rows"]
R --> T["CLI text"]
R --> H["Console Inbox"]
classDef deep stroke-width:3px
class R deep
Problem: Fleet admission, ordering and display repeatedly build CLI text and Console rows, spreading the interpretation of the owning machine’s facts across both presentation modules. Fleet admission and ordering, Console merge
Solution: Deepen the checked Inbox row module so both readers can use its interface for the owning machine’s facts and Fleet admission can delete its calls into the renderers.
Wins
- Locality for peer compatibility rules
- One interface for mixed-version tests
- Delete rendering for validation
Activity