3.1 KiB
3.1 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-centralize-backend-bindings | Centralize backend flag bindings | completed | 1 | plan.md | ../../specs/platform/requirements/feature-toggles.md |
Task 01: Centralize backend flag bindings
- Acceptance: Each runtime flag's key, environment variable, config reader, and config applier are owned by one internal registry registration while the public metadata/API shape remains unchanged.
- Acceptance:
OptionsFromConfig,ValuesFromConfig, andApplyStatesToConfigcontain no per-feature map or switch, and Debug mode's implied environment behavior remains intact. - Acceptance: Generic tests fail when a
FeaturesConfigfield lacks a registry/profile binding or when its binding mutates the wrong field. - Verification: Red first with the completeness/round-trip test, then run
make -C apps/backend test; runmake -C apps/backend lintfrom the repo root. - Files likely touched:
apps/backend/internal/runtimeflags/registry.goapps/backend/internal/runtimeflags/config.goapps/backend/internal/runtimeflags/registry_test.goapps/backend/internal/runtimeflags/config_test.goapps/backend/internal/common/config/config_test.go
- Dependencies: None.
- Parallelism:
parallel-safewith Task 02 only; files are disjoint and there is no shared generated contract, schema, lockfile, or package config. - Inputs: Feature Toggles spec
What,Persistence guarantees, andScenarios; ADR-2026-08-01-release-toggle-gating-contract; existingruntimeflagsservice/handler/store tests. - Output contract: Report changed files, exact test command and counts,
blockers/risks, external side effects (
Noneexpected), then update this task andplan.mdstatuses/results in the same conversation.
Results
- Changed
apps/backend/internal/runtimeflags/registry.goto keep metadata, typed config readers, and typed config appliers in one internal registration. - Changed
apps/backend/internal/runtimeflags/config.goto iterate those registrations for environment values, runtime values, and persisted state. Debug implied-environment behavior remains in its named applier. - Added reflective registry/profile/config round-trip coverage and generic
FeaturesConfigJSON/tag coverage. - Review remediation made config, registry, and profile key comparison exact in both directions; validates registration metadata and binding isolation; and reserves graduated key/environment identities in an append-only tombstone set. The graduated plugins identity is the first tombstone.
- Review verification:
go test ./internal/runtimeflags ./internal/profilesfromapps/backendpassed (37 tests across 2 packages); the full backend suite passed, and backend lint reported 0 issues. - Verification:
go test ./internal/runtimeflags ./internal/common/config ./internal/profilesfromapps/backendpassed (91 tests across 3 packages),make -C apps/backend testpassed, andmake -C apps/backend lintpassed with 0 issues. - External side effects: none.