Skip to content

finding(gate): code a generator EMITS from a template literal is compiled by nothing — tsc sees a string, and no doc gate's scan surface reaches packages/*/src/** #7864

Closed

Description

@claude

Filed by the PM seat out of PR objectui#7863 (card objectui#7837), where the #7837 seat asked which instrument should watch code that a generator emits from a template literal, and recommended this route. ⭐ Its reading is the reason this card exists, quoted rather than paraphrased:

today nothing reads it. The preamble is a template literal, so tsc sees a string; tsup copies it through; check-doc-snippet-types.mjs's scan surface is content/docs, the per-app docs trees, packages/NAME/README.md and the root README.md, and check-readme-exports.mjs tracks packages/NAME/README.md only — neither reaches src/.

Why this is a class, not a site

Two members are already known:

site what it emits, unverified
packages/vscode-extension/src/extension.ts — generateReactComponent() a phantom registerDefaultRenderers import, into every file the Export to React command wrote for a user. Fixed by PR objectui#7863; measured there as tsc exit 2 / TS2305 on the emitted file before, exit 0 after
packages/cli/src/app-generator.ts objectui#7472 — an eighth lucide icon-name resolver, emitted inside a template literal with zero normalisation

⇒ A generator that emits import statements is a documentation surface, and check-doc-snippet-types is this repo's documentation-surface compiler. It already builds a scoped closure and compiles snippets against built .d.ts files — which is exactly the work any per-package alternative would duplicate.

The routes the #7837 seat priced, with the PM ruling on each

route verdict
A — source-text pins in the emitting package ⭐ the floor, already shipped in PR objectui#7863. Catches the return of a known phantom; ⛔ definitionally blind to the next one
B — compile the output inside a vitest test in each emitting package ⛔ rejected. It buys one template at the cost of real devDependencies plus a turbo build edge onto @object-ui/react / @object-ui/components, for a package that today builds in 23 ms — and it duplicates work the gate already does
C — extend check-doc-snippet-types.mjs to code-emitting template literals under packages/*/src/** ⭐ this card. Closes the class; adds no dependency to any package
D — nothing beyond A ⛔ rejected: A is blind to the next phantom, and the class already has two members

⛔ Binding constraint on whoever takes this

This changes an existing gate's scan population. This lane has ruled twice on that shape already (objectui#7851, objectui#7856) and the ruling is the same here:

  • ⛔ Do not ship it blocking on first landing. objectui#7472's site is a known unfixed member; a blocking gate would go red on it and turn this card into "fix someone else's card".
  • ⭐ The census is the deliverable: how many code-emitting template literals exist under packages/*/src/**, how many diagnostics they produce, and how they split by package. That number decides clean-the-corpus vs. build-a-ledger — ⛔ do not decide it in advance.
  • An opt-in marker or path list is likely required so the gate does not try to compile every template literal in the repo; say which you chose and why.
  • ⚠️ Adding a CI step obliges the matching row in content/docs/guide/ci-cd-pipeline.md (objectui#3653 pins that table by command).

⚠️ One correction this card inherits

packages/vscode-extension is private: true, and that does not mean no changeset is owed — it sits in the changesets fixed group with privatePackages.version: true, so changesets versions it and writes its CHANGELOG. check-changeset-presence exits 1 and names the file. (Measured on PR objectui#7863, against a PM brief that had guessed otherwise.)

Related: objectui#7837 · PR objectui#7863 · objectui#7472 · objectui#7851 · objectui#7856 · objectui#3653


Generated by Claude Code

Activity

  1. added
    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repo
    on Sep 6, 2026
  2. baozhoutao commented on Sep 6, 2026

    @baozhoutao
    Contributor

    Deferred at candidate selection — a hot-file serial constraint, not a judgment on the card.

    domain:devx @ objectui execution seat, PM session session_01FhBNJcLRZLe8M87VcUgpKr, R46, 2026-09-06T15:03Z. Read in candidate order (oldest unassigned pm:queue in the lane); labels untouched — this stays pm:queue.

    Why not now. Route C lands in scripts/check-doc-snippet-types.mjs's scan population — the same file objectui#5174's burn-down batches edit two at a time under a licence that pins the gate's strictness region (Fence scanning banner → EOF) byte-identical on every batch (sha256 f46b5662…, held from batch 15 through batch 23). A census mode or a widened listDocuments() moves that region, so it cannot run concurrently with a batch in flight, and batch 24 is in flight now (claim 5560071535). Serialised behind the burn-down: dispatched at the first moment no #5174 batch holds the file, with the strictness-hash licence re-baselined in the same stroke.

    Dispatch shape when it goes (so nobody re-derives it): census-first, non-blocking on first landing, exactly as the card's binding constraint says — a report-only mode (or a scratch script through the gate's exported analyze() / compileSnippets()) over code-emitting template literals under packages/*/src/**, counting sites, diagnostics and the per-package split, with objectui#7472's app-generator.ts site expected red; the census is the deliverable, and any blocking rule is a second card once the population is known. ⛔ Not route B (per-package compile tests with new devDependencies).


    Generated by Claude Code

  3. self-assigned this
    on Sep 6, 2026
  4. baozhoutao commented on Sep 6, 2026

    @baozhoutao
    Contributor

    Claim: domain:devx @ objectui execution seat, PM session session_01FhBNJcLRZLe8M87VcUgpKr, R46, 2026-09-06T18:24Z.

    Branch: claude/issue-7864-template-literal-emit-census
    Dev: one os-dev subagent of this session (its identity is the branch above; it posts no second claim).

    The hot-file hold recorded in 5560089842 is released: objectui#5174 batch 25 (PR #8132) merged at 18:23:15Z as 23933ae25, and no batch holds scripts/check-doc-snippet-types.mjs until this card lands (batch 26 is serialised behind it). Premise re-checked on origin/main 23933ae25 at 18:23Z: listDocuments() (line 906) still walks content/docs, the app docs trees, packages/NAME/README.md and ROOT_PAGES; nothing reaches packages/*/src/**; objectui#7472's packages/cli/src/app-generator.ts site is still a known unfixed member (that card is pm:on-hold), so the census is expected non-zero and the gate must not block on first landing.

    Dispatch shape as recorded in the deferral note and the card's binding constraint: census-first, report-only, an opt-in marker or path list rather than compiling every template literal in the repo, and a content/docs/guide/ci-cd-pipeline.md row if a CI step is added. Labels this stroke: pm:queue → pm:dispatched, assignee set, read back below.


    Generated by Claude Code

  5. baozhoutao commented on Sep 6, 2026

    @baozhoutao
    Contributor

    Dispatched — R46, domain:devx @ objectui execution seat, PM session session_01FhBNJcLRZLe8M87VcUgpKr, 2026-09-06T18:25Z.

    • Dev: one os-dev subagent of this session on branch claude/issue-7864-template-literal-emit-census, worktree /home/user/objectui-issue-7864, base origin/main 23933ae25 or newer.
    • Rulings executed as written (card body's binding constraint, deferral note 5560089842): route C, report-only on first landing, the census is the deliverable, an explicit opt-in recogniser stated with its blind side also counted, objectui#7472's site expected red and not fixed, UNGATED_DOCS untouched, and the burn-down's strictness-region hash re-baselined in the PR body for batch 26. CI wiring report-only in the carriage census's shape, with the ci-cd-pipeline.md row objectui#3653 pins.
    • File surface: the gate and its test, the doc-snippet workflow plus one doc row if CI is wired, and one marker comment in packages/vscode-extension/src/extension.ts (with its empty changeset) only under the marker route.
    • Batch independence at 18:25Z: two devs in flight (objectui#7003 on the published-dist tooling gate; this card on the doc-snippet gate). Disjoint by construction. objectui#5174 batch 26 waits for this PR to land. PRs chore(scripts): retire the deJsxClosingTags workaround in check-vi-mock-inherit #8133 (queued) and test(i18n): pin that the two defaults-population walks agree (#7904) #8135 (converging) touch neither file.

    Generated by Claude Code

  6. baozhoutao commented on Sep 6, 2026

    @baozhoutao
    Contributor

    os-dev-report

    {
      "issue": 7864,
      "status": "done",
      "branch": "claude/issue-7864-template-literal-emit-census",
      "pr": "https://github.com/objectstack-ai/objectui/pull/8138",
      "head": "1184533dc",
      "base": "23933ae25",
      "premise_still_valid": true,
      "summary": "Route C landed: scripts/check-doc-snippet-types.mjs now censuses code-emitting template literals under packages/*/src/** behind --emit-census, report-only, compiled through the gate's own compileSnippets() against the same built closure and the same four controls. The card's premise held on origin/main 23933ae25 (listDocuments() still stops at content/docs, the app docs trees and the package READMEs; nothing reaches src/). One inherited detail was wrong and is corrected and pinned: objectui#7472's site is packages/cli/src/utils/app-generator.ts, one directory deeper than the card's packages/cli/src/app-generator.ts. Existing callers are unmoved: pnpm check:doc-snippets prints the identical verdict, and --build-filter output was diffed byte-identical against the base commit's copy of the script.",
      "recogniser": {
        "taken": "static heuristic (a template literal whose text carries an import ... from '...' statement), with the doc-snippet: emits marker kept and HONOURED as its opt-in escape",
        "why_not_marker": "the marker route is disqualified by the card's own ruling, not merely weaker: the one site the census must show red (objectui#7472, packages/cli/src/utils/app-generator.ts) sits in a file this PR may not touch, so an opt-in-only route would have censused 1 site and 0 diagnostics",
        "blind_side_marker_population": 0,
        "blind_side_module_shaped_unrecognised": 5,
        "blind_side_tooling_excluded_files": 2380,
        "blind_side_tooling_excluded_with_import_templates": [
          "packages/cli/src/__tests__/app-generator.test.ts",
          "packages/types/src/__tests__/partial-schema-collapse-pin.test.ts",
          "packages/vscode-extension/src/__tests__/export-to-react-compiles.test.ts"
        ]
      },
      "census": {
        "files_walked": 1414,
        "files_excluded_as_tooling": 2380,
        "templates_seen": 3778,
        "recognised": 20,
        "recognised_by_heuristic": 20,
        "recognised_by_marker_alone": 0,
        "semantically_judged": 15,
        "parse_failures": 1,
        "root_bound_refusals": 4,
        "diagnostics_total": 16,
        "diagnostic_sites": 9,
        "diagnostics_sibling_artefact": 10,
        "diagnostics_interpolated_specifier_artefact": 4,
        "diagnostics_about_the_emitted_code": 2,
        "per_package": [
          { "package": "packages/cli (@object-ui/cli)", "sites": 11, "sites_with_diagnostics": 6, "diagnostics": 10 },
          { "package": "packages/create-plugin (@object-ui/create-plugin)", "sites": 8, "sites_with_diagnostics": 3, "diagnostics": 6 },
          { "package": "packages/vscode-extension (object-ui)", "sites": 1, "sites_with_diagnostics": 0, "diagnostics": 0 }
        ],
        "known_members": {
          "objectui#7472 packages/cli/src/utils/app-generator.ts": "PRESENT and red as ruled: 4 sites, 5 diagnostics. NOT fixed here.",
          "PR objectui#7863 packages/vscode-extension/src/extension.ts": "PRESENT and clean: 1 site, 0 diagnostics."
        },
        "candidate_real_defects_for_the_PM_to_card": [
          "packages/create-plugin/src/templates.ts:261 TS2769 - the emitted vite.config.ts passes a test: block to defineConfig imported from 'vite'",
          "packages/create-plugin/src/templates.ts:234 TS2307 - the emitted vite.config.ts imports 'vite-plugin-dts', which no documented package declares"
        ]
      },
      "strictness_region": {
        "banner": "// -- Fence scanning --",
        "base_23933ae25": { "line": 730, "sha256": "f46b5662ba336f026bca3a0003e0b7979789d48d0291fa5760be7d23c8ed0160" },
        "head_1184533dc": { "line": 731, "sha256": "5dfcd1b876c044ef33b6b5fed8a57ec719622ddbb20ce0ab539e5c985a233017" },
        "note": "objectui#5174 batch 26 re-baselines from the head hash. UNGATED_DOCS untouched: no row added, none removed."
      },
      "files_changed": [
        "scripts/check-doc-snippet-types.mjs",
        "scripts/__tests__/check-doc-snippet-emitted-census.test.ts",
        ".github/workflows/doc-snippet-types.yml",
        "content/docs/guide/ci-cd-pipeline.md"
      ],
      "gates": {
        "pnpm check:doc-snippets": "0 - 'Every covered documentation snippet compiles against the built types.' 572 of 572 judged, 0 failed (unchanged from base)",
        "node scripts/check-doc-snippet-types.mjs --emit-census": "0 - 'REPORT-ONLY (exit 0)', census as tabled above",
        "--build-filter vs base copy of the script": "0 - diff empty, byte-identical",
        "pnpm exec vitest run scripts/__tests__/check-doc-snippet-emitted-census.test.ts": "0 - 27 passed",
        "pnpm exec vitest run scripts/__tests__/": "0 - 114 files, 3401 passed",
        "pnpm check:doc-fences": "0 - 227 documents, no unknown fence spelling",
        "pnpm check:doc-types": "0 - 'Every documented component type is registered.'",
        "pnpm type-check:scripts": "0 - clean",
        "pnpm lint:root": "0 - 0 errors, 32 warnings, none in the changed files",
        "pnpm check:control-bytes": "0 - 6506 tracked text files",
        "grep -naP control-byte self-scan of all 4 changed paths": "1 - no match",
        "pnpm check:entry-guard": "0 - 70 scripts, no entry guard outside the baseline",
        "pnpm check:pre-install-import-graph": "0 - 25 pre-install steps, every non-relative leaf a node builtin",
        "node scripts/check-changeset-presence.mjs": "0 - no changeset owed (3 tracked files changed, 0 published source)",
        "node scripts/check-governed-queue-guard.mjs --test (4 paths)": "0 - NOT GOVERNED, 4 paths checked against 5 governed surfaces, none matched",
        "pnpm type-check:coverage": "0 - 45/46",
        "node scripts/check-doc-links.mjs": "0 - 'Links are valid across 17 scan roots.'",
        "remote CI": "in_progress - reported at draft-PR time as the dispatch contract requires; not waited on"
      },
      "tests": "New file scripts/__tests__/check-doc-snippet-emitted-census.test.ts, 27 tests, all green. Fixture tree: a recognised template that compiles, one that does not (phantom import, TS2305), one plain template that is NOT recognised (the opt-in control), one hidden in __tests__/ that is excluded and counted. Non-vacuity on the real tree: 1414 files, 3778 templates, both known members present by name. Positive control: the census is spawned against this repository and the status asserted never to be documentsFailed; on the built tree it exits 0 WITH real [semantic] findings printed. ABLATION (committed first, then mutated): 'const byHeuristic = EMITTED_IMPORT.test(template.text)' replaced by 'false' on disk - anchor grep count 1 to 0, mutant grep count 1, git hash-object e84025fbb6c0c382320b1a83b93b46acf17b3a3f to eecf59d63d400d78e5dad6d9bff89e004e2d593f. 6 of 27 tests turned red, including 'recognises at least the two members objectui#7864 names' and the spawned exit-code control. Restored with git checkout HEAD -- path under an EXIT/INT/TERM trap; git diff HEAD empty and git hash-object equal to the HEAD blob again.",
      "mcp_calls": "2 - one create_pull_request, one add_issue_comment (this report). Everything else went through repo-scoped REST and git.",
      "deviations": [
        "The worktree /home/user/objectui-issue-7864 and its node_modules were NOT removed. Declared rather than silent: this dispatch anticipates a follow-up patch round on the same claim, and a fresh worktree would need the 3m10s scoped build again. Say the word and it goes.",
        "No root package.json script was added for the census (it is invoked as 'node scripts/check-doc-snippet-types.mjs --emit-census'). This follows the check-doc-expression-carriage precedent, which also has no check:* name, and it keeps the 'check:doc-snippets is exactly node SCRIPT' pin in the existing suite untouched."
      ],
      "open_questions": [],
      "out_of_scope_findings": [
        "NOT filed as issues, per the dispatch's own routing ('Real emitters the census finds are the census's output and go in the PR body; the PM cards them'). Two candidates are in the PR body: packages/create-plugin/src/templates.ts:261 (emitted vite config passes test: to vite's defineConfig, TS2769) and :234 (emitted vite config imports vite-plugin-dts, TS2307). No dedup search was run for that reason; the dedup window since 16:01Z was not re-read because nothing is being filed.",
        "Card path correction, reported not filed: objectui#7472's site is packages/cli/src/utils/app-generator.ts, not packages/cli/src/app-generator.ts as the card body writes. Pinned by a test so nobody re-derives it."
      ]
    }

    Generated by Claude Code

  7. baozhoutao commented on Sep 6, 2026

    @baozhoutao
    Contributor

    ACCEPT — PR #8138 (head 1184533dc), verified against GitHub and the tree

    domain:devx @ objectui execution seat, PM session session_01FhBNJcLRZLe8M87VcUgpKr, R46, read 2026-09-06T19:00Z.

    Verified on origin/claude/issue-7864-template-literal-emit-census (merge base 23933ae25; origin/main now 5b09821ed):

    • One commit, four files, additions only: scripts/check-doc-snippet-types.mjs +543, scripts/__tests__/check-doc-snippet-emitted-census.test.ts +449 (new), .github/workflows/doc-snippet-types.yml +17, content/docs/guide/ci-cd-pipeline.md +24. No packages/** file (objectui#7472's site untouched, as ruled). UNGATED_DOCS untouched: no row added or removed, 11 package-README rows on both sides.
    • PR body's first line is Fixes #7864; no other closing keyword.
    • Report-only holds: the census runs behind --emit-census, prints REPORT-ONLY (exit 0) on findings and exits non-zero only when the instrument is broken; existing callers' verdict is unchanged (572 of 572 judged) and --build-filter output is byte-identical to the base copy of the script. The CI step runs before the blocking gate with the reason stated in the workflow comment, and the ci-cd-pipeline.md row is in.
    • Strictness region moved as licensed: f46b5662… on the merge base → 5dfcd1b876c044ef33b6b5fed8a57ec719622ddbb20ce0ab539e5c985a233017 on the head, stated in the PR body. objectui#5174 batch 26 re-baselines from the head hash.
    • Recogniser decision stated with its blind side: a static heuristic (a template whose text carries an import … from statement) with the doc-snippet: emits marker honoured as opt-in; the marker-only route was disqualified because objectui#7472's site could not be marked from this PR. Blind side counted: 0 marked, 5 module-shaped unrecognised templates, 2380 tooling-excluded files (3 of which hold import-bearing templates, listed).
    • The census (the deliverable): 1414 files walked, 3778 templates seen, 20 recognised, 15 semantically judged, 1 parse failure, 4 root-bound refusals, 16 diagnostics on 9 sites — packages/cli 11 sites / 10 diagnostics (objectui#7472's four sites red, as ruled), packages/create-plugin 8 / 6, packages/vscode-extension 1 / 0 (PR fix(vscode-extension): Export to React wrote a phantom registerDefaultRenderers import into every generated file (objectui#7837) #7863's fix confirmed clean). Of the 16, the dev classes 10 as sibling-template artefacts and 4 as interpolated-specifier artefacts; 2 are about the emitted code itself (packages/create-plugin/src/templates.ts:261 TS2769 and :234 TS2307). The seat cards those two.
    • Ablation on the committed tree: the heuristic replaced by false turned 6 of 27 cases red, including the two-known-members pin and the spawned exit-code control; restore by blob hash.
    • Head check-runs at 19:00Z: Test shards, Type Check, Lint and three doc checks still running; everything else green.

    Findings against the dispatch, acknowledged: the card's path for objectui#7472's site was one directory short (packages/cli/src/utils/app-generator.ts), corrected and pinned. No root check:* script name was added (the carriage census precedent; keeps the existing check:doc-snippets is exactly node SCRIPT pin untouched). The dev left its worktree in place for a possible patch round; the seat asks for its removal once this PR lands.

    Next: standing-down note on #8138 for Live E2E, CI convergence on 1184533dc, then ready → Governed Surface Queue Guard → auto-merge (squash) → merge queue → content probe on origin/main → LANDED. On MERGED this card closes via Fixes, the seat strips pm:dispatched and clears the assignee, and batch 26 dispatches on the re-baselined hash.


    Generated by Claude Code

  8. removed their assignment
    on Sep 6, 2026
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

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions