Skip to content

feature_flags signal has no detector: always 0, yet it feeds the debt risk family #4114

Closed as not planned

Description

@squid-protocol

Problem

feature_flags is a declared structural signal with no detector anywhere in gitgalaxy/, so it is always 0, on every file of every scan:

  • It is in SIGNAL_SCHEMA (gitgalaxy/standards/analysis_lens.py), in the debt risk family, and in record_keeper (arch_feature_flags DB column).
  • No language definition, shared pattern or sensor writes it.
  • The crucible has real feature-flag usage that should register, e.g. javascript/react/ReactFiberWorkLoop.js imports from 'shared/ReactFeatureFlags'.

Found by the #4108 signal-coverage investigation; baselined there as "NO DETECTOR" so the coverage floor (tests/tools/signal_coverage.py) flags it the moment a rule lands.

Proposal

Add a bounded, ReDoS-safe feature-flag rule, starting with SDK-level evidence that is unambiguous across languages:

  • SDK clients: LaunchDarkly (ldclient, LDClient, .variation( on an LD client), Unleash (isEnabled( on an unleash client), Flagsmith, ConfigCat, GrowthBook, Split.io, OpenFeature (getBooleanValue/getBooleanDetails), Flipper (Flipper.enabled?).
  • Repo-local flag modules: imports of a module named *FeatureFlags / feature_flags.

Follow gitgalaxy/standards/how_to_add_a_language.md's engine rules (bounded quantifiers, boundary correctness) and add strict tests.

Impact to plan for

  • feature_flags feeds the debt family, so tech-debt exposure moves for every file that gains hits. Expect a golden re-bless with a per-language explanation.
  • keyword-rosetta plants and manifests may need a re-bless (rosetta:rebless-owed). This is a cross-repo change; see docs/ecosystem.md.
  • Remove Feature Flags from tests/signal_coverage_baseline.json in the same PR (the floor will demand it).

Activity

  1. added
    bug
    core-engine
    on Oct 2, 2026
  2. added 2 commits that reference this issue on Oct 2, 2026
  3. squid-protocol commented on Oct 2, 2026

    @squid-protocol
    OwnerAuthor

    Reopening: PR #4130 was merged as an empty research-only WIP commit (no detector rules landed), so its 'Fixes #4114' closed this prematurely. The draft rules and measurements are preserved in the signal-feature-flags-4114 worktree under .wip/ and in /nvme-data/projects/agent-scratch-2026-10-02/feature-flags/.

  4. squid-protocol commented on Oct 3, 2026

    @squid-protocol
    OwnerAuthor

    Decision (Joe, 2026-10-03): retire feature_flags rather than build a detector.

    Why:

    • As defined (rollout toggles: LaunchDarkly/Unleash/OpenFeature, *FeatureFlags modules) it is only reliably detectable via SDK imports. In-house toggles are ordinary config reads that no lexical rule can tell apart, which is why the draft rules in the signal-feature-flags-4114 worktree drifted into per-codebase heuristics (k8s FeatureGate, sentry features.has, @ConditionalOnProperty) with a known false positive and no precision sample.
    • It reads 0 on most repos and on essentially every mainframe estate even with a detector.
    • It is filed under the debt family, but a toggle is only debt when stale, which a regex cannot see.

    Plan: remove feature_flags from SIGNAL_SCHEMA, SURFACE_FAMILIES['debt'], the arch_feature_flags DB column and the file-archetype brain features (log_density_arch_feature_flags). Because it is a brain input, dropping it changes the feature dimension (parity check), so do the removal together with the next archetype retrain (#4111) to avoid an extra retrain. Until then the all-zero column is inert. Drop Feature Flags from tests/signal_coverage_baseline.json in the same change.

    The "boolean flags as hidden program state" idea is a separate, cross-language measure, not a rename of this one. It is not being filed now.

  5. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginepriority: mediumscope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions