SDK bundles ship generated excerpts of [arch]-cited architecture docs - #3914
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes installed SDK bundles having dangling [arch] citations by generating and shipping banner-marked excerpts of the cited ARCHITECTURE*.md sections at build/install time, keeping LINT026 and MCP architecture navigation functional in the installed SDK.
Changes:
- Add
utils/internal/arch-extracttool + tests to generate excerptARCHITECTURE*.mdfiles from[arch]citations. - Register shipping trees (daslib + select modules) via
DAS_ARCH_EXTRACT_SPECSand install extracted excerpts alongside shipped code. - Re-arm LINT026 in bundle smoke tests and update leak gates to allow only banner-marked generated architecture excerpts.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| utils/mcp/tools/arch_common.das | Removes local section_text implementation; relies on shared arch citation utilities. |
| utils/common/arch_citations.das | Adds section_span and re-homes section_text for shared use by tools/lint/extractor. |
| utils/internal/arch-extract/main.das | New extractor tool that scans shipped .das for citations and emits excerpt .md files. |
| utils/internal/arch-extract/tests/test_arch_extract.das | New tests covering excerpt content/order/nesting, incremental cleanup, and error cases. |
| utils/CMakeLists.txt | Adds arch-extract tests to the utils test target list. |
| CMakeLists.txt | Adds arch-extract spec processing, build-time generation, installation, and leak-gate banner exception. |
| modules/dasVulkan/CMakeLists.txt | Registers dasVulkan tree for excerpt extraction/installation. |
| modules/dasSpirv/CMakeLists.txt | Registers dasSpirv tree for excerpt extraction/installation. |
| modules/dasMetal/CMakeLists.txt | Registers dasMetal tree for excerpt extraction/installation. |
| modules/dasLLAMA/CMakeLists.txt | Registers dasLLAMA tree for excerpt extraction/installation. |
| ci/smoke_test_bundle.sh | Enables LINT026 on daslib in the bundle; adds per-module excerpt closure lint; allows generated excerpts through leak gate. |
| CLAUDE.md | Documents the new “generated excerpts ship with SDK” rule for [arch]-cited architecture docs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The rule-doc install ban left every shipped [arch] citation dangling in a bundle: LINT026 fired on daslib (masked by --disable in the smoke test), and the MCP arch_of tool returned dead pointers for shipped code. utils/arch-extract resolves a tree's citations with the shared LINT026 scanner and emits banner-marked excerpts - the cited sections only, in document order, a cited anchor nested inside an emitted section skipped so the excerpt declares each anchor once. Shipping trees register on the DAS_ARCH_EXTRACT_SPECS global property beside their install rules (daslib, dasVulkan, dasMetal, dasSpirv, dasLLAMA); the root processor extracts at build time and installs the excerpts, and both leak gates admit only banner-marked ARCHITECTURE*.md. The smoke test now lints daslib with LINT026 armed and adds a closure lint per module excerpt - the bundle proof that every shipped citation resolves and every shipped anchor is cited. section_text moves from utils/mcp/tools/arch_common.das to utils/common/arch_citations.das (public re-export, no call-site changes) so the extractor and the tools share one resolution semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mq9AKyoAwvD5T1cigTnRw
borisbat
force-pushed
the
bbatkin/sdk-arch-extract
branch
from
August 31, 2026 21:57
07bf3a8 to
8b881de
Compare
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.
Installed SDK bundles carried dangling
[arch]citations. The rule-document install ban keeps everyARCHITECTURE*.mdout of the bundle, but shipped.dastrees cite those documents. The smoke test hid the problem by running the daslib lint with LINT026 disabled, and the shipped MCParch_oftool returned dead pointers for shipped code - the mechanism text that replaced comments was unreachable in an installed SDK.The fix generates excerpts at build time.
utils/internal/arch-extractresolves a tree's citations with the same scanner LINT026 uses and writes a banner-marked excerpt per cited document: the cited sections only, in document order, each anchor declared once (a cited anchor nested inside an emitted section rides its parent). Each shipping tree registers a"scan|base|dest"spec on theDAS_ARCH_EXTRACT_SPECSglobal property beside its own install rules - daslib, dasVulkan, dasMetal, dasSpirv, dasLLAMA - so a config that installs the citing tree also installs its excerpt, and a config that omits the tree installs neither. Both leak gates (the install-manifest check and the smoke-test find) admit onlyARCHITECTURE*.mdwhose first line carries the generated banner. The smoke test now lints daslib with LINT026 armed and adds one closure lint per module excerpt: the proof that every shipped citation resolves and every shipped anchor is cited.section_textmoved fromutils/mcp/tools/arch_common.dastoutils/common/arch_citations.das(with a newsection_spanunder it); the public re-export keeps call sites unchanged.Where to look: the registry processor above the leak gate in the root
CMakeLists.txt;emit_excerptinutils/internal/arch-extract/main.das(the nested-anchor skip); the closure loop inci/smoke_test_bundle.sh.Validation, claims, ledger
Validation
cmake --install+ci/smoke_test_bundle.shon a Ninja Release tree (dasLLAMA/dasMetal/dasSpirv on): all arch rows green - daslib lint with LINT026 armed, three per-module closure lints, both leak gates accepting the 11 excerpts. Three unrelated rows fail on this config as they always would (vulkan example/tutorial, Z3/VULKAN/VOLK licenses - dasVulkan and dasSMT not built locally); CI's bundle_smoke covers them.lint.exerun): 23 citations, 4 sections, 0 issues..dasrecursion fixture, unexercised root-containment guard).Claims - stated, not tested
lint.exeand never run the smoke test, so no gate regresses; behavior is unchanged from before this PR. A break would look like LINT026 findings from a target-built lint run over a cross-built SDK..dasare skipped by the scan, mirroring LINT026's own walk; a_*.dasthat installs with a citation would dangle. No such file exists in any registered tree.Not done
arch(at=in bundle.dasoutside excerpt-covered folders (would catch a future module whose install rules land without a spec registration).🤖 Generated with Claude Code