Skip to content

Corvid Inventions

Corvid is a general-purpose language with AI built into the compiler. These are the shipped language ideas that make it different from Python libraries, TypeScript frameworks, and ordinary model SDKs.

This page is intentionally independent of build instructions. It answers one question: what can Corvid express as a language that other ecosystems usually express as runtime glue?

1. Safety At Compile Time

Approve Before Dangerous

tool issue_refund(id: String) -> Receipt dangerous
agent refund(id: String) -> Receipt:
approve IssueRefund(id)
return issue_refund(id)

Corvid makes irreversible authority visible. A dangerous tool call without a prior approve boundary is rejected by the compiler.

Why it is unique: ordinary languages can only ask a library to remember whether approval happened. Corvid makes the boundary part of the program’s static contract.

Dimensional Effects

effect llm_call:
cost: $0.05
trust: autonomous
reversible: true
prompt summarize(text: String) -> String uses llm_call:
"Summarize {text}"

Effects in Corvid are structured dimensions, not flat labels. Cost, trust, reversibility, data, latency, confidence, and custom dimensions compose through declared algebra.

Why it is unique: AI applications carry money, trust, privacy, reversibility, and confidence through the same workflow. Corvid lets the compiler reason about those dimensions together.

Grounded

effect retrieval:
data: grounded
tool fetch_doc(id: String) -> Grounded<String> uses retrieval
agent answer(id: String) -> Grounded<String>:
return fetch_doc(id)

Grounded<T> means a value must be connected to retrieval provenance. The compiler rejects grounded returns that have no grounded source.

Why it is unique: grounding is usually a prompt convention or a RAG library habit. Corvid makes it a type.

Strict Citations

prompt answer(ctx: Grounded<String>) -> Grounded<String>:
cites ctx strictly
"Answer from {ctx}"

A prompt can require citations to a specific grounded parameter. The compiler checks the parameter’s grounded type; runtime checks the model response.

Why it is unique: the citation requirement is not just text inside the prompt. It is a contract the compiler and runtime both understand.

Compile-Time Budgets

effect cheap_call:
cost: $0.05
@budget($0.10)
agent bounded(text: String) -> String:
first = classify(text)
return classify(first)

Corvid can reject workflows whose declared worst-case cost exceeds the agent’s budget.

Why it is unique: most systems discover AI cost after execution. Corvid can make cost a static bound.

Confidence Gates

effect llm_decision:
confidence: 0.95
@min_confidence(0.90)
agent bot(query: String) -> String:
return search(query)

Confidence is a dimension that composes by weakest link. Agents can require a confidence floor before autonomous action.

Why it is unique: confidence stops being a loose telemetry field and becomes a constraint that can block unsafe autonomy.

2. AI-Native Ergonomics

AI-Native Keywords

model local:
capability: basic
prompt say(name: String) -> String:
requires: basic
"Hello {name}"
agent hello(name: String) -> String:
return say(name)

Corvid has syntax for agents, tools, prompts, effects, approvals, models, evals, replay, and streams.

Why it is unique: the compiler can only protect what it can see. Corvid exposes the AI boundaries directly in source.

Trace-Aware Evals

eval refund_accuracy:
result = refund_bot(ticket)
assert result.should_refund == true

Corvid eval declarations are designed to assert on behavior, including trace events such as calls, approvals, ordering, and cost.

Why it is unique: output-only tests miss agents that get the right answer through the wrong process. Trace-aware evals target process correctness.

Replay And Receipts

@deterministic
@replayable
agent classify(text: String) -> String:
return text

Corvid executions can become traces, replay artifacts, diffs, signed receipts, and verification bundles.

Why it is unique: AI behavior changes are usually invisible. Corvid turns them into artifacts that can be audited and compared.

3. Adaptive Routing

Typed Model Routing

model fast:
capability: basic
model deep:
capability: expert
prompt answer(q: String) -> String:
route:
q == "hard" -> deep
_ -> fast
"Answer {q}"

Models are declarations with capabilities and policy dimensions. Prompt routing is checked against those facts.

Why it is unique: model selection becomes a typed program decision instead of a string hidden in runtime glue.

Progressive Refinement

prompt classify(q: String) -> String:
progressive:
cheap below 0.80
medium below 0.95
expensive
"Classify {q}"

Prompts can try cheaper models first and escalate only when confidence is not high enough.

Why it is unique: cost-quality tradeoffs are visible in source and can be reviewed with the rest of the program.

Ensemble Voting

prompt classify(q: String) -> String:
ensemble [opus, sonnet, haiku] vote majority
"Classify {q}"

One prompt can dispatch to multiple models and fold the responses through a typed voting strategy.

Why it is unique: consensus becomes a language-level strategy, not an unreviewed helper function.

Jurisdiction And Privacy Routing

model eu_private:
jurisdiction: eu_hosted
compliance: gdpr
privacy_tier: strict
capability: expert

Model declarations can include privacy, compliance, and jurisdiction facts.

Why it is unique: data-placement policy can be checked before a prompt crosses the wrong boundary.

4. Streaming

Streaming Effects

agent count() -> Stream<Int>:
yield 1
yield 2

Streams are typed values that can carry provenance, confidence, cost, and backpressure semantics.

Why it is unique: streaming AI is usually an untyped callback path. Corvid keeps it inside the language.

