Skip to content

fix(runstore): an uncreatable run store is exit 2, not a traceback - #917

Open
Birfy wants to merge 1 commit into
mainfrom
fix/907-store-create-error
Open

Birfy wants to merge 1 commit into
mainfrom
fix/907-store-create-error

Conversation

@Birfy

@Birfy Birfy commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #907

runstore.create now turns an OSError from creating the store root or the run directory into a RunStoreError naming the path and the OS reason, and reports a store path that is an existing file as not a directory. The CLI therefore exits 2 with one error: cannot create run store <path>: <reason> line, and --json returns {"ok": false, "error": ...}.

The wrap stays inside create() (no blanket CLI-edge OSError handling), so tests/test_audit_store_durability.py still sees PermissionError for audit-path failures.

Verified on the box: --store /proc/adstore, /etc/passwd, /root/adstore all exit 2 with no traceback, text and --json.

Tests: tests/test_store_create_error.py (fails on main): file path, patched os.makedirs EROFS, run-dir ENOSPC, and demo exit 2 with/without --json. Docs: docs/plugins.md run-store section. Changelog: changelog.d/907-store-create-error.md.

@Birfy

Birfy commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS (tip 387e41b)

  • runstore.create wraps only the store-root and run-dir makedirs; OSError becomes RunStoreError with path + strerror, file-as-store reports not a directory. No CLI-edge catch, so audit durability tests keep PermissionError (ran green).
  • CLI: exit 2, one stderr line, {"ok": false} under --json; checked on /proc/adstore, /etc/passwd, /root/adstore.
  • New tests fail on main and pass here; runstore/demo/audit suites green locally. Docs + changelog fragment present.
  • risk_gate: T3 (path agentdescent/runstore.py), 84 lines / 4 files: waiting for Danyang's merge click, not auto-merged.

@github-actions github-actions Bot added the risk:T3 Risk tier T3 (core loop, release, process; needs Danyang's click), set by the controller label Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (core loop, release, process; needs Danyang's click), set by the controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: a store path that cannot be created crashes with a traceback instead of the documented error and exit 2

1 participant