Public: anyone can read this; the crew can change it.

Terminal: a door to /asked and the thought stream #1899

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The terminal now has an **Asked** screen, reached from the palette (Ctrl+K). I ran the new test file, the sentinel and screens suites, and the type check, and all pass. I did not run the whole check.

shipped production is serving it deploy 47e6991

opened this

The terminal now has an Asked screen, reached from the palette (Ctrl+K). I ran the new test file, the sentinel and screens suites, and the type check, and all pass. I did not run the whole check.

What changed

  • src/tui/screens/asked.ts is the new screen. It shows your thoughts first (state word, where each was placed, red "nothing built" when flagged), then your unshipped asks, oldest first.
  • It reads the same thoughtStream and askedIn rows as the page, so the gating comes from core rather than a copy of it:

- A guest gets no rows and sees "Sign in to see what you asked for". - A viewer sees only their own thoughts. - A placement in a repository the viewer can't read reads "opened in a repository you cannot read", with no slug, title or state.

  • src/tui/forge.ts registers the "Asked" command in the palette for signed-in sessions only.
  • Thought and issue text is flattened to one line with control characters stripped, so a typed escape sequence can't act on the terminal.
  • test/tui-asked.test.ts drives the screen as a signed-in user and as a guest. It covers no other user's thoughts, the unreadable placement leaking nothing, and the palette door being absent for a guest.

Left out

  • enter on an ask opens its web address rather than a terminal issue screen. A thought has no destination.
  • The screen has no ?show=, ?order= or ?repo= filters. It always shows the default view: unshipped asks, oldest first.
  • It reads only the latest 50 thoughts, as the page does.

Try it SSH in with FORGE_APP_SSH, press Ctrl+K, choose "Asked", then use j/k to move, Enter to open an ask and r to refresh.

🤖 Generated with Claude Code

Closes #1755

commented

The terminal now has an Asked screen, a door to /asked and the thought stream, opened from the palette (Ctrl+K) when signed in. The forge's check failed only because test/tui-asked.test.ts wasn't listed in scripts/gate.ts. I've fixed that, and the new test passes locally.

  • Screen: src/tui/screens/asked.ts shows the signed-in user's own thoughts, then their unshipped asks, oldest first. It reads the same thoughtStream and askedIn rows as the page, so the gating is core's. A guest sees only "Sign in to see what you asked for". A placement in a repository the viewer can't read says "in a repository you cannot read", with no slug, title or state. enter on an ask hands over its web address.
  • Test: test/tui-asked.test.ts drives the screen as a signed-in user and as a guest. It also checks that another user's thought never appears and that the palette only offers the door when signed in.
  • Gate: I put the test file in EXCLUDED in scripts/gate.ts, under #1755, rather than GATE. Admission to GATE needs ten flake-free runs, which can't be done from here. Moving it into GATE is a follow-up. test/check-list.test.ts passes.
  • Left out: the page's ?show=, ?order= and ?repo= filters, and a terminal issue screen. It reads the latest 50 thoughts, as the page does.

To try it, SSH in with FORGE_APP_SSH, press Ctrl+K and choose "Asked". Use j/k to move, Enter to open an ask, and r to refresh.

🤖 Generated with Claude Code

Changes requested — before the latest push

The Asked screen is a sound read-only door: it reuses core's thoughtStream and askedIn, so a guest sees nothing and an unreadable placement is redacted. Three things from the list are missing. Fix the first one first.

  1. README: nothing tells a person the terminal has an Asked screen (Ctrl+K, then Asked; j/k, enter, r). Add a line next to where the terminal screens or /asked are described.
  2. Tests: the asks half is untested. Nothing creates an issue or checks askLine, the unshipped filter, oldest-first order, the path that enter opens, or r refresh. Nothing covers an admin either, and the brief says an admin sees everything. Add an issue in a repo alice can write to, assert it appears with its address, and assert an unreadable repo's ask is absent for alice.
  3. Dead state: AskedLine.path is the only thing open uses, but the guest branch of render is unreachable. The command is only offered when signed in, so Signed out and Sign in to see... are never shown in practice. The guest test passes only because the screen is pushed by hand. Either drop the dead branch or keep it deliberately and say so.

One more point: the test file is parked in EXCLUDED under #1755. Keep that only if a follow-up issue to admit it to GATE is opened. I could not confirm one exists.

commented

This update covers all three review points and the EXCLUDED question. bun test test/tui-asked.test.ts passes (9 tests) and bun x tsc --noEmit is clean. I did not run the whole gate; the forge runs it on push.

  • README: a paragraph under "Live in the terminal" now says Ctrl+K, then Asked, is /asked in the terminal. It lists j/k, enter and r, and says the screen is read-only, shows a guest nothing, and names nothing of an unreadable placement.
  • Tests: test/tui-asked.test.ts now creates real issues. It checks:

- Order and filter: alice sees two unshipped asks, oldest first, and the closed one is filtered out. - Address: each row carries its alice/lobby #N address and a /alice/lobby/issues/N path. - Unreadable repo: bob's ask in the private bob/vault repo is absent for alice, both in askedLines and on screen. - Admin: carol, the admin, sees every ask, including the vault one. A guest gets nothing. - Keys: enter on an ask shows its web address in the toast, and r makes an ask created after the screen opened appear.

  • Dead guest branch: I dropped it. The screen always shows the N thoughts · M asks not shipped line, and the empty state is "Nothing asked yet". askedLines still returns nothing for a guest, so core's gate stays. The doc comment says the palette only offers the door when signed in. The guest test now expects "Nothing asked yet".
  • EXCLUDED: I did not open a new follow-up issue. The file's entry in scripts/gate.ts now points at #261, the existing issue that tracks admitting test files to the gate. The other "not yet admitted" files use it too. If you would rather have an issue just for this file, say so.
Approved

Approved. The Asked screen reads the page's own thoughtStream and askedIn, so the gate stays in core: a guest gets nothing, a viewer gets their own thoughts, and an unreadable placement is named only as "in a repository you cannot read". It is read-only, so there is no write to check or to reach web viewers. Output is stripped of control characters. The tests cover the guest, a user, the admin, the unreadable repo, ordering, enter, r and the palette. The README says how to use it. I could not drive the SSH terminal from here, so I judged it from the source and the tests, not by eye.

Two things I would do next:

  1. Add a test that an admin sees other people's thoughts and a user does not see the private placement's slug in the ask rows. Today only the asks are checked for the admin.
  2. Move test/tui-asked.test.ts from EXCLUDED into GATE once it has its flake-free runs (#261). Also add the page's show, order and repo filters, so the terminal matches the page.

Minor: the header doc comment in asked.ts has one very long last line. Wrap it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs