Skip to content

fix(simple_mode): fix GDAF context not loaded when using server-manag…#20

Merged
ellipse2v merged 1 commit intomainfrom
resolve-GDAF-context-file-not-found-issue
Apr 17, 2026
Merged

fix(simple_mode): fix GDAF context not loaded when using server-manag…#20
ellipse2v merged 1 commit intomainfrom
resolve-GDAF-context-file-not-found-issue

Conversation

@ellipse2v
Copy link
Copy Markdown
Owner

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.

…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.
@ellipse2v ellipse2v merged commit 10dcfac into main Apr 17, 2026
2 checks passed
@ellipse2v ellipse2v deleted the resolve-GDAF-context-file-not-found-issue branch April 17, 2026 11:17
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