Skip to content

ui-react: tighten one session to the strict profile #1663

Closed

Description

@schlessera

Guardrail class: none. This is an opt-in tightening. Ruling 1 on #1636 makes strict opt-in.

Context

Decision: docs/decisions/governed-writable-workers.md ("Profiles", under "How a profile is selected"). A session may tighten itself to strict through an authenticated session setting. Nothing loosens a profile below the policy.

Scope

  • A per-session setting with two values: "Profile: governed (default)" and "Profile: strict". It is stored in the session catalog.
  • It is honored at each turn start. When the policy already selects strict, the setting is shown as locked.
  • The capabilities note and the turn's attribution carry the chosen profile.

Out of scope

  • Loosening below the policy.
  • Choosing the autonomous profile.

Settled interaction prerequisite

Placement and remaining presentation/recovery are approved by the dated maintainer decisions recorded below. Preserve separately listed technical, dependency, numeric and permission prerequisites; this approval is not runtime delivery.

Acceptance criteria

  • A session set to strict runs its next turn read-only, while another session stays governed. An integration test covers this.

  • When the policy selects strict, the control is disabled and the server refuses an attempt to set governed. A route test covers this.

  • A UI test covers the control at 320 px.

  • Approved interaction. Implement the dated approved interaction and focus/recovery behavior below, and prove applicable pending/success/failed/stale/expired/unknown, keyboard/return-focus, voice and cross-session states in the real browser at 320px/desktop, dark/paper and 200% zoom. Unknown cost/history never displays as zero.

Verification

ui-react and ui-server tests, then bun run check:pr --base origin/main.

Contract impact

Additive session-setting and resolved-profile/limits protocol fields. Update the integration contract and relevant API reports in a CONTRACT: commit, with a minor changeset.

Blocked by #1649
Blocked by #1650

Updated 2026-10-12: identified the remaining shared interaction design; kept architecture, acceptance criteria and real dependency blockers.

Approved interaction — 2026-10-12

Maintainer decision approves the bounded interaction below, following the placement ruling. It supersedes the previously unresolved interaction questions, not the owning issue's policy/security constraints or numeric prerequisites.

  • Profile/limits stay in the model picker's This chat section. Voice sessions show those facts read-only with Voice uses this brain's policy; do not hide the group or enable voice profile/revert authority.
  • Interactive profile controls use native radio behavior and affect the next turn only after successful save. Policy-locked/offline states state their reason. Failed saves keep the last confirmed value; current-turn authority is unchanged.
  • Resolved facts are generated from the same enforcement inputs and remain unknown when unavailable. Proposed numeric examples, fallback-reason enum/wire shape and chip adornment from the earlier brief are not selected by this approval.

Remaining prerequisites

The worker-profile and policy-reader prerequisites remain. The voice-display and interaction choices are settled, so their needs: design/needs: decision labels can be removed. Actual resolved-profile/limits payload, authoritative save acknowledgement, policy non-weakening and turn attribution still require source/route/integration/browser proof; no capability/permission or numeric-default change is inferred.

Approved focus, recovery and browser proof

Reuse existing picker, Disclosure, diff Overlay/BottomSheet and dialog patterns. Insertions do not steal focus; opening a dialog focuses its reading heading rather than Revert. Closing returns to its trigger or the turn disclosure if the trigger disappeared. Receipt updates announce once without reopening the keyboard. Escape closes a reader, never approves/declines/cancels a server operation. Session switches and stale/lost receipts cannot apply actions to another turn. Long paths/copy wrap at 320px/200% zoom; code may scroll inside a bounded diff. Effective 44px targets and existing dark/paper tokens remain. Required real-browser proof covers pending/success/failed/stale/expired/unknown states, keyboard return focus, voice exclusions and cross-session isolation, as applicable to this issue.

This approves presentation/recovery only. Existing permission rules, raw-byte/conflict guarantees, profile non-weakening and voice/autonomous exclusions remain binding. Numeric retention/diff/spend/scope values, quarantine restoration authority and new outward actions are not selected; no extra steering-group revert control, transcript system row, Activity Roadblocks UI or tools/network ledger is selected. Prior design-brief details not explicitly included remain unapproved inputs, not implementation requirements.

Updated 2026-10-12: folded the explicit remaining-interaction approval into this specification and criteria; preserved real dependency/technical gaps and separate numeric/permission decisions. No runtime or browser result is claimed.

