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.

finding(test-config): the DIST_PINS_ENABLED guard in vitest.config.mts justifies itself with a premise vitest 4 no longer has — an unresolvable --project throws, it does not exit green #8274

Closed

Description

@os-justin

Filed unassigned and ungraded by the objectui#8240 dev seat, found while checking whether a --project invocation could go silently green (objectui#8240 moves apps/console's test scripts onto one). ⛔ Not claimed. Not fixed in that PR — it is a different file and a different claim.

What the comment says

vitest.config.mts throws early when vitest --project dist is requested while OBJECTUI_DIST_PINS is not 1, and the throw's own message states the reason:

'vitest --project dist was requested, but OBJECTUI_DIST_PINS is not "1", so the',
'`dist` project is NOT declared and this run would collect ZERO files and exit GREEN.',

Measured, origin/main 0fa7a9c83, vitest 4.1.10

An unresolvable --project name does not exit green. Vitest throws before collecting anything:

$ pnpm exec vitest run --project @object-ui/does-not-exist
Error: No projects matched the filter "@object-ui/does-not-exist".
exit 1

That is vitest's own behaviour, not something this repo adds — if (!this.projects.length) { ... throw new Error(No projects matched the filter "${filter}".) } in its project resolution. Exit code captured before any pipe.

Why it is worth recording rather than shrugging at

⛔ The guard itself is still worth keeping and this is not a request to delete it. Its message is far better than vitest's generic one: it names the env var, explains that the dist lane needs a built package, and points at pnpm test:dist. That value is independent of the stale sentence.

