Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Agentic] Implementation plan: hashing substrate (merge/concatenate roadmap row 1) - #7275

Merged
bjlittle merged 4 commits into
SciTools:greenfieldfrom
bjlittle:merge-concat-plan-pr1
Sep 11, 2026
Merged

[Agentic] Implementation plan: hashing substrate (merge/concatenate roadmap row 1)#7275
bjlittle merged 4 commits into
SciTools:greenfieldfrom
bjlittle:merge-concat-plan-pr1

Conversation

@bjlittle

@bjlittle bjlittle commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

Note

This is agentic work, authored by Claude (Opus 5) working with @bjlittle.
It is labelled Agentic so that it is easy to find, or to filter out.

Follow-up to #7274, which banked the merge/concatenate design spec. This
pull request carries the implementation plan for row 1 of that spec's
roadmap (§6) — moving the array hashing machinery out of iris._concatenate
into a new private iris._combine_common, per §5.1.

It deliberately contains no implementation. The code change itself follows in
a separate pull request.

Why the plan ships on its own

A core developer opening the implementation pull request should see a diff they
can hold in their head: a module moved, an import repointed, a test added. A
four-hundred-line plan describing how an agent was told to do it is not evidence
about that change — it is homework handed in alongside the work, and it makes a
small, easily approved diff look like a large one.

So this becomes the standing convention for the programme, recorded in
docs/src/developers_guide/plans/README.md and in §6 of the spec: a plan
ships as its own pull request, ahead of the implementation it describes.
The
implementation pull request then carries only the change under review, and can
be reviewed on its merits by someone who has never read the plan and does not
need to.

Plans are tracked in the repository for provenance but are excluded from the
Sphinx build (exclude_patterns in docs/src/conf.py), so nothing here is
published.

Also in here

  • Changelog attribution for agentic work. [Agentic] Design spec: making merge and concatenate robust, efficient and configurable #7274's two news fragments credited
    :user:bjlittle; the work was Claude's, so they now credit `:user:`claude.
    Attribution should say who did the work — the pull request record already shows
    who authored and reviewed it. The :user: role resolves to
    https://github.com/%s, and github.com/claude is Anthropic's own
    account, so the rendered link is correct. The rule is recorded in AGENTS.md.
    Both fragments are merged but unreleased, so this costs nothing.
  • One sentence in spec §6 recording the plan-ships-separately convention.

What the plan actually says, for anyone curious

Three tasks. The move itself is atomic — creating the new module without
removing the original duplicates the definitions, and removing the original
first breaks _concatenate. There is exactly one non-mechanical hazard, which
the plan calls out: _concatenate.py:604 and :1230 assign to a local variable
named array_id, so once the moved function loses its underscore prefix that
local shadows it and the right-hand-side call raises UnboundLocalError. Ruff
does not flag it and the type checker does not flag it; only the tests do.

The plan also adds a test for the property that justifies the module's
existence: _combine_common must import nothing from Iris at runtime, which is
what makes the merge-side import risk-free later. That check is static, over the
module's AST, because import iris._combine_common executes iris/__init__.py
first and so sys.modules cannot distinguish the substrate's own imports from
the package's.

Checklist

  • Included a What's New entry
  • Incorporated type hints in any changed code — n/a, no code changed
  • Checked if tests need updating — n/a, no code changed
  • Checked if benchmarks need updating — n/a
  • Checked if documentation needs updating
  • Checked if dependencies need updating — n/a
  • Confirmed that the GitHub 'checks' on this PR are passing ✅

bjlittle and others added 2 commits September 10, 2026 23:42
Attribution should say who did the work.  The pull request record already
shows who authored and reviewed it, so crediting the human in the changelog
as well overstates their hand in it.

Records the rule in AGENTS.md and applies it to the two news fragments from
SciTools#7274, which are merged but unreleased.  The ``:user:`` role resolves to
https://github.com/%s, and github.com/claude is Anthropic's own account, so
the rendered link is correct.

Co-Authored-By: Claude Opus 5 <[email protected]>
Covers row 1 of the merge/concatenate roadmap: moving the array hashing
machinery out of _concatenate.py into a new private _combine_common.py.

Records the convention that a plan ships as its own pull request, ahead of
the implementation it describes.  A reviewer opening the implementation
pull request should see a diff they can hold in their head; a plan bundled
alongside is not evidence about the change, and makes a small diff look
like a large one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (greenfield@7689b98). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             greenfield    #7275   +/-   ##
=============================================
  Coverage              ?   90.35%           
=============================================
  Files                 ?       93           
  Lines                 ?    25816           
  Branches              ?     4796           
=============================================
  Hits                  ?    23327           
  Misses                ?     1709           
  Partials              ?      780           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Three corrections, all found by executing the plan rather than reading
it.

The import block was wrong.  `from __future__ import annotations` makes
`Mapping` annotation-only in Ruff's eyes, so `TC003` requires it behind
`TYPE_CHECKING`; `_concatenate.py` has no `__future__` import, so the
rule never fires there and copying the import across unchanged fails
lint.

The move is not quite mechanical.  Dropping the underscore from
`_array_id` collides with three local bindings inside `compute_hashes`
itself, not just the five call sites the plan already anticipated in
`_concatenate.py`.  Spell out the three, and say why the exception to
"do not otherwise touch the moved code" is narrower than it looks --
every one of the eight renames exists only to clear the unprefixed
name's path, so conceding decision 6 retires all of them at once.

Verification 1 therefore no longer expects an empty diff.  It expects
two hunks and three lines, which is a stronger check than "identical":
it names what may differ instead of asserting that nothing does.  The
`\b` anchors stay, with an accurate reason -- they change nothing over
lines 305-541, but protect `bound_array_id` if the range is ever
widened.

Co-Authored-By: Claude Opus 5 <[email protected]>
@bjlittle
bjlittle merged commit c0dc1d8 into SciTools:greenfield Sep 11, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant