Mock Slurm shims for local simulation

This directory contains lightweight replacements for `sbatch`, `squeue`, and `sacct`
that let you simulate a SLURM cluster locally. They are designed to work with the
Snakemake cluster-generic executor and this repository’s submit.py/status.py.

Behavior
- sbatch: emits a numeric jobid, records simple state, and (in background)
  simulates a short PENDING → RUNNING → COMPLETED lifecycle. It does not execute
  the Snakemake jobscript. Instead, it parses the jobscript header to extract
  outputs and touches them to emulate a successful job completion, while writing
  a short log to the resolved `--output/--error` files.
- squeue: prints `PENDING` or `RUNNING` (or nothing if the job left the queue)
  depending on elapsed time since submission and completion state.
- sacct: prints `COMPLETED` after the job is marked done, otherwise a neutral
  placeholder state.

Opt-in jobscript execution
- Set `MOCK_SLURM_EXECUTE_JOBSCRIPT=1` to make `sbatch` execute the submitted
  jobscript in the background instead of auto-touching declared outputs. This is
  intended for worker-startup and Snakemake handoff tests.
- In execute mode, `sbatch` resolves stdout/stderr logs, propagates submit-time
  variables from `--export=...`, runs the script via its shebang (falling back
  to `/bin/sh`), records `exit_code`/`jobscript_started` in the JSON state, and
  marks non-zero exits as `FAILED`.
- Execute mode deliberately does not create declared output files unless the
  jobscript creates them. This keeps missing-artifact and worker-startup
  failures visible.
- In execute mode, `squeue` reports the live JSON `status` for PENDING/RUNNING
  jobs instead of timestamp heuristics. Terminal jobs leave the queue.

State
- State files are stored in `workflow/mock_slurm/state/<jobid>.json` along with
  a monotonic `next_id` counter in the same directory.

Use
- Put this directory at the front of PATH when running Snakemake with the Slurm
  profile. Example:

  PATH="$(pwd)/workflow/mock_slurm:$PATH" \
  snakemake --profile snakemake_workflow/slurm_profile -j 50 --rerun-incomplete

Notes
- Because the jobscript is not executed, any heavy external dependencies (EMsoft,
  Poetry env) are not required for this simulation. The declared output files are
  created by the mock scheduler to mimic a successful run.
- If you also want to test failure paths, set env `MOCK_SLURM_FAIL=1` before
  calling snakemake; this will cause jobs to end in a failed state without
  creating their outputs.
