PERSISTENT: Repeatedly triggers while the condition is true.
ONETIME: Triggers once and never rearms.
Add CROSSING, which triggers every time a condition changes from false to true.
Examples
Upward crossing:
19 SOL >={{SOL_LONG_ENTRY_PRICE}} CROSSING
Triggers whenever the price moves from below the entry price to equal or above it.
Downward crossing:
20 SOL <{{SOL_LONG_ENTRY_PRICE}} CROSSING
Triggers whenever the price moves from equal/above the entry price to below it.
The condition operator determines the direction, so separate CROSSING_UP and CROSSING_DOWN types are unnecessary.
Behavior
The first observed price establishes the initial state and must not trigger CROSSING.
A false-to-true transition triggers the alarm.
Remaining true does not trigger again.
A true-to-false transition rearms the alarm without triggering.
The next false-to-true transition triggers again.
For ranges, CROSSING triggers whenever the price enters the range.
CROSSING does not use a grace period; CROSSING:<seconds> must be rejected.
Existing ONETIME and PERSISTENT behavior must remain unchanged.
Acceptance criteria
Add CROSSING to AlarmTrigger.
Support it in the configuration parser.
Implement the transition behavior using the existing previous-condition state.
Add examples and semantics to README_alarm.md.
## Background
The current trigger types cover:
* `PERSISTENT`: Repeatedly triggers while the condition is true.
* `ONETIME`: Triggers once and never rearms.
Add `CROSSING`, which triggers every time a condition changes from false to true.
## Examples
Upward crossing:
```text
19 SOL >={{SOL_LONG_ENTRY_PRICE}} CROSSING
```
Triggers whenever the price moves from below the entry price to equal or above it.
Downward crossing:
```text
20 SOL <{{SOL_LONG_ENTRY_PRICE}} CROSSING
```
Triggers whenever the price moves from equal/above the entry price to below it.
The condition operator determines the direction, so separate `CROSSING_UP` and `CROSSING_DOWN` types are unnecessary.
## Behavior
* The first observed price establishes the initial state and must not trigger `CROSSING`.
* A false-to-true transition triggers the alarm.
* Remaining true does not trigger again.
* A true-to-false transition rearms the alarm without triggering.
* The next false-to-true transition triggers again.
* For ranges, `CROSSING` triggers whenever the price enters the range.
* `CROSSING` does not use a grace period; `CROSSING:<seconds>` must be rejected.
* Existing `ONETIME` and `PERSISTENT` behavior must remain unchanged.
## Acceptance criteria
* Add `CROSSING` to `AlarmTrigger`.
* Support it in the configuration parser.
* Implement the transition behavior using the existing previous-condition state.
* Add examples and semantics to `README_alarm.md`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
The current trigger types cover:
PERSISTENT: Repeatedly triggers while the condition is true.ONETIME: Triggers once and never rearms.Add
CROSSING, which triggers every time a condition changes from false to true.Examples
Upward crossing:
Triggers whenever the price moves from below the entry price to equal or above it.
Downward crossing:
Triggers whenever the price moves from equal/above the entry price to below it.
The condition operator determines the direction, so separate
CROSSING_UPandCROSSING_DOWNtypes are unnecessary.Behavior
CROSSING.CROSSINGtriggers whenever the price enters the range.CROSSINGdoes not use a grace period;CROSSING:<seconds>must be rejected.ONETIMEandPERSISTENTbehavior must remain unchanged.Acceptance criteria
CROSSINGtoAlarmTrigger.README_alarm.md.