Skip to content

Add configurable module infrastructure#1

Merged
jmcentire merged 1 commit intomainfrom
feature/configurable-module
Feb 18, 2026
Merged

Add configurable module infrastructure#1
jmcentire merged 1 commit intomainfrom
feature/configurable-module

Conversation

@jmcentire
Copy link
Owner

Summary

  • 5 new components: plugin_registry, middleware pipeline, PII tokenizer, feedback collector, observer
  • Enables Apprentice to operate in distillation (existing), copilot (watch/learn/suggest), or observer (passive) modes
  • All config sections optional with sensible defaults — zero impact on existing behavior
  • PII tokenizer uses ephemeral in-memory tokens, never persisted to disk
  • Feedback collector provides per-task RLHF/RLAF with confidence adjustments
  • 190 new tests (2330 total, 0 failures)

Test plan

  • All 2330 tests pass (190 new + 2140 existing)
  • mode: distillation works identically to current behavior (regression)
  • New config sections are optional — existing configs work unchanged
  • PII tokenizer round-trips correctly (tokenize → model → detokenize)
  • Plugin registration works from config

🤖 Generated with Claude Code

…ipeline, PII tokenizer, feedback collector, observer

Enable Apprentice to operate as a drop-in configurable module for watch/learn/suggest scenarios
(e.g., copilot mode) in addition to its existing distillation pipeline. Five new components:

- plugin_registry: String-keyed factory registries replacing hardcoded enums, enabling extension
  without code changes. PluginRegistrySet.with_defaults() pre-registers all built-in types.
- middleware: Onion-model pipeline (pre in order, post in reverse) with error resilience.
  Empty pipeline = no-op passthrough for full backward compatibility.
- pii_tokenizer: Middleware that replaces PII with ephemeral tokens before model inference
  and restores originals after. Token registry is in-memory only, never persisted.
- feedback_collector: Per-task RLHF+RLAF feedback with append-only JSON-lines persistence.
  Computes confidence adjustments in [-0.1, +0.1] per task.
- observer: Per-task rolling context windows with probabilistic shadow recommendations
  and match scoring for passive learning mode.

Config extensions: mode (distillation|copilot|observer), plugins, middleware, feedback, observer
sections — all optional with sensible defaults. Zero impact on existing behavior.

190 new tests (2330 total, 0 failures).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jmcentire jmcentire merged commit b6d5537 into main Feb 18, 2026
@jmcentire jmcentire deleted the feature/configurable-module branch February 18, 2026 20:50
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.

2 participants