Conversation
…ed project
Introduce a `projectLoaded` flag on `TabManager` to distinguish between
two states that both produced `extraFiles = []`:
- State A: directory picker was never used (server should copy context/BOM
from its --project globals)
- State B: picker was used but the project has no BOM/ or context/ files
(GDAF should be skipped — correct behaviour)
Previously, `extra_files: []` was always sent to the server, causing
`"extra_files" in data` to be True even in State A. The server therefore
skipped its filesystem copy, `_resolve_gdaf_context()` returned None, and
GDAF produced 0 attack scenarios.
Changes:
- Add `projectLoaded: false` to `TabManager`
- Set `projectLoaded = true` in `loadProject()` on successful directory pick
- Set `projectLoaded = true` in the inline picker inside `generateAllFiles()`
(sub-model resolution path)
- Both `fetch('/api/generate_all')` calls now use a conditional spread:
`...(TabManager.projectLoaded ? { extra_files: TabManager.extraFiles } : {})`
so the key is omitted entirely when no picker was used
- `clearAllTabs()` now resets `extraFiles`, `projectLoaded`, and clears the
BOM/context badge display, preventing stale state from a previous project
from leaking into the next generation
Server-side condition (`"extra_files" in data`) is unchanged — the original
guard against cross-project contamination remains intact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a
projectLoadedflag onTabManagerto distinguish betweentwo states that both produced
extraFiles = []:Previously,
extra_files: []was always sent to the server, causing"extra_files" in datato be True even in State A. The server thereforeskipped its filesystem copy,
_resolve_gdaf_context()returned None, andGDAF produced 0 attack scenarios.
Changes:
projectLoaded: falsetoTabManagerprojectLoaded = trueinloadProject()on successful directory pickprojectLoaded = truein the inline picker insidegenerateAllFiles()(sub-model resolution path)fetch('/api/generate_all')calls now use a conditional spread:...(TabManager.projectLoaded ? { extra_files: TabManager.extraFiles } : {})so the key is omitted entirely when no picker was usedclearAllTabs()now resetsextraFiles,projectLoaded, and clears the BOM/context badge display, preventing stale state from a previous project from leaking into the next generationServer-side condition (
"extra_files" in data) is unchanged — the originalguard against cross-project contamination remains intact.