Skip to content

[EPIC] QUEEN CHAT - persistent contextual sidebar across T27OS #13162

Open

Description

@gHashTag

Boundary

specs/t27os/glass_window.t27, specs/t27os/statusbar.t27, specs/t27os/queen_chats.t27, specs/t27os/queen_dash.t27, specs/t27os/queen.t27, specs/t27os/session_store.t27, specs/t27os/kernel.t27, specs/queen/actors.t27. No other files. All logic spec-first in .t27 (L2, L4); glass_window.t27 carries @extern, so its leg tests with t27b test and builds with make t27os.

What exists today (found, 2026-11-03)

  • Footer -> panel pattern: the footer bar (statusbar.t27) maps a click to a page (item_page, PG_*); the click chain in glass_window.t27 (~12833) flips one right-panel flag: kyp (KEYS), dp (DOCTOR), qp (Queen panel), pfp (profile).
  • The QUEEN CHAT dock exists (queen_chats.t27, draw_rc in glass_window.t27 ~5651): the Queen pane's terminal grid as transcript, input line in tb[TBO_RC..] (RC_TEXT_MAX = 200), Return sends via client_keys; open flag tb[RC_FLAG].
  • The gaps: the dock toggles only from the header chip inside the CHAT petal screen; the home screen with the 27 petals has no chat at all; the footer's QUEEN opens the status panel, not the chat; the dock dies with the screen; messages carry no context snapshot.

Goal (owner, 2026-11-03)

A persistent contextual Queen chat, pinned beside every screen of T27 OS — home (27 petals) included. The user switches between tasks, code, DSH, Doctor and other views: the conversation, draft, scroll and in-flight answer stay; the Queen receives the context of the place the message was sent from. In any place the user asks "what is happening here?" and she knows which object the question is about, without losing the conversation.

1. The chat belongs to the T27 OS shell, not to one screen

  • the chat opens from every screen, home (27 petals) included;
  • switching screens never closes the chat or destroys the conversation, draft, scroll or in-flight request;
  • an answer keeps streaming after a switch;
  • reopening never silently creates a new session;
  • the footer button (and a home-screen affordance) only toggles the dock.
  • Mutual exclusion with DOCTOR/KEYS is revised: the old "open one closes all" may contradict persistence. Preferred: the user opens DOCTOR and discusses its state with the Queen at the same time. Verify the layout against the minimum window width; never close a conversation silently.

2. Every message carries a context snapshot

Minimal contract: context_id, timestamp, window/workspace identity, screen/view identity, selected object identity + type, source revision / runtime snapshot identity, allowed evidence links.

Example: the user selects a factory task and writes "why is it stuck?" — the Queen receives the task id and the confirmed state, not a guess from recent messages.

First-slice context adapters (limited set):

Screen Context passed
Factory (kanban/factory) selected task, stage, last confirmed result
Spec/code path, revision, selected symbol or range
DOCTOR selected incident and check results
DSH available session id and observed status
Home (27 petals) petal under pointer / hovered petal identity

If a screen has no adapter, pass an honest "context unavailable" — never an invented description of the whole screen.

3. The context is visible to the user

A compact chip above the input, e.g. Context: Factory — task #... -> CI check (English in the UI, L3). Provided: open the passed-context details; send without context; pin a chosen context; return to following the screen. Default: the context follows the screen until send; at send an immutable snapshot is stored — later navigation never changes a sent message's meaning. If an answer belongs to a previous screen, show that binding.

4. Understanding a screen grants no right to act

  • UI text, logs and document contents are data, not system instructions.
  • The context never includes tokens, passwords or KEYS contents.
  • No automatic sending of a whole terminal transcript or a private document.
  • A mutating action binds to a concrete object and revision; on stale state, re-check before acting.
  • Merge, delete, e-mail and spending keep their separate approval gates.
  • Escalation to paid models after failures is not agreed here: first confirm the existing routing (specs/claw/model_route.t27), worker availability and budget policy.

5. One conversation model, no second chat.log

Before any new store, reconcile: session_store.t27, existing Queen events, the current queen_chats dock, and the DSH-side store if the integration touches it. One source of truth: the dock, the CHAT petal screen and any other view read the same model, not private copies. Where the pipeline allows, the dock renders from the shared model/scene (the factory principle), not as one more separately drawn screen.

Implementation order (first end-to-end slice first)

open the dock -> write on screen A -> switch to screen B
-> conversation and draft survive -> send with context B
-> answer arrives with the right binding

