Skip to content

fix: keep CI preparation from changing Git hooks - #192138

Merged
vincentkoc merged 2 commits into
mainfrom
fix/ci-prepare-hooks-20261104
Nov 3, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/ci-prepare-hooks-20261104

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Source preparation in CI writes a developer Git hooks setting into the checkout. In a reusable workspace, that persisted setting can make the next strict Git synchronization probe reject an otherwise valid checkout.

User Impact

CI preparation leaves Git hook configuration untouched. Local installation still initializes an unset hooks path, and source preparation still invokes Kysely and native-protocol generation.

Why This Change Was Made

Skip only automatic hook setup at the prepare entrypoint when CI is set. The explicit hook configurator and its existing configuration-ownership behavior are unchanged.

Evidence

  • The real prepare entrypoint, copied with its real bootstrap resolver into an isolated Git fixture, reproduced the defect on base ad5218d25d403dea2bd470c829131337a32ca7ad: both generator fixtures ran, then CI preparation persisted core.hooksPath=git-hooks.
  • With the guard, the same CLI proof leaves CI hooks unset and retains ordinary local hook initialization; both generator outputs remain. The regression also checks complete local Git-config bytes in CI.
  • A separate local reproduction using the real hook helper and native seeded-sync probe passed before the hook write and returned exit1 afterward. The deleted remote workspace configuration was not measured, so this does not claim direct attribution of the prior live failure.
  • Fresh independent source review and local ClawSweeper review of ad5218d25d403dea2bd470c829131337a32ca7ad..a35f75172e65562d33b6216f0b57017b985cda89 found no actionable correctness or security defects. ClawSweeper did not execute tests.
  • In the privately qualified native workspace, scripts/pr review-tests 192138 test/scripts/prepare-git-hooks.test.ts passed all 13 tests in 4.65s (3.298s test time) at a35f75172e65562d33b6216f0b57017b985cda89. The final d8e837c689ad544fb1c94b93b3990de252f006e5 changes only an array wrap and its line allowance; production bytes are identical.
  • Final scoped formatting, script/test lint, script and test-script typechecks, syntax, whitespace, and the exact 56-line regression allocation ratchet passed.
  • Broad PR CI remains pending. No live rerun or full-suite pass is claimed.

Related: #190941

@vincentkoc vincentkoc self-assigned this Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Nov 3, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR skips automatic Git hook configuration during CI preparation while retaining generator execution and local hook setup.

Example: Run source preparation with CI=true in a checkout without core.hooksPath.

  • Before: Preparation persists core.hooksPath=git-hooks.
  • After: Preparation leaves Git configuration unchanged and still invokes both generators.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no identified correctness defect, while validation currently rests on reported fixture execution and source inspection.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports the production prepare CLI exercised with real Git and fixture generators, rather than a complete dependency-backed preparation run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: CI preparation persists developer hook configuration that can interfere with later reuse of the checkout.
Reason: The maintainer-authored direction removes an unnecessary CI side effect with a narrow guard and retains supported local behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a current CI configuration mutation with a focused fix; it remains a draft awaiting its recorded qualification.

Priority: P2
Reviewed head: a35f75172e65562d33b6216f0b57017b985cda89

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported fixture red/green run has no attached execution trace, and dependency-backed qualification remains explicitly pending.
Agent review details

How this fits together

The package prepare lifecycle invokes this script, which runs source generators and initializes developer hooks through the existing Git configuration helper.

flowchart TD
A[Package prepare lifecycle] --> B[Kysely preparation]
B --> C[CI environment check]
C -->|Local| D[Existing hook configurator]
C -->|CI| E[Native protocol preparation]
D --> E
Loading

Technical review

Best possible solution:

Keep the CI guard at the prepare entry point and complete the draft’s focused qualification without changing existing hook selections or generator behavior.

Do we have a high-confidence way to reproduce the issue?

Current main demonstrably reaches the hook write during CI when hooks are unset; the author reports a matching isolated CLI reproduction, but this review ran no target code and does not attribute the earlier remote failure.

Is this the best way to solve the issue?

The smallest complete fix uses the existing prepare owner to omit developer-only setup in CI, preserving the explicit helper and the earlier configuration-ownership repair.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c5828d072ba5.

