Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
44ec5811d7 docs: verify #650 already implemented on main
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 21s
Smoke Test / smoke (pull_request) Failing after 19s
Validate Config / YAML Lint (pull_request) Failing after 14s
Validate Config / JSON Validate (pull_request) Successful in 20s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 59s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Cron Syntax Check (pull_request) Successful in 13s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 10s
Validate Config / Playbook Schema Validation (pull_request) Successful in 16s
Validate Config / Shell Script Lint (pull_request) Failing after 46s
Architecture Lint / Lint Repository (pull_request) Failing after 9s
PR Checklist / pr-checklist (pull_request) Successful in 5m30s
Add a verification note and regression test proving the pipeline daily reset
is already wired on main via reset_pipeline_state.py, nightly scheduler
integration, and midnight cron configuration.
2026-04-22 14:56:05 -04:00
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# Issue #650 Verification
Status: already implemented on `main`
Issue: `[Pipeline] pipeline_state.json needs daily reset`
Summary:
The repo already contains the full daily-reset implementation for `pipeline_state.json`.
Yesterday's complete/failed states are reset by age, stuck running states older than 6 hours are cleared, the nightly scheduler calls the reset helper before each cycle, and a dedicated midnight cron entry runs the reset script against `~/.hermes/pipeline_state.json`.
Evidence on `main`:
- `scripts/reset_pipeline_state.py`
- removes stale `complete` and `failed` entries older than 24 hours
- removes stale `running` entries older than 6 hours
- supports direct execution against `~/.hermes/pipeline_state.json`
- `scripts/test_reset_pipeline_state.py`
- covers fresh vs stale complete entries
- covers stale failed entries
- covers stuck running entries
- passes on a fresh clone
- `scripts/nightly-pipeline-scheduler.sh`
- calls `reset_pipeline_state.py` before pipeline scheduling
- treats stale completion state as not reusable forever
- `cron/pipeline-daily-reset.yml`
- schedules a midnight daily reset using `python3 scripts/reset_pipeline_state.py --state-file ~/.hermes/pipeline_state.json`
Verification commands run:
- `python3 scripts/test_reset_pipeline_state.py`
- `bash -n scripts/nightly-pipeline-scheduler.sh`
- `python3 -m py_compile scripts/reset_pipeline_state.py`
Result:
- reset script tests passed
- scheduler shell syntax check passed
- reset script compiled cleanly
Additional trail:
- issue comment references closed PR #676 describing timestamp-based staleness logic
- current `main` already contains the reset helper, scheduler integration, tests, and cron wiring
Recommendation:
Close issue #650 as already implemented on `main`.

View File

@@ -0,0 +1,40 @@
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
def test_issue_650_daily_reset_helper_exists() -> None:
helper = REPO_ROOT / "scripts" / "reset_pipeline_state.py"
text = helper.read_text()
assert helper.exists()
assert "DEFAULT_COMPLETE_MAX_AGE_HOURS = 24" in text
assert "DEFAULT_FAILED_MAX_AGE_HOURS = 24" in text
assert "DEFAULT_RUNNING_MAX_AGE_HOURS = 6" in text
assert "def reset_pipeline_state(" in text
def test_issue_650_scheduler_invokes_reset_helper() -> None:
scheduler = (REPO_ROOT / "scripts" / "nightly-pipeline-scheduler.sh").read_text()
assert 'python3 "$script_dir/reset_pipeline_state.py" --state-file "$STATE_FILE"' in scheduler
assert "Reset stale pipeline states from previous days" in scheduler
assert "Check staleness: complete from a previous day is stale" in scheduler
def test_issue_650_midnight_cron_reset_exists() -> None:
cron_def = (REPO_ROOT / "cron" / "pipeline-daily-reset.yml").read_text()
assert "Pipeline State Daily Reset" in cron_def
assert "schedule: '0 0 * * *'" in cron_def
assert "python3 scripts/reset_pipeline_state.py --state-file ~/.hermes/pipeline_state.json" in cron_def
def test_issue_650_verification_doc_records_current_mainline_state() -> None:
doc = (REPO_ROOT / "docs" / "issue-650-verification.md").read_text()
assert "already implemented on `main`" in doc
assert "scripts/reset_pipeline_state.py" in doc
assert "cron/pipeline-daily-reset.yml" in doc
assert "Close issue #650 as already implemented on `main`." in doc