Skip to content

ui-server: Git mask-target preparation refuses maintenance on an unwritable .git that has no adapter #4469

Open

Description

@schlessera

Part of #4426 (follow-ups from #4278). Deferred from the final review of PR #4444.

Context

prepareMaintenanceGitTargets (packages/ui-server/src/brain/maintenance-git.ts:124-151) runs before every maintenance checkpoint:

  • run and launch (packages/ui-server/src/brain/host-boundary.ts:687, :786);
  • both sync paths (packages/ui-server/src/brain/sync-mirror.ts:209, :245).

It creates hooks, info and modules whenever .git is a server-owned directory.

A .git with no config gets no adapter (prepareMaintenanceGit, maintenance-git.ts:58), so the installer never needs those targets. But if that directory isn't writable by its owner, mkdir throws EACCES and every maintenance operation is refused. Before the epic, the same failure only produced a strict-profile fallback in status, and maintenance ran without an adapter.

Normal use can't produce this: git init and git clone always write config. It takes a hand-made or damaged .git.

The test at packages/ui-server/tests/maintenance-git-targets.test.ts:16-54 also hand-builds an installer manifest for a checkout with no config, which production would skip. Related: #4466.

Scope

  • Decide whether preparation applies when no adapter will be installed. Either skip it, or treat a failed mkdir there as "nothing to prepare".
  • Give the fixture a config, so it models a checkout that gets an adapter.

Acceptance criteria

  • A test with a server-owned, unwritable .git that has no config and lacks a target asserts the decided outcome. If the decision is to skip, maintenance reaches checkpoint acquisition.
  • A .git with config and a target that can't be prepared still refuses the operation, naming the target.
  • The run, launch and sync fixtures use a checkout for which production installs the adapter.
  • The PR answers the guard checklist in docs/decisions/proportionate-containment.md for the changed behaviour.

Activity

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p3Someday. Needs a driving use case before it starts.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p3Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions