feat(learn): excerpts and the example store (decision-engine 6.1)

learn/excerpt.py: the labelled function at its pin as numbered lines, bounded
(80 lines / 4,000 chars for candidates, 40 / 2,000 for memory examples),
centred on focus lines; advisory ids anywhere and comments with security
wording (labels.security_reason, multilingual) become <redacted>; owner,
owner/name, path and commit ids are replaced; a delta unit appends the
base->head diff (<= 40 lines). C/C++ and other brace languages without a
repo-facts declaration pattern use a brace matcher (346 c_cpp pair rows
had no excerpt without it).

learn/examples.py + `ousast learn memory build`: label + feature record +
excerpt -> `example` rows (no rationale), excerpts as content-addressed
blobs; refuses origin: user and sources outside sources.toml (exit 2);
conditional labels skipped; exit 2 when >10% of a source's recorded
candidates have no excerpt. A fixed side that was read but no longer
declares the labelled function is counted apart (absent_fixed_side): a
label defect, not an unread clone.

plane/memory.py: `example` in KINDS; put_blob/get_blob/blob_names on the
MemoryStore base, so FileStore and MinioStore share them (tested on both,
MinIO through the fake object client).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
This commit is contained in:
Marius Ciepluch
2026-10-01 09:45:17 +02:00
co-authored by Claude Opus 5.5
parent 0f9318f58b
commit 7b81c9ac4e
9 changed files with 1094 additions and 9 deletions
@@ -1,7 +1,7 @@
{
"modules": 143,
"modules": 146,
"counts": {
"load_bearing": 136,
"load_bearing": 139,
"standalone_capability": 7
},
"orphaned": [],
@@ -352,6 +352,9 @@
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"cli",
"learn.cli",
"learn.examples",
"learn.excerpt",
"learn.features",
"learn.roles",
"plane.tasks.features",
@@ -359,11 +362,36 @@
"plane.tasks.roles"
]
},
{
"module": "learn.cli",
"classification": "load_bearing",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"cli"
]
},
{
"module": "learn.examples",
"classification": "load_bearing",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"learn.cli"
]
},
{
"module": "learn.excerpt",
"classification": "load_bearing",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"learn.examples"
]
},
{
"module": "learn.features",
"classification": "load_bearing",
"reason": "imported by plane.tasks.features",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"learn.excerpt",
"plane.tasks.features"
]
},
@@ -372,13 +400,16 @@
"classification": "load_bearing",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"cli"
"cli",
"learn.cli",
"learn.examples",
"learn.excerpt"
]
},
{
"module": "learn.roles",
"classification": "load_bearing",
"reason": "imported by learn.features, plane.tasks.features, plane.tasks.roles",
"reason": "reachable from gate, map_gate, pair_gate or the CLI",
"importers": [
"learn.features",
"plane.tasks.features",
@@ -706,6 +737,7 @@
"improve",
"improve.evolve",
"improve.memory",
"learn.examples",
"learn.labels",
"model.candidates",
"pair_gate",
@@ -719,6 +751,8 @@
"importers": [
"cli",
"improve.memory",
"learn.cli",
"learn.examples",
"plane.egress",
"plane.engine_alerts",
"plane.generate",
@@ -792,6 +826,8 @@
"reason": "harnessx-removal Req 6.1/6.4: the memory store (file, MinIO), ingest and fact reuse; `ousast plane remember`",
"importers": [
"improve.memory",
"learn.cli",
"learn.examples",
"plane.generate",
"plane.tasks.loop",
"plane.tasks.remember"
@@ -828,6 +864,7 @@
"reason": "ai-service-plane Req 4.1: the task entrypoint package the runner imports by name; runner integration pending (task 3)",
"importers": [
"cli",
"learn.excerpt",
"learn.features",
"learn.labels",
"learn.roles",
@@ -884,6 +921,7 @@
"classification": "load_bearing",
"reason": "ai-service-plane Req 5.1/5.2: source-only functions and callers per file; runner integration pending",
"importers": [
"learn.excerpt",
"learn.features",
"learn.labels",
"learn.roles",