Commit Graph

120 Commits

Author SHA1 Message Date
fegger 9f120a4075 [ADD] pv-agent: merge Wissensbasis-Agent (RAG-Service, Wissensbasis, Tools) per filter-repo Remap 2026-09-17 13:55:59 +02:00
fegger a848c07e96 [ADD] l10n_at_payroll_agent: PV-agent review bridge for payout plausibility
PV-agent bridge (D25/M4.1): Odoo stays the system of record; the
standalone, KB-bound knowledge service (pv-agent) reviews plausibility
and returns evidence-backed answers (mode=review, agent API v1). No
back path: the agent never calls Odoo and receives no personal data —
only the minimized, schema-bound review context.

- context builder: projects a computed draft payslip with an
  ATP_PRAMIE input (planned one-off payout) onto the review context
  (facts + computation): gross wage (hr.version.wage), applying
  collective agreement (version.kv_id) and the draft's DG/LST lines
  (SVDG_*/LST_*/FLAFDB/KOMMST/DZ/BVG/WIEN_DAG)
- client (stdlib urllib, no extra dependency): POST /v1/ask with
  X-Request-ID, bearer key from company settings (pv_agent_url /
  pv_agent_api_key, group_hr_payroll_user); neutral UserErrors,
  technical details only in the server log
- review wizard on the draft payslip: agent answer (evidence-backed),
  structured verdict (plausible / implausible / not checkable) and
  checks in the dialog
- security: wizard bound to hr_payroll.group_hr_payroll_user; agent
  service key stored on res.company, never logged; 5 tests
2026-09-17 13:50:18 +02:00
fegger 26a20e83b2 docs: record m4.1 odoo module scaffold 2026-09-17 00:38:59 +02:00
fegger f233cb706c feat(agent): add odoo review mode with plausibility verdict 2026-09-17 00:29:03 +02:00
fegger 30a25a4601 feat(tools): map kv library variants to kb ids 2026-09-17 00:06:36 +02:00
fegger e1a6e9e0b2 docs: plan odoo agent integration (D25) 2026-09-17 00:02:44 +02:00
fegger 5090f07880 feat(agent): support cost questions and thinking fallback 2026-09-17 00:02:38 +02:00
fegger af8bfcaa6a feat(agent): log answer comments 2026-09-17 00:02:31 +02:00
fegger b42c326d7f feat(agent): add index bootstrap and answer feedback 2026-09-16 22:40:06 +02:00
fegger 4f5107a46a feat(agent): add test frontend and Docker stack 2026-09-16 21:42:05 +02:00
fegger c8b55fbd38 feat(agent): harden API-first service 2026-09-16 21:12:47 +02:00
fegger aa637270b7 docs: record final ollama evaluation 2026-09-16 20:09:05 +02:00
fegger e4726e6cfd docs: record runtime evaluation decision 2026-09-16 19:29:55 +02:00
fegger ec33dfacf2 [IMP] l10n_at_hr_payroll(_private): Meldewesen-Reste (AP17) und Status-Sonderfälle (AP18/AP19)
AP17 — Lohnnachweis L17, Finanz-Mitteilungen § 109a/§ 109b, GfB-Jahreszahlung:
- L17 (DM-ORG E.24, BEST LF, SART A1/1100, Version 28): je
  Lohnzahlungszeitraum je DN aus den GP3-Kennzahlen-Flags; Prüfkatalog-
  Semantik (KZ 350 = Brutto gesamt, 351/352/354 Teilbeträge) und formale
  Prüfungen (350-Formel, 357/347-Caps, aliquotierte 354/HOPA-Caps);
  ODL-PDF-Extraktion der Kapitel E.24/E.16/E.26 (txt feldversetzt)
- Finanz-Mitteilungen § 109a (W1, E.16) und § 109b (B1, E.26): Modelle
  je Leistungserbringer/Auftragnehmer, Schwellen als hr.rule.parameter
  (450/900 — § 109a-VO; 100.000 — § 109b Abs 4 lit a, RIS NOR40263383),
  AL31/32/33, LKZ1-7, UID, bis 3 maßgebliche natürliche Personen,
  KORR K/S; Unter-Schwellen-Zeilen entfallen mit Protokollhinweis
- mBGM: geringfügig Beschäftigte (BSGR B010/B030) — T01 § 53a-UV-
  Pauschale + V01 BMSVG 1,53 %, kein T02 (GfB-SZ beitragsfrei,
  § 49 Abs 3); JAGB-Pakettrennung für die jährliche Abrechnung
  (§ 58 Abs 8 ASVG iVm § 6 Abs 2a BMSVG, DM-ORG D.52) mit
  2,5 vH-Zuschlag (Z04) in der GfB-Jahresabrechnung (Fälligkeit
  15. 1. Folgejahr)
- Fristenkalender: L17- und § 109b-Fristarten (Ende Februar;
  § 109a/§ 109b EStG und § 58 Abs 8 ASVG RIS-verifiziert)

AP18 — Schwerarbeit/NSchG (Beschaffungsgate erledigt, RIS):
- NSchG (RIS 10008502, BGBl 1981/354) Art XI Abs 3 (2 vH Stammnorm,
  3,80 % via Sistierung) und Abs 6 (Nachtschwerarbeitsmonat: 6-Tage-
  Kriterium, Rückblick-Fenster 12/18, Randmonat); ASchV (20004642)
  § 1/§ 4/§ 5; DM-ORG E.22.2-Erstellvorschriften (Z 1 analog NSchG,
  Z 2/4/5 ≥ 15 Tage, Z 3/GfB nicht melden)
- Kern: Schwerarbeitsmeldung (BEST SM, SART 65/66, Länge 800,
  Tätigkeitsblöcke 26 × 10) mit Altersfilter- und Erstellvorschrift-
  Prüfungen
- Privat: Nachtschwerarbeitsmonat-Zähler (WET ATP_NACHTSCHWER,
  Art-XI-Abs-6-Fenster inkl. Randmonat-Proxy) als stored Flag am Lauf

