Skip to content

features review

bondiano edited this page Nov 12, 2026 · 1 revision

Review analysis

Active contributors: Vassiliy Kuzenkov (also recorded as bondiano), Eduard.

Sych fixes the questions a change must answer before asking a model to look for defects. Snapshot-bound evidence, bounded context and checked model replies feed a deterministic reducer; an empty discovery answer never turns an unassessed requirement into a pass.

Follow the engine

Read Questions answered
Planning and reduction Which obligations exist, what counts as evidence, and how coverage differs from recommendation
Evidence and context What fits a packet, how moved code is represented, and what BASE versus HEAD searches actually establish
Model passes Assessment, combined review, independent risk audit, discovery, verification and bounded recovery

Fact production belongs to Facts, provider routing and monetary accounting to Models. These pages describe how review consumes those services, not their implementations.

Pipeline and trust boundary

flowchart TD
    Pin["Pin target tip, diff base and head"] --> Policy["Read trusted policy"]
    Policy --> Facts["Collect snapshot-bound facts"]
    Facts --> Plan["Fix review units and obligations"]
    Plan --> Packets["Build bounded discovery and verification packets"]
    Packets --> Passes["Assess, discover, audit and verify"]
    Passes --> Limits["Merge chunks and preserve context gaps"]
    Limits --> Reduce["Reduce evidence into statuses"]
    Reduce --> Save["Store result and complete run"]
Loading

execute in crates/sych-app/src/review/mod.rs coordinates this order. Policy normally comes from TARGET_TIP, while the comparison uses DIFF_BASE and HEAD. An explicit --policy-ref selects a different trusted revision and logs a warning. Policy files proposed in HEAD are returned as a policy diff, not applied to their own review.

The app gathers semantic, syntax, effect-ledger, lint and CI facts before calling sych_core::plan. Optional isolated checks produce CI-shaped facts or explicit refusal/failure gaps. The model itself runs no command. Turning semantic collection off does not make missing semantic knowledge a proof of absence.

There are two execution targets: a new local run, and a server-claimed run carrying a cancellation receiver and storage fence. Both use the same Session. Cancellation or a failed save does not mark a run completed. A successful session writes immutable artifacts before complete_run; server scheduling and publication are separate concerns described in Server.

Four distinctions to preserve

  1. Obligation versus candidate. An obligation is a planned requirement. A candidate is a hypothesis from discovery or audit. Rejecting every candidate does not settle an obligation.
  2. Source completeness versus program correctness. Packet evidence can be COMPLETE_FOR_QUERY for the exact spans shown. That does not make a partial call graph complete or prove the program correct.
  3. Execution versus coverage. PLAN_EXECUTED can still have partial coverage, for example because required evidence is unknown or source files were unreviewed.
  4. Coverage versus recommendation. A waiver can lower the risk decision without rewriting UNKNOWN or VIOLATED, and without making coverage complete.

See Planning and reduction for the exact rules, including why NO_BLOCKING_FINDINGS_IN_SCOPE is not a whole-program safety claim.

Current-main context protections

The documented revision is 00dc7637f89a47ee6fd4713204f8331418428370.

  • Removed BASE lines that reappear among added HEAD lines are recognized as bounded, exact-text moves. Moved tests are described as moves rather than dropped assertions. This is a source-text observation, not proof that moving code preserves its runtime behavior.
  • A literal search answer names its source side and summarizes the same query on the counterpart side. A BASE-only absence cannot establish that HEAD is unused or missing.
  • Search hits include bounded neighboring source, so a helper declaration can arrive with its guard or return. Explicit line reads remain exact.
  • Removed-line hypotheses can receive a cross-file summary of names that disappear with the removed code.
  • Selected free-text lists from models are trimmed and deduplicated; blank questions and needs items are dropped.

The bounds, exceptions and regression tests are in Evidence and context, not implicit guarantees of exhaustive analysis.

Saved trace

crates/sych-app/src/review/session.rs saves snapshot, diff, trusted policy, policy review, external inputs, facts, evidence, context packets, evidence manifest and review result. Real model runs also save an analysis artifact with route plans, pass outcomes, assessment records, discovery drafts and refusals, context answers, candidate histories and attempts.

Prompt text and chain-of-thought are not stored in that artifact. Each pass identifies its packet indices and attempt IDs; a reused checkpoint identifies its parent instead of inventing a new attempt. A parent without a completed result can still supply eligible checkpoints, but supplies no parent-result link.

With --models fake and no scripted responses, the app makes no model assessments. Applicable obligations stay UNKNOWN/NOT_ASSESSED. This is a harness check, not a successful review-quality measurement. See CLI for saved-result readers.

Key source files

Source Responsibility and modification entry point
crates/sych-app/src/review/mod.rs Pinning, trusted policy, fact collection and local/claimed entry points
crates/sych-app/src/review/session.rs Cancellation, durable artifacts and terminal run state
crates/sych-app/src/review/outcome.rs Packet construction/compression, engine setup, reduction and usage projection
crates/sych-core/src/plan.rs Pure unit grouping, applicability, risk hints and obligations
crates/sych-core/src/broker/build.rs Packet requests and candidate source selection
crates/sych-core/src/analysis/context.rs Local source references and change metadata shown to models
crates/sych-app/src/analysis/mod.rs Pass scheduling, batching and combined-call eligibility
crates/sych-app/src/analysis/passes.rs Checked assessments, context answers and verification rounds
crates/sych-core/src/reduce.rs Final evidence acceptance, waivers, coverage and recommendation

Size, tests and attribution

Counts use tracked .rs files at origin/main for the documented revision, not generated files or the working-tree wiki.

Scope Source files Primary integration-test files
Core analysis, broker, planner and reducer 20 20
App review and analysis 10 9
Total 30 29

Source scope is exactly crates/sych-core/src/analysis/** (11), crates/sych-core/src/broker/** (7), crates/sych-core/src/plan.rs, crates/sych-core/src/reduce.rs, crates/sych-app/src/review/** (5) and crates/sych-app/src/analysis/** (5). It includes the two tour/follow-up bridge modules; their user-facing behavior is documented in Tours and handoff.

Primary test scope is all .rs files under crates/sych-core/tests/analysis/** and crates/sych-core/tests/broker/**, plus crates/sych-core/tests/review.rs, crates/sych-core/tests/reduce.rs, crates/sych-core/tests/rules.rs, and these nine app files: crates/sych-app/tests/analysis.rs, crates/sych-app/tests/analysis_budget.rs, crates/sych-app/tests/batching.rs, crates/sych-app/tests/verify_search.rs, crates/sych-app/tests/test_integrity.rs, crates/sych-app/tests/replay.rs, crates/sych-app/tests/engine_merges.rs, crates/sych-app/tests/outgoing_prompt.rs and crates/sych-app/tests/checkpoints.rs.

The test/source file ratio is 29/30, approximately 0.97. Test harness modules inside those trees count as files; inline unit tests remain part of source-file counts, not extra test files. Two additional adapter boundary regression files, crates/sych-adapters/tests/git_snapshot/search_context.rs and crates/sych-adapters/tests/git_snapshot/generated.rs, are relevant but excluded from that ratio. None of these counts measures test coverage.

The source scope has 3 unique nonbot author names in git log origin/main --format=%aN -- <source paths>. Two display names, bondiano and Vassiliy Kuzenkov, share a Git author identity, so this corresponds to 2 human identities, not three maintainers. The byline records default-branch contributions, not current ownership or per-person statistics.

Change safely

Use the focused pages' entry-point tables to change one boundary at a time. Extend deterministic contract tests alongside scheduling or context changes, then follow Testing and Patterns and conventions. In particular, never hide a context cut, weaken anchor validation or treat an unavailable analysis as a pass to reduce noisy findings.

Clone this wiki locally