Skip to content

Add chrome policy contract support - #22

Merged
mikeylong merged 3 commits into
mainfrom
codex/chrome-policy-source-of-truth
Mar 8, 2026
Merged

mikeylong merged 3 commits into
mainfrom
codex/chrome-policy-source-of-truth

Conversation

@mikeylong

Copy link
Copy Markdown
Collaborator

Summary

  • add optional layout.chromePolicy support to the shared contract schema and types
  • seed safe chromePolicy defaults during generate-contract without adding shared validation enforcement
  • carry forward landingPattern support so the canonical interfacectl repo matches the surfaces-webapps capability baseline

Verification

  • pnpm --dir /Users/mike/SurfacesPlatform/interfacectl --filter @surfaces/interfacectl-validator test
  • pnpm --dir /Users/mike/SurfacesPlatform/interfacectl --filter @surfaces/interfacectl-cli test

@mikeylong
mikeylong merged commit d8c4e6b into main Mar 8, 2026
2 checks passed
@mikeylong
mikeylong deleted the codex/chrome-policy-source-of-truth branch March 8, 2026 21:03

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f086343d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +546 to +549
for (let index = sectionStack.length - 1; index >= 0; index -= 1) {
if (sectionStack[index]?.tagName === tagName) {
sectionStack.splice(index, 1);
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pop section stack only for tracked opening tags

The landing-pattern parser currently removes a tracked section whenever it sees any closing tag with the same tag name, even if that closing tag belongs to an untracked element. In markup like <section data-contract-section="hero"><section>...<section data-contract-section="guidance">...</section></section></section>, the inner plain </section> pops hero from sectionStack, so subsequent contract sections can be misclassified as top-level and nested-order violations are missed under strict policy.

Useful? React with 👍 / 👎.

Comment on lines +26 to +27
const MIN_SCREEN_CLASS_REGEX =
/className\s*=\s*(?:"[^"]*\bmin-h-screen\b[^"]*\bw-full\b[^"]*"|'[^']*\bmin-h-screen\b[^']*\bw-full\b[^']*')/;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make landing background class detection order-insensitive

The class matcher for background-mode extraction assumes min-h-screen appears before w-full, but class order is not semantically meaningful in JSX/HTML. If a page uses className="w-full min-h-screen", extractPageBackgroundMode falls back to unknown, and landing-pattern-background-mode enforcement is silently skipped for that surface.

Useful? React with 👍 / 👎.

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