Skip to content

feat: wire IntakeEngine via boot client-simulation runtime (e2e test harness)#2006

Merged
Aureliolo merged 4 commits into
mainfrom
test/sim-harness
May 18, 2026
Merged

feat: wire IntakeEngine via boot client-simulation runtime (e2e test harness)#2006
Aureliolo merged 4 commits into
mainfrom
test/sim-harness

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

Wires the GHOST IntakeEngine into the shipped boot path so the client-simulation runtime comes online and becomes the deterministic e2e acceptance substrate (independent child of EPIC #1955; runtime root #2003 already merged).

  • New src/synthorg/client/runtime_builder.py (build_client_simulation_runtime): constructs the real IntakeEngine + a single-stage ReviewPipeline (InternalReviewStage) and returns a populated ClientSimulationState. Called from create_app's construction phase when a TaskEngine is present, so has_simulation_runtime is true and the /simulations + /requests controllers register.
  • Pluggable intake: IntakeConfig discriminator + build_intake_strategy() factory (direct -> DirectIntake, no LLM; agent -> AgentIntake, LLM triage). New simulations.intake_strategy / simulations.intake_model settings, resolved at the boot site via the bootstrap resolver (env > default; read_only_post_init, matching the existing simulations.task_timeout_seconds pattern). A selected agent strategy that cannot be satisfied degrades to direct with a WARNING; a direct failure propagates.
  • Default direct strategy makes zero LLM calls, so the runtime comes online for an empty company.
  • Docs synced: docs/design/client-simulation.md (removed the "not wired" warning, added the Boot wiring section + factory-table row); README.md (intake engine is now exercised end to end).

CORE acceptance

scripts/_ghost_wiring_manifest.txt IntakeEngine line flipped PENDING -> ENFORCED in this PR; scripts/check_no_ghost_wiring.py passes (verified construction site under src/synthorg/client/, reachable from app.py).

Bundled fix: pre-existing latent circular import

Wiring runtime_builder surfaced a pre-existing cycle: synthorg.client.* was unimportable as a first import in a fresh interpreter (budget.cost_record -> ontology -> persistence -> security -> providers -> back into budget mid-init). Reproduced on unmodified synthorg.client.runner, so it is not introduced here. Root fix: PEP 562 lazy export of OntologyService / OntologyEntityRepository from synthorg.ontology.__init__ (locked double-checked cache, mirroring the established synthorg.tools.mcp pattern). Public API unchanged: from synthorg.ontology import OntologyService still works, resolved on first access. Authorized by the maintainer as in-scope.

Tests (four layers)

  • Seam (e2e): builder drives a real ClientRequest SUBMITTED -> TASK_CREATED against a real TaskEngine.
  • Boot-wired HTTP surface: no kwarg; /capabilities reports simulations/requests on, routes register.
  • Direct + scripted-agent harness: SimulationRunner.run driven directly against the boot-wired runtime, deterministic asserted metrics, zero LLM spend.
  • Factory/builder/settings/lazy-export unit tests; obsolete capability tests updated to the new reality.

The deterministic harness assertion drives SimulationRunner.run directly rather than the HTTP poll-to-completion path: litestar TestClient does not progress fire-and-forget asyncio.create_task background tasks between sync requests, so a poll-based e2e would be flaky. The HTTP surface (routes register, 201 on start) is still covered separately.

Review coverage

Pre-PR review ran 23 agents (17 specialist + 6 audit mini-pass). All valid findings (V1-V5) and the user-approved pre-existing/outside-diff items (P1: web/src/api/endpoints/clients.ts migrated to the generated @/api/types barrel, fixing the SimulationStatusResponse / acceptance_criteria drift; P2: pre-raise logging on intake ValueError paths; P3: named tolerance constants, function-length refactor) implemented. Seven findings assessed invalid (agent misreads of PEP 758 / bootstrap-resolver semantics, gate-sanctioned @computed_field exemption, established-pattern conflicts) with rationale in the triage record.

Gates green: ruff, mypy (3902 files), check_no_ghost_wiring.py, affected pytest, full pre-commit run --all-files; web type-check, lint, 3182 tests.

Closes #1961

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9a17f715-8283-4166-a9e8-6602a93b98e0

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba70bb and f82a912.

📒 Files selected for processing (1)
  • src/synthorg/client/runtime_builder.py
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Deploy Preview
  • GitHub Check: Build Backend
  • GitHub Check: Test Unit
  • GitHub Check: Test Conformance (SQLite)
  • GitHub Check: Test E2E
  • GitHub Check: Test Integration
  • GitHub Check: Dashboard Test
  • GitHub Check: CodSpeed Python benchmarks
  • GitHub Check: CodSpeed Web benchmarks
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Lighthouse Dashboard
  • GitHub Check: Lighthouse Site
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{py,ts,tsx,js,jsx,md,yaml,yml}

📄 CodeRabbit inference engine (CLAUDE.md)

No region/currency/locale privileged; use metric units; British English in all text and documentation

Files:

  • src/synthorg/client/runtime_builder.py
src/synthorg/!(persistence)/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Only src/synthorg/persistence/ may import sqlite/psycopg or emit raw SQL

Files:

  • src/synthorg/client/runtime_builder.py
src/synthorg/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/synthorg/**/*.py: Configuration Precedence: DB > env > code default via SettingsService/ConfigResolver (Cat-1) or env > code default (Cat-2, read_only_post_init); Cat-3 bootstrap secrets are pure env; YAML is company-template ingestion format only; no os.environ.get outside startup; pre-init Cat-2 reads use settings.bootstrap_resolver.resolve_init_value
No hardcoded numeric values outside of 0/1/-1, HTTP codes, hex masks, powers-of-2, and module-level annotated named constants (NAME: int|float|Final|Final[int]|Final[float] = literal); numerics live in settings/definitions/
Use async/await with asyncio.TaskGroup for fan-out/fan-in; helpers catch Exception (re-raise MemoryError/RecursionError)
Comments explain WHY only; no reviewer citations, issue back-refs, or migration framing
No from __future__ import annotations (Python 3.14 has PEP 649); PEP 758 except: except A, B: requires parens when binding
Type hints on all public functions; mypy strict; Google-style docstrings; line length 88; functions <50 lines; files <800 lines
Error classes: <Domain><Condition>Error format inheriting from DomainError; never inherit Exception/RuntimeError directly
Pydantic v2: frozen + extra="forbid" on every frozen model; @computed_field auto-exempt; per-line # lint-allow: frozen-extra-forbid for exceptions; use @computed_field for derived fields; NotBlankStr for identifiers
Args models required at every system boundary; use parse_typed() for every external dict ingestion
Immutability: use model_copy(update=...) or copy.deepcopy(); deepcopy at system boundaries
Clock seam: clock: Clock | None = None; inject FakeClock in tests; services own _lifecycle_lock; timed-out stops mark unrestartable
Untrusted content (SEC-1): use wrap_untrusted() from engine.prompt_safety; use HTMLParseGuard for HTML
Logging: use from synthorg.observability import get_logger; variable always logger; never import logging / print() in app...

Files:

  • src/synthorg/client/runtime_builder.py
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use ruff check --fix and ruff format for linting and formatting; mypy --num-workers=4 src/ tests/ for strict type-checking

Files:

  • src/synthorg/client/runtime_builder.py
src/**/*.py

⚙️ CodeRabbit configuration file

This project uses Python 3.14+ with PEP 758 except syntax: "except A, B:" (comma-separated, no parentheses) is correct and mandatory -- do NOT flag it as a typo or suggest parenthesized form. The "except builtins.MemoryError, RecursionError: raise" pattern is intentional project convention for system-error propagation. When evaluating the 50-line function limit, count only the function body excluding the signature lines, decorators, and docstring. Functions 1-5 lines over due to docstrings or multi-line signatures should not be flagged. Do not suggest extracting single-use helper functions called exactly once -- this reduces readability without improving maintainability.

Files:

  • src/synthorg/client/runtime_builder.py
🧠 Learnings (1)
📚 Learning: 2026-05-05T09:04:46.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1760
File: scripts/_dual_backend_parity_lib.py:215-216
Timestamp: 2026-05-05T09:04:46.195Z
Learning: This repository targets Python 3.14+ and follows PEP 758. Therefore, reviewer tooling should NOT treat unparenthesized multi-exception `except` clauses written without an `as` clause (e.g., `except MemoryError, RecursionError:`) as syntax errors. Only flag `except`-clause problems when they are genuinely invalid for Python 3.14+.

Applied to files:

  • src/synthorg/client/runtime_builder.py
🔇 Additional comments (1)
src/synthorg/client/runtime_builder.py (1)

1-170: LGTM!


Walkthrough

This PR wires the client-simulation intake runtime at application boot, enabling deterministic end-to-end testing of requirements through intake, review, and task creation without real LLM calls. It introduces IntakeConfig to parameterize direct or agent-based intake strategies, extends the intake factory to support agent mode with provider validation, and implements build_client_simulation_runtime to construct a configured IntakeEngine and single-stage review pipeline. The app conditionally wires this runtime when a TaskEngine is present, registering simulation and request endpoints and capabilities. Engine observability is enhanced with strategy introspection and transition logging. Settings allow bootstrap configuration of intake strategy and optional model. Web API types are aligned to match generated OpenAPI contracts, and the ontology module is refactored to use PEP 562 lazy loading. Comprehensive tests cover configuration, settings, factory dispatch, runtime wiring, lazy exports, and E2E harnesses for both direct and agent intake paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 40.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: wiring IntakeEngine via boot client-simulation runtime with e2e test harness support.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, covering new runtime builder, pluggable intake, documentation updates, and test coverage.
Linked Issues check ✅ Passed The PR fully addresses issue #1961 requirements: IntakeEngine wired via runtime builder, has_simulation_runtime enabled, deterministic e2e harness with zero LLM calls, and manifest flipped PENDING→ENFORCED.
Out of Scope Changes check ✅ Passed All changes align with linked issue #1961 scope. PEP 562 lazy export fix for pre-existing circular import is authorized and necessary for boot path wiring.

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


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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 18, 2026

Merging this PR will not alter performance

✅ 54 untouched benchmarks


Comparing test/sim-harness (f82a912) with main (e5eef1a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (e2b9eee) during the generation of this report, so e5eef1a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Copy Markdown
Contributor

@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: 3

🤖 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 `@README.md`:
- Line 34: The README sentence under "Client-simulation intake runtime" uses the
phrase "driven end to end" which should be hyphenated; update the line
containing "Client-simulation intake runtime" to replace "driven end to end"
with "driven end-to-end" so the compound reads correctly and improves
readability.
- Line 48: Replace the ambiguous phrase "Until the runtime lands," in the
README.md sentence (the string "Until the runtime lands, multi-agent
coordination...") with a more specific term such as "Until the agent runtime
lands," or "Until the agent runtime (not the client-simulation runtime) lands,"
so it does not contradict the earlier statement that the client-simulation
runtime is wired; update that exact sentence to read e.g. "Until the agent
runtime lands, multi-agent coordination, coordination metrics, autonomy/trust
enforcement on a live run, and the self-improvement loop are designed and
unit-tested but not exercised end to end."

In `@src/synthorg/client/runtime_builder.py`:
- Around line 76-83: The code uses str(resolve_init_value(...).value) which
turns a None setting into the literal "None" (truthy); change the logic in
runtime_builder.py to first capture the raw value from
resolve_init_value(SettingNamespace.SIMULATIONS, _INTAKE_MODEL_KEY,
env=env).value and then set model = None if that raw value is None else
str(raw_value), ensuring real None stays None and non-None values are
stringified; reference resolve_init_value, SettingNamespace.SIMULATIONS,
_INTAKE_MODEL_KEY, and the model variable when making the change.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 34370224-1e27-411f-9d05-7c3c04c3fe6e

📥 Commits

Reviewing files that changed from the base of the PR and between e2b9eee and 958c3ba.

📒 Files selected for processing (26)
  • README.md
  • docs/design/client-simulation.md
  • scripts/_ghost_wiring_manifest.txt
  • src/synthorg/api/app.py
  • src/synthorg/client/__init__.py
  • src/synthorg/client/config.py
  • src/synthorg/client/factory.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • src/synthorg/ontology/__init__.py
  • src/synthorg/settings/definitions/simulations.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/unit/api/controllers/test_capabilities.py
  • tests/unit/client/test_config.py
  • tests/unit/client/test_runtime_builder.py
  • tests/unit/ontology/test_lazy_exports.py
  • tests/unit/settings/test_intake_settings.py
  • web/src/api/endpoints/clients.ts
  • web/src/api/types/dtos.gen.ts
  • web/src/api/types/enum-values.gen.ts
  • web/src/api/types/openapi.gen.ts
  • web/src/components/ui/request-card.stories.tsx
  • web/src/mocks/handlers/clients.ts
  • web/src/pages/SimulationDashboardPage.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Deploy Preview
  • GitHub Check: Build Backend
  • GitHub Check: Lighthouse Dashboard
  • GitHub Check: Lighthouse Site
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Test Conformance (SQLite)
  • GitHub Check: Test Unit
  • GitHub Check: Dashboard Test
  • GitHub Check: Test Integration
  • GitHub Check: Test E2E
  • GitHub Check: CodSpeed Web benchmarks
  • GitHub Check: CodSpeed Python benchmarks
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (21)
**/*.{py,ts,tsx,js,jsx,md,yaml,yml}

📄 CodeRabbit inference engine (CLAUDE.md)

No region/currency/locale privileged; use metric units; British English in all text and documentation

Files:

  • README.md
  • web/src/api/types/enum-values.gen.ts
  • web/src/mocks/handlers/clients.ts
  • src/synthorg/engine/intake/engine.py
  • web/src/components/ui/request-card.stories.tsx
  • src/synthorg/observability/events/client.py
  • tests/unit/client/test_config.py
  • web/src/pages/SimulationDashboardPage.tsx
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • tests/unit/settings/test_intake_settings.py
  • docs/design/client-simulation.md
  • tests/unit/client/test_runtime_builder.py
  • src/synthorg/client/config.py
  • tests/unit/ontology/test_lazy_exports.py
  • src/synthorg/ontology/__init__.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
  • web/src/api/types/dtos.gen.ts
  • web/src/api/endpoints/clients.ts
  • tests/unit/api/controllers/test_capabilities.py
  • web/src/api/types/openapi.gen.ts
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.md: Numerics in README and public docs must be sourced from data/runtime_stats.yaml via <!--RS:NAME--> markers
Markdown tables for tabular data

Files:

  • README.md
  • docs/design/client-simulation.md
web/src/**/*.{js,jsx,ts,tsx,mts}

📄 CodeRabbit inference engine (web/CLAUDE.md)

web/src/**/*.{js,jsx,ts,tsx,mts}: Always use createLogger from @/lib/logger; never bare console.warn/console.error/console.debug in application code. Variable name must always be log. Only logger.ts itself may use bare console methods. Use log.debug() (DEV-only, stripped in production), log.warn(), log.error().
Pass dynamic/untrusted values as separate args to logger calls (not interpolated into the message string) so they go through sanitizeArg
Attacker-controlled fields inside structured objects must be wrapped in sanitizeForLog() before embedding in log calls
Error-code constants (MANDATORY): import ErrorCode and ErrorCategory from @/api/types/errors (re-exported from the generated web/src/api/types/error-codes.gen.ts). Discriminate on ErrorCode.<NAME>, never on raw integer literals.
Use @eslint-react/web-api-no-leaked-fetch to detect fetch() in effects without AbortController cleanup

Files:

  • web/src/api/types/enum-values.gen.ts
  • web/src/mocks/handlers/clients.ts
  • web/src/components/ui/request-card.stories.tsx
  • web/src/pages/SimulationDashboardPage.tsx
  • web/src/api/types/dtos.gen.ts
  • web/src/api/endpoints/clients.ts
  • web/src/api/types/openapi.gen.ts
web/src/api/types/**/*.gen.ts

📄 CodeRabbit inference engine (web/CLAUDE.md)

Generated DTO types (MANDATORY): NEVER hand-edit web/src/api/types/*.gen.ts. Regenerate with uv run python scripts/generate_dto_types_ts.py. Import DTOs via the barrel (import type { AgentConfig } from '@/api/types').

Files:

  • web/src/api/types/enum-values.gen.ts
  • web/src/api/types/dtos.gen.ts
  • web/src/api/types/openapi.gen.ts
web/src/**/*.{ts,tsx,mts}

📄 CodeRabbit inference engine (web/CLAUDE.md)

web/src/**/*.{ts,tsx,mts}: Use @typescript-eslint/no-floating-promises to forbid unawaited promises so async work cannot survive the test that scheduled it and trip the active-handle gate
Use @typescript-eslint/no-misused-promises (with checksVoidReturn: { attributes: false }) to forbid passing async functions where the callsite ignores the returned promise. React 19 async event handlers stay allowed via the attributes: false exemption.

Files:

  • web/src/api/types/enum-values.gen.ts
  • web/src/mocks/handlers/clients.ts
  • web/src/components/ui/request-card.stories.tsx
  • web/src/pages/SimulationDashboardPage.tsx
  • web/src/api/types/dtos.gen.ts
  • web/src/api/endpoints/clients.ts
  • web/src/api/types/openapi.gen.ts
web/src/**/*.{ts,tsx,jsx,js}

📄 CodeRabbit inference engine (CLAUDE.md)

Reuse web/src/components/ui/ design system components with design tokens only in web projects

Files:

  • web/src/api/types/enum-values.gen.ts
  • web/src/mocks/handlers/clients.ts
  • web/src/components/ui/request-card.stories.tsx
  • web/src/pages/SimulationDashboardPage.tsx
  • web/src/api/types/dtos.gen.ts
  • web/src/api/endpoints/clients.ts
  • web/src/api/types/openapi.gen.ts
web/**/*.{ts,tsx,jsx,js}

📄 CodeRabbit inference engine (CLAUDE.md)

Web projects use React 19; see web/CLAUDE.md for dashboard design system; CLI is Go binary (use go -C cli, never cd cli); see cli/CLAUDE.md

Files:

  • web/src/api/types/enum-values.gen.ts
  • web/src/mocks/handlers/clients.ts
  • web/src/components/ui/request-card.stories.tsx
  • web/src/pages/SimulationDashboardPage.tsx
  • web/src/api/types/dtos.gen.ts
  • web/src/api/endpoints/clients.ts
  • web/src/api/types/openapi.gen.ts
web/src/mocks/handlers/**/*.ts

📄 CodeRabbit inference engine (web/CLAUDE.md)

web/src/mocks/handlers/**/*.ts: MSW handlers (MANDATORY): web/src/mocks/handlers/ must mirror web/src/api/endpoints/*.ts 1:1 with a default happy-path handler for every exported endpoint. Use onUnhandledRequest: 'error' in test setup; tests override per-case via server.use(...), never vi.mock('@/api/endpoints/*').
Use typed envelope helpers (successFor, paginatedFor, voidSuccess) to keep MSW handlers in lockstep with endpoint return types

Files:

  • web/src/mocks/handlers/clients.ts
src/synthorg/!(persistence)/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Only src/synthorg/persistence/ may import sqlite/psycopg or emit raw SQL

Files:

  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • src/synthorg/client/config.py
  • src/synthorg/ontology/__init__.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
src/synthorg/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/synthorg/**/*.py: Configuration Precedence: DB > env > code default via SettingsService/ConfigResolver (Cat-1) or env > code default (Cat-2, read_only_post_init); Cat-3 bootstrap secrets are pure env; YAML is company-template ingestion format only; no os.environ.get outside startup; pre-init Cat-2 reads use settings.bootstrap_resolver.resolve_init_value
No hardcoded numeric values outside of 0/1/-1, HTTP codes, hex masks, powers-of-2, and module-level annotated named constants (NAME: int|float|Final|Final[int]|Final[float] = literal); numerics live in settings/definitions/
Use async/await with asyncio.TaskGroup for fan-out/fan-in; helpers catch Exception (re-raise MemoryError/RecursionError)
Comments explain WHY only; no reviewer citations, issue back-refs, or migration framing
No from __future__ import annotations (Python 3.14 has PEP 649); PEP 758 except: except A, B: requires parens when binding
Type hints on all public functions; mypy strict; Google-style docstrings; line length 88; functions <50 lines; files <800 lines
Error classes: <Domain><Condition>Error format inheriting from DomainError; never inherit Exception/RuntimeError directly
Pydantic v2: frozen + extra="forbid" on every frozen model; @computed_field auto-exempt; per-line # lint-allow: frozen-extra-forbid for exceptions; use @computed_field for derived fields; NotBlankStr for identifiers
Args models required at every system boundary; use parse_typed() for every external dict ingestion
Immutability: use model_copy(update=...) or copy.deepcopy(); deepcopy at system boundaries
Clock seam: clock: Clock | None = None; inject FakeClock in tests; services own _lifecycle_lock; timed-out stops mark unrestartable
Untrusted content (SEC-1): use wrap_untrusted() from engine.prompt_safety; use HTMLParseGuard for HTML
Logging: use from synthorg.observability import get_logger; variable always logger; never import logging / print() in app...

Files:

  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • src/synthorg/client/config.py
  • src/synthorg/ontology/__init__.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use ruff check --fix and ruff format for linting and formatting; mypy --num-workers=4 src/ tests/ for strict type-checking

Files:

  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • tests/unit/client/test_config.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • tests/unit/settings/test_intake_settings.py
  • tests/unit/client/test_runtime_builder.py
  • src/synthorg/client/config.py
  • tests/unit/ontology/test_lazy_exports.py
  • src/synthorg/ontology/__init__.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
  • tests/unit/api/controllers/test_capabilities.py
src/**/*.py

⚙️ CodeRabbit configuration file

This project uses Python 3.14+ with PEP 758 except syntax: "except A, B:" (comma-separated, no parentheses) is correct and mandatory -- do NOT flag it as a typo or suggest parenthesized form. The "except builtins.MemoryError, RecursionError: raise" pattern is intentional project convention for system-error propagation. When evaluating the 50-line function limit, count only the function body excluding the signature lines, decorators, and docstring. Functions 1-5 lines over due to docstrings or multi-line signatures should not be flagged. Do not suggest extracting single-use helper functions called exactly once -- this reduces readability without improving maintainability.

Files:

  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • src/synthorg/client/config.py
  • src/synthorg/ontology/__init__.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
web/src/components/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/CLAUDE.md)

web/src/components/ui/**/*.{ts,tsx}: ALWAYS reuse existing components from web/src/components/ui/ before creating new ones. NEVER hardcode hex colors, font-family declarations, pixel spacing, Motion transition durations, BCP 47 locale literals ('en-US'), or currency symbols / codes; use design tokens, @/lib/motion presets, the helpers in @/utils/format, and DEFAULT_CURRENCY from @/utils/currencies.
Every new shared component lives in web/src/components/ui/ with a sibling .stories.tsx covering all states (default, hover, loading, error, empty, disabled where applicable)
Component Props interface name must be <ComponentName>Props and must be exported from the same file (e.g. AgentCardProps in agent-card.tsx). This makes the contract greppable and lets callers extend the props without re-typing the shape.
Base UI primitives must compose Portal + Backdrop + Popup explicitly, use the render prop for polymorphism, and rely on animation state attributes (data-[open], data-[closed]) rather than the older data-[state=open] form.
Base UI primitives are imported directly from @base-ui/react/<subpath> and use the native render prop for polymorphism; the local <Slot> helper is reserved for <Button asChild> only

Files:

  • web/src/components/ui/request-card.stories.tsx
web/src/{components,utils}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/CLAUDE.md)

NEVER write getXIcon(value): LucideIcon factories called inside JSX bodies. Export a <XIcon value={...} /> wrapper that does the lookup via createElement inside the wrapper body. Wrapper components live in their own file, not alongside utility exports.

Files:

  • web/src/components/ui/request-card.stories.tsx
web/src/{components,hooks}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (web/CLAUDE.md)

NEVER read window.innerWidth / window.innerHeight directly in a render body or useMemo; use useViewportSize() from @/hooks/useViewportSize instead

Files:

  • web/src/components/ui/request-card.stories.tsx
web/src/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (web/CLAUDE.md)

web/src/**/*.{jsx,tsx}: Use @eslint-react/no-leaked-conditional-rendering to catch the {count && <Foo />} bug where 0 renders verbatim. For ReactNode | undefined props use {value != null && value !== false && <jsx>}; for compound truthiness use Boolean(...).
Use @eslint-react/globals to restrict window / document / localStorage / etc. inside render. Hoist offenders into a useCallback event handler, a useEffect, or a useSyncExternalStore-backed hook.

Files:

  • web/src/components/ui/request-card.stories.tsx
  • web/src/pages/SimulationDashboardPage.tsx
web/src/**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (web/CLAUDE.md)

Storybook 10 is ESM-only; essentials are built into core, but @storybook/addon-docs is now separate; imports moved to storybook/test and storybook/actions

Files:

  • web/src/components/ui/request-card.stories.tsx
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

tests/**/*.py: Test markers: @pytest.mark.{unit,integration,e2e,slow}; async tests use auto; global timeout 30s; minimum coverage 80%
Windows unit tests use WindowsSelectorEventLoopPolicy (Python 3.14 IOCP teardown race); subprocess tests override back
Test doubles: use FakeClock for Clock seam, mock_of[T](**overrides) for typed-boundary substitutions, SimpleNamespace for attribute-bags; bare MagicMock at typed boundaries is forbidden
Hypothesis testing: 10 deterministic CI examples; failures are real bugs (fix + add @example(...)); never skip/xfail flaky tests; fix fundamentally

Files:

  • tests/unit/client/test_config.py
  • tests/unit/settings/test_intake_settings.py
  • tests/unit/client/test_runtime_builder.py
  • tests/unit/ontology/test_lazy_exports.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • tests/unit/api/controllers/test_capabilities.py

⚙️ CodeRabbit configuration file

Test files do not require Google-style docstrings on classes or functions -- ruff D rules are only enforced on src/. A bare @settings() decorator with no arguments on Hypothesis property tests is a no-op and should not be suggested -- the HYPOTHESIS_PROFILE env var controls example counts via registered profiles, which @given() honors automatically.

Files:

  • tests/unit/client/test_config.py
  • tests/unit/settings/test_intake_settings.py
  • tests/unit/client/test_runtime_builder.py
  • tests/unit/ontology/test_lazy_exports.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • tests/unit/api/controllers/test_capabilities.py
src/synthorg/api/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/synthorg/api/**/*.py: API startup lifecycle: construction phase wires synchronous services; on_startup phase wires services needing persistence backend; agent_registry before auto_wire_meetings; tunnel_provider wired unconditionally
On-startup ordering: SettingsService auto-wire precedes WorkflowExecutionObserver registration; OntologyService wires after persistence.connect() via _wire_ontology_service

Files:

  • src/synthorg/api/app.py
web/src/{api/endpoints,stores}/**/*.ts

📄 CodeRabbit inference engine (web/CLAUDE.md)

Cursor pagination (MANDATORY): list endpoints must use opaque cursor-based paging via PaginationMeta. Stores must keep nextCursor + hasMore in state (not offset arithmetic) and early-return when !hasMore || !nextCursor. Display counts must come from data.length.

Files:

  • web/src/api/endpoints/clients.ts
web/src/api/endpoints/**/*.ts

📄 CodeRabbit inference engine (web/CLAUDE.md)

Health / readiness endpoints (MANDATORY): getLiveness() is always 200 while the process is alive; getReadiness() is 200 healthy / 503 unavailable (binary 'ok' | 'unavailable' outcome, no tri-state). Any new caller must handle the 503 path explicitly.

Files:

  • web/src/api/endpoints/clients.ts
🧠 Learnings (10)
📚 Learning: 2026-05-16T18:36:19.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/guides/contributing.md:95-95
Timestamp: 2026-05-16T18:36:19.195Z
Learning: In the SynthOrg repo, the “Doc Numeric Claims (MANDATORY)” RS-marker rule should be applied only to these docs: README.md; docs/index.md; docs/roadmap/index.md; docs/architecture/decisions.md; docs/reference/convention-gates.md. This rule is enforced by scripts/check_doc_numeric_macros.py (with runtime substitution by scripts/inject_runtime_stats.py), so reviewers should not flag similar numeric-claim issues in other paths (e.g., anything under docs/guides/). When checking those scoped files, the rule skips fenced code blocks and only flags digits that are adjacent to stat nouns (tests/providers/agents/stars/releases). Numeric CLI flags like “--num-workers=4” inside fenced bash code blocks are not subject to this rule.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:31.446Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/reference/conventions.md:787-789
Timestamp: 2026-05-16T18:36:31.446Z
Learning: In Aureliolo/synthorg, follow the `Doc Numeric Claims (MANDATORY)` rule enforced by `scripts/check_doc_numeric_macros.py` only for these markdown files: `README.md`, `docs/index.md`, `docs/roadmap/index.md`, `docs/architecture/decisions.md`, and `docs/reference/convention-gates.md`. The gate flags digits that appear adjacent to the stat nouns `tests`, `providers`, `agents`, `stars`, and `releases`—those numeric claims must use the required `<!--RS:...-->` macro format. Do not apply this rule to prose that mentions Python version numbers (e.g., “Python 3.14” / “Python 3.15”); those should not be flagged as requiring `<!--RS:...-->`.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: In the synthorg repo, the “Doc Numeric Claims (MANDATORY)” RS-marker rule is enforced only for this exact set of Markdown files: README.md, docs/index.md, docs/roadmap/index.md, docs/architecture/decisions.md, and docs/reference/convention-gates.md. During code reviews, do not raise RS-marker/numeric-claims findings for numeric values in any other files (e.g., docs/getting_started.md, docs/guides/*, docs/reference/conventions.md), since they are not checked or injected by scripts/check_doc_numeric_macros.py or scripts/inject_runtime_stats.py.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:31.446Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/reference/conventions.md:787-789
Timestamp: 2026-05-16T18:36:31.446Z
Learning: In Aureliolo/synthorg, do not require adding `<!--RS:...-->` “Doc Numeric Claims (MANDATORY)” numeric macros for Python version numbers mentioned in documentation prose (e.g., “Python 3.14”, “Python 3.15”). The `scripts/check_doc_numeric_macros.py` gate only applies to `README.md`, `docs/index.md`, `docs/roadmap/index.md`, `docs/architecture/decisions.md`, and `docs/reference/convention-gates.md`, and it only flags digits adjacent to specific stat nouns (tests/providers/agents/stars/releases), not language version mentions like “Python 3.14”.

Applied to files:

  • README.md
  • docs/design/client-simulation.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: When reviewing Markdown in the synthorg repo, account for the CI gate `check_doc_numeric_macros.py`: it skips fenced code blocks entirely, and it only flags digits that are adjacent to these stat nouns: `tests`, `providers`, `agents`, `stars`, `releases`. Therefore, numeric examples such as CLI flag values (e.g., `--num-workers=4` in fenced bash blocks) and prose version numbers (e.g., `3.14`/`3.15`) are not expected to trigger this check; prioritize changes only when digits appear next to one of the listed nouns (e.g., “5 tests”, “10 stars”, etc.).

Applied to files:

  • README.md
  • docs/design/client-simulation.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: When reviewing markdown files for the "Doc Numeric Claims (MANDATORY)" RS-marker rule, only require/flag missing RS markers in the files that are actually in-scope for the rule. The scope is enforced via an identical _SCOPED_FILES allowlist in scripts/check_doc_numeric_macros.py and scripts/inject_runtime_stats.py, and currently includes: README.md; docs/index.md; docs/roadmap/index.md; docs/architecture/decisions.md; docs/reference/convention-gates.md. For any other markdown files (e.g., docs/getting_started.md, docs/guides/*), missing RS markers for numeric claims are no-ops and should NOT be flagged.

Applied to files:

  • README.md
  • docs/design/client-simulation.md
📚 Learning: 2026-05-05T09:04:46.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1760
File: scripts/_dual_backend_parity_lib.py:215-216
Timestamp: 2026-05-05T09:04:46.195Z
Learning: This repository targets Python 3.14+ and follows PEP 758. Therefore, reviewer tooling should NOT treat unparenthesized multi-exception `except` clauses written without an `as` clause (e.g., `except MemoryError, RecursionError:`) as syntax errors. Only flag `except`-clause problems when they are genuinely invalid for Python 3.14+.

Applied to files:

  • src/synthorg/engine/intake/engine.py
  • src/synthorg/observability/events/client.py
  • tests/unit/client/test_config.py
  • src/synthorg/client/runtime_builder.py
  • src/synthorg/client/__init__.py
  • src/synthorg/api/app.py
  • tests/unit/settings/test_intake_settings.py
  • tests/unit/client/test_runtime_builder.py
  • src/synthorg/client/config.py
  • tests/unit/ontology/test_lazy_exports.py
  • src/synthorg/ontology/__init__.py
  • tests/e2e/test_client_simulation_runtime_seam.py
  • tests/e2e/test_client_simulation_boot_wired_e2e.py
  • src/synthorg/client/factory.py
  • src/synthorg/settings/definitions/simulations.py
  • tests/unit/api/controllers/test_capabilities.py
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: When reviewing Markdown in the synthorg repo against the `check_doc_numeric_macros.py` gate, account for its documented behavior: it skips fenced code blocks entirely, and it only flags digits that are adjacent to specific stat nouns (`tests`, `providers`, `agents`, `stars`, `releases`). As a result, CLI-style numbers (e.g., `--num-workers=4`) inside fenced bash code blocks should never be treated as violations of this gate; only non-fenced text needs checking, and only around those specific nouns.

Applied to files:

  • docs/design/client-simulation.md
📚 Learning: 2026-05-17T11:45:11.839Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1952
File: src/synthorg/settings/definitions/api.py:594-638
Timestamp: 2026-05-17T11:45:11.839Z
Learning: In SynthOrg (Aureliolo/synthorg) pre-alpha, apply the strict no-backward-compat policy: any setting-key rename must be fully completed in the same change/PR with all repo callers updated, and you should not keep legacy aliases or compatibility fallbacks. When reviewing, do not flag a setting-key rename as a breaking upgrade hazard if the rename is repo-wide and fully implemented within the same PR.

Applied to files:

  • src/synthorg/settings/definitions/simulations.py
📚 Learning: 2026-05-17T11:45:11.839Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1952
File: src/synthorg/settings/definitions/api.py:594-638
Timestamp: 2026-05-17T11:45:11.839Z
Learning: In this repository, SynthOrg is pre-alpha and uses a strict no-backward-compat policy for setting-key renames. When reviewing code under src/synthorg/settings, do NOT flag a setting-key rename as an “upgrade-safety” issue if the rename is complete/atomic in the same PR: all callers/usages of the old key are updated simultaneously, and the PR does not keep any legacy aliases, compatibility fallbacks, or migration/rollback paths for the old key.

Applied to files:

  • src/synthorg/settings/definitions/simulations.py
🪛 LanguageTool
README.md

[grammar] ~34-~34: Use a hyphen to join words.
Context: ...client-simulation runtime and driven end to end by a deterministic simulation harnes...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (24)
src/synthorg/client/config.py (1)

14-18: LGTM!

Also applies to: 132-133, 214-237, 251-252, 280-283

tests/unit/client/test_config.py (1)

11-12: LGTM!

Also applies to: 115-140, 152-153

src/synthorg/client/factory.py (1)

126-142: LGTM!

Also applies to: 255-260, 403-470

src/synthorg/client/__init__.py (1)

14-17: LGTM!

Also applies to: 25-27, 84-84, 103-103

src/synthorg/client/runtime_builder.py (1)

48-75: LGTM!

Also applies to: 87-167

src/synthorg/api/app.py (1)

889-915: LGTM!

src/synthorg/observability/events/client.py (1)

32-35: LGTM!

src/synthorg/engine/intake/engine.py (1)

11-13: LGTM!

Also applies to: 43-52, 72-79, 128-135, 152-157

src/synthorg/settings/definitions/simulations.py (2)

31-50: LGTM!


52-69: LGTM!

web/src/api/types/dtos.gen.ts (1)

49-49: LGTM!

Also applies to: 97-97, 162-162, 194-194, 290-290, 316-316, 369-369, 395-395, 414-416, 423-423, 431-431

web/src/api/types/enum-values.gen.ts (1)

525-533: LGTM!

web/src/api/types/openapi.gen.ts (1)

3062-3147: LGTM!

Also applies to: 3712-3780, 4912-4919, 5364-5371, 6336-6353, 7022-7027, 8872-8886, 9296-9310, 10183-10187, 10272-10286, 10616-10623, 10916-10982, 11087-11090, 11241-11258, 11306-11306, 19540-19728, 20814-20962

web/src/api/endpoints/clients.ts (1)

5-20: LGTM!

Also applies to: 22-58, 81-82, 92-93, 134-135, 163-164, 176-181, 185-187, 207-211, 234-236, 266-274

web/src/mocks/handlers/clients.ts (1)

20-20: LGTM!

Also applies to: 63-65, 190-192

web/src/pages/SimulationDashboardPage.tsx (1)

10-10: LGTM!

Also applies to: 37-37

web/src/components/ui/request-card.stories.tsx (1)

20-20: LGTM!

Also applies to: 23-23

src/synthorg/ontology/__init__.py (1)

1-9: LGTM!

Also applies to: 11-13, 50-92

tests/unit/settings/test_intake_settings.py (1)

1-98: LGTM!

tests/unit/client/test_runtime_builder.py (1)

1-179: LGTM!

tests/unit/api/controllers/test_capabilities.py (1)

43-48: LGTM!

Also applies to: 56-76, 77-93, 94-103

tests/unit/ontology/test_lazy_exports.py (1)

1-47: LGTM!

tests/e2e/test_client_simulation_boot_wired_e2e.py (1)

1-269: LGTM!

tests/e2e/test_client_simulation_runtime_seam.py (1)

1-90: LGTM!

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread src/synthorg/client/runtime_builder.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 94.87179% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.99%. Comparing base (e5eef1a) to head (f82a912).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/synthorg/client/runtime_builder.py 96.00% 1 Missing and 1 partial ⚠️
src/synthorg/engine/intake/engine.py 66.66% 2 Missing ⚠️
src/synthorg/ontology/__init__.py 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2006      +/-   ##
==========================================
+ Coverage   84.98%   84.99%   +0.01%     
==========================================
  Files        1882     1883       +1     
  Lines      111136   111241     +105     
  Branches     9481     9490       +9     
==========================================
+ Hits        94448    94550     +102     
- Misses      14368    14370       +2     
- Partials     2320     2321       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the IntakeEngine into the application's boot sequence, allowing the client-simulation runtime to initialize automatically. It introduces a flexible strategy-based intake system, resolves a long-standing circular import issue in the ontology package, and establishes a deterministic testing harness to ensure stability. These changes collectively enable end-to-end simulation support within the core product.

Highlights

  • Runtime Integration: Wired the IntakeEngine into the application boot process via a new runtime builder, enabling automatic initialization when a TaskEngine is present.
  • Pluggable Intake Strategies: Implemented a configurable intake strategy system supporting 'direct' (no LLM) and 'agent' (LLM-driven) modes, with settings managed via the bootstrap resolver.
  • Circular Import Resolution: Fixed a latent circular import in the ontology subsystem by implementing PEP 562 lazy exports for core services.
  • Testing Harness: Added a comprehensive end-to-end test harness to verify deterministic simulation behavior and runtime wiring.
  • Documentation and Types: Synced design documentation and updated frontend API types to reflect the new simulation runtime capabilities.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request wires the client-simulation intake engine into the application boot process by introducing a runtime builder that constructs the IntakeEngine and ReviewPipeline when a TaskEngine is present. The implementation supports both direct and agent intake strategies through new configuration settings and includes comprehensive E2E and unit tests. Furthermore, the ontology subsystem now utilizes PEP 562 lazy exports to resolve a cross-package import cycle, and the frontend API layer has been updated to reflect the regenerated OpenAPI schema. I have no feedback to provide.

README: hyphenate 'driven end-to-end'; 'Until the agent runtime lands,' disambiguates from the now-wired client-simulation runtime. runtime_builder: stop coercing a missing intake_model to the literal 'None' (None stays None, blank strings normalise to None). Regenerate data/runtime_stats.yaml for the Runtime Stats Freshness Gate (mem0_stars 56k+, tests raw refresh).
Copy link
Copy Markdown
Contributor

@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 `@src/synthorg/client/runtime_builder.py`:
- Around line 105-107: In the except block catching UnknownStrategyError in
runtime_builder.py (the block using "except UnknownStrategyError as exc" that
checks requested_strategy == _DEFAULT_STRATEGY), log a warning or error with
context (include requested_strategy and exc) before re-raising so the failure
retains diagnosable information; use the module's existing logger (or create one
if none exists) and emit a clear message about the direct-strategy failure, then
re-raise the original exception.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 08d069c6-90e0-4c2e-9790-2dcba5476e36

📥 Commits

Reviewing files that changed from the base of the PR and between 958c3ba and 4ba70bb.

📒 Files selected for processing (3)
  • README.md
  • data/runtime_stats.yaml
  • src/synthorg/client/runtime_builder.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Deploy Preview
  • GitHub Check: Build Backend
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Dashboard Test
  • GitHub Check: Test E2E
  • GitHub Check: Test Integration
  • GitHub Check: Test Conformance (SQLite)
  • GitHub Check: Test Unit
  • GitHub Check: Lighthouse Site
  • GitHub Check: Lighthouse Dashboard
  • GitHub Check: CodSpeed Python benchmarks
  • GitHub Check: CodSpeed Web benchmarks
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{py,ts,tsx,js,jsx,md,yaml,yml}

📄 CodeRabbit inference engine (CLAUDE.md)

No region/currency/locale privileged; use metric units; British English in all text and documentation

Files:

  • data/runtime_stats.yaml
  • README.md
  • src/synthorg/client/runtime_builder.py
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.md: Numerics in README and public docs must be sourced from data/runtime_stats.yaml via <!--RS:NAME--> markers
Markdown tables for tabular data

Files:

  • README.md
src/synthorg/!(persistence)/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Only src/synthorg/persistence/ may import sqlite/psycopg or emit raw SQL

Files:

  • src/synthorg/client/runtime_builder.py
src/synthorg/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/synthorg/**/*.py: Configuration Precedence: DB > env > code default via SettingsService/ConfigResolver (Cat-1) or env > code default (Cat-2, read_only_post_init); Cat-3 bootstrap secrets are pure env; YAML is company-template ingestion format only; no os.environ.get outside startup; pre-init Cat-2 reads use settings.bootstrap_resolver.resolve_init_value
No hardcoded numeric values outside of 0/1/-1, HTTP codes, hex masks, powers-of-2, and module-level annotated named constants (NAME: int|float|Final|Final[int]|Final[float] = literal); numerics live in settings/definitions/
Use async/await with asyncio.TaskGroup for fan-out/fan-in; helpers catch Exception (re-raise MemoryError/RecursionError)
Comments explain WHY only; no reviewer citations, issue back-refs, or migration framing
No from __future__ import annotations (Python 3.14 has PEP 649); PEP 758 except: except A, B: requires parens when binding
Type hints on all public functions; mypy strict; Google-style docstrings; line length 88; functions <50 lines; files <800 lines
Error classes: <Domain><Condition>Error format inheriting from DomainError; never inherit Exception/RuntimeError directly
Pydantic v2: frozen + extra="forbid" on every frozen model; @computed_field auto-exempt; per-line # lint-allow: frozen-extra-forbid for exceptions; use @computed_field for derived fields; NotBlankStr for identifiers
Args models required at every system boundary; use parse_typed() for every external dict ingestion
Immutability: use model_copy(update=...) or copy.deepcopy(); deepcopy at system boundaries
Clock seam: clock: Clock | None = None; inject FakeClock in tests; services own _lifecycle_lock; timed-out stops mark unrestartable
Untrusted content (SEC-1): use wrap_untrusted() from engine.prompt_safety; use HTMLParseGuard for HTML
Logging: use from synthorg.observability import get_logger; variable always logger; never import logging / print() in app...

Files:

  • src/synthorg/client/runtime_builder.py
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use ruff check --fix and ruff format for linting and formatting; mypy --num-workers=4 src/ tests/ for strict type-checking

Files:

  • src/synthorg/client/runtime_builder.py
src/**/*.py

⚙️ CodeRabbit configuration file

This project uses Python 3.14+ with PEP 758 except syntax: "except A, B:" (comma-separated, no parentheses) is correct and mandatory -- do NOT flag it as a typo or suggest parenthesized form. The "except builtins.MemoryError, RecursionError: raise" pattern is intentional project convention for system-error propagation. When evaluating the 50-line function limit, count only the function body excluding the signature lines, decorators, and docstring. Functions 1-5 lines over due to docstrings or multi-line signatures should not be flagged. Do not suggest extracting single-use helper functions called exactly once -- this reduces readability without improving maintainability.

Files:

  • src/synthorg/client/runtime_builder.py
🧠 Learnings (7)
📚 Learning: 2026-05-16T18:36:19.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/guides/contributing.md:95-95
Timestamp: 2026-05-16T18:36:19.195Z
Learning: In the SynthOrg repo, the “Doc Numeric Claims (MANDATORY)” RS-marker rule should be applied only to these docs: README.md; docs/index.md; docs/roadmap/index.md; docs/architecture/decisions.md; docs/reference/convention-gates.md. This rule is enforced by scripts/check_doc_numeric_macros.py (with runtime substitution by scripts/inject_runtime_stats.py), so reviewers should not flag similar numeric-claim issues in other paths (e.g., anything under docs/guides/). When checking those scoped files, the rule skips fenced code blocks and only flags digits that are adjacent to stat nouns (tests/providers/agents/stars/releases). Numeric CLI flags like “--num-workers=4” inside fenced bash code blocks are not subject to this rule.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:31.446Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/reference/conventions.md:787-789
Timestamp: 2026-05-16T18:36:31.446Z
Learning: In Aureliolo/synthorg, follow the `Doc Numeric Claims (MANDATORY)` rule enforced by `scripts/check_doc_numeric_macros.py` only for these markdown files: `README.md`, `docs/index.md`, `docs/roadmap/index.md`, `docs/architecture/decisions.md`, and `docs/reference/convention-gates.md`. The gate flags digits that appear adjacent to the stat nouns `tests`, `providers`, `agents`, `stars`, and `releases`—those numeric claims must use the required `<!--RS:...-->` macro format. Do not apply this rule to prose that mentions Python version numbers (e.g., “Python 3.14” / “Python 3.15”); those should not be flagged as requiring `<!--RS:...-->`.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: In the synthorg repo, the “Doc Numeric Claims (MANDATORY)” RS-marker rule is enforced only for this exact set of Markdown files: README.md, docs/index.md, docs/roadmap/index.md, docs/architecture/decisions.md, and docs/reference/convention-gates.md. During code reviews, do not raise RS-marker/numeric-claims findings for numeric values in any other files (e.g., docs/getting_started.md, docs/guides/*, docs/reference/conventions.md), since they are not checked or injected by scripts/check_doc_numeric_macros.py or scripts/inject_runtime_stats.py.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:31.446Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/reference/conventions.md:787-789
Timestamp: 2026-05-16T18:36:31.446Z
Learning: In Aureliolo/synthorg, do not require adding `<!--RS:...-->` “Doc Numeric Claims (MANDATORY)” numeric macros for Python version numbers mentioned in documentation prose (e.g., “Python 3.14”, “Python 3.15”). The `scripts/check_doc_numeric_macros.py` gate only applies to `README.md`, `docs/index.md`, `docs/roadmap/index.md`, `docs/architecture/decisions.md`, and `docs/reference/convention-gates.md`, and it only flags digits adjacent to specific stat nouns (tests/providers/agents/stars/releases), not language version mentions like “Python 3.14”.

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: When reviewing Markdown in the synthorg repo, account for the CI gate `check_doc_numeric_macros.py`: it skips fenced code blocks entirely, and it only flags digits that are adjacent to these stat nouns: `tests`, `providers`, `agents`, `stars`, `releases`. Therefore, numeric examples such as CLI flag values (e.g., `--num-workers=4` in fenced bash blocks) and prose version numbers (e.g., `3.14`/`3.15`) are not expected to trigger this check; prioritize changes only when digits appear next to one of the listed nouns (e.g., “5 tests”, “10 stars”, etc.).

Applied to files:

  • README.md
📚 Learning: 2026-05-16T18:36:35.250Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1944
File: docs/getting_started.md:109-109
Timestamp: 2026-05-16T18:36:35.250Z
Learning: When reviewing markdown files for the "Doc Numeric Claims (MANDATORY)" RS-marker rule, only require/flag missing RS markers in the files that are actually in-scope for the rule. The scope is enforced via an identical _SCOPED_FILES allowlist in scripts/check_doc_numeric_macros.py and scripts/inject_runtime_stats.py, and currently includes: README.md; docs/index.md; docs/roadmap/index.md; docs/architecture/decisions.md; docs/reference/convention-gates.md. For any other markdown files (e.g., docs/getting_started.md, docs/guides/*), missing RS markers for numeric claims are no-ops and should NOT be flagged.

Applied to files:

  • README.md
📚 Learning: 2026-05-05T09:04:46.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1760
File: scripts/_dual_backend_parity_lib.py:215-216
Timestamp: 2026-05-05T09:04:46.195Z
Learning: This repository targets Python 3.14+ and follows PEP 758. Therefore, reviewer tooling should NOT treat unparenthesized multi-exception `except` clauses written without an `as` clause (e.g., `except MemoryError, RecursionError:`) as syntax errors. Only flag `except`-clause problems when they are genuinely invalid for Python 3.14+.

Applied to files:

  • src/synthorg/client/runtime_builder.py
🔇 Additional comments (3)
data/runtime_stats.yaml (1)

2-3: LGTM!

Also applies to: 6-6, 10-12

README.md (1)

33-34: LGTM!

Also applies to: 48-48

src/synthorg/client/runtime_builder.py (1)

48-104: LGTM!

Also applies to: 108-163

Comment thread src/synthorg/client/runtime_builder.py
runtime_builder: log ERROR with context (requested_strategy, error_type, safe_error_description) before re-raising the default direct-strategy UnknownStrategyError, so a boot-time failure of the baked-in strategy retains diagnosable context per the error-path logging convention.
@Aureliolo Aureliolo merged commit 6a9c0aa into main May 18, 2026
82 checks passed
@Aureliolo Aureliolo deleted the test/sim-harness branch May 18, 2026 12:44
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 18, 2026 12:44 — with GitHub Actions Inactive
Aureliolo pushed a commit that referenced this pull request May 19, 2026
<!-- HIGHLIGHTS_START -->
## Highlights

> _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub
Models). Commit-based changelog below._

### What you'll notice
- Multi-agent coordination is now active immediately on startup for
smoother operation.
- Governance rules are fully enforced during use, ensuring compliance at
all times.
- Coordination metrics update live, giving real-time insights into
system activity.
- Review agents are now reliably processed, preventing silent drops in
tasks.
- Sandbox containers can be reused for agents and tasks, speeding up
execution and reducing overhead.

### What's new
- Agents support online runtime with a minimal safety framework to
improve stability.
- Recorded LLM interactions can be deterministically replayed at the
provider interface.
- Distributed path validation has been enhanced for more robust data
routing.
- A client-simulation runtime was added for end-to-end testing of the
IntakeEngine.
- A new work pipeline spine architecture has been introduced to
streamline task processing.

### Under the hood
- Infrastructure, Python, and web dependencies have all been updated to
latest versions.
- Updated apko lockfiles in the CI/CD pipeline improve build
consistency.

<!-- HIGHLIGHTS_END -->

:robot: I have created a release *beep* *boop*
---


##
[0.8.6](v0.8.5...v0.8.6)
(2026-05-19)


### Features

* agent runtime online + minimal safety spine (runtime root)
([#2003](#2003))
([e5eef1a](e5eef1a)),
closes [#1956](#1956)
* deterministic recorded-LLM cassette replay at the provider chokepoint
([#2010](#2010))
([cabf55d](cabf55d))
* distributed path validation + hardening
([#2011](#2011))
([a382e4a](a382e4a)),
closes [#1966](#1966)
* wire IntakeEngine via boot client-simulation runtime (e2e test
harness) ([#2006](#2006))
([6a9c0aa](6a9c0aa)),
closes [#1961](#1961)
* work pipeline spine
([#1960](#1960))
([#2013](#2013))
([29b64e3](29b64e3))


### Bug Fixes

* bring the multi-agent coordinator online at boot
([#2007](#2007))
([180b38a](180b38a)),
closes [#1958](#1958)
* full governance enforcement online
([#1957](#1957))
([#2005](#2005))
([4140fc5](4140fc5))
* harden anti-ghost-wiring gate and fix silently-dropped review agents
([#2000](#2000))
([89b57ce](89b57ce))
* make coordination metrics live
([#1959](#1959))
([#2012](#2012))
([c4775e2](c4775e2))
* sandbox lifecycle dispatch (per-agent / per-task container reuse)
([#2008](#2008))
([03d2587](03d2587)),
closes [#1965](#1965)


### Documentation

* add GitButler concept-only concurrency research
([#1978](#1978))
([#2009](#2009))
([9e4f5c1](9e4f5c1))
* honest-hybrid refresh of README, site, and design specs
([#2001](#2001))
([f485bea](f485bea))


### CI/CD

* update apko lockfiles
([#2004](#2004))
([e2b9eee](e2b9eee))


### Maintenance

* Update Infrastructure dependencies
([#2014](#2014))
([0b16bdf](0b16bdf))
* Update Python dependencies
([#2015](#2015))
([a7224bb](a7224bb))
* Update Web dependencies
([#2016](#2016))
([7a7fe76](7a7fe76))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Client-simulation runtime live (= e2e test harness)

1 participant