Verified implementation prerequisites — 2026-10-12

The binding profile-selection decision requires the in-brain policy as the lower bound. #1649 is merged at 5876df6c81e8fe5e32f6bf1b97fa41397b29492e; #1650's reviewed policy candidate a417ebfee303819b7c202ca4e1bb129615d6fa0b supplies validated effective profiles, last-valid state and immutable per-admission facts (createGovernedTurns, packages/ui-server/src/brain/governed-turn.ts:23-74). The #1663 implementation stacks on that actual candidate, without a duplicate parser or client policy authority. #1650 remains a merge and final hosted-proof prerequisite until it lands.

Existing session storage and routes are createSessionCatalog in packages/ui-server/src/ws/session-catalog.ts and createSessionRoutes in packages/ui-server/src/routes/sessions.ts; extend their authenticated, session-bound behavior. Per-turn facts must distinguish confirmed next-turn preference from the profile that actually ran, including launcher fallback. Preserve the approved read-only voice presentation and autonomous exclusions.

The brief and interaction are specified; both dependency declarations remain active until their outputs land. This source reconciliation adds no policy, numeric limit or UI placement ruling.

Updated 2026-10-12: refreshed worker/policy prerequisite source after the foundation merge and policy candidate delivery; retained #1650 qualification and the approved first-turn, voice and non-weakening constraints.

