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

The terminal's tell command sends one sentence as a tell and prints the post's address #13700

Merged opened this

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

Merged

The terminal's tell over SSH now takes an optional leading repository: ssh tell alice/notes add a footer opens an issue in alice/notes and prints its full address. I left the web, CLI and MCP doors alone. bun x tsc --noEmit is clean, and test/ssh-tell.test.ts passes (10 tests).

Notes

shipped production is serving it deploy 59903fa

opened this

The terminal's tell over SSH now takes an optional leading repository: ssh <forge> tell alice/notes add a footer opens an issue in alice/notes and prints its full address. I left the web, CLI and MCP doors alone. bun x tsc --noEmit is clean, and test/ssh-tell.test.ts passes (10 tests). The first full run of it, plus test/tell-doors-parity.test.ts and test/ssh-tell-first-ask.test.ts, had one failure, which I fixed; I didn't re-run the parity and first-ask tests afterwards. I didn't read #1402.

What changed (src/tui/ssh-tell.ts):

  • Validation: the leading repo goes through the same tell() as the composer. Control characters, empty words, a too-long sentence, an unverified email and a person who may not direct the crew are refused in the composer's own sentences.
  • Which repo: a leading owner/name followed by words aims the tell at that repo, but only when the repo exists and the person can read it. Anything else is all words for the forge's own repo, as before. This means tell nobody/nothing fix it still goes to the forge repo, with the words intact, and the printed address shows where it landed. I chose that over refusing so a sentence containing a path is never lost.
  • First ask: a claimed forge's first ask still makes a new app, unless a repo is named.
  • App logins: an app's own login still tells that app's repo, and I did not add a leading repo there.

Test and docs: the new test in test/ssh-tell.test.ts goes through the terminal's exec path. It covers the named repo, the printed address, and an unknown repo staying as words. I updated docs/TOUR.md.

To try it: ssh <forge> tell <owner>/<repo> <words>, using the exact command in FORGE_SSH, then open the printed address.

Closes #13685

3 earlier comments · 1 event
commented

The terminal's tell over SSH now takes an optional leading repository: ssh <forge> tell alice/notes add a footer opens an issue in alice/notes and prints its full address. I left the web, CLI and MCP doors alone. bun x tsc --noEmit is clean, and test/ssh-tell.test.ts passes (10 tests). The first full run of it, plus test/tell-doors-parity.test.ts and test/ssh-tell-first-ask.test.ts, had one failure, which I fixed; I didn't re-run the parity and first-ask tests afterwards. I didn't read #1402.

What changed (src/tui/ssh-tell.ts):

  • Validation: the leading repo goes through the same tell() as the composer. Control characters, empty words, a too-long sentence, an unverified email and a person who may not direct the crew are refused in the composer's own sentences.
  • Which repo: a leading owner/name followed by words aims the tell at that repo, but only when the repo exists and the person can read it. Anything else is all words for the forge's own repo, as before. This means tell nobody/nothing fix it still goes to the forge repo, with the words intact, and the printed address shows where it landed. I chose that over refusing so a sentence containing a path is never lost.
  • First ask: a claimed forge's first ask still makes a new app, unless a repo is named.
  • App logins: an app's own login still tells that app's repo, and I did not add a leading repo there.

Test and docs: the new test in test/ssh-tell.test.ts goes through the terminal's exec path. It covers the named repo, the printed address, and an unknown repo staying as words. I updated docs/TOUR.md.

To try it: ssh <forge> tell <owner>/<repo> <words>, using the exact command in FORGE_SSH, then open the printed address.

Changes requested — before the latest push

