Skip to content

Add default-on Jev → Luna Pi observer with minimal YSK UI - #849

Merged
nateberkopec merged 11 commits into
mainfrom
pi-ysk-jev-luna
Oct 5, 2026
Merged

nateberkopec merged 11 commits into
mainfrom
pi-ysk-jev-luna

Conversation

@nateberkopec

@nateberkopec nateberkopec commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

This is AI-assisted. Model: gpt-6.1-sol

YSK-BTW-demo.mp4

Summary

Supersedes #842 with the default-on production Jev → Luna observer and the terminal UI refined in the live demo.

  • /ysk-demo on, /ysk-demo off, or a bare float from 0–1 controls enabled state and gate threshold (default 0.85). Settings restore from the active branch.
  • One pinned direct TypeSafe jev-1.13.0 request batches interruption/category decisions per checkpoint. Only P(warn) >= threshold calls pinned, independent, tool-less openai/gpt-6-luna via Pi’s model registry. Operator confirmed Jev’s Datasafe qualification; incompatible profiles fail closed.
  • Above the editor: only bold/accent YSK: plus the note; quiet/declined results remove the widget entirely.
  • Above the native footer: dim, zero-padding split cumulative cost estimates, rounded upward to three decimals, response counts and a first-column waiting spinner (· when idle). Unknown spend displays ?, not a fabricated zero.
  • 24,000-character text window excluding thinking/images; 30-second intermediate throttle and changed final-turn checkpoint; 40-second deadline; no retries, fallback or HTTP redirects for either provider. Main-run cancellation, off, branch restoration and shutdown cancel observer work and suppress stale notes.
  • No main-agent context injection. Only notes and sanitized usage/decision metadata persist as non-context entries. Requires inherited TYPESAFE_API_KEY and existing Luna credentials.
  • CI discovers all test/*_test.mjs generically. README.md is unchanged.

Independent review and fixes

A fresh-context reviewer found three actionable issues; all were fixed and independently re-reviewed with no remaining blockers:

  1. Luna redirect policy: request-local fetch forces redirect: error; actual SDK transport regressions verify both providers.
  2. Main-run cancellation: link the context signal, release the abort race, remove listeners, and prevent a cancelled turn’s final checkpoint from restarting work even after Pi clears the signal.
  3. Interrupted SDK accounting: initialization-zero usage on failed/aborted streams is unknown; preserve genuinely reported positive usage/cost and completed zero-cost responses. Actual mocked SDK SSE tests verify persistence/restoration and no fabricated note.

Validation

  • All 85 generic-discovered local Pi tests passed after the shared side-chat addition. Reviewer independently reran the original 34 focused YSK tests for the three review fixes; the subsequent animated UI and shared side-chat additions have direct-parent regression and PTY validation.
  • Strict extension/fixture typechecking and whitespace checks passed; reviewer independently verified strict typing.
  • Real Jev/Luna over synthetic main transcripts still pass after fixes: risky data-loss scenario P(warn)=0.99 with a warning; quiet arithmetic P(warn)=0 skips Luna.
  • Production real-provider PTY proofs pass regular 100-column/fullscreen 48-column rendering: default-on observation, minimal bold note, dim costs above native footer, first-column spinner and off removal.
  • Published fixes verified byte-for-byte against reviewed/tested local contents; typecheck helper remains executable.

The previous head passed all applicable hosted CI; hosted checks are rerunning for head d177224ec7c27da082769eb524b499273d63aafe. No merge, installation or machine convergence performed.

Approved animated transition

After Jev passes the gate, show bold/accent YSK: and dim Reviewing a possible issue with dots cycling ., .., ... every 400ms while Luna responds. Replace with a static explanation, or clear on decline/error/cancellation/off. Provisional text is never persisted as a warning. Seven regressions cover gate timing, all completion paths and deterministic animation. Actual regular 100-column/fullscreen 48-column PTY proofs verify every dot phase using delayed mocked providers (no network or paid calls). No acknowledgement controls or ignored-check suppression were implemented. Side-chat was subsequently approved and added below.

Approved simpler BTW / YSK side-chat

Adapt Armin Ronacher’s Apache-2.0 agent-stuff/extensions/btw.ts design, pinned upstream 0865c849befd2021490679f96a8dee58c84ac857, into a shared local overlay/backend/thread controller. Preserve attribution and the upstream license. Remove npm:@narumitw/pi-btw@0.61.1 from managed settings; do not enable Armin’s original BTW extension too.

  • /btw [question] uses the main model/context with read/bash/edit/write; --new explicitly starts fresh.
  • /ysk-chat [question] uses only pinned Luna, no tools/fallback/retries/redirects, and the warning’s original bounded text-only snapshot, not evolving main context. Opening the composer makes no model request.
  • Luna is instructed to explain in simplified technical English at an 11th-grade reading level or less, answer follow-ups, and correct/withdraw mistaken warnings.
  • /ysk-dismiss hides without claiming understanding. No commands, buttons or understanding quiz are displayed beside the warning.
  • Esc cancels and closes without a confirmation dialog. Completed history restores from the current branch; only the latest eight completed side turns are replayed. BTW/YSK/individual-warning histories remain separate.
  • Only explicit /btw-inject or /ysk-inject sends text back to the main agent. No automatic handoff or paid summary generation.
  • Modern Pi modelRuntime API forwards through the parent’s configured model registry/auth/policy; no child extensions, skills, context-file discovery, retries, compaction or cache warming.
  • YSK chat contributes precise/unknown usage to the existing Luna ledger, including failed SDK streams.

Validation: all 85 tests and strict typing pass. Actual SDK CLI fixtures prove model/tool boundaries, original snapshot, multi-process restoration, separate history, no main injection, fresh-thread reset and dismissal. Actual SDK mocked OpenAI SSE transport proves redirect policy and interrupted-usage accounting. Deterministic lifecycle tests cover late answers, close, branch changes, deadlines and recovery. Regular 100-column/fullscreen 48-column PTY proofs pass both composers, zero-request opening, streaming, Esc-close and invisible command hints; all new provider proofs were network-free. Published code/config/test blobs verified against tested local contents; helper remains 100755. No merge, installation or live convergence performed.

Shared-overlay screenshot regression fix

The reported demo screenshot exposed missing side borders and main-screen text bleeding into the chat. Markdown transcript rows bypassed the existing full-width border/padding helper; applying it to every row fixes both BTW and YSK chat. Actual SDK renderer regression covers 15 combinations of width/content, including blank rows, wrapping, Unicode and code blocks. Native PTY composition checks pass for both chats at regular100/fullscreen48. All 86 tests, strict extension typing and whitespace checks pass. Published three blobs verified against tested sources; executable helper mode remains 100755. Demo snapshot refreshed, no live installation. Fix head: 68a076e.

Adapt Armin Ronacher’s agent-stuff side-chat design; replace the managed BTW package. Supersedes #842.
Markdown rows bypassed the border and padding helper, leaving the main screen visible through the overlay. Frame every transcript row; lock down real SDK Markdown rendering and full-width coverage. Related #842.
@nateberkopec
nateberkopec merged commit 2a25c98 into main Oct 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant