Skip to content

feat(sqlite)!: page selected rows with a stated order and row offset - #9331

Merged
morluto merged 15 commits into
morluto:mainfrom
2SinceJuly:feat/8234-sqlite-row-offset
Nov 9, 2026
Merged

morluto merged 15 commits into
morluto:mainfrom
2SinceJuly:feat/8234-sqlite-row-offset

Conversation

@2SinceJuly

@2SinceJuly 2SinceJuly commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Selected-row inspection reads a SQLite table's rows with no ORDER BY and
reports rows.order: "unspecified", so a caller cannot reach rows past the
first sample deterministically. This adds a stated unique order and a
row_offset window, so a large settings, cache or history table can be read in
bounded pages that can be cited against the same snapshot digests.

Fixes #8234

Problem and expected behavior

readRows runs SELECT ... FROM main."<table>" NOT INDEXED LIMIT ?. Two
consequences the report identifies still hold on b81da9035:

  • The retained sample has no stated order, and the observed order depends on
    whichever index SQLite decides to scan (for a WITHOUT ROWID table with a
    covering secondary index, NOT INDEXED still scanned the index and returned
    index order).
  • Once truncated is true, raising row_limit hits the fixed 16 MiB reply
    allowance, and there is no offset or cursor input to continue from.

Expected: a non-negative row_offset that skips a deterministic prefix, a
stated unique order that explains what "skip" means, and a reported next
offset the caller can feed back on the same snapshot.

Change and scope

  • readRowOrder picks the order from schema facts only, never caller SQL:
    rowid for rowid tables (unless rowid, _rowid_ and oid are all
    declared columns), and primary_key for WITHOUT ROWID tables. For the
    latter it reads each key column's desc flag and declared collation from
    pragma_index_xinfo and spells both in the ORDER BY, so the plan keeps the
    primary-key index's order rather than adding a sorter.
  • rows gains row_offset and next_row_offset; rows.order is now
    rowid | primary_key | unspecified. next_row_offset is the offset to
    request next and is null once the window reaches the end. The schema
    cross-check ties next_row_offset to truncated and row_offset.
  • row_offset requires table and defaults to 0, with CLI --row-offset.
    A non-zero offset is refused as selection when the table declares no usable
    order, because the skipped prefix would be arbitrary.
  • All existing byte, heap, statement and deadline limits are unchanged.

Compatibility

This changes the selected-table result contract, so it is marked breaking:
rows.order now admits rowid and primary_key besides unspecified, and
rows gains required row_offset and next_row_offset members. A client that
validates the reply against the previous schema — where order could only be
unspecified — rejects a previously valid call. Migration: accept both new
members and read order as the stated order the offset applies to; a null
next_row_offset means the window reached the end. Nothing in main produced
rowid/primary_key before this change, so no existing behaviour changes
meaning; only a strict schema validator sees the difference.

Intentionally not included: arbitrary ORDER BY/WHERE, total row counts,
view/virtual/shadow row reads, cross-call snapshot reuse, and the report's
optional expected_sha256 pre-check (that is a separate idempotency decision).
Pages compose only while the reported database and WAL SHA-256 match, which is
now stated in the docs and tool description.

One attribution fix came with it: adding ORDER BY text can push an over-wide
projection past SQLite's SQL-text length limit, which fails as SQLITE_TOOBIG
before SQLite can report the result-column limit. That case is now attributed
to column capacity as well, so a very wide projection still reads as capacity
rather than a byte budget.

Follow the contribution scope.
This is read-only inspection of an existing snapshot on the existing read-only
connection: no target execution, injection, mutation or protection recovery, so
no separate maintainer scope decision is required.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/sqlite/sqliteDatabase.ts
    owns the input/output schema; src/sqlite/SqliteDatabaseInspection.ts owns
    order selection and the windowed reads. No superseded path is retained.
  • Contribution scope fit and linked maintainer decision: not applicable (offline
    read-only inspection inside the existing ordinary-table profile).
  • CLI and MCP/tool-catalog contract: new optional row_offset input and new
    row_offset/next_row_offset output fields plus a widened order enum; the
    tool description and docs/guides/data/sqlite-databases.md are updated.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: the row window is
    recorded as Evidence parameters, including row_offset.
  • Target selection, authority, upstream behavior, and cleanup details: none; the
    existing private snapshot copy and owned worker are unchanged.
  • Generated metadata: none authored by hand; CI regenerates catalogs.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:
    • tests/boundary/sqlite/sqliteDatabaseInspection.test.ts: three cases —
      paging a rowid table across three pages without repeats or gaps, ordering a
      WITHOUT ROWID table by a DESC + NOCASE primary key, and refusing a
      non-zero offset when the table shadows all three rowid spellings.
    • tests/acceptance/sqliteDatabaseCli.test.ts: one CLI/MCP parity case that
      pages the same window through both surfaces, checks the primary_key order
      end-to-end, and checks row_offset without table is rejected.
    • Existing row fixtures gained order, row_offset and next_row_offset.
  • Base reproduction or other evidence: on b81da9035, rows.order was the
    literal "unspecified" and there was no offset input; the schema rejects a
    reply without the new fields, so the new cases exercise a path that did not
    exist before.
  • User-visible CLI/MCP output (if applicable): --row-offset 1 --row-limit 1
    returns rows.row_offset: 1, rows.order: "rowid", next_row_offset: 2.
  • Remaining proof gaps: the order is asserted against observed row values and
    in-memory EXPLAIN QUERY PLAN checks (no sorter was added), not against an
    independent SQLite build matrix.

Validation performed

  • npm run check:fast — typecheck and lint succeeded.
  • npx oxfmt --check on the touched files — correct format.
  • npm run verify:module-boundaries — checked 3843 source files.
  • npm run docs:check — readmeConsistency 9 tests passed.
  • npx vitest run tests/boundary/sqlite src/application/sqlite tests/acceptance/sqliteDatabaseCli.test.ts — 196 passed, 3 skipped.
  • npx vitest run src/contracts src/application/CapabilityInventory.test.ts src/application/sqlite — 319 passed, 3 skipped.
  • Full npm run check:pr and the complete test suite were not run.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for inputs. The output schema adds
    two required fields to rows and widens order; historical Evidence without
    them is not re-validated through this path.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the order clause is built
    only from decoded schema identifiers and collations through the existing
    quoteIdentifier, and both row_limit and row_offset remain bound
    parameters; no caller text reaches the SQL.

Author readiness

Human owner: @2SinceJuly

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Remaining-work integration

Integration validation: merged current main to include the source-publication budget repair. The former publication failure passes. SQLite row ordering remains owned by the shared inspection path, including repeated primary-key terms, collations, shadowed rowids and unordered offset refusal.

Validation: 85 tests passed and two skipped across SQLite inspection, CLI, cleanup and composed publication suites; check:fast and docs:check passed. Existing breaking-contract migration notes below remain applicable.

readRows read `NOT INDEXED LIMIT ?` with no ORDER BY and reported
order: "unspecified", so an agent could not reach rows past row_limit
deterministically: raising row_limit hits the fixed 16 MiB reply budget,
and the sampled order depends on whichever index SQLite happened to scan.

Read the window in a unique, stated order and expose the position:

- rowid tables order by rowid unless all of rowid, _rowid_ and oid are
  declared columns, in which case the order stays unspecified.
- WITHOUT ROWID tables order by the primary-key columns, reusing each
  key's DESC flag and declared collation from pragma_index_xinfo so the
  plan keeps index order instead of materialising a sorter.
- rows.order, rows.row_offset and rows.next_row_offset report the window;
  next_row_offset is null once the window reaches the end.
- row_offset (CLI --row-offset) requires table and defaults to 0. A
  non-zero offset is refused when the table declares no usable order,
  because the skipped prefix would be arbitrary.

The schema now checks next_row_offset against truncated and the offset so
a worker reply cannot claim a page it did not read.

One attribution fix came with it: adding ORDER BY text can push an
over-wide projection past SQLite's SQL-text limit, which fails as
SQLITE_TOOBIG before the result-column limit is reported. Attribute that
case to column capacity too, so a 250k-column request still reads as
capacity rather than a byte budget.

Verified: npm run check:fast, npm run format:check on the touched files,
npm run verify:module-boundaries, npm run docs:check, and 196 tests
across the sqlite boundary, application and CLI/MCP suites. A 1002-row
inspection and in-memory EXPLAIN QUERY PLAN checks confirmed the
WITHOUT ROWID path adds no sorter. Full check:pr and the complete test
suite were not run.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T13:03:07.781808Z bf7d96e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eeaeb16cb9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/sqlite/sqliteDatabase.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] No blocking issue was found in the supplied changes, which already match the landed feature.

Summary

