Skip to content

background

bondiano edited this page Nov 12, 2026 · 1 revision

Design background and pitfalls

Sych's design keeps review claims narrower than the available evidence. The repository currently contains one accepted ADR, docs/adr/0001-execution-outcome-values.md; other rationale below is derived from implementation, not presented as additional accepted ADRs.

Accepted ADR: execution outcome

ADR 0001 was accepted October 25, 2026. A saved result exists only after finalization/completion, so putting the current execution state inside it would repeatedly say COMPLETED without explaining how the run got there.

execution_outcome Meaning at entry to finalization
PLAN_EXECUTED Planned work ran; this does not promise complete coverage
LIMIT_REACHED Budget/size limit stopped work; skipped work remains gaps
RETRIES_EXHAUSTED Retryable failures exhausted retries; an honest partial result was retained
INPUT_UNAVAILABLE Substantive input such as the diff could not be obtained; coverage unavailable

CANCELLED, SUPERSEDED and FAILED are execution states, not result outcomes: those states do not save a ReviewResult. Outcome does not by itself set recommendation. Limit/retry outcomes cannot claim complete-for-scope coverage. Adding an outcome value changes an external enum and needs a compatibility path plus an old-fixture test. The authoritative enum is crates/sych-core/src/status.rs, not hand-edited JSON Schema.

Why the boundaries exist

Choice Practical reason Source
Pure planner/reducer Models propose assessments/candidates; they cannot turn their own verdict into final authority crates/sych-core/src/plan.rs, crates/sych-core/src/reduce.rs
Target policy separate from head A change must not relax the rules that assess itself crates/sych-app/src/review/mod.rs
Frozen external inputs A result must explain which evidence it actually used; late CI becomes another generation crates/sych-core/src/freeze.rs
Generation plus worker fence A timed-out or superseded worker must not finalize stale protected work crates/sych-storage/src/jobs.rs, crates/sych-storage/src/sql.rs
Outbox and uncertainty A lost network response does not prove an external comment was never created crates/sych-storage/src/publish.rs
Held unknown cost A dispatched timeout is not a free model call crates/sych-storage/src/ledger.rs
Separate mutable relevance New pushes can stale a result without changing its immutable findings crates/sych-core/src/status.rs
Feedback as proposed policy PR Human judgment can improve accepted policy without executing free-text instructions or silently rewriting rules crates/sych-core/src/suggest.rs

Follow Architecture for composition and Review for the analysis path.

Danger zones when changing code

  • “Completed” is not “passed.” Read coverage, UNKNOWNs, findings and recommendation independently. Publication confirmation is not correctness or freshness (crates/sych-core/src/status.rs).
  • An empty result is not evidence of absence. Bounded search, omitted files, unresolved imports and failed tools must retain limitations. BASE and HEAD observations cannot substitute for each other (crates/sych-core/src/broker/ops.rs, crates/sych-core/src/analysis/context.rs).
  • Moved code is not necessarily removed behavior. Cross-side moves and renamed paths affect test-removal/effect claims; keep their provenance and partial matching limits (crates/sych-core/src/effects/build.rs, crates/sych-core/src/analysis/context.rs).
  • Authenticity is not independent proof. Authenticated CI identifies provenance, while author-edited assertions may still be inadequate (crates/sych-core/src/ci.rs).
  • A budget object is not a recursive defaults patch. Omitted optional fields in an explicitly supplied object become unset; inspect normalized configuration (crates/sych-core/src/config/server.rs).
  • No opportunistic migration or replay. Opening storage does not migrate it; reading a pruned result does not rerun it; uncertain publication is not blindly retried (crates/sych-storage/src/connection.rs, crates/sych-storage/src/publish.rs).
  • Do not turn accepted risk into evidence. Waivers preserve the original VIOLATED/UNKNOWN; private tour progress is never approval (crates/sych-core/src/obligation.rs, crates/sych-app/src/server/tours.rs).
  • Trust code over stale guide constants. Current storage has 25 application tables, and directory policy suggestions require five adverse judgments, not merely five total judgments (crates/sych-storage/src/import/schema.rs, crates/sych-core/src/suggest.rs).

The configuration reference, data model reference and security page turn these choices into concrete contracts.

Key source files and change entry points

File Use
docs/adr/0001-execution-outcome-values.md Accepted execution-outcome rationale
crates/sych-core/src/status.rs Independent status enums
crates/sych-core/tests/contracts.rs External schema compatibility checks
crates/sych-core/tests/reduce.rs Honest coverage/recommendation behavior
AGENTS.md Required self-review change discipline

Add rationale as an ADR when a new external meaning needs an explicit decision; do not infer an accepted decision from a guide or model response.

Clone this wiki locally