text-deontic-extract/module.yaml
flemming-it 7dcdf7679f feat: initial text-deontic-extract v0.1.0 (text.deontic_extract@0.1.0)
Regex-based extraction of atomic deontic statements (Pflicht,
Verbot, Erlaubnis) from German legal text. Reuse-lens: contracts,
ISO standards, internal policies. Vorbild: Mercatus QuantGov /
RegData.

Pattern coverage in v0.1.0:

  - OBLIGATION:  muss, hat zu, ist verpflichtet, ist anzuzeigen,
                 aufzuzeichnen, muss eingehalten/geführt/...
  - PROHIBITION: darf nicht, dürfen nicht, ist untersagt, verboten
  - PERMISSION:  kann, können, darf

Each emitted Duty carries a confidence ∈ [0, 1]. Pattern hits
default to 0.85; ambiguous structures (bare "kann") drop to 0.70.
Anything below 0.6 is the surrounding flow's signal to re-run
through llm.chat for human-readable refinement and feed the result
to system.approval@^0 — that keeps deterministic extraction
separate from non-deterministic LLM judgment.

Pure in-WASM (regex), zero filesystem, zero network.

Reserved for next versions:

  - 0.2: EN / FR locale variants
  - 0.3: addressee + frequency + authority detection (Phase 1
         relies on flow-side LLM enrichment for those fields)

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-18 11:24:58 +02:00

40 lines
1.2 KiB
YAML

schema_version: 3
provider: chain
name: text-deontic-extract
version: 0.1.0
# Extracts atomic deontic statements (Pflicht / Verbot /
# Erlaubnis) from a normalised norm. Reuse-lens: useful far
# beyond law — contracts, ISO standards, internal policies.
#
# v0.1.0 ships a regex pattern list for German legal text
# (must / hat zu / ist verpflichtet / darf nicht / kann). Hybrid
# LLM-assist happens in the FLOW via a separate llm.chat step
# that this module's output feeds. Keeping LLM out of the module
# preserves determinism + tier markings.
#
# Vorbild: Mercatus QuantGov / RegData (US).
provides:
- capability: text.deontic_extract
version: 0.1.0
inputs:
norm:
type: json
description:
en: NormalizedNorm (output of text.akoma_normalize).
de: NormalizedNorm (Output von text.akoma_normalize).
outputs:
duties:
type: json
description:
en: |
JSON-encoded { duties: [Duty], confidence: 0..1 }.
Each Duty: { modality, addressee, action, frequency,
source_norm, confidence }. Low confidence (<0.6) flags
an LLM-assist round; the surrounding flow handles it.
de: |
JSON-codiertes { duties: [Duty], confidence: 0..1 }.
permissions: []