Skip to content

chore(knowledge): accept react-native platform component records - #12592

Draft
imdreamrunner wants to merge 1 commit into
mainfrom
chore/knowledge-react-native-platform-records
Draft

imdreamrunner wants to merge 1 commit into
mainfrom
chore/knowledge-react-native-platform-records

Conversation

@imdreamrunner

Copy link
Copy Markdown
Contributor

Maintainer impact

A React Native implementation of a component needs its own record beside the core record, the way a Swift implementation has one (docs/specs/components/Button/Button.swift.spec.md). Today the knowledge tooling accepts only swift as a platform record language. A file such as docs/specs/components/NavigationStack/NavigationStack.react-native.spec.md is reported by pnpm check:knowledge as a stray file under docs/specs/components/, it is not owner-gated as a record, and pnpm specs:for does not index it. An author of the React Native component records cannot open one.

Intended invariant

architecture:knowledge-contracts DEC-13 and DEC-15: a platform implementation's record sits beside the core record as <PublicName>.<language>.spec.md, has the id component:<language>/<PublicName>, names its core component in platform_of, and states only what that platform adds or does differently. Every existing rule for platform records stays the same: placement, platform_of, verified_by paths, the shared schema checks, the spec-owner gate, and Swift code routing.

Change

  • .github/scripts/knowledge-paths.cjs: PLATFORM_SPEC_LANGUAGES gains react-native. react-native gets no entry in PLATFORM_SOURCE_ROOTS, because this repository has no React Native component code. Code lookup iterates only the languages that have a source root, so a React Native record is validated, owner-gated and indexed by its path, and no code path is placed under it.
  • docs/architecture/knowledge-contracts.md: the "Owning code" sentence on platform records names the two languages, swift and react-native. No other text in that record changes.
  • Tests: one case per consumer of the language list (path classification, change scope, check:knowledge id and platform_of validation, specs:for lookup).

This is maintenance: it widens one list the tools share and adds no product behavior.

Evidence

  • Failure before the change: with PLATFORM_SPEC_LANGUAGES set back to ['swift'], the four new cases fail (classification returns null, change scope does not see a record, check:knowledge reports the file as a stray, specs:for does not index it).
  • Success after the change: all cases in the four affected test files pass (364 tests), and pnpm check:knowledge passes on the branch.
  • Product/runtime behavior verified unchanged: no package source changes; the Swift platform record tests pass unchanged.
  • CI impact (for a change to workflows, actions or CI scripts): no workflow or job changes; knowledge-paths.cjs is read by existing jobs only.

Scope

Components: none

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

The record change is one sentence in docs/architecture/knowledge-contracts.md.

R1 narration: none; the sentence states where a platform record sits and which languages it takes.
R2 research: none.
R3 evidence: none changed.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.
R7 project status: none in the record.

Testing

vitest run .github/scripts/knowledge-paths.test.mjs .github/scripts/change-scope.test.mjs scripts/check-knowledge.test.mjs scripts/specs-for-file.test.mjs
  Test Files  4 passed (4)
  Tests  364 passed (364)
vitest run .github/scripts/spec-owner-decision.test.mjs .github/scripts/spec-owner-reconcile.test.mjs
  Test Files  2 passed (2)
  Tests  125 passed (125)
node scripts/check-knowledge.mjs
  Knowledge templates and records are aligned.
prettier --check <changed files>
  All matched files use Prettier code style!

The same four test files with react-native removed from PLATFORM_SPEC_LANGUAGES: 4 failed, the new cases.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 5:43am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 18, 2026, 5:51 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's spec decision; no defects found.

  • The Owning code sentence in docs/architecture/knowledge-contracts.md now limits <language> to swift or react-native, where the current record leaves it open, so an engineering owner (the author qualifies) approves that spec change by commenting /approve-spec <full head SHA> on this pull request.

Each new test case fails on the base and passes on this head, and check:knowledge passes; CI has not run on this draft head.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim, the tooling accepted only swift as a platform record qualifier: verified (.github/scripts/knowledge-paths.cjs:32 on the base).
  • Claim, a React Native record was reported as a stray file, was not gated as a record, and was not indexed: verified by the new tests run against the base code (the base already gated the path as Markdown under docs/specs/).
  • Claim, the platform list gains react-native with no source root, and code lookup iterates only languages that have one: verified (knowledge-paths.cjs:32, :39-41, :207).
  • Claim, the repository has no React Native component code: verified (no such package at this head).
  • Claim, a React Native record is validated, gated and indexed by its path, with no code path under it: verified (the four new test cases).
  • Claim, the record change is one sentence and nothing else in the record changes: verified (record diff).
  • Claim, one test case per consumer of the list: verified.
  • Claim, no package source changes and no product behavior is added: verified.
  • Claim, with the list reverted the four new cases fail: verified (each fails on the base code, and every other case passes).
  • Claim, 364 cases in the four test files pass and check:knowledge passes: verified.
  • Claim, the Swift platform record tests pass unchanged: verified.
  • Claim, 125 spec-owner cases pass: verified.
  • Claim, the changed files pass Prettier: verified.
  • Claim, no workflow or job changes: verified.
  • Claim, placement, platform_of, verified_by, schema checks, the owner gate and Swift routing stay as they were: verified (no other tooling change; existing suites pass).
  • Claim, no public API, behavior or visual change: verified; the record sentence is a spec change, covered by the decision above.
  • File .github/scripts/knowledge-paths.cjs: clear.
  • File .github/scripts/knowledge-paths.test.mjs: clear.
  • File .github/scripts/change-scope.test.mjs: clear.
  • File scripts/check-knowledge.test.mjs: clear.
  • File scripts/specs-for-file.test.mjs: clear.
  • File docs/architecture/knowledge-contracts.md: waits on the spec decision above.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 9dd9add

This branch was successfully deployed

1 active deployment
Preview — 9dd9add0 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant