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>
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>
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>
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>
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>
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>
- frontend/app.js: the document pager put esc(routeHash(route)) inside
onclick="location.hash='...'". esc() is HTML escaping and the browser decodes
' 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
/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>