Skip to content

Update: Search checkpoint across all Runs in Job for --resume-from#81

Closed
FL4TLiN3 wants to merge 1 commit intoepic/job-conceptfrom
fix/checkpoint-search-in-job
Closed

Update: Search checkpoint across all Runs in Job for --resume-from#81
FL4TLiN3 wants to merge 1 commit intoepic/job-conceptfrom
fix/checkpoint-search-in-job

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Dec 9, 2025

Summary

  • Add findCheckpointInJob(jobId, checkpointId) to search across all Runs in a Job
  • Update context.ts to use the new function for --resume-from

Previously, --resume-from only searched the most recent Run, failing when the checkpoint existed in an earlier Run.

Test plan

  • pnpm typecheck passes
  • pnpm test passes
  • pnpm test:e2e passes

Closes #79


Note

Search --resume-from checkpoint across all runs in a job and use it in run context resolution.

  • Run management:
    • Add findCheckpointInJob(jobId, checkpointId) in packages/perstack/src/lib/run-manager.ts to scan all runs within a job for a matching checkpoint and return it; throws if not found.
  • Context resolution:
    • Update resolveRunContext in packages/perstack/src/lib/context.ts to use findCheckpointInJob for --resume-from, instead of relying on the most recent run.

Written by Cursor Bugbot for commit 1ee8a88. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
perstack Ignored Ignored Dec 9, 2025 1:18am

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@FL4TLiN3
Copy link
Contributor Author

FL4TLiN3 commented Dec 9, 2025

Consolidated into a combined PR with #82

@FL4TLiN3 FL4TLiN3 closed this Dec 9, 2025
FL4TLiN3 added a commit that referenced this pull request Dec 9, 2025
- Simplify checkpoint storage path to jobs/{jobId}/checkpoints/{id}.json
- Remove timestamp from checkpoint filename
- Update --resume-from to strictly require --continue-job
- Change TUI history from Run-based to Job-based display
- Show jobId and checkpointId in TUI for easier CLI usage

Closes #81
Closes #82
FL4TLiN3 added a commit that referenced this pull request Dec 9, 2025
* Add: Job lifecycle management and persistence

* Refactor: Simplify checkpoint path and display Job-based history in TUI

- Simplify checkpoint storage path to jobs/{jobId}/checkpoints/{id}.json
- Remove timestamp from checkpoint filename
- Update --resume-from to strictly require --continue-job
- Change TUI history from Run-based to Job-based display
- Show jobId and checkpointId in TUI for easier CLI usage

Closes #81
Closes #82

* Refactor: Move persistence logic from run-manager to runtime

- Add getAllJobs() to job-store.ts
- Add getAllRuns() to run-setting-store.ts
- Add getCheckpointsByJobId(), getEventsByRun(), getEventContents() to default-store.ts
- Export new functions from runtime index
- Simplify run-manager.ts to delegate to runtime functions

* Fix: Job totalSteps and usage double-counting

stepNumber and usage in checkpoints are cumulative within a Job,
so directly assign instead of summing to avoid double-counting.
@FL4TLiN3 FL4TLiN3 deleted the fix/checkpoint-search-in-job branch December 9, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant