hmemcpy / hmemcpy/clair

[Research] What was abandoned: From programming language to trace format

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Typst
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## The Archive Tells a Story

CLAIR's `archive/` directory contains extensive work on a **full programming language** that was abandoned in favor of the current "trace format" approach.

## What Existed

### 1. Turing-Complete Computational Core
`archive/turing-completeness.md` establishes:
- System F with recursive types (functions, products, sums, μ)
- Equivalent to PCF or Haskell's core
- Can encode untyped lambda calculus

This is NOT the current CLAIR—v1 has no computational language, only metadata.

### 2. Belief Types as First-Class Citizens
`archive/categorical-structure.md` formalizes:
- `Belief` as a graded monad over confidence
- Dependent belief types: `Belief<Π(x:A).B(x)>`
- Linear beliefs: `!Belief
` for reusable axioms
- Full categorical semantics (functors, natural transformations)

### 3. Explicit Language Syntax
`archive/old-syntax.md`, `archive/hello-world.clair` show actual programming syntax:
```clair
-- Old CLAIR was a language you wrote in
let sorted = belief {
value = quicksort xs,
confidence = 0.91,
justification = complexity_proof(O(n log n))
}
```

## What Changed

**Then**: CLAIR was a programming language with epistemic types
**Now**: CLAIR is a data format for reasoning traces

**Then**: You programmed in CLAIR
**Now**: LLMs emit CLAIR; humans/agents consume it

## Research Questions

1. **Why the pivot?** What made the language approach untenable?
2. **What was lost?** Can the type-theoretic foundations inform v2?
3. **Hybrid approach?** Statically-typed belief composition + dynamic traces?
4. **Executable CLAIR?** Can traces be "run" or only audited?

## Hypothesis: The Two-Layer Model

The old approach conflated:
- **Layer 1**: Computational language (functions, types, evaluation)
- **Layer 2**: Epistemic tracking (confidence, provenance, justification)

CLAIR v1 kept only Layer 2—the trace of reasoning, not the reasoning itself.

**Question**: Is this separation permanent, or should they reunite?

## Archaeological Value

The archive contains sophisticated mathematics:
- Graded monad laws with proofs
- Categorical semantics
- Type-theoretic foundations
- Turing-completeness arguments

Even if the language approach was abandoned, the formalism may be:- Reusable for INTENT (negotiation protocol types)
- Implementable in dependent type systems (Lean, Idris)
- Valuable for proving properties of CLAIR traces

## Action Items

1. Document why the pivot happened (interview/notes?)
2. Extract reusable formalism from archive
3. Determine if any language features should be resurrected
4. Clarify CLAIR's identity: language, format, or both?

---
*Meta-research: Understanding CLAIR's evolution through its archive*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.