Skip to content

features facts

bondiano edited this page Nov 12, 2026 · 1 revision

Pinned facts and checks

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

Facts describe what Sych could observe at pinned source positions. Collection preserves source side, producer, trust and incompleteness; an empty tool response is not proof that behavior or dependencies are absent.

Git is the source boundary

crates/sych-adapters/src/git/snapshot.rs pins target tip, head and either their merge base or explicit --diff-base. Target tip normally supplies trusted policy; it is not interchangeable with diff base or the deployed version. A CodeRef binds snapshot, side, path, blob, line range and line-content hash.

crates/sych-adapters/src/git/command.rs addresses the object database through --git-dir with a cleared environment, ignored system/global configuration, disabled replace refs and lazy fetches, and no work-tree checkout, hooks, filters, textconv or external diff. Materialization writes raw blobs into separate scratch workspaces for each side.

crates/sych-adapters/src/git/workspace.rs excludes secrets, symlinks, submodules, non-text content and executable tool configuration such as .cargo/config*. Semantic/lint materialization uses a 4 MiB per-blob limit, with whole-workspace limits of 256 MiB and 50,000 files. Omitted content remains a limitation.

Semantic and syntax observations

Layer Implementation Important boundary
Rust LSP Pinned rust-analyzer Default features/host configuration; build scripts, proc-macros and cargo check disabled
TS/JS LSP Pinned TypeScript native tsc --lsp --stdio Exact supported lockfile version; conflicting or unsupported versions are not substituted
Go LSP Pinned gopls and Go Host GOOS/GOARCH, no extra tags, cgo off; no complete interface/reflection call graph
Python LSP Pinned ty with untrustedWorkspace: true No Python dependency installation; third-party imports can remain unresolved
Syntax syn for Rust, oxc for TS/JS/React, tree-sitter for Go/Python In-process parsing, no execution, macro expansion or general type resolution

Versions, download locations and integrity pins live in crates/sych-adapters/src/tools/pinned.json and crates/sych-adapters/src/tools/indexers.json. The tool resolver verifies downloads instead of selecting host-installed language servers.

LSP collection starts from changed constructs on both sides, then records references, callers, callees, implementations, selected type definitions and diagnostics as capabilities permit. Locations outside the snapshot and unmappable answers are named rather than invented. Syntax facts record shapes such as transaction calls, detached tasks, cleanup, suppressed tests and dynamic dispatch, capped at 200 facts per file.

Optional tooling.dependency_install prepares Rust, pnpm and Go dependencies separately for each side. Installers use the configured bwrap/docker sandbox; registry networking is deliberately available there. An unavailable sandbox follows the configured fail/degrade policy, never an unsandboxed retry. Rust fetches do not build repository code, pnpm disables scripts and pnpmfile, and Python installs are refused because build backends can execute project code. This installer boundary is different from the network-disabled targeted checks below.

Semantic caches bind snapshot, side, language, tool/profile configuration and repository access partition. Only READY responses are cached. Inactive cfg, unexpanded macros, unresolved imports and dynamic behavior can keep assessment incomplete; see Review.

Linters and easement projects

With --semantic on, pinned linters inspect selected head files:

Files Tool
Python ruff
TS/JS oxlint
SQL sqruff
PHP mago, lint only
R jarl
Clojure clj-kondo
GitHub workflows actionlint and zizmor
Configured Rust, Go, TS/JS and Python projects easement

Ordinary linter processes have a cleared environment, empty HOME/PATH and a 120-second limit. Unsafe project plugin/configuration paths are disabled or replaced: clj-kondo hooks are not loaded, actionlint helpers are off, mago extensions are off, and executable oxlint configuration causes default rules plus a limitation. This is controlled static-tool invocation, not a claim that every linter runs inside a network namespace.

crates/sych-adapters/src/lint/easement/mod.rs finds project roots whose head contains easement.yml, when a changed source/manifest lies below that root or a policy dependency changes. It indexes each whole project, not just the diff, with a 600-second limit per check. Producers are easement for root or easement:<directory> for nested projects.

Its PATH contains pinned indexers only: rust-analyzer, scip-go, scip-typescript and scip-python as needed, plus their controlled runtimes. Rust receives a nonexistent RUSTC_WRAPPER so SCIP cannot compile build scripts/proc-macros; Python receives an empty environment description and cannot discover packages by running pip/python. Unresolved generated code and dependencies are limitations.

Easement compares violations outside changed lines against the diff-base project, through file renames, to identify introduced violations. No base policy means no prior configured violations; a failed base check means newness is unknown. At most 200 introduced violations are retained. Changed linter policy is explicitly the author's rule selection, not independent proof.

CI formats, binding and trust

crates/sych-adapters/src/ci/mod.rs parses data, never runs the report producer. Supported formats are cargo JSON, JUnit, SARIF, GitLab Code Quality, LCOV, Cobertura, Sych command manifests, Go test JSON/cover/vet JSON, Terraform plan JSON and rendered Kubernetes YAML.

  • A local --ci-facts file is AUTHOR_CLAIM, even with a manifest. The sidecar names job, tested OID, toolchain, target and features.
  • Diagnostic locations map to head only when the manifest identifies that head, or authenticated CI provenance proves a SOURCE_HEAD/MERGE_RESULT binding with that source head. Otherwise the report is stale/unbound.
  • Authenticated reports retain provider/repository/workflow/run/attempt/job/artifact identities and hashes. Provenance establishes origin, not an independent test oracle.
  • Skipped tests are not executed evidence; changed tests are not an independent oracle; line coverage shows execution, not correct assertions. Expected missing/malformed/skipped reports produce explicit gaps.

Reports are bounded, including 2,000 diagnostic/test records and XML nesting depth 64. Infrastructure normalization is covered in Deployment checks; authenticated acquisition belongs to Server.

Approved execution profiles

Repository execution is off by default. crates/sych-core/src/config/execution.rs accepts only admin-approved profiles with a digest-pinned image, absolute executable, literal arguments or values from closed choices. Neither models nor repository text supply an arbitrary command.

crates/sych-adapters/src/execution.rs materializes pinned head into a fresh workspace and runs Docker with no network, dropped capabilities, read-only container root, no-new-privileges and bounded time, memory, CPU and process count. No credentials are supplied in environment or mounts. Report stdout becomes head-bound DERIVED_LOCAL evidence; refusal or inability to run is a gap, not a pass. A nonzero check exit can still produce a valid failed-test report.

compare_base repeats the same profile on diff base only to annotate differing head outcomes. It does not turn base outcomes into head evidence. Images must already contain what the offline check needs.

Effect ledger

crates/sych-core/src/effects/ compares observable effects in changed code: database, filesystem, network, cache, subscription and UI effects, plus registered wrappers. Entries preserve base/head occurrences, guard, transaction/lifetime scope, failure behavior, multiplicity and ordering. Matches are preserved, moved, changed, removed, added or unresolved, with separate resolution quality.

A move without a semantic call edge remains partial; a removal does not rule out another mechanism outside changed files. Registry guarantees carry forward only while their implementation references are current. Changed/unbound implementations require rechecking, and unresolved effects leave gaps. The ledger is derived, partial static evidence, not whole-program dataflow or a runtime guarantee.

Key source files

Source Change entry point
crates/sych-adapters/src/git/snapshot.rs Snapshot identity and diff capture
crates/sych-adapters/src/semantic/profiles.rs Language-server launch/configuration
crates/sych-adapters/src/syntax/mod.rs Syntax collection and limits
crates/sych-adapters/src/lint/mod.rs Linter selection and safe invocation
crates/sych-adapters/src/lint/easement/env.rs SCIP execution boundary
crates/sych-core/src/ci.rs CI binding, trust and evidence conversion
crates/sych-adapters/src/execution.rs Approved check runner
crates/sych-core/src/effects/build.rs Cross-side effect matching

Scope and tests

57 source files, 13 test files; ratio 0.228; 1 unique human author. Method: capability measurements. Scope: adapter git/, semantic/, syntax/, lint/, ci/, tools/, execution.rs, sandbox.rs; core effects/, ci.rs, lint.rs, semantic.rs, syntax.rs; adapter tests semantic.rs, lint.rs, easement.rs, effect_ledger.rs, ci_reports.rs, git_fetch.rs; app test ci_evidence.rs.

The scripted LSP and easement tests exercise real pinned Git snapshots without claiming live-tool coverage. Change trust/binding together with crates/sych-app/tests/ci_evidence.rs; change effect matching together with crates/sych-adapters/tests/effect_ledger.rs. Full check commands are in Testing.

Clone this wiki locally