diff --git a/.gitleaks.toml b/.gitleaks.toml
index 6cab2271..c9cfddf2 100644
--- a/.gitleaks.toml
+++ b/.gitleaks.toml
@@ -3,5 +3,5 @@
useDefault = true
[allowlist]
-description = "R4 report:compare oracle: sha256 digests of fixture PDFs whose names contain 'key' or 'keywords' (the /Keywords stamp cases); no secret can live in this generated file"
+description = "[gated 2026-10-18] R4 report:compare oracle: sha256 digests of fixture PDFs whose names contain 'key' or 'keywords' (the /Keywords stamp cases); no secret can live in this generated file"
paths = ['''^crates/core/tests/oracles/r4/compare/compare\.json$''']
diff --git a/apps/app/src/assets/brand/zenquality-logo-horizontal.png b/apps/app/src/assets/brand/zenquality-logo-horizontal.png
new file mode 100644
index 00000000..9161f607
Binary files /dev/null and b/apps/app/src/assets/brand/zenquality-logo-horizontal.png differ
diff --git a/apps/app/src/components/brand/Footer.tsx b/apps/app/src/components/brand/Footer.tsx
index f41fc4c2..26bd51a1 100644
--- a/apps/app/src/components/brand/Footer.tsx
+++ b/apps/app/src/components/brand/Footer.tsx
@@ -1,6 +1,9 @@
import { useConfig } from '@/app/providers/ConfigProvider'
import { useT } from '@/i18n/useT'
import pawsInHarmonyUrl from '@/assets/brand/paws-in-harmony.svg?url'
+// Bundled copy of zenquality.fr/assets/logo-horizontal-1024.png: the
+// production CSP (`img-src 'self' data: blob:`) refuses an external image.
+import zenQualityUrl from '@/assets/brand/zenquality-logo-horizontal.png?url'
export default function Footer() {
const cfg = useConfig()
@@ -22,7 +25,7 @@ export default function Footer() {
className="inline-flex items-center"
>
{
+ it('serves every image from the application, never an external host', () => {
+ render()
+ const sources = screen.getAllByRole('img').map((img) => img.getAttribute('src'))
+ expect(sources).toHaveLength(2)
+ for (const src of sources) {
+ expect(src).toMatch(/^\/|^data:|^blob:/)
+ expect(src).not.toMatch(/^https?:/)
+ }
+ })
+
+ it('keeps the credit links', () => {
+ render()
+ expect(screen.getByRole('link', { name: 'ZenQuality' })).toHaveAttribute(
+ 'href',
+ 'https://zenquality.fr',
+ )
+ expect(screen.getByRole('link', { name: 'Paws in Harmony' })).toHaveAttribute(
+ 'href',
+ 'https://www.instagram.com/paws.iin.harmony',
+ )
+ })
+})
diff --git a/scripts/browser/r4-app-csp.mjs b/scripts/browser/r4-app-csp.mjs
index 5816d7c3..799782b3 100644
--- a/scripts/browser/r4-app-csp.mjs
+++ b/scripts/browser/r4-app-csp.mjs
@@ -2,8 +2,8 @@
// OD-1): the server's two policies, the three engines, one reference PDF
// picked on Home, a fresh browser per engine and policy.
// with DEPLOY.md's policy, 'wasm-unsafe-eval' in script-src: the
-// import opens the editor; no violation for scripts, workers or
-// wasm (the footer's external image is the one known violation).
+// import opens the editor; no violation at all (the footer's
+// external image, the one known violation until R4.10, is bundled).
// without the keyword removed: the inline line « Le moteur de lecture n'a
// pas pu être chargé. Réessayez l'import. », the button enabled
// again, no page error, and a second pick of the same file shows
@@ -63,7 +63,6 @@ const PASSES = [
{ variant: 'with', reporting: true },
{ variant: 'without', reporting: true },
]
-const KNOWN_IMAGE_HOST = 'zenquality.fr'
const CSP_TEXT = /content.security.policy|refused to|unsafe-eval|\bCSP\b/i
const LATE_VIOLATIONS_MS = 2000
const RETRY_TIMEOUT_MS = 30_000
@@ -165,14 +164,9 @@ async function retryImport(tab) {
/** The violations and console messages that name the policy. */
function violationsOf(row, seen) {
- const documentViolations = row.cspViolations ?? []
- const consoleCsp = seen.console.filter((m) => CSP_TEXT.test(m.text))
- const known = (text) => text.includes(KNOWN_IMAGE_HOST)
return {
- documentViolations,
- unexpectedDocumentViolations: documentViolations.filter((v) => !known(v)),
- consoleCsp,
- unexpectedConsoleCsp: consoleCsp.filter((m) => !known(m.text)),
+ documentViolations: row.cspViolations ?? [],
+ consoleCsp: seen.console.filter((m) => CSP_TEXT.test(m.text)),
}
}
@@ -196,11 +190,10 @@ function problemsOf(variant, row, coreUnavailable) {
if (row.pageErrors?.length) problems.push('page errors')
if (row.crashed) problems.push('page crashed')
if (variant === 'with') {
- const known = (r) => String(r.blockedUri).includes(KNOWN_IMAGE_HOST)
if (row.outcome !== 'editor') problems.push(`outcome ${row.outcome}`)
- if (row.unexpectedDocumentViolations.length) problems.push('violations')
- if (row.unexpectedConsoleCsp.length) problems.push('CSP console messages')
- if (row.reports?.some((r) => !known(r))) problems.push('reports')
+ if (row.documentViolations.length) problems.push('violations')
+ if (row.consoleCsp.length) problems.push('CSP console messages')
+ if (row.reports?.length) problems.push('reports')
return problems
}
if (row.errorText !== coreUnavailable) problems.push('inline line')
@@ -341,7 +334,7 @@ async function main() {
bytes: readFileSync(REFERENCE).length,
sha256: sha256(readFileSync(REFERENCE)),
},
- expected: { without: coreUnavailable, knownImageHost: KNOWN_IMAGE_HOST },
+ expected: { without: coreUnavailable, violations: 'none' },
observation:
"document: the init-script probe's securitypolicyviolation events; " +
'console: every message of the page and its workers; reporting ' +
diff --git a/scripts/browser/results/2026-10-21-r4-csp.json b/scripts/browser/results/2026-10-21-r4-csp.json
new file mode 100644
index 00000000..92356d94
--- /dev/null
+++ b/scripts/browser/results/2026-10-21-r4-csp.json
@@ -0,0 +1,83 @@
+{
+ "harness": "scripts/browser/r4-app-csp.mjs",
+ "startedAt": "2026-10-21T13:43:08.420Z",
+ "watchdog": {
+ "ceilingBytes": 4294967296,
+ "sampleIntervalMs": 50,
+ "measure": "summed VmRSS (/proc//status) of the browser process tree; content = renderer / Web Content / WPEWebProcess processes only",
+ "onCeiling": "SIGKILL of the tree, run recorded as stopped_by_ceiling",
+ "caveat": "The 4 GiB RSS watchdog is not a guaranteed memory limit: it samples every 50 ms, so a faster allocation can overshoot it before the kill; summed VmRSS counts shared pages once per process; a process outside the browser's tree is not seen."
+ },
+ "host": {
+ "cpuModel": "11th Gen Intel(R) Core(TM) i7-11700B @ 3.20GHz",
+ "logicalCpus": 16,
+ "ramBytes": 15815053312,
+ "memAvailableBytesAtStart": 10363768832,
+ "kernel": "7.0.0-38-generic",
+ "arch": "x64",
+ "node": "v24.21.0",
+ "memAvailableBytesAtEnd": 10259890176
+ },
+ "build": {
+ "distDir": "/home/bchanot/Documents/faunosteo/apps/app/dist",
+ "builtAt": "2026-10-21T13:42:57.103Z",
+ "sheetChunk": {
+ "name": "_virtual_faunosteo-sheet-vxifkiH_.js",
+ "bytes": 377259,
+ "sha256": "44ef9bf7c6f64dd621f6656dd1de88689f2f74c998ec0b0822483674721d26b8"
+ },
+ "entryChunk": {
+ "name": "index-DJ2b97Wd.js",
+ "bytes": 921784,
+ "sha256": "578225d4bfbac7a1c00907bb9ca0012545a2d0716163d7e900ff7068b5b40adc"
+ },
+ "wasm": {
+ "name": "faunosteo_wasm_bg-9CH7GQ4e.wasm",
+ "bytes": 1535289,
+ "sha256": "8abfe5d7392fdca75e624a358b070ad577e21da9f550d3cdd96a9538ac167b54"
+ },
+ "importWorker": {
+ "name": "import.worker-BSrH6NM8.js",
+ "bytes": 8175,
+ "sha256": "f667c4c5222bc7cd3311da788e3ecd6cf6156a4a9757b21c8730d93463ac5200"
+ },
+ "headCommit": "1814a8d"
+ },
+ "playwrightCore": "1.64.0",
+ "reference": {
+ "file": "apps/app/tests/fixtures/pdf/r3/demo.fr.logos.pdf",
+ "bytes": 242767,
+ "sha256": "ca9aadd05947912eb4d84c66c56e810abc8030fd69af892d98a019ad54c3f7b3"
+ },
+ "expected": {
+ "without": "Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.",
+ "violations": "none"
+ },
+ "observation": "document: the init-script probe's securitypolicyviolation events; console: every message of the page and its workers; reporting passes: the same enforced directives plus report-uri, the reports the browser POSTs (a worker's own violation events fire in its scope, out of the harness's reach otherwise)",
+ "policies": {
+ "with": "default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'wasm-unsafe-eval'; font-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'",
+ "without": "default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self'; font-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'",
+ "with + report-uri": "default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'wasm-unsafe-eval'; font-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; report-uri /__csp-report",
+ "without + report-uri": "default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self'; font-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; report-uri /__csp-report"
+ },
+ "runs": [
+{"variant":"with","reporting":false,"engine":"chromium","engineVersion":"156.0.8078.4","outcome":"editor","durationMs":105.32999899999999,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":94.70000004768372,"longTasks":{"count":0,"maxMs":0,"totalMs":0},"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"with","reporting":false,"engine":"firefox","engineVersion":"157.0","outcome":"editor","durationMs":261.60911799999985,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":98,"longTasks":null,"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"with","reporting":false,"engine":"webkit","engineVersion":"27.2","outcome":"editor","durationMs":94.84215699999913,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":90,"longTasks":null,"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"without","reporting":false,"engine":"chromium","engineVersion":"156.0.8078.4","outcome":"error","durationMs":22.482552999999825,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":{"count":0,"maxMs":0,"totalMs":0},"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"without","reporting":false,"engine":"firefox","engineVersion":"157.0","outcome":"error","durationMs":78.97164200000043,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":null,"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"without","reporting":false,"engine":"webkit","engineVersion":"27.2","outcome":"error","durationMs":78.12200900000244,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":null,"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"problems":[]},
+{"variant":"with","reporting":true,"engine":"chromium","engineVersion":"156.0.8078.4","outcome":"editor","durationMs":98.57746300000144,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":90.70000004768372,"longTasks":{"count":0,"maxMs":0,"totalMs":0},"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[],"problems":[]},
+{"variant":"with","reporting":true,"engine":"firefox","engineVersion":"157.0","outcome":"editor","durationMs":275.8176769999991,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":91,"longTasks":null,"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[],"problems":[]},
+{"variant":"with","reporting":true,"engine":"webkit","engineVersion":"27.2","outcome":"editor","durationMs":93.34793400000126,"finalPath":"/editor","errorText":null,"dialogs":["Restauration complète.\n\nArchive Faunosteo importée : bilan et instantané de la fiche d'origine conservés."],"pageMs":89,"longTasks":null,"pageErrors":[],"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[],"problems":[]},
+{"variant":"without","reporting":true,"engine":"chromium","engineVersion":"156.0.8078.4","outcome":"error","durationMs":23.575134999999136,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":{"count":0,"maxMs":0,"totalMs":0},"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[{"documentPath":"/assets/import.worker-BSrH6NM8.js","effectiveDirective":"script-src","violatedDirective":"script-src","blockedUri":"wasm-eval","sourceFile":"/assets/import.worker-BSrH6NM8.js","disposition":"enforce"},{"documentPath":"/assets/import.worker-BSrH6NM8.js","effectiveDirective":"script-src","violatedDirective":"script-src","blockedUri":"wasm-eval","sourceFile":"/assets/import.worker-BSrH6NM8.js","disposition":"enforce"}],"problems":[]},
+{"variant":"without","reporting":true,"engine":"firefox","engineVersion":"157.0","outcome":"error","durationMs":83.20322500000111,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":null,"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[{"documentPath":"/assets/import.worker-BSrH6NM8.js","effectiveDirective":"script-src","violatedDirective":"script-src","blockedUri":"wasm-eval","sourceFile":"/assets/import.worker-BSrH6NM8.js","disposition":"enforce"},{"documentPath":"/assets/import.worker-BSrH6NM8.js","effectiveDirective":"script-src","violatedDirective":"script-src","blockedUri":"wasm-eval","sourceFile":"/assets/import.worker-BSrH6NM8.js","disposition":"enforce"}],"problems":[]},
+{"variant":"without","reporting":true,"engine":"webkit","engineVersion":"27.2","outcome":"error","durationMs":22.635161999998672,"finalPath":"/","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","dialogs":[],"pageMs":null,"longTasks":null,"pageErrors":[],"buttonEnabledAfter":true,"retry":{"shown":true,"errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","buttonEnabledAfter":true},"documentViolations":[],"consoleCsp":[],"crashed":false,"workers":[{"path":"/assets/import.worker-BSrH6NM8.js","closed":true},{"path":"/assets/import.worker-BSrH6NM8.js","closed":true}],"console":[],"consoleCount":0,"reports":[],"problems":[]}
+],
+ "endedAt": "2026-10-21T13:43:45.732Z",
+ "engines": {
+ "chromium": "156.0.8078.4",
+ "firefox": "157.0",
+ "webkit": "27.2"
+ }
+}
diff --git a/scripts/browser/results/2026-10-21-r4-offline-import.json b/scripts/browser/results/2026-10-21-r4-offline-import.json
new file mode 100644
index 00000000..584a9fca
--- /dev/null
+++ b/scripts/browser/results/2026-10-21-r4-offline-import.json
@@ -0,0 +1,37 @@
+{
+ "date": "2026-10-21",
+ "playwright": "1.64.0",
+ "build": {
+ "distDir": "/home/bchanot/Documents/faunosteo/apps/app/dist",
+ "builtAt": "2026-10-21T13:42:57.103Z",
+ "sheetChunk": {
+ "name": "_virtual_faunosteo-sheet-vxifkiH_.js",
+ "bytes": 377259,
+ "sha256": "44ef9bf7c6f64dd621f6656dd1de88689f2f74c998ec0b0822483674721d26b8"
+ },
+ "entryChunk": {
+ "name": "index-DJ2b97Wd.js",
+ "bytes": 921784,
+ "sha256": "578225d4bfbac7a1c00907bb9ca0012545a2d0716163d7e900ff7068b5b40adc"
+ },
+ "wasm": {
+ "name": "faunosteo_wasm_bg-9CH7GQ4e.wasm",
+ "bytes": 1535289,
+ "sha256": "8abfe5d7392fdca75e624a358b070ad577e21da9f550d3cdd96a9538ac167b54"
+ },
+ "importWorker": {
+ "name": "import.worker-BSrH6NM8.js",
+ "bytes": 8175,
+ "sha256": "f667c4c5222bc7cd3311da788e3ecd6cf6156a4a9757b21c8730d93463ac5200"
+ },
+ "headCommit": "1814a8d"
+ },
+ "runs": [
+{"engine":"chromium","mode":"emulate","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"editor","errorText":null,"pageErrors":[],"problems":[]},
+{"engine":"chromium","mode":"stop","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"editor","errorText":null,"pageErrors":[],"problems":[]},
+{"engine":"firefox","mode":"emulate","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"editor","errorText":null,"pageErrors":[],"problems":[]},
+{"engine":"firefox","mode":"stop","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"editor","errorText":null,"pageErrors":[],"problems":[]},
+{"engine":"webkit","mode":"emulate","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"error_text","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","pageErrors":[],"problems":[]},
+{"engine":"webkit","mode":"stop","headers":{"envJs":"no-store, no-cache, must-revalidate","workerChunk":"public, max-age=31536000, immutable","asNginx":true},"online":"editor","replaced":true,"offline":"error_text","errorText":"Le moteur de lecture n'a pas pu être chargé. Réessayez l'import.","pageErrors":[],"problems":[]}
+]
+}