Skip to content

update-shape.py: the apply commit names the root's manifest, not project.yaml - #47

Merged
brettheap merged 1 commit into
mainfrom
fix/family-root-commit-message
Sep 5, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/family-root-commit-message

Conversation

@brettheap

@brettheap brettheap commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Lane: xfactory-1 (xFactory-1)
Claim: #44 (comment)

Closes #44

What

update-shape.py apply writes one commit per root via commit_on_branch.
On a FAMILY root (holder carrying family.yaml, no project.yaml), the
pin is correctly mirrored into family.yaml, but the commit message still
hard-coded "project.yaml's \shape:` block now record "`, naming a
file the root does not have.

Fix: commit_on_branch now takes the root's Kind (already computed by
prepare()/cmd_apply) and writes {kind.manifest}'s \shape:` blockin the message.cmd_apply's existing call site passes kind through (update-shape.py:1124`).

While tracing this, rewrite_manifest's two Refusal messages
(update-shape.py:781, 804) turned out to have the same defect: the
function is called generically at update-shape.py:1101 with
manifest_path = root / kind.manifest, so it runs on family roots too, and
its "no shape: block" / "block has N lines" refusals also hard-coded
project.yaml. Threaded kind: Kind into rewrite_manifest and its call
site the same way.

Not changed

  • update-shape.py:1170 and :1181 (inside open_pull_request) are
    project-only by construction — they sit behind the else branch of
    if kind is FAMILY_KIND, which reads project.yaml's legs: to find a
    repository to open a PR against; a family has no legs, so this branch
    never runs for a family root. Left alone as instructed.
  • Did not touch the "Remediation: validate-manifest.py requires one"
    wording in rewrite_manifest's no-shape:-block refusal — that names the
    wrong validator for a family root too (validate-family.py is the one
    that actually requires it), but it's a separate defect from the
    project.yaml spelling this issue is about, so left it out of scope for
    this PR.
  • The module docstring (update-shape.py:10, :25) narrates the original
    2026-09-03 incident, which genuinely was a project.yaml case; left as
    historical narrative, not user-facing tool output.

Tests

Extended tests/test_update_shape_add.py::test_a_family_holder_takes_its_own_addition
to apply with --branch and assert the resulting commit message (read via
git log -1 --format=%B, matching the existing test style) contains
family.yaml and does not contain project.yaml.

Added a cheap companion assertion to the existing project-root branch test
tests/test_update_shape.py::test_apply_on_a_branch_commits_only_what_it_wrote
confirming a PROJECT root's commit message still names project.yaml.

python3 -m pytest tests -q from the clone root: 496 passed (0 failed).

🤖 Generated with Claude Code

https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T

Summary by Sourcery

Ensure update-shape reports the correct manifest name for each root kind when rewriting manifests and creating apply commits.

Bug Fixes:

  • Use the root's actual manifest name in update-shape apply commit messages and manifest-related refusal messages, including family roots that use family.yaml.

Tests:

  • Verify family-root commits mention family.yaml rather than project.yaml, while preserving project-root commit messaging.

…ect.yaml

On a family root the commit message said "project.yaml's `shape:` block"
though the pin was mirrored into family.yaml. commit_on_branch now takes
the root's Kind and names kind.manifest. Test: a family-root apply's
commit message names family.yaml and not project.yaml.

Closes #44

Lane: xFactory-1
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Copilot AI lite review requested due to automatic review settings September 5, 2026 17:28

@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 20 hours and 24 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update update-shape.py to derive commit and refusal messaging from the root's Kind, correctly naming family.yaml for FAMILY roots while preserving project.yaml behavior for PROJECT roots, with regression tests covering both cases.

Sequence diagram for kind-specific shape update and commit messaging

sequenceDiagram
    participant Apply as cmd_apply
    participant Rewrite as rewrite_manifest
    participant Commit as commit_on_branch
    participant Git as Git

    Apply->>Rewrite: rewrite_manifest(text, commit, tree, kind)
    Rewrite-->>Apply: updated manifest or Refusal using kind.manifest
    Apply->>Commit: commit_on_branch(root, branch, paths, target, upstream, count, kind)
    Commit->>Git: git commit
    Git-->>Commit: commit message names kind.manifest
    Commit-->>Apply: committed branch update
Loading

File-Level Changes

Change Details Files
Make manifest-related commit and refusal messages reflect the root kind instead of assuming project.yaml.
  • Pass Kind into rewrite_manifest and interpolate kind.manifest in shape-block refusal messages.
  • Pass Kind into commit_on_branch and use kind.manifest in the generated commit subject/body.
  • Thread the already-computed kind through both apply call sites while leaving intentionally project-only PR logic unchanged.
update-shape.py
Add regression coverage for manifest-specific commit messages while preserving project-root behavior.
  • Run the family-holder apply test on a branch and assert its commit names family.yaml without project.yaml.
  • Assert the existing project-root branch commit still names project.yaml.
tests/test_update_shape_add.py
tests/test_update_shape.py

Assessment against linked issues

Issue Objective Addressed Explanation
#44 Update update-shape.py apply commit messages to name the root's actual manifest (family.yaml for family roots and project.yaml for project roots) instead of always referring to project.yaml. ✅
#44 Ensure generic manifest-rewrite refusal messages identify the applicable manifest for family roots rather than hard-coding project.yaml. ✅
#44 Add regression coverage confirming family apply commits mention family.yaml and omit project.yaml, while preserving the project-root behavior. ✅

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@brettheap
brettheap merged commit 355f6ef into main Sep 5, 2026
4 checks passed

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.

🟡 Changes recommended

The updated rewrite_manifest refusal still hard-codes validate-manifest.py in remediation text, which is incorrect for FAMILY roots and should be made kind-aware while this area is being touched.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes update-shape.py apply to reference the correct root manifest (project.yaml vs family.yaml) in apply-commit messages and in rewrite_manifest refusal messages, aligning tool output with the root kind abstraction.

Changes:

  • Thread kind: Kind into commit_on_branch() so apply-commit messages name {kind.manifest} instead of hard-coding project.yaml.
  • Thread kind: Kind into rewrite_manifest() so refusal messages name {kind.manifest} instead of hard-coding project.yaml.
  • Extend tests to assert commit messages mention family.yaml for family roots and still mention project.yaml for project roots.
File summaries
File Description
update-shape.py Passes kind into commit/refusal message generation so messages name the correct manifest for family vs project roots.
tests/test_update_shape.py Adds assertion that project-root apply commit messages still mention project.yaml.
tests/test_update_shape_add.py Applies with --branch for a family holder and asserts the commit message mentions family.yaml and not project.yaml.
Review details
  • Files reviewed: 3/3 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 update-shape.py
Comment on lines 783 to 784
"Remediation: `validate-manifest.py` requires one; add it, or "
"re-scaffold.")
@brettheap

Copy link
Copy Markdown
Contributor Author

(lane xFactory-1, 2026-09-05T17:30:36Z) LANDED — squash 355f6ef4 on main 2026-09-05T17:30:18Z, on Brett Heap's word "merge it when green". Nothing in the shape estate needs a re-sync for this: update-shape.py is the upstream tool, not a copied shape file.

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.

update-shape.py apply: the commit message says project.yaml on a FAMILY root; it should name kind.manifest

2 participants