# Behavior traces — remix-run/remix

> Canonical page: https://codevetter.com/unpack/remix/behavior-traces

# Behavior traces — remix-run/remix

Scanned commit 27bd7a4401594ec1acbe30ee3937518832270a30 (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The investigation followed three concrete flows across implementation boundaries: scaffolding, template startup/rendering/hydration, and external login with persistence. Additional traces explain frame reloads and asset inspection. These are ordered source walkthroughs, not observed executions. Failure branches are included where they materially change the result.
- Scaffold entry: cli-entry.ts → runRemix → extractGlobalOptions → resolveCliContext → runCommand('new') → dynamically imported runNewCommand → parseNewCommandArgs → bootstrapProject. — [packages/remix/src/cli-entry.ts#L5-9](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/remix/src/cli-entry.ts#L5-L9) [packages/cli/src/lib/cli.ts#L43-67](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/cli.ts#L43-L67) [packages/cli/src/lib/cli.ts#L96-99](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/cli.ts#L96-L99) [packages/cli/src/lib/commands/new.ts#L35-48](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/commands/new.ts#L35-L48)
- Scaffold writes: bootstrapProject → ensureTargetDirectory → resolveTemplateDirectory → copyTemplateDirectory → replaceTemplateValues → writeScaffoldPackageJson; a nonempty target fails unless force is enabled. — [packages/cli/src/lib/bootstrap-project.ts#L66-78](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/bootstrap-project.ts#L66-L78) [packages/cli/src/lib/bootstrap-project.ts#L165-183](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/bootstrap-project.ts#L165-L183) [packages/cli/src/lib/bootstrap-project.ts#L186-221](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/bootstrap-project.ts#L186-L221)
- Template startup: the start/dev command loads remix/node-tsx and server.ts; router module initialization creates static/render middleware and maps the controller; server.ts creates the HTTP listener and calls listen(port). — [template/package.json#L5-10](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/template/package.json#L5-L10) [template/app/router.ts#L9-22](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/template/app/router.ts#L9-L22) [template/server.ts#L4-19](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/template/server.ts#L4-L19)
- Home request: createRequestListener → createRequest → router.fetch → createRequestContext → dispatchRouter → dispatchMatches → dispatchMatch → controller.home → context.render. — [packages/node-fetch-server/src/lib/request-listener.ts#L128-144](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/node-fetch-server/src/lib/request-listener.ts#L128-L144) [packages/fetch-router/src/lib/router.ts#L372-408](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/fetch-router/src/lib/router.ts#L372-L408) [packages/fetch-router/src/lib/router.ts#L431-443](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/fetch-router/src/lib/router.ts#L431-L443) [template/app/actions/controller.tsx#L12-14](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/template/app/actions/controller.tsx#L12-L14)
- HTML output: renderWith installs context.render; the render function calls renderToStream with frame/client-entry resolvers and the request signal, then wraps the stream using createHtmlResponse. — [packages/render-middleware/src/lib/render.ts#L36-41](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/render-middleware/src/lib/render.ts#L36-L41) [packages/render-middleware/src/lib/render-ui.ts#L73-90](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/render-middleware/src/lib/render-ui.ts#L73-L90) [packages/component/src/server/stream.ts#L269-312](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/component/src/server/stream.ts#L269-L312)
- Browser activation: template entry calls run → createStyleManager → createScheduler → createFrame(document) → startNavigationListener → topFrame.ready; hydrated exports are obtained through the entry's importModule loader. — [template/app/actions/public/entry.ts#L8-23](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/template/app/actions/public/entry.ts#L8-L23) [packages/component/src/runtime/run.ts#L140-174](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/component/src/runtime/run.ts#L140-L174)
- OAuth login: GitHub controller.login → startExternalAuth → getSession → createOAuthTransaction → sanitizeReturnTo → provider runtime createAuthorizationURL → session.set('__auth') → redirect response. — [demos/social-auth/app/actions/auth/github/controller.ts#L23-37](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/demos/social-auth/app/actions/auth/github/controller.ts#L23-L37) [packages/auth/src/lib/start-external-auth.ts#L40-49](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/auth/src/lib/start-external-auth.ts#L40-L49) [packages/auth/src/lib/utils.ts#L20-35](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/auth/src/lib/utils.ts#L20-L35)
- OAuth callback persistence: controller.callback → finishExternalAuth → provider runtime handleCallback → resolveExternalAuth(db,result) → completeAuth → session.regenerateId(true) → session.set('auth') → redirect; enclosing session middleware subsequently saves the session. — [demos/social-auth/app/actions/auth/github/controller.ts#L41-60](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/demos/social-auth/app/actions/auth/github/controller.ts#L41-L60) [packages/auth/src/lib/finish-external-auth.ts#L62-76](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/auth/src/lib/finish-external-auth.ts#L62-L76) [packages/auth/src/lib/complete-auth.ts#L12-17](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/auth/src/lib/complete-auth.ts#L12-L17) [packages/session-middleware/src/lib/session.ts#L46-71](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/session-middleware/src/lib/session.ts#L46-L71)
- OAuth failure: finishExternalAuth rejects callback errors, missing/wrong-provider transactions, or invalid state and clears transaction data on failure; the demo controller catches errors, flashes a message, and redirects home. — [packages/auth/src/lib/finish-external-auth.ts#L52-83](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/auth/src/lib/finish-external-auth.ts#L52-L83) [demos/social-auth/app/actions/auth/github/controller.ts#L61-64](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/demos/social-auth/app/actions/auth/github/controller.ts#L61-L64)
- Browser frame reload: defaultResolveFrame creates HTML/frame headers, encodes submitted form data, calls fetch with mode='same-origin' and an abort signal, and rejects 5xx or non-HTML error/redirect responses. — [packages/component/src/runtime/run.ts#L84-98](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/component/src/runtime/run.ts#L84-L98) [packages/component/src/runtime/run.ts#L114-131](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/component/src/runtime/run.ts#L114-L131) [packages/component/src/test/frame.test.tsx#L232-255](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/component/src/test/frame.test.tsx#L232-L255)
- Server nested frame: resolveFrame resolves src against the current frame URL, prepares headers, follows redirects through context.router.fetch, requires HTML, and pipes the returned stream with the outer request's abort signal. — [packages/render-middleware/src/lib/render-ui.ts#L100-119](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/render-middleware/src/lib/render-ui.ts#L100-L119) [packages/render-middleware/src/lib/render-ui.ts#L154-183](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/render-middleware/src/lib/render-ui.ts#L154-L183)
- Asset inspection: runAssetsCommand parses arguments → context.loadConfig → createAssetServer(watch:false) → getAssets or getAssetDetails → formatted stdout; finally it closes the asset server. — [packages/cli/src/lib/commands/assets.ts#L23-40](https://github.com/remix-run/remix/blob/27bd7a4401594ec1acbe30ee3937518832270a30/packages/cli/src/lib/commands/assets.ts#L23-L40)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
