Fallow Cloud setup: runtime coverage with one commit SHA
Fallow Cloud joins production runtime coverage to the code only when five things name the same commit SHA:
- The beacon in the app sends
commitSha. - CI uploads the static inventory for that SHA.
- CI uploads the source maps for that SHA, when the build bundles the code.
- CI registers the deployment of that SHA.
- The first production data for that SHA arrives.
fallow coverage setup --cloud --json writes a plan for all five steps. This skill applies the plan.
When to Use
- Add the Fallow beacon to an app and send production coverage to Fallow Cloud.
- Wire the CI steps that upload the inventory and the source maps and register the deployment.
- Find the missing step when Fallow Cloud shows no data or no matched functions for a repository.
When NOT to Use
- Local code-quality tooling, CI quality gates, or agent wiring. Use
fallow-setup. - Reading runtime data of a repository that is already set up. Use
fallow.
Rules
- Never write an API key value into a file, a command, or a message. Use the environment variable names that the plan gives (
cloud.api_key_env,cloud.browser_key_env). The user stores the values as CI secrets and server environment variables. Never use the--api-keyflag and never put a key before a command (FALLOW_API_KEY=... npx ...). The user exports the key in the shell. - A browser bundle gets only an ingest-only key (prefix
fallow_pub_k1_). A full key (prefixfallow_live_k1_) stays in CI and on the server. - Use the same commit SHA for every step. Do not replace
$GITHUB_SHAor thecommitShaexpression in the plan with another value. - Resolve flags from
fallow coverage setup --help. Do not use flags from memory. - Show the edits to the user before you change a CI workflow. A deploy workflow can hold secrets and production access.
Sequence
-
Check the flag. Run
npx fallow coverage setup --help. When it does not list--cloud, use Manual setup instead of steps 2 to 8. It has the same five steps. -
Get the plan. Run
npx fallow coverage setup --cloud --jsonat the repository root. Whencloud.project_idis null, ask the user for the Fallow Cloud project id (owner/repo) and run the command again with--project-id <owner/repo>, so no snippet keeps theOWNER/REPOplaceholder. When the command exits 2 and prints no JSON, read the error on stderr: an input such as the project id,--git-sha, or--api-endpointis not valid. -
Read the plan.
members[]has one entry for each workspace member that runs code. Each entry has its ownsnippets,files_to_edit,dockerfile_snippet, andwarnings. Apply the snippets frommembers[]only: the top-levelsnippetsandfiles_to_editrepeat the first member.commandsinstalls the beacon.cloud.ci.stepsholds the GitHub Actions steps (cloud.ci.providerisgithub_actions).cloud.ci.workflows_detectednames the workflow files that look like a deploy.cloud.source_maps.dirsnames the build output of each bundled member.cloud.source_maps.reasonsays what the build must do, for example emit source maps.warningsnames what the plan cannot do for you, for example the coverage source of a Node server.
-
Install the beacon. Run the commands in
commandswith the package manager of the project. -
Add the snippets. For each member, add each snippet to the file in its
path. Keep theprojectId,commitSha,coverageOrigin, andruntimeSurfacevalues of the snippet. When the file exists, add the snippet at the start of the entry module. Do not replace the file. -
Pass the commit SHA to the runtime.
- Browser bundle: set
VITE_FALLOW_COMMIT_SHAon the build step (the CI steps show it). - Server in a container: add the
dockerfile_snippetlines to the Dockerfile, and build with--build-arg FALLOW_COMMIT_SHA=$GITHUB_SHA. - Server on a platform: the snippet reads the SHA that Vercel, Render, or Railway sets. On another platform, set
FALLOW_COMMIT_SHAin the runtime environment.
- Browser bundle: set
-
Add the CI steps. Add
cloud.ci.stepsto the job that builds and deploys, in the workflow fromcloud.ci.workflows_detected. When that list is empty, or the project does not use GitHub Actions, ask the user which job deploys and adapt the steps to it. The checkout needsfetch-depth: 0. The upload step goes after the build step, and the build must emit source maps for the upload to send anything. The registration step goes after the deploy step. Followcloud.ci.instructions. -
Tell the user what to do by hand. The user creates the keys in the Fallow Cloud dashboard, stores them as the secrets that the plan names, and deploys.
-
Check the setup after the deploy. Ask the user to export
FALLOW_API_KEY(a full key) in the shell. Runcloud.wait_commandfrom the plan with--jsonadded and$DEPLOYED_SHAset to the deployed commit SHA. It holds the project id. Then read the exit code:- 0: every step is done.
- 1: a timeout. Read
cloud.wait.activation.next. It names the step to do now and, where one exists, a command.activationis null when no read succeeded, andnext.commandcan be null. - 2: an error. Read
cloud.wait.message, or stderr when stdout has no JSON.
The activation body can have step ids and states that this skill does not name. Report them as they are.
Common problems
beaconisproblem: the beacon sends no commit SHA. Check step 5.runtimestayswaiting: the app has no production traffic yet, or the beaconcommitShais not the full SHA that CI used.deploymentiswaiting: an older deployment still receives runtime. The new one becomes current on its first runtime data.overlapiswaiting: too few functions ran so far. Send more traffic.source_mapsismissingfor an app that runs its source files without a bundle: it changes tonot_neededwhen runtime joins the inventory.overlapisproblem: runtime paths do not match the inventory paths. A container that runs the code under another root, for example/app, needs--path-prefixonupload-inventory. A bundled app needs the source maps.inventoryfails in CI: the checkout is shallow. Setfetch-depth: 0.
References
- Manual setup: the five steps by hand, for a fallow version without
--cloud.


