Skip to content

fix(api): expose federation status route#294

Merged
skulidropek merged 4 commits into
mainfrom
fix-federation-status-route
May 13, 2026
Merged

fix(api): expose federation status route#294
skulidropek merged 4 commits into
mainfrom
fix-federation-status-route

Conversation

@skulidropek
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d3f79983-3255-40cc-91b8-c163737a3ba2

📥 Commits

Reviewing files that changed from the base of the PR and between 7566e68 and 126cab3.

📒 Files selected for processing (2)
  • packages/api/src/http.ts
  • packages/api/tests/http-config.test.ts
📜 Recent 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). (12)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (Login context)
  • GitHub Check: Lint
  • GitHub Check: Dist deps prune
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: Test
  • GitHub Check: Final build (ubuntu-latest)
  • GitHub Check: Final build (windows-latest)
  • GitHub Check: Final build (macos-latest)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/api/tests/http-config.test.ts
  • packages/api/src/http.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/api/tests/http-config.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/api/tests/http-config.test.ts
  • packages/api/src/http.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/api/tests/http-config.test.ts
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/api/tests/http-config.test.ts
  • packages/api/src/http.ts
🔇 Additional comments (2)
packages/api/src/http.ts (1)

482-531: LGTM!

Also applies to: 580-597, 900-907

packages/api/tests/http-config.test.ts (1)

1-142: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Новые возможности

    • Добавлена конечная точка /federation/status; оба маршрута /federation/status и /federation/exchange/status возвращают идентичный статус федерации.
  • Интеграция

    • Расширено проксирование и дев‑сервер: запросы к путям /federation теперь перенаправляются к API.
  • Документация

    • Обновлён API‑README с описанием новой конечной точки и совместимого алиаса.
  • Тесты

    • Добавлены тесты для выбора публичного адреса федерации и расширен smoke‑тест на /federation/status.
  • Chore

    • Добавлена dev‑зависимость для property‑testing.

Walkthrough

PR добавляет единый обработчик статуса федерации и экспортируемую функцию разрешения публичного происхождения, вводит маршрут GET /federation/status, расширяет проксирование /federation/* в dev/production-сервере, обновляет документацию и добавляет unit/property-тесты и smoke-проверки.

Изменения

Реализация конечной точки федерации и маршрутизация

Layer / File(s) Summary
Конфигурация API и тестирование происхождения федерации
packages/api/src/http.ts, packages/api/tests/http-config.test.ts, packages/api/README.md, packages/api/package.json
Добавлены firstNonEmptyEnv и экспортируемая resolveConfiguredFederationPublicOrigin(env). Введён federationExchangeStatusResponse, добавлен маршрут GET /federation/status, маршрут GET /federation/exchange/status делегирует общий обработчик. Тесты (включая property-based) проверяют приоритет и усечение пробелов в переменных окружения; fast-check добавлен в devDependencies. Документация добавляет новый endpoint и обновляет примеры workflow.
Проксирование федерации веб-сервером
packages/app/vite.web.config.ts, packages/app/scripts/serve-dist-web.mjs
Добавлен прокси для "/federation" в Vite dev-server. В serve-dist-web.mjs введён isFederationPath и условие маршрутизации расширено, чтобы пересылать /federation/* через proxyHttp.
Валидация дымового теста
scripts/final-build/browser-web-smoke.mjs
Локальный обработчик тестового сервера добавляет GET /federation/status, возвращающий JSON с publicActor и другими полями; smoke-тест теперь ожидает HTTP 200 и наличие "publicActor" в ответе.

Смета усилий по проверке кода

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning Описание pull request полностью отсутствует, хотя в репозитории определён обязательный шаблон с разделами для issues, summary и verification. Добавьте описание PR согласно шаблону: укажите issue/обсуждение, краткое резюме изменений, и способ проверки функциональности.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed Название чётко и лаконично описывает основное изменение: добавление маршрута статуса федерации в API.
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.
Requirements Alignment ✅ Passed Requirements fully satisfied. Routes documented, implemented, tested. Response structure matches spec. No undocumented behavior changes. Web routing configured. Dependencies added.
Security Regression ✅ Passed No high-confidence security regressions detected. All changes are limited to adding federation status endpoints with proper input validation, safe URL handling, and no credential/PII exposure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix-federation-status-route

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: 4

🤖 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`:
- Around line 604-609: Добавьте TSDoc над объявлением функции
federationExchangeStatusResponse, пометив её как SHELL handler и включив краткое
описание, `@effect` с сигнатурой эффекта (напр., описывающую входной
HttpServerRequest и возвращаемый Response через Effect) и `@complexity`
(временная/пространственная сложность), а также упомяните зависимости
resolveFederationContext, makeFederationExchangeStatus, jsonResponse и
errorResponse; оставьте форматирование в едином стиле проекта и используйте
функциональные маркеры PURITY (SHELL), EFFECT и COMPLEXITY в комментарии.
- Around line 494-500: The exported function
resolveConfiguredFederationPublicOrigin is missing the required comprehensive
TSDoc; update the declaration to include a full TSDoc block describing the
function purpose, the env parameter and its type, the string | undefined return,
and include the mandated annotations: `@pure`, `@effect` (describe dependency on
firstNonEmptyEnv and env lookup), `@invariant` (mathematical relation between
inputs and output, e.g. output ∈ {env values} ∪ {undefined}), `@precondition` (env
is a Record<string,string|undefined>), `@postcondition` (returned value equals the
first non-empty value from the specified keys or undefined), and `@complexity`
(O(1) or O(k) where k is number of keys); reference
resolveConfiguredFederationPublicOrigin and firstNonEmptyEnv in the TSDoc so
reviewers can locate related behavior.
- Around line 482-492: Document the pure utility function firstNonEmptyEnv with
comprehensive TSDoc per guidelines: add a description, mark `@pure` true, list
`@effect` (none / required services if any), state `@invariant` (e.g., returns
either trimmed non-empty string or undefined), add `@precondition` (input is
ReadonlyArray<string | undefined>), `@postcondition` (output is either undefined
or a trimmed string with length>0), `@complexity` (time O(n * m) where n = number
of entries and m = average trim cost, space O(1)), and `@throws` Never (no
exceptions thrown; errors handled via Effects); include examples and note that
it returns the first trimmed, non-empty value or undefined, and reference the
function name firstNonEmptyEnv so reviewers can locate it.

In `@packages/api/tests/http-config.test.ts`:
- Around line 1-23: The tests in packages/api/tests/http-config.test.ts call
resolveConfiguredFederationPublicOrigin directly; update them to use Effect
testing utilities by wrapping the synchronous calls in an Effect, supplying any
required mocks via Effect.provide/Effect.provideSomeLayer (or a MockService
layer) and executing with Effect.runPromise (or the no-runtime runner
recommended by our guidelines), then assert the resolved value; reference the
function resolveConfiguredFederationPublicOrigin and replace direct expect(...)
invocations with Effect-based execution and assertions so the tests conform to
the Effect testing pattern.
🪄 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: 78ba9d3e-ab79-4783-8810-208d47d71b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 495620e and ccdf847.

📒 Files selected for processing (6)
  • packages/api/README.md
  • packages/api/src/http.ts
  • packages/api/tests/http-config.test.ts
  • packages/app/scripts/serve-dist-web.mjs
  • packages/app/vite.web.config.ts
  • scripts/final-build/browser-web-smoke.mjs
📜 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 (Runtime volumes + SSH)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (Clone auto-open SSH)
  • GitHub Check: Test
  • GitHub Check: E2E (Login context)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: Lint
  • GitHub Check: E2E (Browser command)
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/app/vite.web.config.ts
  • packages/api/tests/http-config.test.ts
  • packages/api/src/http.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/app/vite.web.config.ts
  • packages/api/tests/http-config.test.ts
  • packages/api/src/http.ts
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/app/vite.web.config.ts
  • packages/app/scripts/serve-dist-web.mjs
  • packages/api/tests/http-config.test.ts
  • scripts/final-build/browser-web-smoke.mjs
  • packages/api/README.md
  • packages/api/src/http.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/api/tests/http-config.test.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/api/tests/http-config.test.ts
🔇 Additional comments (8)
packages/app/vite.web.config.ts (1)

27-32: LGTM!

packages/app/scripts/serve-dist-web.mjs (2)

126-127: LGTM!


279-279: LGTM!

scripts/final-build/browser-web-smoke.mjs (2)

80-96: LGTM!


164-167: LGTM!

packages/api/README.md (2)

99-100: LGTM!


136-141: LGTM!

packages/api/src/http.ts (1)

861-867: LGTM!

Comment thread packages/api/src/http.ts
Comment thread packages/api/src/http.ts
Comment thread packages/api/src/http.ts Outdated
Comment thread packages/api/tests/http-config.test.ts Outdated
@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 13, 2026

AI Session Backup

Commit: 896f2a0
Status: success
Files: 3 (12.86 MB)
Links: README | Manifest

git status

On branch fix-federation-status-route
Your branch is up to date with 'origin/fix-federation-status-route'.

nothing to commit, working tree clean

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/api/tests/http-config.test.ts`:
- Around line 6-26: Add a fast-check property test to
packages/api/tests/http-config.test.ts that verifies the invariant of
resolveConfiguredFederationPublicOrigin: for arbitrary string inputs (including
empty, whitespace-only, and undefined/null cases) the result equals the trimmed
DOCKER_GIT_FEDERATION_PUBLIC_ORIGIN when that trimmed value is non-empty,
otherwise it equals the trimmed DOCKER_GIT_API_PUBLIC_URL; use fast-check
arbitraries for both variables, run many cases, and assert both that outputs are
trimmed (no leading/trailing whitespace) and that the federation-origin wins
when non-empty while api-url is used as fallback.
🪄 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: b5dfe20e-b743-482b-8a59-3578bbfe91d1

📥 Commits

Reviewing files that changed from the base of the PR and between ccdf847 and 896f2a0.

📒 Files selected for processing (2)
  • packages/api/src/http.ts
  • packages/api/tests/http-config.test.ts
📜 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 (Clone auto-open SSH)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: Lint
  • GitHub Check: Test
  • GitHub Check: E2E (Login context)
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/api/tests/http-config.test.ts
  • packages/api/src/http.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/api/tests/http-config.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/api/tests/http-config.test.ts
  • packages/api/src/http.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/api/tests/http-config.test.ts
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/api/tests/http-config.test.ts
  • packages/api/src/http.ts
🔇 Additional comments (1)
packages/api/src/http.ts (1)

482-528: LGTM!

Also applies to: 531-531, 632-649, 900-907

@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 13, 2026

AI Session Backup

Commit: 7566e68
Status: success
Files: 3 (13.00 MB)
Links: README | Manifest

git status

On branch fix-federation-status-route
Your branch is up to date with 'origin/fix-federation-status-route'.

nothing to commit, working tree clean

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/api/tests/http-config.test.ts`:
- Around line 29-72: Add HTTP-level tests that issue GET requests to both routes
handled by federationExchangeStatusResponse() (the "/federation/status" and
"/federation/exchange/status" aliases) and assert they return the same result:
verify HTTP 200 (or the expected status code), assert the response payload
shape/fields (e.g., presence and types of status, timestamp, etc. as defined by
federationExchangeStatusResponse()), and confirm the JSON bodies are deeply
equal between the two endpoints; implement these in the test suite alongside
existing API HTTP tests (e.g., packages/api/tests/http-config.test.ts) using the
same test harness/utilities used for other route-level tests so requests run
against the real HTTP handler stack.
🪄 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: d37ee655-c162-4296-bd32-6a170bc843cc

📥 Commits

Reviewing files that changed from the base of the PR and between 896f2a0 and 7566e68.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • packages/api/package.json
  • packages/api/tests/http-config.test.ts
📜 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 auto-open SSH)
  • GitHub Check: E2E (Clone cache)
  • GitHub Check: E2E (OpenCode)
  • GitHub Check: E2E (Browser command)
  • GitHub Check: Test
  • GitHub Check: E2E (Runtime volumes + SSH)
  • GitHub Check: E2E (Login context)
  • GitHub Check: Lint
  • GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (5)
**/*

⚙️ CodeRabbit configuration file

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

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

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

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

Files:

  • packages/api/package.json
  • packages/api/tests/http-config.test.ts
**/*.{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/api/tests/http-config.test.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/api/tests/http-config.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/api/tests/http-config.test.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/api/tests/http-config.test.ts
🔇 Additional comments (2)
packages/api/package.json (1)

47-47: LGTM!

packages/api/tests/http-config.test.ts (1)

1-27: LGTM!

Also applies to: 29-72

Comment thread packages/api/tests/http-config.test.ts
@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 13, 2026

AI Session Backup

Commit: 126cab3
Status: success
Files: 3 (13.22 MB)
Links: README | Manifest

git status

On branch fix-federation-status-route
Your branch is up to date with 'origin/fix-federation-status-route'.

nothing to commit, working tree clean

@skulidropek skulidropek merged commit b968222 into main May 13, 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