Skip to content

refactor(config): loadConfig returns an initialized LoadedFlatbreadConfig#208

Merged
tonyketcham merged 2 commits into
mainfrom
stack/tonyketcham/feat/unified-watch-effort-graph/loadconfig-returns-initialized--0bf57aa7
Jul 18, 2026
Merged

refactor(config): loadConfig returns an initialized LoadedFlatbreadConfig#208
tonyketcham merged 2 commits into
mainfrom
stack/tonyketcham/feat/unified-watch-effort-graph/loadconfig-returns-initialized--0bf57aa7

Conversation

@tonyketcham

Copy link
Copy Markdown
Collaborator

Make the config package the single owner of "a loaded, initialized
config". loadConfig already called initializeConfig internally, but its
return type claimed raw FlatbreadConfig, so downstream callers
defensively re-initialized: codegen's CLI, watchAndGenerate's
config-reload branch, and flatbread's loadFlatbreadConfig each ran a
second initializeConfig over an already-initialized config.

  • loadConfig now returns ConfigResult; the three
    redundant re-inits are deleted.
  • initializeConfig has exactly two call sites: the loader and
    FlatbreadProvider (the programmatic entry point that accepts raw
    config from user code).
  • Typed load errors (NoConfigFoundError, TooManyConfigsFoundError)
    surface without process exit; process.exit stays only in CLI wrappers.

Test plan: new AVA unit tests in packages/config cover both error modes
and assert a successful load returns an initialized (normalized) config.
Full suite green: pnpm verify (lint + typecheck + build + 243 AVA + 52
vitest).

Co-authored-by: Cursor [email protected]

Depends-On: #207

…nfig

Make the config package the single owner of "a loaded, initialized
config". loadConfig already called initializeConfig internally, but its
return type claimed raw FlatbreadConfig, so downstream callers
defensively re-initialized: codegen's CLI, watchAndGenerate's
config-reload branch, and flatbread's loadFlatbreadConfig each ran a
second initializeConfig over an already-initialized config.

- loadConfig now returns ConfigResult<LoadedFlatbreadConfig>; the three
  redundant re-inits are deleted.
- initializeConfig has exactly two call sites: the loader and
  FlatbreadProvider (the programmatic entry point that accepts raw
  config from user code).
- Typed load errors (NoConfigFoundError, TooManyConfigsFoundError)
  surface without process exit; process.exit stays only in CLI wrappers.

Test plan: new AVA unit tests in packages/config cover both error modes
and assert a successful load returns an initialized (normalized) config.
Full suite green: pnpm verify (lint + typecheck + build + 243 AVA + 52
vitest).

Co-authored-by: Cursor <[email protected]>
Change-Id: I0bf57aa7bf50e9bb90fcb3432d36349ac0c74ff3
@tonyketcham

tonyketcham commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 docs(effort-graph): add Effort Graph glossary and ADRs 0001-0007 #205
2 feat(core,cli): unified watch with incremental reindex and live schema swap #206
3 feat(effort-graph): journaled semantic writer for the Effort Graph #207
4 refactor(config): loadConfig returns an initialized LoadedFlatbreadConfig #208 👈
5 refactor(core): single Record-production module owns file→Record and path classification #209
6 refactor(effort-graph): per-mutate snapshot + Decision lifecycle module #210
7 refactor(core): collection query executor owns filter/sort/paging with copy-on-output #211
8 refactor(core,cli): unified watch coordinator behind one seam, two adapters #212
9 refactor(core): per-build schema composer; delete the config-keyed schema cache #213
10 feat(effort-graph,flatbread): committed-generation bridge completes the ADR-0003/0004 contract #214
11 chore(core): drop unused graphql-compose-json and lru-cache dependencies #215
12 test: raise AVA concurrency now that the global-composer pin is obsolete #216
13 docs(agents): define orchestrator-executor operating model #217

@tonyketcham

Copy link
Copy Markdown
Collaborator Author

@Mergifyio queue

@mergify

mergify Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-18 08:35 UTC · Rule: owner-bypass · triggered by @tonyketcham with the @mergifyio queue command
  • Checks passed · in-place
  • Merged2026-07-18 08:51 UTC · at 06d8163ed1fafdcebba8c7d391a8fb2e1f3a0d3d

This pull request spent 15 minutes 49 seconds in the queue, including 4 minutes 21 seconds running CI.

Required conditions to merge
  • author = tonyketcham
  • check-success = build (20.x, ubuntu-latest)
  • check-success = build (22.x, ubuntu-latest)
  • check-success = integration-nextjs (20.x, macos-latest)
  • check-success = integration-nextjs (20.x, ubuntu-latest)
  • check-success = integration-nextjs (20.x, windows-latest)
  • check-success = integration-nextjs (22.x, macos-latest)
  • check-success = integration-nextjs (22.x, ubuntu-latest)
  • check-success = integration-nextjs (22.x, windows-latest)
  • check-success = integration-sveltekit (20.x, macos-latest)
  • check-success = integration-sveltekit (20.x, ubuntu-latest)
  • check-success = integration-sveltekit (20.x, windows-latest)
  • check-success = integration-sveltekit (22.x, macos-latest)
  • check-success = integration-sveltekit (22.x, ubuntu-latest)
  • check-success = integration-sveltekit (22.x, windows-latest)
  • check-success = lint (20.x, ubuntu-latest)
  • check-success = lint (22.x, ubuntu-latest)
  • check-success = test (20.x, ubuntu-latest)
  • check-success = test (22.x, ubuntu-latest)
  • depends-on = FlatbreadLabs/flatbread#207 [⛓️ feat(effort-graph): journaled semantic writer for the Effort Graph #207]

@mergify mergify Bot added the queued label Jul 18, 2026
Base automatically changed from stack/tonyketcham/feat/unified-watch-effort-graph/journaled-semantic-writer-effort-graph--4bd555ef to main July 18, 2026 08:46
…graph/loadconfig-returns-initialized--0bf57aa7
@tonyketcham
tonyketcham merged commit d2b38f0 into main Jul 18, 2026
19 checks passed
@tonyketcham
tonyketcham deleted the stack/tonyketcham/feat/unified-watch-effort-graph/loadconfig-returns-initialized--0bf57aa7 branch July 18, 2026 08:51
@mergify mergify Bot removed the queued label Jul 18, 2026
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