name: submodule-update description: Use when a task changes ms-core or the top-level repository must point at a new ms-core commit, especially for coordinated fixes spanning both repositories or when the correct submodule commit and push order matters.
Submodule Update
Overview
Handle coordinated changes between the top-level toolkit repository and ms-core/ without leaving the repositories out of sync. Use this skill whenever ms-core code is modified or the submodule pointer needs to advance safely.
This skill covers both:
- commit/push ordering while developing
- PR/merge ordering while landing stacked submodule work
For test selection and verification scope, read the repo root's
docs/TESTING.md first.
When To Use
Use this skill when:
- files under
ms-core/are edited - a top-level change depends on new behavior in
ms-core - the user asks to commit or push submodule work
- the correct push order matters
- the user asks to open, review, merge, or land a branch that updates
ms-core
Do not use this skill for top-level-only changes.
Workflow
- Inspect both repositories before editing.
- top-level
git status git -C ms-core status
- top-level
- Treat
ms-coreas its own repository.- create or use the appropriate branch inside
ms-core - make and verify the
ms-corechange there first
- create or use the appropriate branch inside
- Commit the
ms-corechange inside the submodule repository. - Push the
ms-corebranch or target branch before touching the top-level pointer commit. - Return to the top-level repo.
- Update the submodule pointer with
git add ms-core. - Stage any top-level files that depend on the new submodule state.
- Run the relevant top-level verification command with
PYTHONPATH=ms-core/src. - Commit the top-level repo change.
- Push the top-level repo only after the submodule commit is already reachable remotely.
PR And Merge Workflow
When a branch updates the ms-core pointer, landing has a strict order:
- Open the
ms-corePR first. - Open the top-level toolkit PR second.
- Before merging the top-level PR, verify the top-level
ms-corepointer SHA is already contained in thems-coretarget branch. - If the
ms-corePR is stacked on anotherms-corePR, merge or rebase the lower stack first. - Merge the
ms-corePR. - Update or confirm the top-level PR points at the landed
ms-coreSHA. - Merge the top-level toolkit PR last.
Use this check from the top-level repo before merging the toolkit PR:
$coreSha = git rev-parse HEAD:ms-core
Push-Location ms-core
git fetch origin
git merge-base --is-ancestor $coreSha origin/master
$isLanded = $LASTEXITCODE -eq 0
Pop-Location
if (-not $isLanded) { throw "Block merge: top-level ms-core pointer is not on ms-core origin/master" }
If this check fails, do not merge the top-level PR. Land the ms-core stack first, then refresh the top-level pointer if needed.
Hard Rules
- Never leave a top-level commit pointing at an unpushed
ms-corecommit. - Never describe a coordinated change as complete if only one repository was pushed.
- Never merge a top-level PR whose
ms-corepointer is not already reachable from thems-coretarget branch. - Never merge the toolkit PR before the
ms-corePR stack it depends on has landed. - If
gitreports safe-directory or auth issues insidems-core, report the exact blocker and stop. - When the user asks for one commit "for everything", remember that
ms-corestill needs its own commit first.
Verification
For top-level validation, prefer:
$env:PYTHONPATH='ms-core/src'
python -m pytest tests/ -v --tb=short -x
For submodule coordination, confirm:
git -C ms-core rev-parse --short HEAD- top-level
git diff --submodule - remote push status for both repositories
git merge-base --is-ancestor <top-level-ms-core-sha> origin/masterfrom insidems-core
Reference Files
- For exact command order and common failure cases, read:
references/ms-core-sequence.md
Output
When reporting status, separate:
ms-corecommit SHA and push state- top-level commit SHA and push state
- whether the top-level repo now points at the intended submodule commit
- whether the
ms-corepointer has landed on thems-coretarget branch before toolkit merge