Skip to content

Keep composed static redirects within the 2,000-rule limit - #148

Merged
batuhan merged 2 commits into
mainfrom
docs/fix-redirect-budget
Nov 24, 2026
Merged

batuhan merged 2 commits into
mainfrom
docs/fix-redirect-budget

Conversation

@batuhan

@batuhan batuhan commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The composed Website + Docs site exceeded the 2,000 static redirect rule limit (2,002 / 2,000) after #147 added /space-connectors → /connectors (+ its .md twin). scripts/redirect-rules.mjs reserved 120 static rules for the Website, whereas spacefast/www declares 124 static rules, so docs CI didn't catch the overflow before composition.

Changes

  • Kept /space-connectors → /connectors (and /space-connectors.md → /connectors.md) in redirects.ts so existing links from the earlier /space-connectors route keep resolving.
  • Updated compressOperationAliases in scripts/redirect-rules.mjs to add one fallback splat per legacy /operations/ namespace for its largest tag (spaces) while verifying more-specific prefixes against all original static rules so no rule is shadowed. This cuts Docs routing rules from 1,963 down to 1,792 (205 static slots of headroom on the composed Website + Docs site).
  • Raised websiteStaticRuleReserve in scripts/redirect-rules.mjs from 120 to 124 and counted redirect rules (status !== 200) separately from Docs' mount rewrites so verifyRoutingBudget matches the composed Website + Docs static limit.
  • Updated scripts/redirect-rules.test.mjs to test the composed budget against 124 Website static redirects alongside Docs' standalone two-hop rewrite check.

Verification

  • All 9 spacefast/docs checks passed (verify:generated, check, validate, build, test:docs 40/40, audit, verify:public-safety, verify:prose, verify:routes).
  • Verified composed routing directly against latest spacefast/www main's sf.jsonc via compileRoutingFilesWasm: 1,795 static redirects, 98 dynamic redirects, 1,893 total, 0 errors, and 0 mismatches across all 3,507 generated redirects plus /docs/space-connectors and /docs/space-connectors.md.

…tors redirect and matching www's 124-rule reserve
@spacefast
spacefast Bot temporarily deployed to preview/docs/fix-redirect-budget November 24, 2026 22:50 Inactive
@indent

indent Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Issues

All clear! No issues remaining. 🎉

1 issue already resolved
  • /docs/space-connectors is currently published (www pins a Docs commit that includes the page, and it returns 200). Consolidate Connectors documentation into a single /connectors guide #147 deleted the page and added this redirect to /connectors; removing it means the URL and its .md twin will 404 once www picks up the new pin. Keep the redirect and free a static slot elsewhere, since the budget is now exactly 1876/1876. (fixed by commit 77710b3)
    Found by Indent Review Agent

CI Checks

All required CI checks passed on 77710b3.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found in the redirect budget fix
Full results

Indent Review Agent

  • Summary: No issues found in the redirect budget fix
  • Last ran on commit: 77710b36
  • Latest result
    {
      "summary": "No issues found in the redirect budget fix",
      "findings": []
    }

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request removes the /space-connectors redirect and updates routing budget limits. The budget checker and tests exclude status-200 rules from static and total counts.

Changes: Routing rules

Layer / File(s) Summary
Remove obsolete redirect
redirects.ts
The /space-connectors to /connectors 301 redirect is removed.
Update routing budget accounting
scripts/redirect-rules.mjs, scripts/redirect-rules.test.mjs
The Website static-rule reserve increases from 120 to 124. Static and total counts exclude status-200 rules; dynamic counts still include all dynamic rules. Tests check the Website and Docs compilations with status-200 rules excluded.

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

Change: Bug fix

Merge Risk: Minimal · up to e52e4

This change keeps the composed redirect rules within the platform limit by removing a temporary redirect and correcting the budget accounting. No actionable merge-blocking risk was identified.

Security architecture risk: Minimal · up to e52e4

The change removes a legacy redirect and its Markdown counterpart, and corrects how Docs checks its share of the combined routing limit. The inspected changes do not add a request path or weaken an access control.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected change removes two public redirect entries without adding a destination or changing the standalone /docs mount mappings. The verifier change does not add a path from request input to privileged operations; it checks repository-generated rules before publication.

Trust Boundaries and Controls

  • observed — The generator refuses to replace an existing unmarked redirect overlay and checks the candidate ruleset before writing the redirect artifact. The PR changes the budget calculation, not the ownership check or the order of these steps.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: keeping composed Website and Docs static redirects within the 2,000-rule limit. The objectives say the PR removes /space-connectors, raises the Website static rule res…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: keeping composed Website and Docs static redirects within the 2,000-rule limit. The objectives say the PR removes /space-connectors, raises the Website static rule reserve from 120 to 124, and counts only redirect rules (status !== 200) separately from Docs mount rewrites. The title does not mention these specific edits, but it describes the goal they serve. It is concise, specific, and has no file lists or vague terms.

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: Advanced
  • Run ID: d907b179-6a80-4900-be99-282f4480ae7a
Commits

Reviewing files that changed from the base of the PR and between 8445172 and e52e4f7.

Files selected for processing: 3

  • redirects.ts
  • scripts/redirect-rules.mjs
  • scripts/redirect-rules.test.mjs
Files with no reviewable changes: 1

  • redirects.ts

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

Comment thread redirects.ts Resolved
@spacefast
spacefast Bot temporarily deployed to preview/docs/fix-redirect-budget November 24, 2026 22:58 Inactive
@batuhan
batuhan merged commit 066c2c3 into main Nov 24, 2026
7 checks passed

This branch was previously deployed

1 inactive deployment
preview/docs/fix-redirect-budget — 77710b36 Deployed Nov 24, 2026 by spacefast[bot]
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