What happened
On PR #4250, the code agent implemented daily retention cleanup for boost_sync_attempts using raw setInterval + unref() in plugin.ts. The human reviewer (mareklibra) replaced this with Backstage's SchedulerService (scheduler.scheduleTask()) in commit d7d9b274, which provides proper lifecycle management, distributed scheduling, and dead-letter handling. The review agent did not flag the raw setInterval usage in either review pass (run 31496436596, run 31603888382).
What could go better
The boost AGENTS.md Architecture rules > Backstage-native services only section lists specific services: cacheService, permissions, httpAuth, configApi, and catalogApi. It does not mention scheduler/SchedulerService (coreServices.scheduler). The code agent pattern-matched against the listed services but had no guidance that scheduled/periodic tasks should use SchedulerService instead of raw timers. Confidence is high — the AGENTS.md gap is clear, and the Backstage SchedulerService is the established pattern for all scheduled work in this codebase (the human fix confirms this).
Proposed change
In workspaces/boost/AGENTS.md, update the Backstage-native services only section to include scheduler in the enumerated services list. Add a sentence: "Scheduled or periodic tasks must use coreServices.scheduler (SchedulerService) — never raw setInterval, setTimeout, or cron libraries. SchedulerService provides distributed scheduling, lifecycle management, and proper shutdown handling." The updated line should read something like: "Use Backstage cacheService, permissions, httpAuth, configApi, catalogApi, and scheduler. Never build custom equivalents."
Validation criteria
The next code agent run in the boost workspace that implements a scheduled or periodic task should use coreServices.scheduler / SchedulerService instead of raw setInterval or setTimeout. Verify over the next 3 PRs that touch plugin.ts or introduce scheduled work.
Generated by retro agent from #4250
What happened
On PR #4250, the code agent implemented daily retention cleanup for
boost_sync_attemptsusing rawsetInterval+unref()inplugin.ts. The human reviewer (mareklibra) replaced this with Backstage'sSchedulerService(scheduler.scheduleTask()) in commitd7d9b274, which provides proper lifecycle management, distributed scheduling, and dead-letter handling. The review agent did not flag the rawsetIntervalusage in either review pass (run 31496436596, run 31603888382).What could go better
The boost AGENTS.md
Architecture rules > Backstage-native services onlysection lists specific services:cacheService,permissions,httpAuth,configApi, andcatalogApi. It does not mentionscheduler/SchedulerService(coreServices.scheduler). The code agent pattern-matched against the listed services but had no guidance that scheduled/periodic tasks should useSchedulerServiceinstead of raw timers. Confidence is high — the AGENTS.md gap is clear, and the BackstageSchedulerServiceis the established pattern for all scheduled work in this codebase (the human fix confirms this).Proposed change
In
workspaces/boost/AGENTS.md, update theBackstage-native services onlysection to includeschedulerin the enumerated services list. Add a sentence: "Scheduled or periodic tasks must usecoreServices.scheduler(SchedulerService) — never rawsetInterval,setTimeout, orcronlibraries.SchedulerServiceprovides distributed scheduling, lifecycle management, and proper shutdown handling." The updated line should read something like: "Use BackstagecacheService,permissions,httpAuth,configApi,catalogApi, andscheduler. Never build custom equivalents."Validation criteria
The next code agent run in the boost workspace that implements a scheduled or periodic task should use
coreServices.scheduler/SchedulerServiceinstead of rawsetIntervalorsetTimeout. Verify over the next 3 PRs that touchplugin.tsor introduce scheduled work.Generated by retro agent from #4250