Skip to content

Fix module and shed_relpath to read effective_arrival(row) - #1081

Merged
brettheap merged 2 commits into
mainfrom
fix/1079-module-shed-relpath-effective-arrival
Sep 17, 2026
Merged

brettheap merged 2 commits into
mainfrom
fix/1079-module-shed-relpath-effective-arrival

Conversation

@brettheap

@brettheap brettheap commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-5 (openXfactory-5)

What

Sibling of #1062/#1077. In scripts/carved_reach.py, module() (line 663)
and shed_relpath() (lines 700-701) read row["destination"] /
row["destination_path"] directly instead of effective_arrival(row). A
re_destined row (RULED Q6) would therefore resolve at its ORIGINAL
destination instead of the effective one a ruling moved it to; latent today
because no re_destined row currently names a shed member either function's
callers reach. Both now route through effective_arrival(row), on
source()'s own precedent (line 616) and the exact shape #1077 applied to
shed_commit_object():

  • module(): destination, relative = effective_arrival(row) replaces
    relative = row["destination_path"].
  • shed_relpath(): destination, destination_path = effective_arrival(row)
    replaces the two raw reads (MOUNTS[row["destination"]] and
    row["destination_path"] in the return expression).

Regression

One regression per function, in the shape of #1077's
test_the_exact_commit_resolver_reads_the_effective_arrival_of_a_re_destined_row:
a fixture row re-destined from openxdox_code to a DIFFERENT leg
(opendox_code) entirely, asserting each function resolves at the EFFECTIVE
leg, not the original.

Failing against unfixed code (both fail):

FF                                                                       [100%]
=================================== FAILURES ===================================
___ test_the_module_loader_reads_the_effective_arrival_of_a_re_destined_row ____
    result = carved_reach.module("scripts/pkg/moved.py")
    assert result is sentinel
>   assert asked == ["opendox.moved"], asked
E   AssertionError: ['openxdox.moved']
E   assert ['openxdox.moved'] == ['opendox.moved']
E
E     At index 0 diff: 'openxdox.moved' != 'opendox.moved'

tests/carve_manifest/test_carve_manifest.py:2854: AssertionError
_ test_the_relative_path_reader_reads_the_effective_arrival_of_a_re_destined_row _
    relpath = carved_reach.shed_relpath("scripts/pkg/moved.py")
>   assert relpath == "openDox/code/src/opendox/moved.py", relpath
E   AssertionError: openXdox/code/src/openxdox/moved.py
E   assert 'openXdox/cod...xdox/moved.py' == 'openDox/code...ndox/moved.py'
E
E     - openDox/code/src/opendox/moved.py
E     ?     ^
E     + openXdox/code/src/openxdox/moved.py
E     ?     ^^                +

tests/carve_manifest/test_carve_manifest.py:2901: AssertionError
=========================== short test summary info ============================
FAILED tests/carve_manifest/test_carve_manifest.py::test_the_module_loader_reads_the_effective_arrival_of_a_re_destined_row - AssertionError: ['openxdox.moved']
FAILED tests/carve_manifest/test_carve_manifest.py::test_the_relative_path_reader_reads_the_effective_arrival_of_a_re_destined_row - AssertionError: openXdox/code/src/openxdox/moved.py
2 failed, 181 deselected in 0.81s

Passing after the fix:

..                                                                       [100%]
2 passed, 181 deselected in 0.84s

Full suites, post-fix:

  • python3 -m pytest tests/carve_manifest -q → 183 passed in 56.56s
  • python3 -m pytest tests/carve_arrival/test_verify_carve_arrival.py -q → 158 passed in 38.61s
  • python3 -m pytest tests/doc-health/test_release_inventory.py -q → 37 passed in 0.29s
  • python3 -m pytest tests/hermes_runtime_contracts/test_release_inventory.py -q → 73 passed in 54.66s
  • python3 scripts/validate-carve-manifest.py --repo . → exit 0 (OK … 456 row(s) … verified at c6997f125b8e)
  • python3 scripts/validate-manifest-digests.py → exit 0 (OK contracts/manifest.yaml: 184 per-file digest(s) verify)

