Skip to content

refactor: share the publish flow, installer plumbing and schema parse helpers - #167

Merged
PerfectPan merged 1 commit into
mainfrom
refactor/dedupe-gate-debt
Nov 16, 2026
Merged

PerfectPan merged 1 commit into
mainfrom
refactor/dedupe-gate-debt

Conversation

@PerfectPan

@PerfectPan PerfectPan commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #166 — everything #165 staged behind business excludes is now shared code, so the duplicates gate runs without any of them (only the standing **/*.test.ts convention remains).

Summary

  • **/cli/commands/*.ts removed: flush / reset / update share one publish flow (src/cli/commands/publish-run.ts: setupPublishCommand, settleQueue, runPublishCommand, runRenderedPublish); each command keeps only its own delta.
  • **/install-*.ts, **/uninstall-*.ts removed: the dsh pair shares scripts/lib/cli.ts (runScriptMain, reportDshPatchOutcome); the power-watch pair shares scripts/lib/power-watch.ts (labels, launchctl, currentUid, powerWatchPaths).
  • **/config-schema.ts removed: configField, parseOrDrop and entriesThatParse report every drop through one parseOrReport helper.
  • **/hooks/*.ts removed: the project picker both hook contexts need is pickProject in hooks/context.ts.
  • knip ignoreBinaries: ['mkfifo'] removed: test/queue-worker-recovery.test.ts no longer shells out to mkfifo. The FIFO rendezvous is replaced by an optional requestDelayMs on the watchdog thread's workerData (a sync Atomics.wait sleep, the same injection style as the repo's clock/delay seams); the child writes the request before the first stale tick and flips the heartbeat inside the simulated I/O window, so both invalidation cases keep their determinism without an external binary.

Validation

  • pnpm lint, pnpm typecheck, pnpm format:check clean.
  • pnpm test 1046 passed; test/queue-worker-recovery.test.ts run 4× for determinism.
  • pnpm knip and pnpm knip:production clean without the ignore.
  • pnpm duplicates 0 clones with every business exclude gone.
  • duplicates:audit candidates 62 → 50; the remainder is the audit-only worklist the issue already tracks.

… helpers

Everything #165 staged behind business excludes is now shared code, so the
duplicates gate runs without them:

- flush/reset/update share one publish flow (publish-run.ts: setup, queue
  settle, takeover+print, and the rendered sync with per-command deltas)
- install/uninstall script mirrors share scripts/lib/cli.ts (exit handler,
  dsh patch report) and scripts/lib/power-watch.ts (labels, launchctl, uid,
  env-overridable paths)
- config-schema reports every dropped value through one parseOrReport helper
- both coding-agent hooks resolve the project through pickProject

knip loses ignoreBinaries: ['mkfifo']: the recovery test's FIFO rendezvous
is replaced by an optional requestDelayMs on the watchdog thread (sync
Atomics sleep, the same injection style as the clock/delay seams), so the
invalidation test keeps its determinism without shelling out.
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agent-presence Ready Ready Preview Nov 15, 2026 2:05pm UTC

@PerfectPan
PerfectPan merged commit ce6ecb9 into main Nov 16, 2026
10 of 11 checks passed
@PerfectPan
PerfectPan deleted the refactor/dedupe-gate-debt branch November 16, 2026 08:34

This branch was successfully deployed

1 active deployment
Preview — 09b2aa10 Deployed Nov 15, 2026 by vercel[bot]
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.

[Task]: lint-config v0.8.0 adoption: exclusion worklist and staged rules

1 participant