Repository navigation
how to contribute debugging
Start with the saved run and its explicit gaps before rerunning inference. Most investigations can separate configuration, source facts, analysis, persistence and publication without another model call.
Record the binary/build revision, config hash, run ID, change/generation, target tip, diff base and reviewed head. A branch name or current working tree is not the snapshot the result reviewed. crates/sych-core/src/snapshot.rs defines those identities; Evidence and context explains side-specific reads and searches.
Do not rewrite saved artifacts to make an investigation pass. A stale result can be valid for its old snapshot and irrelevant to the new head.
sych config validate --config sych.yaml --repo .
sych doctor --config sych.yaml --repo .
sych show --run RUN_ID --config sych.yaml --format markdown
sych explain --run RUN_ID --obligation RULE_ID --config sych.yaml --format markdowncrates/sych-app/src/commands/doctor.rs checks effective configuration, Git access, environment-variable presence, artifact-directory metadata, price catalog, profile resolution and database status. It makes no model request unless --probe-model PROFILE is supplied. Warnings can coexist with exit 0, and metadata writability is not the same test as server readiness creating a temporary file.
show and explain read stored artifacts, not a new analysis. Missing or corrupt bytes are reported rather than regenerated. Source snapshot/diff artifacts expire before results; their absence after seven days is not by itself corruption. See Storage.
Two doctor options are deliberately not passive:
-
--probe-model PROFILEsends a small paid structured request. -
--scm-smoke CONNECTION --pr Nwrites, reads, updates, finds and deletes a marked comment on PR N of the connection's first repository.
Use them only with authorization and a suitable test PR. A local doctor profile resolves in personal-local mode; successful resolution alone does not prove a subscription provider is allowed in a hosted service.
| Symptom | Inspect next |
|---|---|
| Bad flags, refs, config or unexpected policy |
crates/sych-app/src/args.rs, crates/sych-app/src/config.rs, target-tip policy in crates/sych-app/src/review/mod.rs
|
| Missing symbols, partial facts or tool refusal |
sych semantic --repo . --base origin/main; Facts
|
| Missing context, wrong source side or moved-code claim | Saved context packets and analysis; Evidence and context |
| Candidate rejected, repeated request or exhausted pass | Saved analysis artifact; Model passes
|
UNKNOWN despite no findings |
Planned obligation, required evidence and reducer; Planning and reduction |
| No result, schema error or corrupted artifact | Run state, database/schema identity and matching artifact directory |
| Webhook accepted but no execution | Receipt/decision, intent, current PR state, job and worker role |
| Completed run but missing/stale comment | Publication operation, relevance and reconciler, not a fresh analysis |
sych semantic may install/download pinned tools and performs semantic collection; it is not a pure saved-result read. --semantic off is useful for isolating a non-semantic harness path, not for claiming the missing facts were proved.
crates/sych-app/bin/sych.rs writes formatted logs to stderr, leaving stdout available for JSON/Markdown. The default filter is:
warn,sych_app=info,sych_adapters=info,sych_storage=info
SYCH_LOG uses tracing filter syntax, for example SYCH_LOG=sych_app=debug,sych_adapters=debug. The configured formatter omits timestamps and targets and enables ANSI only on a terminal. A process supervisor/log collector must supply any deployment timestamps/retention; no distributed tracing backend is configured here.
crates/sych-app/src/errors.rs defines operational exits:
| Code | Meaning |
|---|---|
| 1 | Eval/validation expectations failed |
| 2 | Invalid input/config/ref, including an unknown saved run |
| 3 | Could not produce/read a result, including schema/storage failures |
| 4 | Permission/credential failure where explicitly classified |
| 10 | Violation under the corresponding review exit policy |
| 11 | Incomplete result under the corresponding review exit policy |
| 130 | Accepted cancellation |
The default operational review exit policy does not turn every finding or UNKNOWN into process failure. Read the result's execution, coverage and recommendation independently.
Keep tokens, private keys, database credentials, prompts and raw model replies out of logs and bug reports. crates/sych-core/src/secrets.rs supplies redaction; do not assume every copied source excerpt or debug payload is safe to share.
- Check
/health/liveand/health/readyusing Monitoring. Readiness proves DB access and artifact writability, not model/SCM availability or active background work. - Inspect the admission/scheduling path. A 202 webhook means durable admission, not model execution. Out-of-scope repositories, bot comments and ignored events may correctly create no job.
- Inspect jobs and the run stage through
/v1/jobs,/v1/runs/:idand the dashboard queue. An API-only role does not claim jobs; a split worker must share storage/artifacts. - For CI gaps, check configured workflow/job/artifact names, checkout binding and frozen evidence. A locally imported report remains
AUTHOR_CLAIM; relabeling it is not a fix. - For lease loss, preserve owner/epoch/generation evidence. Stale-worker pin/finalization rejection is a safety mechanism. Do not hand-edit job state to bypass the fence.
- For provider limits, examine attempts, reserved money, unknown charges, route refusals and deadline/cost gaps. Unknown charge is not zero cost; retrying blindly may cost more.
Worker log messages include job claimed, waiting for evidence, lease lost, job retried later and analysis ended without a result, with run/epoch fields where applicable in crates/sych-app/src/server/worker.rs. HTTP refusal envelopes carry an error.code, retryability and correlation ID; retain those instead of logging secret request bodies.
sych reconcile --config sych.yamlThis lists unresolved publication state without an SCM call. UNCERTAIN means the remote write may have happened; it is not permission to POST again. Let automatic reconciliation work within its window.
After the reconciliation window is exhausted, inspect the actual bot-owned comment/marker and access completeness. Only when the object is definitely absent should an authorized operator consider:
sych reconcile --config sych.yaml --allow-create OP --actor NAME --reason TEXTNAME must identify a configured API client with at least the writer role, not an arbitrary audit label. This audited decision accepts duplicate risk and is not allowed for a known remote object ID. Follow Workers and publication and docs/SERVER.md, rather than re-running analysis to repair delivery.
Use the narrowest test harness: pure core test for a decision, snapshot/adapter fixture for source facts, server world for timing/recovery, or frontend request/display spec for the UI. For nondeterministic verifier investigations, preserve a measurement report and its analysis artifacts for replay instead of comparing unrelated fresh discoveries.
Useful source entry points are crates/sych-app/src/review/session.rs, crates/sych-app/src/analysis/passes.rs, crates/sych-app/src/server/worker.rs, crates/sych-app/src/server/publisher.rs and crates/sych-storage/src/lib.rs. Preserve the real limitation in the regression: do not weaken anchor, completeness or trust checks just to remove noise.