Skip to content

Fix Crane idle runs exiting as failures#113

Merged
mrjf merged 1 commit into
mainfrom
codex/crane-idle-success
Jun 8, 2026
Merged

Fix Crane idle runs exiting as failures#113
mrjf merged 1 commit into
mainfrom
codex/crane-idle-success

Conversation

@mrjf
Copy link
Copy Markdown
Contributor

@mrjf mrjf commented Jun 8, 2026

Summary

  • make the Crane scheduler return success when no migrations are due
  • emit has_work, not_due, and no_migrations GitHub Actions outputs
  • gate Crane activation from pre-activation so idle scheduled runs skip the agent cleanly instead of failing
  • add scheduler tests for both idle and due migration paths

Validation

  • .venv/bin/python -m pytest tests/unit/test_crane_scheduler.py tests/unit/test_crane_workflow_prompt.py -q
  • python3 -m py_compile .github/workflows/scripts/crane_scheduler.py
  • gh aw compile crane
  • gh aw validate crane
  • git diff --check

@mrjf mrjf force-pushed the codex/crane-idle-success branch from 6612168 to b91bcb8 Compare June 8, 2026 06:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Migration Benchmark Results

Migration CLI Benchmark

Includes fixture-backed commands that must read, write, execute, or fail against real project state. The installed-project fixture contains apm.yml, apm.lock.yaml, apm_modules packages, local .apm primitives, target directories, deployed prompt files, and sample source files.
The harness checks return-code parity for each command. Detailed stdout/stderr byte counts are kept in the JSON samples, but this is not an output-parity test.

Max allowed Go/Python median ratio: 5.00

Benchmark Command Fixture Python median Go median Go/Python Result Return codes
init scaffold init --yes empty-project 0.3485s 0.0011s 0.00x 307.91x faster {'python': [0], 'go': [0]}
targets json targets --json installed-project 0.3320s 0.0010s 0.00x 316.67x faster {'python': [0], 'go': [0]}
script list list installed-project 0.3309s 0.0011s 0.00x 310.47x faster {'python': [0], 'go': [0]}
deps list deps list installed-project 0.3394s 0.0011s 0.00x 310.42x faster {'python': [0], 'go': [0]}
deps tree deps tree installed-project 0.3389s 0.0011s 0.00x 308.31x faster {'python': [0], 'go': [0]}
install local package install --no-policy ./packages/local-tools local-install-project 0.3685s 0.0014s 0.00x 265.22x faster {'python': [0], 'go': [0]}
compile copilot target compile --target copilot compilation-project 0.3518s 0.0012s 0.00x 303.88x faster {'python': [0], 'go': [0]}
pack output pack --output dist installed-project 0.3529s 0.0012s 0.00x 306.65x faster {'python': [0], 'go': [0]}
run script run stamp runnable-project 0.3399s 0.0018s 0.01x 186.35x faster {'python': [0], 'go': [0]}
audit hidden unicode audit --ci audit-finding-project 0.3465s 0.0012s 0.00x 282.50x faster {'python': [1], 'go': [1]}

Workloads

  • init scaffold: Creates a new apm.yml in an otherwise empty project directory.
  • targets json: Reads configured project targets from apm.yml and emits machine output.
  • script list: Reads apm.yml scripts and renders the runnable script inventory.
  • deps list: Scans apm_modules package directories and apm.lock.yaml metadata.
  • deps tree: Builds a dependency tree from apm.lock.yaml and installed package metadata.
  • install local package: Installs a local package and materializes lock/module state.
  • compile copilot target: Discovers local primitives and writes the Copilot target artifact.
  • pack output: Resolves local package contents and writes a distributable artifact.
  • run script: Executes a project script and writes the script's side-effect file.
  • audit hidden unicode: Scans a real installed file and fails on planted hidden Unicode.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Migration Benchmark Results

Migration CLI Benchmark

Includes fixture-backed commands that must read, write, execute, or fail against real project state. The installed-project fixture contains apm.yml, apm.lock.yaml, apm_modules packages, local .apm primitives, target directories, deployed prompt files, and sample source files.
The harness checks return-code parity for each command. Detailed stdout/stderr byte counts are kept in the JSON samples, but this is not an output-parity test.

Max allowed Go/Python median ratio: 5.00

Benchmark Command Fixture Python median Go median Go/Python Result Return codes
init scaffold init --yes empty-project 0.4384s 0.0013s 0.00x 340.41x faster {'python': [0], 'go': [0]}
targets json targets --json installed-project 0.4237s 0.0013s 0.00x 316.26x faster {'python': [0], 'go': [0]}
script list list installed-project 0.4261s 0.0013s 0.00x 327.39x faster {'python': [0], 'go': [0]}
deps list deps list installed-project 0.4306s 0.0013s 0.00x 323.77x faster {'python': [0], 'go': [0]}
deps tree deps tree installed-project 0.4291s 0.0013s 0.00x 331.53x faster {'python': [0], 'go': [0]}
install local package install --no-policy ./packages/local-tools local-install-project 0.4676s 0.0018s 0.00x 262.57x faster {'python': [0], 'go': [0]}
compile copilot target compile --target copilot compilation-project 0.4557s 0.0014s 0.00x 322.37x faster {'python': [0], 'go': [0]}
pack output pack --output dist installed-project 0.4582s 0.0014s 0.00x 337.03x faster {'python': [0], 'go': [0]}
run script run stamp runnable-project 0.4384s 0.0022s 0.01x 196.62x faster {'python': [0], 'go': [0]}
audit hidden unicode audit --ci audit-finding-project 0.4542s 0.0016s 0.00x 292.41x faster {'python': [1], 'go': [1]}

Workloads

  • init scaffold: Creates a new apm.yml in an otherwise empty project directory.
  • targets json: Reads configured project targets from apm.yml and emits machine output.
  • script list: Reads apm.yml scripts and renders the runnable script inventory.
  • deps list: Scans apm_modules package directories and apm.lock.yaml metadata.
  • deps tree: Builds a dependency tree from apm.lock.yaml and installed package metadata.
  • install local package: Installs a local package and materializes lock/module state.
  • compile copilot target: Discovers local primitives and writes the Copilot target artifact.
  • pack output: Resolves local package contents and writes a distributable artifact.
  • run script: Executes a project script and writes the script's side-effect file.
  • audit hidden unicode: Scans a real installed file and fails on planted hidden Unicode.

@mrjf mrjf merged commit ec1a3f0 into main Jun 8, 2026
7 checks passed
@mrjf mrjf deleted the codex/crane-idle-success branch June 8, 2026 18:32
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