Repository navigation
Closed
1 / 11 of 1 issue completedClosed
1 / 11 of 1 issue completed
Copy link
Labels
area:workspaceWorkspace tooling, justfile, templateseffort:largeMore than 4 hours or multi-sessionpriority:mediumImportant but not urgentrefactorModifications that do not bring any significant change (e.g. style, reorganization)semver:minorNew feature, backward-compatible
Milestone
Description
Description
scripts/sync_manifest.py and scripts/utils.py have overlapping concerns:
sync_manifest.py— declarative manifest entries + transform classes (Sed,RemoveLines) + sync engine + CLIutils.py—sed_inplace()for sed-style substitutions,update_version_line()for README patching, and a CLI wrapper
Both define text-replacement logic independently. The manifest's Sed transform uses re.sub, while utils.py implements a custom sed-pattern parser with str.replace.
Proposed refactoring
- Extract transform classes from
sync_manifest.pyinto a newscripts/transforms.pyso they are reusable outside the sync context. - Keep manifest as declarative Python — the
MANIFESTlist stays insync_manifest.pyas Python dataclass instances (pure data, no logic). TOML/YAML conversion was evaluated and rejected: the transforms have complex parameters (multi-line replacements, regex patterns, lists) that map poorly to config formats, and the file changes rarely. Declarative Python dataclasses with behavior extracted totransforms.pyachieves the same separation-of-concerns goal. - Unify sed logic —
utils.py'ssed_inplaceand the manifest'sSedtransform both do regex/string replacement. Consolidate into one implementation. - Keep
utils.pyCLI —utils.pyis called directly by workflows (version,sedsubcommands). Its CLI interface must be preserved.
Acceptance Criteria
- No duplicate text-replacement logic between the two files
- Transform classes live in
scripts/transforms.py, separate from the manifest data and sync engine -
sync_manifest.pymanifest entries are declarative data (dataclass instances importing transforms fromtransforms.py) -
utils.pyCLI (version,sedsubcommands) continues to work unchanged -
just sync-workspaceproduces identical output before and after - All existing tests pass
Changelog Category
Changed
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
area:workspaceWorkspace tooling, justfile, templateseffort:largeMore than 4 hours or multi-sessionpriority:mediumImportant but not urgentrefactorModifications that do not bring any significant change (e.g. style, reorganization)semver:minorNew feature, backward-compatible
Activity
gerchowl commentedon Feb 20, 2026
Suggestion: Pre-commit hook to prevent asset drift
While working on #102, we hit a
test_manifest_filesfailure caused byassets/workspace/being out of sync with the canonical source files. The build pipeline (prepare-build.sh) always syncs fresh viasync_manifest.py, but the checked-inassets/workspace/drifts when someone changes a source file and forgets to runjust sync-workspace.Proposed solution
Add a scoped pre-commit hook (similar to the existing
generate-docshook) that:sync_manifest.py sync assets/workspace/when any manifest source file is stagedassets/workspace/filesThis follows the same pattern as the
generate-docshook already in.pre-commit-config.yaml:The
files:pattern would need to cover all manifest source paths (.github/pull_request_template.md,justfile.worktree,.cursor/rules/,.cursor/skills/, etc.) — ideally derived from the manifest entries themselves.Alternatives considered
assets/workspace/from git: Sinceprepare-build.shregenerates it, the checked-in copy is redundant. But this breaks "browse the template on GitHub".This fits naturally into the manifest-as-config refactor scope.
gerchowl commentedon Feb 21, 2026
Implementation Plan
Issue: #89
Branch: feature/89-consolidate-sync-manifest-utils
Tasks
Sed,RemoveLines,StripTrailingBlankLines,RemoveBlock,RemovePrecommitHooks,ReplaceBlock) —tests/test_transforms.py— verify:uv run pytest tests/test_transforms.py -v_resolvehelper fromsync_manifest.pyintoscripts/transforms.py; updatesync_manifest.pyto import from it —scripts/transforms.py,scripts/sync_manifest.py— verify:uv run pytest tests/ -v+just sync-workspacesed_inplacehandles regex patterns (new behavior) —tests/test_utils.py— verify:uv run pytest tests/test_utils.py::TestSedInplace -vsed_inplaceto usere.subinternally while preserving thes|old|new|gCLI interface —scripts/utils.py— verify:uv run pytest tests/test_utils.py -vjust sync-workspaceoutput and diff against a golden reference to prove no behavioral change —tests/test_sync_manifest.py— verify:uv run pytest tests/test_sync_manifest.py -vCHANGELOG.mdunder## Unreleased—CHANGELOG.md— verify: visual reviewNotes
conftest.py'sparse_manifestfixture continues to work since it importsMANIFESTdynamicallytransforms.pyachieves the same separation goal.test: add transforms module tests for Sed and RemoveLines
refactor: extract transform classes from sync_manifest to transforms.py
refactor: unify sed logic via substitute_in_file in utils
refactor: convert MANIFEST to declarative manifest.toml
gerchowl commentedon Feb 23, 2026
PR Diagnosis: #140
CI Failures
invalid-syntax: Expected a statementatscripts/sync_manifest.py:195:7— git merge conflict marker>>>>>>> devleft in fileReview Feedback
No pending review feedback ✓
Merge State
mergeable: UNKNOWN, mergeStateStatus: UNKNOWN
Implementation Plan
Issue: #89
Branch: feature/89-consolidate-sync-manifest-utils
Tasks
scripts/sync_manifest.py— remove conflict markers, keep declarative manifest.toml approach (lines 104–195) — verify:python -m py_compile scripts/sync_manifest.pyCHANGELOG.md— merge both sides: keep [REFACTOR] Consolidate sync_manifest.py and utils.py into manifest-as-config architecture #89 entry from feature branch, add [FEATURE] Expand justfile.base with devcontainer, quality, security, docs, info, and git recipes #71 and [FEATURE] Autonomous PR skill should use .github/pull_request_template.md #147 entries from dev — verify:head -50 CHANGELOG.mdshows no conflict markersjustfile.baseentry toscripts/manifest.toml(present in dev, missing in current manifest) — verify:uv run python scripts/sync_manifest.py listincludes justfile.basejust precommitandjust testpassAutonomous Run Complete
9138d28fix: resolve merge conflicts in sync_manifest and CHANGELOGfix: resolve merge conflicts in sync_manifest and CHANGELOG
refactor: consolidate sync_manifest.py and utils.py into manifest-as-…
chore: release 0.3.0 (#270)