diff --git a/.planning/phases/35-mail-templates-and-layouts-editor/35-VERIFICATION.md b/.planning/phases/35-mail-templates-and-layouts-editor/35-VERIFICATION.md index ebada98e..086a7fd8 100644 --- a/.planning/phases/35-mail-templates-and-layouts-editor/35-VERIFICATION.md +++ b/.planning/phases/35-mail-templates-and-layouts-editor/35-VERIFICATION.md @@ -1,8 +1,8 @@ --- phase: 35-mail-templates-and-layouts-editor -verified: 2026-11-13T13:43:11Z -status: human_needed -score: 12/12 must-haves verified +verified: 2026-11-13T21:30:50Z +status: gaps_found +score: 13/14 must-haves verified covered_files: - .planning/phases/35-mail-templates-and-layouts-editor/35-01-PLAN.md - .planning/phases/35-mail-templates-and-layouts-editor/35-01-SUMMARY.md @@ -12,11 +12,18 @@ covered_files: - .planning/phases/35-mail-templates-and-layouts-editor/35-03-SUMMARY.md - .planning/phases/35-mail-templates-and-layouts-editor/35-04-PLAN.md - .planning/phases/35-mail-templates-and-layouts-editor/35-04-SUMMARY.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-05-PLAN.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-05-SUMMARY.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-06-PLAN.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-06-SUMMARY.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-07-PLAN.md + - .planning/phases/35-mail-templates-and-layouts-editor/35-07-SUMMARY.md - admin/openapi/admin.json - admin/package-lock.json - admin/package.json - admin/src/api/schema.d.ts - admin/src/api/types.ts + - admin/src/components/form/LocaleVariantSwitcher.vue - admin/src/components/form/codeeditor/editor.ts - admin/src/components/form/fields/CodeEditorField.vue - admin/src/components/form/fields/ColorPickerField.vue @@ -38,6 +45,7 @@ covered_files: - admin/tests/form/CodeEditorField.test.ts - admin/tests/form/ColorPickerField.test.ts - admin/tests/form/FormViewMail.test.ts + - admin/tests/form/LocaleVariantSwitcher.test.ts - admin/tests/form/MailImageField.test.ts - admin/tests/form/MailImagePicker.test.ts - admin/tests/form/MailPreviewField.test.ts @@ -55,6 +63,8 @@ covered_files: - docs/services/mail.md - docs/services/rate-limiting.md - docs/services/storage.md + - go.mod + - go.sum - modules/boardwalk/dist/assets/dm-mono-latin-400-normal--0xN8mdc.woff - modules/boardwalk/dist/assets/dm-mono-latin-400-normal-4GdczIuU.woff2 - modules/boardwalk/dist/assets/dm-mono-latin-500-normal-CN8Miw6E.woff @@ -79,12 +89,12 @@ covered_files: - modules/boardwalk/dist/assets/dm-sans-latin-ext-600-normal-DRtaDpgU.woff - modules/boardwalk/dist/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff - modules/boardwalk/dist/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 - - modules/boardwalk/dist/assets/editor-Bd7FUlHB.js + - modules/boardwalk/dist/assets/editor-DL0km8ky.js - modules/boardwalk/dist/assets/editor-uDgt9VKj.js - modules/boardwalk/dist/assets/index-Bvfii4cZ.css - - modules/boardwalk/dist/assets/index-C4FC7bPJ.js + - modules/boardwalk/dist/assets/index-DKWSpBPg.js - modules/boardwalk/dist/assets/index-Vcq4gwWv.js - - modules/boardwalk/dist/assets/load-BWLbnrie.js + - modules/boardwalk/dist/assets/load-7hoJXD7k.js - modules/boardwalk/dist/favicon.ico - modules/boardwalk/dist/index.html - modules/cabana/README.md @@ -120,8 +130,10 @@ covered_files: - modules/cabana/form_schema.go - modules/cabana/http.go - modules/cabana/mail_admin.go + - modules/cabana/mail_brand_layout_postgres_test.go - modules/cabana/mail_diff.go - modules/cabana/mail_lifecycle_postgres_test.go + - modules/cabana/mail_locale_postgres_test.go - modules/cabana/mail_permissions_postgres_test.go - modules/cabana/mail_routes.go - modules/cabana/mail_screens_smoke_test.go @@ -147,8 +159,11 @@ covered_files: - modules/phrasebook/backend/lang/pl/lang.yaml - modules/postcard/README.md - modules/postcard/assets/brand.css.tmpl + - modules/postcard/assets/default.htm - modules/postcard/assets/minimal.htm - modules/postcard/assets/partials/button.htm + - modules/postcard/assets/partials/footer.htm + - modules/postcard/assets/partials/header.htm - modules/postcard/assets/partials/panel.htm - modules/postcard/assets/partials/subcopy.htm - modules/postcard/assets/partials/table.htm @@ -160,7 +175,13 @@ covered_files: - modules/postcard/editor.go - modules/postcard/editor_smoke_test.go - modules/postcard/editor_test.go + - modules/postcard/inline.go + - modules/postcard/inline_test.go + - modules/postcard/layouts_test.go + - modules/postcard/locale_postgres_test.go + - modules/postcard/locale_test.go - modules/postcard/mailer.go + - modules/postcard/mailer_test.go - modules/postcard/override_smoke_test.go - modules/postcard/override_test.go - modules/postcard/partials.go @@ -175,178 +196,284 @@ covered_files: - modules/surf/serve.go - modules/surf/store_lookup_test.go - scripts/check-phase35.sh -covered_digest: "v2:sha256:402ba8f1c62f397e73e8ea69cc9299bbf5c8aa2dc727d51a0fe6484b18b419ba" +covered_digest: "v2:sha256:f4b2434769c05675324d4203048de747593a6027ea0f5084450f9ea23790f146" behavior_unverified: 0 overrides_applied: 0 +re_verification: + previous_status: human_needed + previous_score: 12/12 + gaps_closed: + - "G-35-1: locale variants of one mail template are one admin record with a locale switcher (35-05, tests in 35-07); automated evidence green, visual re-run of UAT test 1 still owed" + - "G-35-8 (framework part): built-in default/system/minimal layouts with logo-or-name header, card, footer, Branding site name, button partial, CSS inlining with opt-out (35-06, tests in 35-07); scoped visual re-run of UAT test 8 still owed" + gaps_remaining: [] + regressions: + - "CR-01 (new in 35-06): a site name containing javascript:/vbscript:/data: (Branding Site name, or the display name of mail.from with no admin action) makes every send on the default and system layouts fail, including the file-version fallback; reproduced by the verifier" +gaps: + - truth: "Mail that already works keeps working: an application that sends mail today keeps sending it after upgrading, and no admin-saved Branding value can stop mail on the built-in layouts (roadmap goal clause; 35-06 must-have 'Mail that works today keeps working'; 35-01 D-14 'a failing override never stops mail')" + status: failed + reason: "35-06 began printing siteName (Branding Site name, falling back to the display name of mail.from) in the header and footer of the default and system layouts. Rendered HTML then goes through validateHTML, whose dangerousScheme regex `(?i)(?:javascript|vbscript|data):` matches any substring with no word boundary or attribute context. A sender such as `\"Metadata: Weekly\" ` or a Branding name such as `Big Data: Summit` makes Send return `postcard: rendered HTML contains a dangerous URL scheme` for every template on the default or system layout. The file version is no fallback: mailer.options carries the same siteName into it. At v0.6.3 the same mail.from sent fine, because default.htm printed no name. The Branding form accepts such a name (rules: nullable|max:255, BeforeValidate only trims), and Editor.Validate then refuses every template/layout save on those layouts. Verifier probe (go test -overlay, no source change): from_metadata, brand_big_data, layout default and layout system all return that error; minimal and plain names send. 35-07 pinned the unsafe-name behaviour as current (TestMailBrandSiteName/unsafe_name_current_behaviour) and left it open; no test covers the send path." + artifacts: + - path: "modules/postcard/mailer.go" + issue: "siteName()/options() pass any Branding or mail.from display name into every built-in layout render, file version included, so it can fail the safety check" + - path: "modules/postcard/templates.go" + issue: "dangerousScheme (line 45) is unanchored and runs over the whole rendered document, so plain text such as 'Big Data: Summit' counts as a URL scheme" + - path: "modules/postcard/assets/default.htm" + issue: "header partial and footer copyright print .siteName (system.htm does the same)" + - path: "modules/cabana/mail_admin.go" + issue: "MailBrandSetting site_name has no save-time check (Rules nullable|max:255, BeforeValidate trims only), so the Branding form stores a name that breaks sends and saves" + missing: + - "At render time, a site name never fails a send: drop (or neutralise) a name that would fail the safety check and log a rate-limited warning, on the override path and the file-version path" + - "Save-time refusal on the Branding site_name field with a translated en/pl message (reuse the postcard check, e.g. an exported helper)" + - "Regression tests: Send on default and system layouts with mail.from '\"Metadata: Weekly\" ' and with Branding SiteName 'Big Data: Summit' succeeds; Branding save of an unsafe name is a 422 on site_name; a template save under a previously stored unsafe name is not refused; replace TestMailBrandSiteName/unsafe_name_current_behaviour" + - "Optional, same plan: anchor dangerousScheme to URL-bearing attribute values instead of the whole document (it also rejects body text like 'metadata:'); bundle WR-01 (site name parsed as Markdown in the footer) since it touches the same copyright line" advisory: - - finding: "Layout status filter hides database-only layouts (WR-01)" + - finding: "WR-01: site name is rendered as Markdown in the footer partial (`*Acme*` becomes , `Acme ` loses text, `[x](url)` becomes a link) while the header prints it literally" category: other - reason: "35-REVIEW.md WR-01 — filter customized/outdated require source IS NOT NULL; custom layouts vanish under any status value. Does not break default unfiltered list or editability must-haves." - evidence_status: "code present; advisory from code review" - - finding: "Unknown filterStatus value leaves query unfiltered (WR-02)" + reason: "35-REVIEW.md WR-01; admin-controlled input, cosmetic or consistency issue; fix alongside CR-01" + evidence_status: "reported by code review probe; not re-run by verifier" + - finding: "WR-02: EnsureLocaleRows takes the global advisory lock and upserts sibling rows inside ShowRecord/save transactions, which can deadlock with SyncIndex and makes a GET write" + category: architectural + reason: "35-REVIEW.md WR-02; self-heals (one side's savepoint absorbs the deadlock) but adds ~1s stalls; not goal-blocking" + evidence_status: "code inspection by review; no reproducing test" + - finding: "WR-03: mailLocales swallows TranslationWriter errors while running on the request transaction, so a failed optional-plugin query aborts the transaction and the template show returns 500" category: other - reason: "35-REVIEW.md WR-02 — soft filter hygiene; wrong values should match nothing." - evidence_status: "code present; advisory from code review" - - finding: "Mail image upload errors ignore field-level ValidationError details (WR-03)" + reason: "35-REVIEW.md WR-03; conditional on a failing optional translation plugin" + evidence_status: "code inspection by review; no reproducing test" + - finding: "WR-04: two-letter fallback-locale rule resolves typos such as order-ok to the base template and rejects 3-letter or multi-subtag locales" category: other - reason: "35-REVIEW.md WR-03 — UX; operators often see generic Validation failed." - evidence_status: "code present; advisory from code review" - - finding: "Partial/layout draftEmpty only checks content_html (WR-04)" - category: other - reason: "35-REVIEW.md WR-04 — text-only drafts show empty preview state; server can still render text." - evidence_status: "code present; advisory from code review" -human_verification: - - test: "Open Settings → Mail → Mail templates in a running admin SPA with a plugin that registers HasMailTemplates (e.g. user plugin templates)." - expected: "All registered templates appear; customize subject/body/layout; save; Reset to file version restores file content; drift callout appears after file change." - why_human: "List/form UX, Winter-shaped flow and empty-state copy need visual confirmation beyond unit/API tests." - - test: "Edit a layout in codeeditor (HTML/text/CSS tabs); insert an image from the library; save Branding colours and logo; preview HTML/plain text; Send test to me." - expected: "CodeMirror highlighting/focus feels correct; inserted URL is absolute server URL; preview iframe is sandboxed server HTML; test mail arrives only at the signed-in admin address (Mailpit)." - why_human: "35-VALIDATION.md manual-only rows (D-09 feel, D-17 inbox rendering); visual appearance and real mail-client rendering cannot be proven by grep." + reason: "35-REVIEW.md WR-04; does not affect names that have files, so working mail is unaffected" + evidence_status: "reported by code review probe" + - finding: "WR-05: scheme check runs before entity decoding; with disable_auto_inline_css on, an admin-written layout with href=\"javascript:...\" passes; with inlining on, a post-inline failure stops the message, contradicting docs" + category: security + reason: "35-REVIEW.md WR-05; requires an administrator with system.manage_mail_layouts to write the payload" + evidence_status: "reported by code review probe" +human_verified: + - test: "Customize and save a template" + uat_row: 2 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Reset to file version" + uat_row: 3 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Drift notice" + uat_row: 4 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Layout editor" + uat_row: 5 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Insert image into layout" + uat_row: 6 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Branding" + uat_row: 7 + recorded_at: "2026-11-13T21:09:53.000Z" + - test: "Send test to me" + uat_row: 9 + recorded_at: "2026-11-13T21:09:53.000Z" - test: "Confirm judgment-tier prohibition: postcard imports modules/lagoon/attach for AbsolutePublicURL." - expected: "Accept as intentional (D-24 / 35-01 SUMMARY threat_flag dependency-surface) or request a follow-up to move AbsolutePublicURL out of lagoon." - why_human: "PLAN prohibition said postcard must not import lagoon; implementation imports attach by design. Judgment-tier — needs explicit human resolution." + uat_row: 10 + recorded_at: "2026-11-13T21:09:53.000Z" +human_verification: # pending human items, kept although status is gaps_found so they are not lost; run after the CR-01 gap closure + - test: "Template list" + expected: "On sm-demo-app rebuilt on this framework commit: Mail templates shows one row per template with a Customized locales column; opening a template shows the Language switcher under the title; switching to a locale without a file, saving it and switching back works behind the unsaved-changes confirm. Re-run UAT test 1 in full." + why_human: "Placement and readability of the switcher and the Customized locales column in the embedded admin (35-VALIDATION Manual-Only, G-35-1)" + - test: "Preview" + expected: "Scoped re-run: first reset the UAT overrides of golem15.user::mail.activate and golem15.user::mail.layouts.user; save Branding with a logo and a Site name; preview a template switched to the default layout and then the system layout, with a body override calling {{ partial \"button\" \"url\" \"https://example.com\" \"body\" \"Go\" }}. Expect the logo header (or the name without a logo), the white card, the styled button and the footer (© year and name)." + why_human: "Visual rendering of the built-in layouts in the admin preview (35-VALIDATION Manual-Only, G-35-8 framework part)" + - test: "Inlined mail in a real inbox" + expected: "Test-send a template in the default layout to a real webmail/Outlook inbox; the button and card keep their colours with the style block stripped" + why_human: "Mail clients differ in what they keep of a style block; cannot be asserted by unit tests" + - test: "Confirm judgment-tier prohibitions of 35-05..35-07" + expected: "Accept: no sibling repository changed (sm-user-plugin and sm-paymentgateway-plugin trees clean before and after the verifier's consumers run); nothing pushed or tagged (master is 75 commits ahead of origin, newest tag v0.6.4 predates the gap closure); 35-07 changed only tests, the gate script and planning docs" + why_human: "Judgment-tier prohibitions need explicit human resolution; the verifier's LLM judgment is non-authoritative" --- # Phase 35: Mail templates and layouts editor Verification Report **Phase Goal:** Administrators edit every mail the application sends from the admin panel, as in WinterCMS's Mail templates screen. System mail and the templates plugins register through `pact.HasMailTemplates` appear in a list. Each template can get a database override of its subject and body, and the override can be reset to the file version. Layouts become admin-editable records assigned to templates, with a few predefined layouts seeded. Images can be uploaded and placed in layouts and templates. postcard renders the override when one exists, otherwise the plugin's file, so mail that already works keeps working. - -**Verified:** 2026-11-13T13:43:11Z -**Status:** human_needed -**Re-verification:** No — initial verification +**Verified:** 2026-11-13T21:30:50Z +**Status:** gaps_found +**Re-verification:** Yes. This report regenerates the stale 2026-11-13T13:43Z report after gap-closure plans 35-05 (G-35-1), 35-06 (G-35-8) and 35-07 (tests and gate). The previous report had no `gaps:` block, so every must-have was re-derived and re-checked. ## Goal Achievement -Roadmap lists **Requirements: TBD** and no Success Criteria block for Phase 35. Must-haves are derived from the ROADMAP goal (Option C) and merged with PLAN frontmatter truths (D-01..D-25). `check.decision-coverage-verify`: **25/25** CONTEXT decisions honored. +ROADMAP has no Success Criteria block and `Requirements: TBD` for Phase 35. Must-haves are derived from the goal's clauses (Option C) and merged with the PLAN frontmatter truths of 35-01..35-07. Rows 1-10 and 14 group the 35-01..04 truths that the previous report verified; the verifier re-checked them for regressions. Rows 2, 3, 6-8, 11 and 12 carry the gap-closure truths. ### Observable Truths | # | Truth | Status | Evidence | | --- | --- | --- | --- | -| 1 | Administrators edit mail from Settings → Mail screens (templates, layouts, partials, branding, images) with no top-level nav | ✓ VERIFIED | `modules/cabana/mail_admin.go` + `backend_screens.go` register five Settings entries and controllers; smoke `TestMailScreensSmoke`; SPA generic FormView/ListView/SettingsFormView | -| 2 | Templates from `pact.HasMailTemplates` (and file catalog) appear as list rows after SyncIndex | ✓ VERIFIED | `postcard.SyncIndex` in `store.go`; cabana `http.go` → `mail.syncOnDatabase` → `postcard.SyncIndex`; list YAML under `backendscreens/controllers/mailtemplates/` | -| 3 | Template DB override of subject, Markdown body and layout; Reset clears override and re-mirrors file | ✓ VERIFIED | `mailer.go` per-send `NewDBSource`; `ResetOverride` in `store.go`; `go test -short ./modules/postcard -run 'TestOverride'` PASS; cabana `TestMailReset` exists | -| 4 | Layouts are admin-editable (file override + custom create/delete); predefined `default`, `system`, `minimal` seeded as files | ✓ VERIFIED | assets `default.htm`/`system.htm`/`minimal.htm`; layout form + `TestMailLayoutDelete`; template `fields.yaml` layout dropdown | -| 5 | Images uploadable via mail library and insertable into templates/layouts/partials | ✓ VERIFIED | `GET/POST /mail/images` in `mail_routes.go`; `MailImagePicker.vue` + `insertImage.ts`; SPA tests `insertImage`/`MailImagePicker` PASS | -| 6 | postcard renders override when present, else file; fallback on failure; no boot-time snapshot | ✓ VERIFIED | `mailer.render` / `overrides()` once per send; `TestOverride`+`TestFallback` PASS; Activate installs `NewDBSource(app)` | -| 7 | Partials via additive `pact.HasMailPartials`; built-ins button/panel/table/subcopy; Markdown-safe `partial` | ✓ VERIFIED | `capabilities.go` HasMailPartials; `partials.go`; `TestPartial` PASS | -| 8 | Branding colours + logo replace `mail.brandCss` once row exists; logoUrl absolute at send time | ✓ VERIFIED | `brand.go` CompileBrandCSS; `store.go` calls `attach.AbsolutePublicURL`; `TestBrand` PASS | -| 9 | Live draft preview (sandboxed iframe) and test-send to signed-in admin only, rate-limited | ✓ VERIFIED | `MailPreviewField.vue` `sandbox=""`; `mailTestSend` refuses recipient; SPA MailPreviewField tests PASS (sequence guard); `TestMailTestSend` exists | -| 10 | Permission split `system.manage_mail_templates` / `system.manage_mail_layouts`; no default role grants | ✓ VERIFIED | `backend_screens.go` constants; `TestMailPermissions` listed; smoke asserts zero default grants | -| 11 | Drift: customized + outdated when `base_hash` ≠ `file_hash`; File version diff; re-save clears | ✓ VERIFIED | SyncIndex hash columns; cabana row states; `TestMailDrift` exists; `mail_diff.go` | -| 12 | D-21 gate: `scripts/check-phase35.sh` + unit/SPA coverage map filled | ✓ VERIFIED | `--self-test` PASS; `35-VALIDATION.md` nyquist_compliant + Wave 0 checked; artifact tests present | +| 1 | Administrators edit mail from Settings → Mail (templates, layouts, partials, branding, images) | ✓ VERIFIED | `mail_admin.go`/`backend_screens.go` unchanged in shape. UAT rows 2, 5, 7 and 9 passed. The cabana Postgres tests pass (below). | +| 2 | Templates registered through `pact.HasMailTemplates` appear in the list, **one row per template** however many locales (G-35-1, supersedes D-05) | ✓ VERIFIED | `ListExtendQuery` keeps one representative row per `base_code`; `columns.yaml` has `customized_locales`; the locale filter is gone. `TestMailLocaleGroups/one_row_per_template` PASS (run by the verifier). The visual re-run of UAT test 1 is still owed (human item). | +| 3 | The template form has a locale switcher. A locale without a file shows the default version and can be customized, reset and drift-tracked per locale. | ✓ VERIFIED | `LocaleVariantSwitcher.vue` (`data-locale-variant`) is rendered by `FormView.vue:714` from `meta.localeVariants` when there are 2 or more variants. `postcard.EnsureLocaleRows` is called from sync (`mail_admin.go:220`) and from the show hook (`:1971`). `TestMailLocaleGroups/{variants,fallback_shows_default_version,save_then_send,reset,drift_through_the_base_file,ids_outside_the_group,permissions_on_fallback_rows,locale_enabled_at_run_time}` PASS. The SPA switcher and FormViewMail tests pass (14/14). | +| 4 | Each template can get a DB override of its subject and body; Reset restores the file version | ✓ VERIFIED | `TestOverride` and `TestFallback` PASS. `ResetOverride` accepts fallback codes (`TestEnsureLocaleRows` PASS). UAT rows 2 and 3 passed. | +| 5 | Layouts are admin-editable records assigned to templates; predefined layouts default, system and minimal are seeded | ✓ VERIFIED | assets `default.htm`/`system.htm`/`minimal.htm`; layout form; UAT row 5 passed. `SyncIndex` mirrors the file layouts. | +| 6 | Built-in layouts look finished: default and system have a logo-or-name header, the white card and the © footer; minimal shows the logo; the button partial is styled in all three (G-35-8 framework part) | ✓ VERIFIED | `default.htm` (`layout-default`, `partial "header"`, `inner-body`, footer). `system.htm` calls header and footer; the `.layout-system .content-cell` override is gone. `minimal.htm:12` prints the logo img. `TestBuiltinLayoutsLogo`, `TestHeaderFooterPartials` and `TestButtonPartial` PASS. The scoped visual re-run of UAT test 8 is still owed. | +| 7 | Branding has a Site name; when it is empty, the display name of mail.from is used | ✓ VERIFIED | `Brand.SiteName`, migration `202611130002_mail_brand_site_name`, `siteName()` in `mailer.go:176`, and the `site_name` field in `mailbrandsetting/fields.yaml`. `TestSiteName` and `TestMailBrandSiteName/{saved_trimmed,max_length,preview,send}` PASS. | +| 8 | CSS is inlined at render with a per-layout opt-out (file key, column, switch); an inliner failure never stops mail | ✓ VERIFIED | `inline.go` (go-premailer, panic recovery). `templates.go:705` `inlineHTML` runs unless `disableInline` is set. Migration `202611130003`. `TestInlineCSS`, `TestInlineCSSOptOut`, `TestInlineFailure` and `TestMailLayoutInlineOptOut/*` PASS. | +| 9 | Images can be uploaded and placed in layouts and templates | ✓ VERIFIED | `GET/POST /mail/images`, `MailImagePicker.vue`, `insertImage.ts` (35-02/03, unchanged by the gap closure). UAT row 6 passed. | +| 10 | postcard renders the override when one exists, otherwise the file; `