Progressive Structured Streams

type Plan:
title: String
body: String
agent read(snapshot: Partial<Plan>) -> Option<String>:
return snapshot.title

Partial<T> exposes complete fields as they arrive while the rest of a structured response is still forming.

Why it is unique: users can work with partial structured output safely instead of parsing incomplete JSON.

Typed Stream Resumption

agent capture(topic: String) -> ResumeToken<String>:
stream = draft(topic)
return resume_token(stream)

ResumeToken<T> preserves the stream element contract across interruption and continuation.

Why it is unique: resumption is typed. A token for one stream shape cannot be used as another.

Declarative Fan-Out / Fan-In

agent fanout() -> Stream<Event>:
groups = source().split_by("kind")
return merge(groups).ordered_by("fair_round_robin")

Streams can split by structured fields and merge back with deterministic ordering.

Why it is unique: stream topology is declared in the program, so the compiler and runtime can preserve ordering and effect metadata.

5. Verification

Proof-Carrying Dimension Registry

effect local_policy:
data: pii
reversible: true
tool read_profile(id: String) -> String uses local_policy

Custom effect dimensions can be distributed as signed artifacts with law checks, proof pointers, and regression programs.

Why it is unique: the effect system can grow without asking users to trust arbitrary executable packages.

Adversarial Bypass Testing

tool refund(id: String) -> String dangerous uses transfer_money
@trust(human_required)
agent safe_refund(id: String) -> String:
approve Refund(id)
return refund(id)

Corvid includes a bypass taxonomy so the effect checker can be attacked by a deterministic adversarial corpus.

Why it is unique: the language uses adversarial testing against its own safety claims instead of treating them as prose.

Proof Matrix

InventionStatusRunnable commandTest coverageSpecExplicit non-scope
Approve Before DangerousShippedcorvid tour --topic approve-gatescrates/corvid-types/src/lib.rs03-typing-rules.mdProves the approval boundary, not approval quality.
Dimensional EffectsShippedcorvid tour --topic dimensional-effectscrates/corvid-types/src/effects.rs02-composition-algebra.mdProves declared contracts, not provider honesty.
GroundedShippedcorvid tour --topic grounded-valuescrates/corvid-types/src/effects/grounded.rs05-grounding.mdProves source linkage, not source truth.
Strict CitationsShippedcorvid tour --topic strict-citationscrates/corvid-vm/src/tests/dispatch.rs05-grounding.mdChecks citation evidence, not factual correctness.
Compile-Time BudgetsShippedcorvid tour --topic cost-budgetscrates/corvid-types/src/effects/cost.rs07-cost-budgets.mdStatic declared costs, not invoice reconciliation.
Confidence GatesShippedcorvid tour --topic confidence-gatescrates/corvid-types/src/tests.rs06-confidence-gates.mdDepends on calibrated adapter confidence.
AI-Native KeywordsShippedcorvid tour --topic language-keywordscrates/corvid-syntax/src/parser/tests.rs01-dimensional-syntax.mdDoes not replace ordinary general-purpose code.
Trace-Aware EvalsShippedcorvid tour --topic eval-tracescrates/corvid-types/src/lib.rs12-verification.mdFull eval runner is later workflow tooling.
Replay And ReceiptsShippedcorvid tour --topic replay-receiptscrates/corvid-cli/tests/bundle_verify.rs14-replay.mdReceipts are observed evidence, not full formal verification.
Typed Model RoutingShippedcorvid tour --topic model-routingcrates/corvid-vm/src/tests/dispatch.rs13-model-substrate-shipped.mdDoes not benchmark model quality automatically.
Progressive RefinementShippedcorvid tour --topic progressive-routingcrates/corvid-vm/src/tests/dispatch.rs13-model-substrate-shipped.mdThresholds need calibrated confidence.
Ensemble VotingShippedcorvid tour --topic ensemble-votingcrates/corvid-vm/src/tests/dispatch.rs13-model-substrate-shipped.mdCustom vote functions need future function values.
Jurisdiction And Privacy RoutingShippedcorvid tour --topic privacy-routingcrates/corvid-types/src/effects.rs13-model-substrate-shipped.mdLegal compliance still needs operations and audits.
Streaming EffectsShippedcorvid tour --topic streaming-effectscrates/corvid-vm/src/tests/stream.rs08-streaming.mdProvider-native continuation depends on providers.
Progressive Structured StreamsShippedcorvid tour --topic partial-streamscrates/corvid-types/src/tests.rs08-streaming.mdFull native parity remains backend work.
Typed Stream ResumptionShippedcorvid tour --topic stream-resumecrates/corvid-vm/src/tests/stream.rs08-streaming.mdProvider-native session continuation is future adapter work.
Declarative Fan-Out / Fan-InShippedcorvid tour --topic stream-fanoutcrates/corvid-types/src/tests.rs08-streaming.mdLambda extractors wait for function values.
Proof-Carrying Dimension RegistryShippedcorvid tour --topic effect-registrycrates/corvid-driver/src/dimension_registry.rsdimension-artifacts.mdDistributes declarations, not executable code.
Adversarial Bypass TestingShippedcorvid tour --topic adversarial-testscrates/corvid-driver/src/adversarial.rsadversarial-taxonomy.mdLive LLM generation expands but does not replace deterministic gates.