Skip to content

ci: raise the selector filter and argument bounds (ADR-0105) - #47

Merged
cemililik merged 2 commits into
mainfrom
ci/adr-0105-filter-bounds
Nov 21, 2026
Merged

cemililik merged 2 commits into
mainfrom
ci/adr-0105-filter-bounds

Conversation

@cemililik

@cemililik cemililik commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Raises the two argument bounds of the complete bounded CI shards, under
ADR-0105 (Accepted by the
maintainer 2026-11-21) and a dated Amendment 4 in
ADR-0063: the generated selector
filter goes from 32 KiB to 64 KiB and all argument strings of one invocation from 64 KiB to
128 KiB. Counts, the assignment algorithm, the B salt, weights and every job ceiling are
unchanged, and an oversize filter is still refused before spawning, never split and never
run unfiltered.

This PR is stacked on #46. It targets main because ci.yml runs only for pull requests
into main, so its file list repeats #46's until that merges. Its own change is one
commit, 76501822.
Review that commit; merge #46 first.

Why

The first hosted layout B run of the P03-9 source (#46, head 82d18d8d) refused
backend-ordinary-11 with filter_bound before any test ran: its filter is 33,367 bytes
against the 32,768-byte ceiling, and ordinary-7 is at 31,989. The assignment is
deterministic from the manifest and the plan, so no rerun can pass. Layout A passes the same
source in 27,144 to 28,123 bytes.

A new B salt was the cheap route and measurement ruled it out. Over 200 candidate salts on
the current population the largest filter has a median of 33,070 bytes; 86 of 200 fit, none
stays under 90 % and the best reaches 91.8 %. The assignment is hash-ordered, so each added
selector reshuffles it and a salt fitted to today's population is a fresh draw tomorrow.
The population is 2,052 distinct ordinary selectors across twelve shards, the Accepted upper
count, so growth shows up as longer filters. A byte-aware assignment is the valid alternative
the ADR records and does not select: it leaves about 16 % of growth.

What changes

  • scripts/ci-test-shards-plan.json and the pin in validate_plan: 65,536-byte filter,
    131,072-byte argument vector.
  • scripts/test-ci-test-shards.py: the boundary controls (exact boundary accepted, one byte
    more refused, oversize refused instead of splitting, launcher refuses before spawn) move to
    the new values.
  • ADR-0105 (Accepted), its index row, ADR-0063 Amendment 4, and the acceptance record in the
    Phase 03 delivery log.

Verification

  • 88 shard tests and 42 shard-result tests pass.
  • Run against the layout-B-refused population with the new plan, every layout-A filter is
    accepted (largest 28,123 bytes, 43 % of the new bound), every layout-B filter is accepted
    (largest 33,367 bytes, 51 %) and the two layouts stay distinct.
  • make lint-docs passes.

Hosted qualification (done)

Run 44909390165, head 76501822, same source in every attempt:

  • Layout B (attempt 2): 27/27 green, including backend-ordinary-11, the shard that layout B
    refused at 33,367 bytes before this change. A filter above 32 KiB passes the hosted test
    chain, and the independent rediscovery of each filter held.
  • Layout A (attempt 3): 27/27 green.
  • Layout A attempt 1 failed on two hosted flakes unrelated to this diff: a Keycloak
    readiness timeout in ordinary-1 (TLS, 120 s) and a frontend development-server test
    (bff-development-diagnostics-counter) with no frontend file in the change.

Left for after the merge

  1. Record the qualification in the Phase 03 delivery log and point the Status block's
    layout-B line at it. That is a docs commit after the merge, so this PR does not burn
    another CI cycle on a record.
  2. Merge feat(platform): operator authority, onboarding and recovery (P03-9) #46 first: it already is, so this PR's diff is now its one commit.

🤖 Generated with Claude Code

Summary by Sourcery

Increase the complete bounded CI shard limits to support larger selector filters and argument vectors without changing shard assignment or safety guarantees.

Bug Fixes:

  • Raise the bounded CI shard selector-filter and invocation argument limits so valid layout-B shards are no longer rejected before execution.

Enhancements:

  • Preserve pre-spawn refusal behavior for oversized filters and argument vectors while keeping shard counts, assignment, salt, weights, and job ceilings unchanged.

Documentation:

  • Document the new CI bounds through ADR-0105, an ADR-0063 amendment, the decision index, and the Phase 03 delivery record.

Tests:

  • Update shard boundary and launcher tests to validate the increased limits and continued rejection of oversized inputs.

Summary by CodeRabbit

  • CI Improvements
    • Increased the maximum selector-filter size from 32 KiB to 64 KiB and the maximum argument-vector size from 64 KiB to 128 KiB.
    • Oversized filters and argument vectors are still refused before execution; filters are not split and runs are not retried without filters.
  • Documentation
    • Added and updated decision and delivery records for the new limits and qualification requirements.

ADR-0105, Accepted: layout B refused ordinary-11 at its 33,367-byte filter
against ADR-0063's 32 KiB ceiling, deterministically, and no B salt fits
reliably (86 of 200 fit, none under 90 percent). The filter bound is now
64 KiB and the argument vector 128 KiB; counts, salt, algorithm and job
ceilings are unchanged. The plan, its validator and the four boundary
controls move together, ADR-0063 gains Amendment 4, and the acceptance
record owns the measurements. Hosted A and B qualification is still owed.

ADR: 0105
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with ci:, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@sourcery-ai

sourcery-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Pin plan validation to the accepted 64 KiB filter and 128 KiB argument-vector bounds so plans with different limits are refused.

  • scripts/ci-test-shards.py L100

Configuration

Raise the committed shard-plan bounds to match the newly accepted selector-filter and argument-vector ceilings.

  • scripts/ci-test-shards-plan.json L7-8

Documentation

Record ADR-0105, its supersession of ADR-0063’s initial bounds, and the decision index entry.

  • docs/decisions/0063-complete-bounded-ci-test-shards.md L506-517
  • docs/decisions/0105-ci-selector-filter-and-argument-bounds.md L1-110
  • docs/decisions/README.md L150

Add the ADR-0105 acceptance and implementation record, including measurements and the outstanding hosted qualification gate.

  • docs/roadmap/phase-03-delivery-log.md L512, L534, L25483-25506

Tests

Move shard boundary and oversize-filter controls to the new limits while preserving refusal behavior.

  • scripts/test-ci-test-shards.py L361-377, L719

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CI selector filter limit increases to 65,536 bytes, and the argument-vector limit increases to 131,072 bytes. The plan, validator, tests, ADRs, and delivery log reflect these limits. Oversize inputs remain refused before spawning.

Changes: CI selector bounds

Layer / File(s) Summary
Record the bounds decision
docs/decisions/0105-ci-selector-filter-and-argument-bounds.md, docs/decisions/0063-complete-bounded-ci-test-shards.md, docs/decisions/README.md, docs/roadmap/phase-03-delivery-log.md
ADR-0105 records the increased limits and retained shard rules. The ADR index and ADR-0063 amendment reflect the decision. The delivery log records the measurements behind it.
Apply and verify the bounds
scripts/ci-test-shards-plan.json, scripts/ci-test-shards.py, scripts/test-ci-test-shards.py, docs/roadmap/phase-03-delivery-log.md
The plan and validator use the new limits. Tests check the accepted boundaries and refusal beyond them, including refusal before spawning. The delivery log records implementation and notes that complete hosted A/B qualification remains outstanding.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 86030

This change raises the CI selector filter and argument size limits so a previously refused shard filter fits. Oversize inputs are still refused before any process starts. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci: raise the selector filter and argument bounds (ADR-0105)" matches the main change. The changeset raises the CI selector-filter bound from 32 KiB to 64 KiB and the total argument-vector …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "ci: raise the selector filter and argument bounds (ADR-0105)" matches the main change. The changeset raises the CI selector-filter bound from 32 KiB to 64 KiB and the total argument-vector bound from 64 KiB to 128 KiB in the plan JSON, the validator, the boundary tests, and the ADR documents. The title is specific, uses a conventional commit prefix, and names the ADR for traceability. It is 60 characters and 9 words, which is concise.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: cd17a8ab-81ec-4e9c-ba58-3228e26fabba
Commits

Reviewing files that changed from the base of the PR and between 0a2de9b and 86030d2.

Files selected for processing: 7

  • docs/decisions/0063-complete-bounded-ci-test-shards.md
  • docs/decisions/0105-ci-selector-filter-and-argument-bounds.md
  • docs/decisions/README.md
  • docs/roadmap/phase-03-delivery-log.md
  • scripts/ci-test-shards-plan.json
  • scripts/ci-test-shards.py
  • scripts/test-ci-test-shards.py

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@sourcery-ai sourcery-ai 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/test-ci-test-shards.py" line_range="368" />
<code_context>
         expression = OWNER.filter_for('ordinary-0', 'tests', cases, self.plan)
-        cases[-1]['method'] += 'x' * (32768 - len(expression.encode()))
-        self.assertEqual(32768, len(OWNER.filter_for('ordinary-0', 'tests', cases, self.plan).encode()))
+        cases[-1]['method'] += 'x' * (65536 - len(expression.encode()))
+        self.assertEqual(65536, len(OWNER.filter_for('ordinary-0', 'tests', cases, self.plan).encode()))
         cases[-1]['method'] += 'x'
</code_context>
<issue_to_address>
**Shard boundary test fails**

When the shard test suite runs the new 64-KiB boundary control, `filter_for` validates the cases before checking the filter size, so the padded final method is rejected as `selector_unsupported` rather than reaching the expected `filter_bound`; the boundary test fails.

Build the boundary expression using multiple methods whose individual lengths remain within the selector limit.
</issue_to_address>

### Comment 2
<location path="scripts/ci-test-shards.py" line_range="100" />
<code_context>
     require(plan['salt'] == 'LearnStack.CI.B.v1' and integer(plan['defaultMethodMs'], 1, 86400000),
             'plan_estimate_invalid')
-    require(plan['bounds'] == {'filterBytes': 32768, 'argvBytes': 65536}
+    require(plan['bounds'] == {'filterBytes': 65536, 'argvBytes': 131072}
             and all(type(x) is int for x in plan['bounds'].values()), 'plan_bounds_invalid')
     sources = plan['sources']
</code_context>
<issue_to_address>
**Hosted test discovery fails**

When the hosted `dotnet test` or vendor-host chain rejects or alters selector filters above 32 KiB, `selected_discovery` and `shard_dotnet` pass the larger filter to `dotnet test`; discovery then fails, leaving the shard run incomplete or red. There is no smaller-filter fallback, and selection correctly does not run unfiltered.

Keep the selector limit at 32 KiB unless the hosted test chain is verified to support larger filters.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: scripts/test-ci-test-shards.py:368, scripts/ci-test-shards.py:100


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread scripts/test-ci-test-shards.py Resolved
Comment thread scripts/ci-test-shards.py Resolved
@cemililik
cemililik changed the base branch from development to main November 21, 2026 13:31
@cemililik cemililik closed this Nov 21, 2026
@cemililik cemililik reopened this Nov 21, 2026
cemililik added a commit that referenced this pull request Nov 21, 2026
Record PR #46's merge, the final-head layout A run beside the four
hosted-only faults the pull request exposed, and the evidence that stays
open: layout-B and pair qualification (the filter ceiling is ADR-0105, PR
#47), the maintainer items and the pre-commit worktree note. Mark P03-9
complete in the phase Status block and close G13 and G14's rows, bring
the README's Identity row up to the delivered packet and point the
ADR-0099 index row at Amendments 10 to 13.

ADR: 0069
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cemililik
cemililik merged commit 8ac1428 into main Nov 21, 2026
60 of 81 checks passed
cemililik added a commit that referenced this pull request Nov 21, 2026
PR #47 merged as 8ac1428. The record carries the hosted layout A and B
result on the reviewed source, a direct 64 KiB and 131,000-byte filter check
on the runner image, the Sourcery dispositions, the unfinished runs on the
merge commit and on main after #46, and why the P03-9 pair gap stays open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant