ci: route the base-std docs tree, skip deleted sources, report unrouted files - #1938
Merged
Conversation
base-std#213 (be6d045) deleted the flat docs/B20, docs/PolicyRegistry and docs/ActivationRegistry pages and added an audience-layered docs/ tree. The route table mapped only the six deleted files, so the sync edited their target pages from an all-minus diff (adding "source file removed" banners to reference pages generated from an unchanged interface) and dropped the fifteen new files without a trace (#1928). Route table - Retire the rules for the deleted files. Add rules for overview.md, architecture.md, concepts/*, guides/*, reference/*, placed where docs/ia-guidelines.md and docs/content-guidelines.md put that content: chain-generic precompile mechanics on Base Protocol > Execution, the B20 component map and key concepts on the specification overview, execution and versioning guarantees on the invariants page, how-to guides on the existing Build on Base task pages, reference tables on the B20 supporting pages. - New `ignored` kind for upstream scaffolding (README, guide template, interface link index) so it stays out of the unrouted report. Sync script - `removed_paths`: derived by the workflow from the commit API for the verified sha (renames count their previous name). Removed files never route. - `classifyChangedPaths` buckets every changed path as routed, ignored, unrouted or removed; the PR body gains "Unrouted source files" and "Removed source files" sections. When nothing routes, the workflow files the report as an issue, one per source sha. - Placement proposals: unrouted Markdown sources go through one Haiku call that reads the IA and content guidelines plus the existing Specifications and Build on Base page list, and names the existing page each file belongs on with the guideline rule that decides it. Proposals are filtered against the candidate list; nothing creates a page. GUIDELINE_ROUTING=apply also edits the proposed pages. - `validateCallouts` rejects Warning/Note/Info/Tip callouts that talk about source files, restructures or "last known state"; prompt rules 10 and 11 say the same and let the sync replace a "Generated B20 reference for" placeholder description. Tests cover the new routes against the real be6d045 file list, removed path exclusion, classification, proposal filtering, the routing report and the callout guard. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VNDYZpZXLaTr6iQraqkXyf
Collaborator
✅ Heimdall Review Status
|
4 tasks
Only hyperlink source paths made of plain path characters in the routing report; anything else renders as inert code so a crafted filename cannot close the markdown link. Cap removed_paths in the script (200 entries, 512 bytes each) and make the workflow overwrite the field for every non-release dispatch, so the payload can never supply it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VNDYZpZXLaTr6iQraqkXyf
haardikk21
approved these changes
Sep 8, 2026
soheimam
added a commit
that referenced
this pull request
Sep 8, 2026
…ed files (#1938) * Route the base-std docs tree and report unrouted or removed sources base-std#213 (be6d045) deleted the flat docs/B20, docs/PolicyRegistry and docs/ActivationRegistry pages and added an audience-layered docs/ tree. The route table mapped only the six deleted files, so the sync edited their target pages from an all-minus diff (adding "source file removed" banners to reference pages generated from an unchanged interface) and dropped the fifteen new files without a trace (#1928). Route table - Retire the rules for the deleted files. Add rules for overview.md, architecture.md, concepts/*, guides/*, reference/*, placed where docs/ia-guidelines.md and docs/content-guidelines.md put that content: chain-generic precompile mechanics on Base Protocol > Execution, the B20 component map and key concepts on the specification overview, execution and versioning guarantees on the invariants page, how-to guides on the existing Build on Base task pages, reference tables on the B20 supporting pages. - New `ignored` kind for upstream scaffolding (README, guide template, interface link index) so it stays out of the unrouted report. Sync script - `removed_paths`: derived by the workflow from the commit API for the verified sha (renames count their previous name). Removed files never route. - `classifyChangedPaths` buckets every changed path as routed, ignored, unrouted or removed; the PR body gains "Unrouted source files" and "Removed source files" sections. When nothing routes, the workflow files the report as an issue, one per source sha. - Placement proposals: unrouted Markdown sources go through one Haiku call that reads the IA and content guidelines plus the existing Specifications and Build on Base page list, and names the existing page each file belongs on with the guideline rule that decides it. Proposals are filtered against the candidate list; nothing creates a page. GUIDELINE_ROUTING=apply also edits the proposed pages. - `validateCallouts` rejects Warning/Note/Info/Tip callouts that talk about source files, restructures or "last known state"; prompt rules 10 and 11 say the same and let the sync replace a "Generated B20 reference for" placeholder description. Tests cover the new routes against the real be6d045 file list, removed path exclusion, classification, proposal filtering, the routing report and the callout guard. * Harden the routing report and removed_paths handling Only hyperlink source paths made of plain path characters in the routing report; anything else renders as inert code so a crafted filename cannot close the markdown link. Cap removed_paths in the script (200 entries, 512 bytes each) and make the workflow overwrite the field for every non-release dispatch, so the payload can never supply it. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed? Why?
base/base-std#213 (
be6d045) restructured the upstream docs: it deleteddocs/B20/*,docs/PolicyRegistry/README.mdanddocs/ActivationRegistry/README.mdand added an audience-layered tree (overview.md,architecture.md,concepts/,guides/,reference/). Our route table mapped only the six deleted files, so the sync in #1928:<Warning>banners saying "the source filedocs/B20/Asset.mdhas been removed" on pages generated from an unchanged Solidity interface (batch-mint.mdxeven says the function is deleted upstream);update-ui-multiplier.mdxnow saysUIMultiplierUpdatedfires when the schedule matures; upstreamconcepts/multipliers.mdsays it fires when the schedule is recorded and maturation emits nothing);This PR fixes the automation so a re-dispatch of
be6d045produces the right PR. #1928 is closed in favor of that re-run.Route table (
scripts/sync-from-base-std/route-table.json)docs/ia-guidelines.mdanddocs/content-guidelines.md: chain-generic precompile mechanics →specifications/base-protocol/execution/precompiles.mdx; the B20 component map and key concepts →specification-overview.mdx; execution/versioning guarantees →invariants-tests.mdx; guides → the existing Build on Base task pages (apply-a-multiplier,announce-a-distribution,cancel-blocked-units,recover-funds, …); reference tables →constants-addresses.mdx/errors-events.mdx. No rule creates a page.ignoredkind for upstream scaffolding (READMEs, guide template, interface link index).Workflow (
.github/workflows/base-std-docs-sync.yml)removed_pathsinto the payload (renames count their previous name). Never taken fromclient_payload. Best-effort: an API failure logs a warning and leaves it empty.issues: write, added to theapplyjob only).GUIDELINE_ROUTINGrepo variable passed through (proposedefault /apply/off).Sync script (
scripts/sync-from-base-std/)classifyChangedPathsbuckets every changed path as routed / ignored / unrouted / removed; the PR body gains Unrouted source files and Removed source files sections.docs/specifications/anddocs/build-on-base/, and returns the existing page each file belongs on with the guideline rule that decides it. Proposals are filtered back against the candidate list, so a hallucinated path is dropped. Rendered as Proposed placement (from IA guidelines) for a maintainer to turn into a route-table rule.GUIDELINE_ROUTING=applyalso edits the proposed pages in the same run.validateCallouts(safety.mjs) rejects Warning/Note/Info/Tip/Check callouts that describe repository housekeeping (source files, restructures, "last known state", "verify against source"). Legitimate deprecation and behavior callouts pass. Prompt rules 10 and 11 say the same and let the sync replace aGenerated B20 reference for …placeholder description.scripts/validate-docs-structure.jsaccepts theignoredkind.Notes to reviewers
content-guidelines.mdhas no such page type, and its overview structure puts the architecture/component map on the spec overview. If the team wants a standalone page, that is a guideline change (Governance Owner gate), separate from this PR.specification-overview.mdx(10,045 chars) anderrors-events.mdx(13,851) are aboveMAX_REGENERABLE_CHARS(10,000), so the re-run will skip them with a logged reason. The overview Architecture section, the invariants for storage/versioning, the precompiles section and the four missing constants (ALL_FEATURES_PAUSED,MAX_SUPPLY_CAP,WAD_PRECISION,MAX_UI_MULTIPLIER) need a human-authored follow-up PR.page_templatestill targetsdocs/base-chain/specs/reference/b20/changelog/while every other rule targetsdocs/specifications/b20/.validate-safety.test.mjs.How has it been tested?
npm test(80 pass) andnpm --prefix scripts run test:base-std-sync(122 pass, 8 new tests: docs-tree routes against the realbe6d045file list, removed-path exclusion, classification buckets, proposal filtering, routing report, callout guard).node scripts/validate-docs-structure.jspasses (every routed page exists and is reachable fromdocs.json).applyjob has 18 steps andissues: write.[routing]buckets,sync-review.mdwritten with both sections,unrouted_count=1andtouched_count=0inGITHUB_OUTPUT, placement call fails gracefully.be6d045and check the new PR has no housekeeping Warnings, citesdocs/concepts/*/docs/guides/*/docs/reference/*in provenance, and lists only the four ignored files as unrouted-or-ignored.Screenshots
N/A (no user-facing changes)
🤖 Generated with Claude Code
https://claude.ai/code/session_01VNDYZpZXLaTr6iQraqkXyf