Skip to content

refactor(core): single Record-production module owns file→Record and path classification#209

Merged
tonyketcham merged 2 commits into
mainfrom
stack/tonyketcham/feat/unified-watch-effort-graph/single-record-prod-module-owns-file-record-path--f11d80de
Jul 18, 2026
Merged

refactor(core): single Record-production module owns file→Record and path classification#209
tonyketcham merged 2 commits into
mainfrom
stack/tonyketcham/feat/unified-watch-effort-graph/single-record-prod-module-owns-file-record-path--f11d80de

Conversation

@tonyketcham

Copy link
Copy Markdown
Collaborator

"File → validated Record" had three parallel VFile→EntryNode
implementations and three divergent path→Collection matchers spread
across schema.ts, contentGraph.ts, export/json.ts, and
source-filesystem. A file could be classified differently (or
invisibly) depending on which code path saw it, and the plugin contract
(_path/_filename stamping, capture spreading, extension routing) lived
only in folklore.

New packages/core/src/records/ module is the single owner:

  • produceRecords(files, config): extension-routed transform +
    authoritative source-context stamping (moved from schema.ts).
  • validateRecords(records, config): ID validation + reference
    validation; diagnostic text byte-identical to before (validation
    snapshot suites unchanged).
  • classifyPath(path, config) → { collection, captures } | undefined:
    THE path→Collection matcher, with documented complete-path grammar
    ([name]suffix, *, recursive **) and case-insensitive extension
    allowlisting. Stable interface for the future watch coordinator.

Consumers rewired: generateSchema's non-graph path,
buildContentGraph/patchContentGraph (watch reindex now applies path
captures instead of silently dropping them), export/json.ts (single
fetch; no more schema build as a validation side effect), and
source-filesystem's fetchPaths via a matchPath adapter isomorphic to
classifyPath (fixes ** blindness in the old exact-depth matcher; dead
getCaptureData deleted; no runtime core import added). Plugin contract
written down in types.ts (SourceContextFields, Transformer/Source doc
contracts) and "Record production" added to docs/glossary.md.

Test plan: new AVA suites for produce/validate/classify plus a
core-side parity test locking fetchPaths capture semantics to
classifyPath; regression tests cover exactly the cases the three old
matchers disagreed on. Full suite green: pnpm verify (243 AVA incl. 9
liveSchema reload tests + validation snapshots unchanged, 52 vitest).

Co-authored-by: Cursor [email protected]

Depends-On: #208

…path classification

"File → validated Record" had three parallel VFile→EntryNode
implementations and three divergent path→Collection matchers spread
across schema.ts, contentGraph.ts, export/json.ts, and
source-filesystem. A file could be classified differently (or
invisibly) depending on which code path saw it, and the plugin contract
(_path/_filename stamping, capture spreading, extension routing) lived
only in folklore.

New packages/core/src/records/ module is the single owner:

- produceRecords(files, config): extension-routed transform +
  authoritative source-context stamping (moved from schema.ts).
- validateRecords(records, config): ID validation + reference
  validation; diagnostic text byte-identical to before (validation
  snapshot suites unchanged).
- classifyPath(path, config) → { collection, captures } | undefined:
  THE path→Collection matcher, with documented complete-path grammar
  ([name]suffix, *, recursive **) and case-insensitive extension
  allowlisting. Stable interface for the future watch coordinator.

Consumers rewired: generateSchema's non-graph path,
buildContentGraph/patchContentGraph (watch reindex now applies path
captures instead of silently dropping them), export/json.ts (single
fetch; no more schema build as a validation side effect), and
source-filesystem's fetchPaths via a matchPath adapter isomorphic to
classifyPath (fixes ** blindness in the old exact-depth matcher; dead
getCaptureData deleted; no runtime core import added). Plugin contract
written down in types.ts (SourceContextFields, Transformer/Source doc
contracts) and "Record production" added to docs/glossary.md.

Test plan: new AVA suites for produce/validate/classify plus a
core-side parity test locking fetchPaths capture semantics to
classifyPath; regression tests cover exactly the cases the three old
matchers disagreed on. Full suite green: pnpm verify (243 AVA incl. 9
liveSchema reload tests + validation snapshots unchanged, 52 vitest).

Co-authored-by: Cursor <[email protected]>
Change-Id: If11d80de2f72869ee208feb0990f979e4ab7a48d
@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:55 UTC · at 6fa23c8002dad90556f6e717a31505799dbc5833

This pull request spent 19 minutes 50 seconds in the queue, including 3 minutes 16 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Jul 18, 2026
Base automatically changed from stack/tonyketcham/feat/unified-watch-effort-graph/loadconfig-returns-initialized--0bf57aa7 to main July 18, 2026 08:51
…graph/single-record-prod-module-owns-file-record-path--f11d80de
@tonyketcham
tonyketcham merged commit d9ff4da into main Jul 18, 2026
19 checks passed
@tonyketcham
tonyketcham deleted the stack/tonyketcham/feat/unified-watch-effort-graph/single-record-prod-module-owns-file-record-path--f11d80de branch July 18, 2026 08:55
@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