Skip to content

feat(init): adopt existing remote stackr metadata instead of initializing fresh - #41

Open
amustafa wants to merge 1 commit into
am/pull-meta-bootstrapfrom
am/init-adopt-remote-meta
Open

feat(init): adopt existing remote stackr metadata instead of initializing fresh#41
amustafa wants to merge 1 commit into
am/pull-meta-bootstrapfrom
am/init-adopt-remote-meta

Conversation

@amustafa

Copy link
Copy Markdown
Owner

What

sr init in a clone whose remote already holds stackr metadata now adopts that shared state instead of creating blank local state.

Why

Creating blank state in a second clone silently shadows the shared graph: two clones then disagree about the stack, and the first push-meta from the blank one clobbers or forks the shared metadata. Init is the natural first command a new clone runs, so it should notice the metadata and do the right thing.

How

  • Before initializing fresh, runInit probes each remote for the stackr metadata ref (new Runner.RemoteHasRef, an ls-remote — unlike RemoteBranchExists it needs no prior fetch, since custom refs are never fetched by default). On a hit it announces the adoption and delegates to engine.PullMeta.
  • Best-effort by design: an unreachable remote is treated as one without metadata, so offline sr init still works.
  • --reset keeps meaning "start over deliberately" and skips the adoption probe.

Stacked on the pull-meta bootstrap PR, whose semantics this relies on.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 67dc8556-69f0-47f7-b122-8ac10977b7c1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amustafa
amustafa force-pushed the am/init-adopt-remote-meta branch from 34e9a12 to 64819b2 Compare August 18, 2026 18:34
@amustafa amustafa closed this Aug 19, 2026
@amustafa
amustafa force-pushed the am/init-adopt-remote-meta branch from 64819b2 to 0d57b0d Compare August 19, 2026 14:56
@amustafa amustafa reopened this Aug 19, 2026
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