Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/shared/generated/genome/AcquireSource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Where the substrate would have to get an artifact from if it
* isn't resident anywhere visible. PR-3's recall will fill this in
* based on the artifact's provenance + the federation registry.
* PR-1 ships the typed variants only.
*/
export type AcquireSource = "foundryAbsorption" | "sentinelRefinement" | "unreachablePeer";
9 changes: 9 additions & 0 deletions src/shared/generated/genome/FreshnessTarget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* How fresh the persona requires the result to be. Recall's
* downstream sources (engram catalog, federation peers) may serve
* stale data; this lets the persona reject stale results before
* using them.
*/
export type FreshnessTarget = { "kind": "bestEffort" } | { "kind": "freshAsOf", tsMs: number, } | { "kind": "strict" };
10 changes: 10 additions & 0 deletions src/shared/generated/genome/PeerId.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Stable per-peer identifier for federated recall. UUID-shaped
* (transparent on the wire as a string), typed wrapper distinct
* from PersonaId + ArtifactId so the type system catches swapped
* arguments at call sites that take both (e.g.
* `RecallScope::Federation { peers, .. }`).
*/
export type PeerId = string;
16 changes: 16 additions & 0 deletions src/shared/generated/genome/RecallError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Typed errors recall can surface. Per Joel's "never swallow
* errors" rule: every failure mode has a typed variant with the
* context needed to debug.
*/
export type RecallError = { "kind": "budgetExhausted",
/**
* Bytes requested vs available — debugging signal.
*/
budgetBytes: number, availableBytes: number, } | { "kind": "scopeUnreachable", reason: string, } | { "kind": "freshnessUnmet", behindByMs: number, } | { "kind": "noMatchingArtifacts",
/**
* How many peers were queried before giving up.
*/
peersQueried: number, elapsedMs: number, };
9 changes: 9 additions & 0 deletions src/shared/generated/genome/RecallScope.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PeerId } from "./PeerId";

/**
* Bound on what the recall may touch. Lets a persona say "local
* only" (e.g. for privacy-sensitive tasks) without per-call
* federation-scope plumbing through every caller.
*/
export type RecallScope = { "kind": "local" } | { "kind": "localThenGrid", maxGridPulls: number, } | { "kind": "federation", peers: Array<PeerId>, maxLatencyMs: number, };
48 changes: 48 additions & 0 deletions src/shared/generated/genome/RecallScore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Composite score for a recall candidate. The five factors are
* the explicit, sentinel-tunable dimensions of the scoring function
* (PR-3). Persona-facing code can inspect the components to explain
* why a particular artifact was ranked where it was — useful for
* debugging recall behavior and for VDD replay determinism.
*
* All factors are normalized to `[0.0, 1.0]` so the combined score
* is bounded `[0.0, sum(weights)]` (governor weights are also
* bounded; defaults sum to 1.0).
*/
export type RecallScore = {
/**
* Cosine similarity between query embedding and artifact
* metadata embedding. Range [0.0, 1.0]; 1.0 = identical.
*/
semantic: number,
/**
* How well this artifact performed in the persona's last N
* turns of similar tasks. Exponentially-decayed outcome
* signal — see PR-3's `outcome_window_score`.
*/
outcomeHistory: number,
/**
* Exponential decay over time-since-last-use. Governor-tunable
* half-life (default 24h).
*/
recency: number,
/**
* Cost-to-promote penalty. Hot artifacts score 1.0; cold
* archive scores ~0.2; grid peers score a function of
* estimated latency. See PR-3's `grid_penalty`.
*/
tierProximity: number,
/**
* Artifact's trust score adjusted by the persona's trust
* overrides. Sentinel-refined-locally > sentinel-refined-by-
* trusted-peer > foundry-imported > anonymous-public.
*/
provenanceTrust: number,
/**
* Weighted sum of the five factors. The persona usually picks
* from the top-K by this value; debugging code may inspect the
* factors above to understand why.
*/
combined: number, };
31 changes: 31 additions & 0 deletions src/shared/generated/genome/ResidencyHint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AcquireSource } from "./AcquireSource";
import type { PeerId } from "./PeerId";
import type { TierRole } from "./TierRole";

/**
* Where an artifact currently lives, from the persona's
* perspective. The load-bearing type per GENOME-FOUNDRY-SENTINEL
* Part 7: persona sees the artifact's location + acquisition cost,
* not just its relevance.
*
* The scoring function (PR-3) combines this with semantic match
* and outcome history; the persona can also read the hint directly
* when it wants to make an explicit cost trade-off (e.g. "stay
* local even if a slightly higher-scoring layer is on a grid peer").
*
* Variants:
* - `Hot { role }` — already in this persona's working set at the
* given tier role (typically Fast, or Warm on discrete-GPU
* hardware). Cheapest to use.
* - `Local { role }` — on this machine but not in this persona's
* working set; promotable from Bench/Cold/Frozen via the
* working-set-manager's page_in (#1355).
* - `GridPeer { peer, est_latency_ms }` — resident on a federated
* peer; would require a network pull to use.
* - `NotResident { acquirable_from }` — doesn't exist locally OR
* on any peer the persona has visibility into; would require
* the foundry to import or sentinel to refine. Cost is "indefinite
* future" — the persona usually picks something else.
*/
export type ResidencyHint = { "kind": "hot", role: TierRole, } | { "kind": "local", role: TierRole, } | { "kind": "gridPeer", peer: PeerId, estLatencyMs: number, } | { "kind": "notResident", acquirable_from: AcquireSource, };
12 changes: 12 additions & 0 deletions src/shared/generated/genome/TaskKind.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* The seven canonical task kinds the substrate names. Used by
* scoring (different task kinds weight semantic vs. outcome
* history differently) and by routing (vision tasks need a vision-
* capable persona, etc.).
*
* `Other` is the escape hatch for novel task kinds the substrate
* hasn't named — recall treats them with default weights.
*/
export type TaskKind = "chat" | "code" | "vision" | "toolUse" | "memory" | "plan" | "other";
9 changes: 9 additions & 0 deletions src/shared/generated/genome/TrustClass.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* How much the persona trusts a peer's artifacts. Adjusted at
* scoring time via the persona's `trust_overrides` field
* (PersonaContext, PR-2). PR-1 names the variants the override list
* can map a peer to.
*/
export type TrustClass = "local" | "trustedPeer" | "knownPeer" | "anonymous";
9 changes: 9 additions & 0 deletions src/shared/generated/genome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
// Re-generate: npx tsx generator/generate-rust-bindings.ts

export type { AccessDenied } from './AccessDenied';
export type { AcquireSource } from './AcquireSource';
export type { ArtifactId } from './ArtifactId';
export type { EvictionPolicy } from './EvictionPolicy';
export type { EvictionRecord } from './EvictionRecord';
export type { FreshnessTarget } from './FreshnessTarget';
export type { PageFault } from './PageFault';
export type { PageHandle } from './PageHandle';
export type { PageKind } from './PageKind';
export type { PageOffset } from './PageOffset';
export type { PageRef } from './PageRef';
export type { PeerId } from './PeerId';
export type { PersonaId } from './PersonaId';
export type { Provenance } from './Provenance';
export type { RecallError } from './RecallError';
export type { RecallScope } from './RecallScope';
export type { RecallScore } from './RecallScore';
export type { ResidencyHint } from './ResidencyHint';
export type { ResidentPage } from './ResidentPage';
export type { TaskKind } from './TaskKind';
export type { TierCapacity } from './TierCapacity';
export type { TierError } from './TierError';
export type { TierRole } from './TierRole';
export type { TrustClass } from './TrustClass';
export type { WorkingSet } from './WorkingSet';
export type { WorkingSetCapacity } from './WorkingSetCapacity';
5 changes: 5 additions & 0 deletions src/workers/continuum-core/src/genome/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub mod blob;
pub mod bus;
pub mod local_manager;
pub mod manager;
pub mod recall;
pub mod store;
pub mod tier;
pub mod working_set;
Expand All @@ -74,6 +75,10 @@ pub use bus::{
PAGE_FAULT_KEY,
};
pub use local_manager::LocalWorkingSetManager;
pub use recall::{
AcquireSource, FreshnessTarget, PeerId, RecallError, RecallScope, RecallScore,
ResidencyHint, TaskKind, TrustClass,
};
pub use manager::WorkingSetManager;
pub use store::TierStore;
pub use tier::{EvictionPolicy, EvictionRecord, TierCapacity, TierError, TierRole};
Expand Down
Loading
Loading