Skip to content

feat(shell): auto-pull .docker-git state on docker-git startup#179

Merged
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-178-d5c6ed0a33bf
Mar 23, 2026
Merged

feat(shell): auto-pull .docker-git state on docker-git startup#179
skulidropek merged 4 commits intoProverCoderAI:mainfrom
konard:issue-178-d5c6ed0a33bf

Conversation

@konard
Copy link
Contributor

@konard konard commented Mar 23, 2026

Summary

  • Performs git pull --rebase on the ~/.docker-git directory every time the docker-git CLI is invoked, ensuring local state is always up-to-date with the remote repository before any command runs
  • Adds autoPullState effect to state-repo.ts that pulls with GitHub auth when available and silently logs warnings on failure (never blocks CLI execution)
  • Controllable via DOCKER_GIT_STATE_AUTO_PULL env var (enabled by default when origin remote exists, can be disabled with false/0/off)
  • Extracts shared isFeatureEnabled predicate to deduplicate auto-pull and auto-sync env logic

Математические гарантии

Инварианты:

  • ∀ invocation ∈ docker-git: autoPull(~/.docker-git) *> handle(command)
  • ∀ error ∈ PullErrors: error → logWarning(error) ∧ ¬fail(program)

Предусловия:

  • ~/.docker-git is a git repo with origin remote (otherwise auto-pull is skipped)

Постусловия:

  • ∃ state: pulled(~/.docker-git) ∨ warned(error)
  • CLI command execution is never blocked by auto-pull failures

Сложность:

  • Время: O(1) network round-trip for git pull --rebase
  • Память: O(1) — no additional data structures

Test plan

  • Unit tests for isAutoPullEnabled env predicate (truthy/falsy/undefined/empty values)
  • Integration test: pulls new commits from remote into .docker-git
  • Integration test: does nothing when .docker-git is not a git repo
  • Integration test: does nothing when .docker-git has no origin remote
  • Integration test: respects DOCKER_GIT_STATE_AUTO_PULL=false to skip pull
  • Integration test: does not fail when .docker-git directory does not exist
  • All 117 tests pass (35 test files)
  • Lint passes
  • Typecheck passes

Closes #178

🤖 Generated with Claude Code

konard and others added 2 commits March 23, 2026 14:06
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#178
Performs `git pull --rebase` on the ~/.docker-git directory every time the
docker-git CLI is invoked, ensuring local state is always up-to-date with
the remote repository before any command runs.

- Adds `autoPullState` effect to state-repo that pulls with GitHub auth
  when available and silently logs warnings on failure
- Wires auto-pull into the CLI program pipeline before command dispatch
- Controllable via DOCKER_GIT_STATE_AUTO_PULL env var (enabled by default
  when origin remote exists, can be disabled with "false"/"0"/"off")
- Extracts shared `isFeatureEnabled` predicate to deduplicate auto-pull
  and auto-sync env logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Сделать что бы когда вызывается команда docker-git то происходит git pull для .docker-git папки feat(shell): auto-pull .docker-git state on docker-git startup Mar 23, 2026
@konard konard marked this pull request as ready for review March 23, 2026 14:19
konard and others added 2 commits March 23, 2026 14:24
Effect-TS lint rule forbids try/catch in product code. Uses
Effect.ensuring to restore env var after test assertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.073927
  • Calculated by Anthropic: $4.428699 USD
  • Difference: $-2.645228 (-37.39%)

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Repository (1876KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart 1/3

Detected uncommitted changes from previous run. Starting new session to review and commit or discard them.

Uncommitted files:

M packages/lib/src/core/templates-entrypoint.ts
 M packages/lib/src/core/templates-entrypoint/dns-repair.ts
 M packages/lib/src/shell/files.ts
 M packages/lib/src/usecases/projects-apply-all.ts
 M packages/lib/src/usecases/projects.ts

Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

🔄 Auto-restart 1/3 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.538175
  • Calculated by Anthropic: $0.903622 USD
  • Difference: $-0.634553 (-41.25%)

🤖 Models used:

  • Tool: Claude
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (2533KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Mar 23, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek skulidropek merged commit f2b729a into ProverCoderAI:main Mar 23, 2026
12 checks passed
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.

Сделать что бы когда вызывается команда docker-git то происходит git pull для .docker-git папки

2 participants