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

A tell carries the page it was told from: `from` on the tell action, the API and the MCP, shown on the issue #1527

opened this

Closed 48d 11h ago

A tell can now carry from, the page it was told from, and the issue it opens says "told from" with a link to that page. bun x tsc --noEmit is clean.

Notes

opened this

A tell can now carry from, the page it was told from, and the issue it opens says "told from" with a link to that page. bun x tsc --noEmit is clean. bun test passes: 227 tests across test/tell-from.test.ts, test/check-list.test.ts, test/mcp.test.ts, test/offline.test.ts, test/studio.test.ts and test/crew-direction.test.ts.

  • Validation: src/actions/tell.ts has a new fromPath(). It accepts a rooted path on this forge, up to 300 characters, and refuses everything else with the error invalid_from. That covers full URLs, //host, other schemes, backslashes, whitespace, quotes, angle brackets, backticks, brackets and parentheses. Empty or absent means no from. tell() takes from as an optional fifth argument and opens nothing if it is bad.
  • On the issue: the body gains told from /path as a markdown link. Because only plain path characters get through, there is nothing to escape or inject. The existing markdown renderer escapes it and makes the link, and a test checks the rendered issue page.
  • API: POST /api/v1/feed/tells accepts from and answers a bad one with a 422 and "from is a path on this forge, like /owner/app/issues/3, up to 300 characters". That is the JSON API tell endpoint in src/http/feed.ts; src/http/api.ts didn't need a change.
  • MCP: the tell tool takes from, in its input schema, and refuses a bad one with the same sentence.
  • Tests: test/tell-from.test.ts is new and is in GATE in scripts/gate.ts. It runs on its own temporary data directory and closes every tell it opens at the end, so it can't show up in the studio's Now panel.

Left out: the studio form, the home composer, share and the prompts don't pass from yet. That is the palette composer's part. There are also no dependencies added.

Closes #1463

2 earlier comments
commented

A tell now carries the page it was told from (from) on the tell action, the API and the MCP. This update fixes the check failure: the branch didn't merge into main because src/http/mcp.ts conflicted.

What changed: I merged origin/main into the branch and resolved the conflict in the MCP tell tool. main had meanwhile added a context argument to the same tool. I kept both:

  • from is checked by fromPath and returns invalid_from if it isn't a path on this forge.
  • context is parsed by parseContext and appended to the text by contextNote, as on main.
  • from is passed to tell as its last argument.

Checks run: tsc --noEmit is clean, and the MCP and tell tests pass (25 tests). I didn't run the full check; the forge does that on this push.

Left out: from and context stay separate fields rather than being merged into one.

To try it: call the MCP tell tool with from: "/owner/app/issues/3". The resulting issue should say "told from" and link that page.

commented

A tell now carries its page from the studio and the feed as well as from the API and MCP. The type check is clean, and the five test files I ran pass. I didn't run the full suite; the forge's check does that on push.

  • Interactions route: I deleted the stray fromPath check from POST /api/v1/feed/interactions. The route behaves as it did on main, so a stray from there no longer gets a 422.
  • Page sends from:
    • The feed card's offline tell and the composer's offline tell now queue from: location.pathname + location.search.
    • The form posts (card, composer and the app page's tell box) carry a hidden from, so they record a page without JavaScript. The card and composer fill it with /, the feed's own path. The app page fills it with its own path.
    • tellFrom in src/web/studio/actions.ts validates it with fromPath and passes it to tell. A bad value is dropped and the tell still goes through, because a person typing into a form shouldn't lose their tell over a bad page value. The API and MCP still return 422 invalid_from.
    • A new test in test/tell-from.test.ts posts the studio form twice. A good from produces "told from …" on the issue, and a bad one produces an issue with no page.
  • Terminal: the terminal UI (src/tui) never calls tell, so it names no page. There is no src/tty.ts in this repo. The README says the terminal names no page, and it now documents from on the API and MCP tell.
  • MCP schema: maxLength now uses FROM_MAX.

Left out: pages other than the feed and the app page, such as the run page's steer form, don't send from. A steer isn't a tell. The feed card's no-JS form says "told from /" because the card doesn't know which page it's on.

Try it: open the preview feed, tell an app from a card, then open the new issue. It ends with "told from /".

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("the board's forge strip > an admin reads All fine; a stuck run becomes a linked sentence; a non-admin sees nothing") and the decider saw no point in another try

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs