Files
deepseek-harness/.agents/notes/proposed/process/2026-07-26-pnpm-action-setup-for-symmetric-ci-caching.md
Tianyi Cui 3a88912a22 docs: adopt dependencies-over-hand-rolling policy from NIH audit
A repo-wide Not Invented Here audit (ten parallel domain surveys covering
every package group, scripts/, native/, vendor/ edges, python/, test
infrastructure, and CI) asked of each hand-rolled surface whether a
maintained external package or Node builtin deletes it with a net win.

Policy: new implemented process note records that a dependency which
genuinely deletes owned code is a preferred simplification (bar: net
deletion, health, boundary fit, settled seams stay); root AGENTS.md
carries the one-line rule and dsh-find-simplifications now surveys for
hand-rolled-where-a-dependency-exists candidates.

Findings, all bilingual from birth:
- proposed/simplification: eventsource-parser for llm-deepseek SSE,
  node:timers/promises for three hand-rolled sleeps, turndown (or
  minimal 'entities') for tool-web HTML->markdown, gate-script
  consolidation onto mdast/parseArgs/globSync
- proposed/testing: execa + parseArgs + loadEnvFile + vi.waitFor for
  hand-rolled test subprocess plumbing
- proposed/process: pnpm/action-setup for symmetric CI caching
- proposed/feature: evaluate landstrip before building a Windows
  sandbox launcher
- rejected/simplification: ~30 swap verdicts recorded (vscode-jsonrpc,
  p-retry, Ajv, write-file-atomic, msw, hono, better-sqlite3, wireit,
  landstrip-for-linux, YAML consolidation, ...) so the survey is not
  re-litigated from scratch

Also drops the stale prompt/ entry from the AGENTS.md layout map
(workspace instructions live in packages/context/workspace-context).
2026-07-26 15:54:36 +08:00

2.0 KiB
Raw Blame History

Agent Note: Use pnpm/action-setup for symmetric CI pnpm caching

Status: proposed

English | 中文

Problem

Five workflows repeat a hand-rolled three-step pnpm setup — corepack enable, pnpm store path --silent >> $GITHUB_OUTPUT, then actions/cache@v4 keyed on pnpm-lock.yaml: e2e.yml, docs-pages.yml, pi-ai-provider-e2e.yml, build-exe-for-python-sdk.yml, and the node-compat, serial-linux, and benchmark jobs of ci.yml (~40–60 YAML lines total). The maintained equivalent — pnpm/action-setup@v4 (reads packageManager from package.json) plus actions/setup-node with cache: pnpm — is already proven in-repo in landlock-run.yml, and also insulates against corepack's removal from newer Node distributions.

Proposal

Convert the symmetric-cache workflows to pnpm/action-setup@v4 + setup-node cache: pnpm. Explicitly do NOT convert:

  • the three enterprise-runner PR jobs in ci.yml — they deliberately use actions/cache/restore only, keeping cache compression/upload off the paid latency-critical path, an asymmetry setup-node's cache cannot express;
  • the Windows job, which deliberately skips the store cache.

Alternatives considered

  • Keep the hand-rolled steps. They work, but they are five drifting copies of setup boilerplate, and the corepack dependency is a known future break.
  • Convert everything including the enterprise jobs. Rejected: the restore-only asymmetry is a documented latency decision in ci.yml's comments; erasing it to unify tooling inverts the priority.

Acceptance criteria

  • The five symmetric workflows set up pnpm via the actions; one cold run per lane repopulates the new cache-key format, after which cache hit rates match the old steps.
  • The enterprise-runner PR jobs and the Windows job are untouched.

Risks

  • Cache-key format changes once (one cold run per lane).
  • A third-party action in more workflows; it is already trusted in-repo (landlock-run.yml) and is the pnpm team's official action.