Changing Pipal
The checks to run, and a map of where to change what.
You change a conversation setting and want to know whether you’ve broken an old chat. The diff might be one line, but the setting travels through a request, a saved record and a browser control. You can check each of those places in Pipal without asking a real model to answer a prompt.
In this chapter
- Pick the check that exercises the behavior you changed.
- Follow an HTTP change from the schema to the browser.
- Find the implementation and the nearest tests for common changes.
- Recognize the version and revision a report refers to.
Each check answers a different question
| Feature | pnpm test Vitest | pnpm spike Recovery | pnpm test:e2e Playwright |
|---|---|---|---|
| Starts from | A package or cross-package test | A fresh temporary store per case | The built UI or a Markdown fixture in Chromium |
| Can tell you | Whether a rule, HTTP response or projection changed | Whether a new process can settle work the old one left behind | Whether browser flows and streamed Markdown render as expected |
| Look here | packages/*/test/ and tests/ | tests/recovery.test.ts | tests/browser/ |
Choose up to two columns
Choose up to two columns
| Feature | pnpm test Vitest | pnpm spike Recovery | pnpm test:e2e Playwright |
|---|---|---|---|
| Starts from | A package or cross-package test | A fresh temporary store per case | The built UI or a Markdown fixture in Chromium |
| Can tell you | Whether a rule, HTTP response or projection changed | Whether a new process can settle work the old one left behind | Whether browser flows and streamed Markdown render as expected |
| Look here | packages/*/test/ and tests/ | tests/recovery.test.ts | tests/browser/ |
Run pnpm check from the checkout when you change an interface. It asks each package to check its source and then type-checks tests/, vitest.config.ts and playwright.config.ts. Node runs Pipal’s server and core TypeScript directly. If the compiler would catch that you renamed a field on one side of an interface, this is the step that asks it to look. package.json tsconfig.tests.json
Run pnpm test when you want the behavior exercised directly. Vitest picks up tests under packages/*/test/ and tests/. Start with a runtime test for a rule about chats, an app.test.ts case for a request, or a host.test.ts case for startup and storage. The host test for a backup, for instance, opens a copy made after the runtime closes and checks the chat title, transcript, original submission receipt and restored access token. vitest.config.ts host.test.ts
Use pnpm spike while working on recovery. It selects the same recovery file that pnpm test includes. The file starts a process, waits for it to reach a known point, kills it, then opens the same store in a new process. That lets the test check what actually reached disk without giving shutdown handlers a chance to finish the job. package.json recovery.test.ts
Use pnpm build to produce the site that Pipal serves, then pnpm test:e2e to use it through a browser. Playwright exercises desktop Chrome settings in light mode and Pixel 7 settings in dark mode with Chromium. This is where you can catch a change that looks correct at the API but leaves the user unable to complete the action. package.json playwright.config.ts
Deep diveHow the two test drivers get a host of their own
withBrowserHost() reads packages/web/build/pipal-base-path.txt and starts an HTTP listener on a free loopback port. It assembles createRuntime() and createApp() inside the Playwright process, with a temporary store and a fixture token, then closes the server and runtime and removes the store. Workspace, artifact and install tests use this helper. The chat and passkey tests spawn main.ts and wait for the host’s health response. The passkey tests complete ceremonies with Chromium’s virtual authenticator. The Markdown tests bundle their own in-memory Vite fixture to compare streamed and full rendering. browser-host.ts chat.spec.ts passkeys.spec.ts markdown.spec.ts install.spec.ts
tests/recovery.test.ts forks recovery-worker.ts with an IPC channel, a way for the child to tell its driver when it has reached the crash point. The driver sends SIGKILL and waits for the process to die before starting the recovery command with the same data directory. Cases cover generation, a scheduled prompt, a checkpointed tool, delegation, and a delivery acknowledged by an independent HTTP service before the tool returned. The tool case also tries to open the live store from a second process and checks that ownership is refused. The external-write case checks that the service received one delivery. The suite tests process death on one machine. recovery.test.ts recovery-worker.ts
The development command gives you two watchers
pnpm dev makes a web build before it starts either watcher. The web watcher rebuilds packages/web/build in place. Refresh the tab to load that output. The server watcher runs Node with --watch from the repository root and uses the normal startup entry, packages/server/src/start.mjs. Editing server or core modules can restart the process that owns all your sessions. Sign in again when it does. package.json package.json
Follow the boundary your change crosses
- Tests
- Hono app.ts
- Core index.ts
- Browser api.ts
Tests → Hono · Request
Use the existing mount
Add a handler to the
apisub-app before the fallback. Write the test against its full path, under/api/v1and any configured base.Hono → Hono · Access
Keep the common access checks
The host, origin, session and body limits sit outside your handler. A new public route needs an explicit exception to the session check.
Hono → Hono · Shape
Give JSON a schema
Build the validator with
compileRequest()and callbody(). Exercise wrong content types and unexpected fields.Hono → Core · Operation
Put chat rules beside the state they protect
Core should enforce a rule such as whether the chat can change while a run is active. Direct callers then get the same rule as HTTP callers.
Core → Hono · Result
Return a public value or a known error
Use
RuntimeErrorfor a rejected operation. The host already knows how to turn it into a status and a JSON error.Hono → Tests · Assert
Test what the caller gets
Check the response status and fields. Record the route in
docs/server.mdso another client can find it.Browser → Hono · Use route
Hook up the browser if it needs the route
Put a shared payload type in
contracts.tswhen both sides use it. The browser’sapi()helper adds the build’s base path and API prefix throughapiPath(). Use the subpath build too if your change affects the mount.Hono → Browser · Response
Verify the built client
In the browser test, check what the built client does with the new response.
Tests → Hono
Use the existing mount
Add a handler to the api sub-app before the fallback. Write the test against its full path, under /api/v1 and any configured base.
Suppose you add a route that updates a chat setting. Start in The Hono server for the mount and the checks the request passes through. In the code, keep the request shape in the host and the decision about the chat in core. The request schema can tell you whether a value is a boolean. Core knows whether changing it now is allowed. app.ts index.ts
| Change | Implementation and tests |
|---|---|
| An HTTP route | packages/server/src/app.ts for handlers and schemas, packages/server/src/passkeys.ts for passkey routes, and packages/server/src/request.ts for JSON validation Test in packages/server/test/app.test.ts for base paths, access checks, bad inputs and replies, or packages/server/test/passkeys.test.ts for passkey ceremonies |
| A snapshot field | packages/core/src/view.ts for the public projection, packages/core/src/index.ts for the reads feeding it, and packages/core/src/contracts.ts for the shared shape Test in packages/core/test/runtime.test.ts for the state that produces the field, tests/sse-delta.test.ts for changes on the wire |
| Generation retries | preventsReplay() in packages/core/src/index.ts and the versioned Pi Durable patch in patches/ Test in packages/core/test/generation-retry.test.ts for provider request counts before and after output, and tests/browser/run-status.spec.ts for what a waiting chat shows |
| A built-in tool | packages/server/src/system-diagnostics.ts for host diagnostics or packages/server/src/public-web.ts for Exa search and Jina Reader. Follow packages/server/src/main.ts and packages/server/src/config.ts for loading and enabling the tools, and agents/ for profile grants Test in packages/server/test/system-diagnostics.test.ts for the diagnostics probes, packages/server/test/public-web.test.ts for keyless requests and response handling with a stubbed fetch, packages/server/test/host.test.ts for config and grants, and packages/core/test/runtime.test.ts for runtime grant checks |
| Developer workspace | packages/server/src/workspace-locations.ts for the locationThe place a chat uses for project tools, either the Pipal host, an account reached over SSH, or a Docker project. catalog and tool routing, development-workspace.ts and development-runner.mjs in the same directory for This machine and SSH machine, and project-shell.ts for Docker Test in packages/server/test/workspace-locations.test.ts for settings and chat pinning, development-workspace.test.ts for SSH configuration and opt-in transport coverage, and project-shell.test.ts for container arguments and cleanup |
| Patch delivery and resume | packages/server/src/project-coding.ts for publish_file and packages/core/src/turn-budget.ts for the final reply when budget runs low Test in tests/browser/patch-delivery.spec.ts. The browser downloads the published patch after reload, the test applies it to a clean copy, and Resume response verifies the original checkout after the first run reports an unavailable linter. patch-delivery.spec.ts |
| A profile field | packages/core/src/profiles.ts for accepted frontmatter, packages/core/src/contracts.ts for Profile, and packages/core/src/index.ts for applying settings Test in packages/core/test/profiles.test.ts for parsing and packages/core/test/runtime.test.ts for a field used at run time |
| A model provider | packages/core/src/models.ts for modelRegistry() and recordedModel(), then packages/server/src/config.ts for the TOML key Test in packages/server/test/host.test.ts for config and packages/server/test/openai.test.ts for an OpenAI Responses fixture with a stubbed fetch |
| A UI command | packages/web/src/App.svelte for builtInActions, packages/web/src/lib/ui-extensions.ts for the extension interface, and packages/web/src/lib/load-ui-extensions.ts for registration Test in packages/web/test/load-ui-extensions.test.ts for name conflicts, tests/browser/chat.spec.ts for the composer and quick switcher |
| A theme | packages/web/src/themes/ or an installed extension’s themes/, then packages/web/vite.config.ts for discovery Test in The appearance test in tests/browser/chat.spec.ts for selection, persistence and system mode |
The conversation settings route calls body() with the PATCH schema, normalizes selected strings with trimConversation() and asks core to configure the chat.
api.patch('/conversations/:id', async c => c.json(await runtime.configure( c.req.param('id'), trimConversation(await body(c, patch)))));For the web client, keep shared types in contracts.ts. That is the point where the browser can learn the shape of a snapshot without importing the runtime and its storage. If you’re adding a field that changes as the reply streams, follow an update through Live streams as well as checking the first snapshot. contracts.ts
Deep diveThree seams that matter when you extend an existing feature
Use compileRequest(obj(...)) for the route’s JSON shape. Pass the compiled schema to body(), which rejects the wrong media type with 415 and invalid JSON or fields with 400. A new SSE field belongs on the public snapshot before the server serializes or diffs it. Full snapshots include the field when present, and delta frames carry its edits. The browser checks the envelope version before applying either. app.ts request.ts watch-conversation.ts
For a profile field, check how the setting reaches created chats, changed profiles and specialists. Expose it in ProfileInfo only if the browser needs it. For a provider, follow DeepSeek’s path through configured model selection and environment credentials, then check recordedModel() for how a saved model ID resolves later. The hosted-search wrapper is conditional. Profiles and models explains those choices. profiles.ts index.ts models.ts
If the change is your own slash command, use the extension contract. builtInActions supplies reserved names to the loader. The Vite theme plug-in discovers CSS under themes/light/ and themes/dark/, and the appearance initializer applies the saved preference before paint. Follow Extending the UI for both entry points. App.svelte ui-extensions.ts vite.config.ts
Identify the revision before comparing results
Look at the root package.json for the release version shared by the web client, server and core. The server prints it in ready, and the web build shows its version under Settings → Account → Workspace session. An untagged checkout can have the same manifest version as another checkout with different code. Include the revision in a report so someone else can find the same source. Settings.svelte main.ts
During 0.x, Pipal’s release policy uses a patch bump for compatible fixes and a minor bump for features or breaking changes. After 1.0.0, it uses a major bump for breaking changes. The release commit gets an annotated vMAJOR.MINOR.PATCH tag that matches the manifest and describes any migration. API and event stream versions track wire compatibility independently. README.md
For ordinary commits, use a lowercase type, optional parenthesized scope, a colon and a concise imperative subject. For example, fix(web): retain the composer draft. The repository’s AGENTS.md tells coding agents to create a commit only on explicit request. AGENTS.md
Before changing an interface, what can an existing client send or expect to receive? Check The HTTP API at a glance for the current contract and Decisions and trade-offs for the constraints behind it.
Recap
- Type-check first, then exercise the behavior where it belongs. Build before testing the browser.
- Use the crash suite to check what a fresh process can recover from the old store.
- Identify the code revision as well as the release when reporting a change.
- You tightened a rule about which settings a running chat may change. Where do you test that the rule also holds for a caller outside Hono?
- A direct runtime test
- Only a Playwright visual check
- Only the Vite build
Answer and explanation
A direct runtime test
A runtime test calls core directly and proves the semantic rule lives where every caller meets it.
- A new checkpoint passes a clean shutdown test. What additional test shows whether it survives a process dying without cleanup?
- Refresh the browser after a web rebuild.
- Kill the worker at the checkpoint and open its store in a fresh process.
- Check that the snapshot type includes the checkpoint.
Answer and explanation
Kill the worker at the checkpoint and open its store in a fresh process.
A forced exit removes memory and skips orderly cleanup. The restarted process can only rely on what the old one persisted.
- A client works at the root but requests the wrong path when the UI is mounted under /ai/. Which check exercises that setup?
- Run pnpm check with the default build.
- Run pnpm spike.
- Build with --base=/ai/ and run the Playwright suite.
Answer and explanation
Build with --base=/ai/ and run the Playwright suite.
The host-backed fixtures use the base path written by the build, so those tests exercise the client and host under the mounted path.
You tightened a rule about which settings a running chat may change. Where do you test that the rule also holds for a caller outside Hono?
A new checkpoint passes a clean shutdown test. What additional test shows whether it survives a process dying without cleanup?
A client works at the root but requests the wrong path when the UI is mounted under /ai/. Which check exercises that setup?