Repository navigation
update-shape.py: the no-shape refusal names the kind's manifest validator - #52
Conversation
…ator On a family root the "no `shape:` block" remediation sent the operator to validate-manifest.py, which a family root does not carry; its validator is validate-family.py. Kind now names its manifest validator and the refusal (and rewrite_manifest's docstring) use it. Test: the refusal names validate-family.py on a family root and validate-manifest.py on a project root. Closes #48 Lane: xFactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
There was a problem hiding this comment.
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 19 hours and 6 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThe PR replaces the hard-coded no-shape remediation with an explicit validator configured per root kind, updates the related documentation, and adds project/family regression tests confirming correct messaging and refusal atomicity. Sequence diagram for kind-specific no-shape refusalsequenceDiagram
actor Operator
participant UpdateShape as update-shape.py
participant Kind
participant Manifest
Operator->>UpdateShape: run_script(UPDATE, apply, ...)
UpdateShape->>Kind: root_kind(root)
UpdateShape->>Manifest: rewrite_manifest(text, commit, tree, kind)
alt shape block absent
Manifest-->>UpdateShape: Refusal(update-manifest-no-shape)
UpdateShape-->>Operator: stderr names kind.manifest_validator
UpdateShape-->>Operator: no files written
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, correct per the issue description, and is covered by new targeted tests for both root kinds.
Pull request overview
This PR fixes a misleading update-shape.py apply refusal remediation message when a root manifest lacks a shape: block by making the remediation name the correct kind-specific manifest validator (project vs family), and updates tests to lock in the behavior.
Changes:
- Add an explicit
manifest_validatorattribute toKind, set appropriately forPROJECT_KINDandFAMILY_KIND. - Update
rewrite_manifestdocstring and theupdate-manifest-no-shaperefusal remediation to reference the kind’s validator name. - Add project and family tests asserting the correct validator is named and that a refused apply does not modify
contracts/shape-pin.yaml.
File summaries
| File | Description |
|---|---|
| update-shape.py | Adds Kind.manifest_validator and uses it for no-shape: remediation text and docstring wording. |
| tests/test_update_shape.py | Adds a helper to strip shape: and a project-root test asserting remediation names validate-manifest.py. |
| tests/test_family.py | Imports the shared helper and adds a family-root test asserting remediation names validate-family.py. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
(lane xFactory-1, 2026-09-05T18:48:50Z) LANDED — squash |



Lane: xfactory-1 (xFactory-1)
Claim: #48 (comment)
Closes #48
What
rewrite_manifest'supdate-manifest-no-shaperefusal (raised when the root'smanifest has no
shape:block) hard-coded its remediation to namevalidate-manifest.py. On a FAMILY root that script does not exist — thefamily validator is
scripts/validate-family.py— so the remediation sentthe operator to the wrong tool.
rewrite_manifest's docstring had the sameproject-specific assumption baked in.
Fix shape chosen: an explicit
manifest_validator: strattribute onKind(the "preferred shape" from the issue), rather than falling back to
kind.validators[-1].Kindhas exactly two construction sites(
PROJECT_KIND,FAMILY_KIND), so the attribute adds one argument to eachwith no ripple elsewhere. It is set to
"scripts/validate-manifest.py"forPROJECT_KINDand"scripts/validate-family.py"forFAMILY_KIND, and therefusal now reads
f"Remediation: \{Path(kind.manifest_validator).name}`requires one; add it, or re-scaffold."
The docstring at the top ofrewrite_manifestnow reads "The two fields the kind's manifest validator checks, insideshape:`."Changed lines:
update-shape.py— theKind.__init__signature and bothKind(...)construction call sites (PROJECT_KIND,FAMILY_KIND), therewrite_manifestdocstring, and theupdate-manifest-no-shaperemediationstring.
Tests
Added one test per kind, following the existing
Refusal-assertion pattern(
run_script(UPDATE, "apply", …), then assert onreturncodeandresult.stderr) already used throughouttests/test_update_shape.pyandtests/test_family.py:tests/test_update_shape.py::test_apply_with_no_shape_block_names_this_kinds_own_manifest_validator— on a PROJECT fixture with the
shape:block stripped fromproject.yaml,applyrefuses with codeupdate-manifest-no-shape, the remediation namesvalidate-manifest.py, and does not namevalidate-family.py.tests/test_family.py::test_update_shape_with_no_shape_block_names_the_family_validator— the mirror case on a FAMILY fixture with
shape:stripped fromfamily.yaml: the remediation namesvalidate-family.pyand notvalidate-manifest.py.Both also assert the refused apply left
contracts/shape-pin.yamluntouched(the established "a refused apply writes nothing at all" invariant). The
strip_shape_blockhelper lives intests/test_update_shape.pyand isimported into
tests/test_family.py, matching the existing cross-file importprecedent (
test_neutral_pin_validator.pyimporting fromtest_scaffold_pin_and_reuse.py).Full suite:
python3 -m pytest tests -q→ 498 passed (496 baseline + 2new tests).
🤖 Generated with Claude Code
https://claude.ai/code/session_015WekBEXf55Xv64psGe5t3T
Summary by Sourcery
Use each root kind’s own manifest validator when explaining how to fix manifests without a shape block.
Bug Fixes:
Enhancements:
Tests: