LearnNewsExamplesServices
Frontmatter
id12852
titleSession-sunset Step 1: pull + regen config for non-worktree clones
stateClosed
labels
documentationenhancementaimodel-experience
assignees[]
createdAtJun 10, 2026, 8:43 PM
updatedAtJun 10, 2026, 9:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/12852
authorneo-opus-vega
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 10, 2026, 9:05 PM

Session-sunset Step 1: pull + regen config for non-worktree clones

Closed v13.0.0/archive-v13-0-0-chunk-17 documentationenhancementaimodel-experience
neo-opus-vega
neo-opus-vega commented on Jun 10, 2026, 8:43 PM

Context

@tobiu surfaced (2026-06-10 nightshift kickoff): the swarm's local clones drift stale — agents aren't refreshing to dev + pulling + regenerating config at session end. The named remediation: switch to dev (not inside a worktree) → pull → update config files via ai/scripts/setup/initServerConfigs.mjs.

Live latest-open sweep: checked the latest 60 open issues at 2026-06-10T18:38Z; no equivalent found (#12808 is worktree BOOTSTRAP_CONFIGS, distinct; #10063 is the memory-persist hook, distinct).

The Problem

/session-sunset does have a Pre-Sunset Pull (Step 1), but V-B-A against the live workflow shows it is harness-binary-stale and config-incomplete:

  1. Harness model is outdated (branches on model-family, not topology). Step 1 splits "Shared Checkout (Antigravity/Gemini)" vs "Isolated Worktree (Claude Code)" and tells Claude Code agents to NOT checkout dev ("would conflict with the main checkout"). But the Claude peers now run in independent full clones (e.g. the opus-vega clone — git rev-parse --git-dir.git, a main clone, not a linked worktree). There the correct action is the Shared-Checkout path (checkout dev + pull) — but the protocol routes Claude agents away from it → their clones never pull devstale clones (the exact friction observed).
  2. Pull without config-regen. The Shared-Checkout branch runs only git checkout dev && git pull origin dev — no config regeneration. initServerConfigs.mjs --migrate-config appears only in the operator-facing primary-staleness handover block (worktree case), never as an agent action in the non-worktree path. So an agent that pulls still leaves the gitignored config.mjs operator-overlay stale → daemons (wake-daemon, orchestrator-daemon, DreamService, KB sync) run fresh code against stale config. The block itself states: "A git pull alone is not enough."

The Architectural Reality (V-B-A'd against dev)

  • .agents/skills/session-sunset/references/session-sunset-workflow.md §Step 1 — the binary Shared Checkout (Antigravity/Gemini) vs Isolated Worktree (Claude Code) discriminator; the agent-facing Shared-Checkout command omits config-regen.
  • Same file, Primary-Checkout Staleness Probe block (per #11013) — the ONLY place initServerConfigs.mjs --migrate-config is named, and only as operator-facing handover prose, not an agent action.
  • ai/scripts/setup/initServerConfigs.mjs — canonical config bootstrap; --migrate-config reconciles the gitignored config.mjs to new config.template.mjs leaves (runs at npm prepare). Pure git pull updates the committed template, not the operator overlay the daemons read.
  • Topology anchor: the discriminator should be "am I in a linked worktree?" (git rev-parse --git-common-dir / --show-toplevel) — not model family. Worktree → don't checkout dev (push branch); main/independent clone → checkout dev + pull + regen config.

The Fix

Rewrite Step 1 of session-sunset-workflow.md to branch on working-tree topology, not model family:

  • Linked worktree (current "Isolated Worktree" guidance): unchanged — do NOT checkout dev; commit + push the branch; keep the primary-staleness probe handover block.
  • Main / independent clone (covers Antigravity, Gemini, AND Claude-in-independent-clone): git checkout dev && git pull --ff-only origin dev then node ai/scripts/setup/initServerConfigs.mjs --migrate-config as an explicit agent action (not just an operator handover note). Pair the two inseparably; carry the "pull alone is not enough" rationale to the new site.
  • Keep the change inside the referenced workflow payload (World Atlas), not the top-level SKILL.md router (Progressive Disclosure — .agents/skills/create-skill/).

Decision Record impact

none — no ADR governs sunset Step 1; it embodies the "next session boots on fresh infrastructure" principle. Adjacent: #11013 (staleness-probe origin), #11009 (post-extraction Orchestrator.mjs will own a daemon-driven primary-dev-sync auto-pull that eventually obsoletes the manual step — the sunset condition for this guidance).

Acceptance Criteria

  • Step 1 discriminates on worktree-vs-main-clone topology (git rev-parse --git-common-dir / --show-toplevel), not on model family.
  • The main/independent-clone path includes config-regen (node ai/scripts/setup/initServerConfigs.mjs --migrate-config) as an explicit agent action, paired with the dev pull.
  • The "pull alone is not enough" rationale is retained at the new agent-action site (not only in the operator handover block).
  • Linked-worktree guidance (don't-checkout-dev + push + primary-staleness probe) is preserved.
  • Change stays in references/session-sunset-workflow.md (payload), not the SKILL.md router; net loaded-bytes accounted for per the substrate-accretion defense.

Out of Scope

  • Daemon-driven auto-sync (primary-dev-sync periodic task in Orchestrator.mjs) — tracked under the #11013/#11009 follow-up; this fixes the manual sunset step only.
  • The #12849 wake-cursor flood (operationally adjacent — stale config can co-occur with the restart wave — but a distinct delivery-reliability bug).
  • Any code change to initServerConfigs.mjs itself (already supports --migrate-config).

Avoided Traps

  • Asserting sunset has NO repo-refresh step. It does (Step 1) — the defect is harness-binary staleness + config-regen omission, not absence (initial framing corrected by reading the live workflow — V-B-A).
  • Discriminating by model family. The durable axis is working-tree topology; model-family branching is what stranded the independent-clone case.
  • Pull-only. Config regen is load-bearing — daemons read the gitignored overlay; git pull alone leaves them on stale config.

Related

  • #11013 — primary-checkout staleness probe (introduced the config-regen remediation, operator-facing only)
  • #11009 — Orchestrator.mjs extraction → future daemon-driven auto-sync
  • #12849 — wake-daemon corrupt-cursor flood (operationally adjacent restart-wave context)

Handoff Retrieval Hint: semantic — "session-sunset Step 1 harness-binary staleness independent clone config regen"; structural — .agents/skills/session-sunset/references/session-sunset-workflow.md Step 1. Origin: 2026-06-10 nightshift kickoff, @neo-opus-vega.

Authored by @neo-opus-vega (Claude Opus 4.8).