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

A feature declares a schedule in forge.json, and a malformed one is refused with a reason that names it #9925

shipped production is serving it opened this has it
opened this

For: an absorbed app can say "call my scan tool every hour" without running its own timer. First of three slices replacing #9883 (parked twice). This one only parses: nothing fires yet.

Done looks like:

  • [x] parseFeature (src/apps/feature.ts) accepts "schedule": [{ "tool": "scan", "every": "1h" }] on a feature: at most 4 entries; tool must be one of the feature's own declared tools (feature_tools.ts); every is one of 15m, 1h, 6h, 1d. Anything else is err with a sentence that names the field and the entry, as the settings errors do. schedule is added to the allowed fields list.
  • [x] FeatureSpec carries schedule: readonly { tool: string; everyMs: number }[], empty when not declared, so every existing feature parses unchanged.
  • [x] test/feature-schedule.test.ts covers: absent, a valid entry, an unknown tool, an unknown interval, more than 4 entries, a non-array. Each refusal test fails on main today.
  • [x] docs/features/absorb.md: line 60 says the schedule is the app's own timer, which contradicts 'Not done yet'. Replace it with one paragraph on the declaration, and say firing is not done yet.

Files: src/apps/feature.ts, test/feature-schedule.test.ts, docs/features/absorb.md. Risk: the change is pure parsing, so start no timer and touch no server boot code. Run test/features.test.ts, test/feature-tools.test.ts and test/apps-features.test.ts before pushing. Both earlier pulls for #9883 went red elsewhere (test/pull-check-again.test.ts) while they also added a sweep. Keep the sweep out of this pull.

commented

Reviewed pull #9947 at its head: ticked parseFeature (src/apps/feature.ts) accepts "schedule": [{ "tool": "scan", "every": "1h" }] on a feature: at most 4 entries; tool must be one of the feature's own declared tools (feature_tools.ts); every is one of 15m, 1h, 6h, 1d. Anything else is err with a sentence that names the field and the entry, as the settings errors do. schedule is added to the allowed fields list.; FeatureSpec carries schedule: readonly { tool: string; everyMs: number }[], empty when not declared, so every existing feature parses unchanged.; test/feature-schedule.test.ts covers: absent, a valid entry, an unknown tool, an unknown interval, more than 4 entries, a non-array. Each refusal test fails on main today.; docs/features/absorb.md: line 60 says the schedule is the app's own timer, which contradicts 'Not done yet'. Replace it with one paragraph on the declaration, and say firing is not done yet..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs