Skip to content

[codex] Use openapi-effect client#431

Merged
skulidropek merged 8 commits into
mainfrom
codex/openapi-effect-client
Jun 20, 2026
Merged

[codex] Use openapi-effect client#431
skulidropek merged 8 commits into
mainfrom
codex/openapi-effect-client

Conversation

@skulidropek

@skulidropek skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member

Source TZ / Issues

  • Source TZ: user-requested migration from openapi-fetch to @prover-coder-ai/openapi-effect for the docker-git OpenAPI client boundary.
  • Related discussion: PR [codex] Use openapi-effect client #431 review feedback, including CodeRabbit review 4535473023.
  • Fixes: no linked GitHub issue.

Requirements Alignment

Implemented

  • Replaces the shared OpenAPI transport dependency from openapi-fetch to @prover-coder-ai/openapi-effect.
  • Uses the published @prover-coder-ai/openapi-effect@1.0.27 package exports directly; removes the local TypeScript shim and tsconfig path aliases.
  • Keeps the public docker-git OpenAPI facade in packages/openapi, with app callers using the shared dockerGitOpenApi runtime instead of a duplicated app-local client.
  • Adapts app REST helpers to the strict openapi-effect model: 2xx responses are read from the success channel as { status, contentType, body }, while HTTP and boundary failures are rendered from the typed error channel.
  • Renders UnexpectedStatus through renderOpenApiBody(error.body) consistently with other OpenAPI failure branches.
  • Adds explicit Effect.Effect<Success, string> return type annotations to the public web API helpers touched by the review in api-create-project.ts, api-database.ts, api-prompts.ts, api-skills.ts, and api-tasks.ts.
  • Adds TSDoc and functional architecture comments for the database API helpers and startCreateProject boundary.
  • Keeps regression tests for Effect-native request execution, nested error envelopes, command responses, no-cache transport invariants, and JSON null transport values.

Out of scope

  • No server route behavior changes.
  • No OpenAPI contract shape changes beyond consuming the existing generated contract through openapi-effect.
  • No changes to CodeRabbit billing/review add-on configuration.

Security-sensitive

  • No credentials, tokens, or auth material are added.
  • GET cache-busting remains limited to request URL/query and no-cache headers.
  • Failure rendering preserves typed error-channel handling and does not expose raw transport objects to UI callers.

Mathematical Guarantees

Invariants

  • forall request r: dockerGitOpenApi(r) returns Effect<OpenApiSuccess, OpenApiFailure> and never exposes a raw Promise from the shared client boundary.
  • forall failure f: OpenApiFailure(f) is handled by exhaustive Match before it crosses the UI-facing facade as a string error.
  • forall GET request g: g is sent with no-cache headers and a cache-busting query key.
  • forall public web helper h: h exposes an explicit Effect.Effect<Success, string> return type at the module boundary.

Preconditions

  • The API server implements the generated docker-git OpenAPI paths.
  • App callers construct REST requests through the shared dockerGitOpenApi runtime.
  • @prover-coder-ai/openapi-effect@1.0.27 or newer is available from npm with public type exports.

Postconditions

  • Frontend REST helpers compose through Effect-native OpenAPI requests.
  • openapi-fetch is no longer referenced by app/openapi package code or lockfile state.
  • The local openapi-effect.d.ts facade is removed; TypeScript resolves the package's published declarations.
  • JSON null is preserved as a valid raw transport value rather than being treated as an empty response.
  • Unexpected-status diagnostics render response bodies through the shared OpenAPI body formatter.

Complexity

  • Client construction: O(1) time / O(1) space.
  • Response validation/rendering: O(n) time in payload size / O(n) worst-case render space.
  • Per-helper response projection: O(1) time / O(1) space, excluding transport and payload decoding.

Proof of fix

  • Cause: the shared OpenAPI facade originally depended on openapi-fetch, and the first openapi-effect migration needed a local type shim because the published package did not export usable declaration files. Later review feedback also found one inconsistent UnexpectedStatus render path and missing explicit public helper return annotations.
  • Solution: publish and consume @prover-coder-ai/openapi-effect@1.0.27, remove local path aliases/shim, adapt docker-git app calls to the package's strict success/error-channel API, render UnexpectedStatus via renderOpenApiBody, and add explicit Effect return annotations plus boundary docs.
  • Proof: packages/app/tests/docker-git/openapi-effect-client.test.ts covers direct OpenAPI Effect execution, nested error rendering, command responses, no-cache invariants, and JSON null handling.

Verification

  • rtk bun run --cwd packages/openapi typecheck
  • rtk bun run --cwd packages/app typecheck
  • rtk bun run --cwd packages/app lint
  • rtk bun run --cwd packages/app vitest run tests/docker-git/openapi-effect-client.test.ts
  • rtk bun run lint:effect
  • git diff --check
  • GitHub Actions on head 66b76115: Build, Types, Lint, Test, Snapshot, Dist deps prune, Final builds, and E2E checks completed successfully.

Current external status

  • CodeRabbit status is blocked by account billing: Prepaid credits exhausted — enable the review add-on.

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: b280293
Status: success
Files: 17 (21.98 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek skulidropek changed the title refactor(openapi): use openapi-effect client [codex] Use openapi-effect client Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Замена транспортного клиента OpenAPI с openapi-fetch на @prover-coder-ai/openapi-effect в packages/openapi. Добавлена система нормализации данных в api-normalize.ts. Введён синглтон dockerGitOpenApi с error-rendering в api-http.ts. Все девять API-модулей приложения переведены на новый клиент. Тесты обновлены с новыми мокированиями и расширены comprehensive openapi-effect-client тестами. Комментарии-референсы обновлены.

Changes

Миграция на openapi-effect и нормализация данных

Layer / File(s) Summary
Новая библиотека openapi-effect и типы транспорта
packages/openapi/package.json, packages/openapi/src/client.ts
Зависимость заменена на @prover-coder-ai/openapi-effect ^1.0.27. В client.ts переработаны типы: DockerGitOpenApiClient теперь ClientEffect<paths>, DockerGitOpenApiClientOptionsClientOptions из openapi-effect. Добавлены openApiJsonNoCacheHeaders, withDockerGitDefaults и createClient(options) для инициализации effect-клиента с noCacheGetMiddleware.
Граница web: dockerGitOpenApi синглтон и обработка ошибок
packages/app/src/web/api-http.ts
Добавлены типы RenderableOpenApiBody, RenderableOpenApiHttpError, RenderableOpenApiFailure на web-boundary. Реализована renderDockerGitOpenApiFailure для унифицированной обработки ошибок через Match по _tag с особой веткой для HTTP 429. Экспортирован синглтон dockerGitOpenApi = createClient({ baseUrl: resolveApiBaseUrl() }).
Нормализация данных: api-normalize.ts
packages/app/src/web/api-normalize.ts
Добавлен новый модуль с функциями-нормализаторами: normalizeProjectSummary, normalizeProjectDetails, normalizeAuthSnapshot, normalizeProjectAuthSnapshot, normalizeTerminalSession, normalizePanelCloudflareTunnelSession, normalizeNullablePanelCloudflareTunnelSession. Преобразуют типы "transport" в UI-совместимые с точной семантикой exact-optional полей.
Замена вызовов OpenAPI в API-модулях
packages/app/src/web/api-create-project.ts, api-database.ts, api-project-core.ts, api-prompts.ts, api-share.ts, api-skills.ts, api-tasks.ts, api-terminal.ts, api.ts
Во всех девяти модулях удалён импорт из ./openapi-client.js, добавлены dockerGitOpenApi и renderDockerGitOpenApiFailure из ./api-http.js. Все вызовы openApiJsonSchema(...) и openApiVoid(...) заменены на dockerGitOpenApi.<METHOD>(...) с сохранением контрактов эндпоинтов. Добавлены вызовы нормализаторов для результатов (project, auth snapshots, terminal sessions, tunnel sessions). Единообразная обработка ошибок через Effect.mapError(renderDockerGitOpenApiFailure).
Тесты: обновление мокирования и новые comprehensive тесты
packages/app/tests/docker-git/api-terminal.test.ts, packages/app/tests/docker-git/openapi-effect-client.test.ts
В api-terminal.test.ts vi.mock переключён с openapi-client.js на api-http.js с объектом dockerGitOpenApi. Добавлен новый файл openapi-effect-client.test.ts с четырьмя тестовыми наборами: (1) типизированные GET-запросы с валидацией декодирования и транспортных инвариантов; (2) property-based тесты через fast-check для error-envelopes и инвариантов transport; (3) обработка HTTP 500 с error-rendering; (4) void-ответы.
Обновление комментариев-референсов
packages/api/src/api/openapi.ts, packages/api/src/http.ts
В документирующих комментариях обновлены REF и SOURCE: openapi-fetch заменён на openapi-effect. SOURCE в http.ts обновлён с n/a на https://github.com/ProverCoderAI/openapi-effect.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • ProverCoderAI/docker-git#427: PR выполнил первоначальную интеграцию OpenAPI-клиента и контракта в приложении, на которую опирается текущий PR при полной миграции на openapi-effect и введении нормализации данных.
  • ProverCoderAI/docker-git#313: Рефакторинг api-share.ts в текущем PR опирается на Cloudflare "panel share" API (loadPanelCloudflareTunnel/startPanelCloudflareTunnel/stopPanelCloudflareTunnel), добавленный в этом PR.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Requirements Alignment ❌ Error PR implements openapi-effect migration but violates stated invariants: UnexpectedStatus error renders body via string interpolation (line 141) instead of renderOpenApiBody, contradicting the exhaus... Fix line 141 to use renderOpenApiBody(error.body) consistently with other error cases; add explicit Effect<...> return type annotations to all public API functions in api-tasks.ts, api-skills.ts, api-prompts.ts, api-database.ts, and api-...
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: migration from openapi-fetch to openapi-effect client library, which is reflected throughout the diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Regression ✅ Passed Проверка не выявила высокоуверенных регрессий безопасности: отсутствуют command injection, path traversal, credential exposure, или проблемы с supply-chain risk. Старая зависимость openapi-fetch уд...
Description check ✅ Passed Pull request description is comprehensive and well-structured, following the template with all required sections completed: Source TZ/Issues, Requirements Alignment (Implemented, Out of scope, Security-sensitive), Mathematical Guarantees, Proof of fix, and Verification.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/openapi-effect-client

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 and usage tips.

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 7d9deb6
Status: success
Files: 17 (23.53 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@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

🤖 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/api/src/http.ts`:
- Line 320: Review the documentation comments in both
packages/api/src/api/openapi.ts (line 786) and packages/api/src/http.ts (line
320) regarding the openapi-effect source. Determine whether the division is
intentional with openapi.ts documenting spec generation and http.ts documenting
spec exposure, or if both files should consistently reference the same SOURCE.
If the latter is true, add a SOURCE comment in http.ts matching the GitHub URL
from openapi.ts to maintain documentation consistency across related files. If
the division of responsibility is intentional and clear, the current separation
is acceptable.

In `@packages/app/tests/docker-git/openapi-effect-client.test.ts`:
- Around line 41-124: The test file currently only contains example-based test
scenarios but is missing property-based tests using fast-check as required by
the coding guidelines. Add at least one fc.property test that verifies
mathematical invariants of the OpenAPI Effect client. Suggested invariants
include: verifying that null values are preserved as valid JSON transport values
across different response scenarios, or verifying that the no-cache behavior is
correctly applied to GET requests regardless of the base URL provided to
resolveBaseUrl. Use the existing it.effect pattern combined with fast-check
generators (like fc.webUrl) to generate test inputs, and ensure the invariant
holds true for all generated cases without using async/await.
🪄 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: bf2a1f41-44c4-4f79-8188-6ad5e34434e9

📥 Commits

Reviewing files that changed from the base of the PR and between 126710b and 7d9deb6.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • packages/api/src/api/openapi.ts
  • packages/api/src/http.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/openapi-client.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/package.json
  • packages/openapi/src/client.ts
💤 Files with no reviewable changes (1)
  • packages/app/src/web/openapi-client.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: Test
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Login context)
  • GitHub Check: Lint
  • GitHub Check: E2E (Browser command)
  • GitHub Check: Final build (windows-latest)
🧰 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/app/src/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/web/api-prompts.ts
  • packages/api/src/http.ts
  • packages/api/src/api/openapi.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api-tasks.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-create-project.ts
  • packages/openapi/src/client.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/app/tests/docker-git/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.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/openapi/package.json
🧠 Learnings (1)
📚 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/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
🔇 Additional comments (25)
packages/api/src/api/openapi.ts (1)

785-786: 💤 Low value

Комментарий документирует методологию, но SOURCE требует валидации.

Обновления REF и SOURCE отражают смену инструмента генерации (openapi-fetch → openapi-effect). Однако:

  1. Валидация SOURCE URL: Убедитесь, что https://github.com/ProverCoderAI/openapi-effect является корректным публичным репозиторием и что версия/коммит используемой библиотеки в packages/openapi/package.json согласуется с этим URL.

  2. Классификация комментария: Если openapi-effect — это внешняя зависимость (как @prover-coder-ai/openapi-effect), то SOURCE должен указывать на npm-пакет или конкретный коммит для воспроизводимости (например: SOURCE: https://www.npmjs.com/package/@prover-coder-ai/openapi-effect@<version>).

Это документационный комментарий, но в соответствии с требованиями к SOURCE-ссылкам в архитектуре FP он должен быть полностью проверяем.

packages/app/tests/docker-git/api-terminal.test.ts (1)

35-39: LGTM!

packages/app/src/web/api-http.ts (1)

5-5: LGTM!

Also applies to: 88-101

packages/app/src/web/api.ts (1)

6-6: LGTM!

Also applies to: 116-117, 145-153, 155-163, 165-173, 175-189, 191-200, 201-207, 208-214, 215-215, 217-223, 224-227, 229-235, 254-257, 272-274, 276-282, 284-293, 295-308

packages/app/src/web/api-project-core.ts (1)

4-4: LGTM!

Also applies to: 28-33, 35-41, 43-44, 55-56, 64-69, 71-73, 81-86, 88-90

packages/app/src/web/api-database.ts (1)

3-3: LGTM!

Also applies to: 19-19, 30-30, 45-45, 60-60, 70-70, 84-88, 90-91, 102-103, 113-113

packages/app/src/web/api-create-project.ts (1)

3-3: LGTM!

Also applies to: 45-45

packages/app/src/web/api-terminal.ts (1)

3-3: LGTM!

Also applies to: 14-15, 31-32, 44-45, 58-59, 65-66, 74-75, 87-88, 99-100, 114-115, 125-126

packages/app/src/web/api-tasks.ts (1)

3-4: LGTM!

Also applies to: 7-8, 24-25, 35-36

packages/app/src/web/api-prompts.ts (1)

3-6: LGTM!

Also applies to: 8-10, 23-25, 38-40

packages/app/src/web/api-skills.ts (1)

3-3: LGTM!

Also applies to: 20-21, 36-37, 52-53

packages/app/src/web/api-share.ts (1)

3-3: LGTM!

Also applies to: 28-30, 57-60, 89-91

packages/openapi/package.json (1)

30-32: LGTM!

packages/openapi/src/client.ts (12)

4-12: LGTM!


23-51: LGTM!


53-83: LGTM!


85-109: LGTM!


111-118: LGTM!


120-163: LGTM!


165-183: LGTM!


207-224: LGTM!


235-242: LGTM!


244-307: LGTM!


309-351: LGTM!


185-200: Коммилятор TypeScript уже гарантирует соответствие BoundaryError при компиляции через Match.exhaustive.

Match.exhaustive обеспечивает compile-time проверку: если union BoundaryError содержит теги, отличные от обработанных здесь (HttpError, TransportError, UnexpectedStatus, UnexpectedContentType, ParseError, DecodeError), сборка упадёт. Поскольку код находится в репозитории и компилируется успешно, исчерпывающее покрытие гарантировано архитектурой. Дополнительная верификация не требуется.

Comment thread packages/api/src/http.ts
Comment thread packages/app/tests/docker-git/openapi-effect-client.test.ts
@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: a603c4e
Status: success
Files: 17 (24.75 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: a8ab4ed
Status: success
Files: 17 (25.63 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@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

🤖 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/tests/docker-git/openapi-effect-client.test.ts`:
- Around line 62-80: The catch handler in the Effect.tryPromise call within the
assertOpenApiClientProperty function is returning the cause as-is, which results
in an unknown type. To improve type safety and align with coding guidelines,
modify the catch handler to map the caught exception into a properly typed
error. Instead of returning the raw cause, construct a new Error or
application-specific error type that wraps the caught exception, ensuring the
error has a consistent and known type throughout the Effect error channel.
🪄 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: 66886fe6-782e-46dc-bdd4-75e1e68633e8

📥 Commits

Reviewing files that changed from the base of the PR and between 7d9deb6 and a8ab4ed.

📒 Files selected for processing (3)
  • packages/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: E2E (Login context)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: Lint
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.ts
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/api/src/http.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/src/client.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/app/tests/docker-git/openapi-effect-client.test.ts
🧠 Learnings (1)
📚 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/openapi-effect-client.test.ts
🔇 Additional comments (10)
packages/api/src/http.ts (1)

321-321: Документирующий комментарий полностью обновлён.

Верификация подтвердила, что на строках 320–321 в packages/api/src/http.ts:

  • REF: user-message-2026-06-19-openapi-effect (совпадает с openapi.ts:785)
  • SOURCE: https://github.com/ProverCoderAI/openapi-effect (совпадает с openapi.ts:786)

Комментарий содержит полный набор функциональных маркеров: CHANGE, WHY, QUOTE(ТЗ), REF, SOURCE, FORMAT THEOREM, PURITY, EFFECT, INVARIANT. Документация консистентна между http.ts (маршрут экспозиции) и openapi.ts (генератор спеки).

packages/openapi/src/client.ts (4)

10-10: LGTM!

Also applies to: 23-37


120-127: LGTM!


145-162: LGTM!


205-211: LGTM!

packages/app/tests/docker-git/openapi-effect-client.test.ts (5)

2-7: LGTM!


43-60: LGTM!


114-122: LGTM!


124-158: LGTM!


185-192: LGTM!

Comment thread packages/app/tests/docker-git/openapi-effect-client.test.ts
@skulidropek skulidropek force-pushed the codex/openapi-effect-client branch from a8ab4ed to 10afed0 Compare June 19, 2026 20:52
@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 10afed0
Status: success
Files: 17 (25.83 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 25cb31e
Status: success
Files: 17 (26.07 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 30c1e10
Status: success
Files: 18 (33.16 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@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

🤖 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/web/api-create-project.ts`:
- Around line 41-55: The function startCreateProject lacks required
documentation and functional comments per coding guidelines. Add a TSDoc comment
block above the function with mandatory fields including `@pure`, `@effect`,
`@invariant`, `@precondition`, `@postcondition`, `@complexity`, and `@throws`.
Additionally, include functional comments with CHANGE, WHY, REF, SOURCE, PURITY,
and EFFECT to document the implementation details and rationale for this
Effect-based API call wrapper.

In `@packages/app/src/web/api-database.ts`:
- Around line 11-17: All eight exported API database functions
(loadProjectDatabaseProfiles, loadProjectDatabaseForwards,
saveProjectDatabaseProfile, deleteProjectDatabaseProfile,
exposeProjectDatabaseProfile, deleteProjectDatabaseForward,
loadProjectDatabaseSession, openProjectDatabaseEditor,
restartProjectDatabaseEditor) are missing explicit return type annotations and
TSDoc documentation. Add explicit Effect return type annotations to each
function signature (including the error type), and add comprehensive TSDoc
blocks with `@pure`, `@effect`, `@invariant`, `@precondition`, `@postcondition`,
`@complexity`, and `@throws` fields. Additionally, add functional inline comments
above each function documenting CHANGE, WHY, REF, SOURCE, PURITY: SHELL, and
EFFECT to comply with coding guidelines for public API signatures.

In `@packages/app/src/web/api-http.ts`:
- Around line 134-149: In the renderDockerGitOpenApiFailure function, the
UnexpectedStatus match case is inconsistently handling error.body by
interpolating it directly in the template string, whereas the HttpError match
case uses renderOpenApiBody to process the body. Update the UnexpectedStatus
match case to call renderOpenApiBody(error.body) instead of directly using
error.body in the template string to ensure consistent body rendering across all
match cases and prevent [object Object] output when body is an object.

In `@packages/app/src/web/api-prompts.ts`:
- Around line 6-12: The exported API functions loadProjectPrompts (line 6) and
the functions at lines 14 and 27 are missing explicit return type annotations
and rely on type inference instead. Add explicit return type annotations to each
of these exported functions using the Effect.Effect generic type with the
appropriate type parameters (Success type, Error type which should be string,
and Requirements). For example, if loadProjectPrompts returns an Effect that
resolves to a snapshot, declare the return type explicitly as
Effect.Effect<SnapshotType, string, never> or similar, ensuring the contract is
clear and won't drift with future client changes.

In `@packages/app/src/web/api-skills.ts`:
- Around line 18-24: The exported functions loadProjectSkills, and the other
public functions at lines 26 and 40 are missing explicit return type annotations
and rely on type inference. Add explicit return type annotations to all three
exported functions to maintain a stable and readable API contract. For each
function, specify the return type as an Effect with the appropriate generic
parameters representing the success type (the actual data returned) and the
error type (the error that can be thrown).

In `@packages/app/src/web/api-tasks.ts`:
- Around line 5-14: The functions loadProjectTasks, stopProjectTask, and
loadProjectTaskLogs at lines 5, 16, and 27 have implicit return types that are
inferred from their implementations. Add explicit return type annotations to all
three functions using the Effect.Effect<...> generic type to specify what type
of Effect they return. This makes the public API contract explicit and prevents
unintended changes to the signature when the underlying transport or
transformation logic changes.
🪄 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: 7fe68447-fcf9-4c12-ac58-08548c7daa38

📥 Commits

Reviewing files that changed from the base of the PR and between a8ab4ed and 30c1e10.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-normalize.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-skills.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-terminal.ts
  • packages/app/src/web/api.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/openapi/package.json
  • packages/openapi/src/client.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Login context)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: Lint
  • GitHub Check: Test
  • GitHub Check: Final build (windows-latest)
🧰 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/app/src/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/web/api-skills.ts
  • packages/app/tests/docker-git/api-terminal.test.ts
  • packages/app/src/web/api-create-project.ts
  • packages/app/src/web/api-tasks.ts
  • packages/app/src/web/api-share.ts
  • packages/app/src/web/api-prompts.ts
  • packages/openapi/package.json
  • packages/app/src/web/api-http.ts
  • packages/app/src/web/api-project-core.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
  • packages/app/src/web/api.ts
  • packages/app/src/web/api-database.ts
  • packages/app/src/web/api-normalize.ts
  • packages/openapi/src/client.ts
  • packages/app/src/web/api-terminal.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/app/tests/docker-git/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.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/openapi/package.json
🧠 Learnings (1)
📚 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/api-terminal.test.ts
  • packages/app/tests/docker-git/openapi-effect-client.test.ts
🔇 Additional comments (21)
packages/app/tests/docker-git/api-terminal.test.ts (1)

12-40: LGTM!

packages/app/tests/docker-git/openapi-effect-client.test.ts (1)

3-221: LGTM!

packages/openapi/src/client.ts (4)

1-20: LGTM!


22-41: LGTM!


43-53: LGTM!

Also applies to: 64-69


85-91: API client.use() из @prover-coder-ai/openapi-effect подтверждена.

Метод client.use(noCacheGetMiddleware) действительно существует в openapi-effect и является стандартным паттерном для регистрации middleware. Тесты (lines 151–181 в openapi-effect-client.test.ts) подтверждают, что middleware правильно применяется: GET запросы получают cache-busting параметры и no-cache заголовки. Мутирующий паттерн здесь ожидаемый и корректный для данной библиотеки.

packages/app/src/web/api-http.ts (4)

23-32: LGTM!


100-108: LGTM!


6-6: Импорт и зависимость согласованы корректно. Пакет называется @prover-coder-ai/docker-git-openapi как в packages/openapi/package.json, так и в импорте. Нет несоответствия имени пакета.

			> Likely an incorrect or invalid review comment.

163-163: Синглтон клиента инициализируется один раз при загрузке модуля.

resolveApiBaseUrl() вызывается на строке 163 при создании dockerGitOpenApi, и результат закрепляется в конфигурации клиента. Если переменные окружения изменятся после инициализации, клиент сохранит старое значение.

Однако стоит отметить, что requestText и requestTextStream (строки 173, 189) вызывают resolveApiBaseUrl() динамически при каждом запросе—это асимметрия архитектуры. Большинство кода использует статичный dockerGitOpenApi, поэтому для SPA это обычно не проблема (env не меняются runtime), но если требуется горячее переключение API URL, нужна переработка.

packages/openapi/package.json (1)

30-30: Supply-chain риск минимален: пакет безопасен.

Проверка @prover-coder-ai/openapi-effect@1.0.27 подтверждает легитимность:

  • Опубликован в npm registry, лицензия ISC (открытая)
  • Мейнтейнер: skulidropek (официальный из ProverCoderAI)
  • Repository: https://github.com/ProverCoderAI/openapi-effect (внутренний репо организации)
  • Нет найденных уязвимостей
  • Зависимости минимальны (effect, openapi-typescript-helpers)

Замена трёх пакетов (openapi-fetch → openapi-effect с встроенным управлением effect/@effect/schema) — позитивный рефакторинг, консолидирующий зависимости.

packages/app/src/web/api-normalize.ts (3)

194-199: LGTM!


215-217: LGTM!


58-66: Указанное требование не содержится в coding_guidelines для этого файла.

Обзорный комментарий ссылается на guideline, которого нет в документированных требованиях проекта. В provided coding_guidelines отсутствует правило **/*.test.{ts,tsx}: Write property-based tests using fast-check.

Функция normalizeAuthProviderSnapshotFields в packages/app/src/web/api-normalize.ts имеет полную TSDoc-документацию с явно описанным инвариантом (@invariant missing codex/grok counts become 0 and missing paths become empty strings), что соответствует требованиям к документированию математических свойств.

Добавление property-based теста было бы опциональным улучшением (функция логически тривиальна — простая подстановка значений через ??), но не является обязательным по документам проекта.

packages/app/src/web/api-project-core.ts (3)

27-49: LGTM!


51-61: LGTM!

Also applies to: 77-100


63-75: Код соответствует требованиям exhaustiveness matching.

OpenAPI спецификация для POST /projects определяет ровно два успешных статуса: 201 и 202. TypeScript типы из openapi-paths.ts подтверждают, что success имеет точное объединение только этих двух статусов. Текущая реализация с Match.when для обоих 201 и 202 плюс Match.exhaustive корректно покрывает все возможные успешные ответы. TypeScript компилятор гарантирует exhaustiveness.

packages/app/src/web/api-share.ts (1)

27-31: LGTM!

Also applies to: 54-60, 83-87

packages/app/src/web/api-terminal.ts (1)

6-115: LGTM!

packages/app/src/web/api.ts (1)

109-125: LGTM!

Also applies to: 145-235, 273-303

packages/app/src/web/api-create-project.ts (1)

49-53: Покрытие Match.exhaustive полно; дополнительные 2xx статусы отсутствуют.

OpenAPI-спецификация определяет для POST /projects ровно два статуса успеха: 201 и 202. Оба учтены в Match-выражении. Типы openapi-typescript генерируют union только из объявленных в спеке ответов, поэтому TypeScript гарантирует исчерпывающее покрытие на этапе компиляции. Обработка статуса 201 как ошибки в startCreateProject — это намеренное поведение: функция отправляет асинхронный запрос (async=true) и ожидает 202; статус 201 указывает на неожиданный синхронный ответ.

Comment thread packages/app/src/web/api-create-project.ts
Comment thread packages/app/src/web/api-database.ts Outdated
Comment thread packages/app/src/web/api-http.ts
Comment thread packages/app/src/web/api-prompts.ts Outdated
Comment thread packages/app/src/web/api-skills.ts Outdated
Comment thread packages/app/src/web/api-tasks.ts Outdated
@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 753f7b4
Status: success
Files: 18 (33.33 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek

skulidropek commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 66b7611
Status: success
Files: 19 (35.00 MB)
Links: README | Manifest

git status

On branch codex/openapi-effect-client
Your branch is up to date with 'origin/codex/openapi-effect-client'.

nothing to commit, working tree clean

@skulidropek skulidropek merged commit 08ee941 into main Jun 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant