COSMICONESTRAND
Programm 2 von 5 · TutProgram 2 of 5 · Does

SEP

Side Effect ProtocolSide Effect Protocol

SEP liest Python-, JavaScript- und TypeScript-Code, ohne ihn auszuführen, und sagt in Alltagssprache, was er in der Welt bewirkt: wohin Daten gehen, wer es auslösen kann und was auf dem Spiel steht.SEP reads Python, JavaScript and TypeScript code without running it and says in plain words what it does to the world: where data goes, who can set it off and what is at stake.

Version 0.5.0Spezifikation und UmsetzungSpecification and implementationPython, keine AbhängigkeitPython, no dependency
Das BildThe image

Beipackzettel und ZulassungPackage insert and approval

Beipackzettel und Zulassung: Wie bei einem Medikament steht drauf, wofür die Funktion da ist, wer sie gemacht hat (Mensch oder KI), welche Wirkung angegeben ist und welche Nebenwirkungen sie wirklich hat. Die Zulassung ist die Lock-Datei: Was Menschen gutgeheissen haben, darf passieren, alles andere wird gemeldet oder gestoppt.Package insert and approval: like a medicine leaflet, it states what the function is for, who made it (person or AI), what effects are declared and which side effects it really has. The approval is the lock file: what people approved may happen, everything else is reported or stopped.

Was es istWhat it is

Das «Tut» von COSMICThe "Does" of COSMIC

SEP ist zuerst ein Protokoll und dann ein Werkzeug: Die Spezifikation definiert ein JSON-Dokument mit drei Schichten: Behauptungen (was der Autor im Docstring oder JSDoc angibt), Belege (was eine unabhängige Analyse findet) und Befunde (wo beides auseinandergeht). Zwei Regeln tragen das Ganze: Der Autor ist nie der einzige Zeuge, und jeder Satz zeigt auf eine Zeile im Code. Die Referenz-Implementierung «sideeffect» (Befehl «sep») erzeugt daraus den Beipackzettel als Markdown, den Effekt-Diff für Pull Requests, ein interaktives Overlay, Warnungen im Editor und Antworten für KI-Agenten über MCP. Mit «sep lock», «sep observe» und «sep guard» schliesst sich der Kreis: finden, erklären, freigeben, durchsetzen.SEP is a protocol first and a tool second: the specification defines a JSON document with three layers: claims (what the author states in a docstring or JSDoc), evidence (what an independent analysis finds) and findings (where the two disagree). Two rules hold it together: the author is never the only witness, and every sentence points to a line of code. The reference implementation "sideeffect" (command "sep") turns that into a package insert in Markdown, an effect diff for pull requests, an interactive overlay, warnings in the editor and answers for AI agents over MCP. With "sep lock", "sep observe" and "sep guard" the loop closes: find, explain, approve, enforce.

Was es kannWhat it does

Fähigkeiten, belegt im CodeCapabilities, backed by the code

Beipackzettel in AlltagssprachePackage insert in plain language

«sep insert» schreibt pro Funktion: Anwendungsgebiet, Hersteller (Mensch oder KI), angegebene Wirkung, nicht angegebene Nebenwirkungen, wer sie auslösen kann und was auf dem Spiel steht (verlässt dein System, Personendaten, Geld, Geheimnis, nicht rückholbar, löscht, physische Welt). Jeder Satz nennt seine Zeile. Zwei Ansichten: einfach für alle, Experte für Entwickler:innen. Deutsch und Englisch, Pictogramme für jede Wirkung."sep insert" writes per function: indication, manufacturer (person or AI), declared effects, undeclared side effects, who can set it off and what is at stake (leaves your system, personal data, money, secret, cannot be undone, deletes, physical world). Every sentence names its line. Two views: simple for everyone, expert for developers. English and German, pictograms for every effect.

Über Funktionen und Dateien hinweg, mit DatenflussAcross functions and files, with data flow

