bitfab-cli 0.2.413 → 0.2.414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29868,10 +29868,10 @@ var semver3 = __toESM(require_semver2(), 1);
|
|
|
29868
29868
|
|
|
29869
29869
|
// ../bitfab-plugin-lib/dist/bakedSdkVersions.js
|
|
29870
29870
|
var BAKED_SDK_VERSIONS = {
|
|
29871
|
-
typescript: "0.
|
|
29872
|
-
python: "0.
|
|
29873
|
-
ruby: "0.
|
|
29874
|
-
go: "0.
|
|
29871
|
+
typescript: "0.64.0",
|
|
29872
|
+
python: "0.64.0",
|
|
29873
|
+
ruby: "0.64.0",
|
|
29874
|
+
go: "0.64.0"
|
|
29875
29875
|
};
|
|
29876
29876
|
|
|
29877
29877
|
// ../bitfab-plugin-lib/dist/installedSdk.js
|
|
@@ -36515,7 +36515,7 @@ If the block prints \`ERROR: Bitfab plugin not installed\`, the user hasn't inst
|
|
|
36515
36515
|
inspect: "Diagnose (and offer to fix) your tracing setup: auth, what's instrumented, plugin/SDK freshness, replay coverage, trace arrival.",
|
|
36516
36516
|
"switch-org": "Switch which Bitfab org the plugin reads and writes (replaces the local API key).",
|
|
36517
36517
|
replay: "Create or update replay registry modules for instrumented workflows.",
|
|
36518
|
-
cloud: "Run your normal replay on your own GitHub Actions by adding --cloud. One workflow file in the repository; no Bitfab repository connection or GitHub CLI required.",
|
|
36518
|
+
cloud: "Run your normal replay on your own GitHub Actions by adding --cloud: same options, same output, same exit code. One workflow file in the repository; no Bitfab repository connection or GitHub CLI required.",
|
|
36519
36519
|
"db-snapshot": "Set up per-trace database snapshots so replay runs against the DB state at trace time (TypeScript, Python, Ruby).",
|
|
36520
36520
|
templates: "Iterate on the span-rendering templates for one trace function.",
|
|
36521
36521
|
"analyze-repo": "Read-only discovery: scan source, rank the top workflows to instrument, and report recommendations without creating artifacts or changing code."
|
|
@@ -36579,35 +36579,29 @@ Never modify existing code on a refactor path without completing this three-step
|
|
|
36579
36579
|
kind: "action",
|
|
36580
36580
|
title: "Inspect the replay environment",
|
|
36581
36581
|
toolCalls: ["bash", "read", "glob", "grep", "ask"],
|
|
36582
|
-
body: `Cloud replay
|
|
36582
|
+
body: `Cloud replay is the user's normal replay plus --cloud: every replay option works the same, the runner replays a snapshot of their working tree (changed files, plus new files git does not ignore) from the same directory, and the command prints the replay's own output and exits with its exit code. The code ships inside the SDK, and the repository keeps one file: .github/workflows/bitfab-replay.yml, which holds only settings.
|
|
36583
36583
|
|
|
36584
|
-
|
|
36584
|
+
Run the installed SDK's bitfab-replay --cloud --help; if it does not list --cloud-preview, upgrade the SDK through bitfab:update first. Check that the git origin is github.com and that Python 3.10+ exists (macOS or Linux). GitHub access needs no GitHub CLI: the SDK uses gh when it is logged in, otherwise GH_TOKEN or GITHUB_TOKEN, otherwise the github.com credential git stores. When the repository still has .bitfab/cloud.json from an older SDK, the SDK says to delete it and the old workflow and run --cloud-init again; show the user the old file's settings first.
|
|
36585
36585
|
|
|
36586
|
-
|
|
36586
|
+
Read the existing GitHub Actions, lockfiles, replay registry, and environment-variable NAMES; never read or print secret values. Note what the replay needs beyond an install (build or code-generation steps, services, the working directory) and which environment variables it reads from secrets. For database reads, prefer database branching: it needs no database secret, but only works when every registry entry that reads the database sets dbBranch and the application takes its connection per call from the replay branch URL (getCurrentReplayBranch().databaseUrl, or the Python, Ruby, or Go equivalent); offer db-snapshot mode when either piece is missing. Do not silently give replay production side effects.
|
|
36587
36587
|
|
|
36588
|
-
|
|
36588
|
+
Say plainly which identity the runner uses: only the credentials in its GitHub secrets, never the user's. Local gcloud or AWS logins do not travel to the runner; when a secret is a service account, ask for its email (never the key) and, when the user's CLI is logged in, check it can read what replay reads, such as gcloud storage ls gs://<bucket> --impersonate-service-account=<email>.
|
|
36589
36589
|
|
|
36590
|
-
|
|
36591
|
-
|
|
36592
|
-
Say plainly which identity the runner uses: it authenticates only with the credentials in its GitHub secrets, never as the user. Local gcloud, AWS, or other cloud logins do not travel to the runner, so a bucket the user can read from their laptop can still refuse the runner. When a credential secret is a service account, ask for its email (never the key) and, when the user's own CLI is logged in, check that the account can read what replay reads, such as gcloud storage ls gs://<bucket> --impersonate-service-account=<email>. Report a refusal as the fix to make before the first run.
|
|
36593
|
-
|
|
36594
|
-
State who can start a replay: once GitHub has registered the workflow, anyone with write access to the repository can dispatch it on any branch, including code the user never reviewed, and that run receives every secret the workflow reads. Recommend a GitHub Environment (environment: bitfab-replay, set with --environment bitfab-replay) holding the replay secrets, with required reviewers, so no run gets credentials until someone approves it. Name the tradeoff: every replay then waits for an approval. Let the user decline.
|
|
36595
|
-
|
|
36596
|
-
Present the secret names the replay needs, the Environment choice, and any push-trigger exclusions. Ask only about unresolved choices. Never ask for secret values in chat.`,
|
|
36590
|
+
State who can start a replay: once GitHub registers the workflow, anyone with write access can dispatch it on any branch, and that run receives every secret it reads. Recommend a GitHub Environment with required reviewers (environment: bitfab-replay, set with --environment bitfab-replay), and name the tradeoff that every replay then waits for an approval. Ask only about unresolved choices (secret names, the Environment). Never ask for secret values in chat.`,
|
|
36597
36591
|
next: "cloud/install"
|
|
36598
36592
|
},
|
|
36599
36593
|
{
|
|
36600
36594
|
id: "install",
|
|
36601
36595
|
kind: "action",
|
|
36602
36596
|
title: "Write the cloud replay workflow",
|
|
36603
|
-
toolCalls: ["bash", "read", "write", "edit"],
|
|
36604
|
-
body: `From the directory where replay normally runs, run the SDK's bitfab-replay --cloud-init with --secret <NAME> for each environment variable the replay reads from a secret (BITFAB_API_KEY is always included), --environment <name> when
|
|
36597
|
+
toolCalls: ["bash", "read", "write", "edit", "ask"],
|
|
36598
|
+
body: `From the directory where replay normally runs, run the SDK's bitfab-replay --cloud-init with --secret <NAME> for each environment variable the replay reads from a secret (BITFAB_API_KEY is always included), --environment <name> when chosen, and --check "<command>" when replay reads a bucket or service with its own credentials. It detects the runtime, package manager, install command, and replay command (for Go, the program that calls RunCloudReplayCLI), writes the workflow, and returns next: the remaining steps with the exact secret names and the page to create them on. Work through that list with the user.
|
|
36605
36599
|
|
|
36606
|
-
|
|
36600
|
+
Edit the workflow directly for anything detection missed, such as a build step, code generation, a monorepo install filter, or a service, and pin any added action to a commit SHA. When the user normally starts replay through a wrapper that sets environment variables, add them to the replay step's env. Every variable read from a secret stays in that env as a GitHub expression reading secrets.<name>, which is how --cloud-secrets and the runner's empty-secret check find them; a secret stored under another name is mapped directly, such as OPENAI_API_KEY reading secrets.EVAL_OPENAI_API_KEY, and a non-secret value reads vars.<name>. When a setup step needs a credential file, write it under $RUNNER_TEMP with umask 077 and export its path through $GITHUB_ENV; do not use google-github-actions/auth or similar actions that write the key into the checked-out workspace. Do not copy deployment steps or secret values into the workflow.
|
|
36607
36601
|
|
|
36608
|
-
|
|
36602
|
+
For BITFAB_API_KEY, have the user create a dedicated key for the runner on the Bitfab dashboard's API keys page, in the organization that holds the registry's traces, named for what it is (such as "GitHub cloud replay"), and set it by hand. For the other secrets, when local environment files define them, ask once whether to copy them, then run bitfab-replay --cloud-secrets --env-file <file> --dry-run, then without --dry-run. It pipes values to gh on standard input, creates a missing Environment, and without the GitHub CLI returns createByHand with the page to create them on; relay that list instead of treating it as a failure. Never hand-extract a value with grep, cut, or a shell variable. Warn before copying a value a runner cannot use, such as a localhost URL. Setting secrets needs the same explicit authorization as any other remote write.
|
|
36609
36603
|
|
|
36610
|
-
|
|
36604
|
+
Each replay pushes a temporary bitfab-replay/<UUID> branch. For each push-triggered workflow or deployment in reviewPushTriggers, offer to exclude those branches: branches-ignore: [bitfab-replay/**] on a push trigger (or a last !bitfab-replay/** entry when it already lists branches), and git.deploymentEnabled {"bitfab-replay/**": false} in vercel.json. Ask before changing existing CI or deployments.`,
|
|
36611
36605
|
next: "cloud/verify"
|
|
36612
36606
|
},
|
|
36613
36607
|
{
|
|
@@ -36615,11 +36609,11 @@ When the project keeps local environment files, list the NAMES each secret could
|
|
|
36615
36609
|
kind: "action",
|
|
36616
36610
|
title: "Verify and hand off",
|
|
36617
36611
|
toolCalls: ["bash", "read", "ask"],
|
|
36618
|
-
body: `Validate workflow
|
|
36612
|
+
body: `Validate the workflow (actionlint when available). GitHub must register it before it can be dispatched: merging it to the default branch once does that, and after that each replay runs the copy in its own snapshot, so later edits apply without merging. Do not push, merge, or change repository settings without authorization.
|
|
36619
36613
|
|
|
36620
|
-
Verify with the replay command the user already runs
|
|
36614
|
+
Verify with the replay command the user already runs. First add --cloud --cloud-preview, which pushes nothing and lists the changed and new files the snapshot would carry; review them for anything that should not leave the machine, since filename screening is not a secret scanner, and have the user gitignore it. Once the workflow is merged and secrets are set, and remote runs are authorized, run the same command with --cloud --dry-run: a real run that replays nothing but receives the secrets, stops on any empty secret, runs the --check command, and resolves the traces. Then, only when a replay is authorized, run with --cloud alone.
|
|
36621
36615
|
|
|
36622
|
-
|
|
36616
|
+
From an agent session always add --cloud-detach, since a replay can run for hours, and follow it with --cloud-watch <UUID> (prints the replay's output and exits with its code), --cloud-status, --cloud-cancel, or --cloud-cleanup. --cloud-timeout <minutes> stops one replay early and keeps finished traces. Report separately whether the workflow is written, secrets are set, the workflow is merged, the preview was reviewed, the dry run passed, and a real replay completed.`,
|
|
36623
36617
|
next: "cleanup/finish"
|
|
36624
36618
|
}
|
|
36625
36619
|
]
|
package/package.json
CHANGED