Skip to content

Fix shed_commit_object to read effective_arrival, not raw destination - #1077

Merged
brettheap merged 2 commits into
mainfrom
fix/1062-shed-commit-object-effective-arrival
Sep 17, 2026
Merged

brettheap merged 2 commits into
mainfrom
fix/1062-shed-commit-object-effective-arrival

Conversation

@brettheap

@brettheap brettheap commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-5 (openXfactory-5)

What

scripts/carved_reach.py's shed_commit_object walked the gitlink chain through MOUNTS[row["destination"]] and returned row["destination_path"] directly, instead of routing both through effective_arrival(row) the way source() already does at line 616. A re_destined row (RULED Q6: a moved row whose placement a later ruling corrected to a different leg) would therefore resolve at its ORIGINAL destination: the function would walk the wrong leg's gitlink chain end to end and hand back a perfectly well-formed (repo, commit, path) at a leg the row no longer names, rather than raising. Latent today because no re_destined row names a shed member. Fixed by computing destination, destination_path = effective_arrival(row) once at the top of the function and reading both from it everywhere the function used to read the row directly, including the CarveReachUnavailable message text.

Regression

Added test_the_exact_commit_resolver_reads_the_effective_arrival_of_a_re_destined_row to tests/carve_manifest/test_carve_manifest.py, beside the existing shed_commit_object retired-row test. The fixture row carves to openxdox_code and is re_destined (RULED Q6 form) to opendox_code: two different legs entirely, not merely two paths at the same leg, so a resolver reading the raw destination walks the wrong gitlink chain end to end rather than failing to resolve at all. Both legs are materialized in the fixture on purpose, so the bug's signature is a wrong-but-well-formed answer, not a raised error. _git_object_id is monkeypatched to a constant so the assertion isolates which mount key and which destination_path the function used.

Failing against the unfixed function:

    located = carved_reach.shed_commit_object("a" * 40, "scripts/pkg/moved.py")
>   assert located == (effective_leg, pinned, "src/opendox/moved.py"), located
E   AssertionError: (PosixPath('.../openXdox/code'), 'cccc...cccc', 'src/openxdox/moved.py')
E   assert (PosixPath('/...dox/moved.py') == (PosixPath('/...dox/moved.py')
E     At index 0 diff: PosixPath('.../openXdox/code') != PosixPath('.../openDox/code')

FAILED tests/carve_manifest/test_carve_manifest.py::test_the_exact_commit_resolver_reads_the_effective_arrival_of_a_re_destined_row
1 failed, 180 deselected in 0.30s

Passing after the fix:

.                                                                        [100%]
1 passed, 180 deselected in 0.21s

Full local runs after the fix (submodules openDox/openXdox initialized):

tests/carve_manifest/test_carve_manifest.py: 181 passed in 77.38s
tests/carve_arrival/test_verify_carve_arrival.py + tests/doc-health/test_release_inventory.py
  + tests/hermes_runtime_contracts/test_release_inventory.py (shed_commit_object's two real callers): 268 passed in 134.75s

Validators that import carved_reach, run with . as the tree:

scripts/validate-carve-manifest.py --repo .      -> exit 0 (4 row(s) RE-DESTINED by ruling, 456 rows total)
scripts/validate-manifest-digests.py             -> exit 0, "184 per-file digest(s) verify"
scripts/validate-ideation-cross-reference.py --repo .  -> exit 1, 3 schema errors

The third validator's failure is pre-existing and unrelated: identical 3 evidence-required-property errors against tests/ideation-dashboard/fixtures/base-repo/ideation/cross-reference.yaml on unmodified origin/main (confirmed with git stash), about the ideation cross-reference schema, nothing this change touches.

Not widened

Two sibling call sites in the same module read a row's raw destination/destination_path the same way shed_commit_object used to, and are NOT touched here because issue #1062 names only shed_commit_object:

  • module(), line 663: relative = row["destination_path"]
  • shed_relpath(), lines 700-701: mount = MOUNTS[row["destination"]]... and row["destination_path"]

Both are latent for the same reason shed_commit_object was: no re_destined row currently names a shed member. Filing or fixing either is left to a separate act rather than folded in here.

Refs #1062

Lane: openxfactory-5 (openXfactory-5)

🤖 Generated with Claude Code

Summary by Sourcery

Use effective arrivals when resolving shed commit objects so re-destined rows resolve to their current destination.

Bug Fixes:

  • Resolve shed commit objects using a row’s effective arrival after re-destination rulings, ensuring the correct leg and path are returned.

Documentation:

  • Update shed commit object documentation to describe effective-arrival behavior.

Tests:

  • Add regression coverage for resolving a re-destined row across different legs.

Lane: openxfactory-5 (openXfactory-5)

shed_commit_object() walked the gitlink chain through MOUNTS[row["destination"]] and returned row["destination_path"] directly, so a re_destined row (RULED Q6: a moved row whose placement a later ruling corrected) would resolve at its ORIGINAL destination instead of the ruling's effective one; source() already reads the same row through effective_arrival(row) for exactly this reason (line 616), and shed_commit_object had not followed. Latent today: no re_destined row names a shed member, so no caller has hit it. Fixed by computing destination, destination_path = effective_arrival(row) once and reading both from it, including in the CarveReachUnavailable message. Added a regression in tests/carve_manifest/test_carve_manifest.py that re-destines a fixture row across two different legs entirely (openxdox_code to opendox_code) and asserts the resolver walks the EFFECTIVE leg; proven failing against the unfixed function (resolved at the original leg) and passing after.

Refs #1062

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 16, 2026 21:47

@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 1 day and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates shed_commit_object to route gitlink traversal, returned paths, and diagnostics through effective_arrival(row), preventing re-destined rows from resolving to their original destination. Adds a focused regression test that distinguishes the effective leg from the original and confirms the corrected result.

Sequence diagram for effective arrival commit resolution

sequenceDiagram
    participant Caller
    participant Resolver as shed_commit_object
    participant Arrival as effective_arrival
    participant Mounts as MOUNTS
    participant Git as _git_object_id

    Caller->>Resolver: shed_commit_object(commit, path)
    Resolver->>Arrival: effective_arrival(row)
    Arrival-->>Resolver: destination, destination_path
    Resolver->>Mounts: MOUNTS[destination]
    loop gitlink segments
        Resolver->>Git: _git_object_id(repo, revision, segment)
        Git-->>Resolver: gitlink commit
    end
    Resolver-->>Caller: repo, revision, destination_path
Loading

Flow diagram for re-destined shed resolution

flowchart LR
    A[re_destined row] --> B["effective_arrival(row)"]
    B --> C[Effective destination leg]
    B --> D[Effective destination path]
    C --> E["Traverse MOUNTS[destination] gitlinks"]
    E --> F[Return repo, commit, destination_path]
Loading

File-Level Changes

Change Details Files
Resolve shed commit objects using the row’s effective arrival after re-destination rulings.
  • Compute the effective destination and path once via effective_arrival(row).
  • Use the effective mount for gitlink traversal and the effective path in the return value.
  • Use the effective destination in the unavailable-materialization error message.
scripts/carved_reach.py
Add regression coverage proving re-destined rows resolve against the corrected leg and path.
  • Create a fixture with original and effective legs both materialized to expose a wrong-but-valid result.
  • Stub git object lookup and assert the resolver returns the effective leg, pinned commit, and path.
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

The functional fix and regression test are correct; only a minor stale docstring remains.

Pull request overview

Updates shed commit resolution to honor effective_arrival() for re-destined rows.

Changes:

  • Uses effective destination and path in shed_commit_object.
  • Adds regression coverage across different destination legs.
File summaries
File Description
scripts/carved_reach.py Resolves effective arrival data.
tests/carve_manifest/test_carve_manifest.py Tests re-destined shed resolution.
Review details
  • 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)

Copilot review of PR #1077 (comment 4031093476): the docstring still said the function answers "the row's own destination_path" after the fix routed the actual read through effective_arrival(row), so the contract text named the wrong leg/path for a re_destined row. Updated the sentence to name effective_arrival(row)'s destination_path and spell out the re_destined divergence, matching source()'s own docstring precedent at line 557. No behavior change.

Refs #1062

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

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

The implementation and targeted regression test consistently cover the reported bug.

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-ready on the lane's side, held for Brett Heap's word. Head 867965e9: MERGEABLE, 0 review threads, every check green except pytest-suite (run 35154558436), which fails exactly one test: tests/doc-health/test_modified_block_currency_self_gate.py::test_the_resolution_ordering_and_marker_classes_read_zero_over_the_real_tree. That is main's own failure at 4cef77af and fa39141c (lane openxfactory-2's #1050/#1052 collision; repair route ruled by Brett at #1050 (comment)); this PR touches scripts/carved_reach.py and one test module only, neither under doc-health. Dispositioned as pre-existing; if lane-2's repair lands first, a merge of main clears it. Refs #1062.

Lane: openxfactory-5 (openXfactory-5)

@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-17T12:06:45Z, PR #1077 into opensoft/openxFactory main

@brettheap
brettheap merged commit c6997f1 into main Sep 17, 2026
14 of 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-17T12:06:58Z, PR #1077 into opensoft/openxFactory main → merge c6997f1; Fix shed_commit_object to read effective_arrival, not raw destination

brettheap added a commit that referenced this pull request Sep 17, 2026
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]>
brettheap added a commit that referenced this pull request Sep 17, 2026
Refs #1079. module() and shed_relpath() resolve a re_destined row at effective_arrival(row) instead of the raw destination, completing the class #1077 fixed for shed_commit_object; one regression per function with a re-destined fixture row.

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 17, 2026
`#1077`'s `shed_commit_object` fix and this branch's rewrite of the same
walk are the whole conflict, and they compose: main reads
`effective_arrival(row)` so a `re_destined:` row (RULED Q6) resolves at the
leg the ruling names rather than at the raw `destination`, and this branch
added the mount tracking, `_tree_entry_absent`, `_leg_object_store` and the
store-completeness probe around that same loop. Resolved as BOTH — the loop
walks `MOUNTS[destination]`, the return answers `destination_path`, and all
three `CarveReachUnavailable` messages name `destination` rather than the
raw `row['destination']` they were written against, so a re-destined row
that cannot be read is refused about the leg it actually names.

And the SEMANTIC reconciliation the textual merge could not see, the same
one the previous merge needed: `#1077`'s new case
`test_the_exact_commit_resolver_reads_the_effective_arrival_of_a_re_destined_row`
builds four bare `.git` DIRECTORIES, not repositories, and was written
against the pre-`#1048` walk that had no completeness probe — so the real
`cat-file -e <gitlink>^{commit}` answers no and the walk refused
`CarveReachUnavailable` for an INCOMPLETE STORE at `openDox` before the case
could measure anything. `_git_ok` is stubbed exactly as `_git_object_id`
beside it already was, and for the same reason: what that case measures is
WHICH LEG the walk reaches, and git is not the question. Its assertion is
untouched, and it still leaves the original leg materialized on purpose so
that a resolver reading the raw `destination` answers wrongly rather than
raising.

Lane: openxfactory-2
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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