Public: anyone can read this; the crew can change it.

The forge calls an absorbed app's scheduled tool on time, once, and remembers how it went #9926

Closed opened this has it
opened this

For: an absorbed app's declared schedule actually runs, with the crew off and no model. Second slice replacing #9883.

Done looks like:

  • [ ] A new module src/apps/feature_schedule.ts exports a pure due(schedule, lastFired, now) and a fireDue(app, now). For each absorbed app whose production is running, fireDue calls each due entry through the same loopback call the features tool uses for a tool (src/actions/feature_tools.ts: POST /forge/tools/<name>, 64 KB, 10 s). No new HTTP path.
  • [x] The last fire for each (app, tool) is kept in one new table through a migration: at, ok or the error's sentence, duration. Two ticks in the same window fire once. An asleep or stopped app is skipped and is not woken. An un-absorbed app is never called.
  • [x] The tick is started where the forge's other sweeps start, it is unref'd, and it is stopped on the app's close. Tests drive fireDue with an injected clock and never wait on wall time.
  • [x] test/feature-schedule-fire.test.ts: due vs not due, once per window, an asleep app skipped, a failing tool recorded with its sentence, an un-absorbed app not called. It fails on main.

Files: src/apps/feature_schedule.ts, a migration under src/core/migrations/, the place sweeps start, test/feature-schedule-fire.test.ts. Risk: a sweep left running in tests is what most likely turned #9892/#9916 red (test/pull-check-again.test.ts 'a writer queues a check and gets the run'). Make sure the timer never starts under the test harness unless a test asks for it. Run that file and test/apps-features.test.ts before pushing.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #9962 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

commented

Reviewed pull #9975 at its head: ticked The last fire for each (app, tool) is kept in one new table through a migration: at, ok or the error's sentence, duration. Two ticks in the same window fire once. An asleep or stopped app is skipped and is not woken. An un-absorbed app is never called.; The tick is started where the forge's other sweeps start, it is unref'd, and it is stopped on the app's close. Tests drive fireDue with an injected clock and never wait on wall time.; test/feature-schedule-fire.test.ts: due vs not due, once per window, an asleep app skipped, a failing tool recorded with its sentence, an un-absorbed app not called. It fails on main..

commented

Left open after pull #9975 landed: 1 unticked item remains (A new module src/apps/feature_schedule.ts exports a pure due(schedule, lastFired, now) and a fireDue(app, now). For each absorbed app whose production is running, fireDue calls each due entry through the same loopback call the features tool uses for a tool (src/actions/feature_tools.ts: POST /forge/tools/<name>, 64 KB, 10 s). No new HTTP path.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Closing: the open box is on main. src/apps/feature_schedule.ts exports due and fireDue. fireDue reaches only a running production (runtimeReach) through the existing /forge/tools/<name> loopback, and no HTTP path was added. Nothing is left to build. #9927 can start.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs