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>
The family's standalone ports moved the backend to ${WORKFLOW_PORT:-8141}, and
the smoke test kept asking port 80, so it never saw the stack become ready.
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>
1. Nobody approves their own run unless a template allows it.
`initiator_may_approve` is now off by default, and a run's settings
override may keep or switch on the lock but never lift it
(`rules.merge_settings(..., for_run=True)`, 422 `initiator_lock_fixed`).
Before, anybody could lay out stages naming only themselves - on a Galena
document with no more than read access - and emit `workflow.approved` /
`workflow.signed_on_paper`, which Galena moves a contract card on; and a
moderator's template lock was undone by the override. The console's start
form shows the box off and disabled when the base locks.
2. `round_seen` joins `stage_key_seen` / `stages_seen`. An edit of the request
or a rejection on the first stage brings the run back to the same stage
key in a new round, so a click prepared before it approved content its
author never saw (or overrode a rejection). `assert_current` answers 409
`round_changed`; the console sends the round with every action, the scan
and the request edit. Checked when sent, so API clients keep working.
Tests: DB-free unit tests for both rules and the API passthrough; the
integration tests where the admin approved their own run now use a template
that allows it, or another person; one new integration test for the stale
click after an edit (Atrium#70).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finished runs on a Galena document: the timeline as canonical JSON (sha256 stable) and the paper
scan. A person sees what can_read_run lets them; the archive's technical account (fixed id
ARCHIVE_READER_ID, minted by the hub) sees all, is audited as evidence.read, and gets 404 on every
other route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every field a row is read through sits inside the try that turns errors into
skipped, an unknown event kind skips only its run, and persons, templates and
runs are looked up in three queries for the whole file. Report is a dataclass.
The CLI reports a database failure cleanly. "Wyślij do podpisu" is a plain
button: the stage's approval stays the one primary action. Ticket narration
trimmed from comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by running the unit tests: the start refused the unknown person before
it reached the insert, so the race was never exercised.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Przekazanie do Parafy": on the platform, an approved run on a Galena PDF
gets "Wyślij do podpisu", a link to Parafa's new request with the document
prefilled at the commit the run approved, so exactly the approved bytes are
signed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From review: the old engine ended a paper signature as approved, so those
runs came in as zatwierdzony although this module has podpisany for exactly
that; and the imported scan lacked to_dict's kind, so from_dict refused it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Atrium#53: Galena has no menu entry, so a document is sent for approval from
Galena itself. Its link opens #/runs/new?kind=document&document_id=…&path=…;
the new-run screen fills both fields from it, escaped, and locks them. The
server still re-pins the document with the person's own token at start, so
the link grants nothing. Before, a person had to type a UUID and a path.
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 this module the one approval engine. Galena drains its own
engine and exports templates and finished runs (Alpaq92/Galena#14,
`python -m app.export_workflows`); this reads that file.
- python -m app.import_galena_runs runs.json [--commit]: a dry run by
default, one transaction with --commit, idempotent (every id is a uuid5 of
Galena's), so a later export adds only what is missing.
- Templates keep their stages and keys (quorum "one") and get this module's
rejection rules (DEFAULT_SETTINGS); one naming a removed person is skipped.
- Runs keep state, stages, people, times and timeline; their settings say
`end` for rejection, the rule they actually ran under. Each is on the
DocumentRef Galena pinned (the project's main file). Unpinned, unfinished
or with a removed person: reported, never written.
- History, not activity: no workflow.* event, no notification; one audit row
per imported run or template, actor NULL.
Not run here: no Python on this machine and CI is not running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scan was written to Galena or plain files before any of the action's
database writes. It is now read and checked before those writes
(scan_bytes) but stored only after the run's rows have flushed
(keep_scan). A plain-files scan is also deleted if the transaction rolls
back. Galena has no delete here, so a scan committed there can still
outlive a failed final COMMIT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two starts on one subject could both pass the in-progress check; the
partial unique index then refused the second with a generic conflict.
The run's insert now flushes in a savepoint and a violation of the
running-run indexes answers the same 409 run_in_progress as the check.
Other integrity errors still propagate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The breadcrumb was never localized (it sits outside #content and the
sidebar), so "Nowa sprawa", "Ustawienia" and "Plik z komputera" stayed
Polish in EN. The tab title and <html lang> came straight from
index.html, the language button's "Język" tooltip sat inside
data-no-i18n, one toast skipped _tr and "Odśwież zatwierdzających" had
no dictionary entry. Crumb parts that are people's text (a request
type's or a run's name) are marked data so the dictionary never
rewrites them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seed (gdy SEED_DEMO) zakłada cztery typy wniosków ze ścieżkami: akceptacja wydatku, podróż służbowa, urlop szkoleniowy, wniosek urlopowy; grupy puste, obsadza je moderator. Moderator dostaje na ekranie Nowa sprawa przycisk Zdefiniuj nowy wzór workflow (formularz nowego typu wniosku). Test e2e archiwizuje po sobie typ, szablon i grupę, żeby nie zostawiał kart z kodami.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
- app.css rewritten: white cards on a quiet sidebar, Inter (self-hosted, OFL), radius 16/10,
light and dark tokens; dead search/stripe styles dropped
- "Nowy wniosek" and "Nowy obieg" become one sidebar button: #/new asks what the case is
about (a card per request type with its fields and default path, a file, a Galena
document when enabled), step 2 is the matching form beside its approval path
- run detail: actions in the page head (#runActs), stages as a horizontal path, details
and a newest-first timeline side by side
- settings: one tab per kind, the tab kept in the hash so a save lands back on it
- lists: subject with kind underneath, initials beside the initiator; inbox badge in the menu
- e2e: picks the request type by its card, settings by tab, actions from #runActs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
WORKFLOW_E2E_HUB_URL switches the expense happy path to the one-account platform: everybody signs in once at the hub, the people are the hub's accounts already admitted to this module (WORKFLOW_E2E_PEOPLE, WORKFLOW_E2E_PASSWORD), and setup/cleanup use the hub's cookie with a same-origin Origin. Standalone is unchanged. Green on the Atrium showcase (/workflow behind the front door).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
A FileRef sent to POST /runs is the client's claim. runs.start now answers 404 unless the
actor uploaded that file (audit file.uploaded), before the 409 run_in_progress check, so a
past approver who kept a file's id and hash cannot reopen access to it. uploaded_by is now
public in requests and flushes first (no autoflush).
Verified: 525 unit, 582 integration on Postgres (VPS), e2e passed; mutation-checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
- runs.start flushes the run before its stage row: no relationship() orders the INSERTs,
so run_stage_state could precede workflow_run (FK violation, 500 on every POST /runs)
- _locked flushes before its populate_existing SELECT: with autoflush off it silently
undid an earlier unflushed action in the same transaction
- document_roles hides document runs when Galena is disabled instead of 409 on every list
- tests: pg8000 reports CHECK violations as ProgrammingError; flush between in-session
actions like the API commit does; the fake session no longer counts an empty flush as a write
Verified on the VPS test stack: 581 passed / 5 skipped with WORKFLOW_RUN_INTEGRATION=1,
e2e test_expense_happy_path passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uwxqKwSiEuE8j2HHdFeD4
backend/tests/e2e/test_console.py drives a running stack with Playwright;
skipped unless playwright is installed and WORKFLOW_E2E_BASE_URL is set.
README: screens, API routes, e2e run. CLAUDE.md: lists/routers in Where
things live, e2e command, status after stages 1-7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Galena option is shown only when GET /options answers galena_enabled (viewNewRun: const galena = !!opts.galena_enabled). Adds GET /request-fields for any module user: a filer's form needs the pool's labels, kinds and options, and /admin/request-fields is the moderator's. Save as template posts the editor's stages to /admin/templates (keys dropped). A refused start after filing keeps the request and retries only the start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Archive filters live in the hash so a filtered view is a link and the CSV uses the same query;
the CSV button reads the hash at click time instead of splicing it into an onclick (attribute
entities decode before the script runs). New request, new run and settings are placeholders
for 7.2-7.4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /runs accepts the body dredd_core's WorkflowClient sends (full DocumentRef dict, re-pinned) and answers {run_id, state, link}. POST /files uploads a file subject. /stats counts with the lists' own counters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
services/lists.py: one Galena roles call per list, readability decided by pure
functions mirroring authz, can_* flags asked of the engine itself, CSV with a
formula guard. Mine = running runs the person started (the filer of a request
started by a moderator cannot read it per authz, so it is not listed).
Integration tests written, skipped here (no Postgres).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
requests.update refuses (409 request_approved) once a run approved or
signed the request: the timeline keeps only the snapshot hash, so an
edit would lose what was approved. Rejected or cancelled runs leave it
editable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runs.act now takes every engine action. add_stage re-checks the stage
with the run's subject kind (a role only on a Galena document) and fixes
its list; refresh resolves the current stage again and may close it;
paper_scan stores the signed scan in Galena under podpisane/ as the
person, falling back to plain files when Galena refuses or drafts it
(run.scan holds either ref, the step rests on the scan's hash).
requests.update edits a request: 409 request_locked while a run is in
progress unless editable_in_run, otherwise the run's edit_request in the
same transaction, resting on the new snapshot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open Color gray (gray7 #495057) is the only Atrium tile hue no family module wears (Q1). CLAUDE.md now describes the approval-run domain, the v0.24.0 pin, the workflow schema/roles and port 8141.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 409 run_in_progress must not tell somebody who cannot read a Galena document that a run exists on it: pin (or read the file) first, then check for a running run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runs.start pins the subject and resolves stage 0 before any write, then writes the run, the stage 0 list, the start event with evidence, the audit row and workflow.started in one transaction. A DocumentRef is re-pinned by id and path; templates.references is public for reuse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
templates.create/update/archive/save_as_template and groups.create/update/archive,
moderator-only, validation delegated to rules, references checked against the
database, every write audited. Group names unique among unarchived ones
(case-insensitive, advisory lock + partial index); template names are not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>