Skip to content

feat: report pending upstream template updates - #42

Merged
levelupself merged 4 commits into
mainfrom
fm/062-updatefirstmate-upstream-tracking
Aug 13, 2026
Merged

levelupself merged 4 commits into
mainfrom
fm/062-updatefirstmate-upstream-tracking

Conversation

@levelupself

@levelupself levelupself commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Intent

Teach the self-update path to report upstream template changes alongside fork-origin updates. Upstream catch-ups remain roughly monthly or event-driven, never weekly: trigger when upstream lands a needed fix or capability, when a resolution session materially exceeds 28 files, or immediately before offering work upstream. Observation limits must be explicit rather than implying continuous monitoring, semantic need detection, or conflict prediction. Upstream offers remain opportunistic, with no scheduled outbound pull requests. Every catch-up remains a separate reviewed merge commit; no reset, main rebase, force-push, fork-commit discard, or prefer-theirs conflict pass is permitted. Running homes advance fast-forward only, and nothing under projects/ is touched. This change observes upstream but does not perform the held catch-up merge.

What changed

  • Observe an optional upstream template remote during self-update and report pending commits, changed files, fetch movement, the latest pending subject, and the latest identifiable catch-up date without merging or moving homes.
  • Resolve the upstream default branch from the live remote symref, refresh the local observation baseline after branch renames, and fetch only into remote-tracking refs even under hostile configured refspecs.
  • Preserve fast-forward-only updates from origin, disclose missing or failed observation coverage, document the separate merge-commit catch-up workflow, and add executable regression coverage.

Risk assessment

Medium. Network-sourced default-branch and refspec behavior could violate observation-only guarantees. Review fixes pin fetches to remote-tracking refs and resolve and refresh the live remote symref. Red-first execution occurred before implementation; same-commit coverage was explicitly accepted without rewriting published history.

Testing

  • bash tests/fm-update.test.sh
  • Disposable Git end-to-end observation scenario with fork-only history, a project-state sentinel, and a pending upstream commit
  • bin/fm-lint.sh
  • Changed-file-selected local suite: 34 scripts passed, with two expected optional-tool skips

The end-to-end observation left the fork checkout unchanged, retained the fork-only commit and project-state sentinel, reported the pending upstream commit, and created no merge commit.

Red-first evidence

The behavioral test was executed before the implementation existed. Its verbatim failing output was:

FM_TEST_BEGIN 2026-08-11T04:08:43Z tests/fm-update.test.sh family=session-bootstrap expected_gate_skip=none
ok - T1 main + secondmate fast-forward (single-parent), reread + nudge signalled
ok - T3 reread gates on instruction surface, nudge on advancement
ok - T4 dirty secondmate skipped, local edit preserved
ok - T5 diverged secondmate skipped, local commit preserved
ok - T6 idempotent: a second run is a no-op
ok - T7 registry backstop resolves, dedups meta+registry, excludes the firstmate repo
ok - T9 firstmate off its default branch is skipped, not forced
ok - T10 firstmate detached HEAD is skipped
ok - T11 unsafe secondmate home is not fast-forwarded
not ok - pending upstream template work is observable (missing: 'upstream-template: pending 1 commit from upstream/main (1 changed file); changed-since-last-check: yes')
--- output ---
firstmate: already current
secondmate sm1: already current
reread-firstmate: no
nudge-secondmates: none
FM_TEST_END 2026-08-11T04:08:50Z tests/fm-update.test.sh exit=1 duration_ms=7144 gate_skip=false
FM_TEST_SUMMARY total=1 failed=1 skipped_gate=0 duration_ms=7202
FM_TEST_SUMMARY_FAMILY family=session-bootstrap count=1 duration_ms=7144 failed=1
FM_TEST_SLOWEST rank=1 script=tests/fm-update.test.sh duration_ms=7144

Pipeline

Updates from git push no-mistakes.

Part of PSY-54

@levelupself
levelupself merged commit 05ba786 into main Aug 13, 2026
16 checks passed
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.

2 participants