Skip to main content

hikmah_kernel/
model_port.rs

1use crate::error::Result;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct ProposalRequest {
6    pub goal: String,
7    pub context: Vec<String>,
8    pub constraints: Vec<String>,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Proposal {
13    pub text: String,
14    pub assumptions: Vec<String>,
15    pub confidence: f32,
16}
17
18/// Optional proposal engines sit outside the trusted kernel.
19/// They may be transformers, state-space models, symbolic systems, remote APIs,
20/// or future architectures. Their output is always treated as a proposal.
21pub trait ProposalEngine {
22    fn name(&self) -> &str;
23    fn propose(&self, request: &ProposalRequest) -> Result<Vec<Proposal>>;
24}
25
26#[derive(Debug, Default)]
27pub struct NoModel;
28
29impl ProposalEngine for NoModel {
30    fn name(&self) -> &str {
31        "no-model"
32    }
33
34    fn propose(&self, _request: &ProposalRequest) -> Result<Vec<Proposal>> {
35        Ok(Vec::new())
36    }
37}