Skip to content

Wire CLI to core: teach/do/pack/doctor call real engine functions#8

Closed
SuperInstance wants to merge 1 commit into
mainfrom
wire-cli-to-core
Closed

Wire CLI to core: teach/do/pack/doctor call real engine functions#8
SuperInstance wants to merge 1 commit into
mainfrom
wire-cli-to-core

Conversation

@SuperInstance
Copy link
Copy Markdown
Owner

Summary

Wires the four target stub commands (teach, do, pack, doctor) in pincher-cli to real pincher-core functions. Also wires status, shellinfo, and reflexes while at it.

Changes

pincher teach

  • Changed from a standalone stub to Commands::Teach { intent: String, action: String }
  • Calls ReflexEngine::teach(&intent, &action)? — persists the reflex to SQLite with embeddings
  • Output: [TAUGHT] reflex <id> — intent: "...", action: "..."

pincher do

  • Calls ReflexEngine::do_command(&input)? — matches intent against stored reflexes
  • Supports Exact, Similar, and Novel match types
  • Output: match type, confidence, latency, matched reflex ID, execution output

pincher pack

  • Calls pincher_core::migration::pack_nail(&db_path, &output)? — creates real .nail (tar.zst) archives
  • Includes reflexes.db, identity.json, config.toml, manifest.json with BLAKE3 checksums

pincher doctor

  • Real health checks: SQLite connectivity, embedder status (ONNX/fallback), bwrap availability, disk space, hardware fingerprint, binary integrity
  • Green/red output with details

Also wired

  • status: calls ReflexEngine::get_status() for live counts
  • shellinfo: calls fingerprint() for real hardware fingerprinting
  • reflexes: lists all reflexes from the database via get_all_reflexes()
  • Added expand_tilde() for ~/.pincher/... db path support

Verification

  • cargo test -p pincher-core: 130 tests pass
  • pincher teach successfully stores reflexes
  • pincher do matches and executes stored reflexes
  • pincher pack creates valid zstd-compressed .nail archives
  • pincher doctor runs 6 real health checks
  • cargo check -p pincher-cli: clean, no warnings

…her-core functions

Changes:
- Teach: changed from stub to Commands::Teach{intent, action},
  calls ReflexEngine::teach() to persist reflex to database
- Do: calls ReflexEngine::do_command() which runs exact/similar/novel
  intent matching against stored reflexes
- Pack: calls pack_nail() to create real .nail (tar.zst) archives
  with BLAKE3 checksums, identity, config, and manifest
- Doctor: checks real conditions — SQLite connectivity, embedder
  status, bwrap availability, disk space, hardware fingerprint,
  and binary integrity
- Status: wired to ReflexEngine::get_status() for live engine state
- ShellInfo: calls fingerprint() for real hardware fingerprinting
- Reflexes: lists all stored reflexes from the database via schema
- Teach enum variant now takes positional intent and action arguments
- Added expand_tilde() to handle ~ in database paths
@SuperInstance
Copy link
Copy Markdown
Owner Author

Superseded by PR #6 which wires all 13 commands. Keeping the wiring pattern for reference.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant