Skip to content

chore(knowledge): warn on temporary project status in records - #10794

Merged
cixzhang merged 8 commits into
mainfrom
chore/knowledge-status-warn
Nov 10, 2026
Merged

cixzhang merged 8 commits into
mainfrom
chore/knowledge-status-warn

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Records that state temporary project status ("no module exists yet", "Table is the first consumer, then Selector") are true the day they are written and false soon after. A reader deciding conformance then reads stale build status as a rule. This adds an advisory warning for it.

Intended invariant

architecture:knowledge-contracts INV32 and DEC-20: a spec or architecture record states behavior and decisions, not project status. At most one status line, which says only that the record is still in progress, is allowed; a requirement gap in the <FR or INV id> gap: <observable mismatch> form states no build status. DEC-20 rejects a failing check, so this is a warning only: pnpm check:knowledge still fails only on the problems it failed on before.

Change

  • scripts/lib/knowledge-status-phrases.mjs finds build-status and sequencing phrases in a record body (case-insensitive, whole words). The lists sit at the top of the file:
    • STATUS_PHRASES covers all 12 examples INV32 lists (has not started, no code yet, no module exists, not built, not yet implemented, follow-up work, first consumer, first adopter, adoption order, adopts it first, lands before, phase 1) and close variants.
    • The status line: only a Status: line, or a line that is only an in-progress statement ("Windowing is in progress."), counts. A status phrase on that line still warns (Status: not built yet warns). A later status line warns when it says "in progress" or holds a listed phrase; a second Status: line with neither stays silent. An "in progress" inside a longer sentence, such as DEC-20's own sentence about the status line or "a drag in progress", is not a status line and is not read as status.
    • Gap lines get no exemption: a status phrase warns in every section, so FR7 gap: Table windows only inside its own viewport; not built yet warns and FR7 gap: Table windows only inside its own viewport stays silent.
    • BEHAVIOR_CONTEXTS names behavior that shares words with a status phrase ("not built ahead of time", "target not built", "lands before the next frame", "fix lands before"); that text is not read.
    • CHECKED_ROOTS (docs/specs/, docs/architecture/) and EXCLUDED_PATHS (docs/specs/*/plan.md: a plan orders work by design).
    • Code spans and quoted text ("…", “…”) are not read, including a span or quote that wraps across lines within a paragraph (never past a blank line); fenced blocks, block quotes, headings, and frontmatter are not read.
  • scripts/check-knowledge.mjs prints the hits after validation (a GitHub ::warning annotation in Actions, a list locally), for the checkout --root names. Exit status is unchanged.
  • architecture:knowledge-contracts: the INV32/DEC-20 verification row and the enforcement note describe the advisory warning (the way the record describes INV31's --base warning); applies_to adds the module and verified_by adds its test.
  • docs/contributing/spec-writing.md: "What is checked mechanically" says pnpm check:knowledge prints an advisory warning for project status (R7) and fails on no rubric item.

Evidence

  • Failure before the change: the review-follow-up tests were committed first and 7 failed (INV32's examples, a status phrase in the Status line, the status-line definition, wrapped quotes and code spans, and gap lines with build status).
  • Success after the change: 20/20 rule tests pass; scripts/check-knowledge.test.mjs passes (171 tests across both files).
  • Product/runtime behavior verified unchanged: no package source changes.
  • CI impact (for a change to workflows, actions or CI scripts): none measurable; the scan reads the record files check:knowledge already reads.

Hits on current main

pnpm check:knowledge on this branch, merged with main (4569027): 32 warnings in 18 records, exit 0. All 32 were read: each is build status or work order (for example "Implementation gap: not built", "is follow-up work", "List is its first adopter", "Phase 1 places the CLI's own docs", "staged for the next minor and not built"). None is on compliant text: INV32's own wording (a wrapped quote) and DEC-20's sentence about the status line no longer warn, and the behavior sentences that share words with a phrase (theme compilation "not built ahead of time", the icon-set reader's "package target not built yet", "lands before the next frame paints", the release rule "if the fix lands before final-patch lock") stay silent.

Records Warnings
docs/architecture/: interaction-modality, knowledge-contracts, react-component-runtime, template-authoring 4
docs/specs/ AST-002, AST-018, AST-046 (4), AST-047 (2), AST-053, AST-057 (3), AST-103 (5) 17
docs/specs/components/: Lightbox, List (2), ListItem, Resizable, SelectableCard (2), StatusDot (2), Tooltip (2) 11

Scope

Components: scripts/check-knowledge.mjs, scripts/lib/knowledge-status-phrases.mjs, architecture:knowledge-contracts, docs/contributing/spec-writing.md

  • 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

architecture:knowledge-contracts (INV32/DEC-20 verification row, enforcement note, applies_to, verified_by) and docs/contributing/spec-writing.md ("What is checked mechanically"):

  • R1 narration: none; each changed sentence states what the check does now.
  • R2 research: none.
  • R3 evidence: the verification row names the test file and the observable warning.
  • R4 rejected alternatives: none added (DEC-20's rejection of a failing check stands).
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none; the enforcement note uses the record's existing "Current enforcement gap:" form and states the observable behavior.

Testing

  • npx vitest run scripts/lib/knowledge-status-phrases.test.mjs: the 7 new and flipped tests failed first, then Tests 20 passed (20).
  • npx vitest run scripts/check-knowledge.test.mjs scripts/lib/knowledge-status-phrases.test.mjs: Tests 171 passed (171).
  • pnpm check:knowledge: 32 warnings, Knowledge templates and records are aligned., exit 0.
  • pnpm specs:for --diff origin/main: routes architecture:knowledge-contracts among the records for the changed paths; the change keeps INV32/DEC-20's text unchanged and only describes the warning.
  • eslint and prettier --check on the changed files: clean.

@vercel

vercel Bot commented Nov 9, 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 10, 2026 7:40pm UTC

Request Review

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

astracat-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 10, 2026, 7:44 PM UTC

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · a75428f

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: none in this pull request

Committed API report behind this build: cli 36 rows, core 36 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@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 decision about the rule this warning enforces.

  • No current record says a record must not carry project status, and architecture:knowledge-contracts still asks every Compatibility/readiness row to state "authority and implementation state"; the new warning flags that row in StatusDot.spec.md:44 and List.spec.md:63.
  • The rule is proposed as INV32/DEC-20 in #10793, which also rewrites that row; what must be settled is whether this warning ships before that record is current or waits for it.
  • An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

Two non-blocking notes on the heuristic are inline: a gap-section line that names an FR/INV id stays silent whenever four other words remain, even when those words are themselves status, and a second "is … in progress" sentence about the system warns.

[Automated review]

@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 decision about the rule this warning enforces, and one documentation fix is needed before it can merge.

  • No current record says that records must not carry project status, and architecture:knowledge-contracts still asks each Compatibility/readiness row to state "authority and implementation state", which the warning flags in StatusDot.spec.md:44 and List.spec.md:63; an engineering owner needs to settle whether the warning ships before the rule proposed in #10793 is current, and records that by commenting /approve-spec <full head SHA> (the author may do so as an engineering owner).
  • Miss: docs/contributing/spec-writing.md lines 180–186 say pnpm check:knowledge "does not check any rubric item, by design" (and #10793 extends that sentence to project status), so update that section to describe this advisory warning, and keep #10793 consistent with it, or drop the warning.

The gap-line case raised earlier now warns as described. One non-blocking note stands: a second "is … in progress" sentence about the system still warns (inline on lines 34–37).

[Automated review]

Comment thread scripts/check-knowledge.mjs Resolved
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ffaad92

@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.

Changes are needed before this can merge. The engineering owner's /approve-spec on this head settles that the advisory warning may ship now that INV32 and DEC-20 are current, so no owner decision is pending.

  • Regression: architecture:knowledge-contracts still says "INV32 has no repository check (DEC-20)" in its INV32/DEC-20 verification row (line 1448) and in line 1503, so amend both lines in this pull request to describe the advisory warning (an engineering owner then approves that head with /approve-spec), or drop the warning.
  • Regression: scripts/lib/knowledge-status-phrases.mjs:237-248 lets Status: not built yet and a gap line ending "not built yet" pass silently, and the tests at knowledge-status-phrases.test.mjs:47 and :111-121 lock that in, while INV32 allows only a status line that says the record is still in progress and a gap line that states no build status, so report status phrases on those lines too and flip the two tests.
  • Regression: on main the check warns on INV32's own text in docs/architecture/knowledge-contracts.md (line 505, a quote that wraps across lines, and line 1408, DEC-20's sentence about the allowed status line), so carry quotes and code spans across wrapped lines and count only a Status: line or a standalone in-progress line as the status line.
  • Miss: docs/contributing/spec-writing.md lines 220–226 say pnpm check:knowledge does not check project status (R7) by design, so update that section to describe the advisory warning.

Non-blocking: STATUS_PHRASES covers 6 of the 12 example phrases INV32 lists, and the description's counts predate INV32 (on main the check now prints 8 warnings, 3 of them false).

[Automated review]

Comment thread scripts/check-knowledge.mjs Resolved
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3de3d0e

@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.

Changes are needed before this can merge. The engineering owner's /approve-spec on this head settles that the advisory warning may ship under INV32 and DEC-20, so no owner decision is pending; four points remain:

  • Regression: architecture:knowledge-contracts still says "INV32 has no repository check (DEC-20)" in its INV32/DEC-20 verification row (line 1448) and at line 1503, so amend both lines in this pull request to describe the advisory warning, as the record already does for INV31's --base warning (an engineering owner then approves that head with /approve-spec), or drop the warning.
  • Regression: scripts/lib/knowledge-status-phrases.mjs:237-248 lets Status: not built yet and a gap line ending "not built yet" pass silently, and the tests at knowledge-status-phrases.test.mjs:47 and :111-121 lock that in, while INV32 allows only a status line that says the record is still in progress and a gap line that states no build status, so report status phrases on those lines too and flip the two tests.
  • Regression: the check warns on INV32's own text in docs/architecture/knowledge-contracts.md (line 505, a quote that wraps across lines, and line 1408, DEC-20's sentence about the allowed status line), so carry quotes and code spans across wrapped lines and count only a Status: line or a standalone in-progress line as the status line.
  • Miss: docs/contributing/spec-writing.md lines 220–226 say pnpm check:knowledge does not check project status (R7) by design, so update that section to describe the advisory warning.

Non-blocking: STATUS_PHRASES covers 6 of the 12 example phrases INV32 lists, and the description's counts predate INV32 on main (the check now prints 8 warnings, 3 of them on compliant text).

[Automated review]

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

Copy link
Copy Markdown
Contributor Author

/approve-spec a75428f

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

@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.

Approved pending CI: the CI workflow has not finished on this head yet, so wait for it to pass before merging.

The four points from the previous review are fixed: the knowledge-contracts verification row, its enforcement note and the spec-writing guide describe the advisory warning, status and gap lines are matched like any other line, and INV32's own wording no longer warns.

Two non-blocking suggestions:

  • The amended record lines (docs/architecture/knowledge-contracts.md:1450 and :1505-1507) and docs/contributing/spec-writing.md:227-229 say the check warns on "each build-status or sequencing phrase in a spec or architecture record", but it reads only the phrases in STATUS_PHRASES, under docs/specs/ and docs/architecture/ (for example AlertDialog.spec.md:56, "requirements not shipped yet", stays silent), so consider "each phrase in its list in records under docs/specs/ and docs/architecture/".
  • The description says every further status line warns, but a second Status: line warns only when it says "in progress" or holds a listed phrase, so either warn on every Status: line after the first or narrow the description.

[Automated review]

Comment on lines +1505 to +1507
Current enforcement gap: `pnpm check:knowledge` warns on each build-status
or sequencing phrase in a spec or architecture record (INV32) and does not
fail (DEC-20). Review against rubric item R7 decides each line.

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.

Non-blocking: "warns on each build-status or sequencing phrase in a spec or architecture record" claims more than the check does. It warns on the phrases in STATUS_PHRASES, and only under docs/specs/ and docs/architecture/: docs/specs/components/AlertDialog/AlertDialog.spec.md:56 ("requirements not shipped yet") stays silent, and packages/native/specs/swift/library/tooltip.spec.md (an architecture record) is never read. Suggested: "warns on each phrase in its list in records under docs/specs/ and docs/architecture/". The same wording is in the verification row (line 1450) and docs/contributing/spec-writing.md:227-229.

for (const [i, text] of [...prose].sort(([a], [b]) => a - b)) {
const found = matches(text, STATUS_PATTERNS);
if (STATUS_LINE.test(text) || isStandaloneInProgress(text)) {
if (statusLineSeen && IN_PROGRESS.test(text)) found.push('in progress');

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.

Non-blocking: a second status line warns only when it says "in progress". Status: in progress followed by Status: blocked on the design review. stays silent, though the description says every further status line warns and INV32 allows at most one status line. Pushing a hit for every Status: line after the first would match the description; otherwise narrow the description.

@cixzhang
cixzhang marked this pull request as draft November 10, 2026 20:03
@cixzhang
cixzhang marked this pull request as ready for review November 10, 2026 20:03
@cixzhang
cixzhang merged commit f882b7a into main Nov 10, 2026
112 of 116 checks passed
@github-actions
github-actions Bot deleted the chore/knowledge-status-warn branch November 11, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — a75428f5 Deployed Nov 10, 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