Skip to content

Commit 47cf709

Browse files
Nigel TatschnerNigel Tatschner
authored andcommitted
docs(events): mark hot-reloadable inference rules done
1 parent a041e4f commit 47cf709

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

docs/superpowers/follow-ups/2026-05-17-event-handling.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ Plan: `docs/superpowers/plans/2026-05-17-event-handling-improvements.md`
1818
- **Learned / auto-tuned inference confidence.** Currently hand-picked
1919
per rule. Could be tuned by tracking how often each rule is
2020
superseded by an observed event.
21-
- **Hot-reloadable inference rules via remote manifest.** The
22-
infrastructure exists (`parser_defs.rs` ed25519 + manifest); needs an
23-
inference-rule schema.
2421
- **Sidebar-style entity rail UI variant.** Considered during
2522
brainstorming; deferred to keep tray UI single-column.
2623

@@ -106,6 +103,36 @@ Plan: `docs/superpowers/plans/2026-05-17-event-handling-improvements.md`
106103

107104
## Done
108105

106+
- **Hot-reloadable inference rules via the remote-manifest path.**
107+
The inference engine now walks a runtime `&[CompiledInferenceRule]`
108+
rather than hardcoded free functions, and the parser-definition
109+
manifest carries a new additive `inference_rules` field. **Done in
110+
a510abf + b5977c3 + 293bf99 + a041e4f.** `a510abf` introduces
111+
`CompiledInferenceRule` + `InferenceMatch` and refactors
112+
`infer()` to delegate to `infer_with_rules`; the three built-ins
113+
move into `built_in_inference_rules()` (location-change keeps
114+
stateful Mutex-backed state). `b5977c3` adds
115+
`inference_defs.rs` with `RemoteInferenceRule` / `EventPattern` /
116+
`EventTemplate` / `compile_inference_rules` plus
117+
`${trigger.<field>}` + `${trigger.idempotency_key}` substitution;
118+
extends `Manifest` with the additive `inference_rules` field
119+
(`#[serde(default, skip_serializing_if = "Vec::is_empty")]` for v1
120+
back-compat). `293bf99` wires the new field through the server's
121+
`/v1/parser-definitions` handler and the utoipa doc shapes.
122+
`a041e4f` extends `RuleCache` to compile + cache inference rules
123+
alongside the regex rules; `CompiledInferenceRule.apply` moves
124+
from `Box<dyn Fn>` to `Arc<dyn Fn>` so the rule is `Clone` and
125+
the cache can hand out fresh `Vec`s cheaply. The actual call
126+
site (`infer_with_rules` inside the ingest pipeline) remains
127+
tracked under "Inference engine not wired into client ingest"
128+
above — this commit only lands the schema + compile + cache.
129+
130+
Note: the manifest's `signature` field is still a passthrough
131+
`Option<String>` with no in-tree signing logic, so inference
132+
rules currently ride on TLS trust alongside the parser rules.
133+
When trust comes online the signed payload must include
134+
`inference_rules`.
135+
109136
- **`inference.rs` `reconcile_supersedes` doc-comment vs behaviour mismatch.**
110137
Doc said scan is bounded by `window_size`, code scans full slice.
111138
Behaviour was correct (it `break`s on first match) but the comment

0 commit comments

Comments
 (0)