Tier settings - #183
Open
agualdron wants to merge 24 commits into
Open
Conversation
Record the branch changes against origin/staging, including workflow execution deadlines, durable lifecycle ownership, and private tiers. Document canonical helpers, replaced cancellation paths, deployment considerations, validation results, and guardrails for future branches.
Contributor
|
| Filename | Overview |
|---|---|
| apps/tradinggoose/lib/execution/workflow-execution-runtime.ts | Coordinates captured execution deadlines with runtime lifecycle and terminal-state handling. |
| apps/tradinggoose/lib/execution/workflow-execution-lifecycle-repository.ts | Adds durable lifecycle persistence and concurrency-aware state transitions. |
| apps/tradinggoose/background/workflow-execution-termination-reconcile.ts | Reconciles deadline-driven termination and unresolved external cancellation work. |
| apps/tradinggoose/lib/billing/tiers.ts | Extends tier resolution with workflow limits and private-tier access grants. |
| apps/tradinggoose/lib/billing/core/subscription.ts | Updates effective subscription and tier entitlement behavior for the expanded tier model. |
| apps/tradinggoose/app/api/billing/private-tier-access/route.ts | Adds authenticated private-tier access-code redemption. |
| packages/ts-sdk/src/index.ts | Adds workflow deadline metadata to the TypeScript SDK contract. |
| packages/python-sdk/tradinggoose/init.py | Adds corresponding workflow deadline metadata to the Python SDK. |
Sequence Diagram
sequenceDiagram
participant Entry as Workflow entry point
participant Policy as Billing tier policy
participant Queue as Pending execution queue
participant Worker as Execution worker
participant Lifecycle as Lifecycle repository
participant Provider as Durable provider
participant Reconciler as Termination reconciler
Entry->>Policy: Capture applied tier and time limit
Policy-->>Entry: Absolute deadline and tier metadata
Entry->>Queue: Enqueue execution with captured deadline
Queue->>Worker: Claim execution attempt
Worker->>Lifecycle: Record attempt and lifecycle events
Worker->>Provider: Start supported operation
alt Execution completes before deadline
Worker->>Lifecycle: Arbitrate terminal completion
else Deadline expires
Worker->>Lifecycle: Begin fenced termination
Worker->>Provider: Request cancellation
Reconciler->>Lifecycle: Reconcile unresolved termination
Reconciler->>Provider: Retry cancellation or status check
Reconciler->>Lifecycle: Finalize terminal projection
end
Reviews (2): Last reviewed commit: "docs(changelog): document workflow lifec..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds billing-tier workflow execution time limits and private subscription tiers.
This PR:
Why
Workflow execution limits need to reflect the subscriber's billing tier and remain consistent across retries, queues, nested executions, and external operations.
Private tiers also need a controlled discovery mechanism so authorized users can access non-public subscription options without exposing them in the public catalog.
Type of Changes
The SDK changes are additive. The database and runtime changes require a coordinated rollout.
Affected Areas
apps/tradinggooseapps/docspackages/*Validation
bun run test:billing:suiteFocused workflow and execution Vitest suite.
TypeScript SDK tests.
TypeScript SDK build.
python -m compileall packages/python-sdk/tradinggoosegit diff --check origin/staging...HEADLocalization validation.
Application-wide typecheck.
apps/tradinggoose/app/api/routes.test.tsapps/tradinggoose/app/api/webhooks/route.tsRoot lint.
Tests were added or updated for workflow policies, lifecycle persistence, projections, termination reconciliation, queued execution, provider operations, billing tiers, private-tier access, subscriptions, UI components, and both SDKs.
Reviewer Focus
Please focus on:
Risk / Rollout Notes
0040_gigantic_morlun.sqlbefore deploying application and worker code that depends on the new schema.Config / Data Changes
0040_gigantic_morlun.sql.Screenshots / Video
Recommended visual verification:
Checklist