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>
Since 1dd6b4a (Atrium#68 R2) the session is an HttpOnly cookie and the login
body carries no token, so the smoke test failed on "login returned no token".
It now keeps the cookie, asserts the body has no token, and calls /auth/me
with the cookie.
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>
- ReaderJS, tesseract.js (+ WASM core, language models) and PDF.js are served by
Galena from static/: backend/scripts/fetch_vendor.py fetches them at image build
(Dockerfile `vendor` stage, Netlify prepare, local dev) - ReaderJS by full commit
SHA through git, the npm tarballs at exact versions checked against their
integrity hashes; a mismatch fails the build. tesseract.js was loaded as `@5`.
- The console and reader CSPs name no CDN; READERJS_DEFAULT_BASE is `dist/`, the
shell-relative own copy (a remote, immutable override still works).
- POST /auth/login returns the raw session token only with `issue_token: true`
(Galena Connect asks); the console signs in by the httpOnly cookie alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The platform job's next stop after the 0007 fix was 0014 (no dredd.counterparty: Atrium's 0012
creates it on a real platform). counterparty_alias leaves _LATER_TABLES again: it has no key to
app_user. Verified locally on PG16: platform job from scratch green, backend 638/18/0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new append-only row (archive_disposal_withdrawal, in revision 0015 and
0007's person columns) by the requester or any other moderator, reason
required; 409 once disposed of. A withdrawn request no longer blocks a new
one, and approving it is 409 no_request. POST
/projects/{id}/archive/disposal/withdraw, audited archive.disposal_withdrawn;
console button Wycofaj wniosek on the card and in Likwidacje.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Versioned packages per contract card (card snapshot + the modules' evidence
over GET /evidence, sha256-verified; Galena-stored items read locally at
their commit), manifest + fingerprint, append-only tables (revision 0015),
automatic archiving after document.signed / workflow.signed_on_paper with
ARCHIVE_READER_TOKEN and a "Do zarchiwizowania" retry list, manual archiving
by a moderator, retention from the live card per contract type, legal holds,
two-moderator disposal with a permanent protocol, ZIP export sealed by
Parafa, 409 archived_contract on deleting an archived project, and the
console screens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spec 2026-11-25 part A, step 2. Galena is the register's second writer
(organisations only, through dredd-core link_or_create; a read-only
grant is a 409 counterparties_read_only). New document_card_counterparty
(card, counterparty RESTRICT, position, side) in revision 0014:
standalone the register's tables are this schema's own, on the platform
empty local copies are dropped and the key points at the hub's; ends
with runtime_grants_sql. The card keeps its text for what cannot be
linked. GET/POST /counterparties (picker, new organisation), PUT
/projects/{id}/card/counterparties (editor; no access 404). The list,
the CSV and the search show linked names, else the text; new filter
counterparty_id. One-off python -m app.link_counterparties (dry run,
then --commit) links only unambiguous single names via plan_import and
reports the rest.
Also: the card no longer links to Arbiter's console (Arbiter is
headless); the accepted analysis's date and version stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
my_roles batches its node load and read filter; ProjectRolesIn moves to
schemas. A document's text is one service call that stops at MAX_CHARS
and MAX_PAGES. Dead apply_workflow_approved removed; one _actor helper;
_later reads naive times as UTC. Export loads all timelines in one query.
The Workflow banner navigates in-frame through workflowUrl. Ticket
narration trimmed from comments; behavioural tests added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* An editor could merge their working version straight into the main version of a project that
needs approval with "Combine versions" (POST /projects/{id}/combine), which needed `editor` only:
the review policy's whole promise, gone for anybody who can edit. The same route merged into
someone else's working version, the source of their open draft, and POST /projects/{id}/versions
could create that version in advance. `changes.assert_may_write_version` is the one rule for
both routes: the main version of a `review_required` project is moved by an approver or a
manager (D4: the approver role is the whole rule), someone else's `version/...` by a manager.
* "Resolve discrepancies" wrote around the write chokepoint: it published a draft that was already
rejected or withdrawn, wrote any path it was handed (files nobody reviewed, committed under
"Publish draft"), and committed an encrypted file's resolved text in plain text. It now needs an
open draft, writes only the files the draft changes, encrypts under the file's mode (a passphrase
file is refused, it cannot be encrypted without the passphrase), and the conflict picker shows
the decrypted text instead of ciphertext. `git add` gets `--` before the path.
DB-free regression tests in tests/test_review_gate.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /projects/{id}/text?path= answers a document's paragraphs (docx, odt,
rtf, pdf through pypdf, plain text), read as the caller with the file read's
access and decryption. Nothing is stored or indexed: the platform's chat asks
when a question is about a contract's content. Capability 'document_text'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workflow already calls POST /projects/roles (may this person read these
documents?) and GET /projects/{id}/holders?min_role= (who does a role stage
go to?), and Parafa needs the first; Galena answered neither, so a Workflow
run on a Galena document could not be read or routed. Both answer about the
caller only (the person's token), through dredd-core's effective_role:
roles name null for anything unreadable or not a project (at most 200 ids),
holders is a 404 unless the caller may read the project. Advertised as the
capability "project_roles". Atrium#53, found while fixing Parafa (stage 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: git_facade.all_files sat outside the try, so one such run
ended the whole export instead of becoming a skipped line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: Workflow's payload carries DocumentRef.module, the constant
'galena', while the check compared it to MODULE_SLUG, which is configurable;
under another slug every Workflow event (workflow.approved included) was
ignored. Both names are accepted now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparing isoformat() strings sorts wrong when two timestamps carry
different offsets (a session TimeZone changed between them), so a late,
older analysis.accepted could replace a newer one. Found in review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arbiter now says `analysis.accepted` when a lawyer accepts an analysis
(Atrium#53, stage 2). Galena hears it from ANALYSIS_EVENT_ROLES (default
arbiter_app) and, for a Galena document, stores the latest accepted analysis
on the card (`document_card.accepted_analysis`, revision 0013): ids and
hashes only, as the event carried them, each checked. A late older event
never replaces a newer acceptance, and the card's status does not move.
One audit entry per change. The card shows the date, the document version
and, on the platform, a link to the analysis.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium#53: Galena is a service under the other modules, so the card's status
follows what they report, forward only, never over a status set later:
- workflow.approved szkic|negocjacje -> zatwierdzona (as before)
- workflow.signed_on_paper szkic|negocjacje|zatwierdzona -> podpisana
- document.signed (Parafa) szkic|negocjacje|zatwierdzona -> podpisana
- negotiation.round_received (Agora) szkic -> negocjacje
One table (cards.EVENT_MOVES) and one move (cards._move) replace the approval-
only path; the stamp names its source (obieg / podpis / negocjacje) and the
card shows it. Each kind is trusted only from its module's role
(WORKFLOW_EVENT_ROLES, new SIGNING_EVENT_ROLES=parafa_app,
NEGOTIATION_EVENT_ROLES=agora_app); an event about a file, a request or another
module's document is ignored.
Not run here: no Python or Node on this machine and CI is not running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium#53 moves approval runs to Workflow and takes Galena out of the menu,
so the document is sent from where people work on it. The file menu gets
"Send for approval" ("Wyślij do akceptacji"): it opens Workflow's new-run
screen with this project and path chosen, as a sibling path (../workflow/,
like the hub link), so it is right under any prefix and Atrium's frame
follows it. Only on the platform (hubMode) and only on main, because Workflow
pins the file as it is on main.
Not run here: no Python or Node on this machine and CI is not running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium#53 makes Workflow the one approval engine. This is the first of the
two Galena steps (the second removes the engine's code; its tables stay).
- LEGACY_WORKFLOWS=drain (default): starting a run and changing a template
answer 409 moved_to_workflow, before any read; runs in progress still
approve / reject / cancel / scan as before. No example templates are seeded.
`open` restores the old engine; its integration tests use it.
- The document's workflow page shows a banner linking to Workflow, and no
start button (can_start is false while drained).
- python -m app.export_workflows [--out file]: read-only export of templates
and FINISHED runs with their timelines. Each run is pinned to the project's
main file at its commit (one file outside podpisane/ and hidden paths), with
that file's last commit and the sha256 of its decrypted bytes — the same
hash dredd-core's pin_document computes, so Workflow reads it back cleanly.
Several files, none, a removed project or a passphrase-encrypted one: the
run is exported with subject null and a reason. Runs in progress are listed,
not exported (exit 1); export again once they finish.
- WORKFLOW_EVENT_ROLES defaults to workflow_app (the Workflow module's role),
not the retired compass_app: without it the contract card ignores Workflow's
approvals.
Not run here: no Python or Node on this machine and CI is not running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Templates of ordered stages, runs pinned to a commit, approve/reject/cancel with optimistic checks,
an append-only timeline, paper signature by scan through apply_change, the card moves to
zatwierdzona via register_sources, Waiting for me / In progress lists and a /stats tile. Revision
0012 (idempotent, runtime grants re-run); 0007 learns the new person columns and the user ids inside
stages. Seeds Workflow's three example templates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two tiles, each counted for the caller by the very function its list calls:
contracts (cards.listing with no filter, through cards.readable_count; #/cards)
and drafts (changes.drafts_for_user; #/drafts). Behind the session like every
route, so Panorama's call with the person's own token sees exactly that
person's numbers. The integration test checks tile == list for an
administrator, a viewer of one workspace and a stranger.
dredd-core is pinned to the feat/m4-stats commit (f170334) until v0.23.0 is
tagged; repin then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apply_change emits document.version_added in the write's transaction; a
receiver loop applies workflow.approved to document_card.lifecycle with a
register_sources stamp (zrodlo obieg), idempotent per event. Revision 0011
creates the cursor and receipt tables, and standalone the log itself;
on the platform the log is the hub's. Backups leave the shared event
tables out on the platform.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split plan 2026-11-06, WP-R3. A document of type umowa gets a 1:1 card
(number UM-<year>-NNNN, parties, amounts, dates, lifecycle with
zatwierdzona per D5, signatories, representatives, register_sources,
custom fields). Register list with filters, sorts and the Kolumny panel,
CSV export on Compass's Excel rules, expiring alerts at 60/30/7 days.
custom_fields and table_views come from dredd-core 0.19.0.
Revision 0010 is idempotent; 0007 skips the two tables 0010 creates when
a pre-0007 database is cut over to the platform.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repin dredd-core to v0.19.0. /raw takes its media type and headers from
dredd_core.plain_files.response_headers, so the untrusted-bytes rule
(allowlisted inline media, everything else octet-stream + sandbox CSP +
nosniff) lives in one place. Core's INLINE_MEDIA equals Galena's old set
and the CSP is byte-identical; filenames gain RFC 5987 filename*.
test_raw_headers pins PNG/HTML/SVG/download and fails if core ever widens
the inline set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FastAPI 0.15x keeps each included router as one _IncludedRouter entry, so
the console wrapper (404 instead of 405 + Allow) and the route sweeps would
see no API route. Repins core from v0.17.0; FastAPI itself stays 0.115.6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ported from Compass #51 (plan WP R1):
- encrypt reads the author's working version when there is one, so it no
longer overwrites their edits with main; audited as file.encrypt
- move-file goes through the review policy; crypto.move_marker carries the
encryption marker to the new path; audited as file.move
- flush after closing a draft (publish, resolve, reject, withdraw), so the
next submit does not reopen it
- D4: an approver may publish or reject their own draft
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The service worker unregisters itself only under /galena/, so a standalone
deployment keeps its web push. README says where the drive went.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser decodes an attribute's entities before it compiles onclick="…", so esc()'s '
was a quote again by then: a file, folder, version or plugin named x');alert(1);(' ran code in
Galena's origin — on the platform, the whole family's. jsq() makes the value a JSON string
literal first, then escapes it for the attribute; encodeURIComponent, which leaves ' alone, is
wrapped too. test_console_handlers.py allows only server ids inside a quoted literal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Desktop clients save binary documents through /upload, which took no passphrase, so a
passphrase-encrypted DOCX could be opened but never saved back. The header (never a query
parameter) now reaches apply_change. A missing passphrase answers 422 with
code=passphrase_required, so a client can ask and retry instead of failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium calls frame.win.applyLang(lang) when its language changes. The hook accepts en|pl only,
is a no-op on the current value (no storage-event loop with Atrium), persists galena_lang, sets
<html lang>, re-localizes from the English source and tells an open ReaderJS viewer. Only Settings
is re-rendered; editors, the unsaved-changes guard and the Changes compare are left untouched.
localize() now treats a node or attribute rewritten since its last translation as a new source,
so EN -> PL -> EN never restores stale text. Our own buttons go through the same hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium's Home asks every module GET /api/v1/search?format=v1&q=&limit= and reads one shape
(dredd_core.search_contract, 0.17.0). Galena's palette already owns the key `hits` with its own
item shape, so the contract is opt-in by format=v1 and the legacy body is unchanged until the
palette migrates. Same readable-only scan as before; links are the console's own n/<id> routes.
The requirements pin stays at v0.16.0 under a TODO(search-contract) until the tag exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Galena sent raw UTF-8 under a bare application/json and
application/problem+json (API, problem responses 401/404/405/422/500,
OpenAPI, /healthz). Windows PowerShell 5.1's Invoke-RestMethod decodes
that as Latin-1 ("Rozporządzenie" -> "RozporzÄ…dzenie"); the same fix as
Insider be065e7.
One line in edge.SecurityHeaders (the outermost middleware):
dredd_core.json_charset.ensure_json_charset_message appends the charset
to application/json and application/*+json only; HTML, event streams
and binary responses are untouched, nothing is buffered.
tests/test_json_charset.py sweeps every parameter-free GET route plus
OpenAPI, /healthz and 401/404/405/422/500 problem responses, DB-free.
TODO before merge: repin dredd-core to v0.16.0 (json_charset is new
there); requirements.txt carries the marked TODO, still on v0.15.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>