Skip to content

fix(hr): scope the blocked-compilation audit to the pass change-set (spec 054) - #23864

Merged
dr1rrb merged 3 commits into
masterfrom
dev/dr/hr-audit-changeset-scope
Jul 28, 2026
Merged

dr1rrb merged 3 commits into
masterfrom
dev/dr/hr-audit-changeset-scope

Conversation

@dr1rrb

@dr1rrb dr1rrb commented Jul 23, 2026

Copy link
Copy Markdown
Member

GitHub Issue: closes #23861

PR Type:

🐞 Bugfix

What changed? 🚀

Spec-first draft — this PR currently carries
specs/054-hotreload-audit-changeset-scope/spec.md; the implementation lands on this
branch by following it.

Summary: on a (no rude edit, 0 update) pass, HotReloadManager audits every project of
the solution
through TryGetCompilation — a pass can complete Failed on thousands of
errors from projects it never touched, and when that pass is the one correlated to the
originating UpdateFile request, the request reports failure for a change that was
applied. Planned per the spec: scope the audit to the projects owning the pass's changed
files (documents + additional documents), skip it when nothing resolves, and name the
audited projects in the blocked output line.

PR Checklist ✅

…hange-set

On a (no rude edit, 0 update) pass, HotReloadManager audits every project of
the solution through TryGetCompilation: a pass whose change-set touches a
single project can complete Failed on thousands of errors from unrelated,
never-validated projects - and since the pass can be the one correlated to the
originating UpdateFile request, the request reports failure for a change that
was applied. Scope the audit to the projects owning the pass's changed files
(documents + additional documents), skip it when nothing resolves, and name the
audited projects in the blocked output line.
Copilot AI review requested due to automatic review settings July 23, 2026 16:53
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 3m 7s —— View job


Review

  • Gather context and read spec file
  • Analyze spec for correctness, clarity, and consistency with AGENTS.md
  • Post inline findings
  • Update comment with summary

Summary

This is a spec-only PR — one new document, no implementation yet. The spec is technically sound: the problem statement is accurate (verified against the current HotReloadManager.cs implementation), the files parameter type matches what flows through ProcessSolutionChanged, and PathComparer / AdditionalDocuments patterns are consistent with the broader HotReload codebase.

3 inline findings, 0 blockers:

# Severity Topic
1 Low Broken relative links to specs 053 and 055 (directories don't exist yet — will 404 in the GitHub UI)
2 Medium Path-comparison asymmetry: solution.GetDocumentIdsWithFilePath for regular documents vs PathComparer.PathEquals for additional documents — inconsistent with the rest of the codebase and potentially wrong on Linux if casing differs
3 Nit R2's +N more cap is specified for file names but not for project names; R1 test plan misses the mixed in-solution/out-of-solution change-set case

The path-comparison issue (finding 2) is worth addressing in the spec before implementation — the rest of the codebase always reaches for PathComparer.PathEquals; prescribing GetDocumentIdsWithFilePath here without a note about why would likely produce code inconsistent with the surrounding patterns.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a spec-first design document (spec 054) for fixing Hot Reload’s “blocked-compilation audit” so that no-op passes are evaluated only against projects actually affected by the pass change-set, preventing unrelated/phantom errors from failing the pass and surfacing clearer output context.

Changes:

  • Introduces spec 054 describing scoping rules for the blocked-compilation audit to change-set-owned projects (including AdditionalDocument ownership).
  • Specifies updated user-facing output to include audited project(s) and edited file name(s), plus a concrete unit test plan.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

On a (no rude edit, 0 update) pass, HotReloadManager audited every project of
the solution via TryGetCompilation, so a pass could complete Failed on errors
from projects it never touched. When that pass was the one correlated to the
originating UpdateFile request, the request reported failure for a change that
had already applied.

Scope the audit to the projects owning the pass's changed files (documents and
additional documents), skip it entirely when the change-set resolves to no
project (falling through to NoChanges instead of failing on foreign projects),
and name the audited projects and edited files in the blocked output line. The
diagnostic walk inside the scoped projects is unchanged (same TryGetCompilation
+ GetDiagnostics, formatting, and WASM cap).

Implements spec 054; closes #23861.
Copilot AI review requested due to automatic review settings July 23, 2026 17:52
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 5m 2s —— View job


Review

  • Gather context
  • Read changed implementation files
  • Review spec for updates addressing prior findings
  • Review HotReloadManager.cs implementation
  • Review Given_HotReloadManager.cs tests
  • Post inline findings
  • Update comment with summary

Summary

The implementation correctly follows the spec. The core logic — ResolveAuditProjects scoping the compilation audit to change-set-owned projects, the CompilationAudit record struct, the (true, true) when … is { Errors.IsEmpty: false } pattern, and the FormatEditedFiles cap — is sound. The four spec-054 unit tests cover the specified cases and are well-structured (the warmCompilation harness flag cleanly solves the TryGetCompilation / GetCompilationAsync seam). Async discipline, cancellation handling, and conventional-commits formatting all check out.

3 inline findings:

# Severity Location Topic
1 Medium HotReloadManager.cs:351 GetDocumentIdsWithFilePath for regular documents vs PathComparer.PathEquals for additional documents — on Linux a path casing difference causes a regular source document to escape the audit silently; prior spec review flagged this and the implementation carried it over unchanged
2 Low HotReloadManager.cs:330 WASM cap early-return passes the full resolved-projects list to CompilationAudit.AuditedProjects, which can name projects that were never iterated — the output line says "blocked in A, B, C" even if only A was checked before the cap fired
3 Nit Given_HotReloadManager.cs:420 Mixed change-set test (some files resolve, some don't) still absent; the existing four tests don't catch an implementation that returns early on the first unresolvable file

The broken spec links to specs 053 and 055 (lines 6–7 of spec.md) remain from the first-pass review; no change there.

Verdict: fix-first for finding 1 (the path-comparison asymmetry is a genuine correctness gap that the surrounding codebase has already solved with PathComparer), nit for the rest.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 223890 has failed on Uno.UI - CI.

- Resolve audited projects through PathComparer.PathEquals for both regular and
  additional documents (drop GetDocumentIdsWithFilePath), matching the rest of the
  pipeline and closing a Linux path-casing gap where a source document could escape
  the scope; index the change-set once for an O(1) per-document lookup.
- Name only the projects that actually produced an error, ordered, so the blocked
  line is deterministic and the WASM early-return can't list an unexamined project.
- Order the edited file names before the first-3 + "+N more" cap.
- Add a mixed change-set test (one resolved file + one unknown path) guarding against
  a short-circuit on the first unresolvable file.
- Spec: reference forthcoming specs 053/055 without broken links, align R1 on
  PathComparer, clarify the byte-for-byte scope and uncapped project names, add
  test case 5.
@dr1rrb
dr1rrb marked this pull request as ready for review July 23, 2026 22:16
@dr1rrb
dr1rrb enabled auto-merge July 23, 2026 22:16
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 6m 26s —— View job


Review

  • Gather context and read previous review findings
  • Read changed implementation files (spec, HotReloadManager.cs, tests)
  • Verify prior findings and check for new issues
  • Post inline findings
  • Update comment with summary

Summary

Verdict: fix-first

The core scoping logic is correct — ResolveAuditProjects + the (true, true) when … is { Errors.IsEmpty: false } pattern match + the CompilationAudit record are sound, and the four spec-054 unit tests (especially the warmCompilation harness seam) are well-constructed. Async discipline, cancellation handling, and conventional-commit formatting are clean.

However, five of the six findings from prior review rounds are not reflected in the current code, despite author comments marking them as fixed. The branch has only two commits (both from before any reviews ran), so the "Fixed" responses appear to be forward-looking acknowledgements rather than pushed changes.

5 inline findings posted:

# Severity Location Topic
1 Medium HotReloadManager.cs:330 WASM cap names full auditedProjects (including unexamined B, C, …) — output can say "blocked in A, B, C" when only A was checked
2 Medium HotReloadManager.cs:351 GetDocumentIdsWithFilePath for regular docs vs PathComparer.PathEquals for additional docs — inconsistent with the rest of the pipeline
3 Low HotReloadManager.cs:240 Project names in the output line are non-deterministic (iterated from HashSet<ProjectId>)
4 Low HotReloadManager.cs:384 FormatEditedFiles doesn't sort before the first-3 cap — +N more hides different files across runs
5 Low spec.md:7 Broken relative links to spec 053 and spec 055 (directories don't exist yet)
6 Nit Given_HotReloadManager.cs:420 Mixed change-set test (some files resolve, some don't) absent from both the spec test plan and the test file

Findings 1, 3, and 4 have one-line suggestion blocks in the inline comments.

Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved
Copilot AI review requested due to automatic review settings July 23, 2026 22:42
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 2m 36s —— View job


Review

  • Gather context from previous reviews
  • Read current state of changed files
  • Verify whether prior findings were addressed
  • Post inline comments for remaining issues (none)
  • Update comment with summary

Summary

Verdict: ship — all six findings from prior review rounds are addressed in 62e3f6ec.

# Prior finding Status
1 spec.md: broken relative links to specs 053 and 055 ✅ Now (forthcoming) text references
2 spec.md: missing mixed change-set test case ✅ Test case 5 added to spec plan
3 ResolveAuditProjects: GetDocumentIdsWithFilePath vs PathComparer.PathEquals asymmetry ✅ Both document kinds now use PathComparer.PathEqualityComparer via HashSet.Contains
4 WASM cap named unexamined projects (auditedProjects) ✅ Now returns [.. blockingProjects] — only projects that produced errors
5 Non-deterministic project names in output line ✅ blockingProjects is SortedSet<string>(StringComparer.Ordinal)
6 FormatEditedFiles didn't sort before the +N more cap ✅ .OrderBy(name => name, StringComparer.Ordinal) applied before .Take(maxNamed)

The implementation is correct: ResolveAuditProjects builds a PathComparer-keyed HashSet once from the change-set (O(1) lookups per document), then GetCompilationErrors iterates only the resolved projects accumulating blockingProjects as errors are found — so both the WASM early-return and the final return name exactly the projects that were actually examined and produced errors. The five spec-054 unit tests cover the pure extremes and the mixed case. Async discipline, cancellation, and conventional-commit formatting are clean throughout.

Note: CI build 223890 failed before this latest commit. The CI status should be re-verified against 62e3f6ec.

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@unodevops

Copy link
Copy Markdown
Contributor

@autocarl autocarl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of the current head; hosted checks are green. The scoping, deterministic summaries, WASM cap handling, and regression tests otherwise look sound. One Unix path-normalization gap still prevents approval.

Comment thread src/Uno.HotReload/HotReloadManager.cs Resolved

@carldebilly carldebilly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dr1rrb
dr1rrb merged commit 992d29f into master Jul 28, 2026
54 checks passed
@dr1rrb
dr1rrb deleted the dev/dr/hr-audit-changeset-scope branch July 28, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HR] Blocked-compilation audit judges the whole solution on passes that did not touch it

5 participants