Skip to main content
Every project needs a Lifecycle Setup - the scripts, environment variables, and documentation that define how the application installs dependencies, builds, runs, passes a health check, and tests. uses this configuration to validate your setup, run functional tests, and verify milestone output. You don’t fill this in with a form. sets it up with you in chat, inside the Project Knowledge drawer, during the Project Setup stage of onboarding. The agent inspects your repository, proposes the scripts and variables, asks you for anything it can’t infer, and runs the whole lifecycle end to end to prove it works.

When Lifecycle Setup Happens

Project Setup is a stage on the Roadmap onboarding checklist. It runs after you approve the Project Spec and choose a validation level:
  1. Setup Build Environment
  2. Set Modernization Goals
  3. Generate Project Spec
  4. Approve Project Spec
  5. Choose Validation Level
  6. Project Setup ← lifecycle setup happens here
  7. Generate Roadmap
Roadmap onboarding checklist with the Project Setup stage in progress While the stage is running, the checklist shows it as Setting up Project….
Project Setup only runs at the High validation level. At Low and Mid, skips origin lifecycle setup entirely — the origin application is never built or run, so there is nothing to configure. The target lifecycle is still discovered automatically during the foundation milestone.If you start at Low or Mid and later upgrade to High, opens Project Setup at that point and runs the same chat flow.
Clicking Project Setup opens the Project Knowledge drawer with Knowledge chat already started. The drawer also opens on its own the first time the stage becomes active.

Setting Up the Lifecycle in Chat

The first time you land in Project Setup, the drawer is chat only — there is no tree or content pane yet, because there is nothing to show until the agent discovers it. The chat opens on “Welcome! Time to set up the project and get started” and starts working. While the sandbox boots, the chat shows its progress: allocating resources, cloning the repository, installing dependencies, indexing project context. The tree and content pane appear alongside the chat as soon as the agent has something to put in them.

What the agent works through

The agent maintains a visible to-do list and works through it in order. Which items appear depends on your build environment: Once the lifecycle validates, the agent asks a single question: whether you want to set up acceptance criteria. Answer Skip — I’ll do this later and the last three phases are marked skipped and onboarding wraps up there; you can add scripts and criteria from the chat at any point afterwards.
On a self-hosted project that uses the connect strategy, the Dependencies phase is skipped too — isn’t building or running the app, so there is no toolchain to resolve.
For the lifecycle phase specifically, the agent:
  1. Inventories the repository — framework, install/build/run commands, health-check signals, environment variables, external service dependencies — and reports what it found before writing anything.
  2. Proposes the phases and confirms them with you. Beyond the standard five, this can include steps like migrate or per-service splits in multi-service projects.
  3. Registers the scripts and environment variables, asking you for values it can’t infer.
  4. Executes the lifecycle end to end to prove it works. On failure it shows you the failing phase, the last lines of output, and a proposed fix before retrying.
To-do progress chip and list showing the agent working through the setup phases

Answering the agent’s questions

The agent asks structured questions rather than free-text prompts wherever it can. Pick one of the options or write your own, then click Submit. Skip leaves the decision to the agent. Clarify card in Knowledge chat with a recommended option and an Other free-text choice

Providing secrets

When the lifecycle needs a credential — an API key, a database password, a service token — the agent asks for it with a Provide Secret card instead of asking you to type it into the chat. The value is encrypted immediately and is never shown to the agent or written into the transcript. Provide Secret card with a masked value field and show/hide toggle
Never paste a secret into the chat message box. Use the Provide Secret card — anything typed into the chat becomes part of the conversation history.

When setup finishes

Once the lifecycle validates, the chat confirms it and onboarding continues to Generate Roadmap. If the agent can’t get the application fully healthy, it asks you to confirm saving the configuration as a Draft so you can correct it yourself.

The Project Setup Panel

Once the lifecycle exists, the drawer switches to its full layout: a tree on the left, the selected content in the middle, and chat on the right. Project Setup is the branch of the tree that holds everything needs to run your application. Project Setup tree and content panel in the Project Knowledge drawer
Use Hide chat in the toolbar to collapse the chat column and give the content panel the full width — useful when you’re reading a long lifecycle document.
The branch is organized by side of the migration:
  • Origin - How the source application builds and runs. Set up with you during Project Setup and used as the behavioral baseline for functional testing.
  • Target - How the destination application builds and runs. Discovered automatically during the foundation milestone (Milestone 1). The Target entry stays disabled until then, with the tooltip “Available once a target lifecycle configuration has been discovered.”

Scripts

Ordered shell scripts that bring your application to a healthy, running state. Common scripts include: Scripts section with the discovered lifecycle scripts Click a script name to expand it. The expanded view shows:
  • Inline code editor - Edit the script content directly. Scripts are executed as shell commands.
  • Logs - The stdout output from the last validation run, with the exit code and duration.
  • Errors - The stderr output. A bug icon appears on the script header if the last run failed with stderr output.
Expanded script showing the inline editor, log viewer, and action buttons Scripts run in order, and you can drag the handle on a script to reorder it. To add one, click Add Script, enter a name, and press Enter. To remove one, expand it and click Delete.

Environment Variables

Key-value pairs your application needs at build or runtime. Variables discovered from the codebase are pre-populated; you can add, edit, or remove them with Add Variable. Variables marked as secrets are encrypted at rest. Tick the Secret checkbox on a variable to mark it as a secret; once marked, the value is masked and a show/hide eye icon appears so you can reveal it when needed. Environment Variables section with a plain variable and a masked secret

Lifecycle Document

A markdown overview describing how the application is structured, the execution order of scripts, and how each phase fits together. The agent generates it during Project Setup. It is displayed read-only in the panel — ask Knowledge chat to change it. A marker in the section header shows who wrote the configuration last: Auto-discovered when the agent did, User-modified once you save an edit of your own from the panel.

Dockerfile and Dependencies

These artifacts are read-only in the panel too — they carry the hint “Read-only — ask the chat to update this.” To change the container image or the dependency manifest, ask Knowledge chat. Dockerfile section showing the read-only hint

What You Edit Directly vs. What the Chat Owns

Both routes are available, and they write to the same configuration. Only Scripts and Environment Variables are editable in place — everything else is displayed read-only and changed through the chat. Editing in the panel is best for a small, known correction: a wrong port, a typo in a command. Ask the chat when you want the agent to work out the change itself, touch several things at once, or investigate a failure. Typical chat asks:

Validation Status

The status bar at the top of the Project Setup panel shows the current validation state: Status bar showing the Validated state with a last-validated timestamp When the status is anything other than Validated, a banner explains what to do next and offers a Re-validate link. For Draft and Failed, the banner also includes the raw validation output. Draft — Review Required banner with validation output
Saving any change to scripts or environment variables resets the status to Pending — the saved configuration hasn’t been proven to work until you re-validate.
Origin lifecycle status also gates the roadmap: won’t generate a roadmap while the origin lifecycle is Draft, Failed, or Imported.

Editing and Re-validating

After making changes in the panel:
  1. Click Save Changes to persist your edits
  2. Click Re-validate to run the full validation sequence again
Both buttons sit in the drawer toolbar. Re-validate saves any unsaved changes first, then hands the run to Knowledge chat — the agent re-runs the lifecycle end to end, reports what it finds, and writes the result back. You can watch it happen in the chat panel. Re-validate and Save Changes buttons in the Project Knowledge toolbar
If you only need to fix a small script error, edit the script inline and click Re-validate - it handles saving for you.
Re-validate is disabled while the chat is streaming, with the tooltip “Wait for the chat to finish before re-validating.” Asking the chat directly works too:

Authentication Handling

When sets up or validates your lifecycle, it probes API routes beyond the health endpoint to check whether the application has authentication that could affect automated testing.

What Morph handles automatically

can detect and handle two types of authentication without manual intervention:
  • Disable flags — Many frameworks offer an environment variable or config setting that disables authentication in development or test mode (for example DISABLE_AUTH=true, AUTH_ENABLED=false, or framework-specific flags like EnableTesting). When finds one, it registers the variable, restarts the application, and verifies that protected endpoints are now accessible.
  • Static tokens — If the application uses a fixed API key or Bearer token (e.g. an X-API-Key header), asks you for the token with a Provide Secret card, stores it encrypted, and adds a verification script that confirms the token works.
In both cases, adds an authcheck lifecycle script that hits a protected endpoint with the configured auth method and fails if authentication is not working. This script runs alongside your other lifecycle scripts during every validation.

What requires your attention

  • Session-based login (username/password) — Applications that require a POST /login call to obtain a session cookie or Bearer token. reports this as detected but unsupported for automated bypass.
  • OAuth / SSO / MFA — External identity provider flows that involve browser redirects, third-party consent screens, or multi-factor challenges. These cannot be automated.
When detects these types, it documents the finding and shows an “Unsupported Authentication Detected” banner in the Project Setup panel. The banner explains that validation steps requiring authenticated access may be skipped, along with details about the specific auth type found. Unsupported Authentication Detected banner
cannot bypass login flows, external identity providers, or multi-factor challenges. If your application relies on OAuth, SSO, MFA, or a POST /login session handshake, those auth-protected routes will be unreachable during automated testing. You have two options:
  1. Follow one of the manual steps below to configure authentication yourself (e.g. add a disable flag, seed a test user, add a login script, or use the connect strategy).
  2. Accept reduced functional testing coverage. will still validate install, build, run, and health check — only runtime behavior verification of auth-gated endpoints is skipped.

Manual steps for unsupported auth types

If can’t figure out your application’s auth automatically, you can prepare the environment yourself so that protected surfaces become reachable. Below are common patterns — pick the one that fits your stack. You can apply any of them by asking the chat, or by editing the panel directly.

Add a test-mode environment variable

Most frameworks have a way to relax or skip authentication in non-production environments. Add that variable to the Environment Variables section, for example: Re-validate after the change so confirms protected endpoints are now reachable.

Seed a test user and add a login script

For session-based auth, you can create a test user and add a lifecycle script that logs in before tests run:
  1. Add a bootstrap script (ordered before healthcheck) that seeds a test user:
  1. Add an authcheck script (ordered after healthcheck) that obtains a session token and verifies a protected route:
  1. Store the credentials (testuser / testpass) as secrets in the environment variables section so they are encrypted at rest.

Use the connect strategy with a pre-authenticated instance

When none of the above options work (e.g. OAuth with an external IdP that cannot be mocked), consider the connect strategy. Run the application yourself with authentication already configured, and point at the live, authenticated instance. skips install/build/run and only needs a base URL and health check.

Origin and Target

maintains separate lifecycle configurations for each side of the migration. Target discovery reuses the origin configuration as a starting point, so a clean, accurate origin setup directly improves the target result. Both sides stay editable in the panel and through chat for the rest of the project.

Tips

  • Check the Errors tab first. When a script fails, the stderr output usually points directly at the problem - a missing dependency, a wrong port, or a typo in the command.
  • Keep scripts minimal. Each script runs in a fresh shell process. If two commands need to share shell context (e.g., activating a virtual environment before running a command), concatenate them with && in a single script.
  • Use environment variables for configuration. Avoid hardcoding ports, database URLs, or API keys in scripts. Set them as environment variables so they are easy to change and can be encrypted if sensitive.
  • Answer the agent’s questions rather than skipping them. A skipped question means the agent guesses, and a wrong guess usually surfaces later as a validation failure.
  • Reuse a working setup. Once the lifecycle validates, it becomes available as Organizational Knowledge so the next project on the same repositories can import it and skip Project Setup.

Project Knowledge

The drawer that hosts Project Setup, Knowledge chat, and the rest of your project context

Lifecycle Strategy

Choose whether the agent builds and runs your app, or connects to a running one

Validation Level

Why Project Setup only runs at the High validation level

Acceptance Criteria

Quality gates built on top of your lifecycle scripts

Self Hosted

Run ModelDaemon on your own infrastructure for projects with private dependencies

Validation Hub

Where lifecycle script results are reported during milestone execution