Run the documented reconciliation CLI under the pinned Node runtime - #207
Merged
Conversation
Preload source alias resolution and transform TypeScript syntax. Validate CLI arguments before constructing database dependencies and smoke-test the documented pnpm commands. Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Nitjsefnie
force-pushed
the
fix/12-reconcile-cli-runtime
branch
from
September 7, 2026 06:46
4b278de to
0bab91c
Compare
Nitjsefnie
marked this pull request as ready for review
September 7, 2026 06:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm reconciledied during module loading under the repository's pinned Node 24.17.0, so the documented manual reconciliation route did not run at all. This makes both documented invocations start and run under that runtime, using the documented syntax.Related Issues and Pull Requests
Fixes #12
Issue 191 reported the same failure with a fuller reproduction and was closed into issue 12 as a duplicate before this branch started.
Changes
package.json: thereconcilescript now runs Node with--experimental-transform-typesand preloads an alias-resolution hook.db:migrateand therelease:*scripts are untouched.scripts/register-path-aliases.ts(new): a synchronousregisterHooksresolver mapping@/…onto the source tree, trying.ts,.tsxand/index.ts, then delegating to Node's normal resolution. The source root comes from the hook's ownimport.meta.url, never from the working directory, and a genuinely missing module still fails withERR_MODULE_NOT_FOUNDrather than being swallowed.scripts/reconcile.ts: the argument shape is parsed before production dependencies are constructed, so an argument error is reported instead of being masked by the database-configuration error. Both exported overloads, the injectableReconcileCliDependenciesseam and the usage message are unchanged.README.md: removes the spurious--from the selected-repository example.tests/deploy/reconcile-cli.test.ts(new): extracts thepnpm reconcilecommands from the README's Reconciliation block and runs each as a real child process, covering module loading, argument parsing, the accepted repository-name shape, and a successful run against PostgreSQL.tests/deploy/register-path-aliases.test.ts(new): pins the hook's working-directory independence, its delegation to default resolution, and its missing-module behaviour.Three defects sat behind one symptom. Node's strip-only TypeScript mode cannot compile parameter properties (
ERR_UNSUPPORTED_TYPESCRIPT_SYNTAXfromsrc/lib/fold/postgres-store.ts), and once those are transformed it cannot resolve the 26@/…alias imports across the 21 files reachable from the entry point (ERR_MODULE_NOT_FOUND: Cannot find package '@/lib'), becausecompilerOptions.pathsis honoured only by the bundler and vitest. Separately, pnpm 10.33.0 forwards a literal--, so the documentedpnpm reconcile -- --repository <owner>/<name>produced a three-element argv that the CLI's strict two-element shape rejects.The repair is at the runtime rather than in the source graph by design. Rewriting the three files that use parameter properties would fix this entry point and break again on the next parameter property anyone adds, and two of those files belong to concurrent work.
Testing
Full gate run bare on the rebased head:
pnpm db:migrate && pnpm test --run && pnpm lint && pnpm typecheck && pnpm build, with every Docker-backed suite running rather than skipping.Beyond the gate, the regression suite was verified by mutation rather than by passing. Seventeen mutations that reintroduce a real defect were each planted in the real modules and confirmed to turn the suite red — restoring the old package script, removing either Node flag, removing the transform flag while supplying it from
NODE_OPTIONS, from anXDG_CONFIG_HOMEpnpmrcfile, or from a global pnpmfile lifecycle shell, rooting the alias hook atprocess.cwd(), constructing dependencies before parsing, passing a wrong repository id to the production callback, replacing that callback with fabricated skip summaries, narrowing the accepted repository-name characters, both README command-duplication mutants, rewrapping the documented command without a continuation, renaming the README heading, joining a#word onto the repository argument through a continuation, and making the CLI silently write nothing. Five valid documentation edits were confirmed not to break it: quoting the placeholder either way, wrapping with a backslash continuation, naming a seeded repository, and appending a trailing shell comment.The successful-run coverage uses a real PostgreSQL container and no network: repositories on cooldown produce skip summaries and no
reconciliation_runsrows, while a repository whose cooldown has expired under a sponsor with no OAuth token makes the CLI exit 1 and persist aFAILEDrow — which is what distinguishes real reconciliation from a callback that only prints plausible summaries.Follow-ups / Known Limitations
nodeshim earlier onPATH, since the child must be able to find Node at all.reconcilescript, not shared withdb:migrateor therelease:*scripts. Sharing it is one line each, and would close the whole class the day someone adds an@/…import toscripts/release.ts— where the failure would land mid-deploy. It is deliberately not done here: that line also carries--experimental-transform-typesinto the deploy path, making a release switch depend on an experimental Node flag, andscripts/release.tsimports onlynode:builtins today. The next person to add an aliased import to a Node-run entry point should revisit this rather than rediscover it.reconcilescript now prints Node'sExperimentalWarning: Transform Typeson stderr. Nothing here is warning-free output.Footer
Generated by GPT-6 Astra (implementation, testing, review), Claude Opus 5 (brief, review, integration)