Skip to content

remove isolate from fleche decorator - #523

Open
pmrv wants to merge 1 commit into
mainfrom
claude/issue-522-20260513-0028
Open

remove isolate from fleche decorator#523
pmrv wants to merge 1 commit into
mainfrom
claude/issue-522-20260513-0028

Conversation

@pmrv

@pmrv pmrv commented May 13, 2026

Copy link
Copy Markdown
Owner

Removes the isolate=True option from the @fleche() decorator.

The feature created a per-call TemporaryDirectory and os.chdir'd into it, which collided with Path return values (path deleted on exit), was not thread-safe, and had conceptual overlap with external staging libraries. The user-facing pattern that motivated it is straightforward enough without framework support.

Closes #522

Generated with Claude Code

`isolate=True` created a per-call `TemporaryDirectory` and `os.chdir`'d
into it for the duration of the wrapped call. This collided badly with
any use-case that returns a `Path` (the path is deleted once the
decorator returns), was not thread-safe, and had conceptual overlap with
external staging/storage libraries. The user-facing pattern that
motivated it (`shellwrapper(workingdir: Path)` + `NamedTemporaryDirectory`
at the call site) is straightforward enough to not need framework support.

- Remove `isolate` param and all supporting code from `wrapper.py`
  (`_get_working_directory_root`, related imports, `_HelpersCtx` slot,
  `make_wrapper` branch).
- Delete `tests/unit/fleche/test_workdir.py` (entirely about `isolate`).
- Drop the "The isolate Flag" section from `docs/parallel_execution.rst`.
- Update `AGENTS.md` decorator-kwargs reference.

Closes #522