Activity

  1. added
    type: feat
    area: ui-server
    area: ui-react
    priority: p2
    agent-ready
    blocked
    on Oct 11, 2026
  2. added
    needs: design
    and removed
    agent-ready
    on Oct 12, 2026
  3. schlessera commented on Oct 12, 2026

    @schlessera
    OwnerAuthor

    Design prerequisite — 2026-10-12. The governance architecture and session strict-control policy are approved. The remaining interaction judgments need review before implementation; the two shared placements are now approved, while remaining copy, state/actions and focus still require review.

    Paste to Claude:

    Design the session strict-control interaction for schlessera/brain-kit#1663, under #1642 and shared programme #1636.
    
    Read first:
    - Issues #1663, #1642 and #1636, including their complete bodies, rulings and shared interaction prompt https://github.com/schlessera/brain-kit/issues/1636#issuecomment-6112904347.
    - docs/decisions/governed-writable-workers.md (Profiles, The policy file, The change journal and reconciliation, Cost and budgets, Scope caps, Steering artifacts, Concurrent edits and Settled release defaults, as applicable).
    - docs/decisions/design-kit/navigation.md (D37), design-kit/overlays.md (D54), design-kit/tokens-and-styles.md (D34/D36), design-kit/answer-blocks.md (data-only blocks), docs/decisions/voice-permission.md, cost-tracking.md and example-corpus.md.
    - TurnHeader, packages/ui-react/src/components/chat/transcript-turn.tsx:31-58 (existing turn hierarchy); SettingsPanel, packages/ui-react/src/components/settings/settings-panel.tsx:70-105 (settings selection). Source anchors verified on main 8b4fbdcff57947344ad574e89b249beabe85cb06, 2026-10-12; implementation remains separate from the placement ruling.
    - The owning issue's named enforcement/source anchors and verification fixtures; preserve their actual semantics.
    
    Problem: the issue specifies a governed runtime operation, but its user-visible state/action/copy and recovery/focus behavior is not approved. A delivered decision record is not approval of that interaction.
    
    Settled placement, maintainer 2026-10-12 (https://github.com/schlessera/brain-kit/issues/1636#issuecomment-6127048461):
    - Profile and limits are in the model picker’s This chat section.
    - One disclosure beneath each turn holds changes, cost and limits. The separate control above the composer is superseded.
    - Placement only is approved: numeric limits, security/permissions, remaining state/copy/actions/focus and technical prerequisites remain separate. Activity Roadblocks and additional tools/network UI scope are not approved by this ruling.
    
    Design:
    1. In the approved model picker’s This chat section, decide copy for governed versus strict, policy-locked state, saved versus next-turn-effective setting, pending/failed/offline/stale state, active-turn behavior and keyboard/focus. Nothing may loosen below policy or change autonomous authority.
    2. Draw the relevant interactive/voice, active/idle, pending, failed, stale and disconnected states at 320px and desktop, in both themes. Specify accessible names, announcements and effective 44px touch targets; avoid focus theft.
    3. List named browser assertions and unresolved technical inputs separately; reuse existing kit chrome, overlays and controls.
    
    Requirements to hold: no new destination/seam, no widened autonomous authority, no spoken grants or invented data; data-only blocks remain data-only. Preserve existing visual baselines, reduced motion, zoom, privacy, raw-byte/conflict honesty and measured enforcement coverage. Do not select numeric budget defaults from a drawing or change the approved runtime policy.
    
    Deliverable: state/action/copy matrix, ASCII mocks at 320px and desktop in both themes, focus/recovery rules and issue-specific testable criteria. A compact reuse of existing controls or a documented no to an unnecessary additional surface is acceptable if all approved outcomes remain covered. Post for maintainer review and fold approval into criteria before removing needs: design; a prompt or draft alone is not approval.
    

    2026-10-12 partial-approval refresh: consumed the placement-only maintainer ruling; remaining design/policy/technical questions are not approved or reopened by it.

  4. added
    contract
    on Oct 12, 2026
  5. schlessera commented on Oct 12, 2026

    @schlessera
    OwnerAuthor

    Design brief: one session's profile, governed or strict (#1663)

    Part of the shared governed-turn interaction set (#1636). The This chat section introduced here also hosts the upfront limits facts used by #1669/#1670.

    Recommendation: put the control inside the existing model picker (the composer hint-line chip; popover ≥ 900 px, docked BottomSheet on phone). That is where #543 already put the per-message effort override. It adds a This chat section under Model/Effort with a two-option radio group and a collapsed Limits disclosure. There is no new chip, no new settings tab and no session header menu. The hint-line chip shows the profile only while it is strict: {model} · strict.

    Read: #1663, #1636 and its rulings, governed-writable-workers.md "Profiles", docs/reasoning-effort.md (picker anatomy), Composer.tsx hint-line chip, settings-panel.tsx.

    Picker anatomy

    MODEL
      ◉ Claude Opus 5     · subscription
      ○ GPT-5             · subscription
    ──────────────────────────────────────
    EFFORT · THIS MESSAGE ONLY
      …(unchanged, #543)
    ──────────────────────────────────────
    THIS CHAT · FROM THE NEXT TURN
      ◉ Governed   edits the brain directly; every change is journaled and revertible
      ○ Strict     read-only brain; writes only to scratch and workspaces
      ▸ Limits for this chat
    ──────────────────────────────────────
    

    Limits (expanded) are generated from the same resolved inputs as the agent note (#1626/#1632). Each line has a status word:

      Files changed per turn   200          policy
      Time per turn            30 min       policy
      Tool calls per turn      300          built-in
      Cost                     turn $10 · day $60     covers agent inference only
      Network                  recorded, not limited        ← or "not recorded yet" until the egress gate passes
      Protected                policy, git config/hooks, .env (masked), bunfig.toml, + 6 more
      Host                     separate worker identity     ← or "shared identity · mask-only protection"
                               maintenance workers hold push and provider credentials (interim)
    

    A fact the host cannot state reads unknown. Unknown never reads as enforced. The interim-credential and mask-only lines are the truthful status the ruling of 2026-10-11 requires. They are plain lines, not warnings.

    States

    State Control Copy
    Default (policy governed) ◉ Governed, enabled —
    User chose Strict ◉ Strict. The chip reads {model} · strict Under the group: Applies from the next turn. (only while a turn is running or before the first turn)
    Policy selects strict both disabled, ◉ Strict Set by this brain's policy. Governed is never offered. The server refuses it anyway.
    Turn running enabled This turn keeps its profile. The change applies to the next one.
    Launcher fell back to strict (protected path was a link or mount) unchanged selection The turn's ledger line (#1652) shows ran strict · a protected file was a link. The picker adds the same line under the group for the latest turn only.
    Offline / no host disabled Needs the host.
    Voice session the picker shows the group read-only Voice uses this brain's policy. (open Q2)
    Autonomous n/a —

    Mocks

    320 px bottom sheet ──────────────     desktop popover (above chip) ─────────────────
    │ ─── (grabber)                    │    │ THIS CHAT · FROM THE NEXT TURN            │
    │ MODEL …                          │    │ ◉ Governed  edits the brain directly;     │
    │ EFFORT · THIS MESSAGE ONLY …     │    │             every change is journaled and │
    │ THIS CHAT · FROM THE NEXT TURN   │    │             revertible                    │
    │ ◉ Governed                       │    │ ○ Strict    read-only brain; writes only  │
    │   edits the brain directly;      │    │             to scratch and workspaces     │
    │   every change is journaled and  │    │ ▸ Limits for this chat                    │
    │   revertible                     │    └───────────────────────────────────────────┘
    │ ○ Strict                         │     [ Claude Opus 5 · strict ▾ ]  ← hint-line chip
    │   read-only brain; writes only   │
    │   to scratch and workspaces      │    policy-locked:
    │ ▸ Limits for this chat           │    │ ○ Governed (disabled)                     │
    │                                  │    │ ◉ Strict    Set by this brain's policy.   │
    ──────────────────────────────────
    

    Dark and paper use the existing picker tokens. Nothing is new.

    Browser criteria

    1. profile-strict-next: choosing Strict mid-turn shows the next-turn line; the next turn's ledger reads strict; another session stays governed.
    2. profile-locked: a policy strict fixture shows the disabled group with the reason; a forced governed request is refused (route test).
    3. profile-chip: the chip carries · strict only when strict.
    4. limits-unknown: a host without an egress measurement shows not recorded yet; a fact absent from the fixture shows unknown.
    5. profile-320: the sheet at 320 px, 44 px rows, keyboard radio behaviour, Esc returns focus to the chip.
    6. Dark and paper, zoom 200 %.

    Missing technical facts

    • The resolved-limits payload (the same generator as the note) must reach the client: session_info.limits or a capabilities frame.
    • The fallback reason enum from the launcher (protected_link, protected_mount, …).

    Open questions

    1. Placement: accept the model picker's This chat section, or a separate session menu?
    2. Voice sessions: read-only display (proposal), or hide the group?
    3. Limits disclosure: in the picker (proposal), or only in Settings › Devices & agents › Agent policy (ui-server: an agent may propose a governance policy change that only the user's approval writes #1662)?
  6. added
    needs: decision
    needs: design
    and removed
    needs: design
    on Oct 12, 2026
  7. 4 remaining items

  8. removed
    needs: design
    on Oct 12, 2026
  9. added this to the 0.42.0 milestone on Oct 12, 2026
  10. added
    agent-ready
    on Oct 12, 2026
  11. self-assigned this
    on Oct 12, 2026
  12. schlessera commented on Oct 12, 2026

    @schlessera
    OwnerAuthor

    Claim: session-profile-1663-20261012-78381f66, branch feat/1663-session-profile-78381f66. Implementing the approved This chat control and authenticated per-session tightening as independent work on the governed-worker candidate. #1649 and #1650 remain integration/merge prerequisites; this does not declare their delivery. Native voice stays read-only, saves retain the last confirmed value, and admission enforces the policy lower bound. Milestone0.42.0.

  13. schlessera commented on Oct 12, 2026

    @schlessera
    OwnerAuthor

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

  14. removed
    blocked
    on Oct 12, 2026
  15. schlessera commented on Oct 12, 2026

    @schlessera
    OwnerAuthor

    Merged in #1747 for milestone 0.42.0. Squash 52cbd1db182b618706cd7edca72159ba62768a63 is present on main; its parent is 966bed83 and its tree exactly matches the verified candidate. The bounded journal, confirmed next-turn profile preferences and captured command policy are delivered; the diagnosed Search opening-focus fix is included.

    All 14 selected jobs passed in PR CI run38306139332, attempt1. Each actual job checked out a45084c02c8e1986aeaeca75d3ad8c553eeb37d9, with verified main/head parents and tree. Behavioral mutations, real worker/browser receipts and preflight are recorded in the PR. All 14 selected main-push CI jobs also passed. Every actual job checkout was verified as squash 52cbd1db182b618706cd7edca72159ba62768a63.

    Completing issues and PR are closed/merged with milestone0.42.0 read back. Coordinator claims for this delivery are released. Remaining programme work stays with its own issues; this is not a release publication or whole-programme completion claim.

  16. removed their assignment
    on Oct 12, 2026
  17. removed
    agent-ready
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ui-reactarea: ui-servercontractpriority: p2type: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions