feat(paywalls): round-trip state_declarations through AI paywall editing - #161
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f40f822. Configure here.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f40f822dd1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ersion The checked-in v2 snapshot predates khepri's schema change, so the components-version response schema didn't admit the state_declarations field the live endpoint already returns. Mirror the khepri definition (required nullable map of discriminated StateDeclaration variants) until the published spec catches up and spec-sync converges. Copied from khepri @ cf3f5ea523aee8d5cffb27dd37437380e9a73889.
4358ad2 to
c640ac4
Compare
AI Paywall Editor will be able to start editing these, so we want to send and save
Note
Medium Risk
Changes paywall draft PATCH semantics (omit vs null vs
{}) and AI session persistence; mistakes could clear declarations, though behavior is heavily covered by tests.Overview
Adds
state_declarationsto the paywall components API and wires it through the CLI’s Paywalls AI edit/generate flows so the editor can read and update typed paywall state keys.The OpenAPI spec and generated client types now expose
state_declarationson component versions and on draft PATCH bodies, with discriminatedStateDeclarationvariants (boolean, integer, double, string). Hand-written API structs mirror that field for expanded GETs andPaywallDraftUpdate.Paywalls AI sessions carry declarations in
PaywallData, seed new drafts with{}, load them from the server when resuming or refreshing revision checks, and hydrate older session files from the current draft so dashboard-authored declarations are not replaced with empty objects. When persisting,presentJSONomits absent/null values from PATCH (server keeps stored declarations) while still sending{}to the editor when the API returnsnull(legacy drafts). Editor events that omit declarations no longer clear the session; echoed values update it. Tests cover JSON marshaling, edit round-trip, legacy sessions, and never PATCHing explicitnull.Reviewed by Cursor Bugbot for commit c640ac4. Bugbot is set up for automated code reviews on this repo. Configure here.