fix(tui): gate imperative mutations and execution screens - #2403
Closed
aidandaly24 wants to merge 9 commits into
Closed
aidandaly24 wants to merge 9 commits into
aidandaly24 wants to merge 9 commits into
Conversation
3 tasks
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice piece of defense-in-depth. The CommandGate sits above the imperative screens so an unavailable command can't mount its screen and fire off get*/list*/invoke* before Root has a chance to redirect. A few things I verified while reviewing:
resolveCommandwalking down from the root and comparing againstcommandPath(command).join("/")correctly returnsfalsewhen any ancestor group (e.g.runtime) is pruned byimperative-commands, soisCommandAvailableis sound both for the gate and for the action filters inharness/get,runtime/get, andruntime/endpoint/get.- The
isProjectInvokecarve-out is scoped tightly (3-segment path, child location,harness|runtime, launcher rooted atagentcore/invoke/<family>), so a project-invoke launch cannot smuggle access intoharness/exec/:id,runtime/shell/:id,harness/update/:id, etc. The new tests inCommandGate.test.tsxcover that surface (including the negative cases across siblings/verbs). GatewayCreateScreen's addedgateway.name() === "gateway"guard prevents the CLI-help fallback from firing whenresolveCommandtruncates to theagentcoreroot — theProjectResourceCreateScreenguidance is what shows instead, and it does no I/O.- Read-only siblings (harness/runtime/gateway/memory
get/list/version/endpoint) intentionally remain ungated, and there's explicit coverage that they still hit Core with the parent group off. - Runtime create / memory create / gateway create routes don't need a gate because their route elements are informational-only (
ProjectResourceCreateScreen/ gateway-create branch), which the tests confirm.
No blockers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2403 +/- ##
=========================================
Coverage 97.25% 97.25%
=========================================
Files 612 613 +1
Lines 41019 41032 +13
=========================================
+ Hits 39893 39906 +13
Misses 1126 1126 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
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.
Description
Prevent standalone mutation and execution screens from bypassing
imperative-commandsthrough project status or nested TUI navigation. The TUI now checks registered commands before mounting those screens and hides unavailable actions, restoring them when enabled. Project invocation and read-only inspection remain available, but project chat cannot switch into exec mode or select an account-wide Runtime while the flag is off.Related Issue
Refs #2400. Follow-up to #2396; separate from #2401 and #2402.
Documentation PR
Not applicable: this makes the existing internal feature gate consistent across CLI and TUI entry points.
Type of Change
Testing
3,614 tests passed with 98.00% line coverage. Focused regressions cover disabled routes, action visibility, project CLI-to-TUI invocation, shell handoff, and project Runtime target switching. Existing menu/help tests and resource fixtures are reused instead of duplicated.
Test-process-only fault injection confirmed the retained tests fail when route gating, the exec toggle guard, or Runtime target restrictions are bypassed. Production code is unchanged by this test consolidation.
The built Node CLI was also checked with the TUI harness against an existing deployed project: Harness and Runtime execution actions disappear with the flag off and return with it on; read-only navigation and Escape back to status remain functional. This live check was read-only.
bun testbun run test:e2e, or explained why they are not applicablebun run typecheckbun run lint:checkbun run format:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed themAWS deployment E2E tests are not applicable: no deployment logic or SDK request semantics changed. Execution gates were tested through the real CLI/Root with injected Core clients. No assets changed.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.