Skip to content

Port WDXP protocol schema + wire conformance fast gate (W2)#616

Closed
nmetulev wants to merge 3 commits into
winui-devexfrom
nmetulev-wdxp-protocol-port
Closed

Port WDXP protocol schema + wire conformance fast gate (W2)#616
nmetulev wants to merge 3 commits into
winui-devexfrom
nmetulev-wdxp-protocol-port

Conversation

@nmetulev

Copy link
Copy Markdown
Member

What this is

Ports the WDXP protocol (Workstream W2 — the keystone contract) into winappCli under a
dedicated top-level protocol/ folder, scrubbed for public release, and wires its fast conformance
gate into CI. Everything in the devtools fan-out (read, hot-reload, selection, clients) binds to this
one schema, so it lands first.

Scope: spec specs/winapp-devtools-protocol.md §11 phases 1–2 only (Port + wire the fast
gate). Phases 3 (bind W1) and 4 (grow by family) are explicit follow-ups, not this PR.

Base branch: winui-devex (not main).

What landed

  • protocol/ — canonical schema wdxp.v0.json (10 domains / 32 commands / 8 events / 14 error
    codes / 5 risk tiers), the JSON-Schema 2020-12 guard, the envelope.md framing spec, a zero-dep
    net10.0 generator (gen/, emits the CLI-JSON + docs facades) and conformance suite
    (conformance/), and 3 golden traces (golden/).
  • CI fast gate.github/workflows/protocol-conformance.yml runs on ubuntu-latest (proving the
    zero-dep portability) on every PR to winui-devex/main: conformance suite → license-header check
    → public-appropriateness scan. Runs on every relevant PR so it can be marked a required status
    check
    in branch protection.
  • Docs — protocol spec §11 marks phases 1–2 landed; overview W2 row + AGENTS.md pointer updated.

Scrub (this repo is public-bound)

The proof-of-concept carried internal-only artifacts. On port I dropped the internal agent
tool-manifest facade entirely
(the generator emitter path, its generated output, and the schema
mention — only CLI-JSON + docs facades remain), and neutralized internal probe labels, transport
source-path references, the platform runtime-component name, origin/provenance language, and internal
repo names. A standing gate script (protocol/scripts/check-public-appropriateness.ps1, wired into CI)
enforces zero regressions going forward.

Gate 3 preserved after the facade removal: the CLI facade now emits a notifications array
(events), so command and event totality is asserted across both remaining generated facades — the
suite stays a single check and remains 5/5.

Proof — conformance PASS (5/5)

WDXP conformance
------------------------------------------------------------
  [PASS] schema-valid               10 domains, 32 commands
  [PASS] gate3-facade-totality      32 commands + 8 events present in every facade
  [PASS] golden:01-negotiate-attach.json 7 messages conform
  [PASS] golden:02-read-floor.json  10 messages conform
  [PASS] golden:03-subscribe-and-errors.json 9 messages conform
------------------------------------------------------------
RESULT: PASS  (5/5 checks)
  • Generator emits 2 surfaces (cli-commands.json, protocol-reference.md) — no dropped facade.
  • Public-appropriateness scan: zero forbidden references under protocol/ (incl. generated output).
  • License-header check: all protocol/**/*.cs carry the MIT header.
  • dotnet build protocol/Protocol.slnx -c Release: 0 warnings, 0 errors.

Definition of done

  • Protocol assets ported + scrubbed; generator + conformance build on net10.0 (no -windows).
  • Conformance suite PASS 5/5 (Gate-3 facade-totality + schema-valid + 3 golden traces).
  • Wired as a CI check (license-header + public-appropriateness alongside).
  • No public-appropriateness violations (scan clean).
  • W1 not bound (phase 3) — noted as a follow-up.