Imports zwischen eigenen Modulen werden verfolgt: Eine Web-Route zeigt, was drei Dateien tiefer passiert. Eine E-Mail-Adresse, die durch Parameter und lokale Variablen wandert, ist bei «requests.post» immer noch eine E-Mail-Adresse. Erkannt werden Wege hinein (Flask, FastAPI, Express, Next.js, Server Actions, Cloudflare Workers, Lambda, Cron, Hintergrundjobs) und Dienste (Anthropic, OpenAI, Stripe, AWS, PostHog, Sentry und weitere). Unsicheres ist als «geraten» markiert, nicht analysierbarer Code wird gemeldet, nie verschwiegen.Imports between your own modules are followed: a web route shows what happens three files deeper. An email address passed through parameters and local variables is still an email address when it reaches "requests.post". Ways in are recognised (Flask, FastAPI, Express, Next.js, server actions, Cloudflare Workers, Lambda, cron, background jobs) as are services (Anthropic, OpenAI, Stripe, AWS, PostHog, Sentry and more). Inferred effects are labelled "guessed"; code that cannot be analysed is reported, never ignored.

Lock-Datei: einführen ohne eine einzige Zeile zu schreibenLock file: adopt without writing a single claim

«sep lock src/» schreibt sep.lock.json: was der Code heute tut, in Alltagssprache, zum Review wie Code. Danach meldet «sep check --lock» nur, was neu oder weiter ist: ein neuer Host, mehr Personendaten, ein neuer Weg aus dem Internet. Umbenannte Funktionen gelten als Verschiebung. Der Diff der Lock-Datei ist die Freigabe."sep lock src/" writes sep.lock.json: what the code does today, in plain words, reviewed like code. From then on "sep check --lock" reports only what is new or wider: a new host, more personal data, a new way in from the internet. Renamed functions count as moves. The diff of the lock file is the approval.

Effekt-Diff und ein Kommentar pro Pull RequestEffect diff and one comment per pull request

«sep diff --git main src/» zeigt, was ein Branch in der Welt verändert: neue, breitere und entfernte Nebenwirkungen, mit Risiko und Auslöser. Die GitHub Action postet einen Kommentar pro Pull Request und hält ihn aktuell, setzt Annotationen auf die Zeilen und lässt den Check scheitern ab dem gewählten Schweregrad (Eingaben: paths, fail-on, lang, lock, comment, view). Verstösse gegen eine Policy werden im Kommentar markiert."sep diff --git main src/" shows what a branch changes in the world: new, wider and removed side effects, with risk and trigger. The GitHub Action posts one comment per pull request and keeps it up to date, annotates the lines and fails the check from the chosen severity (inputs: paths, fail-on, lang, lock, comment, view). Policy violations are marked in the comment.

Drei Zeugen: Behauptung, Lesen, AusführenThree witnesses: claim, reading, running

«sep observe src -- pytest» lässt die Tests laufen und notiert über Pythons Audit-Hooks, was der eigene Code wirklich tut; nichts am Code ändert sich. Dann vergleicht SEP drei Quellen: was der Autor angibt, was Lesen findet und was beim Laufen passiert ist. Mit «--learn» wird ein blinder Fleck zur Regel in.sep.json, mit «--format json» geht das Ergebnis an andere Werkzeuge (slp propose --from-sep). Gemessen an 93 Fällen: Recall 98 %, Precision 98 %; jeder Fehltreffer ist aufgelistet."sep observe src -- pytest" runs the tests and notes, through Python's audit hooks, what the project's own code really does; nothing in the code changes. SEP then compares three sources: what the author claims, what reading finds and what happened at run time. With "--learn" a blind spot becomes a rule in.sep.json; with "--format json" the result goes to other tools (slp propose --from-sep). Measured on 93 cases: recall 98 %, precision 98 %; every miss is listed.

Zulassung zur Laufzeit: sep guardApproval enforced at run time: sep guard

«sep guard --mode block -- python app.py» macht die Lock-Datei zu Berechtigungen pro Funktion, während das Programm läuft: Nicht Freigegebenes wird gemeldet (warn) oder gestoppt, bevor es passiert (block, PermissionError). Für Anwendungen gibt es sideeffect.guard.install(). Ein Sicherheitsgurt, kein Tresor: Code, der an Python vorbeigeht (C-Erweiterungen, andere Programme), wird nicht gehalten."sep guard --mode block -- python app.py" turns the lock file into per-function permissions while the program runs: what is not approved is reported (warn) or stopped before it happens (block, PermissionError). Applications can call sideeffect.guard.install(). A seatbelt, not a vault: code that goes around Python (C extensions, other programs) is not held back.

Policies und Datenkarte für nDSG und DSGVOPolicies and a data map for nDSG and GDPR

In.sep.json steht als Daten, was erlaubt ist: erlaubte Hosts, wohin Personendaten und Geheimnisse dürfen, was nie passieren oder nie aus dem Internet erreichbar sein darf. «sep check» scheitert bei Verstössen. «sep datamap src/» listet jede Stelle, an der Code Personendaten weitergibt als Markdown, CSV oder JSON: ein Startpunkt für das Verzeichnis der Bearbeitungstätigkeiten (nDSG Art. 12, DSGVO Art. 30), aus dem Code selbst.In.sep.json, what is allowed is written as data: allowed hosts, where personal data and secrets may go, what must never happen or never be reachable from the internet. "sep check" fails on violations. "sep datamap src/" lists every place the code hands on personal data (which, to whom, trigger, line) as Markdown, CSV or JSON: a starting point for the record of processing activities (Swiss nDSG Art. 12, EU GDPR Art. 30), made from the code itself.

BefehleCommands

Die BefehlszeileThe command line

BefehlCommandWas passiertWhat happens
sep insert src/Schreibt den Beipackzettel als Markdown für eine Datei oder einen Ordner (--view simple|expert, --lang de|en).Writes the package insert in Markdown for a file or folder (--view simple|expert, --lang de|en).
sep check src/ --lock --fail-on highMeldet Warnungen; mit --lock nur, was nicht in sep.lock.json freigegeben ist; Exit-Code 1 ab dem gewählten Schweregrad, --format github für Annotationen.Reports warnings; with --lock only what sep.lock.json does not approve; exit code 1 from the chosen severity, --format github for annotations.
sep lock src/Gibt die heutigen Nebenwirkungen frei: schreibt die Lock-Datei, die «check --lock» und «guard» benutzen.Approves today's side effects: writes the lock file that "check --lock" and "guard" use.
sep diff --git main src/ --format markdownZeigt, welche Wirkungen eine Änderung hinzufügt, erweitert oder entfernt; Markdown ist für Pull-Request-Kommentare gemacht.Shows which effects a change adds, widens or removes; Markdown is made for pull request comments.
sep guard --mode block -- python app.pyFührt einen Befehl aus, der nur tun darf, was die Lock-Datei freigibt; warn meldet, block stoppt.Runs a command that may only do what the lock file approves; warn reports, block stops.
sep observe src -- pytestLässt die Tests laufen und vergleicht, was der Code wirklich tut, mit Behauptung und Lesen; --learn ergänzt fehlende Regeln in.sep.json, --format json für slp propose --from-sep.Runs the tests and compares what the code really does with claims and reading; --learn adds missing rules to.sep.json, --format json for slp propose --from-sep.
sep datamap src/Listet, wohin Personendaten gehen: Startpunkt für das Verzeichnis der Bearbeitungstätigkeiten (Markdown, CSV, JSON).Lists where personal data goes: a starting point for the record of processing activities (Markdown, CSV, JSON).
sep render src/ -o report.htmlSchreibt das interaktive Overlay als eine HTML-Datei; «sep view» zeigt SEP-Dokumente anderer Werkzeuge.Writes the interactive overlay as one HTML file; "sep view" shows SEP documents made by any tool.
sep analyze src/Schreibt das SEP-Dokument (JSON) nach spec/sep.schema.json für eigene Werkzeuge.Writes the SEP document (JSON) per spec/sep.schema.json for your own tools.
sep lsp / sep mcpStartet den Language Server für Editoren bzw. den MCP-Server, über den KI-Agenten fragen, was Code tut (Tools: sep_explain, sep_line, sep_check, sep_diff, sep_analyze, sep_datamap).Starts the language server for editors or the MCP server through which AI agents ask what code does (tools: sep_explain, sep_line, sep_check, sep_diff, sep_analyze, sep_datamap).

