Skip to content

feat(shell): add --exec flag; fix broken firmware-ping just recipe#62

Merged
tarotene merged 2 commits into
mainfrom
feat/shell-exec-and-firmware-ping-fix
May 24, 2026
Merged

feat(shell): add --exec flag; fix broken firmware-ping just recipe#62
tarotene merged 2 commits into
mainfrom
feat/shell-exec-and-firmware-ping-fix

Conversation

@tarotene

Copy link
Copy Markdown
Owner

Summary

  • just firmware-ping was calling cargo run -- ping which fails immediately — ping was removed as a CLI subcommand in feat(shell): discovery-driven REPL + RTT ch0 log redirection #51 when the shell became a discovery-driven REPL. Nobody noticed because the recipe was never used by CI.
  • Adds --exec <COMMAND> flag to telepath-shell for non-interactive single-command execution, enabling scripting from just.
  • Rewires firmware-ping to use --exec ping with a grep -qF "ping -> 0xDEADBEEF" assertion so wire-format skew between FW and host now fails loudly.
  • Updates AGENTS.md to document that just firmware-ping SHOULD be run on PRs touching wire / macros / server / client / shell / nrf52840-ping, since just ci cannot detect this class of breakage without hardware.

Test plan

  • just firmware-ping against connected nRF52840-DK — passes, outputs ping -> 0xDEADBEEF
  • cargo run -- --help shows --exec <COMMAND> in the options list
  • cargo run (no args) still opens the interactive REPL as before
  • cargo build + cargo clippy -- -D warnings + cargo fmt -- --check all green

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 24, 2026 06:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores just firmware-ping as an end-to-end hardware smoke test by adding a non-interactive --exec <COMMAND> mode to telepath-shell, and documents when contributors should run that hardware check to catch FW/host wire-format skew.

Changes:

  • Add --exec <COMMAND> to telepath-shell to run a single discovered command and exit.
  • Update just firmware-ping to use --exec ping and assert the 0xDEADBEEF sentinel.
  • Document in AGENTS.md when just firmware-ping should be run on PRs that may affect the wire interface.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tools/telepath-shell/src/main.rs Adds --exec CLI flag and non-interactive dispatch path.
Justfile Fixes firmware-ping recipe to run ping via --exec and assert expected output.
AGENTS.md Documents when hardware smoke testing via just firmware-ping is expected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/telepath-shell/src/main.rs Outdated
Comment thread tools/telepath-shell/src/main.rs Outdated
Comment thread Justfile Outdated
tarotene and others added 2 commits May 24, 2026 16:40
`just firmware-ping` was invoking `cargo run -- ping` which fails
immediately because `ping` was removed as a CLI subcommand in #51
(the shell became a discovery-driven REPL).  This PR fixes that by
adding `--exec <COMMAND>` to telepath-shell for non-interactive
single-command execution, and rewiring firmware-ping to use it with
a sentinel grep so wire-format skew fails loudly.

AGENTS.md is updated to prompt the developer to run `just firmware-ping`
on PRs touching wire / macros / server / client / shell / nrf52840-ping.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…firmware-ping

- --exec changed from Option<String> to Vec<String> with num_args=1.. so
  multi-token commands like --exec add 1 2 no longer require shell quoting.
- --exec help [CMD] now routes through print_help / print_command_help
  matching REPL behaviour; empty commands bail with a clear error message.
- firmware-ping recipe replaces the fixed /tmp path with a single pipeline
  tee /dev/stderr | grep -qF — no on-disk state remains after the run.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tarotene
tarotene force-pushed the feat/shell-exec-and-firmware-ping-fix branch from 69e23eb to 7ee4a67 Compare May 24, 2026 07:41
@tarotene
tarotene merged commit 99f6af8 into main May 24, 2026
2 checks passed
@tarotene
tarotene deleted the feat/shell-exec-and-firmware-ping-fix branch May 24, 2026 07:43
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