Skip to content

Commit 239eaa3

Browse files
author
Lukas Geiger
committed
feat: prompt-listener 1.0.0 -- Fork-Master-Template (Auskapselung aus dem AI-LAB)
Nutzerentscheid 2026-08-16: eigenes Repo als versioniertes Master-Muster, dessen Logik schnell forkbar ist. Forks divergieren bewusst und werden nur in FORKS.md registriert (deklarierte Divergenz statt stiller Kopie); keine Fork-Synchronisierung. Werkzeug-Kern (5-Stufen-Analyzer, AgentEvent-v2-Schema, 14 Tests); Forschungsdaten bleiben im Lab. Final Gate 10/10 (RELEASE_GATE.md).
0 parents  commit 239eaa3

23 files changed

Lines changed: 4287 additions & 0 deletions

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
__pycache__/
2+
*.py[cod]
3+
*.egg-info/
4+
.venv/
5+
venv/
6+
.pytest_cache/
7+
.ruff_cache/
8+
.env
9+
*.db
10+
.idea/
11+
.vscode/
12+
data/
13+
# Forschungsdaten bleiben im Lab, nie im Template-Master
14+
_results/
15+
_sources/
16+
out/
17+
*.pyc

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
## [1.0.0] - 2026-08-16
4+
5+
Erstveroeffentlichung als **Fork-Master-Template** (Nutzerentscheid 2026-08-16:
6+
eigenes Repo als versioniertes Master-Muster, dessen Logik schnell forkbar ist;
7+
Forks divergieren bewusst und werden nur in FORKS.md registriert).
8+
9+
- Werkzeug-Kern ausgekapselt aus `.RESEARCH/.LAB/_AI-LAB/prompt-listener`
10+
(Erstanwendung Regress-Melder 04/2026; Methodik: Prompt-Archaeology):
11+
prompt_analyzer.py (5 Stufen), stage0_agent_event.py, schema/agent_event_v2
12+
(+ JSON Schema), fixture_corpus, 14 Tests.
13+
- Forschungsdaten (_results/, _sources/) und Reife-Gates bleiben im Lab.
14+
- FORKS.md-Register mit den zwei bekannten Forks (TOM-lm corpus_extract,
15+
AI-LAB-Arbeitskopie).
16+
- Veralteten llmauto-Pfad im Docstring durch neutrale Nachbar-Formulierung
17+
ersetzt (llmauto lebt heute als Paket in MarbleRun).

FORKS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Fork-Register — wer stammt von diesem Master ab
2+
3+
> Dieses Repo ist eine **Fork-Quelle** (versioniertes Master-Muster), keine
4+
> geteilte Abhängigkeit: Wer die Logik anders braucht, **forkt und divergiert
5+
> bewusst** — einzige Pflicht ist der Eintrag hier (Herkunfts-Deklaration).
6+
> Der Master wird gepflegt; Forks leben eigenständig weiter und werden vom
7+
> Master **nicht** nachgezogen.
8+
9+
| # | Fork | Ort | Abgezweigt | Zweck-Divergenz |
10+
|---|---|---|---|---|
11+
| 1 | TOM-lm `corpus_extract.py` | `<privat> _control-center/_TOM-lm/_tool/` | vor 2026-06 (aus `prompt_analyzer.py`) | Nutzermodell-Bau statt Session-Klassifikation: Korpus-Modus, Multi-Source, Outcome-Link |
12+
| 2 | AI-LAB-Forschungsexemplar | `<privat> .RESEARCH/.LAB/_AI-LAB/prompt-listener/` | 2026-08-16 (Ursprungsort; Master wurde von dort ausgekapselt) | Forschungs-Arbeitskopie mit Korpora/Ergebnissen (`_results/`, `_sources/` — bleiben privat) |
13+
14+
## Eintragsregel
15+
16+
Neuer Fork = neue Zeile: Ort, Datum, ein Satz Zweck-Divergenz. Mehr nicht —
17+
kein Rückführungsversprechen, keine Sync-Pflicht. Ein Audit liest diese Tabelle
18+
als Legitimation der Doppelstruktur (deklarierte Divergenz statt stiller Kopie).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Lukas Geiger
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# prompt-listener
2+
3+
> **A fork-master template, not a shared dependency.** A versioned master
4+
> pattern for analysing human–AI interactions: fork it, diverge deliberately,
5+
> register your fork — the master stays clean, your fork lives its own life.
6+
7+
[Deutsche Fassung](README_de.md)
8+
9+
## What it is
10+
11+
Two building blocks for prompt/session research, stdlib-only at the core:
12+
13+
1. **`prompt_analyzer.py`** — a 5-stage pipeline over agent session logs
14+
(JSONL): raw extraction → topic filter → LLM classification
15+
(type/topic/purpose/intent/method) → per-unit aggregation → statistics.
16+
Stages 0–1 run with no dependencies (`--dry-run`); stages 2–4 use an LLM
17+
runner as an **optional neighbour** (detected, never assumed).
18+
2. **`schema/agent_event_v2.py`** — an 850-line, stdlib-only provenance schema
19+
(AgentEvent core + 18 sub-ledgers: source, authority, trust boundary,
20+
tool/MCP context, memory influence, planned vs. executed action, gate
21+
decision, review status) plus JSON Schema and tests. Useful on its own
22+
wherever "who caused what on which authority" must be recorded.
23+
24+
## The template model
25+
26+
This repo answers a real governance question: *what if a consumer needs the
27+
logic differently?* Then a shared import is the wrong tool — **fork the master
28+
instead**:
29+
30+
- The **master** is versioned, tested and kept tidy.
31+
- A **fork** diverges freely and is *not* chased by master updates.
32+
- The only duty: one line in [`FORKS.md`](FORKS.md) (where, when, why the
33+
purpose diverged). An audit reads that as *declared divergence* instead of a
34+
silent copy.
35+
36+
Import when the purpose stays the same; fork when it diverges.
37+
38+
## Quick start
39+
40+
```bash
41+
python prompt_analyzer.py session.jsonl --dry-run # stages 0–1, no deps
42+
python prompt_analyzer.py session.jsonl --dry-run --agent-events-output out/events.jsonl
43+
python -m pytest -q # 14 tests
44+
```
45+
46+
## Provenance
47+
48+
Extracted 2026-08-16 from the AI-LAB research project (which keeps the corpora
49+
and results privately and continues as the research working copy — fork #2 in
50+
the register). First registered fork: TOM-lm's `corpus_extract.py`
51+
(user-model building). Method paper: "Prompt-Archaeology" (research line).
52+
53+
## License
54+
55+
MIT.

README_de.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# prompt-listener
2+
3+
> **Ein Fork-Master-Template, keine geteilte Abhängigkeit.** Ein versioniertes
4+
> Master-Muster zur Analyse von Mensch-KI-Interaktionen: forke es, divergiere
5+
> bewusst, registriere deinen Fork — der Master bleibt sauber, dein Fork lebt
6+
> sein eigenes Leben.
7+
8+
[English version](README.md)
9+
10+
## Was es ist
11+
12+
Zwei Bausteine für Prompt-/Session-Forschung, im Kern stdlib-only:
13+
14+
1. **`prompt_analyzer.py`** — 5-Stufen-Pipeline über Agent-Session-Logs
15+
(JSONL): Roh-Extraktion → Themenfilter → LLM-Klassifikation
16+
(Typ/Thema/Zweck/Absicht/Methode) → Aggregation je Einheit → Statistik.
17+
Stufe 0–1 läuft ohne Abhängigkeiten (`--dry-run`); Stufe 2–4 nutzt einen
18+
LLM-Runner als **optionalen Nachbarn** (erkannt, nie vorausgesetzt).
19+
2. **`schema/agent_event_v2.py`** — 850 Zeilen stdlib-only Provenienz-Schema
20+
(AgentEvent-Kern + 18 Sub-Ledger: Quelle, Autorität, Trust-Boundary,
21+
Tool-/MCP-Kontext, Memory-Einfluss, geplante vs. ausgeführte Aktion,
22+
Gate-Entscheidung, Review-Status) plus JSON-Schema und Tests. Eigenständig
23+
nützlich, wo „wer hat was auf welcher Autorität ausgelöst" festzuhalten ist.
24+
25+
## Das Template-Modell
26+
27+
Dieses Repo beantwortet eine echte Governance-Frage: *Was, wenn ein Konsument
28+
die Logik ganz anders braucht?* Dann ist ein geteilter Import das falsche
29+
Werkzeug — **stattdessen den Master forken**:
30+
31+
- Der **Master** ist versioniert, getestet und wird gepflegt.
32+
- Ein **Fork** divergiert frei und wird vom Master *nicht* nachgezogen.
33+
- Einzige Pflicht: eine Zeile in [`FORKS.md`](FORKS.md) (wo, wann, warum der
34+
Zweck divergiert). Ein Audit liest das als *deklarierte Divergenz* statt
35+
stiller Kopie.
36+
37+
Importieren, solange der Zweck gleich bleibt; forken, wenn er divergiert.
38+
39+
## Schnellstart
40+
41+
```bash
42+
python prompt_analyzer.py session.jsonl --dry-run # Stufe 0–1, ohne Abhängigkeiten
43+
python prompt_analyzer.py session.jsonl --dry-run --agent-events-output out/events.jsonl
44+
python -m pytest -q # 14 Tests
45+
```
46+
47+
## Provenienz
48+
49+
Ausgekapselt 2026-08-16 aus dem AI-LAB-Forschungsprojekt (das Korpora und
50+
Ergebnisse privat behält und als Forschungs-Arbeitskopie weiterlebt — Fork #2
51+
im Register). Erster registrierter Fork: TOM-lms `corpus_extract.py`
52+
(Nutzermodell-Bau). Methoden-Paper: „Prompt-Archaeology" (research line).
53+
54+
## Lizenz
55+
56+
MIT.

RELEASE_GATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Release Gate: prompt-listener
2+
3+
## Status
4+
5+
```
6+
+------------------------------------------+
7+
| |
8+
| STATUS: UNLOCKED |
9+
| |
10+
+------------------------------------------+
11+
```
12+
13+
> **LOCKED** = Repository must remain private.
14+
> **UNLOCKED** = Repository may be set to public.
15+
16+
---
17+
18+
## Gate run 2026-08-16
19+
20+
`final_gate_check.py --repo-path .`**10 PASS, 0 FAIL, 0 WARN — exit 0**
21+
(process `MODULES/RELEASE_PROCESS.md` v1.0)
22+
23+
## Notes
24+
25+
- **Cut of the extraction:** tool core only (analyzer, stage0, schema, tests,
26+
fixture corpus). Research data (`_results/`, `_sources/`) and the lab's
27+
maturity-gate artefacts stay in the AI-LAB project (gitignored here); the
28+
lab-specific gate test was removed from this repo's suite.
29+
- Stale personal path in the analyzer docstring (old llmauto location)
30+
replaced by a neutral optional-neighbour note.
31+
- Role: **fork-master template** — forks diverge freely, sole duty is a
32+
FORKS.md entry (declared divergence). No fork synchronisation by design.
33+
- Test suite: 14 passed (synthetic fixtures only, no network, no API key for
34+
stages 0–1).
35+
- Reviewed by: Claude Code (fable-5), 2026-08-16

TODO.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# TODO — prompt-listener (Fork-Master)
2+
3+
## STATUS
4+
5+
| Category | Status |
6+
|---|---|
7+
| Tests | 14 passed (Werkzeug-Kern; Forschungs-Gate-Tests bleiben im Lab) |
8+
| Sprachstufe (P-006) | Core: README DE+EN; Code/CLI englischsprachige Struktur, deutsche Pipeline-Ausgaben (Forschungssprache — bewusst) |
9+
| Rolle | Fork-Master-Template: Forks divergieren frei, Pflicht ist nur der FORKS.md-Eintrag |
10+
| Bewusste Entscheidung | Keine Rückkonsolidierung von Forks (User 2026-08-16); Forschungsdaten bleiben im Lab |
11+
12+
Stand: 2026-08-16 · Version 1.0.0
13+
14+
## Offen
15+
16+
- [ ] compare-race-Export-Adapter (Race-Artefakte → Stufe-0-JSONL) — Eintrag
17+
liegt im compare-race-TODO; bei Bau hier als Konsument oder Fork führen.
18+
- [ ] Stufe-2-Runner-Probe formalisieren (marblerun/llmauto per enabled_probe
19+
statt PYTHONPATH-Konvention).
20+
21+
## Bewusst nicht gebaut
22+
23+
- **Fork-Synchronisierung** — Forks leben eigenständig (Template-Modell).
24+
- **Forschungs-Reife-Gates** (evidence_gate) — Projektsteuerung des Labs,
25+
nicht Werkzeug-Substanz.

ellmos-module.v2.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"schema": "ellmos.module.v2",
3+
"id": "prompt-listener",
4+
"display_name": "prompt-listener",
5+
"category": "quality",
6+
"kind": "template",
7+
"status": "active",
8+
"visibility": "public",
9+
"provides": ["quality.prompt-analysis", "quality.agent-event-provenance"],
10+
"requires": [],
11+
"optional": ["automation.default"],
12+
"conflicts": [],
13+
"surfaces": ["library", "cli", "template"],
14+
"state": { "ownership": "external", "location": "project" },
15+
"boundaries": {
16+
"network": "none",
17+
"data": "user-local",
18+
"platforms": ["windows", "macos", "linux"]
19+
},
20+
"source_of_truth": { "type": "local-directory", "path": "." },
21+
"adapters": []
22+
}

0 commit comments

Comments
 (0)