Skip to content

Move dev installs to a root hoisted pnpm workspace#368

Merged
schickling merged 133 commits intomainfrom
schickling/2026-03-08-pnpm-gvs-boundary-spec
Mar 14, 2026
Merged

Move dev installs to a root hoisted pnpm workspace#368
schickling merged 133 commits intomainfrom
schickling/2026-03-08-pnpm-gvs-boundary-spec

Conversation

@schickling-assistant
Copy link
Contributor

@schickling-assistant schickling-assistant commented Mar 8, 2026

Why

The existing per-package pnpm install model did not match how installs actually
mutate the repo, which is the root problem behind the #331 class of issues.

This change makes the dev workspace explicit and repo-root owned:

  • one generated root pnpm workspace
  • one root hoisted install state for dev
  • package-level pnpm-workspace.yaml files kept only as package-closure
    metadata for lockfile/build use

It also documents the resulting topology and lockfile rules in the
node-modules install spec.

What

  • add generated root package.json and pnpm-workspace.yaml
  • generate the root workspace member list from Genie
  • switch shared pnpm tasks to a repo-root hoisted install model
  • refresh package-closure lockfiles in lockfile-only mode
  • update package-scoped tool execution to use pnpm exec
  • update the node-modules install spec and requirements to match the validated
    model

How

The new model works like this:

  • pnpm:install owns the repo-root dev install state
  • package-level installs are no longer dev install owners
  • package-level lockfiles are refreshed with pnpm install --lockfile-only
  • package-scoped tasks run from the package cwd through pnpm exec so Vitest,
    Storybook, and Vite resolve against the active workspace topology
  • package-level pnpm-workspace.yaml files remain available for package-closure
    Nix/build workflows

Validation

  • CI=1 dt pnpm:install --no-tui
  • CI=1 dt check:quick --no-tui
  • CI=1 OTEL_MODE=off dt test:run --no-tui
  • focused regression check: pnpm exec vitest fixes the package-scoped test
    execution regression under the hoisted root workspace

Refs: #353

Footnote: acting on behalf of the user.

@schickling schickling force-pushed the schickling/2026-03-08-pnpm-gvs-boundary-spec branch from bc7571d to 580764c Compare March 8, 2026 16:40
@schickling-assistant schickling-assistant changed the title Spec pnpm repo-boundary GVS install model Move dev installs to a root hoisted pnpm workspace Mar 8, 2026
@schickling
Copy link
Collaborator

@codex

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a836a01ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@schickling schickling marked this pull request as ready for review March 9, 2026 19:50
@github-actions github-actions bot requested a review from schickling March 9, 2026 19:50
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f41f0daecb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34648490fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3834ce4d84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8abb21d7bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62826dc06c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e1d2d0410

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

10 similar comments
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be7fd881a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd4c655ef5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a7b1d5bac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6632ab1c54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schickling and others added 6 commits March 14, 2026 14:50
…pertyTypes

The named-args refactoring exposed exactOptionalPropertyTypes issues
where null/undefined were passed as optional property values. Fix by
explicitly allowing null|undefined in the updates type and using
null-coalescing checks in the implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…abels, quality fixes

- Auto-detect nested megarepos by scanning for megarepo.json (Phase 4)
- Add PreflightFailed state with issue list, mr store fix hint, --no-strict escape hatch
- Add preflight stories (apply/lock failures, errors-only, single issue)
- Add LockRequired and WithLockSync stories for mr apply
- Add DepsOutput error stories
- Mode-aware status labels: "fetched"/"already up to date" in fetch mode
- Rename NixFlakeUrl scheme → _tag discriminant (project conventions)
- Change updateNixFlakeUrl null → undefined removal sentinel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add flexDirection="column" to outer Box (fixes verbose tree not rendering)
- Add ref/rev type labels to LockFileUpdateLine
- Include sharedSourceUpdates targetCount in member count
- Update summary wording to "Nix lock sync: N updates across M members"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…params, named-args, format)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: paddingTop={1} on LockSyncSection Box caused yoga height=1,
and renderTreeSimple clips content at yoga-computed height. Text nodes
have zero height in yoga, so the box only had room for 1 line (padding).
Fix: replace paddingTop with explicit <Text> </Text> empty line.

Also adds missing storybook controls:
- --all toggle on lock/Results and apply/Results stories
- --dryRun toggle on StoreOutput/Fetch stories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86eee3b0f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schickling and others added 2 commits March 14, 2026 15:19
…se, --porcelain

Adds missing storybook controls across all renderers:
- --force on all SyncOutput stories (fetch/apply/lock)
- --verbose on Fetch/Issues stories
- --porcelain on StoreOutput/WorktreeNew stories
- --no-strict skipped (requires renderer schema changes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
validateStoreMembers previously only skipped ref_mismatch checks for
40-char commit SHAs, causing false positives for tag refs (e.g. v1.0.0)
in detached HEAD worktrees. Now uses classifyRef to correctly skip both
tags and commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64ee1ef4aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schickling and others added 6 commits March 14, 2026 15:47
… handling

- Update megarepo.nix task definitions to new command model (mr fetch/apply/lock)
- Update ci-workflow.ts to use mr fetch --apply and mr apply
- Fix apply mode to use locked commit instead of bare repo branch tip
- For newly created branch worktrees in apply mode, fast-forward to locked commit
- Share visited set in applyAfterFetch nested fetch calls (dedup fix)
- Skip local path members in lock mode (nothing to record)
- Fix storybook atom state reset when controls change
- Fix Results.stories.tsx force control dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace old command references across 8 documentation files:
- mr sync → mr fetch --apply
- mr lock sync → mr lock
- mr lock update → mr fetch --apply
- mr lock apply → mr apply

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Revert "skip local path members in lock mode" — lock mode needs to
  record their current commit for reproducibility
- Revert sharing visited set in applyAfterFetch nested fetch — the fetch
  marks megarepos as visited, causing the subsequent apply to skip them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each command gets its own file mirroring the three-command model.
Fix missing execCommand re-export in commands/mod.ts that caused CLI crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update run.sh test harness, stories, and context docs to use
mr fetch --apply instead of mr sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fef689c256

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schickling and others added 3 commits March 14, 2026 16:33
Rename megarepo devenv tasks (lock:sync→lock, lock:update→fetch-apply,
lock:apply→apply) and add broken worktree detection in store commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 461ecdcd03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@schickling schickling enabled auto-merge (squash) March 14, 2026 15:48
@schickling schickling disabled auto-merge March 14, 2026 15:49
The catchAll in --all recursion now surfaces the error as an 'error'
member result so collectSyncErrors reports it to the user.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15e9300ad3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

/** If no worktrees found and this isn't the refType root, it's a broken worktree */
if (result.length === 0 && currentPath !== refTypePath) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark missing-.git worktree as broken before recursing

In mr store status / mr store gc, this traversal only reports currentPath as broken when no nested directory yields results, so a broken worktree directory that still contains normal project subfolders (for example src/, test/) is not reported at its actual ref root. Instead, deeper paths are treated as pseudo-worktrees, which can leave the real broken worktree root undeleted and produce misleading refs during status/GC. The broken-worktree decision should happen at the worktree root, not after descending into children.

Useful? React with 👍 / 👎.

Root patchedDependencies entries pointing into workspaceSources paths
(e.g. repos/effect-utils/...) were not found during workspace
materialization because copyPatchedDependencyFilesCmd used the
pre-overlay workspaceRootPath.

Add copyResolvedPatchFilesCmd which parses patch paths from the lockfile
at Nix eval time and resolves each through absoluteSourcePathFor, using
the same source-resolution logic as copyFileCmd/copyDirCmd. This ensures
patch files under workspaceSources prefixes are found in the correct
source root.

Also add chmod before cp in both patch copy functions for idempotency
when root and external install root patches target the same path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@schickling schickling merged commit 2415c5d into main Mar 14, 2026
8 checks passed
@schickling schickling deleted the schickling/2026-03-08-pnpm-gvs-boundary-spec branch March 14, 2026 17:15
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd01c6aa7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -154,9 +154,8 @@ export const addCommand = Cli.Command.make(
sourceString: parsed.sourceString,
megarepoRoot: root.value,
lockFile: undefined,
mode: 'fetch',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use apply flow for mr add --sync

add still defaults --sync to true, but this call now hard-codes syncMember to mode: 'fetch', which intentionally avoids workspace materialization; for local-path members it even returns skipped immediately, and for remote members it only resolves/fetches refs. In practice, mr add can report a synced add while leaving repos/<member> absent, breaking the expected “add and sync immediately” behavior until users run a separate mr apply.

Useful? React with 👍 / 👎.

schickling added a commit to livestorejs/livestore that referenced this pull request Mar 14, 2026
Feature branch was squash-merged as overengineeringstudio/effect-utils#368.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants