Skip to content

fix(shell): surface clone source in workspace context#374

Open
rikohomeless wants to merge 2 commits into
ProverCoderAI:mainfrom
rikohomeless:issue-370
Open

fix(shell): surface clone source in workspace context#374
rikohomeless wants to merge 2 commits into
ProverCoderAI:mainfrom
rikohomeless:issue-370

Conversation

@rikohomeless
Copy link
Copy Markdown
Contributor

@rikohomeless rikohomeless commented Jun 4, 2026

Source TZ / Issues

Summary

  • Added a shared terminal project label that includes issue/PR/source context and container name.
  • Used the label in CLI SSH headers, web/controller action context, and API terminal-session persistence.
  • Added unit and property-based tests for issue/PR/MR mappings, source fallback, empty/main refs, and container preservation.
  • Updated the clone auto-open SSH e2e assertion.

Requirements Alignment

  • Implemented: SSH terminal headers and ready labels identify the workspace source context and container instead of only the repo path.
  • Out of scope: persisting the exact raw clone input as a separate state field; the label reconstructs GitHub issue/PR URLs from normalized repoUrl/repoRef.
  • Security-sensitive changes: none.

Verification

  • bun run --filter @effect-template/api test
  • bun run --filter @prover-coder-ai/docker-git-terminal test
  • bun run --filter @prover-coder-ai/docker-git-terminal lint
  • bun run --filter @prover-coder-ai/docker-git-terminal typecheck
  • bun run --filter @prover-coder-ai/docker-git test
  • bun run --filter @prover-coder-ai/docker-git-session-sync test
  • bun run --filter @effect-template/lib test
  • bun run build
  • bun run typecheck
  • bun run lint:effect
  • bun run --filter @effect-template/api lint
  • bun run --filter @effect-template/api typecheck
  • bun run --filter @effect-template/api build
  • bun run check:dist-deps-prune
  • bun run --cwd packages/app build:web:strict
  • git diff --check
  • bun ./packages/app/dist/src/docker-git/main.js --help
  • bun ./packages/docker-git-session-sync/dist/docker-git-session-sync.js --help

Mathematical Guarantees

  • Invariant: issue-n maps to issue #n and a GitHub issue URL when repoUrl is a GitHub remote.
  • Invariant: refs/pull/n/head maps to PR #n and a GitHub PR URL when repoUrl is a GitHub remote.
  • Invariant: refs/merge-requests/n/head maps to MR #n.
  • Invariant: empty and main refs render source context without an extra ref suffix.
  • Invariant: non-empty containerName is preserved in terminal labels after trimming.
  • Complexity: O(|repoUrl| + |repoRef|).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Добавлена новая утилита projectTerminalLabel для генерации детализированного форматирования имён проектов с информацией об issue/PR/MR, source URL и контейнере. Утилита интегрирована в API сервис терминальных сессий и множество UI-компонентов приложения для унифицированного отображения проекта во всех контекстах (SSH заголовки, прогресс-сообщения, навигация). Все тесты и e2e сценарии обновлены для проверки корректного форматирования.

Changes

Интеграция projectTerminalLabel для отображения проекта

Layer / File(s) Summary
Ядро: реализация projectTerminalLabel и переэкспорт
packages/terminal/src/core/project-terminal-label.ts, packages/terminal/src/core/index.ts, packages/terminal/tests/core/project-terminal-label.test.ts
Реализована функция projectTerminalLabel с поддержкой парсинга GitHub/GitLab ссылок и форматирования контекста workspace (issue, pull request, merge request или source URL), плюс опциональный контейнер. Функция переэкспортирована из core/index.ts и покрыта unit-тестами.
API сервис: регистрация терминальной сессии с новым лейблом
packages/api/src/services/terminal-sessions.ts, packages/api/tests/terminal-sessions.test.ts
В createTerminalSession обе ветки (быстрый SSH и запуск SSH) используют projectTerminalLabel при регистрации записи сессии вместо простого displayName. Тест проверяет ожидаемый отформатированный лейбл с issue-ссылкой и контейнером.
App слой: отображение лейбла в SSH, контексте и навигации
packages/app/src/docker-git/open-project-ssh.ts, packages/app/src/web/app-ready-controller-context.ts, packages/app/src/web/app-ready-ssh-link-terminal.ts, packages/app/tests/docker-git/open-project-ssh.test.ts
SSH заголовок и прогресс-сообщения, selected project name в контексте готовности и projectDisplayName в терминальной сессии используют projectTerminalLabel для унифицированного отображения. Тесты обновлены для расширенного формата с source и container.
E2E: проверка автоматического открытия SSH
scripts/e2e/clone-auto-open-ssh.sh
Проверка в clone log обновлена для подтверждения, что авто-открываемый SSH содержит полный лейбл с issue-ссылкой и контейнером.

🎯 3 (Moderate) | ⏱️ ~25 minutes


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 Test file lacks property-based tests for documented invariants (issue-N mapping, PR/MR markers, container handling, displayName fallback), leaving edge cases untested. Add property-based tests with fast-check for invariants: displayName/repoUrl fallback, issue/PR/MR marker generation, container preservation, empty/main ref handling.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed Название четко отражает основное изменение: добавление функциональности для отображения источника клонирования в контексте workspace.
Linked Issues check ✅ Passed Все требования issue #370 реализованы: терминальные заголовки теперь отображают контекст источника (issue/PR), контейнер и исходный URL вместо просто пути репозитория.
Out of Scope Changes check ✅ Passed Все изменения согласованы с целью issue #370; дополнительные изменения ограничены только необходимой функциональностью для реализации требуемого функционала.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Regression ✅ Passed No high-confidence security regressions found. projectTerminalLabel safely extracts GitHub repo paths, constructs display-only labels, and never exposes data in shell execution or file operations.
Description check ✅ Passed PR description полностью соответствует требуемому шаблону с заполненными всеми обязательными секциями.
✨ 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/terminal/tests/core/project-terminal-label.test.ts`:
- Around line 1-31: Add property-based tests using fast-check for
projectTerminalLabel: write fc.assert(fc.property(...)) cases that verify the
invariants — label always contains displayName or repoUrl fallback, issue refs
(`issue-N`) produce "issue #", pull refs (`refs/pull/N/head`) produce "PR #",
non-empty trimmed containerName causes "container" to appear, and label.split("
| ").length >= 2. Also add properties/edge cases for GitLab MR refs
(`refs/merge-requests/N/head`), SSH/ssh:// URLs, empty displayName (fallback to
repoUrl), empty or whitespace-only containerName (should not include container),
empty repoRef and repoRef === "main" (treat as ordinary source), and non-GitHub
URLs to ensure no malformed URL output; implement these in the existing
projectTerminalLabel test suite by importing fast-check (fc) and generating
appropriate fc.record/fc.string/fc.webUrl/fc.option arbitraries that map into
calls to projectTerminalLabel and assertions of the invariants.
🪄 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: 49ff0e84-19ea-4a27-994a-96d03e02e26c

📥 Commits

Reviewing files that changed from the base of the PR and between fd45823 and e7e5e12.

📒 Files selected for processing (10)
  • packages/api/src/services/terminal-sessions.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/terminal/src/core/index.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/terminal/tests/core/project-terminal-label.test.ts
  • scripts/e2e/clone-auto-open-ssh.sh
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: Lint
  • GitHub Check: E2E (Login context)
  • GitHub Check: Test
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Implement Functional Core, Imperative Shell (FCIS) pattern: CORE layer contains only pure functions with immutable data and mathematical operations; SHELL layer isolates all effects (IO, network, database). Strict dependency direction: SHELL → CORE (never reverse).
Never use any, unknown, eslint-disable, ts-ignore, or as type assertions (except in rigorously justified cases with documentation). Always use exhaustive union type analysis through .exhaustive() pattern matching.
All external dependencies must be wrapped through typed interfaces and injected via Effect-TS Layer pattern. Never call external services directly from CORE functions.
Use monadic composition with Effect-TS for all effects: Effect<Success, Error, Requirements>. Compose effects through pipe() and Effect.flatMap(). Implement dependency injection via Layer pattern. Handle errors without try/catch blocks.
All functions must be pure in the CORE layer: no side effects (logging, console output, IO operations, mutations). Separate all side effects into the SHELL layer.
Use exhaustive pattern matching with Effect.Match instead of switch statements. Example: Match.value(item).pipe(Match.when(...), Match.exhaustive).
Document all functions with comprehensive TSDoc including: @pure (true/false), @effect (required services), @invariant (mathematical invariants), @precondition, @postcondition, @complexity (time and space), @throws Never (errors must be typed in Effect).
Use functional comment markers for code clarity: CHANGE (brief description), WHY (mathematical/architectural justification), QUOTE(ТЗ) (requirement citation), REF (RTM or message ID), SOURCE (external source with quote), FORMAT THEOREM (∀x ∈ Domain: P(x) → Q(f(x))), PURITY (CORE|SHELL), EFFECT (Effect type signature), INVARIANT (mathematical invariant), COMPLEXITY (time/space).
Define all external service dependencies as Context.Tag classes with fully typed methods returning Effect types. Example: `class Da...

Files:

  • packages/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Implement property-based testing using fast-check for mathematical properties and invariants. Example: fc.property(fc.array(messageArbitrary), (messages) => isChronologicallySorted(sortMessagesByTimestamp(messages))).
Mock external dependencies in unit tests using Effect's testing utilities. Run tests without Effect runtime for speed. Example: Effect.provide(MockService), Effect.runPromise.

Files:

  • packages/terminal/tests/core/project-terminal-label.test.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/api/tests/terminal-sessions.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Forbidden constructs in CORE code: any, eslint-disable, ts-ignore, async/await, raw Promise chains (then/catch), Promise.all, try/catch for logic control, console.*, switch statements (use Match with .exhaustive() instead)
All functions must use Effect-TS for composing effects: Effect<Success, Error, Requirements>. No direct async/await, Promise chains, or try/catch in product logic.
Functional comments must include: CHANGE, WHY, QUOTE(ТЗ) or n/a, REF, SOURCE or n/a, FORMAT THEOREM, PURITY (CORE|SHELL), EFFECT signature for SHELL functions, INVARIANT, and COMPLEXITY.
All data mutations must use immutable patterns (ReadonlyArray, readonly properties, Object.freeze); mutation in SHELL only when absolutely necessary and documented.

Files:

  • packages/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Property-based tests (fast-check) must verify mathematical invariants; unit tests must use Effect test utilities without async/await.

Files:

  • packages/terminal/tests/core/project-terminal-label.test.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/api/tests/terminal-sessions.test.ts
**/*.{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/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • scripts/e2e/clone-auto-open-ssh.sh
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.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/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • scripts/e2e/clone-auto-open-ssh.sh
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.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/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • scripts/e2e/clone-auto-open-ssh.sh
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.ts
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/terminal/tests/core/project-terminal-label.test.ts
  • packages/terminal/src/core/index.ts
  • scripts/e2e/clone-auto-open-ssh.sh
  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/src/web/app-ready-controller-context.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/terminal/src/core/project-terminal-label.ts
  • packages/api/src/services/terminal-sessions.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: ezocomp118-source
Repo: ProverCoderAI/docker-git PR: 366
File: packages/api/src/services/skiller.ts:366-369
Timestamp: 2026-06-03T17:35:44.689Z
Learning: In ProverCoderAI/docker-git, launching Electron via `setpriv --reuid/--regid` in the controller container causes a `Trace/breakpoint trap` crash even with `--no-sandbox`. The confirmed workaround is to launch Skiller as the controller user (bash -lc) and enforce project scope at the software level via SkillerContainerScope env vars (HOME, XDG_*, DOCKER_GIT_SKILLER_CONTAINER_HOME_PATH) and the add_project tRPC call. A future fix should use gosu/su-exec or a Chromium-sandbox-compatible credential-drop mechanism instead of setpriv. See PR `#366` for full context.
📚 Learning: 2026-05-14T16:02:05.012Z
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: docs/integrations/skiller.md:0-0
Timestamp: 2026-05-14T16:02:05.012Z
Learning: Applies to docs/integrations/**/*.(ts|js)?(@(routes|handlers|api))* : API endpoint `POST /projects/by-key/:projectKey/terminal-sessions/:sessionId/skiller/open` must launch Skiller Electron app, register terminal session filesystem scope, and write output to ~/.docker-git/logs/skiller.log

Applied to files:

  • packages/app/src/web/app-ready-ssh-link-terminal.ts
  • packages/app/tests/docker-git/open-project-ssh.test.ts
  • packages/app/src/docker-git/open-project-ssh.ts
  • packages/api/tests/terminal-sessions.test.ts
  • packages/api/src/services/terminal-sessions.ts
📚 Learning: 2026-05-13T07:10:13.213Z
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-13T07:10:13.213Z
Learning: Interop with Promise/exceptions is permitted ONLY in SHELL via `Effect.try` or `Effect.tryPromise` with typed error mapping.

Applied to files:

  • packages/app/src/docker-git/open-project-ssh.ts
📚 Learning: 2026-05-13T07:09:47.992Z
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-05-13T07:09:47.992Z
Learning: Applies to package.json : Dependencies must include Effect-TS (`effect: ^3.x`) for monadic effects and `effect/schema: ^0.x` for validation with strong typing.

Applied to files:

  • packages/app/src/docker-git/open-project-ssh.ts
📚 Learning: 2026-05-13T07:09:47.992Z
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-05-13T07:09:47.992Z
Learning: Applies to **/*.{ts,tsx} : Use monadic composition with Effect-TS for all effects: `Effect<Success, Error, Requirements>`. Compose effects through `pipe()` and `Effect.flatMap()`. Implement dependency injection via Layer pattern. Handle errors without try/catch blocks.

Applied to files:

  • packages/app/src/docker-git/open-project-ssh.ts
📚 Learning: 2026-05-13T07:10:13.213Z
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-13T07:10:13.213Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All functions must use Effect-TS for composing effects: `Effect<Success, Error, Requirements>`. No direct async/await, Promise chains, or try/catch in product logic.

Applied to files:

  • packages/app/src/docker-git/open-project-ssh.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/open-project-ssh.ts
📚 Learning: 2026-05-18T07:43:38.131Z
Learnt from: skulidropek
Repo: ProverCoderAI/docker-git PR: 313
File: packages/api/src/services/panel-cloudflare-tunnel.ts:123-135
Timestamp: 2026-05-18T07:43:38.131Z
Learning: In this repo’s ProverCoderAI/docker-git architecture, it is intentional for service modules under packages/api/src/services/ to call Node.js APIs directly (e.g., fs, child_process, fetch). Do not treat direct Node API usage in these service modules as a dependency-injection (DI) violation. This codebase provides the NodeContext at the program boundary (entry point) rather than injecting Context.Tag/Layer services into individual service modules; reviewers should only flag DI/context issues if the expected boundary setup is missing.

Applied to files:

  • packages/api/src/services/terminal-sessions.ts
🪛 OpenGrep (1.22.0)
packages/terminal/src/core/project-terminal-label.ts

[ERROR] 74-74: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 79-79: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 86-86: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

🔇 Additional comments (15)
packages/terminal/src/core/project-terminal-label.ts (5)

19-34: LGTM!


46-68: LGTM!


70-94: LGTM!


101-134: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Функция корректна, но стиль может не соответствовать guidelines в части Effect-TS.

Функция реализована как чистая функция без Effect-TS обёртки. Согласно guidelines, "All functions must use Effect-TS for composing effects", однако эта функция помечена @effect none и @throws Never, что указывает на отсутствие эффектов для композиции.

Для чисто математических/форматирующих функций CORE-слоя без эффектов такой подход может быть приемлемым, но guidelines неоднозначны в этом вопросе.

Логика функции корректна:

  • Обработка пустых значений через trim и fallback ✓
  • Детерминированное форматирование контекста issue/PR/MR ✓
  • Опциональное добавление containerName ✓
  • Сложность O(n) соответствует заявленной ✓
⛔ Skipped due to learnings
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-05-13T07:09:47.992Z
Learning: Applies to **/*.{ts,tsx} : Use functional comment markers for code clarity: CHANGE (brief description), WHY (mathematical/architectural justification), QUOTE(ТЗ) (requirement citation), REF (RTM or message ID), SOURCE (external source with quote), FORMAT THEOREM (∀x ∈ Domain: P(x) → Q(f(x))), PURITY (CORE|SHELL), EFFECT (Effect type signature), INVARIANT (mathematical invariant), COMPLEXITY (time/space).
Learnt from: CR
Repo: ProverCoderAI/docker-git PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-13T07:10:13.213Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Functional comments must include: CHANGE, WHY, QUOTE(ТЗ) or n/a, REF, SOURCE or n/a, FORMAT THEOREM, PURITY (CORE|SHELL), EFFECT signature for SHELL functions, INVARIANT, and COMPLEXITY.

8-10: Regex-паттерны для repoRef соответствуют форматам, которые формирует/обрабатывает docker-git

  • ^issue-(\d+)$ соответствует repoRef: "issue-<n>", который используется в парсинге issue.
  • ^refs/pull/(\d+)/head$ соответствует repoRef: \refs/pull//head`, который генерируется в коде и ожидается в bash-шаблонах (refs/pull/*/head`).
  • ^refs/merge-requests/(\d+)/head$ соответствует repoRef: \refs/merge-requests//head`, который генерируется и проверяется в шаблонах (refs/merge-requests/*/head`).
packages/terminal/src/core/index.ts (1)

3-3: LGTM!

packages/app/src/web/app-ready-controller-context.ts (2)

1-1: LGTM!


28-28: Проверьте совместимость типов ProjectSummary и ProjectTerminalLabelInput в вызове projectTerminalLabel()

ProjectTerminalLabelInput требует displayName, repoUrl, repoRef, и containerName?. ApiProjectSummary содержит эти поля с теми же типами. Но DashboardData описывает projects: ReadonlyArray<ProjectSummary>, поэтому нужно посмотреть, что именно такое ProjectSummary (совпадает ли по полям/типам с ApiProjectSummary) и что selectedProjectSummary корректно приводится к ProjectTerminalLabelInput в projectTerminalLabel().

packages/app/src/web/app-ready-ssh-link-terminal.ts (2)

1-1: LGTM!


140-140: Проверка совместимости DashboardProject с ProjectTerminalLabelInput

DashboardProject (DashboardData["projects"][number]) содержит все требуемые поля для ProjectTerminalLabelInput: displayName, repoRef, repoUrl и опциональное containerName, поэтому вызов projectTerminalLabel(project) на этом месте типобезопасен.

packages/api/src/services/terminal-sessions.ts (1)

30-30: LGTM!

Also applies to: 1403-1403, 1425-1425

packages/api/tests/terminal-sessions.test.ts (1)

417-417: LGTM!

packages/app/src/docker-git/open-project-ssh.ts (1)

4-4: LGTM!

Also applies to: 160-160, 207-207, 209-209, 245-245

packages/app/tests/docker-git/open-project-ssh.test.ts (1)

72-72: LGTM!

Also applies to: 74-74

scripts/e2e/clone-auto-open-ssh.sh (1)

249-250: LGTM!

Comment thread packages/terminal/tests/core/project-terminal-label.test.ts
@rikohomeless
Copy link
Copy Markdown
Contributor Author

rikohomeless commented Jun 4, 2026

AI Session Backup

Commit: d02ecf8
Status: success
Files: 3 (3.26 MB)
Links: README | Manifest

git status

On branch issue-370
nothing to commit, working tree clean

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

Labels

None yet

Projects

None yet

1 participant