1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Ticket 12 — frozen submit-time revision content
Implemented in feat/signet-ticket12, integrating independently completed
fail-closed identity (ticket13). Accepted domain model unchanged. No production
or maa-1 access/service changes. Owner's CONSIDERATIONS.md was read in full;
customer signing remains a discussion handoff, not new implementation scope.
## Implementation
- The submit transaction locks the editable document, validates layout/route,
obtains a new server UUID and freezes inputs before accepting the revision.
One bounded atomic Redis EVAL reads only referenced organisation attributes.
Clients still provide references; client-supplied values are overwritten.
- Private snapshot-<UUID>/ directories hold copied DAM bytes (not hard links to
mutable assets), asset hashes and an immutable manifest.json for every revision.
Current snapshot_id/snapshot_json are stored in PostgreSQL. Corrections point
at a new snapshot; previous resolved metadata/assets remain available privately.
- Fonts, including the audit/default font, images and date format are frozen.
Every DAM path component is opened without following symlinks; only regular
files are accepted. Copying streams through16KB, rejects concurrent in-place
modification and limits aggregate copied assets to16MiB. Referenced PIM strings
are bounded to1023bytes, reject embedded NULs, and text plus prefix must fit the
existing1024-byte render buffer rather than silently truncate.
- Files and containing directories are synced before commit, with final read-only
modes set before fsync: assets/manifests0440, directories0550, shared-group read.
Regression tests assert the actual permissions. Known transaction rollback
removes newly created inputs. An ambiguous COMMIT retains files: deleting
potentially committed inputs would be data loss. Orphan inventory/retention
remains an explicit operational responsibility.
- Renderer context has no Redis connection, organisation lookup, live DAM path
or config font lookup. It consumes only server-resolved text and frozen asset
names. The worker verifies hashes; missing/damaged inputs fail closed, never
falling back to current PIM/DAM values.
- One successful flatten is cached privately as proof-<UUID>.pdf. Public proof
links it; initial stamped input is byte-identical. Database completion failure
and recovery reuse the cache without running the flatten again. Subsequent
sign-offs only overlay facsimiles on the committed body; release reads the
revision's frozen audit font. Only signetd reads sig_dir.
- Additive migration001 and upgrade/backup/recovery notes live under
sql/migrations/. Legacy pending revisions are not silently backfilled from
current values: drain them before upgrade or arrange authorised correction/
recreation and new sign-offs. New workers refuse unfrozen legacy inputs.
Clean-worktree verification also found packaging issues: the verified ticket11
JS/CSS had not reached the initial baseline commit; commit b97f77a restores those
exact tested bytes without modifying the original checkout. PIM's external JS
was missing from clean installs; the Makefile installs it and e2e checks HTTP200.
.gitattributes prevents global text/EOL rules from corrupting binary fixtures.
The visual comparison exposed an existing overlay-border bug: borders reduced
clientHeight/Width, making edit text/seals smaller than server output. Decorative
inset outlines preserve the complete imprint geometry. fitText/draw_text maths
are unchanged; a browser geometry/font-size assertion fails on the old CSS and
passes on the corrected CSS. No UI redesign or customer features were introduced.
## Verification
All data/images synthetic; tests run in isolated Alpine development containers.
Source/image verification is recorded in /tmp/signet-roadmap-build-final.log and
/tmp/signet-roadmap-image.txt. Latest stack: signet-roadmap-review :8082.
- Full clean build/install -Wall -Wextra, no warnings/errors.
- /tmp/signet-ticket12-e2e-final.log: identity + complete API/worker acceptance +
snapshot contract end with `all passed`.
- test/snapshot-contract.sh is a retained regression, dispatched through e2e:
- Rejects symlink/oversized assets, oversized/binary text and forged values;
forced submit DB rollback removes snapshots and does not burn a serial.
- Changes PIM text, seal and font after submit but before worker execution;
forces real qpdf failure, removes live inputs and retries successfully.
- Verifies raw proof/initial stamped equality, unchanged content at sign-off
and actual embedded font-stream hashes (not merely PDF font labels).
- Correction/resubmit preserves serial/date, creates distinct frozen inputs,
retains previous resolved metadata and releases with live inputs removed.
- Damaged frozen bytes fail closed; restoring exact bytes/permissions permits
retry. PostgreSQL-triggered completion failure/recovery preserves proof
bytes and does not execute qpdf flatten a second time.
- /tmp/signet-ticket12-render-final.log: existing render/release contract passes,
retaining typed/stale jobs, sign/release failure/replay, queue and enrol checks.
- /tmp/signet-ticket12-browser.log: real signing UI/API/worker/enrolment/release
pass with no unhandled JS errors; geometry/70%-size assertions included.
/tmp/signet-ticket12-progress.log: existing progress/error/retry regression pass.
- /tmp/signet-ticket12-border-red.log: the geometry regression fails as expected
against old borders, before changing CSS.
- Both pages visually compared in edit/proof/stamped/final, plus audit, under
/tmp/signet-ticket12-browser/. Text and circular seal align; only the proper
parties' facsimiles appear; first facsimile persists into final; audit legible.
- /tmp/signet-ticket12-migration.log: migration idempotence on current schema.
/tmp/signet-ticket12-legacy-migration.log: apply/idempotence on an isolated DB
built from original68ed63b schema. No shared or production DB was changed.
- Node/shell syntax and git diff --check pass.
## Follow-up image regression
Ticket14 resource review found the PDF writer was using suffixes to choose JPEG,
which fails for private asset-N snapshots. Header-based format detection restores
RGB JPEG support without changing snapshot names. A synthetic JPEG now covers
unit, live-input deletion, extracted-byte preservation and both-page browser/
visual checks; image interpolation was aligned with browser upscaling. See
`.scratch/roadmap/ticket-14.md` for the newer evidence and remaining native gates.
## Resource evidence and remaining gates
/tmp/signet-ticket12-rss-samples.log samples the isolated app UID processes
(lighttpd, kfcgi, API/parser children, signetd and same-UID qpdf/pdfinfo children)
at roughly50ms during the fixture suites/browser run. The final sample maximum
is29,576KB across691samples, recorded in /tmp/signet-ticket12-rss-summary.txt.
This excludes PostgreSQL,
Redis, browser/client RAM, and sampling can miss short peaks. It is NOT a native
1-vCPU benchmark, maximum concurrent-upload test or production capacity claim.
The16MiB frozen-input cap/streaming limits this new submit work, not the entire
runtime. Existing32MiB buffered uploads, oversized JSON parse/clone amplification,
child timeouts/limits, aggregate decoded images/fonts, shared DB/Redis impact,
backup/restore and native OpenRC/proxy/CSP
verification remain ticket14 release gates. Do not expose/deploy until addressed;
maa-1's mission-critical services must not be used as an uncontrolled test bed.
Invalid original PDF/DAM content cannot be repaired by silently taking today's
live inputs; use explicit authorised correction/recreation or exact verified
backup restoration. No speculative retention, administrative lifecycle shortcut,
shared-service reconfiguration or customer-signing model is introduced here.