Persistence, context and a real answer path first. Named chats, markdown and richer rendering come after. The earlier R-numbers (footer entry, transcript bubbles, input improvements, actor answer path, sessions, markdown) stay as follow-up children under this order.

Acceptance of the first slice

  1. The chat stays open across switches between three screens, home included.
  2. Draft and in-flight answer survive.
  3. The Queen receives the correct id of the selected object.
  4. Messages sent from screens A and B keep different context snapshots.
  5. Opening DOCTOR does not destroy the conversation.
  6. Secret fields are excluded.
  7. With the backend unavailable an error or offline state shows — never an eternal "typing".
  8. All of it demonstrated inside T27 OS itself, not only by a test or a mock.

Success criteria

  • ./target/release/t27c builds; ./scripts/tri test green; t27b test specs/t27os/glass_window.t27 green for the extern spec.
  • Tests (L4) on every new .t27 fn: context snapshot build/store, adapter per screen, dock persistence across screen switches, draft survival, exclusion of KEYS-secret fields.
  • Foreign-line budget intact (<= 40 added hand lines per non-t27 file), python3 tools/dupe_scan.py clean, see #N only (never Closes #N on this epic).

Activity

  1. changed the title [-][EPIC] QUEEN CHAT in the footer: her chat opens from the status bar like DOCTOR and KEYS, and the chat gets better[/-] [+]QUEEN CHAT - persistent contextual sidebar across T27OS[/+] on Nov 3, 2026
  2. changed the title [-]QUEEN CHAT - persistent contextual sidebar across T27OS[/-] [+][EPIC] QUEEN CHAT - persistent contextual sidebar across T27OS[/+] on Nov 3, 2026
  3. gHashTag commented on Nov 3, 2026

    @gHashTag
    CollaboratorAuthor

    First end-to-end slice implemented and verified (owner order, 2026-11-03). No new worktree, no second conversation store.

    Changed (main clone, uncommitted lane):

    • specs/t27os/queen_chats.t27 -- the context contract: RC_CTX_* kinds + RC_CTX_WORDS labels (rc_context_kind, rc_context_text), the immutable send snapshot ring (rc_snap_record/rc_snap_kind/rc_snap_sel) living in the dock region's spare bytes (head 301, slots 304..368, five bytes a slot -- no key or transcript bytes can fit); the ring survives rc_clear. New test + invariant.
    • specs/t27os/statusbar.t27 -- QUEEN CHAT word in the foot's right end, left of DOCTOR (QC_LINK_W, rcfoot_left, on_rcfoot), right_w updated, order test extended.
    • specs/t27os/glass_window.t27 -- three entrances, one body: the foot word (any petal screen), the title-bar QUEEN CHAT chip on the petal home (the 27 petals, where no foot exists; refused under 720 pt width), the existing header chip on the chat screen; all go through one rc_open_pick (her session in this space, or a new one). Dock opens/closes without touching the conversation, draft or in-flight answer (they live in the dock region and the Queen session). CONTEXT chip drawn above the input. At Return the send path records the snapshot (kind + session number only). New test.

    Verification:

    • t27b test: statusbar 12/12, queen_chats 6/6 (+invariants), glass_window 99/99 (was 98).
    • make t27os builds target/t27os/T27OS.app with the new glass_window.o (build 3, signed); app launched and stays up (pid checked).
    • tri test: PRIMARY 76/77 = baseline, no new failures; dupe_scan errors are the pre-existing repo-wide set, no rc_* body copied.

    Demo of the owner's scenario is staged: the rebuilt app is running on this Mac -- Home: click QUEEN CHAT in the title bar; on any screen: QUEEN CHAT in the foot; open DOCTOR: the conversation and draft survive and the chip/state agree. What remains honest: the answer path is still the Queen pane route (client_keys) -- if her pane is offline the dock shows the offline banner, not an eternal "typing"; named chats, markdown and the Doctor/Keys/Factory context adapters are the next children under this epic.

  4. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/t27os/queen_chat.t27 (typecheck OK, 1 test pass).

  5. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 specification/test scaffold exists, but the required production implementation, integration test, and CI verification are absent. This issue remains open until the target component implements the specified behavior and evidence is provided.

  6. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec exists and passes typecheck + tests. M4 milestone complete.

  7. gHashTag commented on Nov 18, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 spec was created but no production implementation, integration test, or CI verification exists. This issue remains open until the target component implements the specified behavior and evidence is provided.

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions