Skip to content

ui-react, ui-server: an honest author for the W4 comment preview, so it can use GitHubComment preview #4154

Closed

Description

@schlessera

Part of #3791. Refs #3795, #4146, #3800, #3798.

Blocked by #3795

The W4 renderer integration depends on #3795/#4146 landing. Its host metadata and kit states may be prepared independently; the complete issue remains dependency-blocked until that base is delivered.

Context

The approved W4 design puts a target row above GitHubComment in preview. The kit component requires author: GitHubPerson (GitHubCommentProps, packages/ui-kit/src/github/GitHubComment.tsx:15-24); login: null renders @ghost, meaning a deleted account. The comment tool's approval currently carries only repository, number and body (prepareWrite, packages/ui-server/src/github/host.ts:438-450), so it cannot honestly supply a poster or say whether the target is an issue or PR.

#4146 currently composes kit parts for W4 without inventing either fact. Its review added the target-kind requirement. This issue supplies the host display metadata and kit-owned unknown states needed to use the designed reusable preview. Source context was inspected at main 49b6e7c48ca9f7f6c4bfff90790c28a536ba66e0; #4146's renderer delivery retains its own source and proof identities.

Decision

Maintainer, 2026-11-17: author options 1 + 2 and target-kind option A, recorded ruling.

  • Known author: show only the host GitHub tools credential's verified posting account. Resolve through a bounded credential-scoped cache; invalidate/rebind on credential changes so one credential's cached identity is never attributed to another.
  • Unknown author: GitHubComment preview accepts an absent author and shows The host's GitHub account as a neutral identity. Never use @ghost or a made-up/stale login for this state. Posted comments retain their existing real/deleted-author meaning.
  • Known target kind: show Issue or PR only from verified host target metadata bound to the same repository/number.
  • Unknown target kind: show repository #number through a kit-owned neutral target-row state. Do not guess a kind or manufacture a direct link.
  • Data boundary: these facts are host-owned approval display metadata only. They never enter model tool schemas/inputs/results, system prompts or provider-facing history. Unknown/failed metadata uses the neutral state without blocking an otherwise permitted write.

Always-neutral author/target alternatives were rejected because verified metadata adds useful approval context. Neutral fallbacks preserve the surface when verified metadata is unavailable.

Out of scope

Changing GitHub tool names or model-facing input/result envelopes, adding identity to provider history, changing the dedicated-credential rule, repository allow-list or per-use exact-content approval, accepting edited approval payloads, adding authority from display metadata, automatic posting, broad restyling or a renderer-owned W4 layout. No browser request may bypass the existing host detail/avatar routes.

Scope

Carry optional verified poster/target metadata from the host to the approval surface through a display-only path. Use the existing bounded GitHub transport and preserve its policy/authorization checks. Give the kit the explicit absent-author preview and unknown-kind target states, stories and focused design verification. W4 then renders the target row above the kit's GitHubComment preview; the renderer only maps the host-reported facts. Keep the approved exact body, Not posted chip, draft provenance and no posted-comment link.

Acceptance criteria

  • Known poster, unknown poster, issue, PR and unknown target kind render exactly the ruled states; combine known/unknown author and kind independently. No unknown preview reads as @ghost, Issue or PR without supporting metadata.
  • Host metadata is bound to the same credential and target as the pending write. Credential rotation, denied/missing identity, lookup failure, timeout and rate limit produce the neutral fallback with bounded work and no stale identity reuse.
  • The renderer passes reported values to kit-owned preview/target states; it does not recreate their layouts. Posted-comment behavior and direct-link validation remain intact.
  • Display metadata cannot alter the approved outbound content or be returned to the model. Exact-content comparison, repository policy, current-authority checks after approval and recorded one-time posting remain covered.
  • Kit stories and actual render/browser coverage show both neutral states at 320px and wider, in both themes, with truthful accessible names and the existing draft/truncation behavior.
  • Both backends' keyless provider-history guards pass unchanged. A mutation leaking display metadata into model history or inventing a known identity/type fails its named assertion; restore it and retain the receipt.

Verification

Run the affected host GitHub tests, approval transport/schema tests, kit/render tests and real browser preview coverage; run packages/ui-backend-claude/tests/provider-history.test.ts and packages/ui-backend-pi/tests/provider-history.test.ts through the normal offline wrapper. Use mocked/offline GitHub responses for credential rotation, verified metadata and lookup failures. No live credential or network-dependent test is required.

Contract impact

Optional host-to-client approval display metadata is additive: update the actual wire/HTTP/public SDK component it uses in the same CONTRACT: commit, refresh the affected API report, and include the required minor changeset. GitHub model-facing tool names/schemas/input/result meanings stay unchanged. The kit's absent preview author and unknown target kind are additive states; preserve existing non-preview semantics.

2026-11-17 decision processing: selected author 1 + 2 and host-reported target kind with neutral fallback; folded the #4146 review addition into a complete brief. Preserve the existing 0.45.0 milestone and explicit priority p2. This pass performs no product lookup, write or runtime verification.

Activity

  1. added this to the 0.45.0 milestone on Nov 17, 2026
  2. added
    type: featA new capability or a change in user-visible behaviour.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 17, 2026
  3. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Found in #4146's review: the comment tool's approval card names only repository and number, not whether the target is an issue or a pull request, and the comment tool posts on both. #4146's preview therefore names its target as owner/repo #n without "Issue" or "PR". The posted result takes the kind from its validated URL (/pull/ or /issues/).

    The W4 target row (GitHubRef, which needs kind) has the same gap as the author. Whichever option this issue chooses should also give the approval the target's kind, so the target row can be the design's GitHubRef.

    Added criterion: the W4 approval's target row names the object's kind only when the host states it.

  4. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-17): Author options 1 + 2, and target-kind option A.

    • Author: show the host GitHub tools credential's verified posting account when known. Resolve it through a bounded, credential-scoped cache. Otherwise GitHubComment preview accepts an absent author and shows the neutral identity The host's GitHub account. Unknown is never @ghost, a fabricated login or a stale identity from another credential.
    • Target: show Issue or PR only when the host reports that type from verified target metadata. Otherwise show the neutral repository #number target. The kit owns this unknown-type state; the renderer never guesses a type or constructs an unverified direct link.
    • Boundary: posting identity and target type are host-owned approval display data. They never enter tool inputs/results sent to the model, the system prompt or provider-facing history. Missing metadata degrades the preview and does not disable an otherwise permitted approval/write. Exact-content approval, repository policy, current-authority checks and credential-bound posting remain intact.

    Use the target row above the kit's GitHubComment preview for W4, with kit-owned neutral states and stories. Verify known/unknown combinations, credential changes, bounded lookup failures, 320px/accessibility behavior and both backends' keyless provider-history guards. Always-neutral identity/target alternatives were rejected because verified metadata provides useful approval context; neutral fallbacks preserve usability when it is unavailable.

    Remove needs: decision and add agent-ready if no other need remains. Preserve the existing milestone and any actual integration dependency. This ruling selects the data and fallback behavior; it performs no GitHub lookup or write through the product.

  5. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    contractTouches the integration contract: CONTRACT: commit, contract doc updated in the same commit.
    area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    and removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 17, 2026
  6. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

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

  7. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 17, 2026
  8. self-assigned this
    on Nov 17, 2026
  9. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-5dc72645. Branch: feat/4154-comment-preview-author.

    collisions: closure-only overlaps with open drafts (none on the cited paths); #4147 works the same GitHub UI area in parallel

  10. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-17): route the approval card's pre-approval target-kind lookup through G2 data routing, as PR #4198 does. It sends the repository and number to GitHub before approval, so it is a read. If routing refuses, the card shows repository #number with no kind. The write itself stays unrouted under the #4029 ruling.

  11. schlessera commented on Nov 18, 2026

    @schlessera
    OwnerAuthor

    Merged in #4198 as 969a020c2 through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

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

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.contractTouches the integration contract: CONTRACT: commit, contract doc updated in the same commit.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions