chore(policy): ungate guardrail policy form#1552
Conversation
The guardrail form path (--target, --form-category, --form-filters, --form-effect, --form-data-path CLI options and the interactive "form" source method) was hidden behind ENABLE_GATED_FEATURES. Remove that gating so the feature is generally available: options show in --help, the runtime "not yet available" guard is dropped, and the interactive option is no longer disabled with "Coming soon". Drops the now-unused isGatedFeaturesEnabled and Option imports. Confidence: high Scope-risk: narrow
|
Claude Security Review: no high-confidence findings. (run) |
Package TarballHow to installgh release download pr-1552-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.19.0.tgz |
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Reviewed the diff against origin/main. The change is small and surgical: it removes the gate() helper and the runtime formCategory guard in PolicyPrimitive.ts, and drops the gated/"Coming soon" branch in AddPolicyScreen.tsx. The form-path code itself (synth, validation, mutual-exclusion check, telemetry policy_attr_source_type: 'form') was already in place behind the flag and is unchanged.
No functional issues found:
- Other call sites of
isGatedFeaturesEnabled(harness, knowledge-base, gateway-target, config-bundle, etc.) are correctly left untouched. - Telemetry coverage for the form path already exists (no new instrumentation needed).
- No test changes required — the existing tests don't reference the removed gating, and
synthesize-cedar.test.tsalready covers the synthesis logic. - No leftover "Coming soon" / "not yet available" references for the policy form path.
LGTM 🚀
Coverage Report
|
The dev-server integ test only recorded projectPath when create exited 0 and silently left it undefined otherwise. A transient create failure in CI then surfaced as the unhelpful "expected undefined to be truthy" in every test, hiding the real cause. Throw with the captured stderr/stdout instead, matching the createTestProject factory's behavior, so a genuine failure is actionable and a flaky one is visible. Constraint: dev-server suite needs a real installed project (skipInstall: false), so it cannot use the factory's fast default Confidence: high Scope-risk: narrow Not-tested: the specific transient create failure seen in CI (not reproducible locally)
| projectPath = json.projectPath; | ||
| if (result.exitCode !== 0) { | ||
| throw new Error(`Project creation failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`); | ||
| } |
There was a problem hiding this comment.
nit: Is this change intentionally included?
The refactor makes sense to throw early, but seems unrelated?
|
LGTM once CI passes. |
|
Claude Security Review: the review did not analyze this PR (model took 0 turns). See the run for details; a later push or re-run is needed. |
Summary
Removes the
ENABLE_GATED_FEATURESgate on the guardrail policy form so it's generally available.Previously gated behind
isGatedFeaturesEnabled():agentcore add policy):--target,--form-category,--form-filters,--form-effect,--form-data-path— hidden from--helpwhen the flag was off--form-categorythrewGuardrail policy form is not yet available.formsource method was disabled with a "Coming soon" labelChanges
PolicyPrimitive.ts: drop thegate()helper and the runtimenot yet availableguard; the form options are now plain.option()calls. Removed now-unusedisGatedFeaturesEnabledandOptionimports.AddPolicyScreen.tsx: theformoption is no longer disabled/gated. Removed now-unusedisGatedFeaturesEnabledimport.Scope is limited to the guardrail form path — the
isGatedFeaturesEnabledflag itself and its other call sites (harness, knowledge-base, gateway-target, config-bundle, etc.) are untouched.Testing
npm run typecheckpasses.