Skip to content

feat(workspaces): workspace self-scheduling + retire central cron#371

Merged
luokerenx4 merged 2 commits into
masterfrom
local
Jun 23, 2026
Merged

feat(workspaces): workspace self-scheduling + retire central cron#371
luokerenx4 merged 2 commits into
masterfrom
local

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • Workspace self-scheduling. Each workspace declares its own schedule in .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 bundled self-scheduling skill injected into every workspace.
  • Retired the central cron subsystem — deleted src/task/cron (engine/listener/tools), /api/cron, the cronAdd/cronList/… MCP tools, and the jobs.json wiring. Kept the event-bus skeleton (the cron.fire type stays as the bus's sample event).
  • Reshaped the Automation UI — the cron page is replaced by a Schedules dashboard (an Upcoming time-sorted timeline + a By workspace view) and an API docs page; Flow + Webhook are demoted into a collapsed Legacy group.

Notable details

  • GET /api/schedule serves 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-fired cron looks back one interval so it actually fires — seeding it from now made cron never due (a real bug caught in adversarial review; every/at were fine).

Test plan

  • npx tsc --noEmit clean (root) + cd ui && npx tsc -b clean
  • pnpm test — 137 files / 2015 tests pass (incl. new schedule-expr / declaration / scanner specs)
  • Schedules dashboard (both views) verified in light + dark via the demo fixture

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: tradingPush is 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

Ame and others added 2 commits June 23, 2026 12:25
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>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 23, 2026 8:18am

Request Review

@luokerenx4 luokerenx4 merged commit 808e39e into master Jun 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant