-
Notifications
You must be signed in to change notification settings - Fork 31
feat: 🎸 atmn v2.1 #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Too many files changed for review. ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 189 files
Confidence score: 3/5
- Type/schema mismatches in
atmn/src/compose/models/planModels.ts(e.g.,usage_modelvsbilling_method) can cause validated data to diverge from TypeScript expectations at runtime. - Plan type definitions include
auto_enablebut omitdefault, andPlanFeatureusesincludedinstead ofgranted_balance, which risks incorrect typing of validated plan data. - These are concrete consistency issues that could surface as validation or runtime data handling bugs, so the change carries some user-impacting risk.
- Pay close attention to
atmn/src/compose/models/planModels.ts- align Plan/PlanFeature types with the Zod schema.
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="atmn/src/compose/models/planModels.ts">
<violation number="1" location="atmn/src/compose/models/planModels.ts:119">
P2: Plan feature pricing types don’t match the Zod schema (`usage_model: "pay_per_use"` vs `billing_method: "usage_based"`), so runtime validation and TypeScript expectations can diverge.</violation>
<violation number="2" location="atmn/src/compose/models/planModels.ts:157">
P2: PlanFeature type exposes `included` but the schema validates `granted_balance`, causing a schema/type mismatch for included usage.</violation>
<violation number="3" location="atmn/src/compose/models/planModels.ts:266">
P2: Plan type diverges from PlanSchema: it defines `auto_enable` (not validated) and omits `default` (validated), which can cause incorrect typing for validated plan data.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| add_on?: boolean; | ||
|
|
||
| /** Whether to automatically enable this plan for new customers */ | ||
| auto_enable?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Plan type diverges from PlanSchema: it defines auto_enable (not validated) and omits default (validated), which can cause incorrect typing for validated plan data.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At atmn/src/compose/models/planModels.ts, line 266:
<comment>Plan type diverges from PlanSchema: it defines `auto_enable` (not validated) and omits `default` (validated), which can cause incorrect typing for validated plan data.</comment>
<file context>
@@ -0,0 +1,282 @@
+ add_on?: boolean;
+
+ /** Whether to automatically enable this plan for new customers */
+ auto_enable?: boolean;
+
+ /** Base price for the plan */
</file context>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stupid clanker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. If there's a specific issue with the comment, please share details so I can improve future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 41 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="atmn/src/views/react/products/components/ProductSheet.tsx">
<violation number="1" location="atmn/src/views/react/products/components/ProductSheet.tsx:177">
P2: Guard the usage price interval display; feature.price can be valid without price.interval (e.g., when a top-level reset is used), which renders "/undefined" in the UI.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| {feature.price.amount !== undefined | ||
| ? `$${(feature.price.amount / 100).toFixed(2)}` | ||
| : "Tiered"} | ||
| /{feature.price.interval} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Guard the usage price interval display; feature.price can be valid without price.interval (e.g., when a top-level reset is used), which renders "/undefined" in the UI.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At atmn/src/views/react/products/components/ProductSheet.tsx, line 177:
<comment>Guard the usage price interval display; feature.price can be valid without price.interval (e.g., when a top-level reset is used), which renders "/undefined" in the UI.</comment>
<file context>
@@ -0,0 +1,209 @@
+ {feature.price.amount !== undefined
+ ? `$${(feature.price.amount / 100).toFixed(2)}`
+ : "Tiered"}
+ /{feature.price.interval}
+ </Text>
+ </Text>
</file context>
|
switch "atmn auth" to "atmn login" @SirTenzin |
Only write .env when keys are actually removed, preserve trailing newline, and use a Set to prevent duplicate key names in output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When local config matches remote (0 diff), push was still sending changes because featuresToUpdate and plansToUpdate included ALL items that existed both locally and remotely, regardless of whether values actually differed. Now featuresToUpdate and plansToUpdate only include items where the content actually differs. Before comparing, remote API data is transformed to SDK format and both sides are normalized (stripping default values) to account for field name mappings: default↔auto_enable, granted_balance↔included, usage_model↔billing_method, etc. This allows the "no changes to push" state to correctly appear when configs match, even if they contain optional fields that come down from the API. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
fix: centralise env variable precedence
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add logout command to remove API keys
When a plan references a feature that hasn't been created yet, the getPlanHasCustomers API call would 404. Since features are always pushed before plans, this resolves itself during the actual push — just catch and skip during analysis. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of catching and silencing the feature_not_found error, strip plan features that reference not-yet-created features before sending to the has_customers API. Features that don't exist upstream can't affect versioning — the check still runs properly for all existing features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a plan references a not-yet-created feature, the has_customers API 404s. Catch that specific error and default willVersion to true — adding a new feature to a plan with customers can trigger versioning, so we must still show the prompt. All other errors still throw. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mmand Allows skipping all confirmation prompts when using the nuke command by passing --dangerously-skip-all-confirmation-prompts. This bypasses the interactive Ink UI and uses the legacy nuke implementation with automatic prompt skipping. Useful for automation and scripting where prompts cannot be interactively confirmed. Sandbox validation is always enforced regardless of the flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace .find() inside .filter() (O(N²)) with pre-indexed Maps keyed by id for constant-time lookups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: detect zero-diff changes in push command
Add --dangerously-skip-all-confirmation-prompts flag to nuke
money moves
Summary by cubic
Shipped atmn v2.1 with a full src migration, new headless customers/products/features/events (list + aggregate), a plan preview UI, global --config, faster/safer push analysis, parallel sandbox nuke (with non‑TTY fallback and a skip‑prompts flag), logout, and disabled the transform layer to align the SDK with upcoming API v2.1.
Refactors
Bug Fixes
Written for commit 2719f5b. Summary will update on new commits.