Skip to content

feat(python): add explicit streaming checkpoint provenance - #4640

Closed
akshitkhokhani wants to merge 3 commits into
lancedb:mainfrom
akshitkhokhani:codex/checkpoint-provenance
Closed

akshitkhokhani wants to merge 3 commits into
lancedb:mainfrom
akshitkhokhani:codex/checkpoint-provenance

Conversation

@akshitkhokhani

@akshitkhokhani akshitkhokhani commented Oct 23, 2026 •

Copy link
Copy Markdown

Related to #4018. This draft adds explicit checkpoint provenance; the default-mode and migration decision remains open.

A cursor saved after rows 0–1 can currently restore against another same-shaped table and return 102–107. Explicit snapshot mode binds the built plan's branch/version, selected input schema, configuration and caller identity, plus a non-secret local filesystem locator where available. Logical-reference mode supports caller-declared immutable data revisions across compaction. Restore validates detached state before changing progress; rank merge validates provenance in either input order and rejects conflicting packed buffers.

Ordinary asserted plans now also record the actual final logical occurrence order. The native builder records source ordinals separately, leaves the original sorter batches and memory reservation unchanged, then correlates final occurrences through bounded temporary streams and external sorts. For the same canonical eligible source scan order, this detects changed native plan output even under the same public seed without hashing compaction-sensitive physical row IDs. Existing custom-plan fingerprints and supported elastic rank/worker changes remain intact.

Design boundaries:

  • Legacy remains the default and unverified; this draft does not claim feat(python): bind StreamingDataset checkpoints to table and plan provenance #4018 is fully resolved.
  • Dataset generations, immutable logical revisions and transform policies remain caller assertions. The plan digest identifies positions in the canonical eligible source scan and assumes that scan order stays stable. It is not a row-content or arbitrary transform-output hash. Snapshot mode relies on the pinned backend scan-order contract; logical-reference mode also relies on the caller preserving logical contents and order. Old readers may ignore provenance; enforcement requires an aware reader.
  • Asserted ordinary construction requires temporary disk storage and adds a final-plan scan and correlation work. It does not add a second base-data scan. The sort-pool limit is not a whole-process memory cap. Correlation has a fixed 100 GiB scratch guard; exhaustion fails construction without a usable identity. That guard excludes original-plan temporary storage and is not a dataset-size or aggregate disk limit. Earlier unreleased asserted version-1 drafts missing the required identity are rejected.
  • No persisted-plan API from feat(python): Support prebuilt permutation table in StreamingDataset #4144, global-batch planner or production RNG change is included.

Validation:

  • Native permutation suite: 54 passed; the separately invoked million-row test passes under a 16 MiB sort limit with actual original-sort spilling. Enabled/disabled plans have identical ordered (row_id, split_id) pairs and preserved metadata; repeated identity builds agree.
  • Rebuilt native/Python extension: 279 owning elastic/permutation tests and 57 provenance tests pass, including filtered and unfiltered compaction with real row-ID renumbering, exact remaining output, split/clump cases, changed native output behind equal public seeds, failed-restore atomicity, both merge orders, migration and spawned workers.
  • Independent source review completed against the final nine-file snapshot. Seven focused native tests cover source errors, malformed positions, cancellation, disk exhaustion and truncated spools. Scoped Rust clippy (remote/tests/examples), Rust formatting, scoped Python lint/format and documentation build pass; existing documentation warnings remain. The final rebuilt extension passed all 57 provenance tests again. The 279 owning tests passed before equivalent native style/constant refactoring; the final native suite and million-row control were rerun after it.
  • Cost is material: three fresh local child observations per mode/size on an unoptimized build gave median construction of 0.063 s legacy versus 0.289 s asserted at 100,000 rows, and 0.671 s versus 3.786 s at 1,048,576 rows under the 16 MiB cap. Physical output checksums matched. These are development-build observations, not optimized throughput or distributed/GPU performance guarantees.

@github-actions github-actions Bot added enhancement New feature or request Python Python SDK labels Oct 23, 2026
@github-actions github-actions Bot added the Rust Rust related issues label Oct 23, 2026
@akshitkhokhani
akshitkhokhani force-pushed the codex/checkpoint-provenance branch from 42174fc to f93ffad Compare November 3, 2026 02:12
@akshitkhokhani

Copy link
Copy Markdown
Author

Security incident update from the PR author — unauthorized malicious changes

Unauthorized malicious code was pushed through my GitHub account into the source repository associated with this PR. This PR is closed. Please do not merge or run the affected original commits. I am sorry for the risk and disruption to the project.

What the investigation established

The injected files include a hidden VS Code task configured to run on folder opening and a Node payload disguised as fa-brand-400.orc under a nested public/fonts directory. Related Python loaders can retrieve encoded JavaScript through Ethereum-related API/RPC services and launch Node. These are execution mechanisms observed in the source, not evidence that the named API providers caused the compromise.

The observed account action does not identify the person or credential behind it. The exact initial access method remains unconfirmed. Commit author/committer dates can be preserved or manipulated, so I am using GitHub timeline timestamps below for the public activity log.

Public PR activity (UTC)

GitHub timestamp Event Commit / interpretation
2026-11-03T02:12:39Z head_ref_force_pushed f93ffaddfc807d7279a7c8a6656a6b439229cbab — Confirmed affected commit
2026-11-03T02:56:33Z closed PR closed

Affected source files and indicators in this public fork

  • .vscode/settings.json
  • .vscode/tasks.json
  • docs/web/static/assets/tutorials/build-with-ai-agents/camelot/data/img/public/fonts/fa-brand-400.orc
  • nodejs/init
  • nodejs/jest.config.js

Observed loader indicators: api.ethplorer.io, ethereum.publicnode.com, and Ethereum address 0x3b1574417524c11a7403c4b232CAcBb320CceBC6. These are indicators for investigation; do not execute retrieved content.

Payload/loader Git blob identifiers (Git SHA-1, not SHA-256):

  • docs/web/static/assets/tutorials/build-with-ai-agents/camelot/data/img/public/fonts/fa-brand-400.orc: 6f6bde882e1890319f3d0ea4ae4191d2d097a282

The cleanup also removes the payload camouflage files and restores altered ignore/configuration rules where supported by the original parent revision. The source review was static; it does not establish whether automated builds or deployed environments executed affected code.

Branch repair activity in akshitkhokhani/lancedb

Source branch Affected original commit Published repair / status
gatekeeper/fix-4392-1 104fff62080d2345d247e54273a60b9d0901a28f Repair pending; do not use the affected commit
main 3ddced936daaaaba47155e2aa55e900f5e3d5d9d Repair pending; do not use the affected commit
xuanwo/ci-windows-arm-main-only 42614c95a7d01158b69d856ed3ac2709fb95fe6d Repair pending; do not use the affected commit
gatekeeper/fix-1944-1 750d904c3cbf9e07635690395af83b8ed5437848 Repair pending; do not use the affected commit
feat/python-nemotron-embeddings eb11c71e9bd91d3fc7bcd7673f339bbf557fdeb9 Repair pending; do not use the affected commit
codex/checkpoint-provenance f93ffaddfc807d7279a7c8a6656a6b439229cbab Repair pending; do not use the affected commit

Status snapshot: 2026-11-03T04:15:37+00:00. Repairs are being checked by comparing file contents/Git object hashes and branch references; this is static verification, not a successful test/build claim. Legitimate project changes are retained where separable from the injection. I will update this comment as the remaining verification completes.

Limits and maintainer follow-up

  • Closed PR pages, GitHub caches, forks, local clones, and earlier build artifacts may still retain affected code even after source branches are repaired. Current branch cleanup does not guarantee historical object removal.
  • If the affected source was opened with automatic editor tasks enabled, or executed by a build/workflow, please review the relevant execution and treat credentials accessible to that environment as potentially exposed.
  • I have taken account-containment steps and contacted GitHub Support. The available evidence does not establish that upstream systems were compromised or that the account is fully safe.
  • The activity listed here is limited to this public repository. No account security-log export, credentials, or non-public project details are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Python Python SDK Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant