You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc87977
Browse filesBrowse the repository at this point in the historyBrowse files
✨ feat(nous): close recovered observations after seven days (#12659)
* ✨ feat(nous): close recovered observations after seven days
Track observation issue lifecycles on each spoke and relay recovery comments
and closes through the hub. Add the durable ledger, tests, and operator docs.
Hive-Run: #12655
Hive-Plan: #12341 child 4 — observation recovery lifecycle
Hive-Spec: #12655#acceptance-criteria
Signed-off-by: hanthor <jreilly1821@gmail.com>
* test(nous): count the recovery window from the first inactive cycle
The ledger starts the seven-day recovery window on the first eval cycle
that no longer reports the finding, so a single reconcile eight days
after the last active sample cannot produce a recovery request. The three
failing tests assumed the window counted from the last active sample;
align them with the documented ledger semantics.
Signed-off-by: scanner <scanner@hive.kubestellar.io>
* test(nous): add coverage for observation ledger methods and error paths
Signed-off-by: hanthor <jreilly1821@gmail.com>
---------
Signed-off-by: hanthor <jreilly1821@gmail.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
Co-authored-by: scanner <scanner@hive.kubestellar.io>
Copy file name to clipboardExpand all lines: src/docs/strategy-lab.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,28 @@ Nous state lives in three places, none of which is `hive.yaml`:
40
40
| Experiment campaigns |`/data/nous/campaigns.json`|`pkg/nous` campaign store (file version 2), written by `POST/PATCH /api/nous/campaigns` (including restarts) and by the legacy `PUT /api/nous/config/goals` / `POST /api/nous/campaign/start`; see [Campaigns and the per-campaign baseline](#campaigns-and-the-per-campaign-baseline)|
41
41
| Mode, output mode, repo allow-list, fast-fail bounds, schedule | in-memory `NousState.Config`, set via `PUT /api/nous/config/*`| dashboard ⚙ *Experiment Lab Configuration* dialog (lab-wide guardrails only) or direct API calls |
42
42
43
+
### Observation finding recovery
44
+
45
+
Observation detectors keep their issue lifecycle in
46
+
`/data/nous/observations.json`, keyed by finding fingerprint. Each record stores
47
+
the issue number and URL, `opened_at`, `last_seen_at`, and (while the finding is
48
+
absent) `recovered_since`, plus the before/after values and last evidence used
49
+
in the recovery comment.
50
+
51
+
Every evaluation reconciles the currently active findings with this ledger. An
52
+
active finding clears `recovered_since`; an absent finding starts the recovery
53
+
window. After **seven consecutive days** without the finding, the spoke sends
54
+
the hub relay an `action: "recover"` request. The hub searches for the open
55
+
issue marker, comments the before/after values and evidence, and closes the
56
+
issue. A missing or already-closed fingerprint is an idempotent `ok: false`
57
+
no-op, not an evaluation error.
58
+
59
+
After a successful recovery, the ledger records `closed_at`. If the same
60
+
fingerprint fires again, it starts a fresh lifecycle and the hub's open-only
61
+
search creates a new issue rather than reopening the old one. The spoke never
62
+
writes recovery comments or closes issues directly; the hub relay is the
63
+
authoritative write path.
64
+
43
65
The in-memory `Config` map (goals/repos/output/fast_fail/schedule/
44
66
principles sections) is **not currently persisted back to disk
45
67
across a process restart** — it is rebuilt from defaults each time the hive
0 commit comments