Skip to content

ui-server: owner-only detail view for private managed-worktree hygiene findings #2734

Closed

Description

@schlessera

Context

#2431 (PR #2730) adds host-only managed-worktree hygiene findings to the human-started review. The maintainer ruled on #2431 (2026-10-23) that the owner principal is an authorized reader and reviewer of a delegated agent's private worktree findings.

Inbox Actions replicate to every usable principal. A private worktree's card is therefore opaque for every reader: it shows the worktree identity, state and counts only, with no repository, revision, commit, changed path or principal (function display(, packages/ui-server/src/brain/reference-worktree-hygiene.ts:179-197; docs/decisions/managed-worktrees.md#hygiene-and-cleanup). The owner can review and remove through that card, but cannot read the details the ruling authorizes. The detail read consumes #2431's host-only findings and their owner-reader ruling, not #2432's agent tools; real cards reach users once agents can allocate worktrees (#2432).

Part of #2390.

Delivered prerequisite: #2431 / merged #2730 (dc5d3c73282c29a3f0098306d398743ee18ec791).

Out of scope

Putting private details into the replicated card or its preview. A separate review product. Changing who may operate the review (owner and ambient principals). Detail reads for every non-owner principal, including the worktree's own delegated principal.

Approved interaction

The maintainer approval of 2026-10-24 selects both parts of the brief (placement/fields, states/focus/proof) with its recommended choices: non-owners see today's card unchanged with no toggle or hint; removed owners read Removed principal without a former label; starting commits display in full and wrap. The approved surface is inline Private details, not a new destination or a sheet. Owner-reader authority remains unchanged. The following acceptance criteria incorporate the approved interaction; no design question remains.

Scope

An owner-only read of a private worktree finding's details: source repository, revision and starting commit, the changed-path sample and counts, and the owning principal. It is reachable from the review card without the details entering any inbox-replicated data.

Acceptance criteria

  1. Every direct private-detail request permits only the owner principal; all delegated principals, including the worktree's own, are refused. The per-request host review read supplies whether this caller may read details; this fact is never inferred solely from principal kind or replicated in the Action.
  2. In the full review card only, place a collapsed kit Disclosure named Private details between excerpt and controls. Fetch only when opened. Non-owners retain the existing card with no toggle, lock, hint or count of hidden fields; compact inbox cards never offer it. Apply/Later/Dismiss and the opaque removal preview are unchanged.
  3. The replicated card, preview, list entries and outcomes remain opaque; extend REFERENCE_WORKTREE_HYGIENE_PRIVATE_OPAQUE and its native counterpart with a byte search for fictional repository, commit, sample path and principal label. Details remain component memory only: no inbox store, local storage, outcome, persisted cache or cross-mount reuse.
  4. Render the approved inert description list: OWNED BY (principal label plus agent/device kind, or exactly Removed principal), REPOSITORY and REVISION (Not recorded if absent), full wrapping STARTING COMMIT (Not recorded if absent), CHANGED PATHS (total plus explicit sample size, None for known zero, Not established yet for unknown), any incomparable-path count, and As recorded <date, time>. or Assessment time unknown. Values never linkify or interpret Markdown/HTML. Stack below 480px; keep the approved two-column treatment above it.
  5. The disclosure subtitle is Owner only · not sent to other devices or agents. The read shows recorded facts only: it never calls next/check/reassess/dry-run or changes state, fingerprint or last_seen. An explicit Refresh finding after a changed response uses the existing refresh action separately, not an implicit reassessment by the read.
  6. Host responses distinguish unknown/resolved (gone) and fingerprint mismatch (changed); neither returns any detail values. Keep the selected authorization/refusal and no-detail behavior for every caller, including direct requests.
Detail state Approved content and behavior
Loading Five Placeholder lines, Loading private details accessible name, region busy; focus stays on toggle
Loaded Approved rows; polite Private details shown
Changed This worktree changed since the card was shown. Refresh the finding to see current details. + existing Refresh finding; no detail rows
Gone This finding is no longer open. There's nothing to show.
Refused Private details aren't available with your current access.; collapse and remove toggle on next review read; focus card title
Offline Can't reach your brain right now. + Try again
Failed/bad reply Couldn't load the details. Nothing was changed. + Try again
Signed out during load Existing auth-lock flow; collapsed after sign-in
  1. Clear memory and collapse on user collapse; Action identity/version change or leaving pending (including an Actions-limit set-aside); review pause/completion/unmount; socket disconnect/offline; root/principal change, sign-out/auth lock; and refused/changed/gone replies. Discard any late reply for an obsolete card/request. No previous finding's bytes remain visible for the next one.
  2. Toggle is a native button with aria-expanded/controls and a 44px target; region is named Private details with a dl. Enter/Space/tap toggles once; no new Escape binding for this inline disclosure. Preserve card-scoped action keys. Collapse returns focus to the toggle; invalidation while focus is inside moves it to the card title, or the strip if the card disappeared. Keep the approved title → toggle → region actions → review-controls tab order.
  3. Host proof: owner allowed and each agent refused directly, changed/gone contain no values, row snapshot proves no fingerprint/last_seen/state mutation, and no private bytes enter any replicated surface. Each guard has failing-first and mutation receipts.
  4. Pinned browser proof at 320×640 and 1440×900, both themes, plus 200% zoom: owner expand/rows/collapse/focus, no agent toggle or private DOM/accessibility bytes, unknown versus zero, inert hostile-looking path text, late reply discard, disconnect clearing and Actions-limit clearing. Use the approved Odysseus fixture, 2026-07-12, 14 total/5 sampled paths, with no horizontal scroll.
  5. Any new HTTP route/field ships in a CONTRACT: commit with its authoritative component and affected API report. The approved design names required host facts, not preapproved route or field names.

Verification

Direct host authorization/row-snapshot/replication tests with failing-first and mutations; mandatory pinned native browser flow/state/focus proof above, then the required affected checks and bun run check:pr --base origin/main. Owner-only privacy and read-only semantics remain binding.

Contract impact

Additive authenticated host/review/detail read fields. Exact route and field names are implementation design under the existing contract rules; replicated Action/card data remains opaque and does not carry private details or the per-request detail-access fact.

2026-10-24: repointed the blocker from #2432 to #2431, which supplies the findings this view reads; #2390's final acceptance (#2751) now runs after this issue. Noted that the display citation is on PR #2730's branch until it merges.

2026-10-24 triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: verified #2431/#2730 delivery, retired its active dependency and branch-only source qualifier, aligned exclusions with owner-only acceptance, and exposed the unapproved entry/detail interaction as needs: design. Preserve p0, 0.44.0 and the #2751 priority dependency; no UI or route was implemented.

2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Linked the later two-part design proposal and its exact remaining approval choices. The usable existing prompt needs no replacement. Owner-only authority remains settled, delegated principals remain refused, and needs: design remains until the proposal is approved.

The interaction and recommended copy choices are now approved; the earlier pending-design notes above are historical.

2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Folded the explicit two-part design approval and its three selected options into the active brief, with host/privacy assertions, complete state and memory-clearing rules, focus and required browser coverage. The remaining work is implementation of this complete owner-only brief, so add agent-ready and area: ui-react; preserve p0, contract, native parent and 0.44.0.

Activity

  1. added this to the 0.44.0 milestone on Oct 23, 2026
  2. added
    type: feat
    area: ui-server
    blocked
    contract
    on Oct 23, 2026
  3. added
    priority: p0
    on Oct 24, 2026
  4. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Raised to priority: p0 (2026-10-24): this issue now blocks #2751, the p0 final-acceptance task for #2390, and a blocker carries at least the priority of what it blocks.

  5. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #2431 is closed, so scripts/sync-project.ts is removing the blocked label.

  6. added
    needs: design
    and removed
    blocked
    on Oct 24, 2026
  7. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Needs design — 2026-10-24: owner-only details from an opaque managed-worktree hygiene card. The owner may read/review the private finding; replicated inbox data must stay opaque for every reader. The missing judgment is the entry/detail interaction and its loading, missing, stale and authorization-loss behavior; the newly delivered host findings do not decide it. This prompt selects no design or broader reader authority.

    Design the owner-only managed-worktree finding detail for brain-kit #2734 under epic #2390. The full body is the implementation boundary; #2751 consumes its result.
    
    Read first at main dc5d3c73282c29a3f0098306d398743ee18ec791:
    - #2734 and #2390; the 2026-10-23 owner-reader ruling on #2431 and its delivered PR #2730.
    - function display, packages/ui-server/src/brain/reference-worktree-hygiene.ts:179-197: private cards expose only identity, state and counts; public worktree fields are conditional. Do not copy private details into these replicated fields.
    - REFERENCE_WORKTREE_HYGIENE_PRIVATE_OPAQUE, packages/ui-server/tests/reference-worktree-hygiene.test.ts:109, and the native counterpart named by #2734.
    - docs/decisions/managed-worktrees.md, Hygiene and cleanup; docs/decisions/hygiene-review.md (identity/fingerprint/dispositions); docs/decisions/reference-worktrees.md (authority and preservation); docs/decisions/session-principals.md.
    - docs/decisions/design-kit/components-and-interactions.md, existing hygiene review and ActionCard/BottomSheet/Disclosure components; docs/decisions/design-kit/tokens-and-styles.md (themes, effective targets and focus); docs/decisions/http-api-boundary.md and contract-versioning.md for any new authenticated read.
    
    Problem: an owner can review a delegated principal's private worktree finding but sees no repository, revision, starting commit, changed-path sample or owning principal. The inbox is replicated, so those details cannot be added to the card's payload, preview, lists or outcomes.
    
    Settled:
    - Owner-only detail read. Every delegated agent, including the worktree's own principal, is refused. Marking a control hidden is not host authorization.
    - Read only: opening detail does not assess, renew, remove or change a finding fingerprint.
    - Existing review authority and removal confirmation remain unchanged. Private detail is fetched through a host-authorized read, never replicated.
    
    Design:
    1. Where does the owner open details, and where do they appear while preserving the current review flow? Specify what a non-owner sees without implying they can gain access.
    2. Give the hierarchy and exact labels for repository, revision, starting commit, owning principal, changed-path sample and counts. Keep paths and source text inert. Distinguish sample from total and unknown from zero.
    3. Cover loading, unavailable/deleted finding, a changed finding, permission loss/sign-out, offline and failed fetch. State when detail is cleared so it cannot remain visible after authorization loss or for the next finding.
    4. Define focus entry/return, Escape/dismissal, keyboard/touch activation and long-path overflow at 320px and desktop. Keep both themes and effective 44px targets; no new navigation destination or shortcut.
    5. List the host and pinned-browser assertions: direct non-owner read refusal; no private bytes in replicated card/preview/list/outcome; no assessment/renewal/fingerprint mutation; the complete owner entry and return flow.
    
    Deliverable: a proposed design comment on #2734 with exact copy/state/focus rules, 320px and desktop ASCII mocks and checkable browser criteria, for maintainer approval. A compact existing disclosure/sheet treatment is acceptable. If an authority question appears, name it separately; do not invent a reader grant or an API response. Owner-only privacy requirements cannot be waived by the design.
    

    The delivered prerequisite #2431/#2730 is verified on this main SHA; needs: design remains until the interaction is approved. Preserve p0/0.44.0 and dependent #2751. This is issue preparation, not implementation or a privacy proof.

  8. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Design brief (1/2): owner-only private details on a managed-worktree card

    Answers the design prompt. Read against main dc5d3c73: display() and diff() in reference-worktree-hygiene.ts, HygieneFinding / HygieneCard in ui-react/.../activity/hygiene-review.tsx, and kit Disclosure. Nothing has shipped, and no API shape is specified. Where the UI needs a host fact, this brief names the fact, not a field.

    Summary

    • Placement: an inline kit Disclosure, Private details, inside the full hygiene card, between the excerpt and the controls. It is not a sheet, a new destination or a shortcut. The review flow (Apply / Later / Dismiss, removal preview) is unchanged.
    • Who sees the toggle: only a principal that the host's per-request review read (REST, not the replicated Action) says may read details. Everyone else sees today's card unchanged, with no locked toggle and no "owner only" hint.
    • Fetch on open, never before. Details live in component memory only. They never go into the inbox store, outcomes, local storage or the replicated Action. They are cleared on every event listed in part 2 §4.
    • Read-only. Opening the details never calls next, check, reassess or --dry-run. It shows the recorded facts and says how old they are.
    • The removal preview (diff()) stays private source for everyone. It is replicated, so it can't carry details.

    1. Owner, 320px, expanded

    ┌──────────────────────────────────┐
    │ REVIEW · managed worktree        │
    │ A released managed worktree      │
    │ still holds unfinished work      │
    │ reference-worktree://wt_7f3a…    │
    │ private source · 14 changed      │
    │ paths · released                 │
    │                                  │
    │ ▾ Private details                │
    │   Owner only · not sent to other │
    │   devices or agents              │
    │ ┌──────────────────────────────┐ │
    │ │ OWNED BY                     │ │
    │ │ Telemachus research (agent)  │ │
    │ │ REPOSITORY                   │ │
    │ │ github.com/ithaca/palace-    │ │
    │ │ ledger                       │ │
    │ │ REVISION                     │ │
    │ │ refs/heads/raft-repairs      │ │
    │ │ STARTING COMMIT              │ │
    │ │ 3f9a2c1d4e5b7a8c9d0e1f2a3b4c │ │
    │ │ 5d6e7f8a9b0c                 │ │
    │ │ CHANGED PATHS                │ │
    │ │ 14 in total · first 5 shown  │ │
    │ │  src/ledger/olive-oil.ts     │ │
    │ │  src/ledger/wine-stores.ts   │ │
    │ │  docs/suitors/antinous-acc…  │ │
    │ │   …(wraps, never truncates)  │ │
    │ │  tests/ledger.test.ts        │ │
    │ │  package.json                │ │
    │ │ As recorded 12 Jul, 14:02.   │ │
    │ └──────────────────────────────┘ │
    │                                  │
    │ [ Check preview ]                │
    │ [Apply fix] [Later ▾] [Dismiss]  │
    └──────────────────────────────────┘
    

    Collapsed (default): ▸ Private details / Owner only · not sent to other devices or agents. It is a 44px-high toggle row. The state is never remembered between cards or reloads.

    2. Owner, desktop (Actions column ~560px)

    ┌ Actions ─────────────────────────────────────────────────────┐
    │ ● Hygiene review · 2 of 6 open                     [Pause]   │
    │ ┌──────────────────────────────────────────────────────────┐ │
    │ │ REVIEW · managed worktree                                │ │
    │ │ A released managed worktree still holds unfinished work  │ │
    │ │ reference-worktree://wt_7f3a91 · private source ·        │ │
    │ │ 14 changed paths · released                              │ │
    │ │ ▾ Private details   Owner only · not sent to other …     │ │
    │ │   OWNED BY         Telemachus research (agent)           │ │
    │ │   REPOSITORY       github.com/ithaca/palace-ledger       │ │
    │ │   REVISION         refs/heads/raft-repairs               │ │
    │ │   STARTING COMMIT  3f9a2c1d4e5b7a8c9d0e1f2a3b4c5d6e7f8a… │ │
    │ │   CHANGED PATHS    14 in total · first 5 shown           │ │
    │ │                    src/ledger/olive-oil.ts               │ │
    │ │                    …                                     │ │
    │ │   As recorded 12 Jul, 14:02.                             │ │
    │ │ [Check preview]                                          │ │
    │ │ [Apply fix]  [Later ▾]  [Dismiss]                        │ │
    │ └──────────────────────────────────────────────────────────┘ │
    └──────────────────────────────────────────────────────────────┘
    

    At ≥ 480px the labels sit in a two-column grid. Below that they stack, as at 320px. The compact card in inbox lists never shows the toggle. Details are only available on the full card.

    3. Non-owner (agent, or any principal the host doesn't allow)

    The card is exactly today's card: private source · 14 changed paths · released. There is no toggle, no lock, no "ask the owner" line and no count of hidden fields. The existing private source wording already tells the reader that the source isn't shown. See Decision 1.

    4. Labels and values (exact)

    Label Value Unknown / empty
    OWNED BY principal label + (agent) / (device) Removed principal. The id is not shown.
    REPOSITORY domain + repository, as one string Not recorded
    REVISION the revision as requested Not recorded
    STARTING COMMIT full commit, mono, wraps anywhere Not recorded
    CHANGED PATHS 14 in total · first 5 shown / 3 in total (whole list shown) / None (zero) Not established yet (work unknown, never 0)
    extra line 2 paths couldn't be compared. when that count is above 0 omitted when 0
    footer As recorded <date, time>. (when the facts were last assessed) Assessment time unknown.
    • Sample vs total: the count line always states both numbers. The sample is never presented as the full list.
    • Inert text: every value is a text node, in mono for paths and the commit. Nothing is linkified, rendered as markdown or opened on click. Paths wrap (overflow-wrap:anywhere) instead of truncating, so two similar paths can't look identical.
    • No copy buttons in v1 (no new controls). The text can be selected.

    Part 2 covers states, clearing, focus, criteria and decisions.

  9. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Design brief (2/2): states, clearing, focus, criteria

    1. States inside the disclosure

    State Shows Focus / announce
    Loading kit Placeholder, 5 lines, aria-label="Loading private details" focus stays on toggle; aria-busy on region
    Loaded §4 rows polite: Private details shown
    Finding changed (host's recorded fingerprint ≠ card's) This worktree changed since the card was shown. Refresh the finding to see current details. + Refresh finding (existing refresh command). No detail rows. polite: same sentence
    Finding gone (resolved / not detected) This finding is no longer open. There's nothing to show. polite
    Refused (host says not allowed) Private details aren't available with your current access. Collapse; toggle removed on next review read. focus → card title (data-hygiene-title)
    Offline / unreachable Can't reach your brain right now. + Try again polite
    Failed fetch (5xx, bad reply) Couldn't load the details. Nothing was changed. + Try again polite
    Signed out mid-load existing auth-lock flow; disclosure resets collapsed after sign-in —

    "Finding changed" deliberately shows nothing rather than details that disagree with the card the owner is about to act on. Refresh goes through existing selection, which already reassesses.

    2. When details are cleared (memory dropped, region collapsed)

    1. Toggle collapsed.
    2. Card's Action id or version changes, or it leaves pending (fixed, dismissed, snoozed, set aside by the Actions limit, resolved elsewhere).
    3. Review paused, completed or the strip unmounts.
    4. Connection drops or online becomes false (re-auth may change the principal).
    5. Root/principal change, sign-out, auth lock.
    6. Any refused or "changed"/"gone" reply.

    A late reply for a card that is no longer current is discarded (request token, same pattern as useHygieneReview). Nothing is cached across mounts.

    3. Keyboard, touch, focus

    • Toggle is a native button (aria-expanded, aria-controls); Enter/Space/tap toggle it. Effective target 44px.
    • Region is role="region", aria-label="Private details"; rows are a <dl>.
    • Escape: no binding — it's an inline disclosure, not a modal; collapsing is the toggle. The card's a / l / d keys stay card-scoped and unchanged.
    • Collapse keeps focus on the toggle. Clearing by events 2–6 while focus is inside the region moves focus to the card title, or to the strip if the card is gone.
    • Tab order: title → toggle → region (non-interactive except Refresh/Try again) → existing controls.
    • 320px and 200% zoom: no horizontal scroll; commit and paths wrap. Both themes use existing ink tokens; label ink color.inkMute meets 4.5:1.

    4. Host and browser criteria (for the AC)

    Host

    • Owner read returns details; every delegated agent principal — including the worktree's own — is refused by direct request; failing-first + mutation receipt.
    • Read for an unknown / resolved finding returns "gone"; a fingerprint mismatch returns "changed" with no detail values.
    • Read never changes reference_worktree_findings (fingerprint, last_seen, state) and never calls reassess; test snapshots the row before/after.
    • The review read exposes "may read details" per requesting principal; the replicated Action, preview, list entries and outcomes contain no repository, revision, commit, sample path or principal label. REFERENCE_WORKTREE_HYGIENE_PRIVATE_OPAQUE and native counterpart still pass, extended with a byte search for a fixture repo, commit and path.

    Pinned browser (320×640 and 1440×900, light + dark)

    • Owner: start review → card → expand → rows match §4 → collapse → focus on toggle.
    • Agent principal: no toggle in DOM; no fixture repo/commit/path in DOM text or accessible names.
    • Unknown work renders Not established yet, zero renders None.
    • Fixture path [x](http://e.test)<b>y</b> renders literally.
    • Simulated disconnect while expanded clears rows; Actions-limit set-aside clears rows.
    • Fixture: Odysseus corpus, agent Telemachus research, repo github.com/ithaca/palace-ledger, 14 changed / 5 sampled, 12 Jul.

    Open decisions

    1. What does a non-owner see?

    • (a) Nothing new — today's card, private source only.
    • (b) A static line Details are shown to the owner.
      Recommend (a): (b) invites access requests the ruling doesn't offer, and it's identical copy for every reader so it adds nothing.

    2. Label for a removed owning principal.

    • (a) Removed principal only.
    • (b) Removed principal + its former label.
      Recommend (a) — the host may no longer hold the label, and showing a stale label after revocation is a new retention question.

    3. Starting commit length. Full 40 chars (as mocked) vs 12 chars like public cards. Recommend full — the owner is reading this to identify work, and wrapping costs one line.

    No authority question was found: the brief adds no reader grant, and Decision 1 only affects copy.

  10. added
    needs: decision
    needs: design
    and removed
    needs: design
    needs: decision
    on Oct 24, 2026
  11. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main af6300478a07379178bd30221a31c0b917df2283: Linked the later two-part design proposal and its exact remaining approval choices. The usable existing prompt needs no replacement. Owner-only authority remains settled, delegated principals remain refused, and needs: design remains until the proposal is approved. The concurrent needs: decision label was rechecked against the proposal: its outstanding approval choices concern the detail interaction and copy, while owner-reader authority remains settled; classify this as needs: design.

  12. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Design approved (maintainer, 2026-10-24). The two-part brief (1/2, 2/2) is approved as written, with its recommended options:

    1. A non-owner sees today's card unchanged: no toggle and no hint (1a).
    2. A removed owning principal reads Removed principal only (2a).
    3. The starting commit is shown in full, wrapping (3).

    Removing needs: design. Fold the state, copy and focus rules and the host and browser criteria into the acceptance criteria before implementation.

  13. added
    agent-ready
    area: ui-react
    and removed
    needs: design
    on Oct 24, 2026
  14. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main e1ab485669565554ca6cb61ce5d130303647230f: Folded the explicit two-part design approval and its three selected options into the active brief, with host/privacy assertions, complete state and memory-clearing rules, focus and required browser coverage. The remaining work is implementation of this complete owner-only brief, so add agent-ready and area: ui-react; preserve p0, contract, native parent and 0.44.0.

  15. self-assigned this
    on Oct 24, 2026
  16. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim bk044-2734-owner-details), branch feat/2734-owner-worktree-details-044. Implementing the approved owner-only Private details read and disclosure; draft PR to follow.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-reactarea: ui-servercontractpriority: p0type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions