Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions apps/lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,25 @@ acceptance of the first; the third is due five business days after acceptance of
the second. Weekends are skipped; public holidays are not excluded in V1.
Each target date resolves its own Pacific offset, preserving 07:00 across DST.

Due times are persisted in Growth jobs. The existing cron leases campaign sends
only Monday–Friday during 07:00–08:00 Pacific; final authorization and provider
Due times are persisted in Growth jobs. The website's fallback cron invokes
lifecycle every 15 minutes (UTC minutes 00, 15, 30 and 45), rather than opening
Dawn and Growth on every idle minute. Requested form fulfillment still nudges
lifecycle immediately after the submission commits. Background retries and
research cleanup/reconciliation wait for a subsequent tick, potentially adding
up to 15 minutes plus execution time; execution deadlines and lease durations
are unchanged. Other traffic can keep a compute active, so fewer invocations
do not guarantee a proportional reduction in Neon CU-hours.

The cron leases campaign sends only Monday–Friday during 07:00–08:00 Pacific;
final authorization and provider
submission recheck the window. Normal sends begin on the first successful cron
tick after 07:00. Retries can run within that hour; missed windows wait until the
next weekday morning. Stops, mailbox recovery and ambiguous provider acceptance
tick at or after 07:00. The schedule includes 07:00, 07:15, 07:30 and 07:45
Pacific under either daylight-saving offset. The default batch size of 20 means
the four scheduled ticks can lease at most 80 jobs in that hour, shared across
all job kinds; nudges may add runs but are not guaranteed capacity. Review due
queue size before expanding the campaign cohort. Retries can run within that
hour; missed windows wait until the next weekday morning. Stops, mailbox
recovery and ambiguous provider acceptance
remain authoritative. Requested fulfillment and internal notifications do not
use this campaign window. Replayed acceptance cannot move later jobs earlier.

Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/app/api/cron/lifecycle/route.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ describe('GET /api/cron/lifecycle', () => {
expect(invoke).not.toHaveBeenCalled();
});

it('registers exactly one every-minute root Vercel cron without public secrets', () => {
it('registers one fifteen-minute fallback cron so idle Dawn computes can suspend', () => {
const config = JSON.parse(
readFileSync(resolve(REPOSITORY_ROOT, 'vercel.json'), 'utf8')
) as Record<string, unknown>;
expect(config['crons']).toEqual([
{ path: '/api/cron/lifecycle', schedule: '* * * * *' },
{ path: '/api/cron/lifecycle', schedule: '*/15 * * * *' },
]);
expect(JSON.stringify(config)).not.toMatch(
/NEXT_PUBLIC_(?:CRON|LIFECYCLE)/u
Expand Down
12 changes: 9 additions & 3 deletions docs/growth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ explicit operator action; a smoke command without `DRY_RUN=1` can publish.

## Schedules and measurement limits

The website Vercel cron invokes lifecycle every minute. Due times live in Growth
jobs. The founder sequence starts the next business morning at 07:00 Pacific;
later steps are three and five business days after the preceding accepted send.
The website Vercel cron invokes lifecycle every 15 minutes, at UTC minutes
00, 15, 30 and 45. This reduces scheduled Dawn executions from 1,440 to 96 per
day and allows idle computes to suspend between ticks when no other activity
keeps them awake. Forms still nudge lifecycle immediately after their durable
submission; the cron is the fallback when that nudge fails. Background retries,
projection and research reconciliation can wait up to 15 minutes plus execution
time. Due times live in Growth jobs. The founder sequence starts the next
business morning at 07:00 Pacific; later steps are three and five business days
after the preceding accepted send.
The send window is 07:00–08:00 Pacific, weekdays, with daylight-saving handling.
Requested fulfillment and internal notifications use their own execution rules.
See [lifecycle operations](../../apps/lifecycle/README.md).
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"crons": [
{
"path": "/api/cron/lifecycle",
"schedule": "* * * * *"
"schedule": "*/15 * * * *"
}
]
}
Loading