Skip to content

fix(config): updateFeature erases unknown top-level keys on every toggle #349

Description

@dean0x

Finding

writeConfig serialises whatever coerceConfig returns, and coerceConfig (src/core/feature-config.ts:185) constructs a fresh literal from known keys only — so any top-level key written by a newer devflow version, or by hand, is silently deleted by the next unrelated feature toggle.

Why deferred

This is the general form of the erasure that typescript-01 (fixed in PR #344 by widening the tracker field's type) argues against. Fixing the general case — preserving unknown top-level keys through every coerceConfig round-trip — changes the read-modify-write contract for every feature that touches .devflow/config.json; feature-config.ts's callers span memory, learning, knowledge, reviewPublication, and tracker. That's cross-cutting work beyond a single-feature PR.

Suggested fix

Consider preserving unknown top-level keys through coerceConfig round-trips (e.g., spread unknown keys through before applying known-key coercion), so a future devflow version or a hand-edited config key survives an unrelated toggle.

References

Activity

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

    tech-debtTechnical debt items to address

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions