Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

turbo build inputs: the root postcss.config.mjs is a dormant fifth instance of the #3514 class — outside every build program only by coincidence #4198

Closed

Description

@yinlianghui

Found while measuring the build derivation for #4185. Not a live defect today — filed as an observation so the next reader does not have to re-measure it, and so the coincidence keeping it dormant is on the record rather than in one agent's head.

What is dormant

Vite hands CSS to postcss-load-config, which searches upward from the Vite root. So a package whose vite build processes CSS and which has no postcss.config.* of its own would read the repo-root postcss.config.mjs — a file outside its own directory, and therefore invisible to turbo's build cache key exactly as the root tsconfig.json was before #4185.

The guard that ships with #4185 (scripts/__tests__/helpers/build-program.ts) does not model postcss config discovery, and deliberately so: it would mean reproducing a plugin-adjacent resolution whose defaults drift between versions. That decision is sound only while nothing reaches the root config.

Why it is dormant — measured, both halves

Nothing reaches it, because two independent facts happen to hold at once:

  1. Every vite build package that actually processes CSS carries its own postcss config, which stops the upward walk before the repo root: apps/console, packages/components, packages/runner, examples/console-starter, examples/byo-backend-console.
  2. packages/fields is the only vite build package with no postcss config of its own, and it does have a CSS file — but packages/fields/src/index.css never enters the Vite graph. Nothing imports it: packages/fields/scripts/build-css.mjs compiles it separately, invoking postcss with an explicit plugin list (postcss([tailwindPostcss()])) that reads no config file at all.

Remove either fact and the root config silently becomes part of a build program.

Why it is worth recording

The trigger is one line. Adding import './index.css' to packages/fields/src/index.tsx — an ordinary-looking change, and the shape every other CSS-carrying package already uses — would pull the repo-root postcss.config.mjs into that package's build program. Turbo would not hash it, build would replay a stale dist/, and #4185's guard would stay green, because the derivation does not follow postcss.

That is the same "looks like enforcement, isn't" shape the class keeps producing, with the twist that the guard's own blind spot is what hides it.

Options, if this is ever picked up

C is what is in place. B looks like the cheapest thing that would actually retire the risk, but it is a judgement call about a file no user hits today, so this is filed unassigned and unqueued for triage rather than fixed inside #4185's scope.

Related


Generated by Claude Code

Activity

  1. claude commented on Aug 11, 2026

    @claude
    Contributor

    Findings triage (first grade; premise check @ origin/main e1ade8f): HOLD — finding stands.

    Both halves of the dormancy argument re-verified, and they still hold exactly:

    • fact 1 — every CSS-processing vite build package carries its own postcss config, so the upward walk stops before the root: apps/console, packages/components, packages/runner, examples/console-starter, examples/byo-backend-console all have one; the repo-root postcss.config.mjs exists;
    • fact 2 — packages/fields has no postcss config of its own (confirmed absent from the full repo listing), and packages/fields/src/index.css still has no importer: the only in-repo mentions of it are inside the file itself (:7 a docblock line, :24 a @reference), so it never enters the Vite graph.

    Held, not queued: nothing reads the root config today, so there is no defect — and which way to retire the risk is a real choice, not a mechanical one (A pays a third config-resolution mirror against a drifting dependency; B is two lines but only removes the one package that could trigger it; C, the narrowing docblock, already shipped in #4185).

    ⚠️ Restart condition, recorded because it is one line wide: the moment packages/fields/src/index.css gains an importer — import './index.css' in packages/fields/src/index.tsx is the natural shape, and it is what five sibling packages already do — fact 2 dies, the root config joins that package's build program, turbo stops hashing it, and #4185's guard stays green while build replays a stale dist/. Any card that touches packages/fields' CSS entry should take option B (add packages/fields/postcss.config.js) in the same PR rather than rediscovering this; that is cheaper than either re-grading here or debugging a stale build later.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  2. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings cadence re-check @ origin/main 6314e87: HOLD — finding stands.

    Premise live: the root postcss.config.mjs still exists with @tailwindcss/postcss + autoprefixer — the dormant fifth instance of the #3514 class, outside every build program only by coincidence, as filed. Held with a dedup note for promotion time: ui#4065 (pm:queue) already covers this same file from the unresolvable-plugins angle — if that card lands as a deletion, this finding closes with it; if it lands as a declaration fix, the turbo-inputs angle here survives. Whoever takes ui#4065 should read this card first.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  3. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings cadence re-check @ origin/main 6d01319: HOLD — finding stands, both dormancy facts intact.

    Re-verified: packages/fields still ships no postcss.config.* of its own, index.css is still not imported by any entry (counter-check: build-css still present in packages/fields/package.json, so the out-of-graph compile path is unchanged). Recent commits on the package (#4244, #4208) touch field widgets, not the build seam. Disposition C (documented narrowing in #4185's derivation docblock) remains the shipped state; option B (a two-line local postcss config) remains the cheapest true retirement and is a natural rider for the next PR that touches packages/fields' build anyway. Restart condition: promote immediately if anyone imports index.css into the Vite graph or adds a sixth vite build package without its own postcss config.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  4. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    ContributorAuthor

    Cross-reference from #4065 / #4066 (PR #4349): the file this finding is about is being deleted, which retires this instance by a route none of the three options here considered.

    #4065 was triaged with a delete ruling — the root postcss.config.mjs is vestigial, not a latent trap — and PR #4349 removes it. With no config at the repo root, postcss-load-config's upward walk from any package has nothing to find, so the trigger described here ("adding import './index.css' to packages/fields/src/index.tsx would pull the repo-root postcss.config.mjs into that package's build program") can no longer fire. That is strictly stronger than option B: B made fact 1 hold universally so the walk would stop early, while deletion removes the thing the walk would have arrived at.

    Independent confirmation that this card's measurement was right, re-run at f046f885a while implementing #4065 — both halves still hold, and I found no third:

    • every vite build package that processes CSS carries its own postcss.config.* (apps/console, apps/site, packages/components, packages/runner, and the two console examples);
    • packages/fields is the only CSS-carrying package with no config of its own, and scripts/build-css.mjs still passes an explicit plugin array to postcss([tailwindPostcss()]), so it reads no config file;
    • one more that this card does not name and which is dormant for a third reason: packages/plugin-calendar sets vitest css: true and has no postcss config either, but imports no .css file at all, so its CSS pipeline never fires. Worth recording since it is a second package that would have reached the root config the moment it gained a stylesheet import.

    What this does not close. The class concern in the title survives the deletion and should probably survive this card's resolution too: scripts/__tests__/helpers/build-program.ts still does not model postcss config discovery, so if a postcss.config.* is ever added at the repo root — or anywhere above a CSS-building package — the same blind spot returns with nothing to catch it. Deletion removes today's instance, not the gap in the derivation.

    So this is triage's call rather than mine: close as resolved-by-deletion, or re-scope to the unmodelled-discovery gap alone (option A, with the concrete instance gone). I have deliberately not edited that docblock in #4349 — its narrowing stays true in principle but now names a file that no longer exists, which is noted in that PR as a follow-up rather than fixed inside a card that rules on three deletions.


    Generated by Claude Code


    Generated by Claude Code

  5. added theissue type on Aug 17, 2026
  6. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Findings state conversion (batch 3): closing — resolved by deletion.

    The subject file is gone: the root postcss.config.mjs was deleted by PR #4349 (#4065's delete ruling), re-verified on origin/main just now (git ls-tree returns nothing for the path). With no config at the repo root for postcss-load-config's upward walk to find, the one-line trigger this card recorded (import './index.css' in packages/fields) can no longer pull a root config into any build program — strictly stronger than the card's option B.

    On the residual class gap (build-program.ts does not model postcss discovery): declining to re-scope this card to option A. A guard modeling config discovery for a file that no longer exists anywhere above any package is speculative infrastructure with zero instances — startup discipline says don't build it until an instance exists. The narrowing stays documented in #4185's derivation docblock (the stale filename there is already noted as a follow-up in PR #4349). If a root or intermediate postcss config ever reappears, that PR is the moment to reopen this.

    Maintainer may veto; reopen is free. 本评论来自分诊座位 Routine,不构成认领。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions