Skip to content

Cloud sweep: fix ch_func_to_all_pk with *args, partialx reordering, pyproject + uv CI, runnable README - #92

Merged
thorwhalen merged 4 commits into
masterfrom
cloud-sweep-2026-09-26
Sep 26, 2026
Merged

thorwhalen merged 4 commits into
masterfrom
cloud-sweep-2026-09-26

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Tests

Command (from the repo root):

uv venv .venv && uv pip install -e ".[dev]"
.venv/bin/python -m pytest          # pyproject addopts: --doctest-modules, ignores i2/examples and i2/scrap
passed failed xfailed
Baseline (master 14bd29d) 758 0 2
Final (this branch) 785 0 2

The CI-equivalent command also gives 785 passed: --cov=i2 --doctest-modules -o doctest_optionflags='ELLIPSIS IGNORE_EXCEPTION_DETAIL'. The two fix commits alone, without the packaging commit, give 783 passed on the legacy setup. The new uv CI is green on 3.10 and 3.12 for the current head.

Dependents gate: each dependent was cloned from GitHub and run with i2 installed editable, first from master, then from this branch.

Dependent Baseline Final
config2py 132 passed 132 passed
meshed 204 passed, 1 failed 204 passed, 1 failed
ju 46 passed 46 passed
dol 592 passed 592 passed

meshed's one failure is test_hybrid_dag. It fails the same way on master because the optional deps http2py and extrude are missing.

Changes

  • fix: make ch_func_to_all_pk work for functions with *args: on master, every call failed or lost arguments when the function had *args. Only that case takes the new path. Functions without *args keep master's code path and its convention: **kwargs given by name as a dict, other extras ignored. meshed's hook_up and FlexFuncFanout rely on that convention, and tests now pin it. Fixes Make ch_func_to_all_pk work with kwargs #12.
  • fix: keep parameter kinds in order when partialx reorders params: move_params_to_the_end now stable-sorts by parameter kind. Only orders that used to raise change. Fixes Careful reordering when adding keyword-only params to a list that already has a variadic keyword. #17.
  • build: migrate packaging to pyproject.toml and CI to wads uv: hatchling pyproject.toml with SPDX license and full metadata, plus the wads inline uv workflow. It is inline because the reusable stub can't pass the epythet v2 Pages pin, which is kept. setup.cfg, setup.py and the stale i2/tests/test_requirements.txt are removed. This commit is self-contained and can be dropped on its own.
  • docs: fix broken README examples and guard them with a test: seven README examples didn't run and now do. i2/tests/test_readme.py runs every README python block. The README also gains an agent pointer and a "For carbon-based contributors" section, and .claude/CLAUDE.md is updated. Fixes Seven README examples don't run #94.

Issues

Not done, and why

Adversarial review (Opus subagent)

The final verdict was APPROVE after three rounds.

  • Round 1, BLOCK. The first version of the Make ch_func_to_all_pk work with kwargs #12 fix changed behaviour for functions with **kwargs but no *args. It nested kw={...} instead of spreading it and passed extras through instead of dropping them. That broke FlexFuncFanout kwonly calls and changed meshed hook_up output, which meshed's tests don't cover. Fixed: master's code path is restored for functions without *args, and tests pin it. Re-running the reviewer's scripts against master: every remaining difference is a call that raised on master.
  • Round 1, non-blocking findings:
    • The Careful reordering when adding keyword-only params to a list that already has a variadic keyword. #17 test didn't assert the resulting signature. It now asserts it, and the docstring documents that names only move within their kind.
    • doctest_optionflags differed from CI. It is now aligned.
    • ruff format would change 9 files. Left as is; see above.
    • Publishing now assumes the PYPI_PASSWORD secret is a PyPI API token. See below.
    • The wheel also ships i2/tests/test_readme.py, which skips itself when the README is absent. Otherwise the wheel is file-for-file identical to the setuptools build.
  • Round 2, APPROVE. Non-blocking: the returned __signature__.name had become 'Sig' instead of the function's name. Fixed and tested.
  • Round 3, APPROVE. Non-blocking: two edge cases in the new "**kwargs given by name" spreading, both for calls that raised on master.
    • A dict key named like the *args param is taken as the positional args.
    • A clash between the dict and an explicit keyword resolves to the explicit keyword.
      Both are left as is.

For whoever lands it

  • Left open on purpose: I didn't self-merge. The packaging commit replaces the publish pipeline, and its publish and Pages jobs only run on master, so they can't be exercised from a PR. The triage note also asked that it stay droppable for a local lander.
  • Merging all four commits:
    • The first master run publishes through uv publish with secrets.PYPI_PASSWORD as a token. The 0.1.74 upload succeeded, so it is very likely already a token. If it isn't, publish fails before the bump and tag, so nothing half-publishes.
    • The epythet v2 Pages pin is preserved.
  • Dropping the packaging commit: the other three apply cleanly on the legacy setup (783 passed).
  • Version: unchanged at 0.1.74. CI bumps it.

Fixes #12
Fixes #17
Fixes #94

🤖 Generated with Claude Code

Copy link
Copy Markdown
Member Author

cloud-status: started — baseline 758/0 failed/2 xfailed; plan: fix #12 ch_func_to_all_pk kwargs (done), fix #17 partialx reordering, #78 if additive, packaging migration own commit, dependents gate (config2py, meshed, ju, dol)


Generated by Claude Code

ch_func_to_all_pk routed calls through Sig.extract_args_and_kwargs, whose
default ignore_kind=True turns every param keyword-only. For a function
with *args, that mangled the tupled *args value and dropped the **kwargs
extras, so every call failed or lost arguments.

For functions with *args, the wrapper now binds to its own all-PK
signature and rebuilds the call to the original function (tuple expanded
as *args, dict as **kwargs). The **kwargs can be given as extra keywords
or by name as a dict. Functions without *args keep master's code path
unchanged: meshed's hook_up and FlexFuncFanout rely on its convention
(**kwargs given by name as a dict, other extras ignored), and tests now
pin it. The signature ch_func_to_all_pk produces is unchanged.

Fixes #12
move_params_to_the_end appended the moved names at the very end, which
could put a keyword-only param after **kwargs or before a positional one.
partialx(partialx, x=2, _allow_reordering=True) hit this and raised
"wrong parameter order".

The reordered names are now stable-sorted by parameter kind. Every valid
signature is already sorted by kind, so only orders that used to raise
change; the order within each kind is kept.

Fixes #17
Legacy setup.cfg/setup.py become a hatchling pyproject.toml, and the
isee-based workflow becomes the wads inline uv workflow. This commit is
self-contained so it can be dropped without touching the fixes before it.

- Metadata: SPDX license string, description, keywords, classifiers, URLs,
  requires-python >=3.10 (master already fails to import on 3.9).
- Wheel contents are file-for-file identical to the setuptools build.
- [tool.wads.ci] mirrors today's CI: Linux only, Python 3.10 and 3.12,
  doctests, i2/examples and i2/scrap excluded. Metrics off (no config).
- Ruff limited to D100, which the package already passes.
- Inline workflow rather than the stub, because the stub's Pages job cannot
  pass the epythet v2 pilot pin, which is kept here.
- Dropped i2/tests/test_requirements.txt (read only by the old workflow;
  the suite never imported its pins) and the unused SCRIPTS_REPOSITORY_URL.

Publishing now uses secrets.PYPI_PASSWORD as a PyPI API token.
Seven README python examples failed when run: wrong Wrap ingress return
shape, Ingress used as a decorator, next() without a default, undefined
names, and attribute access on imdict. They now run, and
i2/tests/test_readme.py executes every README python block in order so
they can't silently break again.

Also: a README pointer for agents to .claude/CLAUDE.md and the skills, a
"For carbon-based contributors" section with dev setup and the dependents
rule, and CLAUDE.md updated for the pyproject/uv CI setup and test count.

Fixes #94
@thorwhalen
thorwhalen force-pushed the cloud-sweep-2026-09-26 branch from 85b545c to ce64cc6 Compare September 26, 2026 09:34
@thorwhalen thorwhalen changed the title WIP: Cloud sweep (2026-09-26) Cloud sweep: fix ch_func_to_all_pk with *args, partialx reordering, pyproject + uv CI, runnable README Sep 26, 2026

Copy link
Copy Markdown
Member Author

cloud-status: done — tests 758 → 785 passed (2 xfailed); dependents unchanged; Opus review APPROVE; CI green; fixes #12, #17, #94 (filed); filed #93; needs-local #43, #78, #93; left for local landing (includes the pyproject + uv CI migration, so its publish path is untested)


Generated by Claude Code

@thorwhalen thorwhalen left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from the local session that decided #78 and #93 (with a use-site inventory across i2's dependents and a test sweep).

Verdict on this PR's approach: confirmed, and built on. The *args path of ch_func_to_all_pk and the _args_and_kwargs_from_all_pk_arguments helper are kept exactly as they are; tuple_the_args now uses the same helper (#93 part 1), so the two functions share one rebuild path. The one thing this PR left as "not yet handled", a required keyword-only after *args, is handled in all_pk_signature (#93 part 2) and needed no change to this PR's call path. #78 is resolved by dropping a source *args in replace_kwargs_using. The decisions and evidence are on the two issues.

How it lands. This PR is merged first, as is (CI green on 3.10/3.12, Opus review APPROVE, dependents gate in the body). The follow-up branch fix-variadics-all-pk is stacked on it and is landed right after, as its own PR, with the dependents sweep re-run on the combined result.

One note for the record: with *args, excess keyword arguments are merged into **kwargs; without *args, they are ignored (what meshed's hook_up relies on). That asymmetry is pinned by this PR's tests and left as is; it isn't in scope of #78 or #93, and is now tracked in #95.

@thorwhalen
thorwhalen merged commit 225b2ae into master Sep 26, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the cloud-sweep-2026-09-26 branch September 26, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant