refactor(cli): read the production origin from one constant - #150
Open
A1igator wants to merge 1 commit into
Open
refactor(cli): read the production origin from one constant#150A1igator wants to merge 1 commit into
A1igator wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
The shipped baseUrl default, the generated WebSearch hook's fallback, the User-Agent comment, the pinned fund origin, the config-set URL hint, the install hook copy, and the hosted-skill replacement warning each carried their own copy of https://tenjin.blog. They now import PRODUCTION_ORIGIN (and its derived PRODUCTION_HOST) from src/lib/production-origin.ts, so the tenjin.sh cutover is one edit plus a release. No behavior change: every emitted string is byte-identical, both generated hook scripts hash the same (HOOK_SCRIPT_VERSION does not move), and fund keeps its hardcoded origin with no override surface. production-origin.test.ts is the anti-half-flip guard: it pins each module to the constant and fails on any non-comment line under src/ that spells the host out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pe6pvZ9qzb26EW2a88e1Sp
A1igator
force-pushed
the
A1igator/centralize-production-origin
branch
from
August 21, 2026 04:17
c4f439f to
3d3f86a
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Scope
Every production
tenjin.blogreference in the CLI now readsPRODUCTION_ORIGINfromsrc/lib/production-origin.ts, so the tenjin.sh cutover (BackTrackCo/tenjin#402) is one edit plus a release instead of a sweep that can half-apply. Risk is a silent copy change, which the byte-identical proof below rules out.src/lib/production-origin.tsexportsPRODUCTION_ORIGINand a derivedPRODUCTION_HOST; seven call sites import it: thebaseUrldefault (src/lib/config.ts), the generated WebSearch hook fallback (src/lib/hook-scripts.ts), theUser-Agentcomment (src/lib/client-meta.ts), the pinned fund origin (src/commands/fund.ts), theconfig setURL hint (src/commands/config.ts), the install hook copy (src/commands/install.ts), and the hosted-skill replacement warning (src/lib/skill-writer.ts).src/lib/production-origin.test.tsis the anti-half-flip guard: it pins the config default, the UA comment, the emitted hook-script fallback, and the install copy to the constant, then fails on any non-comment line undersrc/that spells the host out.fundkeeps its hardcoded origin with no override surface (owner decision, this repo's feat(fund): let TENJIN_FUND_ORIGIN move the fund origin #146 stays closed), dual-serve is untouched, andHOOK_SCRIPT_VERSIONdoes not move because the generated scripts hash identically.Deliberately out of scope, because none of it is CLI runtime output: the vendored
skills/tenjin/SKILL.mdmirror (synced byte-for-byte from the live site byskill-drift.yml), repo-owned skill and README/docs prose,contract-drift.yml'sTENJIN_CONTRACT_BASE_URLdefault and the dep-freescripts/*.mjs|sh(neither can import a TS constant), evals, historical changelogs, code comments, and test URLs that use the host as sample data.One implementation note for review: in
hook-scripts.tsthe origin is interpolated as'${PRODUCTION_ORIGIN}'rather than throughJSON.stringify(the style used forDATA_DIR), because the generated script's existing bytes use single quotes and any change there rewrites every installed hook.Testing
pnpm format:check,pnpm lint,pnpm typecheck,pnpm build: pass.pnpm test(full suite, 1854 passed / 10 skipped): pass. Two unrelated wallet-passphrase tests time out under a saturated parallel runner on my machine, on this branch and on unmodifiedmainalike; green at--maxWorkers=3.bash scripts/pack-smoke.shwithCI=true: PASS.websearchHookScript()andstopHookScript()output plusTENJIN_USER_AGENTandCONFIG_DEFAULTS.baseUrlbefore and after the change; all four identical.Definition of Done
patch).