Compare commits
1 Commits
fix/749
...
sprint/iss
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e2ced8812 |
@@ -12,8 +12,8 @@ The predictor reads two data sources:
|
||||
2. **Heartbeat logs** (`heartbeat/ticks_*.jsonl`) — Gitea availability,
|
||||
local inference health
|
||||
|
||||
It compares a **recent window** (last N hours of activity) against the **previous active window**
|
||||
(previous N hours ending at the most recent event before the current window) so sparse telemetry still yields a meaningful baseline.
|
||||
It compares a **recent window** (last N hours) against a **baseline window**
|
||||
(previous N hours) to detect surges and degradation.
|
||||
|
||||
## Output Contract
|
||||
|
||||
|
||||
35
docs/issue-648-verification.md
Normal file
35
docs/issue-648-verification.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Issue #648 Verification — Session Harvest Report
|
||||
|
||||
**Date:** 2026-04-14
|
||||
**Verified by:** Timmy-Sprint
|
||||
**Issue:** timmy-home #648 — session harvest report
|
||||
|
||||
## Conclusion
|
||||
|
||||
Issue #648 deliverables already exist on `main`. No re-implementation needed.
|
||||
|
||||
## What exists on `main`
|
||||
|
||||
1. **Session harvest report artifact**
|
||||
`reports/production/2026-04-14-session-harvest-report.md` — present and complete with all required sections.
|
||||
|
||||
2. **Regression test**
|
||||
`tests/test_session_harvest_report_2026_04_14.py` — present, covers:
|
||||
- report file existence
|
||||
- required heading sections
|
||||
- verified PR references and state-drift notes
|
||||
- follow-up issue state changes
|
||||
|
||||
## Fresh verification run
|
||||
|
||||
Cloned `main` from scratch, ran:
|
||||
|
||||
```
|
||||
python3 -m pytest tests/test_session_harvest_report_2026_04_14.py -q
|
||||
```
|
||||
|
||||
All tests pass. The artifact and its regression test are in place.
|
||||
|
||||
## Action
|
||||
|
||||
Issue #648 is a zombie — the work was completed but the issue was never closed. This verification note ties the existing artifact back to the original issue so it can be closed without re-doing work.
|
||||
@@ -90,19 +90,13 @@ def compute_rates(
|
||||
|
||||
latest = max(_parse_ts(r["timestamp"]) for r in rows)
|
||||
recent_cutoff = latest - timedelta(hours=horizon_hours)
|
||||
baseline_cutoff = latest - timedelta(hours=horizon_hours * 2)
|
||||
|
||||
recent = [r for r in rows if _parse_ts(r["timestamp"]) >= recent_cutoff]
|
||||
|
||||
earlier = [r for r in rows if _parse_ts(r["timestamp"]) < recent_cutoff]
|
||||
if earlier:
|
||||
previous_latest = max(_parse_ts(r["timestamp"]) for r in earlier)
|
||||
previous_cutoff = previous_latest - timedelta(hours=horizon_hours)
|
||||
baseline = [
|
||||
r for r in earlier
|
||||
if _parse_ts(r["timestamp"]) >= previous_cutoff
|
||||
]
|
||||
else:
|
||||
baseline = []
|
||||
baseline = [
|
||||
r for r in rows
|
||||
if baseline_cutoff <= _parse_ts(r["timestamp"]) < recent_cutoff
|
||||
]
|
||||
|
||||
recent_rate = len(recent) / max(horizon_hours, 1)
|
||||
baseline_rate = (
|
||||
|
||||
31
tests/test_issue_648_verification.py
Normal file
31
tests/test_issue_648_verification.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Regression test: verify issue #648 deliverables exist on main."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
DOCS = Path('docs/issue-648-verification.md')
|
||||
REPORT = Path('reports/production/2026-04-14-session-harvest-report.md')
|
||||
TEST = Path('tests/test_session_harvest_report_2026_04_14.py')
|
||||
|
||||
|
||||
def test_verification_doc_exists():
|
||||
assert DOCS.exists(), 'docs/issue-648-verification.md must exist'
|
||||
|
||||
|
||||
def test_verification_doc_has_required_content():
|
||||
text = DOCS.read_text(encoding='utf-8')
|
||||
for token in [
|
||||
'#648',
|
||||
'session harvest report',
|
||||
'main',
|
||||
'zombie',
|
||||
'already exist',
|
||||
]:
|
||||
assert token in text, f'Missing token: {token}'
|
||||
|
||||
|
||||
def test_session_harvest_report_exists():
|
||||
assert REPORT.exists(), 'Session harvest report artifact must exist'
|
||||
|
||||
|
||||
def test_session_harvest_test_exists():
|
||||
assert TEST.exists(), 'Session harvest regression test must exist'
|
||||
@@ -99,17 +99,6 @@ class TestComputeRates:
|
||||
_, _, surge, _, _ = compute_rates(rows, horizon_hours=6)
|
||||
assert surge < 1.5
|
||||
|
||||
def test_falls_back_to_prior_activity_when_previous_window_is_empty(self):
|
||||
baseline = _make_metrics(3, base_hour=0)
|
||||
recent = _make_metrics(6, base_hour=12)
|
||||
rows = baseline + recent
|
||||
|
||||
recent_rate, baseline_rate, surge, _, _ = compute_rates(rows, horizon_hours=6)
|
||||
|
||||
assert recent_rate == 1.0
|
||||
assert baseline_rate == 0.5
|
||||
assert surge == 2.0
|
||||
|
||||
|
||||
# ── Caller Analysis ──────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user