Skip to content

Add MIT LICENSE file - #10

Merged
Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
add-license
Apr 17, 2026
Merged

Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
add-license

Conversation

@codemonkeychris

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • Verify GitHub detects the license and surfaces it on the repo landing page / About sidebar.

🤖 Generated with Claude Code

Sourced from microsoft/repo-templates shared/LICENSE.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit b3e126a into main Apr 17, 2026
2 checks passed
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 11, 2026
…; resolve symbol-binding

Doc-only updates across spec, task list, and reference doc to reflect the
decision that `mur check`'s did-you-mean engine is load-bearing
infrastructure for the next 1-3 years, not a token-saving stopgap base-
model improvements will erode.

Why now: Reactor will keep churning faster than models retrain, and WinUI
3 is structurally weak / cross-confused with WPF/Silverlight/WinUI 1/2 in
training data. The 525-run corpus directly evidences the confusion shape
(`.VerticalAlignment` on Reactor `*Element` types, `Theme.AppBackground`,
`.Style(...)`). Tier-2 fuzzy match cannot bridge those by edit distance;
only deterministic vocabulary-translation rules can.

Spec changes (038-mur-check-did-you-mean-design.md):
- §1: new "Why this is load-bearing" subsection with the two-condition
  argument and explicit sunset criterion (≥12mo API stability +
  ≥90% first-build-OK on ≥2 vendor-distinct models).
- §6: rename "induced pattern rules" → "induced and authored pattern
  rules"; split into Class A (induced, frequency-justified) and Class B
  (vocabulary-translation, structurally justified, frequency bar waived).
  Add the resolved symbol-binding decision: rules bind to Roslyn ISymbol
  references via RuleSymbolResolver, not name strings, with a CI gate
  that fails the build on unresolved rule targets.
- §11: two new risks — Reactor API churn invalidating rules/corpus, and
  data-pipeline SLA/owner — both with mitigations.
- §13 Phase 5: reframe from "only if needed" to "scheduled, deferred"
  pending Data Checkpoint D. Add explicit sunset criterion subsection.
- §14: resolve question #8 (symbol-binding decision recorded with
  rationale); add question #9 on vocab-table provenance; renumber
  project-size gate to #10.

Task list (tasks/038-mur-check-did-you-mean-implementation.md):
- Top: new "Framing (read this first)" section with the load-bearing
  argument and sunset criterion link.
- Phase 3: split rule template into Class A / Class B variants. Add §3.0
  pre-phase prerequisites (corpus-pipeline owner; minor-release refresh
  cadence; in-repo `038-vocab-table.csv`). Add §3.1a symbol-binding
  contract with CI gate. Update quantity gates + exit criterion for the
  two-class split.
- Phase 4: status change from "optional" to "scheduled, deferred until
  Data Checkpoint D"; escape hatch remains as the unexpected outcome.
- New "Maintenance (load-bearing operation)" section under cross-cutting
  concerns: API-churn protocol per Reactor minor; corpus freshness rule;
  per-rule accept-rate monitoring; annual sunset-readiness check.

Reference doc (docs/reference/mur-check-did-you-mean.md):
- §1: new "Why this is load-bearing" subsection mirrored from the spec.
- §9 Future improvements: new "The recurring failure mode: WinUI/WPF
  vocabulary confusion" subsection that names the structural failure
  shape, then reframes Phase 3 as Class A / Class B and Phase 4 as
  scheduled-not-optional. Symbol-binding decision called out.
- Out-of-scope (small LLM generator): reasoning now explicitly linked to
  the load-bearing argument (weak training data is why we need the
  system AND why a smaller model trained on it won't fix the gap).
- Glossary: new entries for Class A / Class B rule, Load-bearing,
  Sunset criterion. Validation Gate entry updated for the Class-B
  frequency-bar waiver.
- Closing: pointer to the new task-doc Maintenance section.

No code changes in this commit; all infrastructure decisions documented
here will land in Phase-3 rule PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 11, 2026
Quality and self-consistency pass on the Phase-1 branch. All changes are
contained to Phase-1 surface; broader CR concerns about CS1061/CS0117 fuzzy
behavior, MSBuild-accurate loading, and per-code precision gating remain
scoped to Phase 2/3 per the spec's existing plan.

- CR #10: drop CS8602 warning in CompilationLoader by routing EmptyCompilation
  through a named factory method with explicit Array.Empty<> coalescing.
- CR #11: diagnostic regex now uses a reluctant file capture anchored on the
  (line,col): suffix so MSBuild lines with parenthesized path segments parse
  correctly. Added pipeline test.
- CR #8: TraceWriter.SanitizePath normalizes in-root absolute paths to
  project-relative (forward-slash) form so traces no longer carry
  `C:\Users\<name>\...` prefixes. Tests strengthened to assert no row is
  ever an absolute path.
- CR #13: replace misleading CS7036 tiebreak comment with accurate
  description; full Hamming-vector ranker stays a deferred follow-up per
  spec §1.5.
- CR #14: 525-run report reworded — "500-pair volume bar met, cross-agent
  bar NOT met"; Theme.get_Background note marked "fixed in this branch"
  with code reference.
- CR #2 (narrowed): tighten CS1061 factory-argument receiver check to
  require receiver IS-A factory return type only (dropped reverse
  IsAssignableFrom direction). Full AST-anchored receiver verification
  deferred to Phase-3 RuleSymbolResolver per §3.1a.
- Implementation doc deferred-follow-ups list updated to include
  receiver-anchoring (e) and Phase-2 loader/precision-gate work (f).

Verification: 98 CheckCommand unit tests pass (was 97 + new parens-path
test); MurCheck integration test passes; CS8602 warning eliminated.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 11, 2026
…c-count gate) (#243)

* docs(specs/038): add MSBuild passthrough via `--` to mur check CLI

Today's CheckCommand accepts only <path> and hardcodes --nologo,
-v:m, and -p:Platform={host arch}. Without an escape hatch the only
fallback for an agent that needs to override Platform, pick a
Configuration, skip restore, or pass arbitrary -p: properties is to
drop mur check and run dotnet build directly - which discards every
benefit the spec adds.

Adds a "CLI shape and MSBuild passthrough" subsection in §8
covering: the `mur check [path] [mur-flags] [-- <msbuild args>]`
shape, default-merging rules (auto-inject only if user did not
specify), boundary semantics (bare `--` is the unambiguous
separator; unknown mur-flags error), ranker-unchanged invariant
(passthrough alters the build, not diagnostic scoring), and trace
faithfulness (record effective command line). Adds an
implementation bullet to Phase 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(specs/038): add detailed implementation task list

Mirrors the convention from docs/specs/tasks/036-window-design-
implementation.md: phased checkboxes, "task is done only when"
gate, conventions header. Adapted for spec 038's external
dependency on spec 037's data corpus.

Adds three concepts not in earlier task lists because no other
spec needed them:

- Human Validation Gate: six-bar checklist every Tier 3 rule
  must clear before merge (frequency >=5%, count >=10, cross-
  agent reproducibility, >=3 positive fixtures, >=2 negative,
  independent reviewer signoff). Plus auto-suppression policy
  for rules whose telemetry accept-rate drops below 50%.

- Data Checkpoints A/B/C/D: staged hand-offs from spec 037's
  harness with explicit blocking relationships. A is the
  current 3-pair smoke (already landed); B/C/D gate Phase 1
  threshold tuning, Phase 3 rule authoring, and Phase 4 ranker
  training respectively.

- Eval Checkpoints EC1-EC4: 5xN batches on gpt-5.5 vs reactor-
  calc/kanban with predicted lift bands and pass criteria.
  EC1 after Tier 2 only; EC2 after deterministic ranker + 5
  rules; EC3 at V1 ship (10-15 rules); EC4 if learned ranker
  is pursued.

Quantity bars (per the user's question): 5 rules before EC2,
10-15 rules covering >=80% of fix events for V1 ship.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(spec-038): land Phase 0 + Phase 1 of `mur check` did-you-mean engine

Phase 0 (instrumentation, no behavior change):
- `mur check --trace <path>` writes one JSONL row per parsed diagnostic to
  <path> in addition to stdout. Schema: {ts, code, severity, file, line, col,
  msg, receiver_type?, member?, mode}. Source code text is never written;
  absolute paths outside the project root are redacted to "<external>"; rows
  are bounded to 2 KB.
- New folders src/Reactor.Cli/Check/{Suggesters,Rules}/ with README pointers
  to spec 038 §5/§6 and the Validation Gate.

Phase 1 (Tier-2 Roslyn semantic suggester):
- ISuggester contract + SymbolSuggester covering CS1061, CS0103, CS0117,
  CS1503, CS7036 against Microsoft.UI.Reactor.* symbols.
- CompilationLoader: csproj/source resolution, project.assets.json reference
  resolution, (csproj-path, file-mtime-hash) cache, symlink containment, perf
  budget cold ≤ 500 ms / warm ≤ 50 ms.
- FactoryIndex: pre-filter over Microsoft.UI.Reactor.Factories.* static
  methods with cached parameter-name arrays for named-argument suggestions.
- StringSimilarity (Jaro–Winkler) for fuzzy member-name matching.
- SuggesterOrchestrator wires the suggester into CheckCommand.Run; Tier-1
  HintFor still wins ties at the format layer (spec §9).
- MUR_TELEMETRY=1 opt-in: appends (code, suggester, confidence,
  evidence_short) to ~/.mur/telemetry/<yyyy-mm-dd>.jsonl. Fields bounded to
  256 bytes; no source text, file paths, or machine identifiers.
- Args parser recognises `--trace` and `--help`; rejects unknown flags
  rather than silently forwarding (full passthrough lands in Phase 2).

Tests:
- 66 unit tests under tests/Reactor.Tests/CheckCommandTests/ covering args
  parsing, trace schema/redaction/length cap, compilation loader, factory
  index, JaroWinkler, every suggester code path (positive + negative),
  orchestrator filtering (Reactor-touching gate), Tier-1-wins-ties, and
  telemetry opt-in/byte-bound.
- Integration smoke test exercising mur.exe end-to-end against a deliberately
  broken fixture under tests/Reactor.IntegrationTests/MurCheck/Fixtures/
  SmokeFixture/. Reactor-touching CS1061 fixture is scoped as a follow-up
  because it requires WindowsAppSDK restore.

Pause point per spec 038 task list:
- Phase 1.8 exit needs Data Checkpoint B (≥50 unique pairs from spec 037's
  harness) for per-code threshold tuning before merging to main.
- Phase 2 + 3 are blocked by Phase 1 merge / Data Checkpoint C respectively.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(specs/038): mark Phase 0 + Phase 1 complete; record harness Gap #3 blocker

- Status snapshot at the top of the task list — Phase 0/1 code-complete on
  feat/038-mur-check, not merged to main, blocked on threshold tuning.
- Phase 0 (0.1–0.5) and Phase 1 (1.1–1.7) checkboxes ticked, with one-line
  notes on the four items deferred as follow-ups (Reactor-touching
  integration fixture, perf-trait wall-time test, full Hamming-vector
  overload ranking, CS0103 return-type filter).
- Data Checkpoint A re-audit (2026-05-10): Gap #1 (receiver_type), #2
  (dedup), #4 (cosmetic) all FIXED in the new harness output. Gap #3
  (ranker negative class) still NOT fixed — all 3 ranker-labels rows are
  positive class; for 3 runs the spec expects ~30–80 rows.
- Plus a fix_kind classifier nit: ButtonElement HorizontalAlignment →
  HAlign should be renamed_member, not other (receiver type unchanged,
  member name swapped).
- Recommendation against kicking off the 50-run sweep until Gap #3 lands;
  records that Data Checkpoint B is therefore still blocked.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(specs/038): unblock Data Checkpoint B; record still_present_at_run_end as Phase-4 prereq

Audit pass 2 of the 6-row ranker-labels output (2026-05-10):

- Gap #3 (ranker negative class) is now FIXED. 4 positive / 2 negative on
  addressed_by_next_fix; harness emits per-build per-diagnostic rows; three
  CS8012 emissions in run 5d5fef… recorded as three independent training
  rows, exactly per spec 037 §3 "don't dedupe across builds".
- fix_kind classifier nit partially fixed — both pairs now classify as
  renamed_member; debatable for pair 2's structural rewrite but acceptable.
- New known limitation: still_present_at_run_end is uniformly false even
  when the diagnostic IS in the final build (CS8012 timing-tail
  fingerprint quirk). Primary ranker label addressed_by_next_fix is
  unaffected; auxiliary agent_ignored is corrupted, which breaks the
  spec 038 §11 auto-suppression-telemetry hook. Tracked as a Phase-4
  prerequisite — file with harness owner before Data Checkpoint D.

Status updates:

- Status snapshot at top: 50-run sweep cleared to start.
- Data Checkpoint B: status flipped from blocked to unblocked. Added a
  step-by-step "pickup procedure for the next session" so the next agent
  can run cold once the corpus lands (audit, threshold tuning, EC1, merge).
- Data Checkpoint D: documents still_present_at_run_end as the remaining
  prerequisite before training the learned ranker.
- Phase 1.8 exit criterion points at the pickup procedure instead of the
  stale "blocked" note.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(spec-038): tune Tier-2 SymbolSuggester thresholds against 50-run corpus

Phase 1 ship-gate calibration (Data Checkpoint B). Adds per-code emit
thresholds in src/Reactor.Cli/Check/Suggesters/Thresholds.cs, refactors
SymbolSuggester so the threshold gate has a single source of truth
(SuggestRaw exposes raw confidence; Suggest gates via Thresholds.For),
and removes the now-redundant duplicate cut from SuggesterOrchestrator.

Per-code values informed by tests/Reactor.Tests/CheckCommandTests/Tuning/
which runs the suggester against fixes.jsonl. Snapshot of the first run
is in docs/specs/tasks/038-tuning-reports/2026-05-10-50run.md:
  - CS1061 → 0.80 (only firing in corpus was at conf 0.43; raised
    threshold blocks structural-rewrite false positives)
  - CS0103 → 0.75 default (2/2 firings at conf 1.00 matched)
  - CS0117 / CS1503 / CS7036 → 0.75 default (insufficient signal in
    50-pair corpus; revisit at Data Checkpoint C, 500+ pairs)

Tuning harness is gated on env var MUR_TUNING_CORPUS so it skips
cleanly when the (sibling-repo) corpus isn't available.

Phase-1 next gate: Eval Checkpoint EC1 vs. main.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(specs/038): record EC1 5×N results; surface amortization-floor finding

EC1 5×N (n=5 paired rounds on gpt-5.5, round-3 prompt with reflection
ban + trust-the-suggestion + mur-check-is-the-build rules):

  kanban-variant — cost mean −24% / median −33% / CV 24% vs base 81%
                   wins 4 of 5 paired rounds; the suggestion mechanism
                   is itself a variance stabilizer.

  calc-variant   — cost mean +21% / wall mean +23%
                   real and consistent across the batch.

Diagnosis: ~5–8s per-invocation mur-check overhead does not amortize on
~150-LoC projects with no API exploration surface to skip. Validated
empirically — the prompt iterations that helped (round-2 reflection
ban, round-3 trust-mur-as-build) closed every explore-around-the-
suggestion loophole, but the floor remains.

Strict EC1 pass criterion ("tokens not regressed") fails on calc,
passes cleanly on kanban. Captured as:

  - spec 038 §11 risk row + §14 open question on a project-size /
    per-invocation-diagnostic-count gate
  - task doc EC1 results section with per-arm means/sd, paired comparisons
  - status snapshot updated; Phase 1 merge decision noted as pending

Decision options on the merge: (a) ship Phase 1 as-is and accept the
calc tax; (b) land the gate before merging. Either is product-side; this
commit only records the data and the design surface.

No code changes. SKILL.md intentionally left untouched — larger
mining sweep is running under the current SKILL.md to compare aided vs
un-aided baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(spec-038): scope Thresholds override to AsyncLocal to fix parallel-test race

ThresholdsTests.Each_handled_code_has_a_threshold_in_valid_range was flaking
because the tuner test (ThresholdTuningTests.Run_against_inline_one_row_corpus_produces_report)
temporarily writes Thresholds.PerCode to an all-zero map for its duration,
and xUnit's default cross-class parallelism let the validation tests observe
the zeroed state mid-tuner-run.

Switching the override channel to AsyncLocal isolates the tuner's scoped
change to its own logical thread; concurrent readers in other tests see
the immutable production defaults. Production code paths still go through
the same Thresholds.For(code) entry point — behaviour for the CLI is
unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(spec-038): land diagnostic-count gate + Data Checkpoint C calibration

Two related changes:

1. Diagnostic-count gate (spec §11 risk row, §14 #8) — resolves the EC1
   calc-vs-kanban split where ~150-LoC calc regressed +21% cost while
   kanban won −24%. `CheckCommand.ShouldEmitSuggestions` skips Tier-2
   when an invocation surfaces fewer than `--suggest-threshold` unique
   CS-prefixed diagnostics; default 3, 0 disables. Counts the same
   dedup key `EmitDiagnostics` uses.

2. Data Checkpoint C — 525-pair mining corpus from spec 037's harness
   mirrored at `docs/specs/tasks/038-tuning-reports/2026-05-11-525run-source/`
   (1,027 fixes / 1,233 ranker rows / 104 clusters; `gpt-5.5` only).
   Tuning report at `2026-05-11-525run.md`.

The empirical CS-diagnostics-per-build distribution from the corpus
(43% of builds have 1 diagnostic, 28% have 2, 28.7% have ≥ 3) confirms
T=3 is the right initial cut-line. The 525-run corpus also surfaces
that JaroWinkler fuzzy match has near-0% empirical precision on
CS1061/CS0117 against Reactor types — the agent's typical mistake is
reaching for a WinUI-style name (`.VerticalAlignment`,
`Theme.AppBackground`) whose Reactor replacement is too far in
edit-distance to find, so we pick a wrong sibling. All per-code
thresholds held; systematic fix is Phase-3 rule authoring. Top three
rule targets identified in the report.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(spec-038): record EC1 re-run results; Phase 1 cleared to merge

5×N re-run on `feat/038-mur-check` @ aaa4cce (gate enabled, default
--suggest-threshold 3), same matrix as the prior EC1 batch.

  reactor-calc-mur-check  : cost -4%  (was +21%) — PASS
  reactor-kanban-mur-check: cost -33% (was -24%) — PASS, grew the win
  First-build OK 5/5 both variant arms.

Calc neutralized; kanban win preserved and grew. Phase 1 acceptance bar
met. Spec §11 risk row + §14 #8 updated to mark the mitigation validated.

Watch-item carried into Phase 2: kanban CV widened (24% prior -> 54%
this batch) because one of five runs hit 0 firings and tracked the
long-tail base path. Gate is path-dependent on agent's exploration
order, not just the project's static shape. Below Phase-1 blocker
threshold; Phase 2 telemetry should track per-run firing counts.

No code change in this commit — eval results + spec doc updates only.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(spec-038): add reference doc for `mur check` did-you-mean engine

Layered walkthrough of the system as shipped in this PR (Phase 0 + Phase 1
+ diagnostic-count gate): plain-language intro, four-tier architecture,
mining pipeline, threshold tuning, end-to-end recommendation flow, the
small-project gate, and a future-improvements section sketching Phases
2–4. Lives at docs/reference/ alongside the other developer-facing
references; points back to docs/specs/038… for decision history.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(spec-038): address CR feedback on PR #243

Addresses six review comments from Copilot reviewer on the Phase-1 PR:

1. Hoist CompilationLoader.Load to once per `mur check` invocation
   instead of once per emitted diagnostic. Even with the internal cache,
   Load() re-enumerates `.cs` files and recomputes the file-set hash on
   every call, so the prior wiring was O(diagnostics × files). Now O(1)
   per invocation via SuggesterOrchestrator.SuggestAgainst.

2. FindTreeFor suffix match required a path-separator boundary so a
   diagnostic on bare "Program.cs" no longer mis-binds to a sibling tree
   like "MyProgram.cs". Cross-platform: matches against both '/' and '\'
   prefixes since CSharpCompilation trees can carry either separator
   depending on the project's source-list. Added regression test.

3. Filter synthesized property/event accessors (get_X / set_X / add_X /
   remove_X) out of CollectStaticMembers + CollectInstanceMembers. The
   525-run calibration report flagged conf=0.88 emissions of
   `Theme.get_Background` — same hazard would surface on CS1061 against
   instance-member walks. Fixed at the source.

4. Telemetry.Truncate now enforces a true UTF-8 byte limit, not a char
   limit. Pure-ASCII content still hits the cheap fast path. New test
   covers a 200-glyph CJK string (600 bytes pre-truncation).

5. StringSimilarity header comment no longer claims "allocation-free on
   the hot path" — Jaro() allocates two bool[]s per call. Comment now
   reflects reality with a pointer to revisit via stackalloc if perf-
   trait tests show it on the hot path.

6. Drop the "`<path>` accepts a .cs file" claim from CheckArgs.HelpText
   and the CheckCommand.cs header. `dotnet build <single.cs>` doesn't
   work end-to-end so the help text was misleading. CompilationLoader
   still walks up to the nearest .csproj when seeded from a .cs file
   (tooling/test seam only).

Skipped: #6 (MurCheckSmokeTest.cs build-on-demand for mur.exe) — changes
the integration-tests CI contract and is cleanly scoped as a separate
follow-up.

Full suite: 7051/7097 pass (46 skipped — perf-trait + opt-in, unchanged).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(spec-038): adopt load-bearing framing; split Tier-3 rule classes; resolve symbol-binding

Doc-only updates across spec, task list, and reference doc to reflect the
decision that `mur check`'s did-you-mean engine is load-bearing
infrastructure for the next 1-3 years, not a token-saving stopgap base-
model improvements will erode.

Why now: Reactor will keep churning faster than models retrain, and WinUI
3 is structurally weak / cross-confused with WPF/Silverlight/WinUI 1/2 in
training data. The 525-run corpus directly evidences the confusion shape
(`.VerticalAlignment` on Reactor `*Element` types, `Theme.AppBackground`,
`.Style(...)`). Tier-2 fuzzy match cannot bridge those by edit distance;
only deterministic vocabulary-translation rules can.

Spec changes (038-mur-check-did-you-mean-design.md):
- §1: new "Why this is load-bearing" subsection with the two-condition
  argument and explicit sunset criterion (≥12mo API stability +
  ≥90% first-build-OK on ≥2 vendor-distinct models).
- §6: rename "induced pattern rules" → "induced and authored pattern
  rules"; split into Class A (induced, frequency-justified) and Class B
  (vocabulary-translation, structurally justified, frequency bar waived).
  Add the resolved symbol-binding decision: rules bind to Roslyn ISymbol
  references via RuleSymbolResolver, not name strings, with a CI gate
  that fails the build on unresolved rule targets.
- §11: two new risks — Reactor API churn invalidating rules/corpus, and
  data-pipeline SLA/owner — both with mitigations.
- §13 Phase 5: reframe from "only if needed" to "scheduled, deferred"
  pending Data Checkpoint D. Add explicit sunset criterion subsection.
- §14: resolve question #8 (symbol-binding decision recorded with
  rationale); add question #9 on vocab-table provenance; renumber
  project-size gate to #10.

Task list (tasks/038-mur-check-did-you-mean-implementation.md):
- Top: new "Framing (read this first)" section with the load-bearing
  argument and sunset criterion link.
- Phase 3: split rule template into Class A / Class B variants. Add §3.0
  pre-phase prerequisites (corpus-pipeline owner; minor-release refresh
  cadence; in-repo `038-vocab-table.csv`). Add §3.1a symbol-binding
  contract with CI gate. Update quantity gates + exit criterion for the
  two-class split.
- Phase 4: status change from "optional" to "scheduled, deferred until
  Data Checkpoint D"; escape hatch remains as the unexpected outcome.
- New "Maintenance (load-bearing operation)" section under cross-cutting
  concerns: API-churn protocol per Reactor minor; corpus freshness rule;
  per-rule accept-rate monitoring; annual sunset-readiness check.

Reference doc (docs/reference/mur-check-did-you-mean.md):
- §1: new "Why this is load-bearing" subsection mirrored from the spec.
- §9 Future improvements: new "The recurring failure mode: WinUI/WPF
  vocabulary confusion" subsection that names the structural failure
  shape, then reframes Phase 3 as Class A / Class B and Phase 4 as
  scheduled-not-optional. Symbol-binding decision called out.
- Out-of-scope (small LLM generator): reasoning now explicitly linked to
  the load-bearing argument (weak training data is why we need the
  system AND why a smaller model trained on it won't fix the gap).
- Glossary: new entries for Class A / Class B rule, Load-bearing,
  Sunset criterion. Validation Gate entry updated for the Class-B
  frequency-bar waiver.
- Closing: pointer to the new task-doc Maintenance section.

No code changes in this commit; all infrastructure decisions documented
here will land in Phase-3 rule PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(spec-038): address CR feedback round 2 on PR #243

Quality and self-consistency pass on the Phase-1 branch. All changes are
contained to Phase-1 surface; broader CR concerns about CS1061/CS0117 fuzzy
behavior, MSBuild-accurate loading, and per-code precision gating remain
scoped to Phase 2/3 per the spec's existing plan.

- CR #10: drop CS8602 warning in CompilationLoader by routing EmptyCompilation
  through a named factory method with explicit Array.Empty<> coalescing.
- CR #11: diagnostic regex now uses a reluctant file capture anchored on the
  (line,col): suffix so MSBuild lines with parenthesized path segments parse
  correctly. Added pipeline test.
- CR #8: TraceWriter.SanitizePath normalizes in-root absolute paths to
  project-relative (forward-slash) form so traces no longer carry
  `C:\Users\<name>\...` prefixes. Tests strengthened to assert no row is
  ever an absolute path.
- CR #13: replace misleading CS7036 tiebreak comment with accurate
  description; full Hamming-vector ranker stays a deferred follow-up per
  spec §1.5.
- CR #14: 525-run report reworded — "500-pair volume bar met, cross-agent
  bar NOT met"; Theme.get_Background note marked "fixed in this branch"
  with code reference.
- CR #2 (narrowed): tighten CS1061 factory-argument receiver check to
  require receiver IS-A factory return type only (dropped reverse
  IsAssignableFrom direction). Full AST-anchored receiver verification
  deferred to Phase-3 RuleSymbolResolver per §3.1a.
- Implementation doc deferred-follow-ups list updated to include
  receiver-anchoring (e) and Phase-2 loader/precision-gate work (f).

Verification: 98 CheckCommand unit tests pass (was 97 + new parens-path
test); MurCheck integration test passes; CS8602 warning eliminated.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 22, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 22, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 23, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codemonkeychris
Chris Anderson (codemonkeychris) deleted the add-license branch May 28, 2026 19:11
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Hot keyed list-diff path (grid steady state) allocated heavily and missed
fast-paths even when keys were unchanged. Eliminate per-diff allocations and
add the missing fast-path, preserving diff behavior exactly.

ChildReconciler.cs:
- Keyed prefix/suffix loops now take the Element.CanSkipUpdate early-exit
  that the positional path has, so stable keyed rows no longer re-diff every
  tick (#30); cache children.Count once instead of re-reading the COM
  IVector.get_Size per suffix iteration (#37).
- Replace HashSet-returning ComputeLIS with allocation-free ComputeLISInto
  filling a pooled bool mask; pool tails/tailIndices/predecessors from
  ArrayPool (#31/#32). Keep a thin ComputeLIS(int[]) wrapper for tests.
- Pool ReconcileKeyedMiddle's working arrays (ArrayPool) and the two
  key->index maps (re-entrancy-safe ThreadStatic dict pool); buffers cleared
  and returned on every exit (#33).
- Filter: count-pass + single Element[] fill, no List+ToArray (#36).
- GetKey: cache Type.Name via ConcurrentDictionary (#38).

KeyedListDiff.cs:
- Rent newKeys from ArrayPool<string>, threading explicit newCount (rented
  array may be larger); returned clearArray:true in a finally (#2).
- Move the no-op (SequenceEqual) + empty/empty fast paths ABOVE the duplicate
  scan so the steady-state grid case never allocates/scans a dup set (#1).
- Fold the churn-bailout decision into ApplyGeneral, computed from the same
  post-prefix/suffix scratch map the general walk builds (diff-range churn ==
  full-range churn), removing the O(2n) null-marker pre-pass (#34).
- Pool the doomed ReactorRow[] (ArrayPool, descending IComparer sort over
  [0,removes), cleared+returned) (#3).
- Lazy-allocate movedRows only on an actual move under an ambient (#35).
- In-place SyncLastKeysToSource instead of LastKeys Clear()+Add (#10).
- HasDuplicates reuses state.Scratch (TryAdd) for 4+ keys instead of a fresh
  HashSet (#11); cached null-key diagnostic sample (#41).

Tests: add pooling non-corruption coverage (rented-buffer-larger-than-count,
interleaved independent states, randomized stress vs oracle with survivor
identity, pooled doomed removes, churn with shared prefix+suffix, Scratch
reuse for the dup scan) and ComputeLISInto bool-mask coverage. Full
Reactor.Tests suite green (9693 passed); core lib Release build is
warning-clean (AOT/trim).

Closes #653

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 27, 2026
…ff (#657)

* perf: eliminate per-diff allocations in ChildReconciler + KeyedListDiff

Hot keyed list-diff path (grid steady state) allocated heavily and missed
fast-paths even when keys were unchanged. Eliminate per-diff allocations and
add the missing fast-path, preserving diff behavior exactly.

ChildReconciler.cs:
- Keyed prefix/suffix loops now take the Element.CanSkipUpdate early-exit
  that the positional path has, so stable keyed rows no longer re-diff every
  tick (#30); cache children.Count once instead of re-reading the COM
  IVector.get_Size per suffix iteration (#37).
- Replace HashSet-returning ComputeLIS with allocation-free ComputeLISInto
  filling a pooled bool mask; pool tails/tailIndices/predecessors from
  ArrayPool (#31/#32). Keep a thin ComputeLIS(int[]) wrapper for tests.
- Pool ReconcileKeyedMiddle's working arrays (ArrayPool) and the two
  key->index maps (re-entrancy-safe ThreadStatic dict pool); buffers cleared
  and returned on every exit (#33).
- Filter: count-pass + single Element[] fill, no List+ToArray (#36).
- GetKey: cache Type.Name via ConcurrentDictionary (#38).

KeyedListDiff.cs:
- Rent newKeys from ArrayPool<string>, threading explicit newCount (rented
  array may be larger); returned clearArray:true in a finally (#2).
- Move the no-op (SequenceEqual) + empty/empty fast paths ABOVE the duplicate
  scan so the steady-state grid case never allocates/scans a dup set (#1).
- Fold the churn-bailout decision into ApplyGeneral, computed from the same
  post-prefix/suffix scratch map the general walk builds (diff-range churn ==
  full-range churn), removing the O(2n) null-marker pre-pass (#34).
- Pool the doomed ReactorRow[] (ArrayPool, descending IComparer sort over
  [0,removes), cleared+returned) (#3).
- Lazy-allocate movedRows only on an actual move under an ambient (#35).
- In-place SyncLastKeysToSource instead of LastKeys Clear()+Add (#10).
- HasDuplicates reuses state.Scratch (TryAdd) for 4+ keys instead of a fresh
  HashSet (#11); cached null-key diagnostic sample (#41).

Tests: add pooling non-corruption coverage (rented-buffer-larger-than-count,
interleaved independent states, randomized stress vs oracle with survivor
identity, pooled doomed removes, churn with shared prefix+suffix, Scratch
reuse for the dup scan) and ComputeLISInto bool-mask coverage. Full
Reactor.Tests suite green (9693 passed); core lib Release build is
warning-clean (AOT/trim).

Closes #653

Co-authored-by: Copilot <[email protected]>

* perf: address PR review on keyed-diff allocation fixes

Review follow-ups on #657 (keyed list-diff allocation work):

- ChildReconciler.ReconcileKeyedMiddle: return the pooled matched and inLis
  bool[] buffers with clearArray:false instead of true (Copilot review).
  Both are value-typed (no reference pinning) and have their used range
  fully (re)initialized before any read - matched via the Array.Clear on
  rent, inLis via ComputeLISInto leading clear - so the full-array wipe on
  return was avoidable O(rented-capacity) work on the hot path. Matches how
  the int[] newToOld already returns. Reference-typed pooled buffers
  (string[]/ReactorRow[] in KeyedListDiff) still clear.

- Tests (ChildReconcilerLisIntoTests): replace the circular oracle that
  compared ComputeLISInto against ComputeLIS (now a thin wrapper over it)
  with an independent brute-force LIS-length DP that honors the -1 unmapped
  sentinel, asserting the mask marks a valid strictly-increasing subsequence
  of maximal length.

- Tests (ChildReconcilerKeyedSkipTests, new): cover the #30 keyed
  CanSkipUpdate fast path - an identical keyed list skips every row with no
  ops and no child-control access, across repeated stable frames.

Co-authored-by: Copilot <[email protected]>

* fix: correct keyed-middle reorder identity (C1/H1) + reorder & alloc tests

The keyed-middle reconciliation in ChildReconciler patched surviving
controls by their FINAL panel index while the panel was only partially
rearranged, so on reorders a survivor was patched against the wrong
control (C1, CRITICAL): e.g. rotation [a,b,c,d]->[b,c,d,a] rendered "c"
at slot 0 and scrambled keyed identity (focus/animation/state landed on
the wrong row). A related stale keyToIndex (only the moved key was
rewritten) left shifted siblings mis-indexed after an insert/move (H1).

Fix: extract the index logic into RunKeyedMiddleCore<TSink> behind a
struct-generic IKeyedMiddleSink seam (devirtualized, AOT-clean) and
replace the left-to-right loop with the canonical right-to-left LIS walk.
Each item is positioned immediately before its already-placed right
neighbour; LIS members stay put and only out-of-LIS movers relocate
(minimal moves). Every survivor is patched at its CURRENT live position,
resolved from a pooled oldRelToPanel int[] that is mutated in lock-step
with every Insert/Move so it stays exact -- fixing C1 and H1 together.
The production RealKeyedMiddleSink drives the identical Mount/Move/
UpdateChild/Unmount/Replace + ambient enter/move behaviour as before.
oldRelToPanel replaces the second pooled key->index dict (one fewer
rented dict per call).

Tests:
- ChildReconcilerKeyedMiddleCoreTests (new): a headless SimKeyedMiddleSink
  drives the SAME RunKeyedMiddleCore over identity cells (exact production
  parity, no live-WinUI selftest wall), with a 4-invariant oracle (length,
  prefix/suffix untouched, per-slot identity+content, every patch hits its
  claimed survivor) across rotation, full reverse, scramble, block-swap,
  inserts/removes/duplicates and prefix/suffix offsets. A faithful
  pre-fix reproduction proves the rotation regression test has teeth (the
  buggy walk corrupts content[0] and mis-patches; the real core is clean).
- KeyedListDiffPoolingTests: two GC.GetAllocatedBytesForCurrentThread
  budgets guarding the #1/#2/#11 pooling -- no-op steady-state diff is
  0 B/iter and a 128-key reorder is 72 B/diff; reverting the pooling
  (a new string[128] + a 128-entry HashSet per diff) fails them.

Diff correctness preserved; pooled buffers returned on every exit.

Co-authored-by: Copilot <[email protected]>

* fix: gate keyed no-op fast path on duplicate-free state + test hardening

Address Copilot re-review of e664f9f.

KeyedListDiff: the no-op fast path runs above the duplicate scan (#1), so
an UNCHANGED list that already holds duplicate keys -- the state a prior
duplicate bailout leaves behind, since ReactorListState.Reset preserves
the dups in Source/LastKeys but collapses ByKey to first occurrences --
would match LastKeys and return Empty, silently skipping the duplicate
bailout/diagnostic and leaving the diff in an invalid duplicate state.
Gate the fast path on `state.ByKey.Count == oldCount`: true exactly for
the duplicate-free steady state (allocation-free path preserved), false
when dups were collapsed (re-takes the bailout). The check is O(1) and
short-circuits before the O(n) SequenceEqualOrdinal, so the common
unique-key path pays nothing. No-op steady-state allocation stays 0 B/iter.

Tests:
- KeyedListDiffTests: new Apply_Unchanged_Duplicate_List_Re_Bails_Instead_
  Of_NoOp_FastPath -- proves an unchanged duplicate list re-bails; verified
  to FAIL without the guard (takes the no-op path and returns Empty).
- ChildReconcilerLisIntoTests: strengthen the LIS oracle to assert selected
  indices are never the unmapped -1 sentinel (a buggy impl could swap a real
  member for a -1 and still satisfy strictly-increasing + length).
- KeyedListDiffPoolingTests: drop the unused `using System.Buffers;`
  (fully-qualify the one ArrayPool cref) flagged by the reviewer.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant