{"id":"@lssm-tech/lib.feature-flags","slug":"lib.feature-flags","name":"@lssm-tech/lib.feature-flags","version":"5.0.4","path":"packages/platform/delivery/feature-flags","manifestPath":"packages/platform/delivery/feature-flags/package.json","manifestBlobSha":"c3a28125c9128ee3313529f2eb025990636cfcf4","layer":"platform","physicalArea":"delivery","primaryArea":"governance-and-approvals","classification":{"privateDeclared":null,"catalogFamily":"sharedLibs","catalogKind":"library","catalogStatus":"active","adoptionMode":"adoptable","stability":"stable"},"description":"Feature flags and experiments module for ContractSpec applications","descriptionOrigin":"package.json","catalog":{"family":"sharedLibs","kind":"library","status":"active","adoptionMode":"adoptable","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./contracts","./docs","./docs/feature-flags.docblock","./entities","./evaluation","./events","./experiments","./feature-flags.capability","./feature-flags.feature","./ports","./resilient-client"],"documentation":[{"title":"Lib Feature Flags documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.feature-flags","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.lib.feature.flags","title":"Lib Feature Flags","description":"Feature flags and experiments module for ContractSpec applications","status":"active","useCases":["Adopt feature flags and experiments module for contractspec applications"],"aliases":["contractspec","feature-flags","experiments","toggles","typescript","lib","feature","flags"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/lib.feature-flags","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/contracts","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/docs","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/docs/feature-flags.docblock","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/entities","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/evaluation","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/events","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/experiments","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/feature-flags.capability","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/feature-flags.feature","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/ports","symbols":[]},{"from":"@lssm-tech/lib.feature-flags/resilient-client","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/lib.feature-flags package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/contracts","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/docs","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/docs/feature-flags.docblock","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/entities","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/evaluation","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/events","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/experiments","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/feature-flags.capability","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/feature-flags.feature","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/ports","symbols":[]},{"capabilityId":"package.lssm.tech.lib.feature.flags","from":"@lssm-tech/lib.feature-flags/resilient-client","symbols":[]}],"scripts":{"publish:pkg":"bun publish --tolerate-republish --ignore-scripts --verbose","publish:pkg:canary":"bun publish:pkg --tag canary","build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint":"bun lint:fix","lint:fix":"node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .","lint:check":"node ../../../../scripts/biome.cjs check .","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/lib.schema":"workspace:^","@lssm-tech/lib.contracts-spec-core":"workspace:^","@lssm-tech/lib.surface-runtime":"workspace:^","zod":"catalog:"},"devDependencies":{"@lssm-tech/tool.typescript":"workspace:*","typescript":"catalog:","@lssm-tech/tool.bun":"workspace:*"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./contracts":"./src/contracts/index.ts","./docs":"./src/docs/index.ts","./docs/feature-flags.docblock":"./src/docs/feature-flags.docblock.ts","./entities":"./src/entities/index.ts","./evaluation":"./src/evaluation/index.ts","./events":"./src/events.ts","./experiments":"./src/experiments.ts","./feature-flags.capability":"./src/feature-flags.capability.ts","./feature-flags.feature":"./src/feature-flags.feature.ts","./ports":"./src/ports.ts","./resilient-client":"./src/resilient-client.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","browser":"./dist/browser/index.js","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./contracts":{"types":"./dist/contracts/index.d.ts","browser":"./dist/browser/contracts/index.js","bun":"./dist/contracts/index.js","node":"./dist/node/contracts/index.js","default":"./dist/contracts/index.js"},"./docs":{"types":"./dist/docs/index.d.ts","browser":"./dist/browser/docs/index.js","bun":"./dist/docs/index.js","node":"./dist/node/docs/index.js","default":"./dist/docs/index.js"},"./docs/feature-flags.docblock":{"types":"./dist/docs/feature-flags.docblock.d.ts","browser":"./dist/browser/docs/feature-flags.docblock.js","bun":"./dist/docs/feature-flags.docblock.js","node":"./dist/node/docs/feature-flags.docblock.js","default":"./dist/docs/feature-flags.docblock.js"},"./entities":{"types":"./dist/entities/index.d.ts","browser":"./dist/browser/entities/index.js","bun":"./dist/entities/index.js","node":"./dist/node/entities/index.js","default":"./dist/entities/index.js"},"./evaluation":{"types":"./dist/evaluation/index.d.ts","browser":"./dist/browser/evaluation/index.js","bun":"./dist/evaluation/index.js","node":"./dist/node/evaluation/index.js","default":"./dist/evaluation/index.js"},"./events":{"types":"./dist/events.d.ts","browser":"./dist/browser/events.js","bun":"./dist/events.js","node":"./dist/node/events.js","default":"./dist/events.js"},"./experiments":{"types":"./dist/experiments.d.ts","browser":"./dist/browser/experiments.js","bun":"./dist/experiments.js","node":"./dist/node/experiments.js","default":"./dist/experiments.js"},"./feature-flags.capability":{"types":"./dist/feature-flags.capability.d.ts","browser":"./dist/browser/feature-flags.capability.js","bun":"./dist/feature-flags.capability.js","node":"./dist/node/feature-flags.capability.js","default":"./dist/feature-flags.capability.js"},"./feature-flags.feature":{"types":"./dist/feature-flags.feature.d.ts","browser":"./dist/browser/feature-flags.feature.js","bun":"./dist/feature-flags.feature.js","node":"./dist/node/feature-flags.feature.js","default":"./dist/feature-flags.feature.js"},"./ports":{"types":"./dist/ports.d.ts","browser":"./dist/browser/ports.js","bun":"./dist/ports.js","node":"./dist/node/ports.js","default":"./dist/ports.js"},"./resilient-client":{"types":"./dist/resilient-client.d.ts","browser":"./dist/browser/resilient-client.js","bun":"./dist/resilient-client.js","node":"./dist/node/resilient-client.js","default":"./dist/resilient-client.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/lib.feature-flags","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/platform/delivery/feature-flags/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts","importPath":"@lssm-tech/lib.feature-flags/contracts","target":"./src/contracts/index.ts","targets":[{"conditions":[],"target":"./src/contracts/index.ts","sourcePath":"packages/platform/delivery/feature-flags/src/contracts/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/contracts/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./docs","importPath":"@lssm-tech/lib.feature-flags/docs","target":"./src/docs/index.ts","targets":[{"conditions":[],"target":"./src/docs/index.ts","sourcePath":"packages/platform/delivery/feature-flags/src/docs/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/docs/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./docs/feature-flags.docblock","importPath":"@lssm-tech/lib.feature-flags/docs/feature-flags.docblock","target":"./src/docs/feature-flags.docblock.ts","targets":[{"conditions":[],"target":"./src/docs/feature-flags.docblock.ts","sourcePath":"packages/platform/delivery/feature-flags/src/docs/feature-flags.docblock.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/docs/feature-flags.docblock.ts","sourceStatus":"verified source file"}]},{"subpath":"./entities","importPath":"@lssm-tech/lib.feature-flags/entities","target":"./src/entities/index.ts","targets":[{"conditions":[],"target":"./src/entities/index.ts","sourcePath":"packages/platform/delivery/feature-flags/src/entities/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/entities/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./evaluation","importPath":"@lssm-tech/lib.feature-flags/evaluation","target":"./src/evaluation/index.ts","targets":[{"conditions":[],"target":"./src/evaluation/index.ts","sourcePath":"packages/platform/delivery/feature-flags/src/evaluation/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/evaluation/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./events","importPath":"@lssm-tech/lib.feature-flags/events","target":"./src/events.ts","targets":[{"conditions":[],"target":"./src/events.ts","sourcePath":"packages/platform/delivery/feature-flags/src/events.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/events.ts","sourceStatus":"verified source file"}]},{"subpath":"./experiments","importPath":"@lssm-tech/lib.feature-flags/experiments","target":"./src/experiments.ts","targets":[{"conditions":[],"target":"./src/experiments.ts","sourcePath":"packages/platform/delivery/feature-flags/src/experiments.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/experiments.ts","sourceStatus":"verified source file"}]},{"subpath":"./feature-flags.capability","importPath":"@lssm-tech/lib.feature-flags/feature-flags.capability","target":"./src/feature-flags.capability.ts","targets":[{"conditions":[],"target":"./src/feature-flags.capability.ts","sourcePath":"packages/platform/delivery/feature-flags/src/feature-flags.capability.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/feature-flags.capability.ts","sourceStatus":"verified source file"}]},{"subpath":"./feature-flags.feature","importPath":"@lssm-tech/lib.feature-flags/feature-flags.feature","target":"./src/feature-flags.feature.ts","targets":[{"conditions":[],"target":"./src/feature-flags.feature.ts","sourcePath":"packages/platform/delivery/feature-flags/src/feature-flags.feature.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/feature-flags.feature.ts","sourceStatus":"verified source file"}]},{"subpath":"./ports","importPath":"@lssm-tech/lib.feature-flags/ports","target":"./src/ports.ts","targets":[{"conditions":[],"target":"./src/ports.ts","sourcePath":"packages/platform/delivery/feature-flags/src/ports.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/ports.ts","sourceStatus":"verified source file"}]},{"subpath":"./resilient-client","importPath":"@lssm-tech/lib.feature-flags/resilient-client","target":"./src/resilient-client.ts","targets":[{"conditions":[],"target":"./src/resilient-client.ts","sourcePath":"packages/platform/delivery/feature-flags/src/resilient-client.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/src/resilient-client.ts","sourceStatus":"verified source file"}]}],"entryCount":12,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Lib Feature Flags documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.feature-flags","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.feature-flags.txt"},"readme":{"status":"available","body":"# @lssm-tech/lib.feature-flags\n\nWebsite: https://contractspec.io\n\n**Feature flags and experiments module for ContractSpec applications.**\n\n## What It Provides\n\n- **Layer**: lib.\n- **Consumers**: bundles, apps.\n- `src/contracts/` contains contract specs, operations, entities, and registry exports.\n- `src/docs/` contains docblocks and documentation-facing exports.\n- `src/contracts/` contains contract specs, operations, entities, and registry exports.\n- `src/docs/` contains docblocks and documentation-facing exports.\n\n## Installation\n\n`npm install @lssm-tech/lib.feature-flags`\n\nor\n\n`bun add @lssm-tech/lib.feature-flags`\n\n## Usage\n\nImport the root entrypoint from `@lssm-tech/lib.feature-flags`, or choose a documented subpath when you only need one part of the package surface.\n\nThe root entry point exports vendor-neutral `FeatureFlagPort` and\n`ExperimentPort` contracts. `ResilientFeatureFlagClient` provides deterministic\nprovider → cache → bootstrap → typed-default fallback and records exposures only\nwhen explicitly requested. Experiment allocation is deterministic and guardrail\nevaluation fails closed on missing observations.\n\nStructured provider and bootstrap values must be cycle-free, recursively plain\nJSON without dangerous prototype keys, and are validated against the typed\ndefault before use. Unknown-consent evaluation is fail-closed unless\nnon-personal use is explicitly enabled; even then, subject keys are\npseudonymized, targeting attributes require a normalized ASCII allowlist, and\nUnicode compatibility, separator, case, or camel variants of personal and\nsecret attribute names remain redacted.\n\nProvider capabilities declare registry scope independently. Railway Signals are\nproject- or workspace-scoped feature-flag registries (project scope writable,\nworkspace scope read-only); they are never modeled as environment variables.\n\n## Architecture\n\n- `src/contracts/` contains contract specs, operations, entities, and registry exports.\n- `src/docs/` contains docblocks and documentation-facing exports.\n- `src/entities/` contains domain entities and value objects.\n- `src/evaluation` is part of the package's public or composition surface.\n- `src/events.ts` is package-level event definitions.\n- `src/feature-flags.capability.ts` defines a capability surface.\n- `src/feature-flags.feature.ts` defines a feature entrypoint.\n\n## Public Entry Points\n\n- Export `.` resolves through `./src/index.ts`.\n- Export `./contracts` resolves through `./src/contracts/index.ts`.\n- Export `./docs` resolves through `./src/docs/index.ts`.\n- Export `./docs/feature-flags.docblock` resolves through `./src/docs/feature-flags.docblock.ts`.\n- Export `./entities` resolves through `./src/entities/index.ts`.\n- Export `./evaluation` resolves through `./src/evaluation/index.ts`.\n- Export `./events` resolves through `./src/events.ts`.\n- Export `./feature-flags.capability` resolves through `./src/feature-flags.capability.ts`.\n- Export `./feature-flags.feature` resolves through `./src/feature-flags.feature.ts`.\n\n## Local Commands\n\n- `bun run dev` — contractspec-bun-build dev\n- `bun run build` — contractspec-bun-build build\n- `bun run lint` — bun lint:fix\n- `bun run lint:check` — biome check .\n- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .\n- `bun run typecheck` — tsgo --noEmit\n- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose\n- `bun run publish:pkg:canary` — bun publish:pkg --tag canary\n- `bun run clean` — rimraf dist .turbo\n- `bun run build:bundle` — contractspec-bun-build transpile\n- `bun run build:types` — contractspec-bun-build types\n- `bun run prebuild` — contractspec-bun-build prebuild\n\n## Recent Updates\n\n- Replace eslint+prettier by biomejs to optimize speed.\n\n## Notes\n\n- Flag evaluation logic must be deterministic — same input always produces same output.\n- Capability and feature contracts are public API; changes are breaking.\n- Follow the PostHog naming conventions defined in workspace rules for new flag names.\n\n## Repository location and type configuration\n\nThe existing owner lives at `packages/platform/delivery/feature-flags`; its package\nname, twelve supported exports and implementation remain unchanged. The local\n`typecheck` script uses a source root that contains the package and its explicit\nContractsSpec/Schema source aliases. Canonical declaration builds use ToolBun's\nentry-derived `src` root, preserving the existing source-relative `dist` paths.\nClean producers, strict consumers and resulting-tree acceptance remain pending.\n","sourcePath":"packages/platform/delivery/feature-flags/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/feature-flags/README.md","blobSha":"2a13813536e0d8590641dd86d0eba54689995dfd","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"governance-and-approvals","areaTitle":"Governance, decisions and approvals","displayName":"lib.feature-flags","runtimes":["node"],"platforms":["server"],"kind":"library","scope":"Package manifest","canonicalRoute":"/docs/packages/lib.feature-flags/","contextUrl":"/docs/packages/lib.feature-flags.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}