Follow-ups (out of scope for this PR)

  • Phase 3 — bind W1: align WDXP.negotiate/cancel + Target.* with the daemon session/attach
    model once run --inspect lands.
  • Phase 4 — grow by family: tighten each capability family's types + add golden traces as
    W3/W5/W6/W4 implement.
  • Branch protection: marking Protocol Conformance a required status check is a repo-admin
    setting (can't be done from the PR).

I own the schema — any later capability-family change will ship as a [schema-change] <family>
PR so dependent workstreams can rebase.

Land the proof-of-concept WDXP protocol (W2, the keystone contract) into
winappCli under protocol/, scrubbed for public release, with its fast gate
wired into CI. Scope: spec §11 phases 1-2 only (phases 3-4 are follow-ups).

- protocol/: canonical schema (wdxp.v0.json - 10 domains / 32 commands /
  8 events / 14 error codes / 5 risk tiers), JSON-Schema 2020-12 guard,
  envelope framing spec, zero-dep net10.0 generator (CLI-JSON + docs facades)
  and conformance suite, plus 3 golden traces.
- Scrub for public release: dropped the internal agent tool-manifest facade
  entirely (generator emitter path, its output, and the schema mention), and
  neutralized internal probe labels, transport source-path refs, the runtime
  component name, provenance language, and internal repo names. A standing
  gate script enforces zero regressions.
- CI: .github/workflows/protocol-conformance.yml (ubuntu-latest, net10.0) runs
  the conformance suite (PASS 5/5: schema-valid + Gate-3 facade-totality + 3
  golden traces), a license-header check, and the public-appropriateness scan.
- Gate 3 preserved after facade removal: the CLI facade gains a notifications
  array so command + event totality is asserted across both remaining facades.
- Docs: protocol spec §11 marks phases 1-2 landed; overview W2 row + AGENTS.md
  updated with a protocol/ pointer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d376fce1-8858-45ae-a496-245835e5879f
@github-actions

github-actions Bot commented Jul 12, 2026

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.1 KB (+0.00%)
MSIX (x64) 14.22 MB 14.22 MB 📉 -0.0 KB (-0.00%)
NPM Package 27.91 MB 27.91 MB 📉 -0.1 KB (-0.00%)
NuGet Package 27.94 MB 27.94 MB 📉 -0.1 KB (-0.00%)

Test Results

1611 passed, 1 skipped out of 1612 tests in 447.2s (+33.6s vs. baseline)

Test Coverage

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

CLI Startup Time

41ms median (x64, winapp --version) · ✅ -10ms vs. baseline


Updated 2026-07-12 06:06:16 UTC · commit cc727d8 · workflow run

… teeth)

Fixes for the round-1 review pass on the WDXP protocol port. All hard gates
were already green; these close minor schema/doc drift and give Gate 3 real
field-level teeth.

Minor (schema/doc drift, verified against wdxp.v0.json source of truth):
- README family map: sessionEnded -> sessionClosing; treeChanged -> childrenChanged.
- README Property.ValueSource: templateBinding -> template, builtInStyle -> resource
  (now exactly the schema enum: local, animation, template, style, resource,
  inherited, default).
- README Outcome: normalized the whole PascalCase list to the schema-exact values
  (applied, applied-inert, reloaded, needs-restart) — removes latent drift beyond
  the single ReloadRequired -> reloaded the reviewer flagged.
- wdxp.schema.json $id: repointed off the personal fork URL to the
  microsoft/winappCli path.

Nits:
- conformance: golden traces with an empty/missing 'messages' array now FAIL
  ("nothing to conform") instead of passing vacuously.
- Gate 3 now asserts field-level totality on the CLI facade (the structured
  contract clients bind to): every declared param/return field must be emitted
  for its command/event, and no undeclared field may be smuggled in. Success
  detail reports the field tally (89 fields). README and envelope wording
  tightened to state exactly what the gate asserts.

Verified locally: Release build 0 warnings; conformance PASS (5/5); negative
test (simulated field drop) makes Gate 3 FAIL with precise per-field diagnostics;
public-appropriateness scan 0 hits; license-header check green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d376fce1-8858-45ae-a496-245835e5879f
@nmetulev nmetulev closed this Jul 12, 2026
…iewer round 2)

Address the 12 remaining reviewer round-2 findings on top of cc727d8. All are
inside W2 scope (schema, conformance gate, docs, golden traces, scan/CI). No
runtime work built; deferred-runtime areas (W1 transport / W8 security) are
softened in docs with explicit "deferred" notes rather than implemented.

Tooling / gate depth:
- #2  Deepen golden validation: ConformTrace now requires jsonrpc "2.0" on every
      message, rejects result+error together, correlates error ids (not just
      results) to a prior request, and validates payloads RECURSIVELY against the
      contract via ValidateObject/ValidateValue/ValidateScalar — nested $ref
      objects, enum value sets, and array element types, not just top-level names.
- #4  Assert golden trace count > 0 (an empty golden dir no longer passes vacuously).
- #5  gen Validator.CheckType now runs CheckField over each object type's
      properties, so a dangling $ref inside an object type is flagged (was silent).
- #8  New golden traces 04-07 (HotReload lifecycle, Resource+Diagnostics, Selection
      +Security, describe/set/cancel lifecycle). New golden-coverage check requires
      every command+event to be exercised by at least one trace (all 40 covered).
- #10 wdxp.schema.json root closed (additionalProperties:false) + $schema property;
      new protocol/scripts/validate-schema.py (draft 2020-12 guard) wired into CI.
- #11 check-public-appropriateness.ps1 broadened to also scan specs/winapp-devtools-*.md
      and AGENTS.md (excludes the csproj agent's file by design).
- #15 Extract shared Wdxp.Gen.SchemaPaths.FindUp; gen + conformance both call it.

Schema / contract consistency:
- #7  Outcome invariant narrowed to transactional apply/commit; ephemeral
      Property.set/setPreview return the resulting PropertyValue (schema + envelope §6 + README).
- #12 Security.authenticate now returns token (+optional expiresAt) so the reconnect
      token param has a source; envelope §7 softened to "host-defined, finalized in W8".
- #13 envelope §3/§7 document the pre-auth trust boundary (CurrentUserOnly pipe ACL)
      and what target binding grants before authenticate.
- #14 ids pinned to string protocol-wide (envelope §2, enforced in ConformTrace);
      NodeHandle.handle integer -> string (decimal-encoded uint64, no >2^53 precision
      loss); goldens 02/03 handles updated to strings.
- #6  envelope §1/§3 clarify per-target pipe vs pre-bind discovery; cross-target
      discovery marked W1/phase-3 deferred.
- README: de-hardcode the check count, Applied->applied casing, schema-guard note.

Verified: Release build 0 warnings; conformance PASS (10/10) with recursive
validation + full coverage; negative tests prove teeth (missing jsonrpc, numeric id,
result+error, unknown/enum field, dangling $ref, closed-root schema guard); python
schema guard PASS (+rejects stray key); license headers + broadened scrub scan green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d376fce1-8858-45ae-a496-245835e5879f
@nmetulev nmetulev reopened this Jul 12, 2026
@nmetulev

Copy link
Copy Markdown
Member Author

Closing again — this foundation work has moved to private tracking per the workstream coordinator. I'd reopened it earlier only because it looked accidentally closed mid-review; now that the private migration is confirmed, re-closing to match. No public pushes going forward.

@nmetulev nmetulev closed this Jul 12, 2026
nmetulev added a commit that referenced this pull request Jul 12, 2026
specs/winapp-run-csproj.md's header linked an internal/personal planning repo
(`nikolame/win-devex`) that isn't accessible to public readers of
microsoft/winappCli and whose "overall plan" does not live in this repo. Ahead
of #612 going public, drop that Related line (the same public-appropriateness
rule #616 passed clean). Verified single occurrence: `git grep win-devex` and
`git grep nikolame/` now return nothing on tracked files.

Docs-only; no code, schema, generated-skill, or npm change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b05ed756-966d-4260-a593-f507c4cb2446
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