Skip to content

The AI narration layer isn't reachable from either frontend #75

Description

@Muawiya-contact

diskern-core has an ai feature with a trait, an error type, and a
working TemplateNarrator:

pub trait AiProvider: Send + Sync {
    fn narrate(&self, findings: &[Finding]) -> Result<String, AiError>;
}

Nothing enables the feature, no frontend calls it, and no provider is
implemented — so the narration layer the README describes as
"AI narrates" does not exist in a build anyone can run.

The contract is already written and is the part worth keeping: the
provider gets findings the engine has already decided on and returns
prose. It cannot change a verdict, a score, or trigger an action, and
the app has to work identically with no provider configured. Any PR here
has to preserve that — narration is a view over the report, not a step
in the pipeline.

Roughly in order of usefulness:

  1. Wire TemplateNarrator into the CLI behind --explain. No network,
    no key, no new dependency — and it proves the seam works before
    anyone builds a provider on it.
  2. An OllamaProvider posting to http://localhost:11434. Local, free,
    nothing leaves the machine.
  3. BYO-key providers, which need somewhere safe to keep a key and a
    settings surface in the app — bigger, and worth its own issue.

Start at 1 if you want the smallest useful piece.

crates/diskern-core/src/ai.rs · crates/diskern-core/Cargo.toml:13

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enginediskern-core: scanner, rules, risk, graph, reportenhancementNew feature or requestlevel: advancedCross-cutting or safety-critical design workpriority: lowNice to have

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions