Metadata-Version: 2.4
Name: plm-knowledge
Version: 1.1.0
Summary: TracePulse PLM Knowledge product-line — BM25 retrieval, RAG, business rules, lifecycle FSM, knowledge-pack manifests (Wave 6.5 Conv B / PRD §3 #6). Full description in README.
Author: TracePulse
License: Proprietary
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: plm-shared
Requires-Dist: pydantic>=2.5.0
Requires-Dist: PyYAML>=6.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: openai>=1.16.0
Requires-Dist: httpx>=0.27.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"

# plm-knowledge

TracePulse PLM Knowledge product-line. Wave 6.5 Conv B sibling-package
carve per PRD §3 #6.

## Scope (PRD §3 #6 verbatim — 4 sub-layers)

| Sub-layer | Source | Carve disposition |
|-----------|--------|-------------------|
| **Foundation** | `01_Dictionnaries/**` (146 .md files at repo root) + `plm_taxonomy` + `plm_evaluation_grids` | **Path stays at repo root through Wave 6.5** per Decision #171 = (c) defer relocation to Wave 7. `plm_knowledge.foundation_loader` is a thin reader that resolves the path through `config.dictionnaries_path` (already configurable); no `git mv` of the dictionary tree. |
| **Rule & Policy** | `02_App/backend/services/issue_classification.py` + `02_App/backend/agents/business_validator.py` | Lifted via `git mv` to `02_App/plm-knowledge/plm_knowledge/{issue_classification,business_validator}.py`. Re-export shims at every old monolith path. |
| **Retrieval** | `02_App/backend/services/rag_service.py` + `02_App/backend/skills/knowledge_pack_loader.py` + `02_App/backend/skills/knowledge_search_engine.py` (BM25) | Lifted via `git mv` to `02_App/plm-knowledge/plm_knowledge/{rag_service,knowledge_pack_loader,knowledge_search_engine}.py`. Re-export shims at every old monolith path. |
| **Operational** | V1 placeholder per D-LOCKED-15 + Decision #172 = (a) keep in-process state V1 | `plm_knowledge.operational` exposes a stable but inert public surface so downstream callers can target the future operational telemetry hooks without an interface bump. |

## Public surface (frozen V1 — `KNOWLEDGE_PACKAGE_VERSION = "v1.0.0-wave6.5"`)

* The 5 lifted modules at top level of the package (`rag_service`,
  `issue_classification`, `business_validator`, `knowledge_pack_loader`,
  `knowledge_search_engine`).
* `plm_knowledge.foundation_loader` — thin reader for the Foundation
  layer (path resolution + .md enumeration).
* `plm_knowledge.operational` — V1 placeholder (per D-LOCKED-15 +
  Decision #172).
* `plm_knowledge.lifecycle` — 4-state FSM aligned verbatim with PRD
  §8.11.3 (mirror of Wave 6.5 Conv A `plm-skill-packages` per Decision
  #167).
* `plm_knowledge.manifests` — YAML manifest loader (mirror of Decision
  #168 precedent — YAML + filesystem; no SQL, no admin UI in V1).
* `plm_knowledge.contracts` — wire-contract Pydantic v2 frozen models
  for the public surface (Decision #160 interface-freeze pattern).
* `plm_knowledge.registry` — manifest+lifecycle registry exposed to
  the kernel (capability registry callers).

## Lifecycle FSM (PRD §8.11.3 verbatim — Decision #167 mirrored)

```
draft ──► released ──► deprecated ──► retired
                                          │
                                          └──► (terminal)
```

States are **strictly forward-flowing**; the FSM rejects skip
transitions, out-of-terminal moves, and unknown states. Mirrors the
4-state contract in `plm_shared.capability_registry`.

## Transitional dependency note (Wave 6.5 → Wave 7 Extraction)

Lifted code retains its existing `from services.X` / `from agents.base_agent` /
`from config import settings` imports. These resolve at runtime in the
backend process via PYTHONPATH (also via `pip install -e ../plm-knowledge`
declared in `02_App/backend/requirements.txt`); sibling tests configure
`tests/conftest.py` to extend `sys.path`. Wave 7 Extraction physically
separates the repos and at that point inbound deps refactor to
ports/Protocols. Pattern matches Wave 6.5 Conv A `plm-skill-packages`
precedent verbatim.

## Re-export shims

The following monolith paths are thin re-export shims pointing to the
canonical sibling-package modules. They keep legacy callers working
through Wave 7 Extraction (drop after 90-day soak per US-DC.1).

* `02_App/backend/services/rag_service.py`
* `02_App/backend/services/issue_classification.py`
* `02_App/backend/agents/business_validator.py`
* `02_App/backend/skills/knowledge_pack_loader.py`
* `02_App/backend/skills/knowledge_search_engine.py`

## References

* PRD §3 #6 — `plm-knowledge` product-line definition
* PRD §8.11.3 — 4-state capability lifecycle FSM
* WAVE-6-READINESS-SWEEP.md §11.2 — Wave 6.5 conv-by-conv
* W6.5-CONV-A-FOLLOWUPS.md — Wave 6.5 Conv B warm-up
* Decisions #170-#173 — Wave 6.5 Conv B Q-W6.5B-* answers
