Skip to content

Feat/system unknown relay#107

Merged
josealekhine merged 2 commits into
mainfrom
feat/system-unknown-relay
May 30, 2026
Merged

Feat/system unknown relay#107
josealekhine merged 2 commits into
mainfrom
feat/system-unknown-relay

Conversation

@josealekhine
Copy link
Copy Markdown
Member

No description provided.

Spec for Phase CLI-FIX #5: make `ctx system <unknown>` emit a
verbatim-relay box to stdout and exit non-zero instead of dumping
~51 lines of help at exit 0 (which a UserPromptSubmit hook reads as
success and injects every prompt).

Settled with the user: fire the event-log + webhook relay leg
(nudge.Relay), gated on a real session ID read TTY-safely from
stdin; scoped to ctx system only, parent.Cmd untouched. Runtime
complement to the build-time wiring guard (specs/hooks-wiring-guard.md).

Spec: specs/system-unknown-subcommand-relay.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
`ctx system <unknown>` used to print the group's ~51-line Long help
and exit 0; a UserPromptSubmit hook reads exit 0 as success and
injects the whole blob every prompt (how a stale hooks.json wiring a
deleted command polluted sessions). Now it emits a verbatim NudgeBox
naming the verb + version-skew hint, best-effort records the relay
event (event log + webhook, gated on a session ID read TTY-safely
from stdin), suppresses cobra's help dump, and exits non-zero.

Scoped to ctx system only: a RunE on system.Cmd() (cobra routes an
unmatched non-root subcommand to the group's RunE); the shared
parent.Cmd is untouched, so other groups keep cobra's default. Bare
`ctx system` and valid subcommands are unchanged. Runtime complement
to the build-time wiring guard (specs/hooks-wiring-guard.md).

Handler in internal/cli/system/core/unknown; verified end-to-end
against a real build (box + exit 1). ctx hook generalization deferred
to a follow-up task.

Spec: specs/system-unknown-subcommand-relay.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
@josealekhine josealekhine self-assigned this May 30, 2026
@josealekhine josealekhine merged commit 9154ee7 into main May 30, 2026
16 checks passed
@josealekhine josealekhine deleted the feat/system-unknown-relay branch May 30, 2026 17:44
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