OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Delete a feature flag.
Goal
Remove a feature flag and all its rules.
Context
Called when a flag is no longer needed.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
export const DeleteFlagContract = defineCommand({
meta: {
key: 'flag.delete',
version: '1.0.0',
stability: 'stable',
owners: ['platform.feature-flags'],
tags: ['feature-flags', 'delete'],
description: 'Delete a feature flag.',
goal: 'Remove a feature flag and all its rules.',
context: 'Called when a flag is no longer needed.',
},
io: {
input: DeleteFlagInput,
output: SuccessOutput,
errors: {
FLAG_NOT_FOUND: {
description: 'Flag does not exist',
http: 404,
gqlCode: 'FLAG_NOT_FOUND',
when: 'Flag ID is invalid',
},
FLAG_HAS_ACTIVE_EXPERIMENT: {
description: 'Flag has an active experiment',
http: 409,
gqlCode: 'FLAG_HAS_ACTIVE_EXPERIMENT',
when: 'Cannot delete flag with running experiment',
},
},
},
policy: {
auth: 'admin',
},
});