From 5b7477dfa8fac6a3c0ffde6a6d0f210e495398f0 Mon Sep 17 00:00:00 2001 From: matamune Date: Sat, 16 May 2026 03:37:25 +0000 Subject: [PATCH] Add explicit patch.moi harness submodules --- .gitmodules | 8 +++ harness/README.md | 142 ++++++++++++++++++++++++++++++++++++++++++++++ harness/fork | 1 + harness/upstream | 1 + 4 files changed, 152 insertions(+) create mode 100644 .gitmodules create mode 100644 harness/README.md create mode 160000 harness/fork create mode 160000 harness/upstream diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..28d3799 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "harness/upstream"] + path = harness/upstream + url = https://github.com/peezy-tech/patch-moi-harness.git + branch = main +[submodule "harness/fork"] + path = harness/fork + url = https://github.com/matamune-peezy/patch-moi-harness.git + branch = main diff --git a/harness/README.md b/harness/README.md new file mode 100644 index 0000000..eb118a5 --- /dev/null +++ b/harness/README.md @@ -0,0 +1,142 @@ +# patch.moi Harnesses + +This directory holds small, real repositories used to exercise patch.moi +against upstream/fork maintenance flows. + +## Layout + +- `upstream`: the public upstream GitHub repository. +- `fork`: a local maintained fork, cloned from a real GitHub fork. + +The upstream repository is: + +```text +https://github.com/peezy-tech/patch-moi-harness.git +``` + +The fork repository is: + +```text +https://github.com/matamune-peezy/patch-moi-harness.git +``` + +The fork should also know about the upstream and jojo remotes: + +```bash +git -C harness/fork remote get-url upstream >/dev/null 2>&1 || \ + git -C harness/fork remote add upstream https://github.com/peezy-tech/patch-moi-harness.git +git -C harness/fork remote get-url jojo >/dev/null 2>&1 || \ + git -C harness/fork remote add jojo git@jojo.build:peezy-tech/patch-moi-harness.git +git -C harness/fork fetch upstream +git -C harness/fork fetch jojo +``` + +## Branch Model + +- `harness/upstream` `main`: upstream package history and upstream releases. +- `harness/fork` `upstream/main`: fetched copy of upstream `main`. +- `harness/fork` `main`: maintained fork with patch commits applied. +- `harness/fork` `jojo/main`: service-style maintained fork remote. + +The upstream npm package is `@peezy.tech/patch-moi-harness`. It publishes from +GitHub tags named `v*` through the `npm-publish` GitHub environment. + +The fork npm package is `@peezy.tech/patch-moi-harness-fork`. It is configured +to publish from GitHub fork tags named `fork-v*` through the same +`npm-publish` environment, once the npm trusted publisher exists for the fork +package. + +## Scenario: Upstream Release + +Use this when you want to simulate upstream changing and publishing a new +release. + +```bash +cd harness/upstream +npm version patch --no-git-tag-version +npm test +git add package.json package-lock.json +git commit -m "Release 0.1.4" +git tag v0.1.4 +git push origin main v0.1.4 +``` + +Expected result: GitHub Actions publishes the upstream package to npm with +trusted publishing. + +## Scenario: Fork Feature Patch + +Use this when you want to simulate local feature development on top of +upstream. + +```bash +cd harness/fork +git fetch upstream +git checkout main +npm test +# edit source files +git add . +git commit -m "Add local fork feature" +git push origin main +git push jojo main +``` + +Expected result: the GitHub fork and jojo maintained branch both move ahead of +the last upstream commit. + +## Scenario: Rebase Fork Onto Upstream + +Use this when upstream has released and the maintained fork needs to carry its +patches forward. + +```bash +cd harness/fork +git fetch upstream +git fetch origin +git checkout main +git rebase upstream/main +npm test +git push --force-with-lease origin main +git push --force-with-lease jojo main +``` + +Expected result: fork `main` is still patched, but its base is the latest +upstream release. + +## Scenario: Fork Release + +Use this when the maintained fork should do its own release cycle. + +```bash +cd harness/fork +npm version prerelease --preid fork --no-git-tag-version +npm test +git add package.json package-lock.json +git commit -m "Release fork package" +version=$(node -p "require('./package.json').version") +git tag "fork-v${version}" +git push origin main "fork-v${version}" +git push jojo main +``` + +Expected result: GitHub Actions in the fork publishes +`@peezy.tech/patch-moi-harness-fork`, provided npm has a trusted publisher for +`matamune-peezy/patch-moi-harness`, workflow `publish.yml`, environment +`npm-publish`. + +## Scenario: Remote-Only Service + +Use this when testing patch.moi service behavior without relying on local +working trees. + +```text +upstream repo: https://github.com/peezy-tech/patch-moi-harness.git +upstream branch: main +fork repo: https://github.com/matamune-peezy/patch-moi-harness.git +fork branch: main +service mirror: git@jojo.build:peezy-tech/patch-moi-harness.git +service branch: main +``` + +Expected result: patch.moi can reason from remote refs alone, then create a +workspace only when it needs to apply or validate the patch stack. diff --git a/harness/fork b/harness/fork new file mode 160000 index 0000000..9fd9d8c --- /dev/null +++ b/harness/fork @@ -0,0 +1 @@ +Subproject commit 9fd9d8c31a004059e16f769453d75afba29959be diff --git a/harness/upstream b/harness/upstream new file mode 160000 index 0000000..772bdd6 --- /dev/null +++ b/harness/upstream @@ -0,0 +1 @@ +Subproject commit 772bdd62c6031302b57b175e428110fa51671861