Skip to content

Fix docker-git auth claude login failing after successful OAuth login#440

Open
konard wants to merge 18 commits into
ProverCoderAI:mainfrom
konard:issue-439-c9a9c01e8b9b
Open

Fix docker-git auth claude login failing after successful OAuth login#440
konard wants to merge 18 commits into
ProverCoderAI:mainfrom
konard:issue-439-c9a9c01e8b9b

Conversation

@konard

@konard konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve captured Claude OAuth tokens before post-login probes and keep failed probe handling on a warning-only path.
  • Move shared Claude OAuth helpers into packages/auth-oauth so token parsing, redaction, Docker OAuth, and local smoke behavior are testable independently.
  • Address CodeRabbit hardening items: extra compose overlays must be regular files, token files are created/replaced with private permissions, temporary OAuth test directories are released, and non-parser tests use neutral token markers.
  • Harden the packages/lib Claude login token persistence path: write the secret to a 0600 temporary file inside the account directory, atomically rename it to .oauth-token, and clean up the temp directory.
  • Fix fresh CI failures from run 28381937969: reduce nested Effect calls in token cleanup for Lint, and replace Dockerfile cache-busting ADD https://api.github.com/... with public github.com/.../commit/main.patch to avoid unauthenticated GitHub API 403s during E2E Docker builds.
  • Surface Docker probe failures as warnings, add an e2e assertion that the OAuth marker is absent from login logs, and keep test-only token injection confined to the compose overlay path.
  • Keep the auth Docker image and Claude Code package pinned, with checkout credentials disabled in the added CI job.

Proof of fix

  • Причина: claude setup-token could capture and persist a valid OAuth token, but authClaudeLogin still failed the whole login when the live post-login probe exited non-zero. The remaining CodeRabbit-relevant gap was that packages/lib still wrote token content directly to the final .oauth-token path, so an existing symlink/final target could receive secret bytes instead of being atomically replaced.
  • CI root cause: after hardening, CI exposed two concrete issues: unicorn/max-nested-calls on the cleanup expression in auth-claude.ts, and Docker build failure invalid response status 403 while fetching api.github.com/repos/ProverCoderAI/plan-to-git/commits/main from generated project Dockerfiles.
  • Решение: the shared login flow treats failed probes as typed warnings after token persistence; packages/lib now persists .oauth-token through a private temp file plus atomic rename; cleanup is a named Effect value; generated project Dockerfiles use the public commit patch URL for cache invalidation instead of the GitHub API.
  • Доказательство: the regression test replaces an existing token symlink without writing the secret to the symlink target fails on the old implementation with finalTokenWrites === 1; after the fix it passes and proves the symlink target remains unchanged while the final token path becomes a regular 0600 file. Fresh GitHub Actions on 88da06294ba2fbf9b5fcbfe28136b01e32d3bfbb pass for Check, Final Build, Snapshot, and Checking Dependencies.

Mathematical guarantees

  • env(extra)=p -> regular_file(resolve(p)) before docker compose -f resolve(p) is constructed.
  • captured(token) -> exists(account/.oauth-token) && mode(account/.oauth-token)=0600 before probe interpretation.
  • captured(token) && docker_probe_failed(exit) -> login_success && warning(exit).
  • persist(token, finalPath) -> write(secret, tempPath0600) && rename(tempPath0600, finalPath) && not write(secret, finalPath).
  • plan_to_git_branch_moves(main) -> docker_ADD(commit_patch(main)) changes without api.github.com quota dependency.
  • e2e_log(LOG_FILE) -> not contains(LOG_FILE, DOCKER_GIT_CLAUDE_OAUTH_TOKEN_MARKER).

Verification

Local:

  • git diff --check
  • bash -n scripts/e2e/auth-claude-login.sh
  • bun run --cwd packages/container test -- tests/core/templates.test.ts (54 tests)
  • bun run --cwd packages/container typecheck
  • bun run --cwd packages/container lint:effect
  • bun run --cwd packages/lib test -- tests/usecases/auth-claude-login.test.ts (regression failed before the persistence fix, then passed)
  • bun run --cwd packages/lib typecheck
  • bun run --cwd packages/lib lint:effect
  • bun run --cwd packages/auth-oauth test -- tests/claude-docker-oauth.test.ts tests/claude-local-smoke.test.ts
  • bun run --cwd packages/lib test -- tests/usecases/auth-claude-login.test.ts tests/usecases/auth-claude-local.test.ts
  • bun run --cwd packages/lib test (239 tests)
  • bun run typecheck
  • bun run build

CI on head 88da06294ba2fbf9b5fcbfe28136b01e32d3bfbb:

  • Check run 28382891173: success, including Lint and E2E (Runtime volumes + SSH).
  • Final Build run 28382891213: success on macOS, Ubuntu, and Windows.
  • Snapshot run 28382891133: success.
  • Checking Dependencies run 28382891228: success.

Local limitation: full bun run --cwd packages/container lint and bun run --cwd packages/lib lint crash in this runner before linting files because Node v20.20.2 loads eslint-plugin-unicorn@67 with TypeError: roleStyles.keys(...).map is not a function. The GitHub Actions runner executes these lint jobs successfully; the fresh CI run above is the authoritative lint verification.

CodeRabbit review threads/comments are addressed in code. The only remaining red PR status is external: CodeRabbit reports Prepaid credits exhausted — enable usage-based reviews, which requires maintainer/billing action outside the repository diff.

Fixes #439

Fixes #440

Additional CodeRabbit fix: GPU overlay regular-file invariant

  • Причина: DOCKER_GIT_CONTROLLER_GPU=all accepted an existing docker-compose.gpu.yml directory because GPU overlay resolution checked only exists, so the typed bootstrap boundary could pass an invalid docker compose -f argument.
  • Решение: requireGpuOverlayPath now requires fs.stat(...).type === "File" and fails with ControllerBootstrapError before Docker Compose is invoked.
  • Доказательство: the new regression test rejects GPU compose overlay paths that are directories failed before the fix with a successful ControllerComposeFiles result and now passes.

Verification added in commit 5dc13bcc:

  • bun --cwd packages/app vitest run tests/docker-git/controller-compose.test.ts (9 passed; the new test failed before the fix)
  • bun run --cwd packages/app typecheck
  • bun run --cwd packages/app lint:effect
  • bun run typecheck
  • git diff --check

Additional CI fix: retry Bun dependency install

  • Причина: fresh CI run 28384357354, job 84095018943 (E2E (Local package CLI)), failed during setup with error: Fail extracting tarball for "@effect/platform" while running bun install --frozen-lockfile. The failure happened before repository tests/build logic and is consistent with a transient package download/extraction failure.
  • Решение: the shared .github/actions/setup action now retries bun install --frozen-lockfile up to three times with bounded sleeps before failing, preserving the frozen lockfile invariant while making setup resilient to transient registry/tarball extraction failures.
  • Доказательство: the exact failing log was downloaded to ci-logs/job-84095018943-e2e-local-package-cli.log; the retry shell fragment passes bash -n, local bun install --frozen-lockfile succeeds without lockfile changes, and commit 06a4e2a5 triggers a fresh CI run for end-to-end verification.

Verification added in commit 06a4e2a5:

  • bash -n on the setup retry shell fragment
  • bun install --frozen-lockfile
  • git diff --check

Final CI verification on head 06a4e2a5

GitHub Actions created at 2026-06-29T15:48:05Z all pass:

  • Check run 28384656977: success, including the previously failing E2E (Local package CLI) job.
  • Final Build run 28384657012: success on Ubuntu, macOS, and Windows.
  • Snapshot run 28384656962: success.
  • Checking Dependencies run 28384656995: success.

Remaining non-repository status:

  • CodeRabbit: Prepaid credits exhausted — enable usage-based reviews. All actionable CodeRabbit review comments found in PR review comments are addressed in code; this remaining status requires maintainer/billing action outside the repository diff.

Additional CodeRabbit fix: OAuth env boundary

  • Причина: runClaudeOauthLoginWithPrompt still read DOCKER_GIT_CLAUDE_OAUTH_TOKEN through process.env, leaving a hidden runtime input inside the shared Docker OAuth runner instead of passing decoded boundary data explicitly.
  • Решение: token lookup now lives in packages/lib/src/shell/claude-oauth-env.ts; authClaudeLogin passes envToken into runClaudeOauthLoginWithPrompt, and the shared runner no longer reads global process state.
  • Доказательство: the new regression test uses a decoded docker-git OAuth env token without running setup-token persists the env token, asserts setup-token is not invoked, and still verifies the ping probe path.

Verification added in commit bc1da978:

  • bun run --cwd packages/lib test -- tests/usecases/auth-claude-login.test.ts (5 tests)
  • git diff --check
  • bun run --cwd packages/lib typecheck
  • bun run --cwd packages/lib lint:effect
  • bun run --cwd packages/lib test (240 tests)
  • bun run typecheck
  • bun run build

Additional CodeRabbit follow-up: timeout and env override

  • Причина: CodeRabbit found two residual risks after commit bc1da978: bun install retries did not bound a hung install attempt, and authClaudeLogin accepted DOCKER_GIT_CLAUDE_OAUTH_TOKEN as a production bypass around claude setup-token.
  • Решение: .github/actions/setup/action.yml now wraps each bun install --frozen-lockfile attempt in a portable 20-minute bash timer; Claude production login no longer reads or accepts an env-token shortcut, and the regression test now proves that the env var does not bypass setup-token capture.
  • Доказательство: commit 8abc88d2 adds the negative env-token regression and passed the verification below.

Verification added in commit 8abc88d2:

  • bun run --cwd packages/lib test -- tests/usecases/auth-claude-login.test.ts (5 tests)
  • bash -n <(sed -n '60,90p' .github/actions/setup/action.yml | sed 's/^ //')
  • git diff --check
  • bun run --cwd packages/lib typecheck
  • bun run --cwd packages/lib lint:effect
  • bun run --cwd packages/lib test (240 tests)
  • bun run typecheck
  • bun run build

Local note: bun run --cwd packages/lib lint still crashes before code diagnostics while loading eslint-plugin-unicorn with TypeError: roleStyles.keys(...).map is not a function; CI Lint is the authoritative check for this environment-sensitive linter path.

Additional CI fix: e2e-only Claude setup-token wrapper

  • Причина: after the production DOCKER_GIT_CLAUDE_OAUTH_TOKEN shortcut was removed, scripts/e2e/auth-claude-login.sh still injected only that env var. Fresh run 28387220960, job 84104893072, proved the regression: the job reached the real Claude OAuth prompt and the script failed with exit 124 after timeout.
  • Решение: the e2e compose overlay now mounts a test-only Docker wrapper into the API container. The wrapper intercepts only docker-git-auth-claude:latest setup-token and docker-git-auth-claude:latest -p ping, emits parser-compatible synthetic setup-token output, forces the warning probe path, and delegates all other Docker invocations to /usr/bin/docker. Production authClaudeLogin still has no env-token bypass.
  • Доказательство: the stale failed log was downloaded to ci-logs/check-28387220960-claude-auth.log; the failure lines show the real Claude sign-in URL prompt followed by e2e/auth-claude-login: docker-git auth claude login failed (exit: 124). Fresh CI on head aedf7d3c6a803e80f588dd90a7e835cfc61e3773 passes the same E2E (Claude auth login) job and all other Actions.

Verification added in commit aedf7d3c:

  • bash -n scripts/e2e/auth-claude-login.sh
  • direct parser/redactor check for the synthetic sk-ant-... marker: extraction succeeds and redacted output does not contain the marker
  • bun --cwd packages/auth-oauth test tests/claude-oauth-token.test.ts tests/claude-docker-oauth.test.ts (18 tests)
  • bun run --cwd packages/lib test -- tests/usecases/auth-claude-login.test.ts (5 tests)
  • git diff --check

Fresh GitHub Actions on head aedf7d3c6a803e80f588dd90a7e835cfc61e3773:

  • Check run 28388765352: success, including E2E (Claude auth login).
  • Final Build run 28388765272: success on Ubuntu, macOS, and Windows.
  • Snapshot run 28388765405: success.
  • Checking Dependencies run 28388765341: success.

Remaining non-repository status:

  • CodeRabbit: Prepaid credits exhausted — enable usage-based reviews. Current unresolved, non-outdated CodeRabbit review threads: none. This status requires maintainer/billing action outside the repository diff.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#439
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Добавлен пакет packages/auth-oauth с общими Claude OAuth helpers, общий login flow в packages/lib, поддержка extra compose overlay, а также e2e/CI wiring и релизные обновления. Probe-фейл теперь обрабатывается как предупреждение после сохранения токена.

Changes

Claude OAuth flow и интеграция

Layer / File(s) Summary
OAuth token helpers and package surface
packages/auth-oauth/package.json, packages/auth-oauth/tsconfig.json, packages/auth-oauth/src/claude-oauth-token.ts, packages/auth-oauth/src/index.ts
Определены env-ключи, утилиты нормализации/извлечения/классификации токена, stateful-редактирование потокового вывода, метаданные пакета, публичные exports и exports-карта.
Docker and local Claude runners
packages/auth-oauth/src/claude-docker-oauth.ts, packages/auth-oauth/src/claude-local-smoke.ts
Реализованы runClaudeDockerOauth и runClaudeLocalOauthSmoke с сохранением токена, probe-запусками и CLI-режимами.
Shared login flow and lib integration
packages/lib/src/usecases/auth-claude-login-flow.ts, packages/lib/src/usecases/auth-claude-local.ts, packages/lib/src/usecases/auth-claude-oauth.ts, packages/lib/src/usecases/auth-claude.ts, packages/lib/src/usecases/auth.ts, packages/lib/src/shell/claude-oauth-env.ts
Добавлены runClaudeLoginFlow и runClaudeLocalEnvTokenLoginFlow; authClaudeLogin переведён на общий flow; auth-claude-oauth использует общий пакет; добавлена shell-граница для чтения OAuth env token.
OAuth and login-flow tests
packages/auth-oauth/tests/*, packages/lib/tests/usecases/auth-claude-login-flow.test.ts, packages/lib/tests/usecases/auth-claude-local.test.ts, packages/lib/tests/usecases/auth-claude-login.test.ts
Добавлены тесты для token helpers, Docker/local runners, shared login flow и authClaudeLogin.

Controller compose extra overlay support

Layer / File(s) Summary
Extra compose overlay in controller-compose
packages/app/src/docker-git/controller-compose-files.ts, packages/app/src/docker-git/controller-compose.ts, packages/app/tests/docker-git/controller-compose-fixture.ts, packages/app/tests/docker-git/controller-compose.test.ts, scripts/e2e/_lib.sh, .changeset/fix-claude-auth-login-probe.md
ControllerComposeFiles расширен extraOverlayPath; добавлен loadControllerComposeExtraPath; resolveControllerComposeFiles и тестовые фикстуры обновлены; DOCKER_GIT_CONTROLLER_COMPOSE_EXTRA_FILE пробрасывается в docker-wrapper и покрыта тестами; changeset фиксирует overlay invariant.

Workspace, сборка и CI

Layer / File(s) Summary
Workspace, build, and CI wiring
package.json, pnpm-workspace.yaml, packages/api/Dockerfile, packages/lib/package.json, scripts/e2e/run-all.sh, scripts/e2e/auth-claude-login.sh, .github/workflows/check.yml, .github/actions/setup/action.yml
Новый пакет добавлен в workspace и scripts; Dockerfile обновлён; добавлены e2e-скрипт auth-claude-login.sh, job e2e-auth-claude-login и retry для bun install.
Release notes and version bumps
.changeset/fix-claude-auth-login-probe.md, packages/app/CHANGELOG.md, packages/app/package.json, packages/docker-git-session-sync/CHANGELOG.md, packages/docker-git-session-sync/package.json
Добавлен changeset для probe-поведения; обновлены версии и changelog-записи packages/app и packages/docker-git-session-sync.

Sequence Diagram(s)

sequenceDiagram
  participant authClaudeLogin
  participant runClaudeLoginFlow
  participant runClaudeOauthLoginWithPrompt
  participant runClaudeDockerOauth
  participant claudeLocalOauthSmoke
  authClaudeLogin->>runClaudeLoginFlow: captureToken / persistToken / probeToken
  runClaudeLoginFlow->>runClaudeOauthLoginWithPrompt: envToken, image, containerPath
  runClaudeOauthLoginWithPrompt->>runClaudeDockerOauth: run docker OAuth flow
  runClaudeDockerOauth->>claudeLocalOauthSmoke: save token and probe ping
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly states the main fix: Claude login should not fail after a successful OAuth capture.
Linked Issues check ✅ Passed The changes satisfy #439/#440: token persistence happens before probe handling, failed probes are warning-only, and the requested hardening is present.
Out of Scope Changes check ✅ Passed I don't see clearly unrelated code; the CI, compose, Dockerfile, and auth-oauth additions all support the stated OAuth and reliability goals.
Requirements Alignment ✅ Passed Код соответствует ТЗ: probe стал warning-only после persist, токен пишется через temp+rename 0600, overlay’ы валидируются как regular file, и это покрыто тестами.
Security Regression ✅ Passed Высоковероятных регрессий безопасности не найдено: shell-вызовы идут без shell, токены не печатаются по умолчанию, compose-оверлеи и токенные файлы валидируются как regular file.
Description check ✅ Passed Описание полно и детально покрывает цель, доказательство и верификацию, хотя не повторяет шаблонные секции дословно.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

github-actions Bot and others added 3 commits June 26, 2026 08:33
docker-git auth claude login created and persisted the OAuth token, then ran
a 'claude -p ping' probe and hard-failed (exit 1) on any non-zero probe exit,
discarding an otherwise successful login. Transient probe failures (network,
rate limit, token propagation delay) must not invalidate a saved token.

The probe failure is now logged as a warning, mirroring authClaudeStatus.

Adds a regression test asserting the token is persisted even when the probe
returns non-zero.

Fixes ProverCoderAI#439
@konard konard changed the title [WIP] Исправить ошибку при docker-git auth claude login Fix docker-git auth claude login failing after successful OAuth login Jun 26, 2026
@konard konard marked this pull request as ready for review June 26, 2026 08:34
@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

All functional CI checks pass. The remaining E2E jobs are still running (slow integration tests for unrelated flows), and the only failure is CodeRabbit — an external billing issue ("Prepaid credits exhausted"), not a code problem.

Summary

I fixed issue #439docker-git auth claude login failing with exit code 1 even after a successful OAuth login.

Root cause

In packages/lib/src/usecases/auth-claude.ts, authClaudeLogin:

  1. Runs claude setup-token, captures the OAuth token.
  2. Persists the token to .oauth-token (chmod 600).
  3. Runs a verification probe claude -p ping.
  4. Hard-failed with CommandFailedError on any non-zero probe exit — discarding the already-saved token.

The probe makes a live API call, so a transient failure (network hiccup, rate limit, freshly-issued token still propagating) invalidated an otherwise successful login. This was also inconsistent with authClaudeStatus, which only warns on the same probe failure — exactly matching the issue log where the token was created successfully but the command still exited 1.

Fix

Treat the failing post-login probe as a warning instead of a hard error, mirroring authClaudeStatus. Since the token is persisted before the probe runs, login now succeeds and advises the user to re-check later with docker-git auth claude status.

Verification

  • Added packages/lib/tests/usecases/auth-claude-login.test.ts with a fake docker CommandExecutor that captures a setup-token and makes the -p ping probe return non-zero.
  • Confirmed the test fails without the fix (at the Effect.fail line, verified by stashing) and passes with it.
  • Full packages/lib suite: 229 passed. lint:effect, Types, Build, Test, Lint all green in CI.
  • Added a changeset (patch for @prover-coder-ai/docker-git), merged main, removed the placeholder .gitkeep.

PR: #440 (updated and marked ready for review).


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

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

💰 Cost: $4.620513

📊 Context and tokens usage:

  • 114.4K / 1M (11%) input tokens, 31.8K / 128K (25%) output tokens

Total: (4.0K new + 101.7K cache writes + 5.6M cache reads) input tokens, 31.8K output tokens, $4.620513 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (2166KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 1)

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

💰 Cost estimation:

  • Public pricing estimate: $1.015964
  • Calculated by Anthropic: $5.636477
  • Difference: $4.620513 (+454.79%)

📊 Context and tokens usage:

  • 47.1K / 1M (5%) input tokens, 8.8K / 128K (7%) output tokens

Total: (3.3K new + 34.3K cache writes + 871.7K cache reads) input tokens, 8.8K output tokens, $1.015964 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (2977KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 2)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 2)

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

💰 Cost estimation:

  • Public pricing estimate: $0.696650
  • Calculated by Anthropic: $6.333127
  • Difference: $5.636477 (+809.08%)

📊 Context and tokens usage:

  • 40.9K / 1M (4%) input tokens, 7.4K / 128K (6%) output tokens

Total: (3.5K new + 21.3K cache writes + 562.5K cache reads) input tokens, 7.4K output tokens, $0.696650 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (3734KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 3)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

CI status — only failing check is an external CodeRabbit billing limit

I reviewed the failing CI and verified the code state on issue-439-c9a9c01e8b9b:

  • Diff is exactly 3 files (no stray .gitkeep):
  • Branch is fully up to date with main (HEAD..origin/main is empty), no conflicts.
  • Tests pass: vitest run tests/usecases/auth-claude-login.test.ts → 2 passed.
  • lint:effect clean.
  • All functional CI checks pass: Build, Test, Types, Lint, Lint Effect-TS, Snapshot, Dist deps prune, and every E2E job are green.

Why the CodeRabbit check is red

The check reports:

Prepaid credits exhausted — enable the review add-on

This is an external billing/account limit on the org's CodeRabbit subscription (Your organization has used up its prepaid credits…), not a code problem. No source change can make it pass — it requires an org admin to enable the review add-on in the CodeRabbit billing tab (or waiting out the rate-limit window).

The stale CodeRabbit "Requirements Alignment" note pointing at .gitkeep is from an earlier review run; that placeholder was already removed and is not in the current diff — the present diff correctly fixes docker-git auth claude login in auth-claude.ts and adds a regression test, exactly as #439 requires.

There is nothing further to fix on the code side; the PR is ready pending the CodeRabbit billing resolution.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 3)

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

💰 Cost estimation:

  • Public pricing estimate: $0.731452
  • Calculated by Anthropic: $7.064579
  • Difference: $6.333127 (+865.83%)

📊 Context and tokens usage:

  • 45.9K / 1M (5%) input tokens, 7.4K / 128K (6%) output tokens

Total: (3.2K new + 26.2K cache writes + 536.9K cache reads) input tokens, 7.4K output tokens, $0.731452 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (4493KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 4)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Everything is verified and in order. Here's my assessment:

Conclusion

The code fix for issue #439 is complete and correct. The only failing CI check, CodeRabbit, is an external billing/account limit — not a code problem.

Verification done this session

  • Diff vs main: exactly 3 relevant files — .changeset/fix-claude-auth-login-probe.md, packages/lib/src/usecases/auth-claude.ts (the fix), packages/lib/tests/usecases/auth-claude-login.test.ts (reproducing test). No stray .gitkeep.
  • Branch up to date with mainHEAD..origin/main is empty, no conflicts.
  • Test passes: auth-claude-login.test.ts → 2 passed.
  • lint:effect clean: 0 errors (only pre-existing migration-blocker warnings in an unrelated package, exit code 0).
  • Comment style is idiomatic: the CHANGE:/WHY:/REF:/SOURCE: n/a block matches the convention used across packages/lib/src/ (e.g. shell/config.ts, shell/docker-auth.ts, usecases/auth-codex.ts).
  • All functional CI checks pass: Build, Test, Types, Lint, Lint Effect-TS, Snapshot, Dist deps prune, and every E2E job are green.

Why CodeRabbit is red (and unfixable by code)

CodeRabbit  fail  —  Prepaid credits exhausted — enable the review add-on

CodeRabbit's own comment confirms: "Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab…" This requires an org admin to enable the add-on (or waiting out the rate-limit window). No source change can make it pass. The stale CodeRabbit "Requirements Alignment" note about .gitkeep is from an earlier review run — that placeholder is not in the current diff.

The fix itself (treating a failing post-login API probe as a warning rather than a hard error, mirroring authClaudeStatus, since the OAuth token is already persisted before the probe) directly resolves the issue: docker-git auth claude login no longer exits 1 after a successful login.

Iteration 3 already posted a detailed PR comment explaining the CodeRabbit billing situation, so I'm not adding a redundant duplicate. There is nothing further to fix on the code side — the PR is ready pending the org's CodeRabbit billing resolution.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 4)

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

💰 Cost estimation:

  • Public pricing estimate: $0.485599
  • Calculated by Anthropic: $7.550178
  • Difference: $7.064579 (+1454.82%)

📊 Context and tokens usage:

  • 42.8K / 1M (4%) input tokens, 4.6K / 128K (4%) output tokens

Total: (3.0K new + 23.2K cache writes + 248.8K cache reads) input tokens, 4.6K output tokens, $0.485599 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (5185KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 5)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 5)

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

💰 Cost estimation:

  • Public pricing estimate: $0.637494
  • Calculated by Anthropic: $8.187671
  • Difference: $7.550178 (+1184.35%)

📊 Context and tokens usage:

  • 43.7K / 1M (4%) input tokens, 5.6K / 128K (4%) output tokens

Total: (10.5K new + 24.1K cache writes + 406.4K cache reads) input tokens, 5.6K output tokens, $0.637494 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus (claude-opus-4-8)
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (5925KB)


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

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Auto-restart limit reached

Hive Mind stopped auto-restart-until-mergeable after 5 restart iterations.

Configured limit: 5
Remaining reason: CI failures detected

No further AI sessions will be started automatically for this run. Please review the remaining blockers manually or rerun with a higher --auto-restart-max-iterations value.


Auto-restart-until-mergeable stopped by the safety limit.

@skulidropek

Copy link
Copy Markdown
Member

Мне кажется вместо того что бы решить проблему ты просто пытаешься её спрятать
image

@konard konard marked this pull request as draft June 27, 2026 12:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/lib/src/usecases/auth-claude-oauth.ts (1)

172-180: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Логируйте failed probe как warning.

Сейчас warning есть только для non-zero setup-token; если claude -p ping вернул non-zero, login успешно возвращает token молча, хотя заявленное поведение — warning-only probe failure.

Минимальный фикс
       if (result.exitCode !== 0) {
         yield* _(
           Effect.logWarning(
             `claude setup-token returned exit=${result.exitCode}, but OAuth token was captured; continuing.`
           )
         )
       }
+      if (result.probeStatus._tag === "ClaudeDockerProbeFailed") {
+        yield* _(
+          Effect.logWarning(
+            `claude -p ping failed with exit=${result.probeStatus.exitCode}; OAuth token was saved. Run docker-git auth claude status to verify later.`
+          )
+        )
+      }
       return result.token

As per path instructions, README requires “warning-only” behavior after token persistence so users can verify later via docker-git auth claude status.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/lib/src/usecases/auth-claude-oauth.ts` around lines 172 - 180, In
`auth-claude-oauth.ts`, the `ClaudeDockerOauthTokenCaptured` path only warns for
a non-zero `setup-token` exit, but it should also surface a failed `claude -p
ping` probe as a warning while still returning the captured token. Update the
token-capture flow around the `result._tag` handling so the probe result is
checked and any non-zero probe exit is logged via `Effect.logWarning`,
preserving the warning-only behavior before returning from the auth use case.

Source: Path instructions

packages/auth-oauth/src/claude-local-smoke.ts (1)

89-95: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Создавайте .oauth-token сразу с приватными правами.

writeFile(..., "utf8") создаёт файл с правами, зависящими от umask, и до chmod токен может кратко оказаться читаемым. Передайте mode: claudeOauthTokenFileMode в writeFile; отдельный chmod можно оставить как защиту в глубину.

Минимальный фикс
-  await writeFile(tokenPath, formatClaudeOauthTokenFile(token), "utf8")
+  await writeFile(tokenPath, formatClaudeOauthTokenFile(token), {
+    encoding: "utf8",
+    mode: claudeOauthTokenFileMode
+  })
   await chmod(tokenPath, claudeOauthTokenFileMode)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/auth-oauth/src/claude-local-smoke.ts` around lines 89 - 95, The
token persistence flow in persistClaudeLocalOauthToken currently writes the
.oauth-token file with default permissions before tightening them, so update the
writeFile call to create the file with claudeOauthTokenFileMode immediately and
keep the follow-up chmod as a defense-in-depth safeguard. Use the existing
persistClaudeLocalOauthToken and claudeOauthTokenFileMode symbols to locate the
change.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/src/docker-git/controller-compose.ts`:
- Around line 143-149: The overlay validation in controllerCompose currently
only checks fs.exists, so directories can still pass as a “verified extra
compose overlay.” Update the check around extraOverlayPath in controllerCompose
to require a regular file (not just existence) before returning it, and keep the
controllerBootstrapError path for anything else. Make sure the logic in this
branch proves the intended precondition for the extra compose overlay using the
existing symbols fs.exists, mapComposePathError, and controllerBootstrapError.

In `@packages/auth-oauth/src/claude-docker-oauth.ts`:
- Around line 286-289: The token persistence in writeCapturedToken relies on
writeFile mode and then chmod, but that does not safely handle an existing token
file at the same accountPath. Update the writeCapturedToken flow in
claude-docker-oauth.ts to write the OAuth token to a new temporary file with
restrictive permissions (0600) and then atomically rename it into place, or
otherwise ensure permissions are tightened before any token content is
persisted.

In `@packages/auth-oauth/tests/claude-docker-oauth.test.ts`:
- Around line 47-49: Temporary auth directories created by mkdtemp in the oauth
tests are never cleaned up, so the test run leaves behind .oauth-token data in
/tmp. Update the test setup around the accountPath creation in both relevant
test cases to use Effect.acquireRelease so the directory is always removed after
assertions, and release it with rm(..., { recursive: true, force: true }) using
the same accountPath variable.

In `@packages/lib/src/usecases/auth-claude.ts`:
- Around line 58-61: The token file creation in auth-claude.ts leaves a brief
window with default permissions because writeFileString() happens before chmod()
in the Effect.gen flow. Update the token persistence logic around
claudeOauthTokenPath/tokenPath so the file is created with mode 0o600
immediately, or write to a temporary file with restricted permissions and
atomically rename it, instead of relying on a separate chmod afterward.

In `@packages/lib/tests/usecases/auth-claude-local.test.ts`:
- Around line 19-21: The test fixtures in auth-claude-local.test.ts use
token-shaped strings that look like real Claude secrets even though the test
only needs distinct values for env-key priority and value propagation. Replace
the oauthTokenPrefix/oauthToken/lowerPriorityToken fixtures with clearly
neutral, non-secret placeholder strings in the same test setup so any failed
expect output or CI diff cannot resemble or expose credentials. Keep the
assertions and flow around the existing test cases unchanged; only adjust the
fixture values referenced by the test.

In `@scripts/e2e/auth-claude-login.sh`:
- Around line 24-29: The auth Claude login e2e script currently injects a stable
DOCKER_GIT_CLAUDE_OAUTH_TOKEN, but it does not verify that this marker never
appears in LOG_FILE. Update auth-claude-login.sh to add a negative assertion
after the flow completes, using the existing LOG_FILE and the token marker
string, so the test fails if the token is echoed to stdout/stderr. Keep the
check close to the current compose override setup and reuse the existing login
flow identifiers in the script to locate the right spot.

---

Outside diff comments:
In `@packages/auth-oauth/src/claude-local-smoke.ts`:
- Around line 89-95: The token persistence flow in persistClaudeLocalOauthToken
currently writes the .oauth-token file with default permissions before
tightening them, so update the writeFile call to create the file with
claudeOauthTokenFileMode immediately and keep the follow-up chmod as a
defense-in-depth safeguard. Use the existing persistClaudeLocalOauthToken and
claudeOauthTokenFileMode symbols to locate the change.

In `@packages/lib/src/usecases/auth-claude-oauth.ts`:
- Around line 172-180: In `auth-claude-oauth.ts`, the
`ClaudeDockerOauthTokenCaptured` path only warns for a non-zero `setup-token`
exit, but it should also surface a failed `claude -p ping` probe as a warning
while still returning the captured token. Update the token-capture flow around
the `result._tag` handling so the probe result is checked and any non-zero probe
exit is logged via `Effect.logWarning`, preserving the warning-only behavior
before returning from the auth use case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cf7d78e7-1ec6-4b25-904b-e58566d554ba

📥 Commits

Reviewing files that changed from the base of the PR and between a02936b and 025b925.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .github/workflows/check.yml
  • packages/app/src/docker-git/controller-compose.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/auth-oauth/package.json
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • scripts/e2e/_lib.sh
  • scripts/e2e/auth-claude-login.sh
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Claude auth login)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: Test
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: Lint
  • GitHub Check: E2E (Login context)
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{sh,bash,py,js,ts,jsx,tsx,go,java,rb,php}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce command injection or unsafe shell/process execution with user-controlled input

Files:

  • scripts/e2e/_lib.sh
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{py,js,ts,jsx,tsx,go,java,rb,php,sh,bash,c,cpp}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce path traversal or writes outside intended project/container state directories

Files:

  • scripts/e2e/_lib.sh
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{js,ts,jsx,tsx,py,java,go,rb,php,sh,bash,yml,yaml,json,env*,toml,cfg,config,dockerfile,dockerignore}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files expose credentials, tokens, private-keys, or PII in source, generated config, logs, or CI output

Files:

  • scripts/e2e/_lib.sh
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/package.json
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{setup,install,config,*.sh,*.md}

📄 CodeRabbit inference engine (README.md)

Ensure default projects directory is ~/.docker-git

Files:

  • scripts/e2e/_lib.sh
  • scripts/e2e/auth-claude-login.sh
**/{.git*,config*,*.sh,docker-compose*}

📄 CodeRabbit inference engine (README.md)

Use git credential helper to automatically select correct token by host for HTTPS clone/push operations

Files:

  • scripts/e2e/_lib.sh
  • scripts/e2e/auth-claude-login.sh
**/{browser*,server*,.env*,*.sh}

📄 CodeRabbit inference engine (README.md)

Allow DOCKER_GIT_WEB_HOST environment variable to restrict web access to 127.0.0.1

Files:

  • scripts/e2e/_lib.sh
  • scripts/e2e/auth-claude-login.sh
**

⚙️ CodeRabbit configuration file

**: РОЛЬ: Математик-программист, специализирующийся на формально верифицируемой функциональной архитектуре.

ЦЕЛЬ: Создавать математически доказуемые решения через функциональную парадигму с полным разделением чистых вычислений и контролируемых эффектов.

МОДЕЛЬ РАССУЖДЕНИЯ:

  • Не выдавать “личные мнения”. Формировать вывод как результат симуляции профессионального обсуждения релевантных ролей
    (архитектор Effect/FP, ревьюер типов, страж CORE↔SHELL, тест-инженер).
  • Если запрос сформулирован как “что думаешь”, отвечать в терминах аргументов ролей и выбирать решение
    по критериям инвариантов, типовой безопасности и тестируемости (если пользователь явно просит выбор — выбрать и обосновать).

ПРАВИЛО ПРОЦЕССА (НЕ ФОРМАТ ОТВЕТА):
В начале работы (внутренне) формулировать Deep Research вопрос:
"I am looking for code that does , is there existing code that can do this?"
Далее:

  • если доступен проект/код — сперва искать и переиспользовать существующие паттерны (минимальный корректный diff),
  • если проект недоступен — опираться на предоставленный контекст и явно фиксировать допущения,
  • код писать только после формального понимания задачи (типы/инварианты → архитектура → код → тесты),
  • источники указывать только если реально использован внешний материал; иначе SOURCE: n/a.

ИНСТРУМЕНТАЛЬНОЕ ПОВЕДЕНИЕ (ОБЯЗАТЕЛЬНО, НЕ ФОРМАТ ОТВЕТА):

  • Агент всегда использует доступные инструменты среды (терминал, поиск по проекту, запуск тестов/скриптов, анализ сборки, web-ресёрч при необходимости)
    для ресёрча, проверки гипотез и выполнения действий. Приоритет: проверяемость, воспроизводимость, минимальный риск.
  • Агент не предлагает “гайд” как замену действия. Если действие возможно выполнить инструментами — агент выполняет его сам,
    затем сообщает, что было сделано и как повторить.
  • Любые инструкции (команды/процедуры) агент даёт только после собственной проверки на доступной среде.
    Если проверить невозможно — явно фиксирует ограничение и перечисляе...

Files:

  • scripts/e2e/_lib.sh
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/package.json
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Ты строгий ревьюер SPEC DRIVEN DEVELOPMENT.

Перед выводами изучи README.md, другие *.md файлы, linked issues,
PR description, PR comments/discussion и релевантную кодовую базу.

Сверь изменения с исходным ТЗ/спекой и обсуждением. Флагай любой уход
от спеки, недокументированное изменение поведения, отсутствие тестов
для заявленного поведения и security-риск. Если спека не видна,
попроси автора добавить ее в issue или PR description.

Проверь решение с точки зрения формальной верификации: какие инварианты,
предусловия и постусловия можно доказать математически, а где доказуемость
слабая. Оцени решение с точки зрения теории игр: устойчивы ли стимулы,
нет ли выгодного обхода правил, и какое решение было бы сильнее.

Files:

  • scripts/e2e/_lib.sh
  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/package.json
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: FUNCTIONAL CORE: Write only pure functions with immutable data and mathematical operations in core modules; no side effects, mutations, or external service calls
IMPERATIVE SHELL: Isolate all side effects (IO, network, database, environment/process) in a thin SHELL layer; CORE never calls SHELL, only SHELL → CORE
Never use any type annotation in TypeScript; use unknown only at SHELL boundaries for decoding, never export unknown outside boundary modules
Never use as type assertions in normal code; only permit as in a single 'axiomatic' module (brands, constructors, constants) after which types flow safely without casts
Always use exhaustive pattern matching for union types through .exhaustive() or Match.exhaustive() from effect-ts; never use switch statements or unhandled type branches
Use Effect<Success, Error, Requirements> monad from effect-ts for all effects; compose through pipe() and Effect.flatMap(); never use async/await, raw Promise chains (then/catch), or Promise.all in product code
Interoperate with Promise/exceptions only in SHELL through Effect.try/Effect.tryPromise with typed error mapping; never leave raw exceptions or untyped errors in the domain
Use Effect.acquireRelease + Effect.scoped for resource management with guaranteed finalization; never manage resources with try/finally or manual cleanup
All external services (database, HTTP, environment) must be accessed through Effect-based interfaces and Layer-based dependency injection; never call external APIs directly
Provide comprehensive TSDoc comments with mathematical notation: @pure, @effect, @invariant, @precondition, @postcondition, @complexity, @throws, and CHANGE/WHY/REF/SOURCE/FORMAT THEOREM functional comment markers
No console.*, process direct calls, or untyped environment access in product code; all such operations must be abstracted through Layer-based services in SHELL
Boundary data from external sources (HTTP, database, environment) must be decoded/valida...