Co-authored-by: Marvin Poul <pmrv@users.noreply.github.com>
pmrv added a commit that referenced this pull request Jun 2, 2026
…on (#612)

Audit pass of `AGENTS.md` against current `main` (`3a34ea7`).
Architecture / Key-files / MRO / Storage-composition sections were all
verified accurate against the source — the only material drift is in the
Test-layout section after PR #609, plus a few sites that triple-list the
SshCache 0.15.0 / `python -m fleche` story.

## What changed

### Test layout

- Add a `smoke/` bullet covering `tests/smoke/test_optional_deps.py` (PR
#609): one tiny `@fleche()` round-trip per optional dep (`cloudpickle` /
`dill` / `sqlalchemy` / `bagofholding` / `attrs`), asserting the second
call is served from the backend so the dep is genuinely functional (not
just importable). Selectable with `pytest -m smoke`; uses
`pytest.importorskip` so absent deps skip rather than fail.
- Reword the pytest-config sentence — `pyproject.toml` *does* now have
`[tool.pytest.ini_options]` (registers the `smoke` marker, also from
#609). The doc still claimed there was no such section.
- Disambiguate `unit/storage/test_optional_deps.py` (existing
full-coverage per-backend file) from the new
`smoke/test_optional_deps.py` — a reader scanning the file list
shouldn't conflate them.

### Trim SshCache / CLI repetition

"SshCache shipped in 0.15.0 via `python -m fleche remote --serve` (PR
#597 CLI dispatcher)" was being told three times:

- `remote.py` row: dropped the `landed #551 / released 0.15.0` aside and
the `PR #597 moved the CLI behind a dispatcher` parenthetical. The form
is what callers need; the archaeology is one line of `git log` away.
- "Distributed / remote caching" design theme: removed the repeated
SshCache feature description so the bullet covers only what's still open
(`#552` cold-tier values).
- "Decisions already landed": collapsed the separate `SshCache` and `CLI
consolidated` bullets into one — the CLI dispatcher is part of the
SshCache delivery story, no value in listing twice.

Also alphabetised the `__all__` enumeration in the `remote.py` row to
match the source (`["RemoteConnectionError", "SshCache", "serve"]`).

## Verified (no changes needed)

- Public API in `fleche/__init__.py` matches the listed exports.
- Type-matching order in `digest._digest_bytes` (int → Digest → str →
None → Number → bytes → np.ndarray → np.bool_ → FunctionType → CodeType
→ datetime/timezone → staticmethod/classmethod/property → dataclass →
attrs → ModuleType → Mapping → Iterable).
- `Call`/`DigestedCall`/`LazyCall` API including `LazyCall.detach`
(`call.py:400`), `FunctionProfile.of`, `_get_profile` with the
`__wrapped__` fallback, `lru_cache(maxsize=1000)`.
- `BaseCache.shrink` Template Method + `_shrink` abstract
(`caches.py:96,131-132`), `_first_hit`/`_collect`/`_foreach` on
`CacheStack` (`caches.py:610,640,671`).
- `storage/base.py` hierarchy (`OperationContext(ABC)` → `KeyManagement`
→ `StorageBackend`), `Intent(StrEnum)`, `_operation_context(key, *,
intent=Intent.WRITE)`.
- MRO for every concrete storage class (`ValueMemory`, `CallMemory`,
`Value/CallPickleFile`, `Value/CallBagOfHoldingH5File`, `Sql`,
`Value/CallVoid`) matches
`caches.py`/`memory.py`/`pickle_file.py`/`bagofholding_file.py`/`sql.py`/`void.py`.
- All cited issue/PR numbers in the "Active design themes" + "Decisions
already landed" sections still match GitHub state on 2026-06-02 (#444 /
#527 / #552 / #556 / #568 / #567 / #516 / #517 / #522 / #87 / #161 /
#469 / #333; PR #523 still open).

## Test plan

- Docs-only change.
- `git diff --stat AGENTS.md` → `1 file changed, 7 insertions(+), 7
deletions(-)`.



---
_Generated by [Claude
Code](https://claude.ai/code/session_01SPZhet2pjV5cGCnrq6EH6X)_

Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
pmrv added a commit that referenced this pull request Aug 14, 2026
… fix (#865)

Scheduled audit pass over `agents/DEVELOPING.md` against the tracker
state as of 2026-08-14. Delta since the last audit (#859): PRs #857,
#862, #858, #864, #863, #860, #851, #849 merged; #851 and #849 already
updated the doc inline, the rest had drifted.

## Changes

- **2026-07-31 refactor batch collapsed to its one open member (#809).**
#806 landed as PR #858 (`_lazy_default`), #807 as PR #864 (duplicate
entry-point-hook log); #808 was closed 2026-08-11 as obsolete — its
`wrapper.py` half lives under `isolate=`, which PR #523 removes.
- **Dropped the stale "PR #858 in flight" sentence** from the
2026-08-10/12 tracker entry (merged 2026-08-13).
- **Three new landed-decision entries:** the `_lazy_default` extraction
(PR #858, closes #806), the `load_entry_points` duplicate-hook log fix
(PR #864, closes #807), and the `FiveMinuteTour.ipynb` optional-dep
guards (PR #857 for `ase`, PR #862 for `executorlib`).
- **#861 recorded under Bugs** with its actual state: the `executorlib`
guard landed in PR #862, so the failure is fixed on `main`, but the
issue is not linked and remains open.
- **`state.py` Quick Reference row** now names `_lazy_default` alongside
the public helpers.
- **Perf-audit pointer** bumped to the 2026-08-13 refresh of #625 (was
2026-08-06).

Verified against the doc's standing claims: `caches.py` is 1019 lines
and `remote.py` 1007 (`wc -l`), matching the #789/#832 parentheticals;
`requires-python = ">=3.11,<3.15"` matches AGENTS.md. AGENTS.md and
agents/USAGE.md needed no changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JdJSfDeFTcCfyjSYGCwuK7

---
_Generated by [Claude
Code](https://claude.ai/code/session_01JdJSfDeFTcCfyjSYGCwuK7)_

Co-authored-by: Claude <noreply@anthropic.com>
pmrv added a commit that referenced this pull request Aug 29, 2026
…racker items (#904)

Scheduled AGENTS.md audit. Changes since the 2026-08-27 pass:

- Release-state claims updated: PR #793 (two-phase save) and PR #843
(lock-free pickle-family backends) shipped in 0.22.0 on 2026-08-28
(release PR #837); the three "unreleased as of 2026-08-27" qualifiers
are gone. Noted that `fix(query)` #894 is an ancestor of the 0.22.0 tag
(verified via `git tag --contains c82c691`) even though the generated
changelog entry omits it.
- PR #894 (`latest()`/`oldest()` raise `ValueError` when no matching
call carries `Runtime` metadata, `IndexError` on empty), PR #892 (gc
mid-sweep guards + 441-case digest product collapse, suite 1738 → 1299),
and docs-audit PRs #873/#874 moved from the in-flight section to
decisions landed; the in-flight section is now a one-liner pointing at
the five PRs still open (#887, #804, #797, #786, #523), each covered
under its theme.
- New tracker items recorded: the 2026-08-28 refactor cohort #899#902,
bug #903 (`put()` `filelock.Timeout` fatality on ≤0.21.2,
dedup-concentrated lock contention; resolved for pickle-family by
0.22.0's atomic rename, bagofholding multi-bag still exposed per #893),
and the #895 resolution (documented limitation per the 2026-08-28
maintainer comment). #900 cross-referenced at the `pypi-publish.yml`
line in the workflows list.
- The #893 bullet's `lock_timeout` mitigation sentence rephrased to the
current state: the `FutureWarning` drop covers only pickle-family
configs, a bagofholding `values.lock_timeout` still works on 0.22.0
(checked against `config.py:466`).
- USAGE.md: query section states the `latest()`/`oldest()`
`ValueError`/`IndexError` contract (verified against
`query.py:149-188`).

landau's AGENTS.md was audited in the same pass and left unchanged — no
code or tracker movement since its 2026-08-24 update (only docs commits
on main; issues #423#425 and PRs #422/#414/#395/#394/#391 unchanged).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_014myhh6xKWC2VhQeB92mGSn

---
_Generated by [Claude
Code](https://claude.ai/code/session_014myhh6xKWC2VhQeB92mGSn)_

Co-authored-by: Claude <noreply@anthropic.com>
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.

file, paths and isolate

1 participant