26382a7ac6
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
JetBrains Plugin / Actionlint (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
CodeQL / Analyze (rust) (push) Waiting to run
JetBrains Plugin / Validation (push) Waiting to run
JetBrains Plugin / Build (push) Waiting to run
JetBrains Plugin / Test (push) Blocked by required conditions
Security Check / Security Scan (push) Waiting to run
CI / Clippy (push) Failing after 15m13s
CI / Test (ubuntu-latest) (push) Failing after 16m1s
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Build (no embeddings / no ORT) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / Cookbook (Node) (push) Has been cancelled
CI / Pi Extension (Node) (push) Has been cancelled
CI / Rust SDK (lean-ctx-client) (push) Has been cancelled
CI / Embed SDK (lean-ctx-sdk) (push) Has been cancelled
CI / Python SDK (leanctx) (push) Has been cancelled
CI / Hermes Plugin (Python) (push) Has been cancelled
CI / SDK Conformance Matrix (push) Has been cancelled
CI / Coverage (push) Has been cancelled
CI / cargo-deny (push) Has been cancelled
CI / Adversarial Safety (push) Has been cancelled
CI / Benchmarks (push) Has been cancelled
CI / Output-Quality Gate (eval A/B) (push) Has been cancelled
CI / Documentation (push) Has been cancelled
CI / CI Green (push) Has been cancelled
2.9 KiB
2.9 KiB
Cognition Interface (v1)
LeanCTX cannot modify proprietary model weights. Instead, it ships a Cognition Interface: a deterministic control surface that shapes the model’s effective reasoning by controlling what it sees, how it is budgeted, what is remembered, and what must be verified.
This is production-realistic for API LLMs and becomes even stronger when paired with open-weights models in an optional Cognition Lab track.
What “Cognition Interface” means in practice
1) Context I/O (signal in)
- Deterministic reads/search/shell output with explicit tool calls.
- Bounded outputs (size caps, truncation markers).
- Sandboxed file access (PathJail / allowed roots).
Evidence:
rust/src/core/pathjail.rsrust/src/core/output_verification.rsrust/src/core/cache.rs
2) Orchestration (routing + budgets)
- Profile-driven pipelines (“Context as Code”): read modes, budgets, verification, autonomy.
- Intent/mode prediction and adaptive thresholds (bandits) to keep cost/quality stable.
- Client constraints compilation: the same policy must compile into client-safe instruction blocks.
Evidence:
rust/src/core/profiles.rsrust/src/core/intent_engine.rsrust/src/core/mode_predictor.rsrust/src/core/adaptive_thresholds.rsrust/src/core/instruction_compiler.rsdocs/integrations/client-constraints-matrix-v1.md
3) Memory (what persists)
- Session continuity (CCP), structured knowledge, contradictions/relations.
- Exportable handoffs and auditability across agents.
Evidence:
rust/src/core/session.rsrust/src/core/knowledge.rsrust/src/core/gotcha_tracker/*rust/src/core/a2a/*
4) Verification (what must hold)
- Deterministic checks on compressed outputs (paths, identifiers, structure, line numbers).
- Proof artifacts and CI gates to prevent “it worked yesterday” drift.
Evidence:
rust/src/core/output_verification.rsCONTRACTS.mdrust/tests/*_up_to_date.rs
5) Delivery (everywhere)
- MCP + HTTP MCP + Team Server let the same primitives run locally, in CI, and enterprise setups.
- SDK + cookbook runs against a real server instance (no mock mode).
Evidence:
rust/src/http_server/mod.rsrust/src/http_server/team.rscookbook/sdk/src/client.e2e.test.ts
Contract: deterministic steering, not “prompt magic”
The Cognition Interface is only useful if it is:
- Deterministic: same inputs/policies → same compiled output.
- Bounded: caps enforced per client/model constraints.
- Auditable: evidence artifacts and CI gates catch drift.
- Local-first: no telemetry unless explicitly enabled.
Optional: Cognition Lab track
For open-weights experimentation (or internal models), the same interface becomes a research harness:
- learned attention/layout drivers
- calibration/evaluation suites
- ONNX models with versioning + rollout policies
See: docs/cognition-lab/plan-v1.md (tracked in GitLab #2344).