Skip to content

Validate aliased event fields before DiskGraph token batching - #517

Merged
nittin-murthi merged 1 commit into
mainfrom
codex/500-diskgraph-text-aliases
Nov 24, 2026
Merged

nittin-murthi merged 1 commit into
mainfrom
codex/500-diskgraph-text-aliases

Conversation

@nittin-murthi

@nittin-murthi nittin-murthi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #500.

When two selected fields read the same stored column, DiskGraph counts it once for the token budget. On main, validation accepted the request and the first batch failed. check() and prepare() now name both fields and the column before building the index. Batching by sample count still delivers both fields.

Change map

Reused the Parquet-anchor regression from #447. The one-field case passed on main and the two-field case reproduced #500. Both passed with the fix. The three affected package test modules passed all 104 tests.

@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nittin-murthi
nittin-murthi temporarily deployed to gha-kumo-workflow-tests November 24, 2026 00:14 — with GitHub Actions Inactive
@nittin-murthi

Copy link
Copy Markdown
Contributor Author

Change map

File Function / scope What changed Why
packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py DiskGraphEngine.check_contract Identify two fields that read the same stored column within one event of the token length input. The stored length counts that column once. Detecting this at validation avoids a first-batch failure.
packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/unsupported.py DiskGraph refusal list Register the validation error and its suggested workaround. Callers can identify the error and choose sample-count batching when they need both fields.
packages/experimental/kumo-pytorch/docs/limitations.md Generated limitations table Regenerate the table with the new entry. Keep the user guide in sync with the validation error.
packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py Token aliases and the refusal catalog Adapt #447’s native Parquet test to the existing fixture. Check budgeting, length bucketing, and delivery by sample count. Verify that validation rejects the affected request before indexing and that supported cases deliver exactly the expected tokens.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "tone_instructions" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

DiskGraph now reports DG-TOKEN-LENGTH-ALIAS during contract validation when token budgeting or length bucketing uses multiple fields that directly reference the same stored column in one event. Tests cover refusal and preparation behavior, as well as accepted inputs without the alias. The limitations table documents the condition and alternatives.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 69bfc

DiskGraph now rejects token-budget or length-bucketing inputs where two fields read the same stored column, with a clear error and workaround. Single-field and sample-count batching behavior is preserved. No merge-blocking risk was identified.

Security architecture risk: Minimal · up to 69bfc

The update rejects a configuration that could already fail during batching and reports the problem earlier. Sample-count-only batching still permits both fields, and the change adds no new access or privileges.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — On the inspected path, a caller who controls the matching declarations can trigger a refusal of that preparation request. The added code creates no route to new data, credentials, or privileged operations.
Pre-merge checks: Passed 2 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive The check reviews the PR conversation comment that starts with <!-- kumo-pr-change-map -->. That comment is not in the supplied context. The review comments section lists no threads. The checkout co… Provide the body of the PR conversation comment that starts with <!-- kumo-pr-change-map -->, for example by pasting its text or by making the comment reachable to this check. Then re-run the check. The review should confirm that the map:…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed PR size check: the changed-file count is 4, which does not exceed the limit of 40. The reviewed range (refs/coderabbit/pre-merge-check/base..head) shows four modified files: packages/experimental/kumo…
Public Resource Access Passed The check applies only to external resource references whose text this PR adds or modifies. I listed the changed files with git diff --name-status against the review base. Four files changed: `docs/…
Full details: Pr Size

Explanation

PR size check: the changed-file count is 4, which does not exceed the limit of 40. The reviewed range (refs/coderabbit/pre-merge-check/base..head) shows four modified files: packages/experimental/kumo-pytorch/docs/limitations.md, packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py, packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/unsupported.py, and packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py. Both git diff --name-status and --name-only agree on the count. Line counts were ignored, as the check requires.

Full details: Public Resource Access

Explanation

The check applies only to external resource references whose text this PR adds or modifies. I listed the changed files with git diff --name-status against the review base. Four files changed: docs/limitations.md, src/kumo/pytorch/engines/diskgraph.py, src/kumo/pytorch/engines/unsupported.py, and tests/test_diskgraph_unsupported.py. I searched every added line in that diff for URLs (http://, https://), git+, github.com, git@, pypi, npm, file://, and Markdown link syntax. No added line matched. The PR adds no package source location, repository location, or URL to the changed files. The links in the PR description and the linked issue #500 are not part of the repository diff, so they fall outside the check's scope. No changed reference requires an anonymous-access test, so the check passes.

Full details: Change Map Design Review

Explanation

The check reviews the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;. That comment is not in the supplied context. The review comments section lists no threads. The checkout contains only a reference to the marker in docs/development/review.md. The PR description links the map at comment 7117861563, but this environment cannot fetch GitHub comments. Without the map text, I cannot check its necessity claims, observed failure, inspected behavior, verification, or stopping condition. I therefore cannot judge its design. Partial code evidence from the PR range (refs/coderabbit/pre-merge-check/base to head, 4 files, +106/-1): - diskgraph.py adds _token_budget_aliases, called from check_contract. It only checks Field references with no path, in history event inputs that use Fields with Tokens rows. Aliases through a path, derived fields, or other collections are not reported by this helper. Whether those cases matter for token planning is an open design question, not a proven defect. - Field is imported (line 53), so the isinstance(value, Field) check resolves. - unsupported.py adds the DG-TOKEN-LENGTH-ALIAS catalog entry. The limitations.md text matches it. - The PR description claims that batching by sample count still delivers both fields and that 104 tests pass. I did not verify either claim. The test file changes were not run. Result: the map's design quality is unverified. The concrete code changes do not show a proven defect.

Resolution

Provide the body of the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;, for example by pasting its text or by making the comment reachable to this check. Then re-run the check. The review should confirm that the map: 1. States the observed failure from #500 (two fields reading kind pass check() and fail on the first batch). 2. Justifies the chosen layer (check_contract plus _token_budget_aliases) against the existing unsupported catalog path, and states why no change to token counting is needed. 3. Explains the scope limits of the helper: path-based and derived field aliases, and non-history collections. 4. Lists the verification (the two-field regression, the one-field baseline, and the 104-test run) and a stopping condition.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5d17fb3 and 69bfc4e.

Files selected for processing: 4

  • packages/experimental/kumo-pytorch/docs/limitations.md
  • packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py
  • packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/unsupported.py
  • packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 4 remain after this review.

@Victsm Victsm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The targeted early refusal prevents silent alias undercount for native token budgets/bucketing while retaining sample-count-only behavior. All 32 unsupported-contract/regression tests passed. This is a documented limitation, not full alias-budget support.

@nittin-murthi
nittin-murthi enabled auto-merge (squash) November 24, 2026 22:34
@nittin-murthi
nittin-murthi merged commit 665112b into main Nov 24, 2026
120 checks passed
@nittin-murthi
nittin-murthi deleted the codex/500-diskgraph-text-aliases branch November 24, 2026 22:49

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 69bfc4e1 Deployed Nov 24, 2026 by nittin-murthi via import #3160
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.

Two fields reading the same text column pass validation but fail on the first batch

2 participants