Skip to content

Install gate, Phase 3 (lane 1): uv gate + yarn/pnpm named-only wrappers#113

Open
juangaitanv wants to merge 3 commits into
install-gate-phase-2from
install-gate-phase-3-uv
Open

Install gate, Phase 3 (lane 1): uv gate + yarn/pnpm named-only wrappers#113
juangaitanv wants to merge 3 commits into
install-gate-phase-2from
install-gate-phase-3-uv

Conversation

@juangaitanv

Copy link
Copy Markdown
Contributor

Phase 3, lane 1 of the install-gate restart

Stacked on #112 (Phase 2). Base: install-gate-phase-2. The PRD splits Phase 3 into three independent lanes, each its own PR — this is lane 1 (breadth). Still public-mode only, no --json.

Scope (per the PRD)

  • uvuv pip install / uv add / uv pip sync gate through uv pip compile (--only-binary :all:, temp .in file) so the full resolved set is verdicted. uv sync is gated from the nearest-ancestor uv.lock (local/editable stanzas skipped; unparsable lock refuses; --force escape). uv lock and everything else passes through; top-level uv install gets a did-you-mean.
  • yarn / pnpm — named targets verified (with the loud named-only warning — no safe dry-run); bare installs exec unchecked behind an honest stderr note; bare yarn routes through yarn install.
  • Wrong-package-manager guard — npm/yarn/pnpm cross-checked against lockfiles + the packageManager field (ambiguous indicators stand down; fresh projects don't inherit ancestor lockfiles); pip↔uv cross-checked against uv.lock / requirements files. Suggestions name the corgea-wrapped command; --force bypasses.

Out of scope: --json (lane 2), auth/fail-closed (lane 3).

Exit criteria — met

uv install paths gate via uv pip compile; uv sync from uv.lock; yarn/pnpm named-only with honest ungated notes.

Covered by tests/cli_uv_sync.rs and extensions to the tree/bare-install suites; confirmed live (corgea uv pip install mezzanine==6.0.0 resolves a 24-package tree via real uv pip compile and blocks; corgea pnpm add in an npm project refuses with a suggestion). ./harness check green.

🤖 Generated with Claude Code

Comment thread src/precheck/parse.rs
Comment thread src/precheck/uv.rs
Comment thread src/precheck/tree.rs
Comment thread src/precheck/uv.rs Outdated
Comment thread src/precheck/detect.rs
@juangaitanv juangaitanv force-pushed the install-gate-phase-2 branch from 936d69a to dd4b575 Compare June 12, 2026 14:51
juangaitanv added a commit that referenced this pull request Jun 12, 2026
… guard

Addresses Cursor review on #113.

- uv commands are now classified after skipping leading global flags, so
  `uv --project ./app sync` / `uv --quiet add x` are gated instead of
  falling through to ungated passthrough.
- the custom-index warning (from Phase 1) now fires for uv install/add/sync
  too, listing uv's index flags (--index, --default-index, --find-links, …).
- the pip↔uv wrong-manager guard is applied consistently: it stays on
  `uv add` (project management, writes pyproject) but NOT `uv pip install` /
  `uv pip sync` — those are uv's pip-compatible interface, correct to use in
  a requirements project, and already fully gated by the tree pass. (Partial
  decline of the review's ask, with the reasoning above.)
- parse_uv_lock now verdicts ONLY registry-sourced packages: git/url direct
  artifacts are skipped (their name@version is not a PyPI identity), and a
  registry package missing a version fails closed instead of being silently
  dropped.
- the Node wrong-manager guard walks past a workspace MEMBER's leaf
  package.json to the workspace root (root `workspaces` field or
  pnpm-workspace.yaml), so a member install is checked against the root's
  manager. Standalone fresh projects still stop at their own leaf.
@juangaitanv juangaitanv force-pushed the install-gate-phase-3-uv branch from c39ab0f to d9af832 Compare June 12, 2026 14:51
@juangaitanv juangaitanv force-pushed the install-gate-phase-2 branch from dd4b575 to c86aa2d Compare June 12, 2026 16:42
juangaitanv added a commit that referenced this pull request Jun 12, 2026
… guard

Addresses Cursor review on #113.

- uv commands are now classified after skipping leading global flags, so
  `uv --project ./app sync` / `uv --quiet add x` are gated instead of
  falling through to ungated passthrough.
- the custom-index warning (from Phase 1) now fires for uv install/add/sync
  too, listing uv's index flags (--index, --default-index, --find-links, …).
- the pip↔uv wrong-manager guard is applied consistently: it stays on
  `uv add` (project management, writes pyproject) but NOT `uv pip install` /
  `uv pip sync` — those are uv's pip-compatible interface, correct to use in
  a requirements project, and already fully gated by the tree pass. (Partial
  decline of the review's ask, with the reasoning above.)
- parse_uv_lock now verdicts ONLY registry-sourced packages: git/url direct
  artifacts are skipped (their name@version is not a PyPI identity), and a
  registry package missing a version fails closed instead of being silently
  dropped.
- the Node wrong-manager guard walks past a workspace MEMBER's leaf
  package.json to the workspace root (root `workspaces` field or
  pnpm-workspace.yaml), so a member install is checked against the root's
  manager. Standalone fresh projects still stop at their own leaf.
@juangaitanv juangaitanv force-pushed the install-gate-phase-3-uv branch from d9af832 to 36350f3 Compare June 12, 2026 16:42
Harvested from the install-vuln-gate spike (dfac68e); still public-mode
only, no --json.

- corgea uv: `uv pip install` / `uv add` / `uv pip sync` gate through
  `uv pip compile` (--only-binary :all:, temp .in file) so the full
  resolved set is verdicted; `uv sync` is gated from the
  nearest-ancestor uv.lock (local/editable stanzas skipped, unparsable
  lock refuses, --force escape); `uv lock` and everything else passes
  through; top-level `uv install` gets a did-you-mean
- corgea yarn|pnpm: named targets verified (with the loud named-only
  warning — no safe dry-run); bare installs exec unchecked behind an
  honest stderr note; bare `yarn` routes through `yarn install`
- wrong-package-manager guard: npm/yarn/pnpm cross-checked against
  lockfiles + the packageManager field (ambiguous indicators stand
  down, fresh projects don't inherit ancestor lockfiles); pip↔uv
  cross-checked against uv.lock / requirements files; all suggestions
  name the corgea-wrapped command; --force bypasses
- SKILL.md updated for the new managers and limitations
… guard

Addresses Cursor review on #113.

- uv commands are now classified after skipping leading global flags, so
  `uv --project ./app sync` / `uv --quiet add x` are gated instead of
  falling through to ungated passthrough.
- the custom-index warning (from Phase 1) now fires for uv install/add/sync
  too, listing uv's index flags (--index, --default-index, --find-links, …).
- the pip↔uv wrong-manager guard is applied consistently: it stays on
  `uv add` (project management, writes pyproject) but NOT `uv pip install` /
  `uv pip sync` — those are uv's pip-compatible interface, correct to use in
  a requirements project, and already fully gated by the tree pass. (Partial
  decline of the review's ask, with the reasoning above.)
- parse_uv_lock now verdicts ONLY registry-sourced packages: git/url direct
  artifacts are skipped (their name@version is not a PyPI identity), and a
  registry package missing a version fails closed instead of being silently
  dropped.
- the Node wrong-manager guard walks past a workspace MEMBER's leaf
  package.json to the workspace root (root `workspaces` field or
  pnpm-workspace.yaml), so a member install is checked against the root's
  manager. Standalone fresh projects still stop at their own leaf.
…flag-skip, ungated disclosures

- SECURITY: valued global flags missing from takes_value made their VALUE
  classify as the subcommand → silent ungated passthrough. Added uv's
  --color/--config-file/--cache-dir/--allow-insecure-host and yarn's
  --cwd ('corgea uv --color always add x' and 'corgea yarn --cwd dir add
  x' installed unchecked). Unit + e2e regression tests with valued flags.
- classify_uv_command skips flags between 'pip' and its verb, so
  'uv pip --quiet install x' gates instead of passing through.
- uv add's --optional/--bounds/--script values no longer parse as specs.
- 'uv run' / 'uv tool install|run|upgrade' print an ungated-install note
  (and SKILL.md lists them as limitations) instead of passing silently;
  same for 'yarn global add'.
- Workspace-member walk now checks dir membership against the declared
  globs (package.json workspaces / pnpm-workspace.yaml packages), so a
  standalone project nested under an unrelated monorepo keeps its leaf
  boundary instead of being wrong-manager-refused.
- uv.lock parsing discloses skipped non-registry pin counts and warns on
  non-default registry sources; run_uv_sync echoes the command correctly
  behind global flags.
@juangaitanv juangaitanv force-pushed the install-gate-phase-2 branch from c86aa2d to 33da96b Compare June 12, 2026 18:28
@juangaitanv juangaitanv force-pushed the install-gate-phase-3-uv branch from 36350f3 to f8426b6 Compare June 12, 2026 18:28
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.

1 participant