Skip to content

mcp: the offset ceiling's 'matches MAX_PAGE_ROWS' sentence is unenforced prose #1266

Done
ItsAbir005/nostream
#2

Description

@chappie-daemon

The doc comment on MAX_ROWS_PER_SKIP and ADR 0020's D2 both say the number's magnitude "matches nostream_storage::MAX_PAGE_ROWS", and nothing enforces that sentence.

The constant is now this door's own 5_000 (job 040's architecture lens required it, and the approver ruled the change right), precisely so a relay event-page change cannot move an MCP schema. The prose kept the comparison as information — it is why 5,000 is a sensible magnitude — but it is a claim that rots silently: raise or lower the relay's page clamp and the sentence becomes false with every test still green, because no assertion reads it.

Options: drop the comparison from both places and keep only the measurement that justifies 5,000; or keep it and pin it (assert!(MAX_ROWS_PER_SKIP >= nostream_storage::MAX_PAGE_ROWS) with a comment saying the relationship is informational rather than a derivation). The second is honest but couples the test to the relay clamp again, which is the thing the fix removed — worth deciding deliberately rather than by drift.

Activity

  1. added
    bug
    rewrite
    rust
    factory
    on Nov 27, 2026
  2. chappie-daemon commented on Nov 27, 2026

    @chappie-daemon
    CollaboratorAuthor

    Follow-up of #1223, filed from its approver's decision.md — a gap left by that job, not a defect in what landed (PR #1265).

  3. ItsAbir005 commented on Nov 29, 2026

    @ItsAbir005
    Contributor

    Hi @cameri @chappie-daemon , I'd like to take this one. Of the two options in the issue, I'd lean towards the first (drop the comparison from the doc comment and ADR 0020 D2, keep only the measurement behind 5,000), since it avoids reintroducing the coupling that #1265 removed. Would you prefer that, or the pinning test? Could you assign it to me once you decide?

  4. ItsAbir005 commented on Nov 29, 2026

    @ItsAbir005
    Contributor

    Hi @cameri @chappie-daemon , I've opened the PR on my fork: ItsAbir005#2
    Commit: 8123994c (test(mcp): pin MAX_ROWS_PER_SKIP against MAX_PAGE_ROWS)
    Implements Option 2 for #1266 by keeping the existing comparison prose and pinning MAX_ROWS_PER_SKIP >= nostream_storage::MAX_PAGE_ROWS in crates/nostream-mcp/src/server.rs with a comment noting the relationship is informational, not derived.
    Includes unit test server::tests::skip_ceiling_is_at_least_relay_max_page_rows (with #[allow(clippy::assertions_on_constants)]) and the empty changeset .changeset/mcp-offset-ceiling-pin.md.
    All formatting, clippy, nostream-mcp tests, changeset, and commitlint checks pass cleanly on Linux.
    Ready for review and cherry-picking whenever convenient (and happy to switch to Option 1 if preferred)!

  5. cameri commented on Nov 29, 2026

    @cameri
    Owner

    @ItsAbir005 I agree let's go with the first

  6. added a commit that references this issue on Nov 29, 2026
    0e0b5ee
  7. ItsAbir005 commented on Nov 29, 2026

    @ItsAbir005
    Contributor

    @ItsAbir005 I agree let's go with the first

    Hi @cameri @chappie-daemon , I've updated the PR on my fork to Option 1: ItsAbir005#2
    Commit: 0e0b5eec (docs(mcp): drop unenforced MAX_PAGE_ROWS comparison)
    Removes the nostream_storage::MAX_PAGE_ROWS comparison from the MAX_ROWS_PER_SKIP doc comment in crates/nostream-mcp/src/server.rs and from D2 in docs/rewrite/decisions/0020-mcp-offset-ceiling.md, keeping only the measurement that justifies 5,000.
    Includes the empty changeset .changeset/mcp-offset-ceiling-prose.md with no code behavior changes.
    Ready for review and cherry-picking whenever convenient!

  8. chappie-daemon commented on Nov 29, 2026

    @chappie-daemon
    CollaboratorAuthor

    Landed on rewrite/main as 090136c0 (PR #1277), option 1: the comparison is gone from the doc comment and from ADR 0020's D2, and 5,000 keeps only the measurement that justifies it. Closing by hand because the base branch is not the default one, so the PR body's close keyword did not fire.

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

Metadata

Metadata

Assignees

Labels

bugfactoryrewriterust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions