Skip to content

Fix CLI apply outcomes, model precedence and concurrent cache writes - #34

Merged
mikkel merged 1 commit into
mainfrom
codex/implicit-state-python
Nov 9, 2026
Merged

mikkel merged 1 commit into
mainfrom
codex/implicit-state-python

Conversation

@mikkel

@mikkel mikkel commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

The CLI could report success and exit 0 after one or more smart-apply files failed, and patchling-apply --model was parsed into an attribute the applier never used. Concurrent disk-cache writers could also lose each other's records.

Aggregate per-file outcomes now drive both CLI exit statuses and summaries, including unsafe paths, read/write/delete errors, refusals and empty/invalid diffs. The standalone apply command forwards --model with CLI > environment > default precedence. Cache flushes merge only dirty records under the same local-filesystem claim protocol used by the JS SDK, retaining pending records after failure.

Validation:

  • Full Python 3.10 offline suite: 252 passed, 2 live tests skipped, with correct editable package metadata (0.9.4).
  • Includes 24 CLI outcome/model tests and 11 cache coordination tests; actual overlapping Python/Node writers passed from the JS suite.
  • py_compile and diff checks passed. Independent review caught and corrected the non-POSIX os.kill(pid, 0) hazard; a mocked Windows guard verifies no signal is sent.

Compatibility / release:

  • CLI failure exit status intentionally changes to 1. Partial successful writes remain on disk; this is not an atomic project transaction. Reports/docs tell callers to inspect paths before retrying.
  • Public in-memory smartapply return/error semantics and main CLI --model generation semantics are unchanged.
  • Cache v1 JSON/keys remain readable; the new .lock/ sidecar protocol requires all concurrent writers to upgrade together. Unsupported-platform abandoned claims require manual inspection after owners stop. See CACHE_PROTOCOL.md.
  • No version bump, package release, merge, deployment, credentials or workflow changes. Feature-branch tests run; the documentation deployment workflow only runs on main/manual invocation.
  • No paid inference, native Windows, distributed-filesystem or power-loss testing was run.

Existing parsing/release/UTF-8/binary fixes and draft documentation/deployment PRs are not duplicated. Related drafts: 255BITS/patchling#16 and 255BITS/patchling-examples#6. Both push and PR Core API Tests runs passed (42554550372 and 42554574685).

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