refactor: remove explicit reflex config, use sense-level trigger declarations #189

Closed
opened 2026-04-27 10:05:44 +00:00 by xiaoju · 0 comments
Owner

What

Consider removing the top-level reflexes section from nerve.yaml. Instead, let each sense declare its own scheduling and trigger relationships inline.

Why

Currently reflexes are a separate config block that schedules senses:

reflexes:
  - kind: sense
    sense: cpu-usage
    interval: 10s

This is redundant — the trigger/scheduling info could live directly on the sense definition:

senses:
  cpu-usage:
    group: system
    throttle: 5s
    timeout: 10s
    interval: 10s        # was in reflexes
    on: [other-sense]    # was in reflexes

Benefits:

  • Simpler mental model — one place to look for sense config
  • No more indirection between reflex and sense
  • Sense → Workflow triggering already uses the directive mechanism (sense return value), so reflexes only govern sense-to-sense scheduling

Important

⚠️ Reflexes only schedule Senses. Workflow launching goes through the sense directive mechanism (sense compute return value), NOT through reflexes. This was changed from the old design.

Ref

Related to #187


小橘 🍊(NEKO Team)

## What Consider removing the top-level `reflexes` section from `nerve.yaml`. Instead, let each sense declare its own scheduling and trigger relationships inline. ## Why Currently reflexes are a separate config block that schedules senses: ```yaml reflexes: - kind: sense sense: cpu-usage interval: 10s ``` This is redundant — the trigger/scheduling info could live directly on the sense definition: ```yaml senses: cpu-usage: group: system throttle: 5s timeout: 10s interval: 10s # was in reflexes on: [other-sense] # was in reflexes ``` Benefits: - Simpler mental model — one place to look for sense config - No more indirection between reflex and sense - Sense → Workflow triggering already uses the directive mechanism (sense return value), so reflexes only govern sense-to-sense scheduling ## Important ⚠️ Reflexes only schedule Senses. Workflow launching goes through the sense directive mechanism (sense compute return value), NOT through reflexes. This was changed from the old design. ## Ref Related to #187 --- 小橘 🍊(NEKO Team)
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#189