Skip to content

fix(sync): include sync-tooling files in $script:UpstreamManagedPaths#113

Open
MarkMichaelis wants to merge 1 commit into
mainfrom
fix/112-managed-paths
Open

fix(sync): include sync-tooling files in $script:UpstreamManagedPaths#113
MarkMichaelis wants to merge 1 commit into
mainfrom
fix/112-managed-paths

Conversation

@MarkMichaelis

Copy link
Copy Markdown
Contributor

Summary

Adds Pull-SDLC.ai.ps1, Pull-SDLC.ai.Tests.ps1, Cleanup-Worktree.ps1, and sync-manifest.json to \ so the diff-replay sync picks them up.

Without this, Invoke-SelfRefresh writes new bytes to Pull-SDLC.ai.ps1 on every run, but the sync mechanism never commits them -- consumers see a persistent M Pull-SDLC.ai.ps1 in their working tree and must hand-craft a chore(sync) commit each time the upstream script advances. This gap has recurred on the consumer side (e.g. MarkMichaelis/CodiwomplerSocialMedia#326, #331).

sync-manifest.json already lists these paths as the intended managed set, but the script never reads the manifest -- the hardcoded array is the actual source of truth and was out of sync. This PR is the minimal patch to bring them back in sync. A full refactor to load sync-manifest.json at runtime is left for a follow-up.

Tests

New Describe 'Test-IsUpstreamManagedPath -- self-managing sync tooling (#112)' block:

  • 4 failing-before-fix assertions for the added paths.
  • 3 baseline assertions (existing CLAUDE.md still managed, README.md still always-local-trumps-managed, unrelated repo file still \False).

All 73 tests pass after the change. Each new assertion was first observed failing on Should -BeTrue with Expected \True, but got \False before the constant was updated -- no compile-error collusion.

\\powershell
Invoke-Pester -Path .\Pull-SDLC.ai.Tests.ps1

Tests Passed: 73, Failed: 0

\\

Out of scope

  • Loading sync-manifest.json at runtime as single source of truth.
  • Wildcard / glob support in \.

Closes #112

Adds Pull-SDLC.ai.ps1, Pull-SDLC.ai.Tests.ps1, Cleanup-Worktree.ps1, and
sync-manifest.json to the upstream-managed path list so the diff-replay
sync picks them up. Without this, the script self-updates on every run
(via Invoke-SelfRefresh) but the new bytes are never committed by the
sync mechanism -- consumers see a persistent `M Pull-SDLC.ai.ps1` in
`git status` and must hand-craft a chore(sync) commit each time
upstream advances. Same gap surfaced repeatedly in consumer repos
(e.g. MarkMichaelis/CodiwomplerSocialMedia#326, #331).

sync-manifest.json already listed these paths as the intended managed
set; this brings the hardcoded constant in line with the manifest. A
full refactor to read sync-manifest.json at runtime (single source of
truth) is left for a follow-up.

Tests (Pester):

- New `Describe 'Test-IsUpstreamManagedPath'` block asserts the four
  added paths return $true, that always-local README.md still trumps
  managed, and that unrelated repo files return $false.
- Existing 66 tests continue to pass.

Closes #112

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

Adds the sync-tooling files themselves (Pull-SDLC.ai.ps1, Pull-SDLC.ai.Tests.ps1, Cleanup-Worktree.ps1, sync-manifest.json) to the hardcoded $script:UpstreamManagedPaths array so the diff-replay sync commits upstream advancements rather than leaving them as uncommitted working-tree changes on consumers.

Changes:

  • Extend $script:UpstreamManagedPaths with the four sync-tooling paths.
  • Add a Pester Describe block with 7 assertions covering the new managed paths and baseline behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Pull-SDLC.ai.ps1 Adds the four sync-tooling paths to the managed-paths array.
Pull-SDLC.ai.Tests.ps1 Adds Pester coverage for the new managed paths plus baseline preservation tests.

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.

fix(sync): add Pull-SDLC.ai.ps1 (and siblings) to $script:UpstreamManagedPaths so sync self-commits

2 participants