Skip to content

refactor(flags): inject the registry into notification-actions and attention readers (slice 3) - #1713

Open
tstapler wants to merge 3 commits into
mainfrom
refactor/flags-stage2-slice3
Open

tstapler wants to merge 3 commits into
mainfrom
refactor/flags-stage2-slice3

Conversation

@tstapler

Copy link
Copy Markdown
Owner

Slice 3 of project_plans/package-split-ocp/flags-stage2-plan.md (slices 1 #1709, 2 #1711 merged). No behaviour change.

  • flagReader{reg} replaces the free functions that read featureflags.Current() through FeatureFlagDefault (effectiveFlag, resolveEffectiveFlag, resolveStage, scoped, dispatcherRunning, resolveAnswerQuestion). A nil registry still falls back to Current() until slice 7.
  • wireNotificationActionFlags seeds from the service's registry. ResolveAttentionFlags/LoadAttentionFlags, NewDescriptorBuilder, NewGuidanceHookMirror and NewNotificationActionDispatcher take a trailing registry; production passes SessionService.FeatureFlagRegistry().
  • liveAttentionFlags global is gone: newAttentionOptionsSource(core.FlagRegistry) builds one cached source, shared by the review-queue poller and startup scanner through ServiceDeps.AttentionOptions.

Tests: feature_flags_reader_injected_registry_test.go uses a registry with flipped defaults and asserts the injected one is consulted; reverting any reader to Current() fails all three tests.

…tention readers

Slice 3 of flags-stage2-plan.md. flagReader{reg} replaces the free
functions that read featureflags.Current() via FeatureFlagDefault; a nil
registry still falls back to Current(). Attention flags resolve through
the composition root's registry and one shared options source.
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

CI memory (Go affected-package tests)

2 benchmarks (no base to compare with)

ci-memory/test-affected

Benchmark Value Range
peak_used [max] 4117 MB —
min_available [min] 11864 MB —
Environment
Head
sha 13ec0bd966d02d79e8b927138915da5793bc7271

Head-only report: add a base to see changes.

@github-actions

Copy link
Copy Markdown
Contributor

Selective e2e (shadow, non-blocking): 0 of 0 targets selected; shard jobs: skipped. The full suite in build.yml stays authoritative.

…ading with tests

Wiring paths use the service's injected registry (nil when none) so a
service built without SetCurrent no longer panics at construction; the
nil case falls back to Current() at read time. FeatureFlagService.injected
is nil-receiver safe. One test per constructor site proves the injected
registry is threaded.
@github-actions

Copy link
Copy Markdown
Contributor

📊 Feature E2E Coverage

Feature E2E coverage: 57/351 tested (16%)

Run make e2e-report locally to view the full Allure report.

@github-actions

Copy link
Copy Markdown
Contributor

Selective e2e (shadow, non-blocking): 0 of 0 targets selected; shard jobs: skipped. The full suite in build.yml stays authoritative.

…istry

Tests drive WireNotificationActions, wireGuidanceMirror and BuildServiceDeps
with a flipped-default registry; nil at any of those call sites now fails.
Adds SessionService.GuidanceMirror as the read accessor. The plan notes the
remaining eager wireNotificationActionFlags fallback.
@github-actions

Copy link
Copy Markdown
Contributor

Selective e2e (shadow, non-blocking): 0 of 0 targets selected; shard jobs: skipped. The full suite in build.yml stays authoritative.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant