gate: run clean inside a linked git worktree #580

Open
opened 2026-09-22 17:10:22 +00:00 by hexajon · 0 comments
Owner

Context

madtea manages linked git worktrees natively through its worktree command,
but scripts/gate.sh has only ever run in the primary checkout. The gate must
produce the same result inside a linked worktree. The repo self-hosts, so its
own gate must be worktree-clean.

What

Run the full gate inside a linked git worktree. Fix any failure that comes from
the worktree layout rather than from branch content. Known seams to check:

  • In a linked worktree, .git is a file (a gitdir pointer), not a directory.
    Any [ -d .git ] test or path arithmetic on it breaks.
  • conformance/mcp-client/node_modules is absent in a fresh worktree; prime it
    with npm ci. If mcp-conformance.sh hardcodes paths relative to the primary
    checkout, it still breaks.
  • repoRoot walk-ups in tests (danglingref, docs tooling) look for go.mod;
    expected to work.
  • gen-third-party-licenses.sh snapshots and restores go.sum in the current
    directory; per-worktree, expected to work.
  • Two gates that share the Go module and build caches (locked, content
    addressed); watch for flakes.

Acceptance

  • The gate completes inside a linked git worktree with results attributable
    only to branch content.
  • Any layout-sensitivity found is fixed and gated. The gate header comment then
    documents worktree compatibility.
## Context madtea manages linked git worktrees natively through its `worktree` command, but `scripts/gate.sh` has only ever run in the primary checkout. The gate must produce the same result inside a linked worktree. The repo self-hosts, so its own gate must be worktree-clean. ## What Run the full gate inside a linked git worktree. Fix any failure that comes from the worktree layout rather than from branch content. Known seams to check: - In a linked worktree, `.git` is a file (a gitdir pointer), not a directory. Any `[ -d .git ]` test or path arithmetic on it breaks. - `conformance/mcp-client/node_modules` is absent in a fresh worktree; prime it with `npm ci`. If mcp-conformance.sh hardcodes paths relative to the primary checkout, it still breaks. - repoRoot walk-ups in tests (danglingref, docs tooling) look for go.mod; expected to work. - gen-third-party-licenses.sh snapshots and restores go.sum in the current directory; per-worktree, expected to work. - Two gates that share the Go module and build caches (locked, content addressed); watch for flakes. ## Acceptance - The gate completes inside a linked git worktree with results attributable only to branch content. - Any layout-sensitivity found is fixed and gated. The gate header comment then documents worktree compatibility.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#580
No description provided.