Skip to content

fix(flags): validate persisted route-gate values - #3351

Open
Chris0Jeky wants to merge 8 commits into
mainfrom
audit/3350-feature-flag-storage-boundary
Open

Chris0Jeky wants to merge 8 commits into
mainfrom
audit/3350-feature-flag-storage-boundary

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Closes #3350.

Summary

Hardens the local feature-flag persistence boundary used during app startup, router gating and Profile Settings:

  • restores only declared keys with actual boolean values;
  • arrays, primitives and unknown properties cannot become route gates;
  • storage read/parse failure restores safe defaults without aborting startup/navigation;
  • storage write failure preserves the valid in-memory setFlag or resetAll result;
  • an unsaved in-memory choice cannot be overwritten by stale readable storage during later route-triggered restore() calls;
  • a later successful write clears the unsaved-state guard;
  • isEnabled() and allEnabled remain strictly boolean over declared flags.

The storage key, public store API, defaults, valid payload behavior, router contract and settings UI remain unchanged. Feature flags remain local presentation/developer preferences, not a server authorization boundary.

Test-first evidence

Test-only head a22c2acaa96a0db4736af0a56646687f15897307 ran canonical Node 24 qualification. Ubuntu lint, typecheck, production build and PWA validation passed before JUnit recorded 7,158 tests, exactly 6 failures, 0 errors, exclusively the intended shape/storage-boundary cases. Initial corrected head 9246b9744174b76b0b0418b1929d443b54bd154b then passed Self-Test, Extended and the complete Required CI matrix.

Fresh Codex review found that a failed write could leave an older payload readable, allowing a later route-triggered restore() to silently revert the in-memory choice. Test-only head b49fccaf90e17d8a11ae8280a09f04088a1f0890 adds regressions for both unsaved setFlag and unsaved resetAll.

A dependency-free runner transpiled and executed the actual production module:

  • before the correction: setFlag(false) survived the write exception, then restore() reloaded stale true;
  • after the correction: the stale restore is ignored while unsaved changes exist, and the in-memory value remains authoritative.

Supplemental execution does not replace hosted qualification.

Current head and remaining gates

Exact final head: faac2a9ab22470b136197f8b3259a3e6f73e0fd4

Keep draft until this exact head passes Smart CI, Extended and the complete Required CI matrix on Ubuntu and Windows, then receives repeat independent review. The Codex stale-restore thread remains unresolved until that evidence exists.

No backend, API, DTO, schema, migration, dependency, workflow or control-plane change. Green CI is qualification evidence, not merge authorization.

@Chris0Jeky
Chris0Jeky marked this pull request as ready for review September 21, 2026 17:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9246b97441

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/taskdeck-web/src/store/featureFlagStore.ts Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T23:34:20.459340Z ca7ade3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Chris0Jeky
Chris0Jeky marked this pull request as draft September 21, 2026 17:34
@Chris0Jeky
Chris0Jeky marked this pull request as ready for review September 21, 2026 18:56
@Chris0Jeky
Chris0Jeky force-pushed the audit/3350-feature-flag-storage-boundary branch 2 times, most recently from 7920993 to e880496 Compare September 21, 2026 20:16
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact current head e880496 against base fb830ed. This is the one current-head review request after the main-base requalification. Focus on the PR's changed ownership and stale-settlement behavior, and report only merge-blocking correctness or security defects.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: e880496b36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Chris0Jeky
Chris0Jeky force-pushed the audit/3350-feature-flag-storage-boundary branch from e880496 to 48e325a Compare September 21, 2026 22:06
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48e325a4e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/taskdeck-web/src/store/featureFlagStore.ts Outdated
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7668a30398

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/taskdeck-web/src/store/featureFlagStore.ts
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8161b04446

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Chris0Jeky
Chris0Jeky force-pushed the audit/3350-feature-flag-storage-boundary branch from 8161b04 to ca7ade3 Compare September 21, 2026 23:24
@Chris0Jeky

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ca7ade33c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Chris0Jeky
Chris0Jeky force-pushed the audit/3350-feature-flag-storage-boundary branch from ca7ade3 to a0cbf1c Compare September 22, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending

Development

Successfully merging this pull request may close these issues.

Feature-flag restore accepts non-boolean route gates and can crash on storage failure

1 participant