Skip to content

feat(paywalls): edit a flow screen step with --step-id - #203

Draft
jholwill wants to merge 3 commits into
josh/cli-flow-authoringfrom
paywalls-edit-step-id
Draft

jholwill wants to merge 3 commits into
josh/cli-flow-authoringfrom
paywalls-edit-step-id

Conversation

@jholwill

@jholwill jholwill commented Oct 29, 2026 •

Copy link
Copy Markdown

Checklist

  • Tests added or updated, if applicable
  • go build ./..., go test ./..., and gofmt pass

Motivation

rc paywalls edit can only edit a standalone paywall, so CLI users can't have Astra edit a screen inside a flow. Part of FUN-2337.

Description

Adds --step-id to rc paywalls edit so Astra edits one flow screen and saves it into the flow draft. It saves only the edited paywall per step, leaving the other steps untouched.

How this stack fits together

Relation PR What
Stacked on #201 rc flows commands (Josh) (uses its flows client)
Blocked by RevenueCat/agents#1970 v3 open to public clients (deploy: public v3 endpoint)
Blocked by RevenueCat/agents#1971 Astra validates every run (deploy: validation on public runs)
Related RevenueCat/agents#1972 MCP edit on v3 (same edit for MCP)

Gates: ASTRA_EDITOR_V3_PUBLIC_CLIENTS and ASTRA_FLOW_CREATE_PUBLIC_CLIENTS default off, and the MCP tools sit behind FUNNELS_PUBLIC_CLIENTS, so nothing changes until they are switched on. Public tokens need projects:read + offerings:read_write + workflows:read_write.

Testing: unit tests; end-to-end on a local stack with a real model: rc paywalls edit <flow> --step-id <step> --prompt ... edited the target step of a funnel and bumped the draft revision with exit 0 (a workflows-only token is rejected by Astra, so the token needs the scopes above).

Part of FUN-2337

🤖 Generated with Claude Code

jholwill and others added 3 commits October 29, 2026 16:59
Hidden --step-id on `rc paywalls edit <flow-id>` runs the Astra v3 editor
focused on one screen step of a Flow and saves only the steps the run
edited back to the flow draft, guarded by the revision read before the
run. A failed run saves nothing; a revision conflict is reported and not
retried. Edits without --step-id keep the v1 paywall path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ow edit

The flow draft PATCH now carries {"paywall": {...}} per edited step instead of echoing the whole draft step back, so no read-only keys reach the strict PATCH schema. Tests assert the exact body.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Flow session loading starts fresh only when the file is missing and reports
parse errors like the v1 loader. The flow session drops its unused version
and identity fields and reuses savePaywallAISession. A duplicate v1 test and
the request-shape assertions already covered in paywallai are removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant