Skip to content

docs: teach purview-architecture to choose a contract strategy - #8

Merged
kieronlanning merged 3 commits into
mainfrom
docs/contract-strategy
Oct 27, 2026
Merged

kieronlanning merged 3 commits into
mainfrom
docs/contract-strategy

Conversation

@kieronlanning

@kieronlanning kieronlanning commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds a procedure to the purview-architecture skill for deciding how an HTTP API and its clients share a contract: Contracts, OpenAPI or Hybrid. It also covers when a Backend-for-Frontend (BFF) is earned.

Skills only. The architecture policy and the wiki are unchanged. Blazor and BFF support is planned for a future Build SDK release, so until then the skill states the BFF and browser-safety rules as guidance and review obligations.

Changes

  • skills/purview-architecture/references/contract-strategy.md (new):
    • definitions of the three strategies and the decision procedure;
    • rules, version skew and worked examples;
    • constraints on the Contracts project, including how browser-safety is checked;
    • BFF guidance.
  • SKILL.md: a new section 5 summarising the strategy choice, plus a checklist item and a wider description.
  • references/project-responsibilities.md: the Contracts and WebApp rows mention the Blazor WebAssembly client, and the split rule points to the new reference. The BFF guidance is in a section marked as not yet policy.

Checked against the sources

  • ZodSharp: {T}Schema.BuildJsonSchema(), x-zodsharp-unsupported, additionalProperties: false and IsAotCompatible are checked against zodsharp main. ZodSharp ships no OpenAPI integration, so the skill says the API host wires the export into the document.
  • BFF: the forwarding, server-side refresh, token storage and prerendering guidance follows Microsoft's Blazor Web App with OIDC and the BFF pattern. The anti-forgery and Data Protection rules are standard ASP.NET Core requirements that the article does not cover.

Test run

just test: 74 passed, 1 skipped (an existing data-source skip), 0 failed.

Add a decision procedure for how an HTTP API and its clients share a
contract (Contracts, OpenAPI or Hybrid), with version-skew rules, BFF
guidance and worked examples. Add Bff to the architecture policy and the
Project Responsibilities catalogue so the skill does not describe a
responsibility the policy does not define.
ZodSharp exports JSON Schema but ships no OpenAPI integration, so the
Hybrid strategy now says the API host wires the export into the document.
It also covers x-zodsharp-unsupported, and the way additionalProperties:
false breaks additive versioning for clients that validate responses
strictly.

Browser-safety now names mechanisms that actually check it: policy bans
on ASP.NET Core packages and the framework reference, IsAotCompatible,
and SupportedPlatform browser. It also says plainly that the analyzers
only warn unless TreatWarningsAsErrors is set.

The BFF section now covers the Blazor case, where the BFF is the host
that serves the WebAssembly client (Bff may reference WebApp). It adds
anti-forgery, cookie flags, Data Protection keys, server-side refresh,
a server-side session store, and prerendering as the reason a BFF
references Contracts.
…dds it

Revert the architecture policy and Project Responsibilities wiki changes.
BFF and Blazor support will arrive with a future Build SDK release, so for
now the skill states the BFF and browser-safety rules as guidance and
review obligations rather than as policy the playbook enforces.
@kieronlanning
kieronlanning merged commit ccf5b3d into main Oct 27, 2026
1 check passed
@kieronlanning
kieronlanning deleted the docs/contract-strategy branch October 27, 2026 15:05
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