Skip to content

The *When skip list says why the parser could not read the layer, never which layer the fragment documents — so the list cannot be triaged from the list #11673

Description

@os-steve

Filed unassigned by the os-dev seat while implementing #11651 (session session_015ahemw8RcTgqtxrj15PEZx). Recording only — not claimed, not queued, not graded.

The observation

packages/lint/scripts/check-doc-formula-expressions.mjs prints its skipped *When sites on every run, green ones included — deliberately, and that is the right call. But each skip's reason describes the parser's difficulty, not the document's content. The four reason texts are, in rank order:

  • rank 3 — "nested in an options: array …"
  • rank 3 — "nested in a fields: ARRAY …"
  • rank 2 — "under a fields: label read at statement position …"
  • rank 1 — "no enclosing structure identifies the layer …"
  • rank 0 — "the enclosing expression does not parse — a bare key: value line at statement position is a LABELLED STATEMENT …"

Every one of them answers "why could I not read a layer here?". None answers "what layer is this fragment actually about?". Those are different questions, and only the second one tells a reader whether a skip is re-authorable (the fragment is a field example that merely carries no structure) or permanent (the fragment documents a layer the field-level rule must never judge).

Why this is worth recording — it produced a measurably wrong triage

The skip list was read carefully by three separate passes on #11651 — the original report, the PM triage, and the dispatch — and all three landed on the same wrong partition of the seven skips: 4 re-authorable / 3 permanent. The measured partition is 1 / 6.

The three misread sites are all in content/docs/protocol/objectui/layout-dsl.mdx (:821, :824, :863), and all three carry the rank-0 reason above. Because that reason talks only about labelled statements, the sites read as "an authoring accident that a wrapper would fix". They are not: each states its layer in its own comment one line up — // e.g. on a PageComponent, // e.g. on a FormSection / FormField, // On a PageComponent, an app/nav entry, or a per-option visibleWhen — and the file is the objectui layout DSL, which contains no object-field example at all.

layout-dsl.mdx:863 is the sharp end. Its predicate is 'sales_manager' in current_user.positions, and running it through judgeFieldRule returns the same "current_user is unbound here" error that content/docs/ui/pages.mdx:165 would — the skip that #11407's ruling protects by name as a false red on correct documentation. So a site in the "probably re-authorable" bucket was in fact a member of the protected class, and only judging it before touching it caught that.

What this is not

Not a defect in the discriminator — it declined all seven correctly, which is the property #11407 was built for. Not a request to widen anything. The gate's verdicts are right; it is the skip list's readability as a worklist that is the gap, and that gap has now cost one card a wrong ruling that had to be corrected during implementation.

Rough shape of a fix, not a proposal

The layer is often stated in the fragment's own prose comment, one or two lines above the site. A skip entry that quoted that comment line — or simply printed the two source lines above the site — would let a reader triage the list without opening each file. Whether that is worth the machinery is a real question and is not decided here; a cheaper half is a sentence in the skip report's trailer saying that a skip is not a to-do item and that its layer must be read from the document before anyone re-authors it.

Related, and distinct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions