Skip to content

fix: make GIT_AUTOCOMMIT work in the Docker image - #26

Open
thecodacus wants to merge 2 commits into
mainfrom
fix/git-autocommit
Open

fix: make GIT_AUTOCOMMIT work in the Docker image#26
thecodacus wants to merge 2 commits into
mainfrom
fix/git-autocommit

Conversation

@thecodacus

Copy link
Copy Markdown
Owner

Closes #21

@REASON-labs's diagnosis was exactly right, all three layers of it — no binary, no identity, dubious ownership — each silently masked by the best-effort catch while the README promised history. Their point about why it matters lands hardest: git history is the only undo for a memory that supersedes contradictions in place and dreams autonomously.

Image layer (their suggested fix, applied): apk add git plus system-level committer identity and safe.directory in the runtime stage.

Loudness layer (the startup check they suggested considering): ensureGitReady() runs at startup on both entry points when GIT_AUTOCOMMIT=true

  • missing binary → clear error and exit 1 (no more silent divergence between requested and actual behavior)
  • bundle not a repo → auto-git init with an --allow-empty first commit (which doubles as a committer-identity probe)
  • ownership problems surface via an early rev-parse instead of on the first mutation

The per-mutation catch stays as a backstop for transient failures, but hard misconfiguration is now impossible to miss.

Verified live both ways: a stripped-PATH server exits with the friendly message; with git present it inits, logs git autocommit: enabled, and git log shows the init commit plus one commit per mutation. 2 new tests (60 total).

The image shipped no git binary, so GIT_AUTOCOMMIT=true silently
committed nothing while mutations kept reporting success — and git
history is the only undo for a memory that dreams autonomously.

- Dockerfile: install git, set a system-level committer identity and
  safe.directory for bind-mounted bundles (the three stacked failures
  from the report, covered at the image layer)
- KnowledgeBase.ensureGitReady(): startup readiness check — friendly
  error when the binary is missing (simple-git reports installed:false
  rather than throwing), auto-init of non-repo bundles with an
  --allow-empty first commit (also proves committer identity works,
  independent of staging quirks), and an early rev-parse to surface
  ownership problems before the first mutation
- server + stdio entry points fail loudly at startup instead of
  discovering the problem commit by commit
- 2 new tests (60 total)
Fresh containers and CI runners have no git identity, so the init
commit failed there. When user.email doesn't resolve, set a
repo-local understory identity — same as the image does at system
scope. Verified with GIT_CONFIG_GLOBAL/SYSTEM nulled.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fc9db311-7a15-4dcf-8e1d-eda0b63fff4e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'GIT_AUTOCOMMIT=true' silently does nothing in the Docker image — no git binary

1 participant