Files
poimen-memory/crates/mem-core/src/lib.rs
T
rock eb36895331
Build and Push / Test (push) Canceled after 0s
Build and Push / Build and push image (push) Canceled after 0s
feat: implement core architecture modules
Phase 1: Wiki-Link Graph Indexing
- WikiLinkParser: extract [[links]] from markdown
- WikiLinkGraph: BFS traversal, reachable docs, backlinks
- Support relative path resolution (../../../)

Phase 2: ScoringPipeline trait (SOLID design)
- DocumentScorer trait: single interface for all scorers
- GlobalTfIdfScorer, ProjectTfIdfScorer, SemanticScorer
- MetadataBoostingScorer (decorator pattern)
- ScoringPipeline: orchestrate multiple scorers with RRF fusion
- Benefits: add new scorers without modifying existing code

Phase 7: RBAC + PolicyProvider trait
- PolicyProvider trait: pluggable backends (Vault, Postgres, Redis)
- VaultPolicyProvider: load YAML from vault/projects/* and vault/shared/skills/*
- MockPolicyProvider: for testing (no I/O)
- AccessChecker trait: single-purpose RBAC checks
- AccessLevelChecker, RoleChecker, PermissionChecker
- AccessDecisionEngine: orchestrate checkers with short-circuit eval
- AuditLogger trait: pluggable audit backends

Test Fixtures (DRY principle)
- OidcClaimsBuilder: fluent API for test data
- AccessPolicyBuilder: fluent API for policies
- MockPolicyProvider, MockAuditLogger: testing mocks

All modules compile and unit tests pass.
2026-08-30 20:40:43 -07:00

27 lines
1019 B
Rust

pub mod domain;
pub mod lesson;
pub mod symptom_projection;
pub mod query;
pub mod query_levels;
pub mod prompt;
pub mod gate_parser;
pub mod gated_loop;
pub mod query_executor;
pub mod optimizer;
pub mod scoring;
pub use gate_parser::{GateResponse, ParseError, parse_gate_response};
pub use domain::{
Chunk, Level, MemoryNode, Provenance, Record, Role, ProjectId, QueryId, RunId, Sha256Hash,
};
pub use lesson::{
derive_lessons, extract, lookup, normalise, render_injection, render_skill, similarity,
tool_of_cmd, Confidence, Event, Hit, Lesson, Signature, Tier,
};
pub use query::{Query, QuerySet, SynthesisQuery};
pub use prompt::{PromptBuilder, PromptMessages, CacheMetrics};
pub use symptom_projection::{project_symptom, SymptomVector};
pub use optimizer::{ContextOptimizer, ContextOptimizerConfig, ContentType, OptimizedChunk, CacheAligner, AlignedContent, CcrStore};
pub use scoring::{DocumentScorer, ScoringPipeline, GlobalTfIdfScorer, ProjectTfIdfScorer, SemanticScorer, MetadataBoostingScorer};