Skip to content

Stage 8 of simplification audit: generated build/meta layer + CI consolidation (~1,300 config lines + metadata bugs, audit §1.5–1.6) #704

Description

@sroussey

Context

From the 2026-08-05 simplification audit (workglow-dev/prd#77, docs/superpowers/notes/2026-08-05-libs-simplification-audit.md, §1.5–1.6 + Part 5 stage 8). Orthogonal to stages 4–7 — can proceed in parallel any time. Start with --check-only generators so drift becomes visible before anything is rewritten.

Already landed from this area (don't redo): license added to all 38 manifests, @workglow/javascript got a sideEffects allowlist, and util's ./worker types/import mismatch + missing worker-entry type builds were fixed (#686). Verified still outstanding as of 2026-08-06: 15 manifests still lack sideEffects — including packages/ai, which declares sideEffects: false while relying on module-side-effect registration (the exact bundler-drop hazard Part 3 item 11 flags) — and the workglow meta-package drift below.

  • packages/workglow generation: 48 of 52 files are shims (27 provider shims = 9 distinct bodies), plus a 210-line exports map and a 25-entry tsconfig references mirroring dependencies. Generate from one manifest via the existing build.ts, with --check in CI. Fixes real drift found by measuring: 4 phantom browser conditions (anthropic/gemini/hf-inference/hf-transformers browser variants the packages don't ship), 3 browser-capable providers unexposed, 9 published packages unreachable through the meta-package (including indexeddb and supabase).
  • Per-package scripts blocks: ~450 of 565 lines mechanically derivable from each package's exports map (14 of 38 packages byte-identical).
  • tsconfigs: 25 of 38 byte-identical after normalization → shared tsconfig.base-package.json; generate references from deps. (The one real bug — packages/test missing 6 provider references — is in Test infrastructure: 21 CI-invisible test files, conformance-suite gaps, test tsconfig refs (audit §1.6 + Part 3 item 14) #701; coordinate.)
  • Package metadata: one sync-package-meta.ts with --checksideEffects for the 15 missing manifests (fixing the packages/ai false hazard specifically), plus the identical bugs/homepage/type fields.
  • Entry-point convention: only util genuinely needs the 3-way browser/node/bun split; ai and workglow have all three entries identical (collapse to one); six packages are really 2-way; five providers carry 10 shim files whose entire diff is ./ai/index vs ./ai/index.browser — point the exports condition at the file directly (−16 files).
  • Doc drift: libs CLAUDE.md lists dataset/debug packages that no longer exist, omits four that do, and documents root scripts (watch, test:bun, test:vitest) that don't exist; docs/technical/19-build-system.md quotes a turbo.json that doesn't match the real one. Generate the dependency-graph block from the workspace graph. (Also: CLAUDE.md's execution-model section still says ABORTED where ABORTING is the actual state — Fix concurrency and event emission across storage and task systems #686 fixed EXECUTION_MODEL.md but not CLAUDE.md.)
  • CI YAML (§1.6): six bun jobs commented out while their 8 root scripts remain (16 of 40 root scripts are runner-token mirror pairs → one --runner flag); the same 5-step setup block repeats 15×; six live vitest jobs differ only in the run line → composite action + matrix (484 → ~150 lines).

Refs: prd#77 (audit), #686 (partial metadata fixes), #701 (test-infra sibling), #696/#699/#700/#702/#703.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions