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
2 changes: 1 addition & 1 deletion src/clippy-baseline.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
148
154
18 changes: 18 additions & 0 deletions src/shared/generated/genome/ArtifactRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { EngramRef } from "./EngramRef";
import type { LoRALayerRef } from "./LoRALayerRef";
import type { MoEExpertRef } from "./MoEExpertRef";

/**
* Generic artifact reference for `CapabilityQuery::must_include`
* (hard pins). Discriminates by artifact kind so the recall can
* route the pin to the right sub-pool of the result.
*
* Uses adjacently-tagged serde (`{"kind": "loraLayer", "ref":
* "<uuid>"}`) rather than internally-tagged because the inner
* newtypes (LoRALayerRef etc.) are `#[serde(transparent)]` — they
* serialize as bare strings, and serde's internally-tagged form
* can't tag a bare string. Adjacent tagging is the clean fix; TS
* consumers narrow by `kind` and read `ref` for the artifact id.
*/
export type ArtifactRef = { "kind": "loRALayer", "ref": LoRALayerRef } | { "kind": "moEExpert", "ref": MoEExpertRef } | { "kind": "engram", "ref": EngramRef };
29 changes: 29 additions & 0 deletions src/shared/generated/genome/CapabilityQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ArtifactRef } from "./ArtifactRef";
import type { DomainHint } from "./DomainHint";
import type { FreshnessTarget } from "./FreshnessTarget";
import type { RecallScope } from "./RecallScope";
import type { ResourceBudget } from "./ResourceBudget";
import type { TaskKind } from "./TaskKind";

/**
* The input to `DemandAlignedRecall::recall`. Names what the
* persona is trying to do + what it can spend + where it's willing
* to look.
*/
export type CapabilityQuery = { taskKind: TaskKind,
/**
* Free-form tags from the persona's plan. May be empty.
*/
domainHints: Array<DomainHint>, budget: ResourceBudget,
/**
* Hard pins — recall MUST include these in the RankedPool even
* if their score is low. Used for persona-private LoRA layers
* and sticky engrams.
*/
mustInclude: Array<ArtifactRef>,
/**
* When true (default), sentinel-refined artifacts win ties
* over foundry-imported. When false, the score alone decides.
*/
preferRefined: boolean, scope: RecallScope, freshnessTarget: FreshnessTarget, };
16 changes: 16 additions & 0 deletions src/shared/generated/genome/CompositionHint.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.
import type { LoRALayerRef } from "./LoRALayerRef";

/**
* Stub placeholder for the composer's "how to stack these
* artifacts" hint. Recall produces a suggested stacking order +
* per-artifact weights; the composer module (not built yet) reads
* this. PR-2 ships an empty struct so RankedPool compiles.
*/
export type CompositionHint = {
/**
* Reserved for the full shape. PR-2 keeps it empty; the
* composer PR will fill in the stacking order + per-artifact
* weight fields.
*/
layerOrderHint: Array<LoRALayerRef>, };
8 changes: 8 additions & 0 deletions src/shared/generated/genome/CompositionRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Stub placeholder for "what composition is currently hot for this
* persona." Full shape from the composer module (not built yet);
* PR-2 ships a thin opaque struct so PersonaContext compiles.
*/
export type CompositionRef = string;
8 changes: 8 additions & 0 deletions src/shared/generated/genome/DomainHint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Free-form tag from the persona's plan. Recall uses these for
* semantic narrowing (e.g. "math", "ruby", "vision-segmentation").
* `String` because the tags are open-ended; recall doesn't validate.
*/
export type DomainHint = string;
6 changes: 6 additions & 0 deletions src/shared/generated/genome/EngramRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Typed reference to one engram (refined episodic memory).
*/
export type EngramRef = string;
8 changes: 8 additions & 0 deletions src/shared/generated/genome/LoRALayerRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Typed reference to one LoRA layer artifact. Newtype around
* `ArtifactId` so the type system catches "passed a LoRA layer
* where an expert was expected" at compile time.
*/
export type LoRALayerRef = string;
8 changes: 8 additions & 0 deletions src/shared/generated/genome/MoEExpertRef.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Typed reference to one MoE expert artifact (one expert tile of
* an MoE model). Sub-artifact paging — the artifact is the full
* expert set; this reference picks one.
*/
export type MoEExpertRef = string;
19 changes: 19 additions & 0 deletions src/shared/generated/genome/OutcomeWindow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Stub placeholder per GENOME-FOUNDRY-SENTINEL Part 7. The full
* shape carries the persona's last N turns of outcomes (explicit
* user signal + implicit downstream-tool-success). Sentinel reads
* this to compute `outcome_history` for scoring.
*
* PR-2 ships an opaque empty struct so the trait compiles; the
* real shape lands when sentinel-observer is built (separate Lane
* H PR).
*/
export type OutcomeWindow = {
/**
* Reserved for the full shape. PR-2 ships as an empty struct;
* the field exists so downstream consumers can pattern-match
* even on the empty case.
*/
turnCount: number, };
16 changes: 16 additions & 0 deletions src/shared/generated/genome/RankedPool.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.
import type { CompositionHint } from "./CompositionHint";
import type { EngramRef } from "./EngramRef";
import type { LoRALayerRef } from "./LoRALayerRef";
import type { MoEExpertRef } from "./MoEExpertRef";
import type { RecallScore } from "./RecallScore";
import type { RecallTrace } from "./RecallTrace";
import type { ResidencyHint } from "./ResidencyHint";

/**
* The output of `DemandAlignedRecall::recall`. Three sub-pools
* (layers / experts / engrams) so the composer can pick from each
* independently. Every entry carries its score + `ResidencyHint`
* so the persona can make the cost trade-off explicit.
*/
export type RankedPool = { layers: Array<[LoRALayerRef, RecallScore, ResidencyHint]>, experts: Array<[MoEExpertRef, RecallScore, ResidencyHint]>, engrams: Array<[EngramRef, RecallScore, ResidencyHint]>, compositionHint: CompositionHint, traceRef: RecallTrace, };
17 changes: 17 additions & 0 deletions src/shared/generated/genome/RecallBudget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Memory + time budget the persona allocates for the composition
* it's about to build. Recall uses this to filter candidates
* (e.g. don't include a 4GB layer if budget is 1GB).
*/
export type RecallBudget = {
/**
* Maximum bytes the composition is allowed to consume.
*/
maxBytes: number,
/**
* Maximum wall-clock duration the recall call is allowed.
* `0` = no time limit (caller will time out separately).
*/
maxDurationMs: number, };
27 changes: 27 additions & 0 deletions src/shared/generated/genome/RecallContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CompositionRef } from "./CompositionRef";
import type { OutcomeWindow } from "./OutcomeWindow";
import type { PeerId } from "./PeerId";
import type { PersonaId } from "./PersonaId";
import type { TrajectoryHint } from "./TrajectoryHint";
import type { TrustClass } from "./TrustClass";

/**
* The persona's context for a recall call. Recall uses this for:
* - `outcome_history` factor (recent_outcomes input)
* - speculative weighting (conversation_trajectory)
* - per-peer trust overrides (trust_overrides)
* - skip-already-hot-artifacts (current_composition)
*/
export type RecallContext = { persona: PersonaId,
/**
* What composition is already hot for this persona. `None`
* means the persona is starting fresh (cold composition).
*/
currentComposition?: CompositionRef, recentOutcomes: OutcomeWindow, conversationTrajectory: TrajectoryHint,
/**
* Per-peer trust adjustments from the persona's identity state.
* Recall composes these with the artifact's `provenance_trust`
* during scoring.
*/
trustOverrides: Array<[PeerId, TrustClass]>, };
14 changes: 14 additions & 0 deletions src/shared/generated/genome/RecallScoreWeights.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Governor-tunable weights for the five scoring factors. The
* `new()` constructor enforces sum-to-1.0 (within an epsilon);
* fields are pub so the governor can read but not mutate
* directly. Mutation goes through `RecallScoreWeights::new()`
* which re-validates.
*
* Defaults from GENOME-FOUNDRY-SENTINEL Part 7 (semantic-leaning;
* the governor tunes per hardware class + sentinel refines per
* persona over time).
*/
export type RecallScoreWeights = { semantic: number, outcomeHistory: number, recency: number, tierProximity: number, provenanceTrust: number, };
9 changes: 9 additions & 0 deletions src/shared/generated/genome/RecallTrace.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.

/**
* Stub placeholder for the replay handle. The full shape carries
* the snapshotted scoring weights + artifact-set version + query
* hash that `replay` uses to reproduce the recall deterministically
* for sentinel attribution + VDD regression tests.
*/
export type RecallTrace = string;
16 changes: 16 additions & 0 deletions src/shared/generated/genome/TrajectoryHint.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.
import type { TaskKind } from "./TaskKind";

/**
* Stub placeholder per GENOME-FOUNDRY-SENTINEL Part 7. The full
* shape carries hints about where the conversation is heading
* (likely-next-task signals from the planning layer). Recall uses
* this for speculative weighting on artifacts likely to be needed
* soon. Empty in PR-2.
*/
export type TrajectoryHint = {
/**
* Reserved for the full shape (planner-emitted next-task
* likelihoods). PR-2 keeps it empty.
*/
speculativeKinds: Array<TaskKind>, };
15 changes: 15 additions & 0 deletions src/shared/generated/genome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@
export type { AccessDenied } from './AccessDenied';
export type { AcquireSource } from './AcquireSource';
export type { ArtifactId } from './ArtifactId';
export type { ArtifactRef } from './ArtifactRef';
export type { CapabilityQuery } from './CapabilityQuery';
export type { CompositionHint } from './CompositionHint';
export type { CompositionRef } from './CompositionRef';
export type { DomainHint } from './DomainHint';
export type { EngramRef } from './EngramRef';
export type { EvictionPolicy } from './EvictionPolicy';
export type { EvictionRecord } from './EvictionRecord';
export type { FreshnessTarget } from './FreshnessTarget';
export type { LoRALayerRef } from './LoRALayerRef';
export type { MoEExpertRef } from './MoEExpertRef';
export type { OutcomeWindow } from './OutcomeWindow';
export type { PageFault } from './PageFault';
export type { PageHandle } from './PageHandle';
export type { PageKind } from './PageKind';
Expand All @@ -16,15 +25,21 @@ export type { PageRef } from './PageRef';
export type { PeerId } from './PeerId';
export type { PersonaId } from './PersonaId';
export type { Provenance } from './Provenance';
export type { RankedPool } from './RankedPool';
export type { RecallBudget } from './RecallBudget';
export type { RecallContext } from './RecallContext';
export type { RecallError } from './RecallError';
export type { RecallScope } from './RecallScope';
export type { RecallScore } from './RecallScore';
export type { RecallScoreWeights } from './RecallScoreWeights';
export type { RecallTrace } from './RecallTrace';
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 { TrajectoryHint } from './TrajectoryHint';
export type { TrustClass } from './TrustClass';
export type { WorkingSet } from './WorkingSet';
export type { WorkingSetCapacity } from './WorkingSetCapacity';
7 changes: 7 additions & 0 deletions src/workers/continuum-core/src/genome/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub mod bus;
pub mod local_manager;
pub mod manager;
pub mod recall;
pub mod recall_trait;
pub mod store;
pub mod tier;
pub mod working_set;
Expand All @@ -79,6 +80,12 @@ pub use recall::{
AcquireSource, FreshnessTarget, PeerId, RecallError, RecallScope, RecallScore,
ResidencyHint, TaskKind, TrustClass,
};
pub use recall_trait::{
ArtifactRef, CapabilityQuery, CompositionHint, CompositionRef, DemandAlignedRecall,
DomainHint, EngramRef, LoRALayerRef, MoEExpertRef, OutcomeWindow, PersonaContext,
RankedPool, RecallScoreWeights, RecallTrace, ResourceBudget, TrajectoryHint,
WeightSumOutOfBounds,
};
pub use manager::WorkingSetManager;
pub use store::TierStore;
pub use tier::{EvictionPolicy, EvictionRecord, TierCapacity, TierError, TierRole};
Expand Down
Loading
Loading