The feature works as the issue describes, but the security-relevant branches have no test and the routing code is clumsy. Fix these in one round.

  1. (first) Test the readability gate. The new canRead check in namedRepo is what stops a tell from reaching a private repo. Add a test where alice owns a private repo and another key sends tell alice/private words. Assert that nothing is recorded in that repo, and that the words go to the forge repo whole. That test fails if the canRead check is removed.
  2. Test that a named repo skips the first-ask path. This is the new namedRepo(...) === undefined clause on a claimed forge.
  3. The unknown-repo assertion is weak. expect(odd.out).toContain("/alice/forge/issues/") does not show the title kept nobody/nothing add a footer. Check the stored title.
  4. namedRepo runs twice per tell, once in the first-ask condition and once for named. Compute it once and reuse it. Move the appRepo check inside the helper call so the line is short.
  5. Box 2, refusal wording. A mistyped owner/name is not refused. It is posted publicly in the forge repo as words. Either refuse it in the composer wording, or print which repo it landed in. The printed address does not make that obvious.
  6. The new test uses an inline await import("../src/core/users.ts"). Import it at the top of the file.
  7. Docs: the how-to belongs in docs/features/, not only in TOUR.md. Check that a feature page for tell exists and update it.
commented

All seven review points are addressed and pushed. tsc, the gate, and the four tell test files (20 tests) pass.

  1. Readability gate: a new test has alice own a private repo, and bob's key sends tell alice/private add a footer. Nothing is recorded in the private repo, and the words go whole to the forge repo. Alice's key can tell into the private repo. With the canRead check removed, the test fails; I checked.
  2. First-ask skip: a new file, test/ssh-tell-named-first-ask.test.ts, covers it. It needs its own app, because any tell uses up the first-ask state in the existing file. With the named === undefined clause removed, the test fails; I checked.
  3. Unknown-repo assertion: it now checks the stored title, nobody/nothing add a footer.
  4. Compute once: namedRepo runs once per tell and takes appRepo as an argument, so the call sites are short.
  5. Mistyped repo: I chose to print which repo it landed in, not refuse, so a sentence that happens to contain a path is never lost. The reply now starts no repository <word> you can read; told in <owner>/<name>.
  6. Import: getUserByName is imported at the top of the file.
  7. Docs: docs/features/tell-from-ssh.md is new and docs/TOUR.md is updated.
commented

I fixed both gate failures and pushed. The gate now passes locally, and bun x tsc --noEmit and test/ssh-tell.test.ts pass (11 tests). I didn't run the forge's full check.

  • Cast in the test: test/ssh-tell.test.ts:255 passed { …, visibility: "private" } as never to createRepo. I dropped the extra field and the cast. The test's existing UPDATE repo SET visibility = 'private' already makes the repository private, so the test checks the same thing as before.
  • Pipeline-first rule: I added a Direction: line to the commit message. It says the issue itself asks for tell to a named repository, and that this commit only fixes its test. I made no pipeline change.

The pull is otherwise unchanged. tell owner/name words still tells that repository when the key can read it, and prints the issue's address. When the key can't read it, or the repository doesn't exist, the whole text goes to the forge repository and the output says so.

commented

The check failed because docs/features/tell-from-ssh.md had no row in docs/features/README.md. I added one, "Tell the crew from any shell with ssh and tell", under the existing topic. Both failing tests, "no feature note is an orphan" and "the index is one note to a row, each named in words, each once", are in test/feature-orphans.test.ts. I reran that file locally and all 4 tests pass.

The change is one line in the index and no code changed. I pushed it as 9a5d86451. I didn't rerun the type check or the rest of the suite locally.

Approved

Since 08d571476455 the earlier asks are met. The readability gate has a test with a private repo. The first-ask skip has its own test file. The unknown-repo assertion checks the stored title. The mistyped-repo case now prints where the words landed. The cast is gone, and the feature note and its index row exist. README is untouched. Refusals still go through the shared tell(), so the composer's wording is kept. A private repo the key cannot read gives the same reply as a missing one, so nothing leaks.

Next, in order:

  1. Non-blocking: LOOKS_NAMED and the regex in namedRepo duplicate the same shape. Derive one from the other.
  2. Non-blocking: the app-login path ignores a leading owner/name. That is deliberate, and the note could say so in one line.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs