16 Commits
Author SHA1 Message Date
adminandClaude Opus 5.5 ef4249eebd Fetch private dredd-core from the Haski Gitea, not GitHub
CI / backend (16) (push) Successful in 1m23s
CI / backend (17) (push) Successful in 56s
CI / managed-db (push) Successful in 1m8s
CI / compose-smoke (push) Successful in 1m22s
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:39 +01:00
adminandClaude Opus 5.5 111c120834 CI: allow a manual run (Actions -> CI -> Run workflow)
CI / backend (16) (push) Successful in 1m47s
CI / managed-db (push) Successful in 1m13s
CI / compose-smoke (push) Successful in 1m45s
CI / backend (17) (push) Successful in 1m14s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:06:30 +01:00
adminandClaude Opus 5.5 4b42bd6f48 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:39:12 +01:00
adminandClaude Opus 5.5 ea3d57728f Build from Gitea instead of GitHub
CI / managed-db (push) Successful in 1m2s
CI / backend (16) (push) Successful in 1m5s
CI / backend (17) (push) Successful in 58s
CI / compose-smoke (push) Successful in 1m38s
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:29 +01:00
admin 6d33e37d5c Merge pull request #3 from Alpaq92/security/users-guard-and-check-bounds
Guard the user roster; bound the amount parser and Lexicon reads
2026-11-28 10:40:09 +01:00
admin 4f7cdffb69 Merge pull request #2 from Alpaq92/feat/draft-from-scratch
A draft from scratch, and the provisions it cites checked in Insider
2026-11-28 00:22:27 +01:00
adminandClaude Opus 5.5 2586ac846b feat: no console — the chat is the only screen for contracts (Atrium #53)
Decision 1 of 18.11: Arbiter, Lexicon and Scribe are one module "Umowy" under
Atrium's chat; the logic stays here and the chat calls this API. The static
console (frontend/), its mount, SPA fallback and console-only edge classes go;
"/" answers a small JSON note. Every API route and /healthz stay. CI, the
Dockerfile, compose, deploy_check and the docs follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 19:42:43 +01:00
adminandClaude Opus 5.5 e32bfa4310 fix(checks): two citations separated by a space are two
An abbreviation's extra letters now each end with a dot, so the "art." of the next
citation is no longer read as part of the previous code's abbreviation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:14:02 +01:00
adminandClaude Opus 5.5 cdd97ef7dd fix(checks): concurrent provision lookups under one deadline
The provisions check asks Insider for up to 30 citations through a pool
of 6 under one shared deadline; a citation not answered by then counts
as not checked, so a slow Insider costs an export the budget at most.
run() drops check_provisions: provision_lookup defaults to SKIP and is
typed ProvisionLookup | None. drafts uses checks.LEFTOVER directly.
TemplateIn refuses a blank name, which would mark its drafts as drafts
from scratch. Tests: body_empty on a template draft, that invariant,
the deadline with a slow fake lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:50:33 +01:00
Piotr ChojnackiandClaude Opus 5.5 deb37daa9d Guard the user roster; bound the amount parser and Lexicon reads
- GET /users needs this module's moderator: on the platform app_user is
  the whole shared roster, and the console reads it only in administration.
- parse_amount refuses text longer than any amount (64 chars) before the
  currency regex, whose search is quadratic on long whitespace-filled values.
- Lexicon: a 16 MiB body limit (JSON, not files), and one fetch per source
  per check instead of one per slot that quotes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 11:06:33 +01:00
adminandClaude Opus 5.5 a57e1d2f02 fix(provisions): a text Insider could not read yet is not checked, not wrong
From review: Insider answers located=false with reason timeout,
text_pending or text_unavailable when it could not read the act yet; only
not_in_text means no such article. A non-object answer is not checked
either. The check is bounded: 5 s a call, 20 s in all, the rest reported as
not checked, so an export never waits minutes on a slow Insider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:38:52 +01:00
adminandClaude Opus 5.5 dc3baa9a40 A draft from scratch, and the provisions it cites checked in Insider
Atrium#53, stage 2 (the Umowy module).

From scratch: POST /drafts with no template_id makes a draft that is its
text - no fields, no slots, no {{...}} - written through PATCH body. It is
marked by template_name "" (never inferred from template_id, which also goes
NULL when a template is deleted); a template's draft refuses a body (409).
The same checks gate export, an empty text included. The console offers "Bez
szablonu (od zera)" and a text editor for such a draft.

Provisions: every provision the rendered document cites ("art. 471 k.c.",
"art. 6 ust. 1 lit. b RODO", "Dz.U. 1964 poz. 93", the patterns Atrium's chat
recognises) is looked up in Insider's GET /resolve with the person's token
(INSIDER_URL, optional like Lexicon and Galena). Not found, not in force, or
not checked is a warning, never an error: the lawyer decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:27:17 +01:00
admin 380f926a03 Merge pull request #1 into main 2026-11-24 20:18:13 +01:00
tobayahandClaude Opus 5.5 2947a38ea4 Console: English only in EN mode (chrome, crumb, toast, template editor)
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.

Scribe: the Lexicon / Galena status line, date order, check report, Lexicon revision and the
template editor's field labels; the date and amount-in-words placeholders (data-no-i18n inputs)
go through _tr(). The field list is written with yes/no in EN and textToFields() reads both
tak/nie and yes/no - before, an EN user typing "no" got a required field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:42:35 +01:00
adminandClaude Opus 5.5 87ebdaa3b5 Ship the platform render of provision.sql (identity schema dredd)
Scribe joins Atrium as a module, so db/managed/provision.sql is now the
rendering with --identity-schema dredd --identity-owner atrium_migrator
(the one Atrium's push.sh compares), and CI's --check-file step passes the
same two flags, as Lexicon and Agora do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:51:20 +01:00
adminandClaude Opus 5.5 5dbe0fb1c8 Scribe MVP: templates, clauses, checks in code, export (Compass split M7)
Scaffolded with the dredd skill (simple tenancy, pl-first, dredd-core v0.23.0;
brand lime #66a80f set by hand, standalone port 8125), then the domain:

- Templates (moderators): Markdown with {{field}} and {{klauzula:slot}},
  typed fields (text/amount/amount_words/date), date-order rules.
- Drafts copy their template; clauses come from Lexicon via module_client
  with the acting person's token, or from the template itself (D9).
- Deterministic checks before every export: placeholders, amounts
  (Polish words vs digits), dates (valid, ordered), quotes (identical to
  the current source). Errors block export with 409 checks_failed.
- Export: Markdown/DOCX download (python-docx, MIT), a new Galena document
  pinned as DocumentRef, or plain_files without Galena. draft_export is
  NO_DELETE evidence.
- GET /api/v1/stats per dredd_core.stats_contract (drafts, templates).
- docs/spec-mvp.md: a proposal for Tobiasz's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:49:46 +01:00