Erweiterungen:Extensions: Claude Code VS Code Language Server Jede CIAny CI Browser-Playground mit Pyodide

Wer entscheidetWho decides

Der Mensch, an einem klaren PunktA person, at a clear point

Ein Mensch liest die Sätze und entscheidet, was der Code tun darf: Er gibt mit «sep lock» die heutigen Nebenwirkungen frei (der Diff der Lock-Datei ist die Freigabe), schreibt in.sep.json die Policy (wohin Personendaten und Geheimnisse dürfen, was nie passieren darf) und entscheidet, ob eine neue Regel aus «sep observe --learn» gilt. «SWELP init» legt dafür Claude-Code-«ask»-Regeln an, damit «sep lock» immer die Person fragt, nie die KI selbst freigibt. Die Maschine schreibt den Code, der Mensch entscheidet, was er darf.A person reads the sentences and decides what the code may do: they approve today's side effects with "sep lock" (the diff of the lock file is the approval), write the policy in.sep.json (where personal data and secrets may go, what must never happen) and decide whether a new rule from "sep observe --learn" stands. "SWELP init" writes Claude Code "ask" rules so that "sep lock" always asks the person and the AI never approves itself. Machines write the code; people decide what it may do.

Im ZusammenspielIn concert

Was SEP mit den anderen verbindetWhat connects SEP with the others

SWP

Der SWP-Auftrag nennt, welche neuen Nebenwirkungen die KI haben darf, und die Quittung listet die neuen Nebenwirkungen aus dem SEP-Diff, nicht aus der Selbstauskunft der KI; ohne installiertes SEP werden neue Nebenwirkungen im Auftrag nicht beurteilt.The SWP work order names which new side effects the AI may add, and the receipt lists new side effects from the SEP diff, not from the AI's own account; without SEP installed, new side effects in a work order are not judged.

SLP

Was «sep observe» beim Laufen sieht und das Lesen nicht kennt, wird mit «sep observe --format json» an «slp propose --from-sep» übergeben; ein Mensch gibt die Lektion frei, «slp apply» schreibt die Regel in.sep.json, und «sep lock» hält sie fest.What "sep observe" sees at run time that reading does not know is handed with "sep observe --format json" to "slp propose --from-sep"; a person approves the lesson, "slp apply" writes the rule into.sep.json, and "sep lock" records it.

SWELP

«SWELP init» richtet SEP mit ein: die heutigen Nebenwirkungen als freigegebener Startpunkt, der Claude-Code-Hook nach jeder Änderung, der MCP-Server und «ask»-Regeln für «sep lock»; «SWELP status» zeigt unter «Tut» die noch nicht freigegebenen Nebenwirkungen und den nächsten Schritt."SWELP init" sets SEP up as part of the whole: today's side effects as the approved starting point, the Claude Code hook after every change, the MCP server and "ask" rules for "sep lock"; "SWELP status" shows under "Does" the side effects not yet approved and the one next step.

SWELPER

Im SWELPER ist «sep check --lock» das Gate «data-flow»: Neue Nebenwirkungen warten auf Alban, und die Quittung eines Auftrags entsteht aus Git, Hook-Log und SEP-Diff; der SWELPER baut nichts nach, was SEP kann.In the SWELPER, "sep check --lock" is the gate "data-flow": new side effects wait for Alban, and a work order's receipt is built from Git, the hook log and the SEP diff; the SWELPER rebuilds nothing that SEP already does.