Files:

  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.{ts,tsx}: Write property-based tests using fast-check (fc.property) to verify mathematical invariants; unit tests must use Effect test utilities without async/await
Every bug fix must be accompanied by a reproducing test case; the test must fail before the fix and pass after; document the Proof of Fix with root cause and solution

Files:

  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/{browser*,server*,app*,*.ts,*.js}

📄 CodeRabbit inference engine (README.md)

Web version must listen on 0.0.0.0 by default for accessibility across LAN devices

Files:

  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{cli*,command*,auto*,*.ts,*.tsx}

📄 CodeRabbit inference engine (README.md)

Implement auto-mode agent selection logic to choose Claude, Codex, Gemini, or Grok randomly from available authorized providers, or allow forced selection with --auto=

Files:

  • packages/auth-oauth/tests/claude-oauth-token.test.ts
  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/auth-oauth/tests/claude-local-smoke.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-oauth-token.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/lib/src/usecases/auth-claude.ts
**/.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce unsafe GitHub Actions configuration such as unsafe pull_request_target, or unnecessary write permissions

Files:

  • .github/workflows/check.yml
**/{.env*,auth*,config*,setup*}

📄 CodeRabbit inference engine (README.md)

Store authentication tokens in env-file as GIT_AUTH_TOKEN__ / GIT_AUTH_USER__

Files:

  • packages/lib/tests/usecases/auth-claude-login-flow.test.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/lib/src/usecases/auth-claude-login-flow.ts
  • packages/lib/src/usecases/auth-claude-local.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{package*.json,requirements*.txt,setup.py,setup.cfg,Pipfile,Pipfile.lock,pyproject.toml,pom.xml,build.gradle,Gemfile,Gemfile.lock,go.mod,go.sum,composer.json,Cargo.toml,Cargo.lock}

📄 CodeRabbit inference engine (Custom checks)

Fail if dependency or package-manager changes materially increase supply-chain risk without justification

Files:

  • packages/auth-oauth/package.json
🧠 Learnings (2)
📚 Learning: 2026-06-10T10:21:51.286Z
Learnt from: konard
Repo: ProverCoderAI/docker-git PR: 386
File: packages/app/tests/docker-git/gridland-react-singleton.test.ts:0-0
Timestamp: 2026-06-10T10:21:51.286Z
Learning: In `packages/app/tests/docker-git` tests that inspect the `packages/terminal` workspace (e.g., for React-related versions), remember that `react-dom` is intentionally declared as a `devDependency` in `packages/terminal` (the terminal exports components but does not render to the DOM itself). Therefore, test assertions should not require `react-dom` to appear in `dependencies`; when resolving versions, accept either `dependencies` or `devDependencies` (as `resolveDepVersion` does in `gridland-react-singleton.test.ts`).

Applied to files:

  • packages/app/tests/docker-git/controller-compose.test.ts
📚 Learning: 2026-05-22T21:08:18.083Z
Learnt from: skulidropek
Repo: ProverCoderAI/docker-git PR: 344
File: packages/app/src/docker-git/controller-compose.ts:34-40
Timestamp: 2026-05-22T21:08:18.083Z
Learning: In this repo’s docker-git controller compose generation, `${DOCKER_GIT_CONTROLLER_BUILD_SKILLER:-1}` should be treated as standard bash parameter expansion: when `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` is unset, it defaults to the string "1". There is no "-1" mode. The runtime contract enforced by `packages/app/src/docker-git/controller-compose.ts` is: unset / "1" / "true" => output "1"; "0" / "false" => output "0". If review code shows branching/behavior for "-1" or any numeric value other than this 0/1 contract, flag it. Also ensure the Dockerfile ARG `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` stays consistent with default `1`.

Applied to files:

  • packages/app/src/docker-git/controller-compose.ts
🪛 Shellcheck (0.11.0)
scripts/e2e/auth-claude-login.sh

[info] 67-67: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)

🔇 Additional comments (10)
packages/app/src/docker-git/controller-compose.ts (1)

16-23: LGTM!

Also applies to: 250-265, 290-292

scripts/e2e/_lib.sh (1)

28-28: LGTM!

.github/workflows/check.yml (1)

260-263: LGTM!

packages/auth-oauth/src/claude-oauth-token.ts (1)

5-15: LGTM!

Also applies to: 38-46, 116-247

packages/auth-oauth/src/claude-docker-oauth.ts (1)

8-23: LGTM!

Also applies to: 92-103, 217-272, 297-359, 361-377, 391-391

packages/auth-oauth/src/claude-local-smoke.ts (1)

14-18: LGTM!

Also applies to: 117-169, 268-282

packages/lib/src/usecases/auth-claude-oauth.ts (1)

47-90: LGTM!

Also applies to: 105-166

packages/auth-oauth/tests/claude-oauth-token.test.ts (1)

1-70: LGTM!

Also applies to: 85-138, 163-201

packages/auth-oauth/tests/claude-docker-oauth.test.ts (1)

19-43: LGTM!

Also applies to: 129-172

packages/auth-oauth/tests/claude-local-smoke.test.ts (1)

3-83: LGTM!

Comment thread packages/app/src/docker-git/controller-compose.ts Outdated
Comment thread packages/auth-oauth/src/claude-docker-oauth.ts Outdated
Comment thread packages/auth-oauth/tests/claude-docker-oauth.test.ts Outdated
Comment thread packages/lib/src/usecases/auth-claude.ts Outdated
Comment thread packages/lib/tests/usecases/auth-claude-local.test.ts Outdated
Comment thread scripts/e2e/auth-claude-login.sh Outdated
@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

CI update for 875fbd5: all GitHub Actions checks are passing, including Check/Test/Lint/E2E and Final Build. The only remaining non-passing status is external CodeRabbit: "Prepaid credits exhausted — enable usage-based reviews". This requires maintainer/billing action outside the codebase.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $36.933939

📊 Context and tokens usage:

  • 1.0M / 200K (508%) input tokens, 106.8K / 128K (83%) output tokens

Total: (1.0M + 22.0M cached) input tokens, 106.8K output tokens, $36.933939 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Thinking level: max (~31999 tokens)
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (11455KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

CI update for de50520: all GitHub Actions checks are passing on the latest PR head, including Check/Test/Lint/Types/Build/E2E, Final Build, Checking Dependencies, and Snapshot.

The only remaining failing status is external CodeRabbit: "Prepaid credits exhausted — enable usage-based reviews". I addressed the actionable CodeRabbit review comments in commit de50520, but this status requires maintainer/billing action outside the codebase.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 1)

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $9.464141
  • Token usage: 352,321 input, 32,175 output, 12,800 reasoning, 4,493,056 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (14546KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 2)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

CI status after syncing with main

Head SHA: bbd18855d2326a5b3ce65d45f4a372a5073f9b06

GitHub Actions are green for the current head:

  • Check: success
  • Snapshot: success
  • Checking Dependencies: success
  • Final Build: success

The remaining failing PR status is external to the codebase:

  • CodeRabbit: Prepaid credits exhausted — enable usage-based reviews

I also verified the latest CodeRabbit review comments were already addressed in the branch. This remaining failure requires CodeRabbit billing/credits or required-status configuration action; there is no repository diff that can satisfy that status while CodeRabbit cannot run.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 2)

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $6.835383
  • Token usage: 349,468 input, 18,299 output, 5,907 reasoning, 2,517,248 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (17385KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 3)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/lib/src/usecases/auth-claude-oauth.ts (1)

212-215: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Не читайте process.env напрямую из usecase.

Этот shortcut делает env-token глобальным runtime-входом для auth claude login. Вынесите чтение DOCKER_GIT_CLAUDE_OAUTH_TOKEN в shell/Layer boundary и передавайте уже декодированное значение в flow; так тестовая compose-инъекция останется управляемой зависимостью, а не скрытым process-side effect.

As per coding guidelines, “No console.*, process direct calls, or untyped environment access in product code; all such operations must be abstracted through Layer-based services in SHELL”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/lib/src/usecases/auth-claude-oauth.ts` around lines 212 - 215, The
shortcut in authClaudeOAuth usecase reads process.env directly, which violates
the shell-boundary rule and makes the token a hidden runtime side effect. Move
the DOCKER_GIT_CLAUDE_OAUTH_TOKEN lookup out of the usecase into the shell/Layer
boundary, then inject the already-decoded token into the flow and update
readClaudeOauthTokenFromEnv/authClaudeOAuth to consume the provided value
instead of accessing process.env.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/src/docker-git/controller-compose-files.ts`:
- Around line 91-106: The GPU overlay validation in requireGpuOverlayPath only
checks fs.exists, so a directory named docker-compose.gpu.yml can still pass
bootstrap; update it to mirror the DOCKER_GIT_CONTROLLER_COMPOSE_EXTRA_FILE path
by verifying the path with stat and requiring File before returning it,
otherwise fail with the same bootstrap error flow. For formal verification, make
the precondition explicit that the overlay path must be an existing regular
file, the invariant that only File paths are accepted, and the postcondition
that the function returns either a valid file path or ControllerBootstrapError;
add a regression test covering the directory-as-overlay case.

---

Outside diff comments:
In `@packages/lib/src/usecases/auth-claude-oauth.ts`:
- Around line 212-215: The shortcut in authClaudeOAuth usecase reads process.env
directly, which violates the shell-boundary rule and makes the token a hidden
runtime side effect. Move the DOCKER_GIT_CLAUDE_OAUTH_TOKEN lookup out of the
usecase into the shell/Layer boundary, then inject the already-decoded token
into the flow and update readClaudeOauthTokenFromEnv/authClaudeOAuth to consume
the provided value instead of accessing process.env.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 82b8b682-5f97-43dd-a257-267cfcaf579f

📥 Commits

Reviewing files that changed from the base of the PR and between 025b925 and 5ba9e51.

