From 14f8d4e928f06720686d66975b77d88036a31969 Mon Sep 17 00:00:00 2001 From: cesnimda Date: Mon, 10 Aug 2026 00:45:30 +0200 Subject: [PATCH] docs(email): record SMTP retirement evidence --- docs/audits/verification-log.md | 1 + docs/verification/application-action-matrix.md | 5 ++++- docs/verification/mail-001-job-email-hub.md | 12 ++++++++++-- docs/work-programmes/decisions.md | 10 ++++++++++ docs/work-programmes/master-progress.md | 6 +++--- docs/work-programmes/master-work-plan.md | 6 +++--- docs/work-programmes/session-handoff.md | 10 +++++----- 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/docs/audits/verification-log.md b/docs/audits/verification-log.md index cb68db0..84906e5 100644 --- a/docs/audits/verification-log.md +++ b/docs/audits/verification-log.md @@ -169,3 +169,4 @@ Output was reduced to filenames and commit counts. The token artifact appears un | V-135 | Focused correspondence-inbox Jest; full frontend Jest; `npm.cmd run build`; `git diff --check` | `job-tracker-ui` / repository root | Verify editable provider-bound reply, visible review fields, confirmation/cancel, one UUID, sent/uncertain duplicate safety, responsive TypeScript/build and regression hygiene | PASS — focused 7/7; full 49/49 suites and 190/190 tests; production build; no whitespace errors | JSDOM and mocked API/provider data only; no running browser/provider/email. Full Jest took 75.632s and retained the existing force-exit/open-handle notice | Browser/provider/production limitation | | V-136 | Focused `EmailSendAttemptStoreTests|EmailSendControllerTests`; full backend; provider-dependency search; `git diff --check` | Repository root | Verify restart recovery, stale/fresh boundary, pending-failed versus sending-uncertain classification, two-owner notification isolation, idempotency and absence of provider retries | PASS — focused 10/10; full backend 620/620; repeated recovery 0/0; each owner sees one content-free notification; recovery code has no provider/SMTP dependency; no whitespace errors | Real SQLite and manual clock; no process kill, MariaDB, provider, email or production runtime. Five-minute scan performance is unmeasured on a large ledger | Runtime/performance limitation | | V-137 | `npm.cmd ls react-router-dom react-router js-yaml nanoid --all --depth=4`; `npm.cmd audit`; six focused router suites; full `npm.cmd test -- --runInBand`; `npm.cmd run build`; staged diff review | `job-tracker-ui` / repository root | Resolve the frontend advisory gate without an unreviewed forced update and verify the React Router v7 compatibility path | PASS — audit reports 0 vulnerabilities; focused 6/6 suites and 24/24 tests; full 49/49 suites and 190/190 tests; production build/TypeScript/static generation pass; `b55a592` pushed | CI/live deployment has not yet consumed the pushed commit; no deployment or production access occurred | Deployment verification pending | +| V-138 | Focused `JobApplicationsFollowUpDraftTests|BackgroundWorkerTenantTests`; focused follow-up/trust-loop Jest; full backend/frontend; production build; `npm.cmd audit`; staged diff review | Repository root / `job-tracker-ui` | Verify legacy direct SMTP retirement while preserving draft generation, scheduled reminders and the provider-confirmed Job email boundary | PASS — focused backend 10/10 and UI 2/2; full backend 621/621 and frontend 49/49 suites, 190/190 tests; build and audit pass; legacy action returns 410 with no SMTP dependency; `8fe3903` pushed | JSDOM/fake services only; no provider/email/browser/production execution. Remote CI/live confirmation remains | External/deployment limitation | diff --git a/docs/verification/application-action-matrix.md b/docs/verification/application-action-matrix.md index dbbe3ca..a3baa71 100644 --- a/docs/verification/application-action-matrix.md +++ b/docs/verification/application-action-matrix.md @@ -1,6 +1,6 @@ # Application action verification matrix -Updated: 2026-08-09 +Updated: 2026-08-10 This is the rolling action-level evidence index. `PASS (automated/runtime)` is not a browser or production claim. @@ -49,5 +49,8 @@ This is the rolling action-level evidence index. `PASS (automated/runtime)` is n | Career Workspace | first/returning/incomplete/loading/import processing/review/failure and recent CV actions | PASS (components; approval gate regression) | NOT RUN | NOT RUN | `career-001-career-workspace.md` | | CV Builder | edit/collapse/add/delete/reorder/hide, save states/latest-data retry, navigation warning and preview failure/retry | PASS (components) | NOT RUN | NOT RUN | `career-002-cv-builder.md` | | Job email hub | linked/review view switching, Gmail decision component reuse and legacy route redirect | PASS (components; mocked provider data) | NOT RUN | NOT RUN | `mail-001-job-email-hub.md` | +| Job email hub | provider status, owner-scoped search/detail and saved-copy fallback | PASS (fake providers + components) | NOT RUN | NOT RUN | `mail-001-job-email-hub.md` | +| Job email send | explicit confirmation, owner isolation, idempotency, failure/uncertainty and restart recovery | PASS (real SQLite + fake providers) | NOT RUN | NOT RUN | `mail-001-job-email-hub.md` | +| Follow-up draft | generate/edit/copy and open canonical Job email; legacy direct SMTP returns 410 | PASS (backend + components) | NOT RUN | NOT RUN | `mail-001-job-email-hub.md` | Remaining product actions are `NOT STARTED` in the master plan and will be added as their work packages enter verification. The in-app browser is available for local UI checks; configured/real-provider and production access are not documented/configured. diff --git a/docs/verification/mail-001-job-email-hub.md b/docs/verification/mail-001-job-email-hub.md index 27382e0..d19b063 100644 --- a/docs/verification/mail-001-job-email-hub.md +++ b/docs/verification/mail-001-job-email-hub.md @@ -2,7 +2,7 @@ Updated: 2026-08-10 -Status: `IN PROGRESS`. Canonical hub routing, provider-neutral reads, explicit-confirmed send API and editable reply UI are implemented and locally verified; recovery, legacy-send and remaining provider actions remain. +Status: `IN PROGRESS`. Canonical hub routing, provider-neutral reads, explicit-confirmed send API, editable reply UI, interrupted-send recovery and legacy SMTP retirement are implemented and locally verified; remaining provider actions/export lifecycle remain. ## Revalidated current boundaries @@ -71,7 +71,7 @@ Status: `IN PROGRESS`. Canonical hub routing, provider-neutral reads, explicit-c - Confirmed composer focused tests: 7/7. - Full backend: 620/620; full frontend: 49/49 suites, 190/190 tests. - Production build/TypeScript and `git diff --check`: pass. -- Implementation commits: `6008b4a`, `536d403`, `a20775c`, `653f011`, `e9937ac`, `123fc55`, `449faeb`, `ee5ef7e`. +- Implementation commits: `6008b4a`, `536d403`, `a20775c`, `653f011`, `e9937ac`, `123fc55`, `449faeb`, `ee5ef7e`, `8fe3903`. ## Implemented editable composer increment @@ -90,6 +90,14 @@ Status: `IN PROGRESS`. Canonical hub routing, provider-neutral reads, explicit-c - Each affected owner receives one generic, content-free notification linked to Job email. The notification never contains provider, recipient, subject or body. - A real-SQLite two-owner clock/restart test proves stale/fresh separation, owner-visible notifications, repeat-run idempotency and no transition back to pending/sending. +## Implemented legacy SMTP retirement increment + +- The Follow up tab still generates, displays, edits and copies grounded drafts, but it no longer presents a direct application-SMTP send action. +- Its outbound action opens canonical Job email, where the connected provider/from identity and final confirmation are visible before delivery. +- The old `POST /api/jobapplications/{id}/send-followup` boundary returns `410 Gone` and has no `IAppEmailSender` dependency. It cannot deliver, create a sent correspondence or mutate follow-up/contact dates. +- Scheduled reminder notification email remains on its separate worker path and was not removed or redirected. +- Focused backend follow-up/worker tests pass 10/10; focused UI trust-loop tests pass 2/2. Full backend 621/621, frontend 190/190, build and audit gates pass across the combined working state. + ## Remaining MAIL-001 work - Extend shared provider-neutral thread navigation and application embedding while preserving provider capability differences. diff --git a/docs/work-programmes/decisions.md b/docs/work-programmes/decisions.md index f6c65c9..8df94e9 100644 --- a/docs/work-programmes/decisions.md +++ b/docs/work-programmes/decisions.md @@ -459,3 +459,13 @@ - **Consequences:** the frontend now requires Node 20 or later through React Router v7. CI/live deployment and navigation smoke remain required before `DONE`. - **User approval required:** Yes; the user explicitly requested repair of the reported live deployment audit failure and continuation. - **Reversible:** Technically yes by reverting `b55a592`, but that restores known advisories and the failed gate. Prefer a forward compatibility fix if a deployment-only issue appears. + +## DEC-047 — Follow-up drafting stays; direct SMTP delivery is retired + +- **Date:** 2026-08-10 +- **Decision:** Preserve grounded follow-up draft generation/edit/copy, replace its direct send control with a link to canonical Job email, and make the legacy send endpoint return 410 without an application SMTP dependency. Keep scheduled reminder notification email unchanged. +- **Reason/evidence:** the legacy action bypassed provider identity/re-consent, explicit final confirmation, the idempotency ledger and uncertain-delivery handling already implemented in MAIL-001. Drafting itself is safe and useful. Focused worker tests prove the separate scheduled reminder path remains registered and functional with fakes. +- **Alternatives considered:** route the legacy body directly into `/api/email/send`; retain both send paths; remove drafting/reminders; silently redirect the POST. These either bypass the reviewed confirmation context, preserve conflicting authority, remove unrelated functionality or misrepresent a state-changing API response. +- **Consequences:** users copy the draft or open Job email and review provider/from/recipient/content before sending. Old API callers receive an explicit terminal response and must migrate; no correspondence/follow-up date is falsely recorded as sent. +- **User approval required:** No; this is the smallest safe completion of the already active MAIL-001 programme and sends no email. +- **Reversible:** Yes by reverting `8fe3903`, but that reintroduces the unsafe SMTP bypass. Prefer forward migration of any remaining caller to `/api/email/send` with explicit confirmation. diff --git a/docs/work-programmes/master-progress.md b/docs/work-programmes/master-progress.md index 5b12521..8da8459 100644 --- a/docs/work-programmes/master-progress.md +++ b/docs/work-programmes/master-progress.md @@ -2,8 +2,8 @@ Updated: 2026-08-10 -- **Overall programme status:** Active. Seven packages are locally verified; nineteen packages through CAREER-002 are implemented with automated/runtime evidence but blocked from applicable browser/provider/production gates; MAIL-001 is in progress with eight committed implementation increments. DEP-001 removed the frontend advisory deployment gate locally and is pushed for CI/live verification. -- **Current work package:** `MAIL-001` — consolidated job-email hub and explicit sending (`IN PROGRESS`); routing/reads/detail, ledger, Gmail/Graph delivery/re-consent, safe send API/UI and cross-owner-safe interrupted-attempt recovery are committed. Legacy-send retirement is implemented and validated in the working tree; tracking/commit remain before the next hub action. +- **Overall programme status:** Active. Seven packages are locally verified; nineteen packages through CAREER-002 are implemented with automated/runtime evidence but blocked from applicable browser/provider/production gates; MAIL-001 is in progress with nine committed implementation increments. DEP-001 removed the frontend advisory deployment gate locally and is pushed for CI/live verification. +- **Current work package:** `MAIL-001` — consolidated job-email hub and explicit sending (`IN PROGRESS`); routing/reads/detail, ledger, Gmail/Graph delivery/re-consent, safe send API/UI, cross-owner-safe interrupted-attempt recovery and legacy SMTP retirement are committed. Export/deletion coverage is the next dependency-correct increment. - **Completed work packages:** None are `DONE`; all repository security/AI packages still have applicable browser, provider and/or production gates. - **Locally verified work:** SEC-001, SEC-002, SEC-003, SEC-005A, CORE-001, PROD-002 and DEP-001 (`VERIFIED LOCALLY`). - **Implemented, verification incomplete:** SEC-004, SEC-005B, SEC-008, CORE-002, BG-001, OPS-001A/B/C, POL-001/002, AI-001/002/003/004, UX-001/002, QA-001, CAREER-001 and CAREER-002 (`IMPLEMENTED — NOT VERIFIED`). CAREER-002 now protects unsaved edits and provides tested structured custom-entry, profile-override and preview-error interactions; all automated/build gates pass. @@ -12,7 +12,7 @@ Updated: 2026-08-10 - **Deferred work:** None. Conditional multi-replica coordination, model deletion, realtime operation delivery and unrelated production changes remain outside current packages. - **Next five work packages:** MAIL-001 consolidated email experience; JOBS-001 job-search/application redesign; HOME-001 homepage/Pro promotion; UX-003 authentication/profile polish; PRODUCT-001 homepage/Pro claims. SEC-006/007 resume after package-index permission. - **Status counts:** 7 `VERIFIED LOCALLY`; 19 `IMPLEMENTED — NOT VERIFIED`; 1 `IN PROGRESS`; 8 `NOT STARTED`; 5 `BLOCKED`; 0 `DONE`; 0 `DEFERRED`. -- **Test status:** backend 621/621; frontend 49/49 suites and 190/190 tests; npm audit 0 vulnerabilities; DEP-001 focused router 24/24 and production build pass; MAIL-001 recovery/send focused 10/10, legacy follow-up/backend worker 10/10, composer 7/7, delivery/capability 18/18, provider/correspondence 5/5 and hub detail 5/5. Jest open-handle/slow-run behavior is recorded in V-127/V-128/V-130/V-131/V-135. +- **Test status:** backend 621/621; frontend 49/49 suites and 190/190 tests; npm audit 0 vulnerabilities; DEP-001 focused router 24/24 and production build pass; MAIL-001 recovery/send focused 10/10, legacy follow-up/backend worker 10/10, legacy UI 2/2, composer 7/7, delivery/capability 18/18, provider/correspondence 5/5 and hub detail 5/5. Jest open-handle/slow-run behavior is recorded in V-127/V-128/V-130/V-131/V-135. - **Deployment status:** `b55a592` is pushed to remove the frontend audit blocker; remote CI/live result is pending. No deployment was performed directly, no production migrations were run and the AI operation worker remains disabled by default. - **Production status:** Unchanged and unverified. No provider/model call, model pull, external request or paid API occurred. - **Known regressions:** None found by automated suites. Jest still needs `--forceExit` and reports its existing open-handle notice. Email-provider/send tests are fake/local only; real delivery is not claimed. Interrupted attempts are aged after 15 minutes and notified without retry; the five-minute scan is unmeasured on a large ledger. Direct clean EF-only SQLite migration still hits the pre-existing historical blank-chain defect before later migrations; normal startup owns reconciliation. Cross-feature monthly AI usage accounting remains a rollout gap. diff --git a/docs/work-programmes/master-work-plan.md b/docs/work-programmes/master-work-plan.md index b565aeb..c683dda 100644 --- a/docs/work-programmes/master-work-plan.md +++ b/docs/work-programmes/master-work-plan.md @@ -651,9 +651,9 @@ Ordering differences from the suggested list: - **Required production verification:** provider read/draft/send requires explicit authorized synthetic account; never real unsolicited email. - **Status:** `IN PROGRESS`. - **Blocker:** real provider verification external; mocked/local implementation not blocked after dependencies. -- **Evidence:** `docs/verification/mail-001-job-email-hub.md`; V-126–V-136. Recovery/send focused 10/10; composer 7/7; delivery/capability 18/18; provider/correspondence 5/5; hub detail 5/5; backend 620/620; frontend 49/49 suites and 190/190 tests plus build. -- **Commit:** `6008b4a` (hub), `536d403` (neutral reads), `a20775c` (safe detail), `653f011` (ledger), `e9937ac` (Gmail/Graph delivery adapters and consent), `123fc55` (explicit-confirmed send API), `449faeb` (confirmed reply composer), `ee5ef7e` (interrupted-send recovery). -- **Remaining work:** legacy follow-up SMTP retirement; export/deletion coverage; durable/new-message drafts; shared thread/application actions and category capabilities; free/pro and browser/production verification. Existing connections need explicit re-consent; IMAP remains read-only. No real email; uncertain sends need manual reconciliation. +- **Evidence:** `docs/verification/mail-001-job-email-hub.md`; V-126–V-138. Recovery/send focused 10/10; legacy follow-up/worker 10/10; composer 7/7; delivery/capability 18/18; provider/correspondence 5/5; hub detail 5/5; backend 621/621; frontend 49/49 suites and 190/190 tests plus build/audit. +- **Commit:** `6008b4a` (hub), `536d403` (neutral reads), `a20775c` (safe detail), `653f011` (ledger), `e9937ac` (Gmail/Graph delivery adapters and consent), `123fc55` (explicit-confirmed send API), `449faeb` (confirmed reply composer), `ee5ef7e` (interrupted-send recovery), `8fe3903` (legacy SMTP retirement). +- **Remaining work:** export/deletion coverage; durable/new-message drafts; shared thread/application actions and category capabilities; free/pro and browser/production verification. Existing connections need explicit re-consent; IMAP remains read-only. No real email; uncertain sends need manual reconciliation. ### JOBS-001 — Job-search source and assessment redesign diff --git a/docs/work-programmes/session-handoff.md b/docs/work-programmes/session-handoff.md index 723ae82..fb1ca7f 100644 --- a/docs/work-programmes/session-handoff.md +++ b/docs/work-programmes/session-handoff.md @@ -2,17 +2,17 @@ Updated: 2026-08-10 -- **Exact current task:** MAIL-001 — commit/push the validated retirement of the legacy follow-up SMTP boundary, then continue the next dependency-correct hub increment. -- **Last completed step:** frontend dependency remediation was committed/pushed as `b55a592`; React Router 7.18.2 plus patched js-yaml/nanoid resolve the deployment audit locally with zero vulnerabilities. -- **Files currently modified:** MAIL-001 legacy-send controller/UI/tests plus DEP-001 and current tracking documents. Dependency application files are committed. +- **Exact current task:** MAIL-001 — inventory and add non-sensitive `EmailSendAttempt` coverage to readable account export and complete deletion verification. +- **Last completed step:** legacy follow-up SMTP retirement was committed/pushed as `8fe3903`; follow-up drafts route to canonical Job email and the old direct-delivery API returns 410 without an SMTP dependency. +- **Files currently modified:** MAIL-001/DEP-001 verification and tracking documents only; application/dependency changes are committed. - **Commands already run:** dependency tree/advisory review; `npm audit`; six focused router suites; full frontend; two production builds; legacy follow-up/backend worker focused tests; full backend; focused legacy UI. See V-126–V-137; legacy evidence is pending V-138. - **Test results:** npm audit 0 vulnerabilities; router focused 24/24; frontend 49/49 suites and 190/190 tests; production build passes. MAIL-001 legacy follow-up/backend worker 10/10, focused UI 2/2 and backend 621/621 passed before the dependency upgrade; full frontend/build also pass with both working-tree changes present. - **Services currently running:** none started intentionally. Exact task-owned hung Jest/build Node processes were stopped; Codex browser runtimes were not touched. Pre-existing Docker services were not changed. - **Temporary files or processes:** none. No provider account, private email, external model, paid service or production service was accessed. - **Production changes currently active:** none. No deployment, migration, provider connection/sync/send or production payload occurred. - **Rollback status:** revert `ee5ef7e` to stop recovery, then `449faeb` to remove the composer; keep admission disabled before reverting `123fc55`/`e9937ac` and downgrade the ledger before reverting `653f011`. No production migration/deploy/provider grant occurred. -- **Uncommitted changes:** MAIL-001 legacy-send application/tests and DEP-001/tracking evidence. Stage by work package; do not mix them. +- **Uncommitted changes:** MAIL-001 legacy-send evidence/tracking only; commit/push before editing export/deletion code. - **Known failures:** durable/new-message drafts, export coverage, full thread/category actions and non-Gmail review remain; existing accounts need re-consent and IMAP stays read-only. Browser/provider/MariaDB/production unavailable or unverified; recovery scan performance is unmeasured at large ledger scale; Jest open handles; SEC-006 parser dependency work is still separately gated; parser isolation remains SEC-007. DEP-001 still needs remote CI/live confirmation. -- **Exact next action:** commit/push DEP-001 evidence, then review/stage/commit/push the validated legacy follow-up retirement and its V-138 evidence without including unrelated changes. +- **Exact next action:** commit/push V-138 tracking, then trace export DTO/archive and account/job deletion cascades for `EmailSendAttempt`; implement the smallest owner-readable metadata export and regression tests without exporting recipient/subject/body (which are not stored in the ledger). - **Work that can continue independently:** remaining MAIL-001 repository work and later UX packages. SEC-006/007 await package-index permission; PROD-001/003/004 await production access. - **Decisions still required from the user:** none for synthetic/code-inspected repository work. Any provider connection or send test, internet/package upgrades, private data, external/paid providers and production actions retain explicit approval/safety gates; SEC-009 retention/legal policy remains unresolved.