diff --git a/integ-tests/dev-server.test.ts b/integ-tests/dev-server.test.ts index 0a7fea149..ee9a694da 100644 --- a/integ-tests/dev-server.test.ts +++ b/integ-tests/dev-server.test.ts @@ -65,10 +65,12 @@ describe('integration: dev server', () => { { skipInstall: false } ); - if (result.exitCode === 0) { - const json = JSON.parse(result.stdout); - projectPath = json.projectPath; + if (result.exitCode !== 0) { + throw new Error(`Project creation failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`); } + + const json = JSON.parse(result.stdout); + projectPath = json.projectPath; }, 120000); afterEach(() => { diff --git a/src/cli/primitives/PolicyPrimitive.ts b/src/cli/primitives/PolicyPrimitive.ts index f28bf2d7c..950416ef8 100644 --- a/src/cli/primitives/PolicyPrimitive.ts +++ b/src/cli/primitives/PolicyPrimitive.ts @@ -5,7 +5,6 @@ import { EnforcementModeSchema, PolicySchema, ValidationModeSchema } from '../.. import { detectRegion } from '../aws'; import { getPolicyGeneration, startPolicyGeneration } from '../aws/policy-generation'; import { getErrorMessage } from '../errors'; -import { isGatedFeaturesEnabled } from '../feature-flags'; import type { RemovalPreview, SchemaChange } from '../operations/remove/types'; import { runCliCommand, withCommandRunTelemetry } from '../telemetry/cli-command-run.js'; import { PolicyValidationMode, standardize } from '../telemetry/schemas/common-shapes.js'; @@ -14,7 +13,6 @@ import { type PolicyEffect, authorizationPhaseForEffect, defaultDataPathForEffec import { BasePrimitive } from './BasePrimitive'; import { SOURCE_CODE_NOTE } from './constants'; import type { AddResult, AddScreenComponent, RemovableResource } from './types'; -import { Option } from '@commander-js/extra-typings'; import type { Command } from '@commander-js/extra-typings'; import { existsSync, readFileSync } from 'fs'; @@ -287,9 +285,6 @@ export class PolicyPrimitive extends BasePrimitive(option: T): T => (isGatedFeaturesEnabled() ? option : option.hideHelp()); - addCmd .command('policy') .description('Add a policy to a policy engine') @@ -300,34 +295,19 @@ export class PolicyPrimitive extends BasePrimitive', 'Policy statement [non-interactive]') .option('-g, --generate ', 'Generate policy from natural language description [non-interactive]') .option('--gateway ', 'Deployed gateway name for policy generation [non-interactive]') - // Guardrail form flags are gated behind ENABLE_GATED_FEATURES: hidden from help when off. - .addOption(gate(new Option('--target ', 'Gateway target name for Cedar action scope [non-interactive]'))) - .addOption( - gate( - new Option( - '--form-category ', - 'Guardrail category: contentFilter, promptAttack, or sensitiveInformation [non-interactive]' - ) - ) - ) - .addOption( - gate(new Option('--form-filters ', 'Comma-separated filters for the chosen category [non-interactive]')) + .option('--target ', 'Gateway target name for Cedar action scope [non-interactive]') + .option( + '--form-category ', + 'Guardrail category: contentFilter, promptAttack, or sensitiveInformation [non-interactive]' ) - .addOption( - gate( - new Option( - '--form-effect ', - 'Policy effect: forbid, permit, or suppressOutput (default: forbid) [non-interactive]' - ) - ) + .option('--form-filters ', 'Comma-separated filters for the chosen category [non-interactive]') + .option( + '--form-effect ', + 'Policy effect: forbid, permit, or suppressOutput (default: forbid) [non-interactive]' ) - .addOption( - gate( - new Option( - '--form-data-path ', - 'Data path to evaluate, e.g. context.input.prompt (default: context.input.prompt) [non-interactive]' - ) - ) + .option( + '--form-data-path ', + 'Data path to evaluate, e.g. context.input.prompt (default: context.input.prompt) [non-interactive]' ) .option( '--validation-mode ', @@ -378,11 +358,6 @@ export class PolicyPrimitive extends BasePrimitive POLICY_SOURCE_METHOD_OPTIONS.map(opt => { const isGenerate = opt.id === 'generate'; - // Guardrail form is gated behind ENABLE_GATED_FEATURES. - const gated = opt.id === 'form' && !isGatedFeaturesEnabled(); - const disabled = gated || (isGenerate && !isEngineDeployed); + const disabled = isGenerate && !isEngineDeployed; return { id: opt.id, title: opt.title, - description: gated ? 'Coming soon' : disabled ? 'Deploy engine first' : opt.description, + description: disabled ? 'Deploy engine first' : opt.description, disabled, }; }),