Stand und GrenzenStatus and limits

Ehrlich, Stand November 2026Honestly, as of November 2026

Stand:Status: Version 0.5.0, Spezifikation 0.3 im Status «draft», Entwicklungsstand «Alpha» laut pyproject.toml. 131 Testfunktionen in 12 Testdateien (gezählt mit grep «def test_» in tests/); CI läuft auf Python 3.10 bis 3.13. Genauigkeit gemessen an 93 Benchmark-Fällen: Recall 98 %, Precision 98 %. Keine Laufzeit-Abhängigkeit, Python 3.10 oder neuer. Lizenz: proprietär, Copyright 2026 Alban Hyseni, alle Rechte vorbehalten; Evaluation für 30 Tage nach Zugang, alles Weitere braucht eine Lizenz (LICENSE, NOTICE). Heute erhältlich per «pip install git+https://github.com/BanioX/swelp»; Veröffentlichung auf PyPI und im VS Code Marketplace: geplant.Version 0.5.0, specification 0.3 with status "draft", development status "Alpha" per pyproject.toml. 131 test functions in 12 test files (counted with grep "def test_" in tests/); CI runs on Python 3.10 to 3.13. Accuracy measured on 93 benchmark cases: recall 98 %, precision 98 %. No runtime dependency, Python 3.10 or newer. Licence: proprietary, copyright 2026 Alban Hyseni, all rights reserved; 30-day evaluation after access, everything else needs a licence (LICENSE, NOTICE). Available today via "pip install git+https://github.com/BanioX/swelp"; release on PyPI and the VS Code Marketplace: planned.

Grenzen:Limits: Nur Python, JavaScript und TypeScript; die JS/TS-Analyse ist ein sorgfältiger Scanner, kein vollständiger Parser, ungewöhnliche Syntax kann eine Funktion verbergen. Aufrufe in installierte Bibliotheken werden nach Regeln beurteilt, nicht verfolgt; Bibliotheken ohne Regel sind beim Lesen unsichtbar, nur «sep observe» sieht sie. «sep observe» und «sep guard» funktionieren nur für Python-Prozesse; Node.js zur Laufzeit beobachten und «sep guard» für Node.js sind geplant. Statische Analyse sieht keine Werte, die erst zur Laufzeit entstehen, und nicht, was ein gestartetes Fremdprogramm tut. «sep guard» ist ein Sicherheitsgurt, kein Tresor: C-Erweiterungen und andere Programme werden nicht gehalten. Wenn SEP nichts findet, heisst das «nichts gefunden», nicht «nichts da». Die Benchmark-Fälle sind eine Stichprobe, für den Benchmark geschrieben, nicht die Welt. Geplant ausserdem: PyPI und VS Code Marketplace, weitere Sprachen (Albanisch, Französisch, Spanisch), «sep guard» in Produktion mit zentralem Freigabedienst.Python, JavaScript and TypeScript only; the JS/TS analysis is a careful scanner, not a full parser, so unusual syntax can hide a function. Calls into installed libraries are judged by rules, not followed; libraries without rules are invisible to reading, only "sep observe" sees them. "sep observe" and "sep guard" work for Python processes only; watching Node.js at run time and "sep guard" for Node.js are planned. Static analysis cannot see values that only exist at run time, or what another program does once started. "sep guard" is a seatbelt, not a vault: C extensions and other programs are not held back. When SEP finds nothing, that means "nothing found", not "nothing there". The benchmark cases are a sample written for the benchmark, not the world. Also planned: PyPI and the VS Code Marketplace, more human languages (Albanian, French, Spanish), "sep guard" in production with a central approval service.

LoslegenGet startedZurück zum ZusammenspielBack to how they fit