fix(desktop): harden the renderer architecture ratchet base comparison - #4584
Open
chihumyum wants to merge 1 commit into
Open
fix(desktop): harden the renderer architecture ratchet base comparison#4584chihumyum wants to merge 1 commit into
chihumyum wants to merge 1 commit into
Conversation
Add a --strict-base flag that turns the silent fallback to the committed base ledger (the pre-apache#4249 behaviour that wedged CI in apache#4250) into a hard failure, and pass it from the CI step that supplies --base. When the checker script differs from the base commit, also measure both trees with the base commit's checker and ratchet those results, so a change cannot weaken a rule and lower both sides of the comparison at once. Cover the base-tree derivation with git-fixture integration tests. Generated-by: Claude Code
chihumyum
force-pushed
the
fix/renderer-architecture-strict-base
branch
from
September 2, 2026 19:24
a8721f4 to
54bc30f
Compare
Contributor
Author
|
The first CI run failed only in Storybook smoke, on the Automated update from Claude Code on behalf of the PR author. |
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.
Summary
Three follow-ups to #4249's base-tree ratchet, so the guard fails loudly and cannot be lowered from one side.
--strict-base: when the base commit's tree cannot be materialized or analyzed, the check fails instead of silently falling back to the base's committed ledger (the pre-fix(desktop): ratchet renderer debt against the base tree, not its ledger #4249 behavior that wedged CI in CI red on main: "Check renderer architecture" fails from a stale renderer-architecture ledger #4250). CI now passes the flag; local runs without it are unchanged.check-renderer-architecture.mjsitself differs from the base commit, the base version is imported and itsgenerateArchitectureConfigis run over both trees, and the currentvalidateMonotonicDebtcompares the two. Debt that the base rules would have flagged fails as abase-checker cross-check:violation, so one PR cannot weaken a rule and lower both sides of the ratchet at once. Nothing extra runs when the script is unchanged.--strict-basefails when the base cannot be materialized, and the cross-check catches a weakened checker.Refs #4582
Verification
node --test apps/desktop/scripts/check-renderer-architecture.test.mjs— 78 tests (71 existing + 7 new), 0 failuresnpm run check:renderer-architecture -- --base upstream/main— passes; because this PR changes the script, the output shows the cross-check running (… differs from upstream/main; cross-checked debt under the base checker.)npm run check:renderer-architecture(no base) — passesscripts/*workflow-policy*.test.mjs) — 69 tests, 0 failuresnpm run check:asf-headers, Biome lint on both scripts,git diff --check— cleanrenderer-architecture.jsonis untouched. Run under Node 24 (identical under Node 22).Review focus
--strict-base, a base checker that exists but cannot be imported, or whose generator throws on either tree, fails closed; a base checker with nogenerateArchitectureConfigexport, or whose output does not fit the current ledger schema, is a notice-and-skip in both modes. Consequence: a PR that makes the old checker unable to analyze the new tree must land the checker change first. Easy to flip if the other default is preferred.validateMonotonicDebtitself is not covered; that stays a review concern.@babel/parserresolves, and removed infinally;.gitignorecovers a crash mid-run.import.meta.url === pathToFileURL(argv[1])guard is realpath-sensitive, so invoking it through a symlinked path is a silent no-op. The fixtures userealpath.AI use
Select exactly one:
Tool(s) and scope: Claude Code — implementation, tests, and local validation. The commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?