Skip to content

Render propose's --from literally in the preamble and drop the CLI's VORO_TASK_ID read#95

Merged
MJohnson459 merged 1 commit into
mainfrom
worktree-cli-drop-voro-task-id-env
Jul 23, 2026
Merged

Render propose's --from literally in the preamble and drop the CLI's VORO_TASK_ID read#95
MJohnson459 merged 1 commit into
mainfrom
worktree-cli-drop-voro-task-id-env

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

Render propose's --from literally in the dispatch preamble and remove the CLI's VORO_TASK_ID env read, so voro's own logic consults no environment.

Problem

A dispatched session runs with VORO_TASK_ID exported. The binary read it in one place — the propose --from default — so cargo test inside a dispatched session leaked the ambient id into the CLI tests: a scratch-db propose picked up VORO_TASK_ID as its discovered-from source and errored "task N not found". CI passed only because the var is unset there. It had bitten twice.

Change

  • dispatch.rs: the return-path preamble now renders the propose line with a literal --from {task_id} (matching ask/done), and the prose describes the rendered flag instead of an env fallback. Dropped DispatchCtx::session_task_id.
  • cli.rs: propose_verb takes no ambient source — discovered-from comes only from an explicit --from. run() reads no environment.
  • main.rs: removed the VORO_TASK_ID read.
  • Dispatch still exports VORO_TASK_ID (dispatch.rs:499) solely so the Claude Code shell hooks can expand it into explicit args; nothing in voro's logic reads it, making the test leak impossible by construction.
  • docs: DESIGN.md §8 and agent-integration.md describe the rendered --from; the operator-pasted snippet now passes --from "$VORO_TASK_ID" explicitly so it still links back.

Verification

  • cargo test --workspace, cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all --check — all green.
  • VORO_TASK_ID=999 cargo test --workspace — now passes (previously failed); confirmed the formerly-failing project_archive_hides_the_cockpit_views_and_unarchive_restores_them passes under it.
  • New integration test tests/propose_ignores_ambient_task_id.rs runs the built binary under VORO_TASK_ID=999: a bare propose links nothing, --from 1 still links. Preamble unit test asserts the literal --from {id} and no VORO_TASK_ID in the prompt.

Branch: worktree-cli-drop-voro-task-id-env. Not pushed (bg session).

A dispatched session runs with VORO_TASK_ID exported. The `voro` binary read
that variable in exactly one place — the `propose --from` default — so running
`cargo test` inside such a session leaked the ambient id into the CLI tests:
a scratch-db `propose` picked up VORO_TASK_ID as its discovered-from source and
errored "task N not found" instead of the expected outcome. Every other verb
already renders the task id literally rather than reading the environment.

Make propose match. The dispatch preamble now renders the propose line with a
literal `--from {task_id}`, exactly as it does for ask/done, so a mid-session
proposal links back to the running task with no environment dependency. The CLI
verb-dispatch path no longer threads any ambient session id: propose_verb's
discovered-from comes only from an explicit `--from`, DispatchCtx drops its
session_task_id field, and main.rs reads no VORO_TASK_ID. Dispatch still exports
the var so the Claude Code shell hooks can expand it into explicit args; nothing
in voro's own logic reads it, which makes the test leak impossible by
construction.

Docs: DESIGN.md §8 and agent-integration.md updated to describe the rendered
`--from` and the operator snippet's explicit `--from "$VORO_TASK_ID"`.

Verified: `cargo test --workspace`, `cargo clippy --workspace --all-targets -D
warnings`, and `cargo fmt --all --check` all green; `VORO_TASK_ID=999 cargo test
--workspace` now passes (previously failed). Adds an integration test that runs
the built binary under VORO_TASK_ID=999 and asserts a bare propose links nothing
while `--from` still links.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Av6BLDBjEGggMzk2MpWCEh
@MJohnson459
MJohnson459 merged commit 667a90f into main Jul 23, 2026
6 checks passed
@MJohnson459
MJohnson459 deleted the worktree-cli-drop-voro-task-id-env branch July 23, 2026 17:08
MJohnson459 added a commit that referenced this pull request Jul 26, 2026
main does not compile its test targets. #95 removed DispatchCtx's
session_task_id field; #93 was branched before that landed and added two
test-only DispatchCtx literals that still assign it. Each PR was green on
its own base, and because both sites are inside #[cfg(test)] modules
`cargo build --workspace` still passes — only `cargo test` and
`cargo clippy --all-targets` fail, so the breakage reached main unnoticed.

Delete the two assignments, matching the neighbouring literal in the same
test module that already omits the field. No behaviour change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146m6RCmCo8i64XpfXSqEJ4
MJohnson459 added a commit that referenced this pull request Jul 26, 2026
* Drop the stale session_task_id from two test DispatchCtx literals

main does not compile its test targets. #95 removed DispatchCtx's
session_task_id field; #93 was branched before that landed and added two
test-only DispatchCtx literals that still assign it. Each PR was green on
its own base, and because both sites are inside #[cfg(test)] modules
`cargo build --workspace` still passes — only `cargo test` and
`cargo clippy --all-targets` fail, so the breakage reached main unnoticed.

Delete the two assignments, matching the neighbouring literal in the same
test module that already omits the field. No behaviour change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146m6RCmCo8i64XpfXSqEJ4

* Render a markdown subset in TUI task bodies

Task bodies are written in markdown but the popup and detail pane rendered
them as plain text. Add a hand-rolled renderer (matching the editor.rs
no-dependency precedent) that styles a small subset: **bold**, `inline
code`, fenced code blocks, #-### headings, and -/* bullets.

The logic lives in one pure function, markdown::body_lines, isolated behind
a module boundary so a real parser could be swapped in later. Both render
sites in ui.rs call it in place of the previous lines().map(...). Anything
the renderer does not understand — including malformed markup like an
unclosed fence or an unmatched ** — degrades to literal text so content is
never dropped or mangled.

Presentation only: no voro-core, schema, or storage changes. Scroll
measurement in draw_detail keeps working since it operates on the styled
lines. Verified with cargo test/clippy and by eyeballing both surfaces
against a scratch DB (ANSI capture confirms bold/cyan/dim/bullet styling).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_0146m6RCmCo8i64XpfXSqEJ4

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
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