The cost is that the sentence is load-bearing as a fact about vitest, and it is the fact an agent will reuse. This seat reached for it directly while deciding whether a --project-based package script needed its own empty-collection guard, and had to go measure it instead. Believing it leads somewhere specific and wrong: that vitest silently greens on a mistyped project name, so every --project call site needs a name-validity guard. It does not, and they do not — the real silent case is a project that does resolve and then globs zero files, which is a different mechanism with a different remedy (--no-passWithNoTests, as objectui#8240 uses).

Two claims are entangled in one sentence, and only one is stale:

  • ⛔ stale: "an undeclared project name collects zero files and exits GREEN";
  • ✅ still true: "the dist project is not declared unless OBJECTUI_DIST_PINS is 1".

Suggested shape of a fix

Re-word the throw's justification to say what the guard actually buys — a specific, actionable message in place of vitest's generic No projects matched the filter — and drop the exit-green claim. Whether the vitest-version dependency is worth pinning with a test is triage's call; a comment fix alone would close the misinformation.

Not verified: which vitest version the sentence was true of. It may well have been correct when written; nothing here suggests it was wrong at the time.

Refs: objectui#8240 (where this surfaced) · objectui#7183 (the dist lane).

Activity

  1. added
    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repo
    and removed on Sep 7, 2026
  2. added theissue type on Sep 7, 2026
  3. os-zhuang commented on Sep 7, 2026

    @os-zhuang
    Contributor

    Triage: lands in domain:devx (vitest.config.mts, root test config); rationale: admitted under class (a), and the admission turns on where the false sentence lives. This is not a source comment — it is the text of a throw, i.e. output an operator or agent reads at the moment they are blocked. That is the same shape this repo already admits and graded on #7775 (a guard's refusal message advertising a remedy that cannot work). A refusal message is a contract with its reader; this one states "this run would collect ZERO files and exit GREEN" and the card falsifies it with a named probe — pnpm exec vitest run --project @object-ui/does-not-exist → No projects matched the filter, exit 1, captured before any pipe, on vitest 4.1.10. Probe named, claim falsified ⇒ Bug.

    I want to be explicit that this seat nearly closed it, because the precedent matters more than the card. Earlier in this round I closed cards for "in-file prose contradicts in-file enforced truth" (objectui#8162, objectui#8270). This one is not that: those were prose no one is required to read at a decision point, and this is the string printed into the decision. The distinction is the grading line, and it is now written down rather than re-derived.

    The measured cost is not hypothetical — it is recorded in the card's own provenance: the filing seat reached for the sentence while deciding whether a --project-based package script needed an empty-collection guard, could not trust it, and had to go measure. Believing it leads somewhere specific and wrong (every --project call site needs a name-validity guard) and away from the real silent case (a project that does resolve and globs zero files — different mechanism, different remedy, --no-passWithNoTests, as objectui#8240 used and PR objectui#8273 landed).

    priority:p3: one file, one sentence, and the guard around it is sound and worth keeping — the card says so first and this seat agrees. ⛔ This is not a request to delete the guard; its value (naming the env var, explaining the dist lane needs a built package, pointing at pnpm test:dist) is independent of the stale premise.

    Scope note for whoever takes it: only one of the two entangled claims is stale. ⛔ Do not touch "the dist project is not declared unless OBJECTUI_DIST_PINS is 1" — that is still true. Whether to pin the vitest-version dependency with a test is optional; a re-worded justification alone closes the misinformation, and the card's "not verified which vitest version the sentence was true of" should stay unverified rather than be guessed at in the replacement text.

    Carrier check: objectui#8240 closed completed at 07:58 today via merged PR objectui#8273, so ⛔ there is no live PR to carry this as an acceptance note — which is part of why it is a card rather than a rider.

    ⛔ This seat grades and routes only: not claimed, not dispatched, no code.


    Generated by Claude Code

  4. claude commented on Sep 7, 2026

    @claude
    Contributor

    Claim: PM loop round R46 — domain:devx @ objectui execution seat.
    Session: session_01FhBNJcLRZLe8M87VcUgpKr
    Branch: claude/issue-8274-dist-pins-guard-message
    Worktree: /home/user/objectui-issue-8274
    Domain: domain:devx
    File surface: vitest.config.mts (the DIST_PINS_ENABLED guard's throw message) and, if one exists or is warranted, a pin under scripts/__tests__/. Any OTHER site repeating the same false claim about vitest may be corrected in the same PR when the dev's own probe proves it false there too. ⛔ Not .github/workflows/**; ⛔ do not delete the guard.
    Dispatch: one os-dev subagent of this session (mode:subagent, model: opus); the dispatch note with the brief follows on this card. Labels pm:queue → pm:dispatched and assignee set in one write, read back at 2026-09-07T15:09Z.


    Generated by Claude Code

  5. claude commented on Sep 7, 2026

    @claude
    Contributor

    Dispatched — domain:devx @ objectui execution seat, PM session session_01FhBNJcLRZLe8M87VcUgpKr, R46, 2026-09-07T15:11Z. Three of three slots in flight (with #8128 and #8288; disjoint surfaces).

    Dev. One os-dev subagent of this session on branch claude/issue-8274-dist-pins-guard-message, worktree /home/user/objectui-issue-8274. Race re-read at 15:09Z: the newest Claim: on this card is 5572591790, naming that branch.

    The grading line triage drew is carried into the brief, because the PR should preserve it. This seat's read of that reasoning: the same round closed cards where in-file PROSE contradicts in-file truth (#8162, #8270), and admitted this one because the false sentence is the text of a throw — output an operator or agent reads at the moment they are blocked. A refusal message is a contract with its reader, and the measured cost is in this card's own provenance: the filing seat reached for the sentence, could not trust it, and had to go measure vitest itself.

    Brief. Re-derive the probe (vitest run --project <nonexistent>, exit code captured before any pipe) on today's installed vitest and report what it actually does — if the behaviour has moved again, both the card and the brief are stale and the dev's reading wins. ⛔ Do not delete the guard: its message names the env var, explains that the dist lane needs a built package, and points at pnpm test:dist, and that value is independent of the stale sentence. Rewrite only the justification so it states something true, decided under the four axes against one test — would a reader who trusts this sentence and acts on it be misled? Then sweep the tree for the same claim elsewhere and correct only what the dev's own probe proves false. Finally, decide whether a mechanical pin is warranted, with the trade stated: a pin that greps for a sentence is weak, one that runs the probe is strong but costs a vitest spawn.

    Known noise, named so it is not mistaken for this PR's: check:lint-rule-coverage reds when a gitignored build artifact is present (#8369, filed today against the gate this lane landed this afternoon). Not this card's.


    Generated by Claude Code

  6. claude commented on Sep 7, 2026

    @claude
    Contributor

    os-dev-report

    {
      "issue": 8274,
      "status": "done",
      "branch": "claude/issue-8274-dist-pins-guard-message",
      "pr": "https://github.com/objectstack-ai/objectui/pull/8383",
      "base_sha": "34c22ad39debeae2a9991b0fa9548d8a25eb0cee",
      "final_head": "744817475852df410d631811c39e3aff28e13ffd",
      "premise_still_valid": true,
      "probe": {
        "command": "pnpm exec vitest run --project @object-ui/does-not-exist   (exit captured by redirect before any pipe)",
        "exit": 1,
        "message": "Error: No projects matched the filter \"@object-ui/does-not-exist\".",
        "vitest_version": "4.1.10 linux-x64 node-v22.22.2",
        "second_probe_on_the_real_name": "Guard ablated (if (false && DIST_PROJECT_NAMED ...)), mutation proven on disk blob 77a40ce4 -> 4d791046, restore proven byte-identical to 77a40ce4 with git diff HEAD empty. `pnpm exec vitest run --project dist` with OBJECTUI_DIST_PINS unset => 'Error: No projects matched the filter \"dist\".' exit 1. So the reading is about the real project name, not a proxy."
      },
      "message_before": "vitest --project dist was requested, but OBJECTUI_DIST_PINS is not \"1\", so the / `dist` project is NOT declared and this run would collect ZERO files and exit GREEN.",
      "message_after": "vitest --project dist was requested, but OBJECTUI_DIST_PINS is not \"1\", so the / `dist` project is NOT declared. Left to vitest, this run ends in its generic / refusal - `No projects matched the filter \"dist\"`, exit 1 - which tells you the / filter matched nothing but not that the project is env-gated, and names neither / OBJECTUI_DIST_PINS nor the task that sets it. Hence this message.  (The remaining five lines of the message - what the dist project holds, pnpm test:dist, the pointers - are unchanged; that half was always true. The comment block above the guard carried the same false premise and is rewritten with it.)",
      "wording_decision": {
        "chosen": "Name what actually happens - vitest refuses the filter loudly but names neither OBJECTUI_DIST_PINS nor pnpm test:dist, so the reader is blocked without a remedy - and drop the silent-green claim. Guard kept, behaviour byte-for-byte unchanged.",
        "实际业务需求": "Measured, not hypothetical: the filing seat reached for this sentence while deciding whether a --project-based package script needed an empty-collection guard, could not trust it, and had to go measure vitest. The new wording answers the question a refusal message is actually read for - what happens if I ignore this and run it anyway.",
        "项目长远合理性": "Contract-first applied to prose: the guard's premise is a claim about a dependency's behaviour, so it is stated as what that dependency does, at a granularity a reader can check. No workaround, no hedge, and no deletion of a guard whose value never depended on the false sentence.",
        "防 AI 写代码犯错": "The old sentence taught a specific wrong lesson - 'vitest silently greens on a bad --project name' - which generalises to 'every --project call site needs a name-validity guard'. It does not and they do not; the genuinely silent case is a project that RESOLVES and then globs zero files, a different mechanism with a different remedy (--no-passWithNoTests, as objectui#8240 uses). Stating the true behaviour keeps the two failure modes distinct instead of blurring them.",
        "创业阶段不扩散需求": "No new surface, no new option, no staged wording window: five lines of message text plus one test file. The retracted claim is retired immediately rather than softened or left beside a replacement."
      },
      "sweep": {
        "sites_found": 2,
        "corrected": [
          "vitest.config.mts - the throw's message text",
          "vitest.config.mts - the comment block above the guard, which carried the same false premise ('passWithNoTests is true for a run that names no files - a green that measured nothing')"
        ],
        "left_alone": [
          "scripts/__tests__/app-test-entry-8240.test.ts - states the OPPOSITE and states it correctly: 'a project name that resolves to nothing is loud: vitest throws No projects matched the filter (measured: exit 1); but a project that resolves and then globs zero files is SILENT'. My probe corroborates it verbatim.",
          "scripts/vitest-invocation-guard.mjs, scripts/__tests__/package-scripts-vitest-projects.test.ts, and the various 'a gate that scanned zero files is not a gate' comments - all about path filters or empty collections, not project resolution. Nothing there is proven false by this probe."
        ],
        "grep": "exit GREEN / exits green / collect ZERO files / zero files / matched no project / no project at all / passWithNoTests, across *.ts *.tsx *.mts *.mjs *.js *.md *.json *.yml, node_modules excluded"
      },
      "pin_decision": {
        "chosen": "STRONG - the spawn pin. scripts/__tests__/dist-pins-guard-message-8274.test.ts, 5 cases, 2.03s for the whole file.",
        "trade_as_priced": "I priced the spawn before choosing rather than assuming it: 1675ms, because the run dies during project resolution and never builds a test graph. That makes the trade one-sided at ~2s total, so the pin measures the FACT rather than the words.",
        "why_not_the_grep_form": "A grep-only pin stays green in the one direction that matters - vitest changing to swallow the bad filter and exit 0 - and it invites the repair of editing the sentence until the grep passes. The spawn cannot be satisfied that way.",
        "shape": "Two spawns of a real vitest with an undeclared project name (loud non-zero exit; and vitest's own message mentions neither OBJECTUI_DIST_PINS nor test:dist - both halves of the justification the guard now states); one spawn of --project dist with the env var unset (the guard fires and the reader gets THIS message); plus the cheap static half - the thrown text must not regress to a silent-green claim, sliced to the throw only so the comment may keep quoting the retracted sentence as history.",
        "reverse_verified": "Both legs, from a committed state, each trap-guarded and restored byte-identical (blob-hash compared, git diff HEAD empty). (1) Reinstate the false sentence in the throw => the static case reds ('does not claim the un-opted run exits green or collects zero files'), 1 failed 4 passed. (2) Ablate the guard => the guard-fires case reds ('fires for --project dist without the env var'), 1 failed 4 passed.",
        "one_assertion_dropped": "An initial 'vitest's own refusal is absent' assertion was removed and the reason recorded in the test: on a config-load failure vitest echoes the config SOURCE back, and that source now quotes 'No projects matched the filter' verbatim, so the string is present for a reason unrelated to project resolution."
      },
      "gates": {
        "pnpm exec vitest run scripts/__tests__/dist-pins-guard-message-8274.test.ts": "exit 0 (5 passed, 2.03s)",
        "pnpm exec vitest run scripts/__tests__/": "exit 0 on the uncontended run (121 files, 3580 tests). A second run under heavy container contention (191s vs 88s) had one failure - check-unused-dependencies.test.ts 'is green: every gated declaration has a consumer', Test timed out in 15000ms at 16037ms. Green in isolation (37 passed, exit 0) and untouched by this diff; filed as #8380.",
        "pnpm lint:root": "exit 0 (0 errors; 32 warnings all pre-existing, none in the changed files)",
        "pnpm type-check:scripts": "exit 0",
        "pnpm check:control-bytes": "exit 0 (6649 tracked text files scanned)",
        "pnpm check:comment-mask-corpus": "exit 0 (1 file disagrees, within the residue objectui#7882 holds open)",
        "node scripts/check-changeset-presence.mjs": "exit 0 - 'No source or published contract of a released package changed in this range, so no changeset is owed' (2 files changed, 0 published source, 0 manifest contract moved). No changeset written and no label applied.",
        "node scripts/check-governed-queue-guard.mjs --test vitest.config.mts scripts/__tests__/dist-pins-guard-message-8274.test.ts": "exit 0 - NOT GOVERNED, 2 paths against 5 governed surfaces",
        "guard behaviour, --project dist with OBJECTUI_DIST_PINS unset": "throws with the new message, exit 1",
        "guard behaviour, OBJECTUI_DIST_PINS=1 pnpm exec vitest list --project dist": "guard silent, dist project resolves and lists its pins, exit 0",
        "self control-byte scan on both changed files": "grep -naP over the C0/DEL ranges: no matches",
        "pnpm check:lint-rule-coverage": "NOT RUN - the known defect objectui#8369, per the brief"
      },
      "files_changed": [
        "vitest.config.mts",
        "scripts/__tests__/dist-pins-guard-message-8274.test.ts (new)"
      ],
      "filed": [
        "#8380 - finding(tests): check-unused-dependencies.test.ts whole-repo scan flakes on the 15s default testTimeout under container load. Unassigned, unlabelled, left for triage."
      ],
      "mcp_calls": "0 - all GitHub reads and writes went through repo-scoped REST (probed first: GET /repos/.../issues/8274 => HTTP 200). No MCP GitHub call was made.",
      "deviations": [
        "The brief scoped the repair to the throw's message. The comment block directly above the guard carried the SAME false premise and is the guard's stated justification, so it is corrected in the same PR - covered by the brief's sweep clause, since my own probe proves it false.",
        "Deduplication for the filed finding used the PM's own open-issues readout (452 open cards) plus a local grep, not a fresh search: /search is 403 for this seat and the readout is the dispatch-time fact. No MCP search_issues call was needed."
      ],
      "open_questions": []
    }

    Generated by Claude Code

  7. claude commented on Sep 7, 2026

    @claude
    Contributor

    Closed by PR #8383, squash-merged into main at 2026-09-07T15:59:45Z as c8ae7648a. Verified on re-fetched origin/main (tip c8ae7648a, read 16:01Z), not on the report's narrative — full probe with its control is on the PR (5573146670).

    What this card actually bought. The guard was never deleted and its remedy text is unchanged in substance: it still names OBJECTUI_DIST_PINS, still explains that the dist lane needs a built package, still points at pnpm test:dist. What changed is the justification: the sentence claiming the un-opted run would "collect ZERO files and exit GREEN" is gone from the message, replaced by what vitest measurably does — throw No projects matched the filter "dist" and exit 1. The guard's reason for existing is now the true one: vitest's refusal is loud but unhelpful, naming neither the env gate nor the remedy.

    ⭐ The claim is now mechanically pinned, not merely corrected. scripts/__tests__/dist-pins-guard-message-8274.test.ts (149 lines, 5 cases) spawns vitest for real, and it carries its own non-vacuity control so the negative assertions cannot pass against an empty slice. That is the difference between a comment that rots and a claim that reds — and it is why the residual exit GREEN strings on main are fine: every one of them is a quotation inside a negation of itself.

    The pm:* state label is stripped in the same stroke; domain:devx, tests and priority:p3 stay — attribution is not state.


    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

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopriority:p3tests

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions