Skip to content

W4: source-mapping provenance — grader + census analysis (Gate 1)#617

Closed
nmetulev wants to merge 1 commit into
winui-devexfrom
nmetulev-source-mapping-provenance
Closed

W4: source-mapping provenance — grader + census analysis (Gate 1)#617
nmetulev wants to merge 1 commit into
winui-devexfrom
nmetulev-source-mapping-provenance

Conversation

@nmetulev

Copy link
Copy Markdown
Member

W4 — Source mapping (provenance): confidence-graded source mapping + the census

Ports and productizes the proven source-resolution proof-of-concept (which returned a GO) into a pure net10.0 analysis layer that runs on hosted CI without a desktop. Prime directive: never report false confidence.

Key move: split collect from analyze

  • Analyze (in scope, CI): grade each element (SourceKind/Confidence/ReasonCode) → aggregate by SourceKind → apply the Gate-1 kill-criteria → emit md/json report + verdict. Single source of truth for grading.
  • Collect (deferred, heavy gate): live-app enumeration via the read component is owned by the "reading the UI" workstream and needs an interactive desktop. The harness calls it through a gated seam.

What landed (src/winapp-devtools/)

  • SourceProvenanceGrader — the §4 honesty model. Never emits exact unless the origin is authored markup with a resolved line; framework/template/runtime rows carrying a stray app line are down-graded → 0% false-confident by construction.
  • Census analysisCensusTsvReaderCensusAggregatorGate1EvaluatorCensusReport, a console analyze command, and a scrubbed orchestration harness (census/Run-Census.ps1).
  • Independent false-confident audit — re-checks confident rows against authored-markup classification, so a grader regression is caught, not hidden. Encoded as a standing Gate-1 MSTest check.
  • 49 unit tests — every §4 case incl. both false-confident-prohibition cases. All green.
  • Reference corpus + published baseline (census/results/) reproduces GO: Release source-backed 100%, templated 58.3%, false-confident 0.
  • CI — dedicated devtools-provenance.yml: scrub scan → Release build (warnings-as-errors) → tests + Gate-1 standing check → census verdict gate. Path-filtered to this area.
  • Public-repo scrubscripts/scrub-scan.ps1 gate is clean (0 forbidden tokens).

Gate-1 kill-criteria (spec §5, enforced)

Metric Floor / rule
source-backed resolved in Release ≥ 70%
templated → template in Release ≥ 40%
false-confident (exact/high that was wrong) 0% — any hit = automatic KILL

Deferred follow-ups

  • Live Source.resolve/census wired into the running-app daemon.
  • Fresh collection: packaged/trimmed configs + a real-app corpus (Q-CENSUS-CORPUS open).
  • W5 persist integration.
  • Enum types mirror the protocol schema (§6.3/§6.5) and swap to generated types when W2 lands.

Notes for reviewers

  • Self-contained new area src/winapp-devtools/; no edits to winapp.sln, build-cli.ps1, other workstreams' specs, or the protocol schema.
  • Targets winui-devex (not main).

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Copilot-Session: 6fe9cf76-63c6-4b13-a9a2-8fe012035cad

Productizes the proven source-resolution proof-of-concept into a pure
net10.0 analysis layer that runs on hosted CI without a desktop. The
prime directive is honesty: never report false confidence.

Split of concerns:
- Analyze (in scope, CI): grade each element (SourceKind/Confidence/
  ReasonCode) -> aggregate by SourceKind -> apply Gate-1 kill-criteria
  -> emit md/json report + verdict. Single source of truth for grading.
- Collect (deferred, heavy gate): live-app enumeration via the read
  component is owned by the "reading the UI" workstream and needs an
  interactive desktop; the harness calls it through a gated seam.

What landed under src/winapp-devtools/:
- SourceProvenanceGrader (spec section 4 honesty model). Never emits
  exact unless the origin is authored markup with a resolved line;
  framework/template/runtime rows carrying a stray app line are
  down-graded, never trusted -> 0% false-confident by construction.
- Census analysis: CensusTsvReader -> CensusAggregator -> Gate1Evaluator
  -> CensusReport, plus a console analyzer and a scrubbed orchestration
  harness (census/Run-Census.ps1).
- Independent false-confident audit (re-checks confident rows against
  authored-markup classification), so a grader regression is caught, not
  hidden. Encoded as a standing Gate-1 MSTest check.
- 49 unit tests (all section 4 cases incl. both false-confident-
  prohibition cases). Reference corpus committed; published baseline in
  census/results reproduces GO (Release source-backed 100%, templated
  58.3%, false-confident 0).
- Dedicated devtools-provenance.yml workflow: scrub scan -> Release build
  -> tests + Gate-1 standing check -> census verdict gate.
- scripts/scrub-scan.ps1 public-repo forbidden-token gate (clean).

Deferred follow-ups: live Source.resolve/census wired into the running-
app daemon; fresh collection (packaged/trimmed configs, a real-app corpus
per Q-CENSUS-CORPUS); W5 persist integration. Enum types mirror the
protocol schema and swap to generated types when W2 lands.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6fe9cf76-63c6-4b13-a9a2-8fe012035cad
@github-actions

Copy link
Copy Markdown
Contributor

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 31.87 MB 31.87 MB ✅ 0.0 KB (0.00%)
CLI (x64) 32.19 MB 32.19 MB ✅ 0.0 KB (0.00%)
MSIX (ARM64) 13.39 MB 13.39 MB 📉 -0.0 KB (-0.00%)
MSIX (x64) 14.22 MB 14.22 MB 📈 +0.3 KB (+0.00%)
NPM Package 27.91 MB 27.91 MB 📈 +0.4 KB (+0.00%)
NuGet Package 27.94 MB 27.94 MB 📈 +0.3 KB (+0.00%)

Test Results

1611 passed, 1 skipped out of 1612 tests in 388.3s (-25.3s vs. baseline)

Test Coverage

18.3% line coverage, 37.3% branch coverage · ✅ no change vs. baseline

CLI Startup Time

42ms median (x64, winapp --version) · ✅ -9ms vs. baseline


Updated 2026-07-12 06:21:15 UTC · commit 1f73101 · workflow run

@nmetulev nmetulev closed this Jul 12, 2026
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