Skip to content

Translation tiers

Calcify classifies every translation unit (function, class, or module) into one of three tiers. The tier reflects how completely the Python source maps to native Chelis constructs.

Fully typed Python that uses only pure, translatable patterns becomes idiomatic Chelis with explicit types. The output contains no bridge calls and no residual Python. It is indistinguishable from hand-written Chelis.

Requirements for Tier 1 eligibility:

  • Every variable, parameter, and return value carries a concrete type annotation.
  • No mutation of shared state (local rebinding is fine).
  • All called functions are themselves Tier 1 translatable or have a known Chelis equivalent.
  • No use of eval, exec, dynamic attribute access, or untyped containers.

When parts of a module resist pure translation, Calcify keeps those parts in Python and translates the rest. The translated Chelis core communicates with the residual Python through the Python-Chelis bridge.

Typical Tier 2 scenarios:

  • A module mixes pure computation (translatable) with I/O or stateful orchestration (kept in Python).
  • A function calls a library that has no Chelis equivalent.
  • A class uses inheritance patterns that do not map to Chelis type classes.

The manifest marks each unit with its tier and lists every bridge call site.

For code that does not satisfy Tier 1 or Tier 2 constraints, Calcify attempts a best-effort translation. Every decision the translator makes is recorded in the manifest and flagged for human review.

Tier 3 output is syntactically valid Chelis, but its semantic equivalence to the original Python is not guaranteed by the tool. The manifest includes:

  • Each point where the translator chose between alternatives.
  • Assumptions about runtime behavior.
  • Suggested tests to verify equivalence.

Translation is deterministic at every tier. The same Python source, the same Calcify configuration, and the same typing-pass output produce byte-identical Chelis output. This holds for Tier 3 as well: the agentic decisions are functions of the input, not of randomness.