feat(workspaces): workspace self-scheduling + retire central cron#371
Merged
Conversation
Workspaces declare their own schedule in .alice/schedule.json; a launcher scanner reads each declaration on a ~60s tick and fires due tasks as headless runs that report to the Inbox. No central registry — scheduling is a coding task the agent does by writing a file, taught by a bundled self-scheduling skill injected into every workspace.
- core: schedule-expr (pure cadence math) + schedule/{declaration,marker-store,scanner}; the scanner caches the snapshot it builds each tick, served warm by GET /api/schedule.
- fireBase(): a never-fired cron looks back one interval so it actually fires (seeding from now made cron never due); every/at fire on first sight.
- retire central cron: delete src/task/cron, /api/cron, the cron MCP tools and jobs.json wiring; keep the event-bus skeleton (cron.fire kept as the bus's sample event).
- UI: Automation reshaped — Schedules dashboard + API docs page (replacing the cron page), Flow/Webhook demoted into a collapsed Legacy group; useSchedules() hook with a warm client cache.
Boundary touch: headless runs reach the full MCP surface incl. trading; execution still gates on the human Trading-as-Git commit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The raw full-width table read poorly. Reworked into two lenses (toggle): - Upcoming (default): every enabled task with a future fire, flattened across workspaces and sorted by next-due — a timeline of what runs next (the symmetric future of the Runs history). Answers 'what is going to happen?'. - By workspace: cards per workspace showing everything it declared (incl. paused / one-time-done tasks). Per task: id + a cadence pill (clock icon; 'at' collapses to 'once'), the full prompt (2-line clamp + title), compact last-run/next-due. Constrained to max-w-3xl; emerald/red status dots; default-expanded. Verified in light + dark via the demo fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
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
.alice/schedule.json; a launcher scanner reads every declaration on a ~60s tick and fires due tasks as headless runs that report to the Inbox. No central registry — scheduling is a coding task (the agent writes the file), taught by a bundledself-schedulingskill injected into every workspace.src/task/cron(engine/listener/tools),/api/cron, thecronAdd/cronList/… MCP tools, and thejobs.jsonwiring. Kept the event-bus skeleton (thecron.firetype stays as the bus's sample event).Notable details
GET /api/scheduleserves a snapshot the scanner caches each tick (O(1), no per-request disk walk);useSchedules()adds a warm client cache so the tab opens without a Loading flash.fireBase(): a never-firedcronlooks back one interval so it actually fires — seeding it fromnowmade cron never due (a real bug caught in adversarial review;every/atwere fine).Test plan
npx tsc --noEmitclean (root) +cd ui && npx tsc -bcleanpnpm test— 137 files / 2015 tests pass (incl. new schedule-expr / declaration / scanner specs)Boundary touch
Touches the automation dispatch path: a headless run reaches the full MCP surface including trading. Trade execution still gates on the human Trading-as-Git commit (verified:
tradingPushis a hollow no-op; only a human Web UI push reaches the broker). No new in-Alice trading gate was added, per the "autonomous trading is wanted, the gate is the future detached-UTA" boundary.🤖 Generated with Claude Code