AP19 — Status- und Verhinderungs-Sonderfälle:
- hr.version-Status (Organ ≤/≥ 25 %, lb-vst-03): Organ ≥ 25 % — kein
  SV-Verhältnis (SVDN/SVDG 0 via SV-Satz-Override, mBGM-Ausschluss,
  LSt läuft weiter); Ferialpraktikanten-Flag (dokumentativ — BMSVG § 6
  nennt keinen Ausschluss, Entgelt-/SV-Logik bleibt normal)
- Präsenz-/Ausbildungs-/Zivildienst-Fiktion (§ 7 Abs 1/2 BMSVG):
  fiktive BV-Bemessungsgrundlage 435,90 € (KBGG § 3 Abs 1 idF vor
  BGBl I 53/2016, lb-vor-04) aliquotiert auf ATP_PRD_TAGE
- Dienstverhinderungs-Sonderfälle bleiben dokumentiert offen
  (lb-dvh-01/04, KB-); Feiertags-EFZ ist durch das AP4-WET-Modell
  abgedeckt

Tests: 21 neue (L17-Positionen/Prüfkatalog, W1/B1-Schwellen, GfB-mBGM/
JAGB/Jahresabrechnung, NSchM-Fenster/Randmonat, SM-Fixsatz, Organ-Sperre,
PRD-Fiktion); Suite 252/252 grün auf frischer -i-DB (85 Kern, 18 GemBG,
213 Privat, 10 Dokumente). Dokumentierte Reste: DZR-36-Fenster,
Randmonat-Proxy und UV-Pauschale-vs-mBGM im Parallellauf (GP8),
fallweise mBGM (G3/G4), 2027er-Schwellen (C7).
2026-09-16 19:12:08 +02:00
fegger 7e1d466ab7 fix(agent): stabilize decision support grounding 2026-09-16 12:15:42 +02:00
fegger 1df5fb19c4 [ADD] l10n_at_payroll_dokumente: generate documents from templates
Document generation module: templates with own text (structure reference
and source stand documented per template, no licensed full text in the
repo), fill fields resolved from hr data (company, employee, hr.version
stand) plus wizard input, preview rendering and PDF/HTML attachment via
the generic report layout.

- templates: pilot set for the general-AT track formulated as own text
  after the KB muster structure (lb-bes-09, lb-bnd-55, lb-bnd-52/62,
  lb-end-35), legal status per template marked as draft
- rendering via convert_inline_template_to_qweb + ir.qweb (t-out
  auto-escapes values) — deliberately not mail.render.mixin inline
  engine, whose expression whitelist blocks werte[...] placeholders for
  non-template-editors
- wizard resolves hr.version by date_version at the reference date;
  PDF falls back to HTML attachment without wkhtmltopdf
- security: ir.model.access (hr user read / manager write) + company
  rule; 8 tests, suite 236/236 green on a fresh -i database run
2026-09-16 10:36:49 +02:00
fegger efe76e6b3d [FIX] personalverrechnung: record Ausbildungskostenrückersatz gap in AP14 plan
Renewed knowledge-base comparison (2026-09-16, Batch 10) surfaced a new
settlement component not covered by the 2026-09-12 gap analysis:
Ausbildungskostenrückersatz at early termination (lb-end-27/28). Added to
the AP14 scope, anchors and gap list; RIS verification of the legal basis
gates implementation, scope gate at the pilot client.
2026-09-16 10:36:42 +02:00
fegger 31ed539941 feat(agent): tune retrieval for decision support 2026-09-16 09:34:29 +02:00
fegger 27f3b4b7f9 [ADD] personalverrechnung: Lexis360 knowledge base (Batch 10)
Zehnter Lexis 360-Intake (64 Briefings aus den Sektionsordnern
beispiele / muster / uebersichten_checklisten, Quell-Staende
2020-12 bis 2026-08), erweitert das Korpus auf 665 kuratierte
Eintraege in 69 Clustern. Dasselbe Werk, dieselbe Breadcrumb-Form
— die Pipeline globt jetzt die drei Subordner; die neue
no-author-Breadcrumb-Variante (Muster-Exporte
"Kapitel > Thema · <Monat> <Jahr>") defaultet auf "Lexis Redaktion".

- 13 bestehende Cluster erweitert (keine neuen):
  beendigungsarten bnd 44→66 (Muster: Kuendigung/Aenderung/
  Aufloesung/Entlassung/Fristablauf/Befristung/Verwarnung/
  Dienstfreistellung, 13 Checklisten, Anspruchsuebersicht Tod),
  endabrechnung end 25→34 (Beispiele: Zeitschulden,
  Viertel-/Zwoelftelregelung, Voll-Ueberttritt,
  Gleitzeitguthaben, UEL; Checklisten: Ausbildungskosten,
  Kuendigungsentschaedigung; Muster: Vergleich, Vordienstzeiten),
  uberstunden ues 4→9, telearbeit tel 6→11,
  beendigungsphase-sonstiges bso 10→16, arbeitszeitgrenzen azg 4→9,
  arbeitszeitmodelle azm 7→10, entsendung grz 8→11,
  beschaftigungsformen bes 8→10, sonderzahlungen son 5→6,
  schwerarbeit swa 5→6, arbeitskrafteuberlassung aug 2→3,
  urlaub url 16→17
- alte Quell-Staende (2020-12 bis 2025-12) mit "⚠ Alter Stand"
  in den Eintraegen markiert
- Pipeline: BATCH_LEXIS 10, SOURCES["lexis"].pdf_subdirs,
  BC_LINE_NOAUTHOR_RE + Slug-Kollisionsguard in extract_lexis()
- RUNBOOK (Batch-10-Paragraf) und Agent-Memory aktualisiert;
  --registry und --check beide gruen (635/635, 0 problems)
2026-09-16 08:52:47 +02:00
fegger 16f6591e36 docs: record rechtsprechung eval baseline 2026-09-15 16:42:49 +02:00
fegger 39d80d371e chore: consolidate local source directories 2026-09-15 15:58:22 +02:00
fegger 209a64dc53 feat(kb): ingest rechtsprechung corpus 2026-09-15 15:27:28 +02:00
fegger d53e1e64a1 [IMP] l10n_at_hr_payroll_private: add unpaid care/parental leave family (AP16)
Close the parental/care-leave block after the pilot-client scope release (8.13): six unpaid full-release kinds join the generic parental-leave work entry — Bildungskarenz (AVRAG § 11, two to twelve months by agreement with the AMS-financed Weiterbildungsbeihilfe), Familienhospizkarenz for terminal accompaniment (AVRAG § 14a, three to six months), accompaniment of seriously ill children (§ 14b, five to nine months), children's rehabilitation leave (§ 14e, four weeks per year), Pflegekarenz (§ 14c, one to three months, undivided) and the Papa-Monat (VKG § 1a, one month, creditable toward seniority under § 1a Abs 7 VKG iVm § 15f MSchG while Bildungs-/Pflegekarenz is not). All are unpaid at the employer — the external bodies pay the replacement income (AK, AMS, Bundesamt, KV-Träger) — so the new negative KARENZ_ENTGELT rule stops the employer wage per working day through the shared Tagesatz helper whose exclusion list now covers EFZG, Mutterschutz and Karenz corrections. The Versichertenmeldung run emits M4 deregistrations at the end of the pay entitlement (the day before the release begins) and M3 re-registrations at the return date — omitted when the employment itself ends — with the eSV Karenzart strings logged as protocol information pending the special DM-ORG formats (GP7 track). The fictive BMSVG basis gains the § 7 Abs 4 Z 1–3 bridge: when a new maternity prohibition follows a parental-leave stretch directly or after employment of less than three months, the reference months fall before the preceding prohibition, and a re-founded employment within three months of the ended karenziert employment uses the single last full calendar month; contributions during the KBG period are FLAF-financed (§ 7 Abs 5) and during hospice/care leave Bund-financed (§ 7 Abs 6) — no employer rule, verified by test. Pflegeteilzeit and comparable reduced-hour arrangements pay the BV contribution on the pre-reduction wage via a new version field consumed by the BMSVG basis (§ 6 Abs 4). The endabrechnung wizard gains the § 23 Abs 8 AngG full-time re-rating preview (monthly salary ÷ work_time_rate, confirmable) with § 23a Abs 4a and UEL § 10 Abs 4 UrlG guidance. The Mutterschutz status now detects the § 163 ASVG Sonderwochengeld case (prohibition inside a Karenz — the KV-Träger pays the increased sickness benefit) and warns on § 166 ASVG suspension (full for >50 % continued pay, half at 50 %, activity and Pflegekarenzgeld hints). Verified against the original statute text in .ris/ (AVRAG §§ 11/11a/14a–14e, VKG § 1a, MSchG § 15f, BMSVG § 7 Abs 4–6, ASVG §§ 163/166) and the knowledge-base sources lb-kar/elt/kzs/pap/kbg; the vacation proration of leave stretches (§ 15f Abs 2 MSchG on the hr_holidays allocation side), the eSV special formats for the Karenz art block, the full Sonderwochengeld computation and the leave-overlap policy decision remain documented open points.

Version 19.0.17.0.0 (private)
2026-09-15 14:25:48 +02:00
fegger 1f4b4ce933 length-Retry: abgeschnittene Antworten sind die q-024-Ursache, kein Thinking (D14)
- Diagnose: q-024-Flakiness war KEIN Think-Ghost (thinking-Feld leer,
  keine Tags), sondern num_predict=1024 — lange belegte Antworten
  brachen bei done_reason=length ab (3/3 Sondenlaeufe), Zitationen
  wurden unvollstaendig, CITE_RE matchte partielle IDs -> Verletzung ->
  Regenerierungs-Eskalation -> UNCERTAIN.
- Fix: num_predict 1024 -> 2048; OllamaClient.chat_full() liefert
  (content, done_reason); chat_with_length_retry() wiederholt bei
  length einmal mit 2x Budget (technischer Retry, kein Regel-
  Regenerierungszaehler) - im Antwort-, Map- und Regenerierungspfad.
- Voll-Eval (46 Fragen): Zitier-Praezision 100 %, Verweigerung korrekt
  100 % (46/46) - erstmals alle M3-Gates erfuellt; erwartete Quelle
  92,7 %; Latenz mean 39,6 s / p95 78 s (vollstaendige statt
  abgeschnittener Antworten). q-024: 4/4 stabil.
- Tests 59 -> 60. Report lokal data/eval-qwen38-lengthfix.json.
2026-09-15 14:14:27 +02:00
fegger 850e99df20 [IMP] l10n_at_hr_payroll_private: add premiums at termination under § 16 AngG (AP14-B)
Close the premium-at-termination gap of the end-of-employment cycle: an aliquote periodic premium (annual, sales, bonus, 15th payment) whose entitlement period outlasts the termination is covered by § 16 AngG — the pro-rata amount follows the ratio of the elapsed service to the entitlement period, is due for employees regardless of the termination ground (loss clauses void, 9 ObA 82/13v), while performance-linked premiums for workers may validly hinge on non-fault grounds and premiums tied to a specific service (e.g. Bilanzgeld) are not aliquote without the service (lb-end-18). Two routes: PRAM_END (bemessung sonstig) covers premiums paid with the end-of-employment run — a special payment inside the annual sixth at the flat 6 % rate with the 620 EUR free amount and 2 615 EUR free threshold checked by the core, SV as special-payment contributions (KV/PV/AV without AK/WF) against the monthly HBG and the annual SZ cap, fully payroll-levy liable and BV-contributory at the uncapped 1.53 % rate (§ 6 Abs 1 iVm Abs 5 BMSVG). PRAM_END_TARIF (bemessung laufend plus the core l10n_at_s67_abs6_ueberhang flag) covers premiums due at a pre-agreed maturity because their amount only becomes determinable after the entitlement period ends (e.g. balance-sheet premiums): taxed like running pay with the payment-month tariff without touching the annual sixth (§ 67 Abs 10, not a § 67 Abs 8 lit c case per 98/14/0009 = ARD 5483/14/2004) — the SV contribution month rolls back into the termination year via a new payslip field consumed by an extended branch of the existing SV-basis-by-Beitragsmonat override (historical caps and rates, E-MVB 044-01-00-006), while the LSt stays in the payment month. The wizard section previews the § 16 pro-rata amount from the full premium, entitlement period and elapsed service, keeps the payable amount confirmable (KB agreement), requires the service/claim-basis confirmation, enforces the contribution month for the deferred case, and lands the memo on the payslip for the separate Lohnzettel workflow (LStR Rz 911a); the existing manual PRAM rule is untouched. The account matrix posts both rules to 6230. Verified against the original statute text in .ris/ (AngG § 16, BMSVG § 6 Abs 5) and the knowledge-base source lb-end-18; the full SZ roll-forward (storno plus recomputation against the termination year's SZ annual cap) and the mBGM storno/re-transmission remain open in the GP7 payroll-reporting track, and the BV attribution of the deferred premium remains in the payment month as a documented approximation.

Version 19.0.16.0.0 (private)
2026-09-15 13:33:49 +02:00
fegger 472b19a4b2 [IMP] l10n_at_hr_payroll_private: add settlement payments under § 67 Abs 8 lit a (AP15-C)
Complete the termination sequence with the settlement-sum path: comparison sums from court or out-of-court settlements, judgment/decision arrears and dismissal-objection payments are split between the statutory-severance and voluntary-severance rules and the settlement remainder. The remainder (VERGLEICH, bemessung neutral, sv_art laufend) reuses the lit-a/b fifth rule: after deducting the § 62 employee-rate contributions, one fifth stays tax-free capped at one fifth of nine times the monthly HBG (12 474 EUR 2026), and the remaining four fifths run with the payment-month tariff without touching the annual sixth. A new rule flag l10n_at_vergleich_bv marks the part paid for periods with a BV-Kasse entitlement: up to the parameterised cap at_lst_67_abs8_vergleich_bv (7 500 EUR 2026; § 67 Abs 8 is § 33a/§ 124b indexed) it is taxed at the flat 6 % rate with the contributions allocated pro rata (LStR Rz 1102b), while the excess falls back into the fifth rule. Both settlement rules stay payroll-levy liable (§ 41 Abs 4 lit b FLAG exempts only § 67 Abs 3 and 6) and SV-liable in the payment month, with per-Beitragsmonat roll-forward and insurance-period extension remaining documented manual options (lb-end-22, E-MVB 011-02-00-001). Identifiable severance components keep running through the existing statutory and voluntary severance machinery; a settlement expressly agreed as statutory severance is taxed in full under § 67 Abs 3 (VwGH 2013/13/0001 = ARD 6490/20/2016), and pension buy-outs (lit e) and social-plan payments (lit f) are out of scope. The wizard section requires confirmation of the settlement's itemisation and contested-claim status plus the BV entitlement, enforces the BV cap with the excess captured as remainder, and previews the free fifth, tariff basis and 6 % tax; the settlement memo lands on the payslip for the separate Lohnzettel workflow (LStR Rz 911a). The account matrix posts both settlement rules to the provisional 6200/6000 (workers 6000) and the new tax rule to 3540. Verified against the original statute text in .ris/ (EStG § 67 Abs 8 lit a) and the knowledge-base sources lb-end-21/22; KZ positioning of the lit-a tariff parts and their § 291d pot allocation remain documented verification points against LStR Rz 1087 ff.

Version 19.0.15.0.0 (private)
2026-09-15 12:38:19 +02:00
fegger 4b86bcb790 [IMP] l10n_at_hr_payroll_private: add voluntary severance under § 67 Abs 6 (AP15-B)
Split the voluntary severance into its privileged part and a tariff remainder on the exit run: the privileged part combines the quarter rule (1/4 of the last twelve months' running pay, capped at nine times the monthly HBG) with the twelfth rule (2/12 to 12/12 by proven service, capped at n × 3 × HBG), reduced per Z 3 by severance already received and the statutory claim due at this termination, all taxed at the flat 6 % rate. The excess runs as its own rule flagged l10n_at_s67_abs6_ueberhang: taxed with the running tariff of the payment month but excluded from the annual sixth, since Z 5 exempts only the Z 1/Z 2 amounts and the excess is a special payment, not running pay. The twelve-month basis aggregates validated prior runs plus own lines, excluding the flagged excess and § 26 Z 4 travel overhang via a dedicated rule flag. Free of SV (§ 49 Abs 3 Z 7 ASVG), payroll levies regardless of the 6 %/tarif split (§ 41 Abs 4 lit b FLAG, § 122 Abs 8 WKG, § 5 Abs 2 lit b KommStG) and BV contributions; the former BV-Anwartschaft exclusion Z 7 is repealed (BGBl I 118/2015). The wizard proposes the rolling basis and the statutory claim, previews Z 1/Z 2/reduction/privileged/excess/tax and requires explicit confirmation against claim-conversion risk. The § 291d EO termination pot nets both severance wage-tax rules; key 260 now includes LST_ABF_FREI. Verified against the original statute text in .ris/ (EStG § 67 Abs 6) and the knowledge-base sources lb-end-12/13/15; KZ positioning of Abs-6 amounts and the excess's § 291d pot allocation remain documented verification points against LStR Rz 1087 ff.

Version 19.0.14.0.0 (private), 19.0.10.0.0 (core)
2026-09-15 11:34:09 +02:00
fegger 23a5ef74dc Stufe 2: Antworttyp-Routing — Survey Map-Reduce + Rueckfrage-Regel (D13, M6)
- Planer liefert jetzt type: survey|specific. Survey-Fragen (Uebersicht
  ueber viele Dokumente) laufen ueber Map-Reduce: Retrieval auf
  survey_blocks=16 erweitert, ein Map-Call destilliert JE Block als
  Stichpunkte mit seiner KB-ID (MAP_SYSTEM_PROMPT), ein Reduce-Call
  synthetisiert die Endantwort. Grounding unveraendert: Zitier-Validierung
  strikt ueber die Retrieved-Union; leerer Map-Output -> Fallback auf
  Einzelantwort.
- Systemprompt-Regel 9: haengt die Antwort wesentlich von nicht genanntem
  Kontext ab (Branche, Bundesland, Zeitraum), belegte allgemeine Aussage
  plus EINE Rueckfrage statt Verweigerung (API-first; Odoo-Chat kann die
  Rueckfrage als Follow-up nutzen).
- Ergebnis: q-029 (WIKU-Survey, bisher hartnaeckigste Fehlverweigerung)
  geheilt - Teilantwort mit 5 belegten Heften; q-015 antwortet mit
  expliziter KV-Abhaengigkeit + Rueckfrage statt Branchen-Noise.
- Eval (46 Fragen): Zitier-Praezision 97,8 %, Verweigerung 97,8 % (Gate
  erfuellt), erwartete Quelle 90,2 %, Latenz mean 34,2 s (Map-Reduce nur
  bei Survey-Fragen, ~95 s). Report lokal data/eval-qwen38-stage2.json.
- Tests 57 -> 59 (Survey-Integration, Typ-Parsing).
2026-09-15 11:16:53 +02:00
fegger 9add58fe83 [IMP] l10n_at_hr_payroll_private: add statutory old-system severance (AP15-A)
Pay the pre-2003 AngG severance from the end-of-employment run as its own neutral benefit line: free of SV (§ 49 Abs 3 Z 7 ASVG) and payroll levies, outside the annual sixth, and collected into the § 291d EO termination pot net of its own wage tax. Taxation follows the binding better-of rule of § 67 Abs 3 EStG: multiple-of-method (tariff wage tax on the running monthly wage × the statutory multiple of the payout) versus the flat 6 % rate, applied mandatorily in favour of the employee. The tariff wage tax is captured as a separately confirmed value instead of deriving it from gross pay through the § 62 engine. The wizard enforces § 23a Abs 3 AngG (parental exit needs five uninterrupted years), blocks BMSVG-new contracts except frozen claims and validates AGRD 02/06 against the claim type. The LNK basis subtracts § 67 Abs 3/6 rules only when they actually run in the tax base, the L16 generator reports LST_ABF in key 260 outside 210/220, and result_rules access in the garnishment paths avoids DefaultDictPayroll materialisation. Verified against the original statute texts in .ris/ (AngG §§ 23/23a, EStG § 67 Abs 3).

Version 19.0.13.0.0 (private), 19.0.9.0.0 (core)
2026-09-15 11:01:55 +02:00
fegger aa7adfd464 Stufe 1: komplexe Fragen via Query-Planer, Per-Query-Slots, Scope-Filter (D12, M6)
- Query-Planer (agent/query_planner.py): Heuristik-Gate (Jahr, Vergleichs-/
  Aggregationsmarker, Laenge) entscheidet ueber einen kleinen LLM-Call,
  der komplexe Fragen in 1-3 Sub-Queries zerlegt (JSON, temp 0; Fehler ->
  Original als Einzel-Query). Je Sub-Query optional stand_year und scope.
- Multi-Query-Retrieval: je Sub-Query BM25+Dense mit RRF-Summe;
  Per-Query-Slots (2 je Sub-Query) sichern jeden Frageaspekt im Kontext
  (sonst dominieren Eintraege, die in mehreren Sub-Queries mittelgut
  matchen — q-113-Befund). Scope-Filter: 'gesetz' (nur Lexis/WIKU/RIS)
  und 'kv' (nur Branchen-KV) mit Fallback auf unscoped bei leerem
  Ergebnis. Temporal-Intent: stand_year + temporal_boost (default 0,
  FTS-jahr-Tag-Signal reichte).
- Grounding unveraendert: eine Retrieved-Menge (Union), eine Antwort,
  Post-Validierung ueber die Union, Verweigerungspflicht unveraendert.
- Goldset 42 -> 46: q-110 (Temporal 2023; 2024er-Lohnordnung existiert
  im Korpus nicht - Mantelvertrag ohne Lohntabelle, korrekt verweigert),
  q-111 (2025), q-112 (Abfertigung-Vergleich), q-113 (Gesetz+KV).
- Eval (46 Fragen): Zitier-Praezision 97,8 %, Verweigerung 97,8 %
  (Gate >94,3 % erfuellt), erwartete Quelle 90,2 %, Latenz mean 33,5 s.
- Tests 50 -> 57. Reports lokal: data/eval-qwen38-stage1*.json.
  API-first festgehalten (D13-Vorbereitung): Odoo bleibt duenner Client;
  Lohndaten-Zugriff in M4 erfordert Privacy-Neubewertung.
2026-09-15 09:58:25 +02:00
fegger 4687cd4792 Tuning: Prompt-Budget + cross_ref-Erweiterung heilt Fehlverweigerungen (D11)
- Ursache der 4 Fehlverweigerungen nach KV/RIS-Erweiterung: lange
  KV-Chunks ueberlieferten num_ctx=16384 (bis 62,7 KB Prompt) — Ollama
  trunciert den Systemprompt vorn, das Modell verliert die Zitierregeln
  ('Block-N'-Zitate statt IDs -> Regenerierung -> Verweigerung).
- Fix: num_ctx 32768; trim_results (max_context_chars=90.000, niedrig
  gerankte Bloecke ganz weglassen statt truncieren, Mindestbestand 6);
  cross_ref_expand 3 -> 6 (Top-3 sind oft Branchen-KV-Bloecke mit leeren
  cross_refs - kuratierte Nachbarn kamen sonst nie nach).
- Eval: alle 4 Faelle geheilt, 10/10 Bestaetigungslaeufe OK.
  Retrieval Recall@8 0,851 -> 0,946 (cross_ref-Extras bringen
  Expected-IDs nach). Antworten: Zitier-Praezision 97,6 %, Verweigerung
  97,6 % (>94,3 %-Gate), erwartete Quelle 83,8 -> 91,9 %, Latenz mean 33 s.
- Tests 49 -> 50 (trim_results); Reports lokal (data/eval-*).
2026-09-15 08:31:02 +02:00
fegger 7fb569b7cf Retrieval-Kalibrierung nach Korpusverdopplung (D10) + Goldset-Erweiterung
- Hybrid-Fusion um dense_weight erweitert; kalibriert per Goldset-Sweep:
  dense_weight=2.0 (BM25 durch KV-S-Titel-Matches inflationiert),
  rrf_k=20, candidate_pool=150 -> Recall@8 0,851 -> 0,923 (>0,9),
  Hit-Rate 0,973, MRR 0,667. ENV: PV_DENSE_WEIGHT/PV_RRF_K/
  PV_CANDIDATE_POOL.
- CITE_RE um kv|ris erweitert (Post-Validierung deckt neue ID-Raeume).
- Goldset: +6 KV/RIS-Fragen (q-101-106) + Branchen-Refusal r-005;
  q-021 auf lb-kar-04 rekalibriert (Top-1, deckt Beginn/Dauer voll -
  dokumentiert im Note).
- Antwortmodus-Eval (qwen3.8:27b, 42 Fragen): Zitier-Praezision 95,2 %,
  Verweigerung 90,5 % - unter den M3-Gates, Tuning folgt
  (Report data/eval-qwen38-kvris.json, lokal).
- Docs: agent/README.md Baseline, planung.md Umsetzungsstand,
  .agents/MEMORY.md (D9/D10, offene Punkte).
2026-09-15 07:45:04 +02:00
fegger 97aa3c1c82 KV/RIS-Erweiterung: 614 WKO-KV-Dokumente + 59 RIS-Gesetze (D9)
- Korpus 601 -> 1274 Layer-2-Eintraege: kv-kvt-001...614 (ein Cluster
  kollektivvertraege, Branche als Tag) und ris-<cluster-prefix>-nn auf
  der bestehenden Cluster-Map + 7 neue Cluster (zvr/avr/agg/lst/abo/
  nso/kvt); LAW_MAP dokumentiert die 59 Gesetz-Zuordnungen.
- kv/ris-Eintraege sind quellentreu generiert (D9) - Gesetze sind
  amtliche Werke, KV-Lohntabellen zahlenexakt; Tool-Output in
  tools/ (ingest_sources.py, build_registry.py, kb_common.py),
  eingefrorene ID-Kataloge tools/catalogs/*.json (nur Metadaten).
- kb.json/INDEX.md regeneriert (1274 Eintraege, 76 Cluster);
  agent/kb.py: ID-Raeume kv|ris, source akzeptiert html-only.
- Tests 41 -> 49 (Konverter, LAW_MAP-Abdeckung, neue ID-Raeume,
  Korpus-Integrationszahl).
2026-09-15 07:44:56 +02:00
fegger b3e8e47cdd Prompt v2 + Kontext-Section-Prioritaet: Fehlverweigerungen behoben (D8)
Diagnose: q-008 bekam die 'Verweise'-Navigationssektion von lb-end-03 als
Kontext (BM25-Langennormalisierung bevorzugt duenne Chunks) -> inhaltlose
Bloecke -> korrekte Verweigerung nach Regel 4. q-031 enthaelt eine falsche
Praemisse (kein 'Mindestlohngesetz' in Oesterreich; Wissensbasis sagt:
kein gesetzlich betraglich festgelegtes Mindestentgelt).

Fixes: (a) retrieve.py _representative_chunk - pro Eintrag beste Inhalts-
sektion (Zusammenfassung > Kernwerte > Rechtsgrundlagen > Payroll >
sonstige > Verweise), Section-Swap aus dem Index falls nur 'Verweise'
rangiert; (b) generate.py Prompt v2 - Regel 4 erlaubt Teilantworten,
Regel 8 verlangt Prämisse-Korrektur mit Muster-Beispiel.

Bestaetigungslauf qwen3.8:27b (35 Fragen): Zitier-Praezision 100 % (8
Regenerierungen, alle geheilt), Verweigerung korrekt 94,3 %, erwartete
Quelle 83,9 % (v1 80,6 %), mean 34 s. q-008 + q-031 behoben; verbleibender
bekannter Fall q-029 (breite Survey-Frage, sicherer Fehlermodus).
Retrieval-Metriken unveraendert (Recall@8 0,952). 41 Tests gruen.
2026-09-15 00:22:41 +02:00
fegger 9e1d2fd2b0 Bake-off ergaenzt: muse-glimmer:latest (Rang 5 von 6)
Nach User-Wunsch im selben Protokoll gemessen (35 Goldset-Fragen):
100% Zitier-Praezision bei nur 1 Regenerierung (diszipliniertestes
Modell), aber 8/35 falsche Verweigerungen (Ueberverweigerung teils trotz
vorhandener Zitate) und 37,5s mean - schlaegt qwen3.8:27b in keiner
Kennzahl. D7 unveraendert: qwen3.8:27b bleibt fixiert.
2026-09-14 23:55:45 +02:00
fegger 263bbd2cac M3 Bake-off abgeschlossen: qwen3.8:27b als Antwortmodell fixiert (D7)
Alle 5 Kandidaten auf dem Goldset (35 Fragen, Antwortmodus) gemessen.
Protokoll Zitier-Praezision > Verweigerungskorrektheit > Latenz:

  qwen3.8:27b   100% / 94,3% / 80,6%  32s  -> Sieger, fixiert
  gemma4:26b    100% / 91,4% / 67,7%  7,9s -> Latenz-Kandidat (4x schneller)
  gemma4:12B    94,3% / 91,4% / 77,4%  21s
  qwen3.6:27B   94,3% / 85,7% / 80,6%  43s
  mistral-small3.1:24b 100% / 71,4% / 58,1%  20s

mistral-Deutsch-Hypothese praktisch widerlegt (71,4% Verweigerungs-
korrektheit). q-008/q-031 verweigern beide Finalisten -> Prompt-/
Retrieval-Tuning, nicht modellspezifisch. Tabelle in planung.md 13,
README und MEMORY aktualisiert.
2026-09-14 23:30:36 +02:00
fegger 4fa98b7e82 Bake-off M3: qwen3.8 vs qwen3.6 gemessen; Topologie korrigiert (Remote-GPU-Maschine)
Zwischenstand Bake-off (Antwortmodus, 35 Goldset-Fragen):
qwen3.8:27b 100% Zitier-Praezision / 94,3% Verweigerung korrekt / 32s;
qwen3.6:27B 94,3% / 85,7% / 43s (10 Regenerierungen) - klar schwächer.

Topologie korrigiert: 100.103.83.12:11435 ist die Remote-GPU-Maschine
(Tailscale, R9700), NICHT dieselbe wie die Dev-Maschine (deren localhost:
11434 ist ein eigener, fast leerer Ollama; URL-Nicht-auf-11434-Korrigieren
in Skill/README/Config präzisiert). bge-m3 auf der GPU-Maschine gepullt.

gemma4:26b-Lauf brach ab: auf der GPU-Maschine sterben seit dem Crash
alle llama-server-Loads (API 500 'exit status 1'), auch bge-m3. Neustart
dort noetig: sudo systemctl restart ollama. Danach mistral-small3.1:24b
und gemma4:12B ausstehen.
2026-09-14 22:42:54 +02:00
fegger 50e62509e6 Ollama-URL korrigiert (100.103.83.12:11435) und M1/M2 gegen Echt-System validiert
Der Host betreibt zwei Ollama-Instanzen: 11434 (fast leer, 0.16.2) und
11435 (Ziel-Instanz, 0.32.13, Modell-Zoo) — Port nicht mehr auf 11434
'korrigieren' (Dokumentation + Skill + Config-Default angepasst).

Validierung gegen das echte System: bge-m3 per API gepullt, Hybrid-Index
(3005 Chunks, 100 % eingebettet, 144 s), M1-Akzeptanz erreicht (Recall@8
0,952 > 0,9; Hit-Rate 0,968). Antwortmodus-Eval mit qwen3.8:27b (Thinking
verifiziert aus): Zitier-Präzision 100 % (4 Regenerierungen), Verweigerung
korrekt 94,3 %, Latenz mean 32 s. ATZ-Konfliktfall korrekt beide Werte
mit Warnung. generate.py: sources enthaelt jetzt nur zitierte Quellen;
Systemprompt ohne redundante Quellenzeile.

Bake-off-Feld (M3) bereits installiert: qwen3.6:27B, gemma4:26b,
mistral-small3.1:24b, gemma4:12B.
2026-09-14 22:09:09 +02:00
fegger cf16426f5f M1+M2: RAG-Pipeline mit verbindlichem Grounding
agent/-Paket: Ingest (601 Layer-2-Eintraege -> 3005 Chunks, FTS5-BM25 +
Vektoren-Cache), Hybrid-Retrieval (RRF, Stand-Boost, cross_ref-Erweiterung),
Ollama-Client (embed/chat, think-Flag-Fallback, kurzes Connect-Budget),
Systemprompt mit Zitierpflicht, Post-Validierung (zitierte IDs gemaess
Retrieved-Set, 1x Regenerierung, dann Verweigerung), FastAPI (/ask, /health,
/reindex), CLI, Goldset (31 Fragen, IDs gegen kb.json verifiziert, inkl.
ATZ-Konfliktfall + 4 Verweigerungsfaelle), Eval-Suite, Test-Chat.

41 Offline-Tests gruen. Baseline BM25-only: Hit-Rate 0,871 / Recall@8 0,855 /
MRR 0,476. Hybrid-Messung, Antwortmodus-Eval und Modell-Bake-off (M3) auf
dem Host ausstaendig (Ollama aus der Zed-Sandbox nicht erreichbar).

MEMORY.md und planung.md Umsetzungsstand aktualisiert.
2026-09-14 16:53:04 +02:00
fegger b5ca81abab Planung und Skills für den Wissensbasis-RAG-Agenten
planung.md: Architektur (schlanker RAG-Service, SQLite-Index, Hybrid-Retrieval),
verbindliche Grounding-Regeln, Modell-Bake-off M3 (qwen3.8:27b, qwen3:32b,
gemma3:27b, mistral-small3.2:24b, qwen3:14b als Latenz-Untergrenze),
Meilensteine M1-M4 und Odoo-Integrationsoptionen.

.agents: neuer Skill pv-rag-agent (verbindliche Regeln für die Implementierung)
sowie bestehende Projekt-Skills (agent-memory, wissensbasis,
odoo19-development, opendataloader-pdf).
2026-09-14 16:34:13 +02:00
fegger 9d141eed9a Initialimport: Wissensbasis Layer 2 (601 kuratierte Einträge)
571 Lexis-Briefings (lb-*) + 30 WIKU-Publikationen (wk-*) in 69 Clustern,
Frontmatter-Schema als Single Source of Truth; kb.json + INDEX.md generiert.
.gitignore für lizenzierte/lokale Corpora (.lexis360, .wiku, .firecrawl, .ris)
sowie künftige RAG-Artefakte (data/).
2026-09-14 16:34:07 +02:00
fegger ee94f4664f [IMP] l10n_at_hr_payroll_private: add end-of-employment payroll cycle (AP14-A)
Pay the untaken vacation, dismissal compensation, time balances and open advances from one exit run. The vacation replacement splits natively into a running and a special-payment component per § 67 Abs 8 lit d, only the running part extends the mandatory insurance under § 11 Abs 2 ASVG with sequential windows (dismissal compensation first) and daily-value ceilings. Dismissal compensation follows the one-fifth rule of § 67 Abs 8 lit b without raising the annual sixth, stays fully social-insurable by allocation over the notice period and fully subject to payroll taxes. Advances are offset against net pay only (§ 293 Abs 3 EO) and time credits carry the 50 % statutory surcharge without § 68 relief. Verified against the original statute texts in .ris/; § 67 Abs 6 lump-sum payments are deliberately deferred to AP15.
2026-09-14 16:08:44 +02:00
fegger 9ff977e0d4 [IMP] l10n_at_hr_payroll_private: add Pendlerpauschale, Pendlereuro and job ticket data (AP13-B)
Model commuter declarations as effective-dated L 34 records so monthly changes, L 34/Pendlerrechner evidence and historical payslip reproduction stay auditable. PP enters as an aliquoted § 66 freibetrag of the running tax base while PE joins the annual absetzbetraege, matching the cumulative engine's rollup. Ticket handling follows § 26 Z 5: employer ticket costs reduce PP pro rata (lit i), Werkverkehr is data-driven via the residual route and salary conversion does not block PP/PE. Also register the AP13-A tests that were accidentally left out of the previous commit.
2026-09-14 14:47:23 +02:00
fegger 3f307a0688 [IMP] l10n_at_hr_payroll_private: add domestic travel expenses (AP13-A)
Use Odoo's payroll expense reconciliation flow so documented employee-paid travel expenses remain linked to their payslip and payable settlement. Classify only the excess over the verified domestic tax-free limits as running remuneration, avoiding both unpaid expense reimbursements and double payment.
2026-09-14 13:42:06 +02:00
fegger 91ac9e5fda [IMP] various: record AP12 completion and ignore RIS cache 2026-09-14 13:20:38 +02:00
fegger 8efea77b6c [IMP] l10n_at_hr_payroll_private: Sachbezüge (AP12) 2026-09-14 12:22:15 +02:00
fegger 018554b215 [IMP] l10n_at_hr_payroll_private: Lohnpfändung — Existenzminimum § 291a EO, DN-Abzug, Kostenersatz, DSE (AP11)
Pfändungs-/Exekutionsmaschinerie nach EO §§ 291/291a/292/301/302/
292h für den Privatwirtschafts-DN (Plan:
personalverrechnung/PLAN-Restluecken-AP11.md §AP11, MVP + Kostenersatz):

- Neues Modell l10n.at.payroll.pfaendung (models/pfaendung.py):
  Gläubiger, Vollstreckungsträger, Pfändungsart, Zustellungsdatum,
  Forderungshöhe, Status aktiv/gesetzt/geloest, Verwalter
  (§ 301 Abs 1 Z 6), 4-Wochen-Zahlungssperre (§ 304),
  Kostenersatz-Variante (§ 292h), DSE-/Auszahlungsfristen (computed),
  Rang nach Einlangedatum, Constraint Löse-/Zustellungsdatum;
  hr.version: l10n_at_unterhaltspflichten (0–5) und
  l10n_at_sz_anspruch (§ 291a Abs 2 Z 1/Z 2); hr.salary.rule:
  Flags l10n_at_pfandung_unpfandbar (AP12-Schnittstelle) und
  l10n_at_pfandung_beendigung (AP14/15-Schnittstelle)
- Engine (hr.payslip): Existenzminimum-Maschine § 291a EO je Topf
  (laufend/sz13/sz14/beendigung), Pfändungsberechnungsgrundlage
  § 291 EO (laufend = Bezüge − unpfändbar − SV-DN − LSt),
  Masse, Kostenersatz § 292h (2 %/max 8 € + 1 %/max 4 €, nie vom
  Existenzminimum), Regeln PFAENDUNG (seq 75) / PFAENDUNG_SZ (seq 76);
  result_rules enthält ungerundete Rule-Summen — Lesezugänge
  runden auf Cents (Zeilenbeträge), sonst 1-Cent-Drift
- Parameter at_eo_azr (2025: 1.273,99 / 2026: 1.308,39 €) und
  at_eo_kostenersatz; DSE-Report (qweb-pdf auf hr.employee),
  Views/Menu unter Payroll-Wurzel, Security (payroll-Groups +
  Company-ir.rule)
- Rechenfälle docs/rechenfaelle/pfaendung.md (RF-PFA-1…7):
  lb-pfa-03 exakt verifiziert (33.840 € → EX 16.684 € /
  pfändbar 17.156 €); 103/103 Tests grün
- Offene Reste dokumentiert: Unterhaltsexekution 75 %/Koinzidenz,
  Vorschüsse § 290c, Sachbezüge (AP12), Beendigungs-Regeln (AP14/15),
  2027-AZR-Werte

Version 19.0.9.5.0
2026-09-13 02:33:26 +02:00
fegger c3b9d6eb8e [IMP] l10n_at_hr_payroll_private: Arbeits- und Entgeltbestätigungen BEST AK/AW — SART 70/71 Kranken-/75/76 Wochengeld (AP8)
Satzstrukturen PDF-verifiziert aus DM-ORG 42.7.0 (ODL, Pages
493-505; Positionsketten lückenlos): G.10 AEB-Krankengeld v12
(SART 70/71, BEST AK, 111 Felder, Satzlänge 1392) und G.11
AEB-Wochengeld v10 (SART 75/76, BEST AW, 64 Felder, 1048).
Die .txt-Extraktion des DM-ORG ist unzuverlässig (Feldversatz).

- Neues Modell l10n.at.payroll.aeb (models/aeb.py): Episode
  (verhinderung_von/bis), KZKU, Storno über storno_id (E.10.2.1:
  nur Fehler/BMGL-Änderung), REFN/Datei/Prüfprotokoll; Erzeugung
  auf dem ELDA-Bestands-Framework (Vorlauf/Schluss/Satzlängen-
  selbstkontrolle)
- EFZ-Refaktur: Phasen-Karte nach hr.version verschoben
  (_l10n_at_efz_arbeitsjahr_start/_l10n_at_efz_phasen/
  _l10n_at_efz_stufe_am) — Payslip-Status (AP4) und AEB teilen die
  Maschine; _at_efz_status-Verhalten durch Tests gepinnt
- Fachdaten Krankengeld: AEFZ (Anspruch in Wochen), JAGU=1
  (Arbeitsjahr), TAGU=2 (Kalendertage), Teilentgelt TPR/TVO/TBI
  je Phase, Vorerkrankungen ANV/ANB vor der Episode, VENT
  (Voll-Phase-Ende), Bezugsblöcke BVO/BBI/BBE + BSUM aus den
  vollen Monatsläufen vor der Episode, SZKZ datengetrieben
- Fachdaten Wochengeld: AVER (Ø-Netto der drei Referenzmonate,
  § 162 Abs 3 ASVG — AP7-Logik), AVON/ABIS, ANGV=K (kein
  Fortbezug), AGRD-Validierung nach D.22 (SART 75/76 nur
  02/03/04/05/06/10/22/24; unzulässige geleert + Protokoll)
- Fund: L10nAtEldaSatz.setze(None) übernimmt die Grundstellung
  nicht — Felder nur per Leerstring aktiv leeren
- 4 Tests: SART 70 mit 76-Tage-Episode (AEFZ 06, TPR1 50,
  TVO1 13.10.2026, VENT 12.10.2026, Bezugsblock), SART 75 mit
  AVER/AVON/ABIS, Storno 76 (REFN -ST, Kerndaten des Originals),
  AGRD-Validierung
2026-09-12 23:52:11 +02:00
fegger 802f2ef04c [IMP] l10n_at_gemeinde_payroll: Autor im Manifest korrigiert (Florian Egger) 2026-09-12 23:29:08 +02:00
fegger e20de9d543 [IMP] l10n_at_hr_payroll: Autor im Manifest korrigiert (Florian Egger) 2026-09-12 23:29:08 +02:00