103 Commits
Author SHA1 Message Date
adminandClaude Opus 5.5 61c5d71d2c Fetch private dredd-core from the Haski Gitea, not GitHub
CI / infra-matrix (full) (push) Successful in 2m26s
CI / backend (17) (push) Successful in 12m23s
CI / ocr-license (push) Successful in 26s
CI / managed-db (push) Successful in 8m44s
CI / infra-matrix (bare) (push) Successful in 1m6s
CI / backend (16) (push) Successful in 12m33s
CI / compose-smoke (push) Successful in 3m30s
The Dockerfiles still rewrote credentials for github.com only, so the build
token never reached Gitea and installs worked only while dredd-core was
public. Rewrite http://77.216.148.202:3000/ instead, give every workflow
that pip-installs the same rewrite (org secret DREDD_CORE_TOKEN, the
read-only haski-reader token), and drop the GitHub PAT leftovers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:18:27 +01:00
adminandClaude Opus 5.5 127e3a857e CI: allow a manual run (Actions -> CI -> Run workflow)
CI / backend (16) (push) Successful in 14m36s
CI / backend (17) (push) Successful in 14m10s
CI / compose-smoke (push) Successful in 1m17s
CI / managed-db (push) Successful in 10m25s
CI / ocr-license (push) Successful in 2m24s
CI / infra-matrix (full) (push) Successful in 2m48s
CI / infra-matrix (bare) (push) Successful in 1m50s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:06:29 +01:00
adminandClaude Opus 5.5 4853393865 CI: push runs only on main; branches are tested through their pull request [skip ci]
A push of many branches at once (the migration pushed 100 of Atrium's) started
a run per branch and flooded the runners. Every pull request is still tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 16:38:58 +01:00
adminandClaude Opus 5.5 086f45f48c test: the memory probe reads its own peak (VmHWM), not ru_maxrss
CI / backend (16) (push) Successful in 15m32s
CI / infra-matrix (bare) (push) Successful in 3m2s
CI / infra-matrix (full) (push) Successful in 2m45s
CI / compose-smoke (push) Successful in 4m22s
CI / ocr-license (push) Successful in 2m6s
CI / backend (17) (push) Successful in 15m10s
CI / managed-db (push) Successful in 10m56s
On Linux ru_maxrss is carried over from the parent across fork+exec, so in a
full pytest run (the pytest process at ~340 MB) the probe reported ~340 MB
before it had done anything; run alone it passed. bb7c540 blamed coverage for
that, wrongly. The probe now reads VmRSS/VmHWM from /proc/self/status, which
start over at exec: under a 400 MB parent it reports 40 MB (10 MB document)
and 55 MB (200 MB document).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 12:56:21 +01:00
adminandClaude Opus 5.5 3869992257 deps: numpy 2.3.5, so the OCR extras install again
CI / backend (16) (push) Failing after 12m32s
CI / backend (17) (push) Failing after 11m45s
CI / infra-matrix (bare) (push) Successful in 1m22s
CI / infra-matrix (full) (push) Successful in 3m21s
CI / managed-db (push) Failing after 8m52s
CI / compose-smoke (push) Canceled after 0s
CI / ocr-license (push) Canceled after 0s
paddleocr 3.7.0 needs paddlex 3.7.x, and every paddlex 3.7.x needs numpy<2.4;
with numpy 2.5.4 (pinned since dd8d769) requirements-ocr.txt could not be
resolved, so the OCR image could not be built and the ocr-license job had
been red since. 2.3.5 is the newest numpy below 2.4; onnxruntime 1.31 accepts
it, and the license gate passes on the OCR set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 11:12:03 +01:00
adminandClaude Opus 5.5 bb7c540259 test: the memory probe measures the importer, not the harness
Under pytest --cov the probe subprocess ran with coverage tracing (peak ~340 MB
for the 200 MB document), and glibc's per-core malloc arenas added their own
retained pages on a 6-core runner. The probe now runs without the coverage
environment and with MALLOC_ARENA_MAX=1 (~42 MB vs ~62 MB); the growth bound
is 32 MB instead of 16. The old whole-body path was ~700 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:41:26 +01:00
adminandClaude Opus 5.5 c577b77de3 Build from Gitea instead of GitHub
CI / infra-matrix (full) (push) Successful in 2m33s
CI / backend (16) (push) Failing after 11m29s
CI / backend (17) (push) Failing after 11m35s
CI / infra-matrix (bare) (push) Successful in 1m7s
CI / managed-db (push) Failing after 8m7s
CI / compose-smoke (push) Successful in 4m12s
CI / ocr-license (push) Failing after 17m51s
The Alpaq92 GitHub account is suspended, so nothing can be fetched from it.
dredd-core (and Lexicon's compass packages from Arbiter) now come from the
public Haski repositories on Gitea, so CI no longer authenticates to GitHub:
the "Authenticate to dredd-core" steps and insteadOf rewrites are gone.
The Dockerfile's dredd_core_token build secret stays; any non-empty value
works now (the Haski org secret DREDD_CORE_TOKEN provides one in CI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 17:05:22 +01:00
admin 3039f1675c Merge pull request #29 from Alpaq92/security/console-xss-users-guard
Security: document pager XSS, roster for moderators, text parsing off the event loop
2026-11-28 10:39:34 +01:00
Piotr ChojnackiandClaude Opus 5.5 2d50403423 Console: no route in an inline handler; roster for moderators; text work off the loop
- frontend/app.js: the document pager put esc(routeHash(route)) inside
  onclick="location.hash='...'". esc() is HTML escaping and the browser decodes
  &#39; back to ' before the handler runs; the route comes from the URL hash and
  encodeURIComponent keeps ' ( ) - ., so a crafted #/doc/eu/<celex>/<segment> link
  ran script on a click of the pager arrows. The pager is now plain links, and
  routeApi accepts exactly the segments each kind has (act 4, eu 2, judgment 3).
- GET /users takes require_moderator. On the platform list_users reads the shared
  app_user, so any Insider user could list every account. The console fetches the
  roster only on the Administration screen.
- services/legal.py: html_to_text (pure-Python HTMLParser, live EU texts up to
  MAX_TEXT_BYTES) and _text_answer (chunk + outline of a whole text) run in
  asyncio.to_thread instead of on the event loop.
- docker-compose.managed-db.yml: the OCR worker gets the same credential blanks as
  the backend (no migrator URL, no superuser password); deploy_check checks it.

Tests: test_console (routeApi extra segments, no route in an inline handler),
test_integration (GET /users is 403 for a user), test_event_loop (AST guard).
Not run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 20:42:59 +01:00
admin ed8a65ead5 Merge pull request #27 into main 2026-11-24 20:17:40 +01:00
admin c66216044a Merge pull request #28 into main 2026-11-24 20:17:29 +01:00
tobayahandClaude Opus 5.5 3f64fad643 Console: English only in EN mode (chrome, crumb, toast, sources, 3D graph)
The shared chrome, the same in all six modules: the tab title and <html lang>, the language
button's title / aria-label (data-no-i18n, so set in code by localizeChrome()), the search
tooltip, the breadcrumb (setCrumb() now localizes the top bar) and toast(), which wrote outside
every localize() root.
localizeChrome() also runs in applyLang(), so the in-place switch keeps title and button in step.

Insider: the source line's status and notes, the cleared-filters hint, the sources table's scope
and rate, "Tekst niedostępny" and the MCP tools line split from data; the fixed attributions and
dataset labels the server sends get EN entries (matched verbatim). graph.js: the 3D counts line
in separate spans and the 3D tooltip through tr(). Citations, outline labels (ust./pkt/art.) and
the legal text stay Polish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:42:34 +01:00
tobayahandClaude Opus 5.5 ade4181d4a Partial match: cut the word subsets while drawing them, not after
TextIndex._match listed every combination of the query's words before keeping
the first PARTIAL_COMBOS (20). A ~40-word query relaxed to 60% of its words has
C(40, 24) ~ 63 billion subsets; Atrium's chat sends whole exam questions as the
search query, and in the 2026-11-18 benchmark one such query took the process
past 16 GB and it died. itertools.islice draws the same first 20 subsets.

The new test fails fast (it counts the subsets drawn per call) instead of
exhausting memory if the list comes back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:56:32 +01:00
adminandClaude Opus 5.5 140ab3e5b9 GET /stats: Insider answers dredd-core's stats contract (M4, Panorama's tiles)
One tile: the caller's MCP tokens (#/tokens), counted by
auth_service.list_app_tokens, the very function GET /me/tokens calls. Acts,
judgments and the reference graph are the same for everybody, so they are
not a person's numbers and are not published as tiles.

dredd-core repinned v0.17.0 -> v0.23.0 (0.18-0.22 additions are opt-in).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:46:43 +01:00
admin 811e24e46b Merge pull request #26 from Alpaq92/nav-admin-indent
Stop indenting Administracja twice in the sidebar
2026-11-01 17:29:11 +01:00
adminandClaude Opus 5.5 d3c6d70561 Readability: AA contrast for faint text (3.2 -> 4.7:1), 11px nav headers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:16:56 +01:00
adminandClaude Opus 5.5 87ff4b4290 Make the console usable by keyboard, screen reader and finger
The shared ui/v1 pass Atrium got: icon-only buttons named, the toast a
live region, dialogs labelled, the page title an h1, a skip link, 44px
targets on touch, contained overscroll, theme-color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:47:55 +01:00
adminandClaude Opus 5.5 495adbd6cc Stop indenting Administracja twice in the sidebar
The link was a .nav-item inside a div.nav-item, so its padding counted
twice and the icon sat 12px right of every other entry (and in Atrium's mirrored module nav).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:38:54 +01:00
admin dcfb6c94de Merge pull request #25 from Alpaq92/acts-by-score
Merge the local indexes' acts by score
2026-10-29 20:08:48 +01:00
adminandClaude Opus 5.5 122432543f Merge the local indexes' acts by score
Each local index (Polish acts, EU acts, judgments) returned its hits in
relevance order, but the blocks were appended in whichever order their
searches finished, so a block of EU word-form matches could sit above
KC art. 991 for "zachowek". merge_ranked interleaves them by score
normalised per index, weighs EU acts at 0.6 unless the query names EU
law, keeps partial matches under full ones, and never reorders an
index's own list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 20:08:23 +01:00
admin eccc067449 Merge pull request #24 from Alpaq92/graph3d-instanced
Draw the 3D view's spheres as two instanced meshes
2026-10-29 14:46:32 +01:00
adminandClaude Opus 5.5 cee9c54c75 Draw the 3D view's spheres as two instanced meshes
Every node was its own Mesh, so a frame at the 2,500-node cap was about 2,500
draw calls. The spheres are now instances of two InstancedMeshes (big and
small), so 15 draw calls in all; the per-node Group keeps only labels and the
fallback halo. Hover dimming is per-instance colour instead of per-colour
material opacity.

3d-force-graph's pointer interaction is off (its raycast walked every node
object each frame); our own raycast against the two meshes, once per frame at
most, drives hover and click, and a drag of more than 5 px is not a click.

Synthetic 2,500-node act, same 576 px box: frame 65.7 -> 25.5 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 14:39:55 +01:00
admin ef34fda6d9 Merge pull request #23 from Alpaq92/graph3d-faster
Make the 3D view's hover and frames cheaper
2026-10-29 14:01:53 +01:00
adminandClaude Opus 5.5 16225b7f19 Make the 3D view's hover and frames cheaper
Hovering a node changed four link accessors, so 3d-force-graph re-digested all
5,500 links on every hover in and out. The hovered node's edges are now a second
small LineSegments of our own; 3d-force-graph draws no links at all. The
directional particles on hovered edges go with that.

The renderer's pixel ratio is capped at 1.5 and the bloom runs at half the
canvas size, so a hi-DPI or 4K screen no longer renders and blurs up to 9x the
pixels.

Synthetic 2,500-node act (the cap), same browser: frame 55.8 -> 41.2 ms,
hover 90.4 -> 48.6 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:57:31 +01:00
admin 02ee3b7bef Merge pull request #22 from Alpaq92/outline-md-headings
Show articles in the act outline when headings are Markdown
2026-10-29 09:55:18 +01:00
adminandClaude Opus 5.5 0a09650d2c Show articles in the act outline when headings are Markdown
dziennik-ustaw-md texts write "##### Art. 227.", so the outline missed
every article and listed all the § lines flat. Heading marks are now
stripped before matching (articles at the top, § / ust. under them,
pkt below; "Oddział" counts as a chapter), and a Markdown heading line
is shown as a bold heading without its "#####".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 09:54:58 +01:00
admin 1f517ec924 Merge pull request #21 from Alpaq92/search-contract-v1
Answer the family search contract; strip control characters from act texts
2026-10-28 15:31:36 +01:00
adminandClaude Opus 5.5 5bee0990bc Answer the family search contract; strip control characters from act texts
- dredd-core v0.17.0. Every /search answer carries the contract's
  version/q/hits/truncated beside Insider's own keys (services/search_v1);
  format=v1 applies the contract's limit default and 2-character minimum
  and asks the fast sources only. Hit links are the console's own routes.
- PDF hyphenation left U+0002 inside words (art. 483 k.c.). The DzU
  splitters strip C0 controls (tab/newline/CR kept); 0013 cleans the 226
  articles already stored.

Requested by Tobiasz under Alpaq92/Atrium#17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:21:44 +01:00
admin be56dba0ff Merge pull request #20 from Alpaq92/caselaw-future-dates
Never take a judgment dated in the future as an article's newest
2026-10-28 13:53:28 +01:00
adminandClaude Opus 5.5 8daa937ec4 Never take a judgment dated in the future as an article's newest
SAOS has four judgments dated after today (up to 3013, source typos), so
49 articles showed a "newest judgment" in the future. The recount (SQL
and the in-memory store) now ignores dates after today for `latest`;
the judgments still count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 13:52:05 +01:00
admin 316f78c62e Merge pull request #19 from Alpaq92/dated-act-case
Read a dated act in capitals instead of crashing the case-law pass
2026-10-28 10:05:27 +01:00
adminandClaude Opus 5.5 82a1b5fa03 Read a dated act in capitals instead of crashing the case-law pass
SAOS judgments quote acts as "USTAWY Z DNIA ... R.". The DATEDACT token
matches case-insensitively, but the follow-up regex did not, so it
returned None and every case_refs pass died at ~290k judgments. Match
case-insensitively, and leave a name unresolved rather than raise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 09:26:26 +01:00
admin 91d4699078 Merge pull request #18 from Alpaq92/celex-five-digits
CELEX: accept a five-digit document number
2026-10-27 21:44:49 +01:00
adminandClaude Opus 5.5 5f4a4953d2 CELEX: accept a five-digit document number (the CELLAR pass was stuck on 32026D05001)
CELLAR's 2026 decisions passed 9999 and went to five digits. The allow-list took exactly four, so
every run refused its own keyset cursor ("after": "32026D05001") and no EU act came in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:44:43 +01:00
admin 71d7787903 Merge pull request #17 from Alpaq92/resolve-opens-text
Console: a citation opens the act's text at the article
2026-10-27 21:19:42 +01:00
adminandClaude Opus 5.5 be1bdc5013 Console: a resolved citation opens the act's text at the article, which is now found
submitSearch followed resolve's article.url, the reference graph's page, outside the console: for
an article nobody cites that is an empty graph, which read as "nothing found" (art. 227 KK). It
now goes to #/doc/act/<eli>?part=N&art=<label>. And articleLine never matched dziennik-ustaw-md's
Markdown headings ("##### Art. 52."), so the article was neither highlighted nor scrolled to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:19:38 +01:00
admin 4b09bebcff Merge pull request #16 from Alpaq92/vectors-mmap
Vectors: float16 + mmap, chunked search, mapped model; plain-language questions answer
2026-10-24 14:47:35 +02:00
adminandClaude Opus 5.5 0256be1cce Bound vector search memory and make plain-language questions find their acts
The box (2026-10-24): one hybrid search took a process to 2.9 GB in a 3 GB cgroup (uvicorn
OOM-killed at 11:43 UTC), and "ile mam czasu żeby pozwać o zapłatę" returned 0 acts in 10.5 s -
the federation budget expired while the format-1 store was decompressed into a resident matrix.

- Vector store format 2: float16 segments opened with mmap + metadata; exact search in
  16k-row chunks with a running top-k, scoring only rows the filters keep (81% are "sup");
  vectorised open. Format-1 shard-*.npz stores are converted once, shard by shard, streamed
  out of the zip, resumable; the embedding loop does it at start-up, BM25 answers meanwhile.
- The local model loads from a memory-mapped external-data copy, written once in a child
  process (e5-small: 788 -> 340 MB anonymous); arena stays off, prepacking off on the copy.
- Query side: question words ("ile", "mam", "żeby", "mnie"...) are no longer required by the
  match (a 568k-char unsplit doc was the only strict match and blocked the partial one); new
  reviewed thesaurus lines; the vector side also embeds the thesaurus variants (best-of).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 14:44:19 +02:00
admin 1778364a7e Merge pull request #15 from Alpaq92/graph-look
Graph: a nicer 2D look, fitted layouts, and an optional 3D view
2026-10-24 13:05:50 +02:00
adminandClaude Opus 5.5 df4290f688 Add an optional 3D view to the act-structure and act-links graphs
A "2D | 3D" switch on /graph/act, /graph/acts and the console's #/graph tabs.
2D (Cytoscape) stays the default. 3D draws legal-memory's "burst": the act,
its units and articles as a tree, the references inside the act, linked acts
on an outer shell and, once case law is ready, the judgments citing it. It
uses three.js 0.183.0 and 3d-force-graph 1.80.0 (both MIT), vendored,
same-origin and lazy-loaded, with UnrealBloomPass glow. The CSP is unchanged.

Python caps the data at 2,500 nodes (/graph/act/3d, /graph/acts/3d). The
choice is kept in localStorage (default 2D) and in ?view=3d. The selection
and the side panel survive a switch, and going back to 2D disposes the
renderer. Without WebGL the page stays in 2D.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:41:32 +02:00
adminandClaude Opus 5.5 0ad581b3f1 Make the reference graph good-looking, and fit it to its box
- Every layout fits the nodes into the box with padding after it runs, and again on
  every resize (ResizeObserver): the act graph no longer draws as a 30-px cluster.
- Styles come from the theme tokens (getComputedStyle) and the family's data-viz set
  (--chart-1/2/3, violet/teal/orange); restyled live when the console's theme changes.
- Nodes sized by PageRank / citations on a sqrt scale; kind colours with a legend;
  labels with a halo, ellipsis, a constant on-screen size and no overlap (greedy
  placement), full titles in a tooltip.
- Edges: bezier, coloured and dashed by reference kind, width by weight; filled
  arrowheads scaled to the edge, ending at the node border; mutual references as two
  curves; hover highlights the neighbourhood with its arrows, dims the rest.
- Zoom/fit/re-layout buttons (keyboard-reachable, localized), double-click expands,
  reduced motion respected; cose tuned (and turned to the box's aspect), concentric
  rings by hop / by citations elsewhere.
- Fix: the graph data travels in a <template>, not a JSON <script>: htmx with
  allowScriptTags:false dropped it from swapped HTML, so every "Pokaż" drew nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:38:24 +02:00
admin f3ee274458 Merge pull request #14 from Alpaq92/graph-in-console
Console: a "Powiązania" view for the reference graph, inside the frame
2026-10-24 11:06:25 +02:00
adminandClaude Opus 5.5 abe93edc95 Put the reference graph in the console: a Powiązania view, in-frame
The /graph pages had no entry point: only grey target="_blank" links under act hits, which
also escaped Atrium's frame. Now:

- NAV "Powiązania" (Tabler affiliate icon) -> #/graph: a search box (article citation or
  kc:415 -> /resolve -> the article's neighbourhood; a code's name/abbreviation -> act page;
  other text -> acts by title with graph buttons), tabs (Powiązania aktów = graph/acts?top=60,
  Struktura aktu, Najczęściej cytowane, Ścieżka) and the graph page in a same-origin iframe
  sized to #content. The framed page drops its own header, follows the console language, and
  its own navigation is mirrored into the hash. "Graf jeszcze się buduje" is a console card.
- Search hits: visible buttons (Powiązania, Orzecznictwo when cited_in_case_law > 0, Graf
  aktu, Najczęściej cytowane, Powiązania aktów) into #/graph, never a new window.
- Document view of a PL act: Powiązania (with ?art=) and Graf aktu.
- /graph pages: frame-ancestors 'self' + SAMEORIGIN always (the console frames them, never
  wider than same-origin); links back into the console are target="_parent"; "← Insider";
  data-building marks the building state; ?cases=1 opens the article's case-law panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:01:30 +02:00
admin b89b0632d7 Merge pull request #13 from Alpaq92/answers-grounding
Cited answers: refusal example, verifier, graph expansion, eval
2026-10-24 00:49:45 +02:00
adminandClaude Opus 5.5 4c6e77017e Ground cited answers: few-shot refusal, a verifier, graph expansion, an eval
Brings in tobayah/legal-memory's RAG findings (Apache-2.0, CREDITS.md):
- the answer prompt is data (app/ai/prompts/answer.json, PL + EN) with two
  worked examples, the second a REFUSAL although the right act is present;
- services/grounding.verify drops every sentence that cites nothing, a
  passage out of range, an art./section/ust. number, date or act number its
  CITED passage does not hold (invented vs miscited after searching the whole
  context), or whose lemmatised words its passage does not support; nothing
  left = refused; a `verification` block goes to REST and MCP;
- retrieval adds up to INSIDER_ANSWER_GRAPH_EXPAND articles one hop away in
  legal_ref, only while RankPrior.active() (the rank_prior guard);
- tests/answer_eval.py: a misbehaving fake generator per failure mode, plus
  real questions for --live runs; infra-matrix test in bare and full.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 00:40:41 +02:00
admin 959e81f277 Merge pull request #12 from Alpaq92/case-law-refs
Case law: judges' article citations (migration 0012)
2026-10-24 00:40:40 +02:00
adminandClaude Opus 5.5 be433ad92c Cited in case law: judgments citing articles, beside the act graph
Parse SAOS judgment sections with the graph's own grammar and resolver
(codes, declined code names, Dz.U. citations, lists, 'w zw. z', bare
kpc/KC and EU names like RODO), resolve to the current text's article,
and keep only resolved citations. New tables case_ref + case_ref_count
(alembic 0012, idempotent), never mixed into legal_ref.

CaseRefJob runs after saos_dump and the graph (INSIDER_CASE_REFS_SCHEDULE,
default 45 5 * * *), incremental by updated_at, keyset pages with short
transactions, resumable, re-points rows onto a newer t.j. Guarded: nothing
reads it before its first complete pass.

REST /api/v1/graph/case-law, MCP article_case_law, cited_in_case_law in
find_article and resolve, an Orzecznictwo list in the /graph panel and a
'w orzecznictwie' column on /graph/top. Optional search prior
INSIDER_CASE_LAW_PRIOR, off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 00:40:26 +02:00
admin aa1011da72 Merge pull request #11 from Alpaq92/graph-act-views
Graph: links between acts and an act's most-cited articles
2026-10-23 23:43:44 +02:00
adminandClaude Opus 5.5 1839ca2177 Graph: links between acts and an act's most-cited articles
/graph/acts (+ acts/view, acts/panel): one node per act, edges summed per
act pair from article-level references, split by kind, delegations dashed;
scope = an act's neighbourhood (depth 1-2, direction) or the top-N acts by
act PageRank; min weight and kind filters; 500-node cap; size = PageRank,
width = weight, both decided in Python; cose layout.
/graph/top: an act's articles by distinct citing articles (within / from
other acts) with PageRank, links to the neighbourhood and the document view
at the article (part from the alias table), and a mini-graph of the top 20.

Live GROUP BYs over legal_ref's indexes, no new table: on the box the
heaviest view is 64 ms. Before the graph's first build every page says the
graph is still being built (bare / fresh / missing tables), never a 500.
Linked from the article panel, the act page and the console's search hits;
graph.js gains the pages' EN dictionary and window.applyLang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:03:15 +02:00
admin 59aabe2165 Merge pull request #10 from Alpaq92/eu-stream-large
Index oversized EU texts by streaming them into parts (migration 0011)
2026-10-23 20:42:54 +02:00