refactor(container): отделить определение контейнера в отдельный пакет (#412)#416
Merged
Merged
Conversation
…ckage (ProverCoderAI#412) Separate the container definition from the panel and the backend. - New leaf package @prover-coder-ai/docker-git-container owns the pure rendering layer (planFiles → Dockerfile/entrypoint.sh/docker-compose.yml, TemplateConfig, resolveCompose* helpers). Zero deps on shell/usecases/api/app. - packages/lib (backend) now depends on it and re-exports the moved symbols, keeping the @effect-template/lib public API unchanged. - Panel: removed the dead duplicate packages/app/src/lib (165 files), its @lib / @effect-template/lib aliases and unused dependency. The no-lib-imports ESLint rule now forbids the panel from importing the backend OR the container-definition package. No runtime behaviour change: generated container files are byte-identical, guaranteed by the unchanged property-based template test suite (moved to the new package). Dependency graph stays acyclic: container <- lib <- api. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…t job (ProverCoderAI#412) Fix CI regressions from extracting @prover-coder-ai/docker-git-container: - packages/api/Dockerfile: controller image enumerated packages explicitly (api/app/session-sync/lib/terminal) and omitted the new container package, so `bun install --frozen-lockfile` failed (lockfile had a workspace member whose package.json was never copied) and the in-image lib build could not find ../container. Add container to mkdir, COPY package.json, the install --filter list, COPY source, and build it before lib. Fixes all docker E2E. - packages/lib/package.json: add prelint/prelint:effect that build the container package, mirroring the existing pretypecheck/pretest. The CI lint job builds nothing, and lib's vibecode-linter runs tsc; without the built container .d.ts, FileSpec/TemplateConfig collapsed to `any` and Match.exhaustive failed (657 errors). Fixes Lint (lib). - .github/workflows/check.yml: add first-class container steps to the build, types, test, lint and lint-effect jobs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…t:effect (ProverCoderAI#412) Run eslint --fix / biome --write across the PR packages (container, lib, app) and keep the resulting auto-fixes. Also drop lib's prelint:effect: lint:effect is plain ESLint and needs no built container .d.ts (it passed in CI without it). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
@coderabbitai проведи REVIEW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #412.
Контекст
Issue #412: «Логика контейнеров должна лежать в отдельном сабмодуле, а сама панель — отдельный модуль.» По уточнению: сабмодуль = workspace-пакет; панель (
app) ↔ REST ↔ бекенд (lib+api) уже разделены; вынести надо определение самого контейнера (Dockerfile / entrypoint / docker-compose — «что есть контейнер и что в нём ставится»), которое лежало внутри бекенда.Что сделано
Phase A — новый leaf-пакет
@prover-coder-ai/docker-git-containerЧистый CORE-слой рендеринга вынесен из
packages/lib:core/сохранён → relative-импорты не тронуты):templates.ts(planFiles),templates-entrypoint*,templates/(Dockerfile + docker-compose),templates-prompt/zsh,template-defaults.ts,shell-literals.ts+templates.test.ts.domain.ts(контейнер-подмножество —TemplateConfig,GpuMode,resolveCompose*…),resource-limits.ts(типResolvedComposeResourceLimits),index.ts.packages/libзависит от пакета и реэкспортирует перенесённые символы → публичный API@effect-template/libне сломан, churn у потребителей нулевой.resource-limits.tsоставлен вlib(завязан на CLIRawOptions/ParseError); в контейнер вынесен только результирующий тип — пакет остаётся полностью чистым.Phase B — убрана мёртвая копия контейнерной логики из панели
packages/app/src/lib(165 файлов дубля) + дублирующий тест/адаптер.@lib-алиасы (4 vite/vitest + tsconfig), неиспользуемая зависимость и билд-шаги@effect-template/libизapp.no-lib-importsрасширено: панели запрещён импорт и бекенда, и контейнерного пакета.Математические гарантии
∀ config ∈ TemplateConfig: planFiles_new(config) ≡ planFiles_old(config)— генерируемыеDockerfile/entrypoint.sh/docker-compose.ymlпобайтово идентичны.packages/container/srcне импортируетshell/,usecases/,api,app(CORE остаётся CORE).container ← lib ← api;appне зависит ни отcontainer, ни отlib.@effect-template/libсохранён через реэкспорт.Proof of fix
lib, а его мёртвая копия — в панельapp; ответственности «панель» и «контейнер» не были выделены в модули.@prover-coder-ai/docker-git-container, от которого зависит только бекенд; мёртвая копия удалена из панели, граница закреплена eslint-правилом.templates.test.ts(64 теста) проходит в новом пакете без изменений → генерация файлов идентична.Verification
🤖 Generated with Claude Code