📒 Files selected for processing (12)
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • scripts/e2e/auth-claude-login.sh
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Login context)
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{sh,bash,py,js,ts,jsx,tsx,go,java,rb,php}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce command injection or unsafe shell/process execution with user-controlled input

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/*.{py,js,ts,jsx,tsx,go,java,rb,php,sh,bash,c,cpp}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce path traversal or writes outside intended project/container state directories

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/*.{js,ts,jsx,tsx,py,java,go,rb,php,sh,bash,yml,yaml,json,env*,toml,cfg,config,dockerfile,dockerignore}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files expose credentials, tokens, private-keys, or PII in source, generated config, logs, or CI output

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: FUNCTIONAL CORE: Write only pure functions with immutable data and mathematical operations in core modules; no side effects, mutations, or external service calls
IMPERATIVE SHELL: Isolate all side effects (IO, network, database, environment/process) in a thin SHELL layer; CORE never calls SHELL, only SHELL → CORE
Never use any type annotation in TypeScript; use unknown only at SHELL boundaries for decoding, never export unknown outside boundary modules
Never use as type assertions in normal code; only permit as in a single 'axiomatic' module (brands, constructors, constants) after which types flow safely without casts
Always use exhaustive pattern matching for union types through .exhaustive() or Match.exhaustive() from effect-ts; never use switch statements or unhandled type branches
Use Effect<Success, Error, Requirements> monad from effect-ts for all effects; compose through pipe() and Effect.flatMap(); never use async/await, raw Promise chains (then/catch), or Promise.all in product code
Interoperate with Promise/exceptions only in SHELL through Effect.try/Effect.tryPromise with typed error mapping; never leave raw exceptions or untyped errors in the domain
Use Effect.acquireRelease + Effect.scoped for resource management with guaranteed finalization; never manage resources with try/finally or manual cleanup
All external services (database, HTTP, environment) must be accessed through Effect-based interfaces and Layer-based dependency injection; never call external APIs directly
Provide comprehensive TSDoc comments with mathematical notation: @pure, @effect, @invariant, @precondition, @postcondition, @complexity, @throws, and CHANGE/WHY/REF/SOURCE/FORMAT THEOREM functional comment markers
No console.*, process direct calls, or untyped environment access in product code; all such operations must be abstracted through Layer-based services in SHELL
Boundary data from external sources (HTTP, database, environment) must be decoded/valida...

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/{browser*,server*,app*,*.ts,*.js}

📄 CodeRabbit inference engine (README.md)

Web version must listen on 0.0.0.0 by default for accessibility across LAN devices

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/{cli*,command*,auto*,*.ts,*.tsx}

📄 CodeRabbit inference engine (README.md)

Implement auto-mode agent selection logic to choose Claude, Codex, Gemini, or Grok randomly from available authorized providers, or allow forced selection with --auto=

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**

⚙️ CodeRabbit configuration file

**: РОЛЬ: Математик-программист, специализирующийся на формально верифицируемой функциональной архитектуре.

ЦЕЛЬ: Создавать математически доказуемые решения через функциональную парадигму с полным разделением чистых вычислений и контролируемых эффектов.

МОДЕЛЬ РАССУЖДЕНИЯ:

  • Не выдавать “личные мнения”. Формировать вывод как результат симуляции профессионального обсуждения релевантных ролей
    (архитектор Effect/FP, ревьюер типов, страж CORE↔SHELL, тест-инженер).
  • Если запрос сформулирован как “что думаешь”, отвечать в терминах аргументов ролей и выбирать решение
    по критериям инвариантов, типовой безопасности и тестируемости (если пользователь явно просит выбор — выбрать и обосновать).

ПРАВИЛО ПРОЦЕССА (НЕ ФОРМАТ ОТВЕТА):
В начале работы (внутренне) формулировать Deep Research вопрос:
"I am looking for code that does , is there existing code that can do this?"
Далее:

  • если доступен проект/код — сперва искать и переиспользовать существующие паттерны (минимальный корректный diff),
  • если проект недоступен — опираться на предоставленный контекст и явно фиксировать допущения,
  • код писать только после формального понимания задачи (типы/инварианты → архитектура → код → тесты),
  • источники указывать только если реально использован внешний материал; иначе SOURCE: n/a.

ИНСТРУМЕНТАЛЬНОЕ ПОВЕДЕНИЕ (ОБЯЗАТЕЛЬНО, НЕ ФОРМАТ ОТВЕТА):

  • Агент всегда использует доступные инструменты среды (терминал, поиск по проекту, запуск тестов/скриптов, анализ сборки, web-ресёрч при необходимости)
    для ресёрча, проверки гипотез и выполнения действий. Приоритет: проверяемость, воспроизводимость, минимальный риск.
  • Агент не предлагает “гайд” как замену действия. Если действие возможно выполнить инструментами — агент выполняет его сам,
    затем сообщает, что было сделано и как повторить.
  • Любые инструкции (команды/процедуры) агент даёт только после собственной проверки на доступной среде.
    Если проверить невозможно — явно фиксирует ограничение и перечисляе...

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Ты строгий ревьюер SPEC DRIVEN DEVELOPMENT.

Перед выводами изучи README.md, другие *.md файлы, linked issues,
PR description, PR comments/discussion и релевантную кодовую базу.

Сверь изменения с исходным ТЗ/спекой и обсуждением. Флагай любой уход
от спеки, недокументированное изменение поведения, отсутствие тестов
для заявленного поведения и security-риск. Если спека не видна,
попроси автора добавить ее в issue или PR description.

Проверь решение с точки зрения формальной верификации: какие инварианты,
предусловия и постусловия можно доказать математически, а где доказуемость
слабая. Оцени решение с точки зрения теории игр: устойчивы ли стимулы,
нет ли выгодного обхода правил, и какое решение было бы сильнее.

Files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/src/claude-docker-oauth.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/app/tests/docker-git/controller-compose-fixture.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/app/src/docker-git/controller-compose.ts
  • packages/auth-oauth/src/claude-local-smoke.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
**/{setup,install,config,*.sh,*.md}

📄 CodeRabbit inference engine (README.md)

Ensure default projects directory is ~/.docker-git

Files:

  • scripts/e2e/auth-claude-login.sh
**/{.env*,auth*,config*,setup*}

📄 CodeRabbit inference engine (README.md)

Store authentication tokens in env-file as GIT_AUTH_TOKEN__ / GIT_AUTH_USER__

Files:

  • scripts/e2e/auth-claude-login.sh
  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{.git*,config*,*.sh,docker-compose*}

📄 CodeRabbit inference engine (README.md)

Use git credential helper to automatically select correct token by host for HTTPS clone/push operations

Files:

  • scripts/e2e/auth-claude-login.sh
**/{browser*,server*,.env*,*.sh}

📄 CodeRabbit inference engine (README.md)

Allow DOCKER_GIT_WEB_HOST environment variable to restrict web access to 127.0.0.1

Files:

  • scripts/e2e/auth-claude-login.sh
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.{ts,tsx}: Write property-based tests using fast-check (fc.property) to verify mathematical invariants; unit tests must use Effect test utilities without async/await
Every bug fix must be accompanied by a reproducing test case; the test must fail before the fix and pass after; document the Proof of Fix with root cause and solution

Files:

  • packages/lib/tests/usecases/auth-claude-local.test.ts
  • packages/auth-oauth/tests/claude-docker-oauth.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
🧠 Learnings (2)
📚 Learning: 2026-05-22T21:08:18.083Z
Learnt from: skulidropek
Repo: ProverCoderAI/docker-git PR: 344
File: packages/app/src/docker-git/controller-compose.ts:34-40
Timestamp: 2026-05-22T21:08:18.083Z
Learning: In this repo’s docker-git controller compose generation, `${DOCKER_GIT_CONTROLLER_BUILD_SKILLER:-1}` should be treated as standard bash parameter expansion: when `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` is unset, it defaults to the string "1". There is no "-1" mode. The runtime contract enforced by `packages/app/src/docker-git/controller-compose.ts` is: unset / "1" / "true" => output "1"; "0" / "false" => output "0". If review code shows branching/behavior for "-1" or any numeric value other than this 0/1 contract, flag it. Also ensure the Dockerfile ARG `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` stays consistent with default `1`.

Applied to files:

  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/app/src/docker-git/controller-compose.ts
📚 Learning: 2026-06-10T10:21:51.286Z
Learnt from: konard
Repo: ProverCoderAI/docker-git PR: 386
File: packages/app/tests/docker-git/gridland-react-singleton.test.ts:0-0
Timestamp: 2026-06-10T10:21:51.286Z
Learning: In `packages/app/tests/docker-git` tests that inspect the `packages/terminal` workspace (e.g., for React-related versions), remember that `react-dom` is intentionally declared as a `devDependency` in `packages/terminal` (the terminal exports components but does not render to the DOM itself). Therefore, test assertions should not require `react-dom` to appear in `dependencies`; when resolving versions, accept either `dependencies` or `devDependencies` (as `resolveDepVersion` does in `gridland-react-singleton.test.ts`).

Applied to files:

  • packages/app/tests/docker-git/controller-compose.test.ts
🔇 Additional comments (8)
scripts/e2e/auth-claude-login.sh (1)

16-16: LGTM!

Also applies to: 25-29, 78-80

packages/auth-oauth/src/claude-docker-oauth.ts (1)

1-1: LGTM!

Also applies to: 288-303

packages/lib/src/usecases/auth-claude-oauth.ts (1)

180-186: LGTM!

packages/lib/src/usecases/auth-claude.ts (1)

53-82: LGTM!

Also applies to: 288-288

packages/lib/tests/usecases/auth-claude-local.test.ts (1)

19-20: LGTM!

packages/lib/tests/usecases/auth-claude-login.test.ts (1)

6-8: LGTM!

Also applies to: 17-17, 133-159, 197-199, 209-213, 215-261

packages/auth-oauth/tests/claude-docker-oauth.test.ts (1)

1-1: LGTM!

Also applies to: 44-48, 50-53, 103-107, 129-129

packages/auth-oauth/src/claude-local-smoke.ts (1)

94-98: 🔒 Security & Privacy

Комментарий неактуален: accountPath создаётся через mkdtemp(...) в уникальном временном каталоге, поэтому writeFile(tokenPath, ...) не перезаписывает чужой путь и здесь не нужен дополнительный temp-file rename.

			> Likely an incorrect or invalid review comment.

Comment thread packages/app/src/docker-git/controller-compose-files.ts
@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Status update for head 88da06294ba2fbf9b5fcbfe28136b01e32d3bfbb:

  • All GitHub Actions are passing now. Fresh runs:
    • Check: 28382891173
    • Final Build: 28382891213
    • Snapshot: 28382891133
    • Checking Dependencies: 28382891228
  • The previously failing Lint job is passing.
  • The previously failing E2E (Runtime volumes + SSH) job is passing.
  • The only remaining red status is CodeRabbit: Prepaid credits exhausted - enable usage-based reviews. That is an external quota/billing failure, not a code or CI failure in this PR.

Proof of fix and local verification details are included in the PR description.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 3)

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $15.967847
  • Token usage: 416,920 input, 40,243 output, 11,911 reasoning, 9,987,712 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (22679KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 4)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

konard added 2 commits June 29, 2026 15:43
Reject directory-valued docker-compose.gpu.yml before constructing docker compose arguments.

Proof of fix: tests/docker-git/controller-compose.test.ts failed before the stat check and now passes with the new directory-as-overlay regression.
Retry transient Bun dependency installation failures in CI setup before failing the job.

Proof of fix: CI job 84095018943 failed while downloading @effect/platform during bun install; local shell syntax and bun install --frozen-lockfile both pass after adding bounded retries.
@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

GitHub Actions are green on head 06a4e2a5 (Check 28384656977, Final Build 28384657012, Snapshot 28384656962, Checking Dependencies 28384656995). The remaining red PR status is external: CodeRabbit still reports Prepaid credits exhausted — enable usage-based reviews. All actionable CodeRabbit code comments found in the PR review comments have been addressed; this remaining status requires maintainer/billing action outside the repository diff.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 4)

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $9.926956
  • Token usage: 380,758 input, 27,792 output, 9,419 reasoning, 4,868,736 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (26654KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 5)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/lib/tests/usecases/auth-claude-login.test.ts (1)

195-229: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Зафиксируйте инвариант probe-поведения через fc.property.

Сейчас фикс подтверждён несколькими примерами, но инвариант PR — что после захвата токена login не откатывается из-за probe — остаётся непроверенным на произвольных non-empty token / exit code. Для *.test.ts здесь нужен property-based тест, иначе Proof of Fix остаётся частичным.

As per coding guidelines, "**/*.test.{ts,tsx}: Write property-based tests using fast-check (fc.property) ... Every bug fix must be accompanied by a reproducing test case ... document the Proof of Fix ...". As per path instructions, "Флагай ... отсутствие тестов для заявленного поведения".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/lib/tests/usecases/auth-claude-login.test.ts` around lines 195 -
229, The current `authClaudeLogin` coverage only proves the probe/token behavior
with a couple of fixed examples; add a fast-check property test in this
`*.test.ts` suite to lock in the invariant that a successfully created OAuth
token is still persisted regardless of the post-login probe exit code. Reuse the
existing `runLoginAndReadToken`, `withTempDir`, and `withPatchedEnv` setup, and
express the assertion with `fc.property` over non-empty token input and
arbitrary non-zero/zero probe exits so the proof of fix is exercised
generically, not just by the two example cases.

Sources: Coding guidelines, Path instructions

packages/app/src/docker-git/controller-compose-files.ts (2)

33-39: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Вынесите чтение env за typed SHELL boundary.

Line 39 читает process.env напрямую. Из-за этого loadControllerComposeExtraPath() зависит от неявного глобального состояния процесса, хотя остальная функция уже оформлена как Effect-сервисная граница. Сюда лучше передавать уже декодированное значение env или получать его через отдельный Layer/decoder.

As per coding guidelines, "No console.*, process direct calls, or untyped environment access in product code; all such operations must be abstracted through Layer-based services in SHELL" and "Boundary data from external sources (HTTP, database, environment) must be decoded/validated through @effect/schema or typed decoders before entering the domain".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/app/src/docker-git/controller-compose-files.ts` around lines 33 -
39, `loadControllerComposeExtraPath` is reading `process.env` directly, which
violates the typed SHELL boundary and couples the effect to global process
state. Refactor this function to accept the already-decoded env value through a
Layer/service or decoder-based input, and keep
`controllerComposeExtraFileEnvKey` handling outside the domain-facing logic.
Ensure the boundary source is validated/decoded before reaching
`loadControllerComposeExtraPath`, and remove any direct `process.env` access
from this product code path.

Source: Coding guidelines


20-21: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Общий mapper ошибок подменяет реальный путь сбоя.

mapComposePathError() всегда пишет про docker-compose.yml, хотя Lines 47-58 и 108-117 используют его и для extra/GPU overlay. При EACCES/I/O ошибке bootstrap укажет не на тот файл, и диагностика уйдёт в ложный след.

🔧 Предлагаемый фикс
-const mapComposePathError = (error: PlatformError): ControllerBootstrapError =>
-  controllerBootstrapError(`Failed to resolve docker-compose.yml path.\nDetails: ${String(error)}`)
+const mapComposePathError = (
+  targetPath: string,
+  error: PlatformError
+): ControllerBootstrapError =>
+  controllerBootstrapError(`Failed to resolve ${targetPath}.\nDetails: ${String(error)}`)
-const isExists = yield* _(fs.exists(extraOverlayPath).pipe(Effect.mapError(mapComposePathError)))
+const isExists = yield* _(
+  fs.exists(extraOverlayPath).pipe(
+    Effect.mapError((error) => mapComposePathError(extraOverlayPath, error))
+  )
+)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/app/src/docker-git/controller-compose-files.ts` around lines 20 -
21, The shared mapper in mapComposePathError() hardcodes docker-compose.yml,
which mislabels failures coming from extra and GPU overlay compose files. Update
the error construction so the resolved path is passed into mapComposePathError()
from the call sites in controllerComposeFiles logic, and include that specific
path in the controllerBootstrapError message instead of a fixed filename. Make
sure the callers around the extra/GPU overlay handling use the same mapper but
supply the correct file identifier for each failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/setup/action.yml:
- Around line 60-70: The retry loop around bun install in the setup action only
handles immediate failures and can hang indefinitely on a stuck install. Update
the run block in the action workflow to wrap the bun install call with a local
timeout inside the existing retry loop, so each attempt is bounded and can fail
fast before retrying. Keep the change localized to the setup step that invokes
bun install, preserving the current retry and backoff behavior while ensuring a
hung install cannot block e2e-auth-claude-login.

In `@packages/lib/src/usecases/auth-claude.ts`:
- Around line 286-289: The authClaudeLogin flow is now accepting a global
DOCKER_GIT_CLAUDE_OAUTH_TOKEN override in the main login use case, which should
remain test-only. Remove the envToken wiring from
runClaudeOauthLoginWithPrompt/authClaudeLogin and keep token injection confined
to the compose overlay or test shell path so the normal OAuth flow cannot be
bypassed by process environment.

---

Outside diff comments:
In `@packages/app/src/docker-git/controller-compose-files.ts`:
- Around line 33-39: `loadControllerComposeExtraPath` is reading `process.env`
directly, which violates the typed SHELL boundary and couples the effect to
global process state. Refactor this function to accept the already-decoded env
value through a Layer/service or decoder-based input, and keep
`controllerComposeExtraFileEnvKey` handling outside the domain-facing logic.
Ensure the boundary source is validated/decoded before reaching
`loadControllerComposeExtraPath`, and remove any direct `process.env` access
from this product code path.
- Around line 20-21: The shared mapper in mapComposePathError() hardcodes
docker-compose.yml, which mislabels failures coming from extra and GPU overlay
compose files. Update the error construction so the resolved path is passed into
mapComposePathError() from the call sites in controllerComposeFiles logic, and
include that specific path in the controllerBootstrapError message instead of a
fixed filename. Make sure the callers around the extra/GPU overlay handling use
the same mapper but supply the correct file identifier for each failure.

In `@packages/lib/tests/usecases/auth-claude-login.test.ts`:
- Around line 195-229: The current `authClaudeLogin` coverage only proves the
probe/token behavior with a couple of fixed examples; add a fast-check property
test in this `*.test.ts` suite to lock in the invariant that a successfully
created OAuth token is still persisted regardless of the post-login probe exit
code. Reuse the existing `runLoginAndReadToken`, `withTempDir`, and
`withPatchedEnv` setup, and express the assertion with `fc.property` over
non-empty token input and arbitrary non-zero/zero probe exits so the proof of
fix is exercised generically, not just by the two example cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2e0a905f-b644-4c17-ad85-23d3e54d0a5c

📥 Commits

Reviewing files that changed from the base of the PR and between 5ba9e51 and bc1da97.

📒 Files selected for processing (10)
  • .changeset/fix-claude-auth-login-probe.md
  • .github/actions/setup/action.yml
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/container/tests/core/templates.test.ts
  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: E2E (Claude auth login)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: Final build (windows-latest)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Login context)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: Lint
  • GitHub Check: Test
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{sh,bash,py,js,ts,jsx,tsx,go,java,rb,php}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce command injection or unsafe shell/process execution with user-controlled input

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{py,js,ts,jsx,tsx,go,java,rb,php,sh,bash,c,cpp}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files introduce path traversal or writes outside intended project/container state directories

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{js,ts,jsx,tsx,py,java,go,rb,php,sh,bash,yml,yaml,json,env*,toml,cfg,config,dockerfile,dockerignore}

📄 CodeRabbit inference engine (Custom checks)

Fail if changed files expose credentials, tokens, private-keys, or PII in source, generated config, logs, or CI output

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: FUNCTIONAL CORE: Write only pure functions with immutable data and mathematical operations in core modules; no side effects, mutations, or external service calls
IMPERATIVE SHELL: Isolate all side effects (IO, network, database, environment/process) in a thin SHELL layer; CORE never calls SHELL, only SHELL → CORE
Never use any type annotation in TypeScript; use unknown only at SHELL boundaries for decoding, never export unknown outside boundary modules
Never use as type assertions in normal code; only permit as in a single 'axiomatic' module (brands, constructors, constants) after which types flow safely without casts
Always use exhaustive pattern matching for union types through .exhaustive() or Match.exhaustive() from effect-ts; never use switch statements or unhandled type branches
Use Effect<Success, Error, Requirements> monad from effect-ts for all effects; compose through pipe() and Effect.flatMap(); never use async/await, raw Promise chains (then/catch), or Promise.all in product code
Interoperate with Promise/exceptions only in SHELL through Effect.try/Effect.tryPromise with typed error mapping; never leave raw exceptions or untyped errors in the domain
Use Effect.acquireRelease + Effect.scoped for resource management with guaranteed finalization; never manage resources with try/finally or manual cleanup
All external services (database, HTTP, environment) must be accessed through Effect-based interfaces and Layer-based dependency injection; never call external APIs directly
Provide comprehensive TSDoc comments with mathematical notation: @pure, @effect, @invariant, @precondition, @postcondition, @complexity, @throws, and CHANGE/WHY/REF/SOURCE/FORMAT THEOREM functional comment markers
No console.*, process direct calls, or untyped environment access in product code; all such operations must be abstracted through Layer-based services in SHELL
Boundary data from external sources (HTTP, database, environment) must be decoded/valida...

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{browser*,server*,app*,*.ts,*.js}

📄 CodeRabbit inference engine (README.md)

Web version must listen on 0.0.0.0 by default for accessibility across LAN devices

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/{cli*,command*,auto*,*.ts,*.tsx}

📄 CodeRabbit inference engine (README.md)

Implement auto-mode agent selection logic to choose Claude, Codex, Gemini, or Grok randomly from available authorized providers, or allow forced selection with --auto=

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**

⚙️ CodeRabbit configuration file

**: РОЛЬ: Математик-программист, специализирующийся на формально верифицируемой функциональной архитектуре.

ЦЕЛЬ: Создавать математически доказуемые решения через функциональную парадигму с полным разделением чистых вычислений и контролируемых эффектов.

МОДЕЛЬ РАССУЖДЕНИЯ:

  • Не выдавать “личные мнения”. Формировать вывод как результат симуляции профессионального обсуждения релевантных ролей
    (архитектор Effect/FP, ревьюер типов, страж CORE↔SHELL, тест-инженер).
  • Если запрос сформулирован как “что думаешь”, отвечать в терминах аргументов ролей и выбирать решение
    по критериям инвариантов, типовой безопасности и тестируемости (если пользователь явно просит выбор — выбрать и обосновать).

ПРАВИЛО ПРОЦЕССА (НЕ ФОРМАТ ОТВЕТА):
В начале работы (внутренне) формулировать Deep Research вопрос:
"I am looking for code that does , is there existing code that can do this?"
Далее:

  • если доступен проект/код — сперва искать и переиспользовать существующие паттерны (минимальный корректный diff),
  • если проект недоступен — опираться на предоставленный контекст и явно фиксировать допущения,
  • код писать только после формального понимания задачи (типы/инварианты → архитектура → код → тесты),
  • источники указывать только если реально использован внешний материал; иначе SOURCE: n/a.

ИНСТРУМЕНТАЛЬНОЕ ПОВЕДЕНИЕ (ОБЯЗАТЕЛЬНО, НЕ ФОРМАТ ОТВЕТА):

  • Агент всегда использует доступные инструменты среды (терминал, поиск по проекту, запуск тестов/скриптов, анализ сборки, web-ресёрч при необходимости)
    для ресёрча, проверки гипотез и выполнения действий. Приоритет: проверяемость, воспроизводимость, минимальный риск.
  • Агент не предлагает “гайд” как замену действия. Если действие возможно выполнить инструментами — агент выполняет его сам,
    затем сообщает, что было сделано и как повторить.
  • Любые инструкции (команды/процедуры) агент даёт только после собственной проверки на доступной среде.
    Если проверить невозможно — явно фиксирует ограничение и перечисляе...

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Ты строгий ревьюер SPEC DRIVEN DEVELOPMENT.

Перед выводами изучи README.md, другие *.md файлы, linked issues,
PR description, PR comments/discussion и релевантную кодовую базу.

Сверь изменения с исходным ТЗ/спекой и обсуждением. Флагай любой уход
от спеки, недокументированное изменение поведения, отсутствие тестов
для заявленного поведения и security-риск. Если спека не видна,
попроси автора добавить ее в issue или PR description.

Проверь решение с точки зрения формальной верификации: какие инварианты,
предусловия и постусловия можно доказать математически, а где доказуемость
слабая. Оцени решение с точки зрения теории игр: устойчивы ли стимулы,
нет ли выгодного обхода правил, и какое решение было бы сильнее.

Files:

  • packages/lib/src/shell/claude-oauth-env.ts
  • packages/container/tests/core/templates.test.ts
  • packages/container/src/core/templates/dockerfile-prelude.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/app/src/docker-git/controller-compose-files.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.{ts,tsx}: Write property-based tests using fast-check (fc.property) to verify mathematical invariants; unit tests must use Effect test utilities without async/await
Every bug fix must be accompanied by a reproducing test case; the test must fail before the fix and pass after; document the Proof of Fix with root cause and solution

Files:

  • packages/container/tests/core/templates.test.ts
  • packages/app/tests/docker-git/controller-compose.test.ts
  • packages/lib/tests/usecases/auth-claude-login.test.ts
**/{.env*,auth*,config*,setup*}

📄 CodeRabbit inference engine (README.md)

Store authentication tokens in env-file as GIT_AUTH_TOKEN__ / GIT_AUTH_USER__

Files:

  • packages/lib/tests/usecases/auth-claude-login.test.ts
  • packages/lib/src/usecases/auth-claude-oauth.ts
  • packages/lib/src/usecases/auth-claude.ts
🧠 Learnings (2)
📚 Learning: 2026-06-10T10:21:51.286Z
Learnt from: konard
Repo: ProverCoderAI/docker-git PR: 386
File: packages/app/tests/docker-git/gridland-react-singleton.test.ts:0-0
Timestamp: 2026-06-10T10:21:51.286Z
Learning: In `packages/app/tests/docker-git` tests that inspect the `packages/terminal` workspace (e.g., for React-related versions), remember that `react-dom` is intentionally declared as a `devDependency` in `packages/terminal` (the terminal exports components but does not render to the DOM itself). Therefore, test assertions should not require `react-dom` to appear in `dependencies`; when resolving versions, accept either `dependencies` or `devDependencies` (as `resolveDepVersion` does in `gridland-react-singleton.test.ts`).

Applied to files:

  • packages/app/tests/docker-git/controller-compose.test.ts
📚 Learning: 2026-05-22T21:08:18.083Z
Learnt from: skulidropek
Repo: ProverCoderAI/docker-git PR: 344
File: packages/app/src/docker-git/controller-compose.ts:34-40
Timestamp: 2026-05-22T21:08:18.083Z
Learning: In this repo’s docker-git controller compose generation, `${DOCKER_GIT_CONTROLLER_BUILD_SKILLER:-1}` should be treated as standard bash parameter expansion: when `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` is unset, it defaults to the string "1". There is no "-1" mode. The runtime contract enforced by `packages/app/src/docker-git/controller-compose.ts` is: unset / "1" / "true" => output "1"; "0" / "false" => output "0". If review code shows branching/behavior for "-1" or any numeric value other than this 0/1 contract, flag it. Also ensure the Dockerfile ARG `DOCKER_GIT_CONTROLLER_BUILD_SKILLER` stays consistent with default `1`.

Applied to files:

  • packages/app/src/docker-git/controller-compose-files.ts
🔇 Additional comments (5)
.changeset/fix-claude-auth-login-probe.md (1)

5-19: LGTM!

packages/container/tests/core/templates.test.ts (1)

211-211: LGTM!

packages/container/src/core/templates/dockerfile-prelude.ts (1)

87-87: 🩺 Stability & Availability

commit/main.patch корректно резолвится для main, блокера здесь нет.

			> Likely an incorrect or invalid review comment.
packages/lib/src/usecases/auth-claude.ts (1)

64-85: LGTM!

packages/app/tests/docker-git/controller-compose.test.ts (1)

82-160: LGTM!

Comment thread .github/actions/setup/action.yml
Comment thread packages/lib/src/usecases/auth-claude.ts
@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Fresh GitHub Actions on head aedf7d3c6a803e80f588dd90a7e835cfc61e3773 are green: Check 28388765352, Final Build 28388765272, Snapshot 28388765405, and Checking Dependencies 28388765341 all succeeded. There are no current unresolved, non-outdated CodeRabbit review threads. The remaining red status is external to the repository diff: CodeRabbit reports Prepaid credits exhausted — enable usage-based reviews. Maintainer/billing action is needed to clear or rerun that status.

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 5)

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

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $25.551078
  • Token usage: 758,327 input, 64,448 output, 25,482 reasoning, 15,067,648 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (33336KB)


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

@konard

konard commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Auto-restart limit reached

Hive Mind stopped auto-restart-until-mergeable after 5 restart iterations.

Configured limit: 5
Remaining reason: CI failures detected

No further AI sessions will be started automatically for this run. Please review the remaining blockers manually or rerun with a higher --auto-restart-max-iterations value.


Auto-restart-until-mergeable stopped by the safety limit.

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 auth claude login

2 participants