Skip to the content.

SRS LP Architecture Contract

Status: active architecture contract Role: Canonical current Last updated: 2026-03-21 Source-of-truth: LP capability contract centered on core/lexishift_core/helper/lp_capabilities.py and the linked helper/SRS modules.

Purpose:

1) Source Of Truth

Primary registry:

PairCapability is the canonical LP contract. Surfaces should read capabilities, not hardcode pair assumptions.

Current capability responsibilities:

Compatibility rule:

2) Layer Responsibilities

Core (lexishift_core):

Helper (helper_engine, helper CLI/native host):

GUI / Extension:

3) SRS Pipeline By LP

  1. LP selection:
    • SRS selectable pairs are capability-driven (selectable_srs_pairs()).
  2. Resource resolution:
    • Frequency DB, dictionary paths resolved from capability defaults (with explicit overrides allowed).
  3. Seed candidate selection:
    • Frequency DB is required.
    • Dictionary gate is LP-specific (require_jmdict true only for LPs that need it).
    • Source metadata must be generic (derived from selected frequency source), not hardcoded to a single corpus.
  4. Admission weighting:
    • POS bucket classification is pair-aware (at minimum JA and DE specific classifiers plus generic fallback).
  5. Rule generation:
    • Dispatches via adapter keyed by rulegen_mode.
    • Unsupported LPs return no rules until adapter exists; they must not break existing LPs.
  6. Pair policy defaults:
    • set_top_n, feedback_window_size, and initial_active_count fall back to pair policy defaults when omitted.
    • Policy defaults are surfaced by helper diagnostics (pair_policy) so UI and operators can verify effective behavior.

4) LP-Specific UX vs Core SRS

Allowed LP-specific UX:

Non-negotiable core invariants:

5) Adding A New LP Safely

  1. Add/update capability in core/lexishift_core/helper/lp_capabilities.py.
  2. Add/verify frequency source default and dictionary requirements.
  3. Add rulegen adapter if cross-lingual/monolingual rulegen is expected.
  4. Ensure helper diagnostics show resolved paths and missing inputs for that LP.
  5. Add LP E2E tests (initialize -> refresh -> publish -> diagnostics).
  6. Update docs:
    • docs/language_pairs/lp_resource_requirements.md
    • docs/srs/srs_roadmap.md
    • LP setup checklist docs

Execution note:

6) Regression Guardrails