Skip to content

fix: run config tables' on-file commands in declaration order - #1539

Merged
thekevinbot merged 5 commits into
mainfrom
bot/1538-onfile-order-1019
Oct 20, 2026
Merged

thekevinbot merged 5 commits into
mainfrom
bot/1538-onfile-order-1019

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1538

Config tables' on-file commands run in table declaration order: table N's command finishes before table N+1's starts; across repeated -c, argv order.

  • Startup (no cache): every per-table hook still starts before the walk, but each waits for the hook declared before it to finish. The first table's command still streams over paths as the walk finds them; walking, shaping and inserting still overlap the commands. Rows are inserted in the same order.
  • Startup with a cache: batches sorted by declaration instead of by first file in walk order.
  • Watch: a refresh covering several tables runs them in declaration order instead of event order.
  • Documented in docs/reference/config.md.

Red commit d1dfd38a (packages/rust/tests/on_file_order.rs) failed in CI on exactly those four assertions (overlapping start/end lines, or walk/event order).

Speed: single-table configs unchanged (speed-of-light e2e tests pass). Multi-table configs lose the cross-table overlap of commands, which the guarantee forbids: 3 tables x 20k files with an awk command, paired runs main vs branch, median ~0.074s -> ~0.092s.

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass
  • TypeScript SDK e2e: pass
  • Rust core e2e (if applicable): pass (cargo test --workspace --features cli)
  • packages/python/e2e-attestations/<branch>.json receipt written if packages/python changed (just e2e-attest-python)
  • packages/ts/e2e-attestations/<branch>.json receipt written if packages/ts changed (just e2e-attest-ts)
  • Command(s) run: uv run python -m pytest tests/e2e/{on_file_query,declared_table_name,fanout,query_contract,sigint_interrupt,use_case_notebook,use_case_transcripts,plugin_discovery,frontmatter_parse_speed,jsonl_parse_speed,watch_speed,server_speed}_test.py; pnpm test:e2e
  • Result summary: Python 30 passed; TypeScript 18 passed.

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package (or: skip-changelog trailer on a commit with reason)
  • Migration fragment with the same slug added under <root>/<pkg>/migrations.d/ for each changed package (every subsection but Summary _None._ when nothing breaks)

@thekevinbot
thekevinbot merged commit aea4749 into main Oct 20, 2026
90 checks passed
@thekevinbot
thekevinbot deleted the bot/1538-onfile-order-1019 branch October 20, 2026 11:12
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.

Config tables' on-file commands run in table declaration order

1 participant