Repository navigation
Use the config validators in doctor, and join service directories once - #32
Merged
Merged
Conversation
anurag
force-pushed
the
ag/small-cleanups
branch
from
September 24, 2026 05:07
bf2cfbb to
6a1a674
Compare
- scripts/doctor.ts checked APPS_REPO, FACTORY_API_KEY, UI_USERNAME, and UI_PASSWORD with code of its own, with a third copy of the slug regex. Now it runs appsRepo(), apiKey(), and uiCredentials(), the validators that each process runs when it starts, and prints their errors. So doctor cannot pass a value that the gateway refuses. - config.ts checks UI_USERNAME with the slug schema of contracts.ts. The gateway gives that name to each run of the UI as its user, and the request schema checks the user with the same slug. Before, two copies of the regex had to agree. - verify-app joined the rootDir of a service onto the app directory with resolveServiceDir(), and the Blueprint with joinServiceDir(), with slightly different rules. Now both use joinServiceDir() in blueprint.ts, so they agree on each directory. It also accepts a path that is the full base, which gave a doubled path in verify-app. Tests: tests/blueprint.test.ts tests joinServiceDir() with relative and absolute bases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anurag
force-pushed
the
ag/small-cleanups
branch
from
September 24, 2026 05:07
6a1a674 to
f33cdca
Compare
2 of 3 tasks
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.
Stacked on #31, which is stacked on #30. Merge those first; GitHub then moves this PR to
main.Changes
scripts/doctor.tscheckedAPPS_REPO,FACTORY_API_KEY,UI_USERNAME, andUI_PASSWORDwith code of its own, including a third copy of the slug regex. Now it runsappsRepo(),apiKey(), anduiCredentials(), the validators that each process runs when it starts, and prints their errors. So doctor cannot pass a value that the gateway refuses.config.tschecksUI_USERNAMEwith theslugschema ofcontracts.ts. The gateway gives that name to each run of the UI as itsuser, and the request schema checksuserwith the same slug. Before, two copies of the regex had to agree.verify-appjoined therootDirof a service onto the app directory withresolveServiceDir(), and the Blueprint withjoinServiceDir(), with slightly different rules. Now both usejoinServiceDir()inblueprint.ts, so they agree on each directory. It also accepts a path that is the full base, which gave a doubled path inverify-app.Not changed
sleep(). I proposedsetTimeoutfromnode:timers/promises, but vitest's fake timers do not control it: a probe test timed out. The render, teardown, and workflow tests skip their poll intervals with fake timers, so they would really wait. The copies stay.Verification
npm run checkpasses: 372 tests.tests/blueprint.test.tstestsjoinServiceDir()with relative and absolute bases.UI_USERNAME, and with good values, prints the error of each validator, or its OK message.🤖 Generated with Claude Code