Skip to content

bug: refuse release when source tree changes during build #195

Description

@kiki830621

Problem

Tracking umbrella: PsychQuant/macdoc#163

che-word-mcp/scripts/release.sh checks repository cleanliness only before a long release build. If HEAD or a source file changes while swift build -c release is running, the script can sign and notarize bytes that do not correspond to the release tag's commit.

Type

bug

Expected

Capture the source revision at preflight and, immediately after build but before codesign, refuse the release unless:

  • HEAD is unchanged, and
  • git status --porcelain is still empty.

Tests must stub build/sign/notary/release commands, mutate the source tree during the build step, and prove no signing or upload command runs.

Actual

Only the initial cleanliness check exists. Later signature/hash gates attest the artifact's integrity but cannot detect that uncommitted source entered the build.

Impact

A correctly signed and notarized binary can contain uncommitted, untested source while the created tag points to different code.

Scope

This child owns the fix and verification in PsychQuant/che-word-mcp. Cross-repo policy coordination and the macdoc CLI script remain tracked in PsychQuant/macdoc#163.

Refs PsychQuant/macdoc#163

Clarity Surface(idd-clarify run 2026-08-23T20:05:32Z, unattended)

Type Source Question for you Status
(none) no issues detected passed

Current Status

Phase: verified
Last updated: 2026-08-24 by idd-verify

Key Decisions

  • Build release from detached SOURCE_HEAD worktree; reject isolated-tree drift before signing.
  • Pin release target and notes to captured commit.

Blocking

Commits

  • fa94ca9

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions