Skip to content

Add: Job lifecycle management and persistence #80

@FL4TLiN3

Description

@FL4TLiN3

Background

In #78, the Job schema was added but the actual persistence and lifecycle management is not implemented yet. Currently:

  • jobId is passed through Run/Checkpoint/Event
  • Storage structure uses perstack/jobs/{jobId}/runs/{runId}/
  • But no job.json is created or managed

Proposed Implementation

Job Persistence

  • Create job.json when a new Job starts
  • Update job.json on each Run completion

Job Lifecycle

  • Track totalSteps (sum of all Run stepNumbers)
  • Enforce maxSteps at Job level
  • Update status based on Run outcomes

File Structure

perstack/jobs/{jobId}/
├── job.json          # Job metadata (NEW)
└── runs/{runId}/
    ├── setting.json
    ├── checkpoints/
    └── events/

Acceptance Criteria

  • Implement storeJob and retrieveJob functions
  • Create job.json on perstack run (new Job)
  • Update job.json on Run completion
  • Track and enforce totalSteps / maxSteps at Job level
  • Add --max-steps option that applies to Job (not Run)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions