test: drop low-value import-boundary guard and CSS-contract suites - #2425
Merged
Conversation
Remove pure architecture-guard meta-tests that scan the source import graph with typescript/unstable/ast to enforce whitelists: - runtime-host dependency-boundary (424L / 5 cases) - storage root-authority-dependency (228L / 3 cases) - headless headless-storage-dependency (196L / 3 cases) - cli runtime-host-run-dependency (477L / 2 cases) These are dev-time composition audits, not product behavior tests; they also flake under parallel workspace runs (the runtime-host suite failed 30+ cases only when co-scheduled). Product guard coverage is preserved by the remaining behavioral suites.
These tests parse the renderer CSS text with postcss and assert exact selector/declaration shapes (ladders, gutters, ligatures, quote-layer geometry, picker menus). They are brittle pixel/order locks on Astryx's stylesheet, not behavior: they re-read source CSS and pin values the design system owns. The behavior contracts (app-shell-effect-stability, ui-render-memo-boundary, dock-presentation, window-reveal, cursor clock) are kept, as are the shared css-test-helpers consumers that exercise real window/DOM behavior.
jackwener
force-pushed
the
test/trim-low-value-suites
branch
from
August 7, 2026 10:12
657c3da to
0f2ca8a
Compare
jackwener
added a commit
that referenced
this pull request
Aug 7, 2026
main has been red on `knip --workspace apps/desktop` since #2425, with `format:check` red alongside it, which drags every open PR's typecheck job red too (PR CI runs the branch merged with main). The knip half is leftovers, not new decisions: - #2425 deleted the CSS-contract suites but kept their helpers, so `assertCssRuleDecls` and `parseCssBlocks` lost their only callers. Removing them orphans the whole scanning subtree behind them (`cssRuleBody`, `splitSelectorList`, `stripCssComments`, the postcss block walk and the `CssBlock` type), which goes with them; `postcss` was that subtree's only use in this workspace and leaves devDependencies. What the file still owes its callers is `REPO_ROOT` and `readAllRendererCss`, which stay. - #2426 removed the Voice module end-to-end, but `provider-connection-dialog` was reachable only from the deleted `voice-settings-page` and survived it. The format half is just the formatter over three files that landed without it: `tool-free-model-call.ts`, and `bootstrap-connections.ts` + `connection-store.test.ts` from #2431. No behaviour change in any of this.
jackwener
added a commit
that referenced
this pull request
Aug 7, 2026
) main has been red on `knip --workspace apps/desktop` since #2425, with `format:check` red alongside it, which drags every open PR's typecheck job red too (PR CI runs the branch merged with main). The knip half is leftovers, not new decisions: - #2425 deleted the CSS-contract suites but kept their helpers, so `assertCssRuleDecls` and `parseCssBlocks` lost their only callers. Removing them orphans the whole scanning subtree behind them (`cssRuleBody`, `splitSelectorList`, `stripCssComments`, the postcss block walk and the `CssBlock` type), which goes with them; `postcss` was that subtree's only use in this workspace and leaves devDependencies. What the file still owes its callers is `REPO_ROOT` and `readAllRendererCss`, which stay. - #2426 removed the Voice module end-to-end, but `provider-connection-dialog` was reachable only from the deleted `voice-settings-page` and survived it. The format half is just the formatter over three files that landed without it: `tool-free-model-call.ts`, and `bootstrap-connections.ts` + `connection-store.test.ts` from #2431. No behaviour change in any of this.
This was referenced Aug 7, 2026
6 tasks
Astro-Han
added a commit
that referenced
this pull request
Aug 21, 2026
styles.css told readers the "compact == transcript" assumption was held by `__tests__/markdown-rhythm-dom-contract.test.tsx`. That file was deleted in claiming a guard that does not exist — the worst state to leave an assumption in, since the next person reads the citation and stops looking. Restore the two assertions the comment is actually about, plus the ladder order #2348 exists to protect, in ONE file. Split across two they each stayed green against the half they could not see, which is how the stylesheet half got deleted without anything noticing: - the ladder is declared on the --space-* scale in strictly increasing order (retuning a rung is a design call and stays green; list gaps meeting block gaps fails) - every rung declared is actually spent by a rule, so the ladder cannot become decoration while literals do the spacing - the runtime hooks the selectors need are really emitted by MarkdownBody — data-maka-contract, data-density, astryx-markdown-heading, data-level, astryx-list-item. These names have a single upstream owner in Astryx and appear in Maka only inside selectors, so a rename kills every rule at once with nothing failing - compact markdown still has exactly one caller, which is the bet the comment names: the table carries heading TYPOGRAPHY on a density key, and Astryx's own RFC says density must not do that Why these are not what #2425/#2462 retired. Those PRs removed markup/copy pins, duplicate presentation assertions and CSS-structure suites that asserted how a rule was written. Nothing here asserts an appearance or a rule's shape: three of the four are relations that must survive any retune, and the fourth renders the real component and checks the join between Astryx's output and Maka's selectors. Deliberately left unpinned, because they ARE how the table is written: the adjacent-sibling gap form, the `hr` rung, the ListItem padding reset, and the two heading size tiers. The stylesheet-reading half no longer revives the deleted desktop css-test-helpers module or the renderer-wide CSS aggregate it read; it reads packages/ui/src/styles.css directly, in the package that owns it. Seven mutations, each verified to fail the assertion that describes it: inverting the ladder; taking a rung off the --space-* grid; hardcoding a rung's usage; hardcoding it while naming the rung in a comment (this is why comments are stripped first); renaming the contract wrapper; cutting density off before it reaches Astryx; and adding a second compact caller. Also state in the comment what the contract does and does not hold, so the next reader does not have to open the test to find out. Generated-by: Claude Code
6 tasks
Astro-Han
added a commit
that referenced
this pull request
Aug 21, 2026
styles.css told readers the "compact == transcript" assumption was held by `__tests__/markdown-rhythm-dom-contract.test.tsx`. That file was deleted in #2462 and its stylesheet-side sibling in #2425, so the comment has been citing a guard that does not exist — the worst state to leave an assumption in, since the next person reads the citation and stops looking. Restore only what cannot be noticed without a test. Both failure modes here are silent: no error, no failing check, just spacing that quietly stops being what the table declares, because a CSS selector that matches nothing never complains. - The table selects entirely on DOM Astryx generates at runtime — data-density, astryx-markdown-heading + data-level, astryx-list-item. Those names have one upstream owner and appear in Maka only inside selectors, so a rename kills every rule at once. Astryx is bumped regularly (0.4.0 in #2983, 0.4.3 in flight, plus the Dependabot minor group), so this is a recurring event, not a hypothetical. - Astryx's ListItem carries CONTROL row padding that `density` cannot reach from outside. That padding is what inverted the ladder in #2348 — list items ~10px apart against 4px paragraphs — and one rule neutralizes it. Lose the rule and the original defect returns, silently. - Plus the assumption the comment actually names: compact markdown still has exactly one caller. The table carries heading TYPOGRAPHY on a density key, which Astryx's own RFC says density must not do, so the key is honest only while `compact` and "transcript" are the same set. Deliberately NOT pinned: the ladder's declared values and their order. A first draft asserted them, and it was the wrong instinct — a reversed ladder has to be typed on purpose into four adjacent lines under a comment explaining the order, and it is visible the moment anyone looks at a transcript. It also would not have caught the defect it claimed to guard: #2348's inversion came from the ListItem padding above, which a test reading only the declared variables cannot see. Same for the adjacent-sibling gap form, the `hr` rung and the two heading size tiers — those are how the table is written, not what it promises. Why this is not what #2425/#2462 retired. Those PRs removed markup/copy pins, duplicate presentation assertions, and CSS-structure suites that asserted how a rule was written. Two of the three assertions here render the real component and check the join between Astryx's output and Maka's selectors; the third asserts an outcome the table promises, not a syntax. The stylesheet-reading half does not revive the deleted desktop css-test-helpers module or the renderer-wide CSS aggregate it read — it reads packages/ui/src/styles.css directly, in the package that owns it. Six mutations, each verified to fail the assertion that describes it: deleting the ListItem padding reset; un-zeroing it; un-zeroing it while naming the reset in a comment (this is why comments are stripped first); renaming the contract wrapper; cutting density off before it reaches Astryx; and adding a second compact caller. Generated-by: Claude Code
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.
概览
精简低价值的守卫/契约类测试套件,净删 2086 行、12 个文件,同时保留对真实行为的守卫覆盖。
变更内容
1. 删除 4 个 import 边界守卫套件(−1325 行)
纯架构守卫/元测试,用
typescript/unstable/ast扫描源码 import 图强制执行白名单:runtime-hostdependency-boundary.test.ts(424L / 5 cases)storageroot-authority-dependency.test.ts(228L / 3 cases)headlessheadless-storage-dependency.test.ts(196L / 3 cases)cliruntime-host-run-dependency.test.ts(477L / 2 cases)这些是开发期组合审计,而非产品行为测试;并且在并行工作区运行时会出现 flake(runtime-host 套件仅在共同调度时失败 30+ 个用例)。行为守卫覆盖由其余行为测试套件保留。
2. 删除 8 个纯 CSS 结构契约套件(−761 行)
用 postcss 解析渲染器 CSS 文本并断言精确的选择器/声明形态(阶梯、间距、连字、引用层几何、选择器菜单)。它们是对 Astryx 样式表的脆弱像素/顺序锁定,而非行为;行为契约(app-shell-effect-stability、ui-render-memo-boundary、dock-presentation、window-reveal、cursor clock)以及共享 css-test-helpers 的真实窗口/DOM 行为消费者均保留。
验证