Not widened

  • Grepped the module for every remaining direct row["destination"] /
    row["destination_path"] read: the only other hit is line 474, inside
    effective_arrival(row) itself (the base-case fallback when no
    re_destined block is present): the canonical definition, not a bug.
    Nothing else reads a row's raw arrival.
  • shed_destination() and sources_under() already resolve through
    source(), which already reads effective_arrival(row) (fixed shape
    since before this repo's history began tracking it); untouched here.
  • Docstrings for module() and shed_relpath() are left as written: unlike
    shed_commit_object()'s pre-Fix shed_commit_object to read effective_arrival, not raw destination #1077 docstring, which explicitly asserted
    "the row's own destination_path", neither of these two docstrings makes
    an equivalently specific wrong claim about re_destined rows, so there was
    no stale sentence to correct.

Refs #1079

Lane: openxfactory-5 (openXfactory-5)

🤖 Generated with Claude Code

Summary by Sourcery

Use effective arrivals when resolving module names and shed paths so re-destined files are located at their current destination.

Bug Fixes:

  • Resolve module names and shed relative paths using the effective arrival of re-destined rows.
  • Add regression coverage ensuring both resolvers follow a ruling to a different destination leg.

Documentation:

  • Update module resolution documentation to describe effective arrivals for re-destined rows.

Tests:

  • Add regression tests covering effective-arrival handling in module and shed-relative-path resolution.

Lane: openxfactory-5 (openXfactory-5)

Sibling of #1062/#1077: carved_reach.module() (line 663) and
shed_relpath() (lines 700-701) read row["destination"]/row["destination_path"]
directly instead of effective_arrival(row), so a re_destined row would
resolve at its original destination instead of the effective one a ruling
moved it to; both now route through effective_arrival(row), on source()'s
own precedent and the shape #1077 applied to shed_commit_object, with one
regression per function against a re-destined fixture row whose original
and effective legs differ.

Refs #1079

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 12 hours and 22 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR fixes two carved-reach resolvers that bypassed effective-arrival handling, ensuring re-destined rows resolve against their ruling-selected destination rather than their original one, with targeted regression tests and the reported full validation suites passing.

Flow diagram for effective arrival resolution

flowchart LR
    Row[Manifest row]
    EffectiveArrival["effective_arrival(row)"]
    Module["module(path)"]
    ShedRelpath["shed_relpath(path)"]
    Destination[Effective destination and relative path]
    Original[Original destination]
    Row --> EffectiveArrival
    EffectiveArrival --> Module
    EffectiveArrival --> ShedRelpath
    Original -. bypassed for re_destined rows .-> Module
    Original -. bypassed for re_destined rows .-> ShedRelpath
    Module --> Destination
    ShedRelpath --> Destination
Loading

File-Level Changes

Change Details Files
Resolve module names and shed-relative paths from the row’s effective arrival, including re-destined rows.
  • Updated module() to obtain destination and relative path via effective_arrival(row).
  • Updated shed_relpath() to select the effective mount and destination path via effective_arrival(row).
  • Added regression coverage using re-destination to a different leg for both resolvers.
scripts/carved_reach.py
tests/carve_manifest/test_carve_manifest.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Only minor documentation and test wording nits remain; no blocking issues were identified.

Pull request overview

Updates module and shed-relative path resolution to honor effective destinations for re-destined rows.

Changes:

  • Route module() and shed_relpath() through effective_arrival(row).
  • Add regression tests for cross-leg re-destination handling.
File summaries
File Description
tests/carve_manifest/test_carve_manifest.py Adds regression coverage for both resolvers.
scripts/carved_reach.py Resolves modules and relative paths using effective arrivals.
Review details

Suppressed comments (1)

tests/carve_manifest/test_carve_manifest.py:2813

  • The regression docstring has a subject–verb agreement error: module() is singular, so this should say module() reads ....
    """Regression, `#1079`. `module()` read `row["destination_path"]` directly
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/carved_reach.py Resolved
Lane: openxfactory-5 (openXfactory-5)

module()'s docstring still described the dotted name as derived from a
MOVED row's own destination_path, inaccurate now that the previous commit
routes the read through effective_arrival(row); the docstring now says a
re_destined row's to_path wins instead, on shed_commit_object()'s own
docstring fix in #1077.

Refs #1079

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings September 17, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

All reviewed changes are covered by passing regression and full test suites.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-5 (openXfactory-5)

LANDING — lane openXfactory-5, session 651195c7-1854-491e-894a-e6542ef5e9f4@Eagle, 2026-09-17T13:34:19Z, PR #1081 into opensoft/openxFactory main

@brettheap
brettheap merged commit c938189 into main Sep 17, 2026
15 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-5 (openXfactory-5)

LANDED — lane openXfactory-5, session 651195c7-1854-491e-894a-e6542ef5e9f4@Eagle, 2026-09-17T13:34:35Z, PR #1081 into opensoft/openxFactory main → merge c938189; Fix module and shed_relpath to read effective_arrival(row)

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.

2 participants