Skip to content

runtime+prompt: content verbs read stdin OR arg; content travels in the program#23

Merged
vinodhalaharvi merged 1 commit into
mainfrom
claude/verbs-stdin-or-arg
May 25, 2026
Merged

runtime+prompt: content verbs read stdin OR arg; content travels in the program#23
vinodhalaharvi merged 1 commit into
mainfrom
claude/verbs-stdin-or-arg

Conversation

@vinodhalaharvi-claude
Copy link
Copy Markdown
Collaborator

The principle (your point about temporal portability)

On temporal a program runs on an arbitrary remote worker — it cannot read local files; only data passed in (stdin) and out (stdout) crosses that boundary. So a pipeline must carry its content as values, not reach into ambient local state (read "/tmp/x"). The same program must run unchanged on memory and temporal — read "localfile" violates that; stdin/arg content does not.

This makes the content verbs echo-like (stdin OR arg) so pasted content travels in the program.

The bug this fixes (seen live in Slack)

@loom in memory: summarize "..." returned 'no content was included' — because summarize was input-only: it ignored its arg and summarized empty upstream input.

Changes

runtime (internal/agentscript/runtime.go):

  • summarize: use piped input if present, else the arg; clear error if neither
  • analyze: no piped input → treat the arg as content (not just the focus)
  • (ask already did arg + optional stdin context — kept as the model)

prompt (pkg/script/translate.go):

  • New PASSING CONTENT section: put pasted text directly in the command's quoted arg; do not use a file path / read for pasted content — content travels in the argument so the program is portable across backends

Effect

@loom in memory: summarize <pasted text>memory static ( summarize "<pasted text>" ) → runs in-process on Claude Code → real summary. The identical program is valid on temporal later (content is a value, not a local file).

Verified

summarize "text" and stdin >=> summarize both reach the LLM with content (sandbox lacks the claude binary — proving the route). No local-state dependency.

Step Result
vet / gofmt / staticcheck
go test ./pkg/...
build

…he program

Backend portability principle: on temporal a program runs on an arbitrary
remote worker, so it cannot read local files — only the data passed in
(stdin) and out (stdout) crosses that boundary. A pipeline must therefore
carry its content as values, not reach into ambient local state. The same
program must run unchanged on memory and temporal.

This makes the content verbs echo-like (stdin OR arg) so pasted content
travels in the program:

runtime (internal/agentscript/runtime.go):
  - summarize: was input-ONLY — it ignored its arg, so summarize "text"
    summarized empty input (the bug seen live in Slack). Now: use piped
    input if present, else the arg; error clearly if neither.
  - analyze: if there's no piped input, treat the arg as the content
    (not only the focus), so analyze "text" works standalone.
  - (ask already did arg + optional stdin context — left as the model.)

prompt (pkg/script/translate.go):
  - New PASSING CONTENT section: put pasted text directly in the
    command's quoted argument; do NOT use a file path or read for pasted
    content — content travels in the argument so the program is portable
    across backends.

Effect: '@loom in memory: summarize <pasted text>' now translates to
memory static ( summarize "<pasted text>" ) and runs in-process on
Claude Code, returning a real summary — and the identical program is
valid on temporal later (content is a value, not a local file).

Verified: summarize "text" and (stdin >=> summarize) both reach the LLM
with content (sandbox lacks the claude binary, which is why they stop
there — proving the route). No file/local-state dependency.

CI: vet, gofmt, staticcheck, go test ./pkg/..., build pass.
@vinodhalaharvi vinodhalaharvi merged commit b6d3413 into main May 25, 2026
1 check 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.

2 participants