Repository navigation
Conversation
Completed runs reported zero spend because pipeline agents never call hpr run spend, so --budget could never fire. Fold notes/raw sources and spawn events into counters on finish, add hpr run reconcile, and record pid + heartbeat_at so a dead host session is distinguishable from a live one. Fixes jordan-gibbs#92
|
Thanks for taking this on. The The ceiling only fires because of For the counts, don't use mtime. Drop Two smaller things: mention the |
Rework of jordan-gibbs#92 for maintainer review: - Gate lives in set_step (every hpr run step --status done); no prompt changes and no DEFAULT_USD_PER_* coefficients. - init_run --max-sources / --max-notes are the observable ceilings. - Counts come from the vault DB by vault_tag + each note's raw_file frontmatter, not mtime (concurrent runs and repair rewrite files). - Drop pid and heartbeat_at; possibly_stalled uses updated_at. - run step --status done --force clears a count block so resume can proceed; cannot clear budget/verify; force-clears are capped. Fixes jordan-gibbs#92
|
Reworked in 86d9cda per your review:
un step --status done --force clears a count block only (not budget/verify) so resume can proceed when no new files landed. Ready for another look. |
Resolve CHANGELOG (keep Unreleased jordan-gibbs#92 + 0.11.1) and runs.py (chapter-plan fold from jordan-gibbs#114 + updated_at stall detection without heartbeat).
|
Thanks for the rework, this is the shape I was hoping for. I ran it against a run that just finished here (91 notes, 87 fetched pages) and it reports SELECT COUNT(DISTINCT s.url) FROM sources s JOIN tags t ON t.note_id = s.note_id WHERE t.tag = ?That query returns 87 on the same run. One more thing while you're in there: With the sources count fixed I'll merge. |
Keep jordan-gibbs#92 ceilings + force; retain VaultError handling and upstream Unreleased notes.
|
The Sep 14 push is just a merge of main, so the two things from my last comment are still open: A few more came up reading it again:
Please also say plainly in the description that |
…cile-92 # Conflicts: # CHANGELOG.md
|
Addressed the open review points in
The description states the remaining limits plainly: The CLI and run tests pass after the merge (one optional crawl4ai test skipped), as do ruff and |
|
Rebased the review state by merging current Validation on the merged tree: full local test suite passed (one Windows-only skip), |
What changed
set_stepreconciles counts at everyhpr run step --status doneboundary, andrun reconcilecan refresh them directly.notes_writtencounts notes tagged with the run'svault_tag;sources_fetchedcounts distinct URLs insourceslinked to those notes. This includes HTML pages and PDFs. It does not use file modification times orraw_file._count_agent_spawns. No pipeline skill emits the event types it scanned, so reconciliation leaves the agent-reportedagents_spawnedvalue alone.run init --max-sourcesand--max-notesceilings block when observed counts reach them.run resumeandrun step --status done --forceclear a count block against a saved count. Unchanged counts stay clear; an increase blocks again. Both clear paths share a cap of three, checked before a step is recorded. Budget and verify blocks cannot be cleared by step--force.run reconcilenow reports a bad run tag as a CLI error, consistent with the other run commands. The changelog entry sits with the existing Unreleased bullets and restores the en-dashes in the Pipeline constants are authored twice: profile fields vs hardcoded values #101 entry.Limits that remain
--budgetitself stays inert in normal pipeline runs: nothing callshpr run spend, soestimated_usdremains zero unless a caller explicitly reports spend. This PR does not add unit prices or automatic dollar estimates.The count ceilings only protect real runs if the entry skill passes
--max-sourcesor--max-notestorun init. The current entry skill does not pass them, so runs started by it have no active count ceiling by default.Addresses #92.
Verification
python -m pytest tests/test_cli tests/test_core/test_runs.py -q— passed; one optional crawl4ai test skipped because the extra is not installed.ruff checkon the touched Python files — passed.git diff --check— passed.run resume), and bad-tag CLI output.