Provenance checked

  • Git hook configuration ownership keeps the original intent (fix(tooling): preserve Git hook choices during install #139461: Preserve existing local, inherited, and empty hook selections and avoid changing sibling-worktree settings.)
  • Automatic prepare-time hook configuration changes intended behavior with a stated reason (d21abb8: Extracted cross-platform hook setup during Windows install hardening; the current PR explains why automatic invocation should be skipped in CI.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change: The introduced production change guards only the automatic hook-configurator call; generator execution and the explicit helper remain intact. (scripts/prepare-git-hooks.mjs:74, a35f75172e65)
  • Current main still writes hooks in CI: Current main calls configurePrepareGitHooks unconditionally, and package.json registers this script as the prepare entry point. (scripts/prepare-git-hooks.mjs:74, c5828d072ba5)
  • Existing ownership contract: fix(tooling): preserve Git hook choices during install #139461 deliberately preserves existing hook selections and refuses unsafe shared writes; this PR retains those decisions. (scripts/prepare-git-hooks.mjs:35, 98bb2591c7d3)
  • Focused regression boundary: The added regression invokes the copied production CLI with real Git, checks complete CI configuration bytes, and checks local initialization and generator invocation using generator fixtures. (test/scripts/prepare-git-hooks.test.ts:194, a35f75172e65)
  • Draft qualification remains pending: The full PR body reports fixture-based red/green behavior but explicitly leaves focused dependency-backed tests, formatting, lint, and types pending; exact-head build and test checks are skipped, not passed. (a35f75172e65)
  • History and inspection limits: History establishes the Windows extraction and later hook-ownership repair; older-content searches encountered unavailable promisor objects, so earlier introduction remains unverified. The checkout remained clean. (scripts/prepare-git-hooks.mjs, c5828d072ba5)

Likely related people:

  • Peter Steinberger: Raw commit 98bb259 adds scripts/prepare-git-hooks.mjs:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 98bb2591c7d3; files: scripts/prepare-git-hooks.mjs)
  • Vincent Koc: Raw commit d21abb8 adds scripts/prepare-git-hooks.mjs:63 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d21abb88e43c; files: scripts/prepare-git-hooks.mjs)

PR surface

Tests +53, Docs 0, Other +5. Total +58 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 54 1 +53
Docs 1 4 4 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 6 1 +5
Total 4 64 6 +58

Labels

Label changes:

  • add P2: Unwanted Git configuration writes affect reusable CI workspaces, with limited scope and no demonstrated urgent production outage.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Unwanted Git configuration writes affect reusable CI workspaces, with limited scope and no demonstrated urgent production outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the recorded focused tests, typecheck, lint, and formatting qualification on the reviewed head before marking the draft ready.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 3, 2026, 12:55 PM ET / 17:55 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 3, 2026 18:00
@vincentkoc
vincentkoc enabled auto-merge (squash) November 3, 2026 18:04
@vincentkoc
vincentkoc merged commit 3bbbcd4 into main Nov 3, 2026
171 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-prepare-hooks-20261104 branch November 3, 2026 18:16
vincentkoc added a commit that referenced this pull request Nov 3, 2026
* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression

(cherry picked from commit 3bbbcd4)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression
vincentkoc added a commit that referenced this pull request Nov 10, 2026
)

* fix(crabbox): preserve Boat source and retained claim ownership

* test(crabbox): avoid map spreads in source fixtures

* fix(crabbox): restore Boat transport Git after source execution

* fix: keep CI preparation from changing Git hooks (#192138)

* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression

(cherry picked from commit 3bbbcd4)

* fix(crabbox): restore source Git when SSH output closes
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 10, 2026
…claw#191845)

* fix(crabbox): preserve Boat source and retained claim ownership

* test(crabbox): avoid map spreads in source fixtures

* fix(crabbox): restore Boat transport Git after source execution

* fix: keep CI preparation from changing Git hooks (openclaw#192138)

* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression

(cherry picked from commit 8c449fe)

* fix(crabbox): restore source Git when SSH output closes
vincentkoc added a commit that referenced this pull request Nov 10, 2026
* fix(crabbox): preserve Boat source and retained claim ownership

* test(crabbox): avoid map spreads in source fixtures

* fix(crabbox): restore Boat transport Git after source execution

* test(crabbox): reproduce unpublished Boat source seeding

* fix(crabbox): seed Boat capsules from the captured base

* fix: keep CI preparation from changing Git hooks (#192138)

* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression

(cherry picked from commit 3bbbcd4)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…2164)

* fix(crabbox): preserve Boat source and retained claim ownership

* test(crabbox): avoid map spreads in source fixtures

* fix(crabbox): restore Boat transport Git after source execution

* test(crabbox): reproduce unpublished Boat source seeding

* fix(crabbox): seed Boat capsules from the captured base

* fix: keep CI preparation from changing Git hooks (openclaw#192138)

* fix: keep CI preparation from changing Git hooks

* chore: format CI preparation regression

(cherry picked from commit 8c449fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant