Repository navigation
apps server
Active contributors: Vassiliy Kuzenkov.
The server turns signed GitHub signals and authorized requests into durable review jobs, then publishes advisory results separately from analysis. It also serves the dashboard's finding history, policy suggestions, analytics, private tours and operator workflows.
| Area | What to read |
|---|---|
| Webhooks, reconciliation and generation decisions | Admission and scheduling |
| Leases, CI freeze, review execution and outbox recovery | Workers and publication |
| Caller identities, permissions, playground and private reader workflows | Operator capabilities and auth |
| Finding continuity, feedback, risk acceptance and suggested policy edits | Findings and policy |
| Quality, gaps, cost, latency, Slack and weekly delivery | Analytics and notifications |
The API reference, security and deployment pages cover the complete external contract and operating environment. docs/SERVER.md is the repository's detailed configuration guide and runbook.
flowchart LR
GH["GitHub delivery"] --> Admit["Verify and admit"]
Client["API or browser caller"] --> Request["Authorize request"]
Admit --> DB["Inbox, intents, generations, jobs"]
Request --> DB
SCM["Current PR state"] --> Schedule["Pure scheduling decision"]
DB --> Schedule
Schedule --> Worker["Leased worker"]
Worker --> Review["Pinned source, CI freeze, review engine"]
Review --> Result["Immutable result and durable outbox"]
Result --> Publisher["Publisher and reconciler"]
Publisher --> GitHub["Summary, inline comments, neutral check"]
Result --> Readers["History, analytics, tours, handoff"]
Readers --> Notify["Slack reads and weekly digest"]
The HTTP handler never starts inference for a webhook. crates/sych-app/src/server/engine.rs rereads the PR before deciding what work is significant. crates/sych-storage/src/lib.rs commits a completed server run's result pointer, job completion and publication intent together. External publication is still fallible and can remain UNCERTAIN.
| Command | Process responsibility |
|---|---|
sych serve --config sych.yaml |
HTTP intake plus scheduler, worker, publisher and maintenance loops |
sych api --config sych.yaml |
HTTP API, webhooks and configured UI without claiming background work |
sych worker --config sych.yaml |
Background work; its HTTP listener exposes only health and metrics |
The API role can hold an Engine for request-time SCM operations without running its background loops. A missing engine produces an explicit dependency error on handlers that require one. Split processes need shared metadata and artifact access; a shared database alone does not share local files. See Storage.
| Boundary | Files and responsibility |
|---|---|
| Composition |
crates/sych-app/src/server/mod.rs, crates/sych-app/src/server/build.rs: shared state, routes, role selection, trusted credentials and engine settings |
| Admission and scheduling |
crates/sych-app/src/server/hooks.rs, crates/sych-app/src/server/engine.rs, crates/sych-core/src/scm.rs, crates/sych-core/src/schedule.rs
|
| Execution |
crates/sych-app/src/server/worker.rs, crates/sych-app/src/server/ci.rs, crates/sych-app/src/server/mirrors.rs: claimed jobs, pinned source and evidence |
| Publication |
crates/sych-app/src/server/publisher.rs, crates/sych-core/src/publication/mod.rs: external orchestration versus pure placement/rendering |
| Reader and operator features |
crates/sych-app/src/server/views.rs, crates/sych-app/src/server/api.rs, plus focused handler modules |
| External transports |
crates/sych-adapters/src/github/mod.rs, crates/sych-adapters/src/notify.rs, crates/sych-adapters/src/slack.rs
|
| Durable lifecycle |
crates/sych-storage/src/admission.rs, crates/sych-storage/src/scheduler.rs, crates/sych-storage/src/jobs.rs, crates/sych-storage/src/outbox.rs, crates/sych-storage/src/publish.rs
|
Measured at documented revision 00dc7637f89a47ee6fd4713204f8331418428370 on origin/main:
| Measure | Value |
|---|---|
| Application server source files | 30 Rust files |
| Server-oriented application integration-test roots | 24 Rust files |
| Test/source file ratio | 24 / 30 = 0.80 |
| Unique human authors of application server source | 1 |
Source scope is tracked crates/sych-app/src/server/**/*.rs, including mod.rs and files with inline unit tests. Test scope is the top-level crates/sych-app/tests/*.rs files matching ^mod (world|http);|sych_app::server; nested fake/provider/HTTP helpers, fixtures and shared-crate tests are excluded. This is a file ratio, not line or execution coverage. Shared core, adapter and storage implementations are described here but excluded from these counts.
The bylines on these pages use that source scope's origin/main author history. Git records Vassiliy Kuzenkov and the historical name bondiano under the same author identity, counted once; bots are excluded. This is contribution evidence, not an ownership or support commitment.
-
New event or scheduling rule: start with the normalized types and pure
decidefunction, then admission/storage transactions. Preserve the distinction between a signal and current SCM state. - New result-side effect: decide whether it belongs in fenced finalization, a durable outbox or an explicitly private reader action. Do not add network calls inside SQL transactions.
-
New HTTP feature: register the route in
crates/sych-app/src/server/mod.rs, enforce caller scope and the appropriate role, and update DTO/schema generation where the contract changes. - New operator view: reuse repository visibility filtering; tenant-wide settings and budgets must not leak through a repository-scoped read.
The deterministic harness in crates/sych-app/tests/world/mod.rs uses a loopback GitHub fake, a file:// Git origin, migrated storage, fake models and a controlled clock. Relevant suites include server, scheduler, CI evidence, outbox, publication, auth, findings, suggestions, analytics, digest, Slack, playground and tour tests. See Testing for execution requirements.
Publication is advisory, not approval or merge authority. A completed run can have partial coverage, a delivered result can be stale, and a lost write reply is not proof of absence. Loop intervals and configured deadlines describe implementation behavior, not latency or availability SLOs. The engine reviews a single run in one worker; separate workers scale independent claims rather than distributing one analysis.