Feat/system unknown relay#107
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.