v0.13.2Control flow and dataflow are rebuilt on explicit semantics, Z3 translation matches executable C# numeric rules, and the build chain is hermetic and supply-chain verified with hash- and size-pinned Z3 binaries.See what's new

Stable Identifiers

Calor can embed an identifier in a structural declaration so tools can target that declaration independently of its name or file location. In current syntax, source IDs are optional: the parser creates an in-memory _auto ID when an opener omits one.

Plain Text
// Compact source: the parser supplies an in-memory ID
§M{Calculator}
  §F{Calculate:pub} (i32:x) -> i32
    §E{}
    §R (* x 2)

// Explicit source identity for durable external references
§M{m_3hj8x2bw9pkq:Calculator}
  §F{f_7k9m2npqrstv:Calculate:pub} (i32:x) -> i32
    §E{}
    §R (* x 2)

Explicit IDs are useful when an agent, index, generated artifact, or review packet needs a durable target. They are not magic history: a rename or file move keeps the identity only if the editing tool preserves the ID, and a copied or extracted declaration must receive a new one.


What Explicit IDs Solve

Names and locations are fragile references:

ReferenceFailure mode
File and lineEarlier edits move the line
Declaration nameRenames and overloads make it stale or ambiguous
Content hashAny implementation edit changes it
Preserved Calor IDRemains stable across rename, move, and body edits

That makes explicit IDs helpful for precise edits, navigation indexes, and round-trip metadata. Collision checks make accidental reuse visible, but IDs do not eliminate ordinary textual merge conflicts when two branches edit the same lines.


Optional and Explicit Forms

Structural openers accept either their compact name-first form or an explicit ID-first form. Indentation ends the block; structural closer tags were removed and now produce Calor0830.

OperationExplicit ID behavior
Rename declarationPreserve the existing ID
Move declaration or filePreserve the existing ID
Reformat or change the bodyPreserve the existing ID
Extract a helperGive the helper a new ID
Copy or clone a declarationGive the copy a new ID

Omitting IDs is the simplest authoring style. Materialize explicit IDs when the repository needs persistent cross-tool identity:

Bash
# Preview and then assign IDs to compact declarations
calor ids assign src/ --dry-run
calor ids assign src/

# Validate formats, prefixes, duplicates, and production/test policy
calor ids check src/

ID Formats

New IDs use a kind prefix plus a 12-character lowercase Crockford Base32 payload. Legacy 26-character uppercase ULID payloads remain accepted for backward compatibility.

KindCompact exampleLegacy accepted example
Modulem_3hj8x2bw9pkqm_01J5X7K9M2NPQRSTABWXYZ12
Functionf_7k9m2npqrstvf_01J5X7K9M2NPQRSTABWXYZ12
Classc_z4w7n5q2gxhtc_01J5X7K9M2NPQRSTABWXYZ12
Interfacei_9p3hxq7m4nbki_01J5X7K9M2NPQRSTABWXYZ12
Methodmt_5v8b3kxq2nhpmt_01J5X7K9M2NPQRSTABWXYZ12

Short IDs such as m001 and f001 are for tests/, docs/, and examples/ (or an explicit --allow-test-ids workflow), not production source.

To migrate legacy ULID payloads without changing their mapped identity:

Bash
calor fix src/ --compact-ids --log compact-ids.json
calor fix src/ --compact-ids --revert --log compact-ids.json

The migration is reversible only while its log is available.


Tooling

Bash
calor ids check src/                         # text validation
calor ids check src/ --format json           # schema 2.0 envelope
calor ids assign src/ --fix-duplicates       # keep first, reassign repeats
calor ids index src/ --output calor.ids.json # declaration index

Keep ID-preservation rules in agent instructions and run ids check in CI. The compiler catches malformed, wrongly prefixed, duplicated, and disallowed test IDs; repository history or an edit hook is needed to detect that a valid ID was deliberately replaced with another valid ID.


Next