- README, the note (abstract, introduction, section 10), the two-page summary and the slides now point to the plugin dynamisk-rettsstat, with link. The slides get a new slide 16 about it (17 slides in all); the summary gets a box with both links and stays on two pages. - New limitation in section 10: in the models with a court queue the starting point is close to, but not exactly, an equilibrium. Without any shock crime drifts from 1.000 to 1.018 and the processing time from 3.0 to 4.6 months over 240 months. No numbers, tables or figures change. - PDFs rebuilt: note 59 pages (was 58), summary 2, slides 17 (was 16). - sim.py, diagnose.py, forlop.py and paper/data are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
4.5 KiB
4.5 KiB
den-dynamiske-rettsstaten
Context
Concept note (Norwegian, LaTeX) and its simulation code. The principle: enforcement effort should track how much, and how seriously, laws are actually broken. Published as open, non-commercial material. Readers are Norwegian, so README and paper are in Norwegian (bokmål); CLAUDE.md and code comments may stay as they are.
Stack
paper/sim.py: Python 3, numpy + scipy (pinned inrequirements.txt). Writespaper/data/*.dat, which pgfplots in the LaTeX source reads.paper/*.tex: LaTeX.main.texandnotat.texbuild with pdflatex,karusell.texwith xelatex (font Inter from TeX Live).main.tex= the note (inputspart1-part4,refs),notat.tex= 2-page summary,karusell.tex= slides. Sharedpreamble.tex. Bibliography is a hand-writtenthebibliographyinrefs.tex.pdf/: the published PDFs. They are build output committed on purpose; rebuild and replace them together with source changes.
Conventions
- The core sentence must be quoted verbatim everywhere: «Innsatsen for å håndheve lover og regler bør løpende stå i forhold til hvor mye, og hvor alvorlig, de faktisk brytes.» Short form of the clarification: «Straffebud og strafferammer ligger fast.»
- Any change to
sim.pymust keeppaper/data/byte-identical unless the change is meant to alter results; then text, figures and PDFs change in the same commit. - Licensing is split: text (
pdf/,paper/*.tex,README.md,CHANGELOG.md,CLAUDE.md) is CC BY 4.0 (LICENSE-CC-BY-4.0.txt); code and data (paper/sim.py,paper/diagnose.py,paper/forlop.py,paper/eksempel_domstol.json,paper/norge_2025.json,requirements.txt,paper/data/) are MIT (LICENSE). New files follow the same split. - Never commit working documents;
private/is ignored for that purpose.
Commands
- Setup:
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt - Run simulation (about 2 min, from
paper/):../.venv/bin/python sim.py - Bottleneck diagnosis from own numbers (stdlib only, from
paper/):python3 diagnose.py eksempel_domstol.json; must reproduce section 9.5 (utilization 1,28, +19 % capacity).python3 diagnose.py norge_2025.jsonmust match the table in README (1,09 / 1,04 / 0,88 / 1,09). - Time course and stability check from own numbers (needs the venv, from
paper/):../.venv/bin/python forlop.py eksempel_domstol.json; must reproduce section 9.5 and table 10 (critical delay 7,2; +19 % now, +12 % after 12 months, capacity 137,9 = 1,31; with measures 8,3 / 0,74 / 1,10 / +31 % / 3,5; without 68,7 / 0,65 / 1,26). A copy of the example withrestanse3000 for Domstol must give a course that starts at 3 000 (first decision +119 %, asdiagnose.py).forlop.pyimportssim.pyand must never require a change there. It has its own copy of thesimulate_endoloop (simuler, policieskoordandschedonly) so that the backlog in the file can be put in directly; every run checks that the copy matchessimulate_endobit for bit, so a change tosimulate_endomust be mirrored insimuler. - Reproduction check after a run:
git status paper/datashows no changes (verified 2026-11-10: 22/22 files identical with Python 3.14.0, numpy 2.5.4, scipy 1.18.1) - LaTeX build (from
paper/, TeX Live 2026 in/Library/TeX/texbin):pdflatex main.texandpdflatex notat.texthree times each,xelatex karusell.textwice; copy topdf/(verified 2026-11-11: main 59 pages, notat 2, karusell 17, no undefined references). Build in a scratch copy ofpaper/to keep aux files out of the repo, and give each run a time limit: one pdflatex run has been seen to hang.
Workflow
- Published at
https://git.fromaitochitta.com/open/den-dynamiske-rettsstaten. Visibility, description and moves are the operator's decisions. - Run the repo-standard gate before pushing changes to
README.mdor the files the standard requires. - The plugin
dynamisk-rettsstat(https://git.fromaitochitta.com/open/dynamisk-rettsstat, locally~/repos/ktg-plugin-marketplace/dynamisk-rettsstat) carries unmodified copies ofpaper/sim.py,paper/diagnose.pyandpaper/forlop.pyfrom commit2badc25, pinned by sha256, plus reference output built from them. A change to any of the three files here must be followed by a sync there (the plugin'sCLAUDE.md, Conventions). Text-only changes here need no sync, but check what the plugin's README anddocs/forbehold.mdsay about the note. notat.texmust stay on 2 pages; it is tight (margins and list spacing were reduced on 2026-11-11 to fit the box about the plugin). Check the page count after any change.