Adds ordered SQLite row windows, row_offset, and next_row_offset through the shared inspection path, CLI, and MCP contract.

  • Selected SQLite rows now continue page by page in a stated order.
  • Very wide SQLite column requests now report a capacity limit.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[CLI or MCP request] --> B[Check shared input contract]
  B --> C[Copy database and WAL into private snapshot]
  C --> D[Read table and key facts]
  D --> E{Available order}
  E -->|Free rowid spelling| F[Order by rowid]
  E -->|WITHOUT ROWID| G[Order by primary-key index terms]
  E -->|No stated order| H[Allow only offset zero]
  F --> I[Read bound limit and offset]
  G --> I
  H --> I
  I --> J[Return rows and next offset]
  J --> K[Check reply and caller binding]
  K --> L[Return Evidence with snapshot digests]
Loading

Reviews (14) · Last reviewed commit: "Merge remote-tracking branch 'origin/nex..." · Reviewed by Greptile

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Three defects in the row paging added alongside row_offset:

- readRowOrder emitted ORDER BY rowid for every rowid table, but a table
  that declares a rowid column shadows that spelling, so the sort used the
  stored column and could repeat or drop rows across pages. Order now names
  the first alias the table leaves unbound, read from raw name bytes so an
  unrelated malformed identifier is not decoded just to choose an order.

- The inventory projection could hide the primary key a WITHOUT ROWID table
  orders by, silently degrading a paginated read to unspecified order. The
  order key is now read from the table itself rather than from the columns
  the caller asked to see.

- A truncated table with no stated order reported a next_row_offset that the
  row_offset rule then refused. It is null there, and the reply limitation
  no longer claims an unspecified order for windows that have one.

rowEvaluationFailure also probed the first rows of the table instead of the
requested window, so a failure confined to a later page was attributed to
columns that evaluate fine there.
The paging regression checked only counts, offsets and flags, so a second
page that repeated the first page's rows would still pass. Assert the values
read across all three pages instead.
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 532a54cef6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
readRowKeyFacts decoded primary-key names as UTF-8 and probed a fixed
hidden set, so two supported schemas could not be paged at all:

- A UTF-16 database stores key names as UTF-16 bytes, so "k" decoded to
  NUL-padded text and ORDER BY named an identifier that does not exist.
  Pass the detected encoding, as readColumns and the index-metadata path
  already do.
- A virtual generated column named rowid (hidden=2) was absent from the
  shadow check, so ORDER BY rowid evaluated the generated expression
  instead of the rowid and could sort non-uniquely or fail outright.
  Include generated columns in the alias probe.

Also stop decoding primary-key names for rowid tables: their ORDER BY
names an alias, never a declared key, so an unselected malformed key
name could abort an otherwise readable selection.

The page-concatenation assertion now narrows SqliteValue before reading
.value, which the null/blob arms do not carry; this was failing the
Static checks typecheck job.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2718231a59

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
`readRowOrder` filed `pragma_index_xinfo` key terms into a map keyed by
column name, so a valid composite key that repeats a column —
`PRIMARY KEY(a COLLATE BINARY, a COLLATE NOCASE DESC)` — collapsed to one
term. The generated clause then overstated uniqueness: it omitted the
BINARY term, so `A`/`a` ties survived, and the `row_offset` paging
advertised a `primary_key` order that the actual key does not establish.

Build the terms from the index rows in `seqno` order instead, keeping
repetitions, and bail to `unspecified` if any declared key column never
appears in the index. The declared collation stays explicit so a caller
column's own collation cannot re-sort the window.

Verified against a real SQLite database that the repeated key is accepted
and that the old clause orders A, a, B while the index orders A, B, a.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d582853059

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/sqlite/sqliteDatabase.ts Resolved
readRows already withholds next_row_offset when a table shadows rowid, _rowid_ and oid and declares no primary key, because every non-zero offset is refused there. The reply schema still required the offset whenever truncated was set, so the provider rejected its own worker result and the first sample never reached CLI or MCP. Require the offset only when the order is stated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 091f5eb9d9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
readRowKeyFacts ran for a selected virtual shadow table before readRows
could reject it, so an unavailable module surfaced as SQLite's
"no such module" instead of the selection refusal. Probe the key only
when the selected kind is an ordinary table and leave the order
unspecified otherwise, since no rows are read for that kind.

The unordered-offset refusal also reported the generic selection reason,
which callers see against table. Give it its own reason so the failure is
attributed to row_offset.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d27c58dede

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/sqlite/sqliteDatabase.ts Resolved
Selected-row inspection currently reports only rows.order: "unspecified" and
offers no way to reach rows past the first sample deterministically. Main also
refuses non-zero row_offset today, so nothing relies on that omission; this
change makes the stated order and the offset the contract, reports the next
offset the caller feeds back, and keeps the existing byte, heap, statement and
deadline limits.

BREAKING CHANGE: rows.order becomes rowid | primary_key | unspecified, and
rows gains required row_offset and next_row_offset members. A client that
validates selected-table output against the previous schema (where order was
the only permitted value) rejects a now-valid reply. Migration: accept the two
new members and treat order: "rowid" | "primary_key" as the stated order the
offset applies to; a null next_row_offset means the window reached the end.
@2SinceJuly 2SinceJuly changed the title feat(sqlite): page selected rows with a stated order and row offset feat(sqlite)!: page selected rows with a stated order and row offset Nov 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f42f78b56

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
The selected-rows limitation described next_row_offset as null only when the window reached the end. An unordered table whose row_limit truncates the sample also publishes null, because an offset there would name a request the row-offset rule refuses, so the Evidence read as if the sample were complete. State the second cause and pin it in the existing regression.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a985f05b86

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…rdered exception

The boundary test pinned the sentence a caller reads in `limitations`,
so a harmless rewrite of that text failed a paging test whose real
subject is `order`, `truncated` and `next_row_offset`.
docs/development/testing.md asks for facts over frozen explanatory prose,
and the three structured expectations already fail if the paging fact
changes.

The tool contract promised that retained rows always have a unique order
and can be paged. A rowid table that shadows rowid, _rowid_ and oid and
declares no primary key has no such order: it returns
order=unspecified with a null next offset and refuses a non-zero
row_offset. Say so in the description so callers do not plan a
continuation the tool always refuses.
The description told callers that a truncated table without a stated order
needs "the table read without offsets", but omitting row_offset starts at
zero again: with an unchanged row_limit the next call repeats the first
sample instead of continuing past it. Say that these tables cannot be
paged and point at row_limit for a larger first sample.
@2SinceJuly

Copy link
Copy Markdown
Contributor Author

Merged origin/main (through 5553acfe5) so this branch is no longer 24 commits behind.

Static checks is still red, but only on src/cli/coreNativeCommands.ts, which this PR does not touch: oxfmt wants localPathStringSchema.describe("Local native executable or app path") collapsed onto one 79-column line, and the raw origin/main blob fails the same check. npm run check:ci:fast locally reports that single file and nothing else — typecheck and lint are clean across this branch's sqlite changes.

I did not reformat that file here: it is an unrelated upstream defect, and folding it in would put an unreviewed change to the native CLI surface in a sqlite PR.

Comment thread src/sqlite/SqliteDatabaseInspection.ts Resolved
The `inspect-native-data-type` argument description line is 82 columns, over the repository's 80-column `.oxfmtrc.json` limit, so `npm run format:check` fails on main and on every branch merged from it. It came in with morluto#9465 and the following commits to this file did not touch it. Reformat the one call the formatter objects to; no behaviour change.
readRowKeyFacts decoded every column name before testing it against three short aliases, so a table declaring a multi-megabyte name could exhaust the worker heap even when the caller projected the column away. Reject names that cannot be an alias by their byte length, accounting for the database encoding, before building any string.
@2SinceJuly

Copy link
Copy Markdown
Contributor Author

Test shard (2/8) fails on tests/boundary/mcp/sourcePublicationComposed.test.ts > preserves the source when an inline result with unknown retention exceeds delivery, with 1 failed | 2213 passed. That is a baseline failure on main, not this branch: the same test fails in the main CI run at 4a1c4a59b, and the failure is in code this PR does not touch. No change made here; the branch goes green once main does.

@2SinceJuly

Copy link
Copy Markdown
Contributor Author

Correcting the above: this is no longer true. Main's shards were green at 4a1c4a59b (all 8 passed; the only remaining main-run failure was a javascript_recovery lane hitting HTTP 504 on a download, not a test). If this PR still shows Test shard (2/8) red it is running against an older main — merging current main should clear it.

@morluto

morluto commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Integration validation: merged current main to include the source-publication budget repair. The former publication failure passes. SQLite row ordering remains owned by the shared inspection path, including repeated primary-key terms, collations, shadowed rowids and unordered offset refusal.

Validation: 85 tests passed and two skipped across SQLite inspection, CLI, cleanup and composed publication suites; check:fast and docs:check passed. Existing breaking-contract migration notes below remain applicable.

@morluto
morluto merged commit 3230f50 into morluto:main Nov 9, 2026
4 of 6 checks passed
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added enhancement New feature or request provider: sqlite Analysis provider / engine: sqlite labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request provider: sqlite Analysis provider / engine: sqlite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Deterministic row paging for inspect_sqlite_database selected tables

2 participants