feat: complete release readiness work

- consolidate API ownership and remove dead vendor code

- add Stripe billing, learning paths, and public CV hardening

- add migration, recovery, security, audit, and browser gates
This commit is contained in:
cesnimda
2026-07-31 16:54:16 +02:00
parent a23c3dfc97
commit ce76046a29
1634 changed files with 6889 additions and 135429 deletions
+6 -1
View File
@@ -1,3 +1,8 @@
# safety
TODO: Complete documentation.
AI output is suggestion-only and cannot overwrite the Career Profile automatically. Prompts delimit
untrusted source text, require preservation of factual claims, and instruct providers not to invent
employers, titles, dates, or metrics. Attachments are included only when explicitly selected.
Provider outages degrade AI features without blocking core tracking. Calls and tokens are metered and
limited by plan. See `docs/ai/security.md` and `docs/ai/privacy.md`.
+1 -1
View File
@@ -51,7 +51,7 @@ master profile text ────────────┘ │
## History model
`AiInteraction` (`Models/AiInteraction.cs`) is **append-only** — one row per generation, never
`AiInteraction` (`JobTrackerApi/Models/AiInteraction.cs`) is **append-only** — one row per generation, never
overwritten. This is deliberately distinct from `AiWorkspaceNote` (a one-row-per-type *cache* for
candidate-fit/focus-plan). History gives the user restore/reuse (re-surface a past result), compare
(view two side by side), copy, and delete. `ResultJson` is `{ text, meta? }`; `Provider` records which
+7 -2
View File
@@ -93,6 +93,11 @@ Seeding is idempotent per `(JobApplicationId, SystemKey)` — enforced by a uniq
never duplicates. Custom items have a `NULL` `SystemKey`; both SQLite and MariaDB treat NULLs as
distinct in a unique index, so a user can add as many as they like.
The deterministic match-score endpoint also synchronises `learning:{hash}` system items from its
current missing skills. They form the first job-specific learning path without another table or an
external course catalogue. Manual learned/dismissed decisions persist; only recommendations that
were auto-completed because a gap disappeared reopen when the same gap returns.
Deleting a **system** item dismisses it (a hard delete would be undone by the next seed); deleting a
**custom** item removes the row. Dismissed items leave the progress denominator entirely.
@@ -378,6 +383,6 @@ belongs to the AI cache — a reminder that the two systems are genuinely differ
6. ✅ Completion and product readiness — ownership audit, security review, full local verification
(Phase 5.6). See `docs/phase-5-completion-report.md`.
**Phase 5 is feature-complete locally.** It is not deployed: CI is red for a documented environmental
reason and deployment is gated on it. See the completion report's *Remaining risks*.
**Phase 5 is feature-complete locally.** Current release and deployment dependencies are tracked in
`BLOCKERS.md`; the completion report is a historical snapshot.
7. Cover letter workflow. 8. Documents. 9. Interview preparation. 10. Dashboard improvements.
+2 -2
View File
@@ -10,7 +10,7 @@
> ## Implementation status (2026-07-18) — SHIPPED
>
> The model below is implemented on `main` and verified against the live database:
> - **Entities** (`Models/CareerEntities.cs`): `CareerExperience`, `CareerEducation`, `CareerSkill`,
> - **Entities** (`JobTrackerApi/Models/CareerEntities.cs`): `CareerExperience`, `CareerEducation`, `CareerSkill`,
> `CareerProject`, `CareerCertification`, `CareerLanguage` — relational children of `CareerProfile`;
> long tail in `CareerProfile.LongTailJson`. Migration `AddCareerProfileRelationalChildren`
> (applied cleanly on the real dev DB and the running container).
@@ -40,7 +40,7 @@ The Career Workspace foundation (`992f89e`) stores the whole profile as **one JS
`CareerProfileService.SaveVersionAsync` (dual-write). One row per user.
- `CareerProfileVersion` — append-only history: one row per save, with a `Source` discriminator.
The blob shape (`Models/StructuredCvProfile.cs`) already has structured items for **Jobs, Education,
The blob shape (`JobTrackerApi/Models/StructuredCvProfile.cs`) already has structured items for **Jobs, Education,
Certifications, Projects, Languages**, plus `Skills`/`Summary`/`Interests` (string lists) and
`OtherSections` (title + items). `CareerProfileService` already assigns **stable item IDs** to
Jobs/Education/Certifications/Projects and normalizes free-text dates to `YYYY-MM`.
+36 -51
View File
@@ -1,10 +1,11 @@
# Jobjakt — Current Architecture
> **This document describes the system as it actually is.** Every claim was verified against code.
> Last verified: 2026-07-17 (Phase 0). Supersedes the archived `docs/_archive/SYSTEM_OVERVIEW.md` (2026-07-02).
> Last verified: 2026-07-31. Supersedes the archived `docs/_archive/SYSTEM_OVERVIEW.md` (2026-07-02).
>
> **Rule:** if this document and the code disagree, the code wins — and this document is a bug. Fix it.
> Do not trust other files under `docs/` over this one; most are stubs.
> Topic documentation is maintained alongside this file; dated completion and review reports remain
> historical snapshots. When documentation conflicts, prefer this file and the code.
---
@@ -69,22 +70,19 @@ flowchart LR
BG --> DB
```
### Solution layout (unusual — read this first)
### Solution layout
| Project | Role |
|---|---|
| `JobTrackerApi/` | Web **host only**: `Program.cs`, appsettings, migrations, Dockerfile. Its csproj **excludes** `Controllers/**` and `Services/**` from its own compilation. |
| `JobTrackerBackend/` | "Transitional shared-backend" **library** that link-compiles, via `<Compile Include>`, files physically located in `../Data`, `../Models`, `../JobTrackerApi/Controllers`, `../JobTrackerApi/Services`. Exists so tests can reference controllers/services without the web host. |
| `JobTrackerApi/` | ASP.NET Core host plus its controllers, services, EF models, `JobTrackerContext`, migrations, and Dockerfile. |
| `JobTrackerApi.Tests/` | xUnit, 36 test files incl. authorization + hostile-fixture suites. |
| `Models/`, `Data/` (repo root) | The *real* EF models and `JobTrackerContext`. |
| `job-tracker-ui/` | React SPA inside a Next.js shell. |
| `tools/summarizer/` | FastAPI AI service (own Dockerfile, pytest tests). |
| `tools/hostile-fixture-db/` | Security test fixture generator. |
| `deploy/`, `.gitea/workflows/` | Prod deploy script + CI/CD. |
**Source lives in one place and compiles from another.** Any tool assuming csproj-adjacent source will mislead you. Check `JobTrackerBackend.csproj` before adding files or projects.
> Corrected 2026-07-17: the dead root `Controller/` (singular) folder described in the archived overview **no longer exists** — removed in `519c32e`.
> Corrected 2026-07-31: the transitional `JobTrackerBackend` link-compilation project and root
> `Models/`/`Data/` directories were retired. Source now compiles from the project that owns it.
---
@@ -94,7 +92,7 @@ flowchart LR
**Frontend:** **Next.js 16** + React 19 + **TypeScript 5.9** + MUI 7 (+ x-data-grid, x-date-pickers, lab), axios, react-router-dom 6, @tanstack/react-table, i18n EN + NB (custom provider), Jest/RTL.
> Corrected 2026-07-17: the archived overview said "CRA/react-scripts 5, TypeScript 4.9". The CRA→Next.js migration has happened. See §4 for what that migration did and did not do.
> Corrected 2026-07-31: the CRA migration is complete; direct Jest/Babel configuration replaced `react-scripts`.
**AI:** FastAPI + transformers (`sshleifer/distilbart-cnn-12-6`) for summaries; pytesseract/PyMuPDF/pypdf/python-docx for extraction/OCR; **one** generation provider selected by the `AI_PROVIDER` env var ∈ {`ollama` (default, `qwen2.5:7b`), `gemini`, `groq`}; TTL cache.
@@ -104,17 +102,16 @@ flowchart LR
## 4. Frontend architecture
**Three toolchains coexist. This is the single most confusing thing about the frontend.**
**Two routing layers coexist intentionally:**
1. **Next.js 16 App Router** (`app/layout.tsx`, `app/page.tsx`) — a thin shell that mounts a client-side app. The CRA→Next migration was a **CSR lift-and-shift**: no SSR, no server components, no Next routing, no data fetching. Next is effectively a build tool here. Static export → nginx.
2. **react-router-dom v6** — does the actual routing, in **two different patterns inside one file** (`src/App.tsx`): `createBrowserRouter` for public routes (`/`, `/login`, `/forgot-password`, `/reset-password`, `/verify-email`) and a nested `<Routes>` inside a catch-all `Shell` for authenticated routes.
3. **react-scripts 5.0.1** — still a dependency, used **only** as the test runner (`"test": "react-scripts test"`).
Known consequence: a **dev-only 404 on deep links** follows directly from the Next shell + client router combination.
Development leaves static-export mode disabled so deep links reach the client router; production exports one shell and nginx falls back to `index.html` for unknown paths.
**Routes** (`src/App.tsx`): public — `/`, `/login`, `/forgot-password`, `/reset-password`, `/verify-email`. Authenticated — `/dashboard`, `/jobs`, `/reminders`, `/kanban`, `/companies`, `/correspondence`, `/correspondence/review`, `/profile`, `/career`, `/trash`, `/settings`, `/settings/connected-accounts`, `/admin/{audit,users,system}`.
> **No `/register` route exists.** Sign-up is folded into `LoginPage.tsx`, and the endpoint is disabled by default (§5).
> `/register` reuses the hardened auth form. Submission remains disabled until registration is enabled by production configuration (§5).
**State management: none.** No Redux/Zustand/React Query. Local `useState` + `axios` per component, with a hand-rolled `refreshToken` counter threaded through props. Two workspace-cache hooks exist (`components/job-workspace/useWorkspaceTabCache.ts`, `useJobWorkspaceBaseData.ts`). This is the root cause of the oversized components below.
@@ -138,7 +135,7 @@ the reference model for how account identity and the master career profile relat
| `/career` | `views/CareerWorkspacePage.tsx` → `views/CareerProfilePage.tsx` (~1293 lines) | The **master career profile** — the single editable source of truth |
`CareerWorkspacePage` is a thin shell (heading + source-of-truth notice) around `CareerProfilePage`.
The CV Builder is **not** built yet (Phase 4); `CareerProfilePage` is where it will live.
The CV Builder is a separate routed workspace and consumes the Career Profile as its source of truth.
### Request flow
@@ -209,7 +206,7 @@ null-leaves).
- **Sessions:** `UserSession` entity + `SessionsController` — list/revoke active sessions.
- Password policy: min 8, digit + lowercase. Reset via emailed token (SMTP required).
- **Registration is disabled by default** — `AuthController.cs:135` reads `Auth:AllowRegistration` defaulting to `false` and returns HTTP 403. There is no CAPTCHA anywhere.
- **Rate limiting (3 fixed-window policies):** `auth-login` 10/window, `auth-email` 5/window, `auth-2fa-challenge` 5/window. **AI and other expensive endpoints are unthrottled.**
- **Rate limiting:** login, auth email, 2FA challenge, and anonymous public-CV PDF export have dedicated fixed-window policies. AI usage is bounded by per-account monthly generation and token ceilings rather than request-window throttling.
---
@@ -246,12 +243,12 @@ erDiagram
- Salary is **structured**: `SalaryMin`, `SalaryMax`, `SalaryCurrency`, `SalaryPeriod` (plus a legacy free-text `Salary`).
- `Tags` is a **JSON array in a string column** — not queryable; `/tags` and `/tag-trends` must scan.
- Denormalized `HasResume`/`HasCoverLetter`/`HasPortfolio`/`HasOtherAttachment` flags duplicate `Attachments`; kept honest by `AttachmentFlagsRecomputeTests`.
- CV text is stored **three times** (`CvExtractionRun.RawExtractedText`, `.NormalizedText`, `.StructuredProfileJson`) plus twice on the user. Deliberate audit trail, but **no retention policy**.
- CV extraction runs retain the newest 20 completed runs per user; expired runs and unreferenced upload artifacts are pruned while the current artifact is preserved.
- `Status` is free-text at the DB level; canonicalized only in the application layer by `JobPipeline.Normalize` — deliberately, so custom user values are never destroyed.
- Indexes: `OwnerUserId` on Company/Job/JobApplication/GmailConnection; composites `(OwnerUserId, UploadedAtUtc)`, `(OwnerUserId, StartedAtUtc)`; unique `(OwnerUserId, JobApplicationId)` on draft, unique `(OwnerUserId, GmailAddress)`. EF auto-indexes FKs by convention. **Genuinely missing:** owner-prefixed composites `(OwnerUserId, IsDeleted, Status)` and `(OwnerUserId, FollowUpAt)`.
- SQLite at `DataRoot/jobtracker.db` (WAL); migrations applied at startup by `StartupInitializationExtensions` (1356 lines — also seeds admin, creates Identity tables where `dotnet ef` is unavailable, ignores `PendingModelChangesWarning`).
- Indexes include owner-prefixed list/board/reminder composites `(OwnerUserId, IsDeleted)`, `(OwnerUserId, IsDeleted, Status)`, and `(OwnerUserId, FollowUpAt)`, plus CV and provider-specific indexes.
- SQLite lives at `DataRoot/jobtracker.db` (WAL); migrations and legacy-schema reconciliation run at startup through `StartupInitializationExtensions`.
> Corrected 2026-07-17: prior session notes recorded the EF model snapshot as **broken/empty**. It was **resynced** in `20260711181039_SyncModelSnapshot` — the snapshot now covers the full model and incremental `dotnet ef migrations add` works normally. Note `dotnet ef` still needs the `Design` package temporarily added to `JobTrackerApi` (the `MigrationsAssembly`), since it lives in `JobTrackerBackend` with `PrivateAssets=all`.
> Corrected 2026-07-31: the model snapshot is current and the API directly carries the EF Design package and `JobTrackerContext`; no temporary project edit is required for `dotnet ef`.
---
@@ -294,10 +291,10 @@ erDiagram
| `DailyExportHostedService` | Daily JSON export at a configured local hour |
| `JobEnrichmentHostedService` | Backfills summaries/enrichment |
| `SummarizerProbeHostedService` | Probes AI service readiness |
| `CvProcessingHostedService` + `CvProcessingQueue` | In-memory queue for CV extraction |
| `CvProcessingHostedService` + `CvProcessingQueue` | Process-local wake-up queue for CV extraction; queued/running database work is recovered at startup |
| `DatabaseBackupHostedService` → `DatabaseBackupRunner` | Automated DB backup (`VACUUM INTO`, server-derived path) |
**All state is in-process** (`IMemoryCache`, in-memory queue) — single-instance assumption, no distributed locks, **queued CV jobs are lost on restart**.
Caches and worker coordination are process-local. CV work itself is durable and recovered after restart, but the worker remains a deliberate single-instance design without database leasing.
---
@@ -361,15 +358,15 @@ Inbound: `GmailOAuthService` (655), `MicrosoftGraphOAuthService` (507), `ImapSer
- **Backend:** xUnit integration-style via `TestHostFactory`. 36 test files. Notable: `JobApplicationsAuthorizationTests`, `OwnershipGuardTests`, `ImapServiceSsrfGuardTests`, `ProductionConfigTests`, `AttachmentFlagsRecomputeTests`, `CvCorpusHarnessTests`, `SqliteMigrationHelperTests`, `JobPipelineTests`, plus a `tools/hostile-fixture-db` project.
- **Frontend:** ~20 Jest/RTL files — **all run in CI**.
- **AI service:** pytest (`tools/summarizer/tests/`).
- **Gaps:** no true end-to-end browser tests; no load/perf tests; **no dependency CVE scanning** (CI explicitly sets `npm_config_audit: 'false'`).
- **Browser smoke:** Playwright drives login/session cookies, saved-job creation, Career Workspace routing, and anonymous public-CV rendering/PDF download against isolated API/SQLite and Next.js processes. CI installs Chromium and runs all four flows.
- **Gap:** no load/performance suite. CI reports NuGet transitive vulnerabilities and production npm audit findings.
---
## 14. Logging & error handling
Console/debug logging; middleware logs every request (method, path, status, ms, traceId, sub claim). Unhandled exceptions logged then rethrown (500). Client errors POST to `/api/client-errors`. React `ErrorBoundary` + route error page.
No structured sink (Seq/OTLP), no in-app log rotation, no ProblemDetails standardization.
Development uses simple console/debug logging; production emits structured JSON. Middleware records method, path, status, duration, trace ID, and subject. Unhandled errors return Problem Details with the same trace ID. Client errors POST to `/api/client-errors`; the frontend has an `ErrorBoundary` and route error page.
Compose bounds each container's local logs to three 10 MB files. There is still no external sink (Seq/OTLP) or cross-host aggregation.
---
@@ -385,17 +382,17 @@ No structured sink (Seq/OTLP), no in-app log rotation, no ProblemDetails standar
- 2FA + recovery codes + trusted devices + session revocation.
- **AI sidecar: backend-only.** Unpublished, on a private two-member network, and token-authenticated (§16). Verified against the running stack, not just configured.
**Open findings** (detail in `docs/application-discovery-report.md` §12 and `docs/phase-0-foundation-report.md`):
**Findings status** (detail in `docs/application-discovery-report.md` §12 and `docs/phase-0-foundation-report.md`):
| Sev | Finding | Status |
|---|---|---|
| Medium | DataProtection keys recoverable from git history (`519c32e`, `955cae6`) | **Open — rotation required, needs an operator** |
| Medium | **CORS: `Cors:Origins="*"` triggers `SetIsOriginAllowed(_ => true)` + `AllowCredentials()`** (`Program.cs:96-102`) — reflected-origin with cookies = session theft from any site. Not currently active (compose never sets `Cors__Origins`, so it defaults to `localhost:3000`), but it is one config value away. | **Open — landmine** |
| Medium | AI cost ceiling | Metering shipped in Phase 5; enforce quotas before open registration (Phase 7). |
| Low | No CAPTCHA (rate limiting only) | Open — blocks public signup |
| Low | Unbounded storage: attachments, CV artifacts, extraction runs, base64 avatars | Open |
| Medium | Wildcard credentialed CORS configuration | **Closed — startup rejects it** |
| Medium | AI cost ceiling | **Closed — monthly generation/token limits are enforced by plan** |
| Low | Public-registration abuse control | Implemented with Turnstile; production keys/configuration still required |
| Low | Unbounded storage | **Closed — attachment quotas, extraction/artifact pruning, file-backed avatars, and PDF-export retention are implemented** |
| Low | Backup / DPAPI is Windows-oriented — verify behaviour on Linux prod | Unverified |
| Low | No dependency CVE scanning in CI | Open |
| Low | No dependency CVE scanning in CI | **Closed — NuGet and production npm audit reporting are in CI** |
---
@@ -417,20 +414,9 @@ Full record: `docs/phase-0-foundation-report.md`. What changed architecturally:
---
## 17. Known debt (ranked)
## 17. Known debt
1. **`JobApplication` still carries opportunity columns** — the `Job` split is started but not completed. Reads/writes still use the legacy columns.
2. **God controllers** — `JobApplicationsController` 2313/38 endpoints, `ProfileCvController` 2249, `StartupInitializationExtensions` 1356, `GmailController` 1023, `AuthController` 879.
3. **Hardcoded CV templates** — dead end for the CV Builder.
4. **Three frontend toolchains** — Next shell + react-router (×2 patterns) + react-scripts test runner.
5. **No frontend data layer** — root cause of the 600–1400-line components.
6. **`ProfilePage` (1368 lines) serves two routes** behind a boolean; the `careerView` prop it accepts is **never read** (the "CV Builder" tab is inert).
7. **Denormalized `Has*` flags**; **`Tags` as a JSON string column**; **unbounded CV storage**; **base64 avatars in a DB column**.
8. **`JobTrackerBackend` link-compilation** — self-described "transitional".
9. **In-memory queue/cache** — single-instance coupling; restart loses queued CV jobs.
10. **No OpenAPI in prod, no ProblemDetails, no structured logging sink.**
11. **Root-level clutter**: `temp_job.json`, `temp_post_job.py`, `todo jobtracker.txt`, `test/`, `tmp/`, `vendor/`, `docs.7z`, `CV_Changes.md`, `SMART_GMAIL_PROGRESS.md`.
12. **Norway-only import plugins** (Finn/NAV/Jobbnorge). Product decision 2026-07-17: **Norway first, but no hardcoding Norway** — market must become a data dimension, not an assumption.
The live, prioritized ledger is `docs/architecture/technical-debt.md`. The principal remaining items are the legacy `JobApplication` opportunity columns, single-replica worker coordination, and optional cross-host log aggregation. Large orchestration files are refactored only when a cohesive behavior change provides a safe seam.
---
@@ -438,9 +424,8 @@ Full record: `docs/phase-0-foundation-report.md`. What changed architecturally:
Recorded nowhere else in active docs:
1. `JobTrackerBackend` link-compilation exists so tests can reach controllers without the web host — deliberate, self-described "transitional".
2. `Status` is free-text and canonicalized in the application layer **specifically so custom user values are never destroyed** (`JobPipeline.cs` docstring). Deliberate; do not "fix" it with a DB enum.
3. The CI frontend-test whitelist was removed after it "silently skipped new suites and let two regressions reach main."
4. Ollama is intentionally not bundled by default so deploys reuse a shared instance.
5. `AI_PROVIDER=gemini` exists to offload a weak local GPU in prod.
6. `TailoredCvDraft` is a separate entity specifically to guarantee the master CV is never auto-modified.
1. `Status` is free-text and canonicalized in the application layer **specifically so custom user values are never destroyed** (`JobPipeline.cs` docstring). Deliberate; do not "fix" it with a DB enum.
2. The CI frontend-test whitelist was removed after it "silently skipped new suites and let two regressions reach main."
3. Ollama is intentionally not bundled by default so deploys reuse a shared instance.
4. `AI_PROVIDER=gemini` exists to offload a weak local GPU in prod.
5. `TailoredCvDraft` is a separate entity specifically to guarantee the master CV is never auto-modified.
+7 -2
View File
@@ -25,8 +25,8 @@ The master profile is never written by the builder. A variant references career
## Variant model
`CvVariant` (`Models/CvVariant.cs`) + `CvVariantVersion` (autosave history). The whole lens lives in one
`SettingsJson` blob (`CvVariantSettings`, `Models/CvVariantSettings.cs`) because it is edited and saved
`CvVariant` (`JobTrackerApi/Models/CvVariant.cs`) + `CvVariantVersion` (autosave history). The whole lens lives in one
`SettingsJson` blob (`CvVariantSettings`, `JobTrackerApi/Models/CvVariantSettings.cs`) because it is edited and saved
as a unit — never queried field-by-field. A variant stores:
- `ThemeId` + overrides: accent, heading/body font, density, page size, photo/icons/page-numbers.
@@ -56,6 +56,11 @@ Anonymous (`/api/public-cv/{slug}`, `PublicCvController`): serves a public varia
tenant filter — there is no current user). Unknown/private slug → 404
(`CvBuilderTests.Private_variant_is_not_served_publicly`).
Recruiters can download the same public render as PDF through `GET /api/public-cv/{slug}/pdf`.
The endpoint applies the identical public/private slug check; unknown, revoked, or private links return
404 without invoking the exporter. Anonymous PDF generation is limited to three requests per minute
per public link because it launches Chromium. `PublicCvPage` exposes it as a native **Download PDF** link.
## Builder workflow (frontend)
`/career/builder` lists variants (`CvBuilderPage`); the editor (`CvBuilderEditor`) is three tabs —
+2 -2
View File
@@ -7,7 +7,7 @@
**A theme is data, not code.** There is exactly one renderer — `ThemedCvRenderer`
(`JobTrackerApi/Services/ThemedCvRenderer.cs`) — with a single render path. Every visual difference
between themes is expressed by the fields of a `CvTheme` record (`Models/CvTheme.cs`). Adding a theme
between themes is expressed by the fields of a `CvTheme` record (`JobTrackerApi/Models/CvTheme.cs`). Adding a theme
never touches the renderer.
This replaces the previous approach (`CvTemplateRenderer`, one hand-written HTML method per template),
@@ -30,7 +30,7 @@ section keys move to the sidebar for the two-column layouts.
## Adding a theme
1. Append one `CvTheme { … }` to `CvThemeCatalog.Themes` (`Models/CvTheme.cs`). Only override the
1. Append one `CvTheme { … }` to `CvThemeCatalog.Themes` (`JobTrackerApi/Models/CvTheme.cs`). Only override the
fields that differ from the defaults.
2. Nothing else. It appears in `GET /api/cv/themes`, the Customize tab picker, and renders.
+14 -1
View File
@@ -1,3 +1,16 @@
# deployment
TODO: Complete documentation.
Production runs the frontend/nginx, ASP.NET API, AI sidecar, and configured database through Docker
Compose. The backend is not published directly; nginx proxies `/api`. `deploy/deploy.sh` validates
configuration, takes and verifies a provider-appropriate backup before replacement, builds/restarts the
stack, and performs health checks.
Production compose enables `Proxy:TrustForwardedHeaders` because nginx is the sole ingress, allowing
HTTPS scheme and client-IP rate limits to use one trusted forwarded hop. The development override
publishes the API directly and disables forwarded-header trust.
Each service rotates local Docker logs at 10 MB and retains three files. Add a central sink only if
cross-host search or longer retention becomes necessary.
Use `deploy/README.md`, `deploy/first-production-deployment.md`, and
`docs/deployment/backup-restore.md` as the operational runbooks.
+9 -1
View File
@@ -1,3 +1,11 @@
# future
TODO: Complete documentation.
Architecture evolves incrementally rather than through a rewrite. Current priorities are reducing large
controller/component orchestration boundaries, replacing the transitional link-compiled backend project,
adding durable background work if multi-instance deployment becomes necessary, and introducing browser
end-to-end coverage for critical user journeys.
Job-specific learning recommendations reuse deterministic match gaps and checklist state. Portfolio
content stays in public CVs. Broader course integrations or separate portfolio hosting remain out of
scope until concrete requirements justify new storage or service boundaries. Active items are tracked
in `docs/architecture/technical-debt.md` and `BLOCKERS.md`.
+48 -48
View File
@@ -1,56 +1,56 @@
# Technical Debt Management
# Technical debt
## Purpose
Last reconciled: 2026-07-31
Track known issues.
This ledger contains verified engineering debt only. Product ideas belong in the roadmaps and
operator/external dependencies belong in `BLOCKERS.md`.
---
## Resolved in the 2026-07-31 debt pass
# Categories
- Removed the 232 MB unused `vendor/saasable-ui-main` snapshot.
- Retired the link-compiling `JobTrackerBackend` project. The API now owns its controllers,
services, models, and `JobTrackerContext`; tests and tools reference the API directly.
- Added standard Problem Details responses with trace IDs and structured JSON production logs.
- Made trusted reverse-proxy headers explicit so rate limits see the real client address in the
production nginx topology.
- Made queued CV processing recover queued/running database work after restart and bypass the
request-only tenant filter with explicit owner checks.
- Pruned expired CV extraction runs and orphaned upload artifacts while preserving the current CV.
- Added configurable PDF export retention (`CvExports:RetainDays`, default 30 days).
- Corrected the remaining CRA-era environment-variable names after the Next.js migration.
- Removed React Router and `act(...)` warnings from the frontend tests.
- Replaced placeholder documentation stubs with concise, code-linked guidance.
- Removed stale locals and reconciled old TODO claims against the implemented code.
- Added a CI-gated Playwright smoke suite for login/session cookies, saved-job creation, Career
Workspace routing, and anonymous public-CV rendering/PDF download.
- Updated Axios and Next.js and overrode Next's vulnerable bundled Sharp/PostCSS versions; the only
remaining npm findings are the non-applicable/mitigated React Router items in `BLOCKERS.md`.
- Pinned SQLitePCLRaw 2.1.12 so the native SQLite runtime is no longer in the high-severity
CVE-2025-6965 range; the NuGet transitive vulnerability audit is clean.
- Made fresh SQLite startup reconcile schema-owned columns between historical EF migrations, so
strict SQLite identifier handling no longer breaks the later table rebuild.
- Updated Jest and Playwright, pinned the patched transitive brace-expansion package, and promoted
the full npm high-severity audit to a blocking CI gate.
- Corrected Chromium PDF export argument handling, bounded hung exports, and verified the returned
public artifact is a real PDF in the browser smoke suite.
- Removed unfinished Portfolio/Notes workspace navigation promises; existing project, attachment,
and application-note surfaces remain authoritative, and stale section links fall back to Overview.
## Architecture
## Remaining engineering debt
Examples:
| Priority | Debt | Current decision / trigger |
|---|---|---|
| P1 | `JobApplication` still duplicates opportunity data now owned by `Job`. | Keep the compatibility dual-write until a production-data backfill and restore rehearsal prove every application has a valid `JobId`; then remove the legacy columns in one migration. |
| P1 | Background workers assume one API instance. Restart recovery is durable, but there is no row lease for concurrent workers. | Add database leasing only before deploying more than one backend replica. |
| P2 | Production log aggregation is still deployment-owned; Compose now bounds each container's local logs to 3 × 10 MB. | Add an OTLP/Seq sink only before multi-host operation or when incident-response needs exceed `docker logs`. |
| P3 | `Tags` remains a JSON string and attachment-purpose booleans remain compatibility columns. | Normalize tags only when server-side tag querying becomes slow. Remove attachment flags only with an API/schema compatibility release; recomputation tests currently prevent drift. |
| P3 | Checklist reads seed and synchronize system-generated items, so the GET is intentionally non-cacheable. | Split read/write paths only if workspace read volume or caching makes the current idempotent behavior measurably costly. |
| P3 | Several orchestration files are large (`JobApplicationsController`, `StartupInitializationExtensions`, `JobDetailsDialog`). | File length alone is not a defect. Extract a cohesive slice only when the next behavior change touches it; avoid a standalone rewrite. |
- Large services.
- Tight coupling.
## Deliberate non-debt
---
## Frontend
Examples:
- Duplicate components.
- Complex state.
---
## Backend
Examples:
- Large controllers.
- Missing abstractions.
---
## Testing
Examples:
- Missing coverage.
---
# Rules
Do not fix everything immediately.
Prioritise:
Impact.
Risk.
User value.
- Free-text pipeline status is intentional so custom values are not destroyed.
- Next.js is the static build shell and React Router owns client navigation; changing routers has no
demonstrated user benefit.
- The CV queue is intentionally process-local for the current single-replica deployment.
- User-local untracked files at the repository root were not removed or modified.
+6 -1
View File
@@ -1,3 +1,8 @@
# 2fa
TODO: Complete documentation.
Local accounts can enable TOTP from Profile settings. Setup requires the current password, verification
of the first six-digit code, and acknowledgement of one-time recovery codes. Users can disable TOTP,
regenerate recovery codes, list/revoke trusted devices, and revoke every trusted device.
Challenge attempts are rate-limited. Recovery codes are hashed at rest and shown only when generated.
See `docs/security/two-factor-authentication.md` for the detailed trust model.
+7 -1
View File
@@ -1,3 +1,9 @@
# login
TODO: Complete documentation.
`POST /api/auth/login` accepts email, password, and remember-me preference. Successful local login
issues an HttpOnly session cookie plus a readable CSRF cookie. Accounts with two-factor authentication
receive a short-lived pending token and must complete `POST /api/auth/2fa/challenge` before a session is
issued. Login and challenge endpoints are rate-limited.
The frontend route is `/login`; registration has its own `/register` route. Authentication errors are
shown without exposing whether an unknown account exists.
+7 -1
View File
@@ -1,3 +1,9 @@
# oauth
TODO: Complete documentation.
Google and Microsoft sign-in exchange provider identity tokens for a normal Jobjakt local session.
Verified provider email addresses may link to the matching local account; provider subject identifiers
are then retained for stable future sign-in. Gmail and Microsoft Graph mailbox connections use separate
OAuth flows and state validation because they grant mailbox permissions, not application login.
Provider client IDs and secrets belong in environment configuration, never the repository. See
`docs/architecture/authentication.md` and the connected-account settings UI.
+8 -1
View File
@@ -1,3 +1,10 @@
# overview
TODO: Complete documentation.
Jobjakt supports local email/password sessions plus optional Google and Microsoft identity exchange.
Local access tokens are stored in an HttpOnly `jobtracker_session` cookie; mutating cookie-authenticated
requests also require the double-submit CSRF token. Identity, sessions, two-factor authentication,
trusted devices, email verification, and password reset are implemented by the controllers and services
under `JobTrackerApi/Controllers` and `JobTrackerApi/Services`.
Production authentication fails closed when required configuration is missing. See
`docs/architecture/authentication.md` and `docs/security/authentication.md` for the security model.
+6 -1
View File
@@ -1,3 +1,8 @@
# signup
TODO: Complete documentation.
Self-service signup uses `POST /api/auth/register` and the `/register` frontend route. It is disabled
unless `Auth:AllowRegistration`/`AUTH_ALLOW_REGISTRATION` is enabled. When Cloudflare Turnstile keys
are configured, the server validates the widget token through Siteverify before creating the account.
Production activation is intentionally blocked until the operator supplies Turnstile configuration;
see `BLOCKERS.md`. Email verification can also be required before the first login.
+1 -1
View File
@@ -96,7 +96,7 @@ It also independently states the same product boundary you have been enforcing:
Branch is **10 commits ahead, 29 commits behind** `main`. Seven files were touched on both sides since the fork:
```
Data/JobTrackerContext.cs
JobTrackerApi/Data/JobTrackerContext.cs
JobTrackerApi/Controllers/JobApplicationsController.cs
JobTrackerApi/Controllers/ProfileCvController.cs
JobTrackerApi/Program.cs
+5 -1
View File
@@ -1,3 +1,7 @@
# education
TODO: Complete documentation.
Education entries are relational `CareerEducation` children with stable item keys. The Career Profile is
the editable source of truth; CV variants control only selection, order, labels, and presentation-time
overrides. Imported CV data is reviewed before it is merged.
See `docs/architecture/career-profile-model.md`.
+5 -1
View File
@@ -1,3 +1,7 @@
# experience
TODO: Complete documentation.
Experience entries are relational `CareerExperience` children owned by one Career Profile. They carry
stable item keys so CV variants can reference, hide, reorder, or override presentation without copying
the underlying facts. Career Profile edits update the source; variants resolve the latest source data.
See `docs/architecture/career-profile-model.md`.
+4 -1
View File
@@ -1,3 +1,6 @@
# projects
TODO: Complete documentation.
Projects are structured Career Profile records and can appear in any CV variant. Project facts remain
in the profile while each variant chooses visibility, order, and presentation overrides. Public CV
custom sections are the portfolio surface. A separate hosting product is intentionally out of scope
until a concrete need such as media galleries or custom domains appears.
+5 -1
View File
@@ -1,3 +1,7 @@
# skills
TODO: Complete documentation.
Skills are structured Career Profile records used by CV rendering, deterministic job matching, keyword
gap analysis, and application readiness. They are never inferred into the profile without review.
Variant-specific hiding or ordering belongs to `CvVariantSettings`, not the Career Profile.
See `docs/career/career-profile.md` and `docs/architecture/career-profile-model.md`.
+5 -1
View File
@@ -1,3 +1,7 @@
# ai
TODO: Complete documentation.
AI cover-letter generation is suggestion-only. Prompts delimit untrusted job content, require factual
claims to come from the Career Profile or application context, and return text for user review. Calls
are recorded by the shared AI interaction meter and constrained by plan request/token limits.
See `docs/ai/cover-letter-ai.md` and `docs/ai/safety.md`.
+3 -1
View File
@@ -1,3 +1,5 @@
# builder
TODO: Complete documentation.
The application workspace exposes cover-letter drafting alongside tailored CV and recruiter-message
tools. Users can generate a suggestion, edit it, save deliberately, and restore prior versions. Context
comes from the owned application and Career Profile; attachments are included only when selected for AI.
+5 -1
View File
@@ -1,3 +1,7 @@
# overview
TODO: Complete documentation.
Cover letters are application-owned documents generated from the Career Profile, job description, and
selected application context. They are not part of the master profile. Saved versions retain explicit
history so generation never silently overwrites an accepted draft.
See `docs/career/cover-letters.md` and `docs/architecture/application-workspace.md`.
+5 -1
View File
@@ -1,3 +1,7 @@
# ai
TODO: Complete documentation.
`POST /api/cv/ai/assist` supports focused rewrite actions such as shorten, grammar, bullets, summary,
ATS phrasing, and tailoring. Requests always instruct the provider to preserve facts. The response is a
suggestion: the user must apply it to a variant field explicitly.
Usage is counted by the shared AI metering and monthly plan limits.
+6 -1
View File
@@ -1,3 +1,8 @@
# content
TODO: Complete documentation.
The Content tab reads the master profile through `GET /api/cv/outline`. Section order, visibility,
renamed headings, item order, and per-item bullet overrides are saved in `CvVariantSettings`; profile
records remain unchanged. Custom sections belong only to the variant.
Reordering supports native drag-and-drop plus arrow-button keyboard controls. Rich-text input stores a
small plain-text markup whitelist that the server renders safely.
+6 -1
View File
@@ -1,3 +1,8 @@
# customisation
TODO: Complete documentation.
The Customize tab selects a catalog theme and changes the supported theme tokens: accent, fonts,
density, page size, photo treatment, icons, and page-number preference. `CvThemeCatalog` defines the
available first-party themes and plan entitlement. Existing Premium-theme documents remain readable
and exportable after downgrade.
See `docs/architecture/cv-theme-engine.md` for the data model.
+6 -1
View File
@@ -1,3 +1,8 @@
# exports
TODO: Complete documentation.
Authenticated variant export uses `POST /api/cv/variants/{id}/export-pdf`. The server resolves the
variant against the current Career Profile, renders HTML through `ThemedCvRenderer`, and invokes
headless Chromium through `PlaywrightCvPdfExporter`.
Public variants expose the same render through `GET /api/public-cv/{slug}/pdf`; visibility is checked
before rendering and anonymous generation is limited to three requests per public link per minute.
+6 -1
View File
@@ -1,3 +1,8 @@
# overview
TODO: Complete documentation.
The CV Builder turns the Career Profile into named, themed CV variants. A variant stores presentation
settings and stable item references; it never copies or overwrites the master profile. Users edit
content overrides, customize a data-driven theme, preview continuously, retain version history, export
PDF, and optionally publish an unguessable read-only link.
The authoritative design is `docs/architecture/cv-builder.md`.
+5 -1
View File
@@ -1,3 +1,7 @@
# rendering
TODO: Complete documentation.
Rendering is a projection pipeline: Career Profile plus `CvVariantSettings` becomes `CvRenderModel`,
then `ThemedCvRenderer` applies a declarative `CvTheme` to produce HTML. Preview, authenticated PDF,
and public sharing all use this path, preventing format-specific content drift.
See `docs/architecture/cv-rendering.md` and `docs/architecture/cv-theme-engine.md`.
+5 -1
View File
@@ -1,3 +1,7 @@
# themes
TODO: Complete documentation.
Themes are immutable catalog data rather than separate renderer implementations. Each theme declares
layout, colors, typography, spacing, header/photo treatment, ATS suitability, and whether Premium is
required. User overrides are stored on the variant and normalized before rendering.
Add a theme to `CvThemeCatalog`; do not add a new HTML renderer.
+7 -1
View File
@@ -1,3 +1,9 @@
# workflow
TODO: Complete documentation.
1. Maintain factual career data in `/career`.
2. Create or open a named CV variant in `/career/builder`.
3. Select visible content and apply variant-only overrides.
4. Choose a theme and customization tokens while previewing live.
5. Export PDF or explicitly enable a public link.
Autosave appends variant history. AI tools return suggestions only and never save without user action.
@@ -36,7 +36,7 @@ Split `Job` from `JobApplication`, **additively and in stages**. Phase 0 lays th
### Delivered in Phase 0
1. **`Job` entity** (`Models/Job.cs`) — the opportunity: company, title, description, URL, location, salary, deadline, tags, plus `SavedAt`. Owner-scoped by the same deny-on-null global query filter as every other tenant entity.
1. **`Job` entity** (`JobTrackerApi/Models/Job.cs`) — the opportunity: company, title, description, URL, location, salary, deadline, tags, plus `SavedAt`. Owner-scoped by the same deny-on-null global query filter as every other tenant entity.
2. **`JobApplication.JobId`** — a nullable FK to `Job`, `OnDelete: SetNull`.
3. **Prospect stages** — `JobPipeline` gained `PipelineCategory.Prospect` and the stages `Saved`(1), `Interested`(2), `Preparing`(3), ahead of `Applied`(4). No schema change: `Status` is a free-text column by deliberate prior design.
4. **`DateApplied` is now nullable**, and `SavedAt` was added to `JobApplication`.
+21 -6
View File
@@ -4,21 +4,36 @@ Updated: 2026-07-31
## Stripe billing — Phase 7.5
Needed from the operator before implementation can finish:
Needed from the operator before the implemented flow can be activated:
- Add `STRIPE_SECRET_KEY` and `STRIPE_PUBLISHABLE_KEY` to the production environment.
- Add `STRIPE_SECRET_KEY` to the production environment. Hosted Checkout does not need a publishable key in the browser.
- Create the recurring Premium price and add `STRIPE_PRICE_PREMIUM`.
- Create the billing webhook and add `STRIPE_WEBHOOK_SECRET`.
- Enable the customer portal, register `/api/billing/webhook` for subscription created/updated/deleted events, and add `STRIPE_WEBHOOK_SECRET`.
- Do not store or paste secret values in the repository or chat.
## Production key rotation — Phase 1.4
Confirm the DataProtection keys exposed in git history have been rotated on the production host.
## Product direction
## Operator handoff
The committed roadmaps are exhausted after the operator blockers above. The remaining long-term options need prioritization before implementation: separate portfolio hosting, recruiter visibility, or learning paths. Public CV custom sections already cover a basic portfolio, so a separate product should only be built if that distinction is intentional.
The remaining work requires external systems or production access, in this order:
1. **Run remote CI** for the reviewed working tree and diagnose the self-hosted runner only if it still fails.
2. **Rotate production DataProtection keys** and complete the documented backup/restore rehearsal.
3. **Deploy and verify production** login, OAuth, registration/Turnstile, real data, public CV/PDF, AI, and attachments.
4. **Activate Stripe billing** after its product, price, portal, webhook, and secrets exist.
5. **Rehearse the legacy-column cutover** against the restored production backup; remove columns only in a later expand/contract release.
### Access and inputs still needed
- **CI:** a reviewed commit/branch submitted to Gitea Actions; runner host/log access if the workflow remains unstable.
- **Stripe:** create/configure the Premium recurring price, portal, and webhook, then set `STRIPE_SECRET_KEY`, `STRIPE_PRICE_PREMIUM`, and `STRIPE_WEBHOOK_SECRET` outside the repository and chat.
- **Production security:** confirm the DataProtection keys exposed in git history were rotated.
- **Production access:** authorized host credentials for backup/restore, deploy, authenticated smoke tests, OAuth, and legacy-data validation.
Recruiter-facing PDF download and job-specific learning paths are implemented and tested in the working tree. Separate recruiter discovery/messaging and portfolio hosting are intentionally outside the current product scope. The existing `.agent.md`/`AGENTS.md` changes and the migration designer's line-ending-only status are unrelated and must be preserved.
## Progress
Phases 2 through 7.9 are complete except Stripe billing. Public CV sharing, premium themes, AI call and token limits, visible account usage, storage limits, NAV discovery, provider market dual-write with synchronized edits, CORS hardening, the prospect workflow, migration-history reconciliation, and salary insights are pushed to `main`. Latest completed commit: `6ed56fd`.
Phases 2 through 7.9 are implemented. Production reports registration and Turnstile enabled; remote CI, interactive production verification, key rotation, Stripe activation, deployment, and the production-backed legacy cutover remain. Public CV sharing, job-specific learning paths, premium themes, AI call and token limits, visible account usage, storage limits, NAV discovery, provider market dual-write with synchronized edits, CORS hardening, the prospect workflow, migration-history reconciliation, salary insights, browser smoke coverage, and Stripe billing are present in the working tree.
+7 -1
View File
@@ -1,3 +1,9 @@
# documentation-rules
TODO: Complete documentation.
Active documentation must describe verified current behavior or a clearly labelled future decision.
Prefer one authoritative document plus short topic guides that link to it; do not copy long architecture
sections across files. Update behavior docs in the same change as code.
Use `docs/architecture/current.md` for the verified system, `docs/implementation-roadmap.md` for delivery
status, `docs/MASTER_IMPLEMENTATION_GUIDE.md` for product constraints, and `BLOCKERS.md` for external
decisions or credentials. `docs/_archive` is historical evidence and must not be treated as current work.
+37 -42
View File
@@ -1,6 +1,6 @@
# Jobjakt — Implementation Roadmap
Date: 2026-07-17 · **Updated after Phase 0** (see `docs/phase-0-foundation-report.md`)
Date: 2026-07-31 · **Reconciled after the technical-debt pass**
Companion to `docs/application-discovery-report.md`. Every task below traces to a verified finding there.
> **Phase 0 is complete.** Architecture docs restored, **AI sidecar locked down to backend-only and verified live**, pipeline expanded beyond `Applied` (10 stages, 3 board groups), `Job` entity introduced. Phase 1 below has been re-scoped against the *actual* architecture rather than the assumptions the original plan carried. Product decisions from 2026-07-17 are folded in throughout.
@@ -17,7 +17,7 @@ Companion to `docs/application-discovery-report.md`. Every task below traces to
Priority: `P0` blocker · `P1` high · `P2` medium · `P3` later
Difficulty: `XS` <½day · `S` ~1day · `M` 2–4days · `L` ~1–2wk · `XL` 2wk+
**Ordering principle:** the guide names "Excellent Job Tracking" and "Excellent Application Workflow" as goals #1 and #2. Phase 1 exists because the data model currently cannot represent goal #2 at all. Nothing in Phases 3–7 is worth building before that is true.
**Current state:** Phases 0–7 are repository-complete. Opening registration, activating Stripe, and deploying the release require operator configuration/access. See `BLOCKERS.md`.
---
@@ -29,7 +29,7 @@ Original tasks 1.1, 1.2, 1.3 (backend half), 1.5, 1.7, 1.8, 1.9, 1.10 are comple
---
## Phase 1 — Critical fixes (re-scoped after Phase 0)
## Phase 1 — Critical fixes ✅ CODE COMPLETE
Goal: finish surfacing the pre-application workflow in the UI, and close the security findings that need an operator.
@@ -42,8 +42,8 @@ Goal: finish surfacing the pre-application workflow in the UI, and close the sec
| 1.5 | ✅ **DONE (2026-07-30)** — startup rejects wildcard CORS origins when credentialed requests are enabled. | **P1** | **XS** | none | Unsafe configuration now fails closed. |
| 1.6 | ✅ **DONE** — the dead `careerView` prop/tab is gone; the implemented CV Builder has its own routed workspace. | **P1** | **XS** | none | No dead navigation remains. |
| 1.7 | ✅ **DONE** — onboarding reads structured career-profile collections with raw CV text only as fallback. | **P2** | **XS** | none | Parsed profiles are recognized correctly. |
| 1.8 | ✅ **DONE** — full frontend suite is green (142 tests on 2026-07-30). | **P1** | **S** | none | CI has a clean regression baseline. |
| 1.9 | **Decide what to do with the `feature/career-workspace` branch.** ✅ *Investigated 2026-07-17 — see below.* The orphan tables are not an abandoned prototype: they are the local footprint of **10 unmerged commits** (local + `origin`, last touched 2026-07-12) containing working, tested code and 1,100 lines of research/strategy. All 7 tables are **empty** in dev, so there is no data to migrate. Branch is **29 commits behind main**. | **P0** | **M** | none | **Blocks Phases 3 and 4 from being planned honestly.** Re-deriving this work would waste weeks; ignoring it leaves a rebase debt that grows every day main moves. See `docs/career-workspace-branch-assessment.md`. |
| 1.8 | ✅ **DONE** — full frontend suite is green (145 tests on 2026-07-31). | **P1** | **S** | none | CI has a clean regression baseline. |
| 1.9 | ✅ **DONE** — the useful Career Workspace design/code was recovered and superseded by the completed Phase 3/4 implementation. The old branch is historical and is not a merge target. | **P0** | **M** | none | No longer blocks later phases. See `docs/career-workspace-branch-assessment.md` for the original assessment. |
| 1.10 | ✅ **DONE (2026-07-30)** — restored EF identity metadata for the two orphan migrations as safe no-op history markers and brought the development database fully current. | **P2** | **S** | none | The idempotent reconciler remains the schema owner for those legacy columns; EF migration history is now complete with no pending migrations. |
**Phase 1 exit:** a user can save a job they have not applied to, walk the wizard, prepare materials, and *then* mark it applied — visibly, in the UI. CI is green.
@@ -189,39 +189,35 @@ Goal: commercialise. Last, per the guide's "do not over-engineer before needed.
| # | Task | Priority | Difficulty | Dependencies | Expected value |
|---|---|---|---|---|---|
| 7.1 | **IMPLEMENTED; configuration required** — password signup and sign-in use Cloudflare Turnstile with mandatory server-side Siteverify validation when keys are configured. Registration remains closed until `AUTH_ALLOW_REGISTRATION=true` and production widget keys are supplied. | **P2** | **M** | 2.4, 7.3 | Safe code path is ready without silently opening public registration. |
| 7.1 | **IMPLEMENTED AND CONFIGURED; browser verification required** — password signup and sign-in use Cloudflare Turnstile with mandatory server-side Siteverify validation. Production reports registration and Turnstile enabled; a real signup still needs interactive verification. | **P2** | **M** | 2.4, 7.3 | The code and configuration are active without weakening abuse controls. |
| 7.2 | **DONE (2026-07-30)** — existing Identity roles are the plan model: `Premium` (and `Admin`) receives `advancedAi`, `premiumThemes`, `automation`, `analytics`, and 5 GB storage capabilities; free accounts receive core features and 250 MB. `/auth/me` exposes plan and entitlements. | **P3** | **M** | none | Reuses the existing role system and avoids a second billing-state table before Stripe exists. |
| 7.3 | **DONE (2026-07-30)** — existing AI interaction metering now enforces monthly generation limits: 25 for free accounts and 250 for Premium/Admin. Usage responses expose the active plan and limit. | **P3** | **M** | 5.2, 7.2 | Cost-bearing AI now has a clear monthly ceiling before registration opens. |
| 7.4 | **DONE (2026-07-30)** — attachment uploads enforce total per-user storage entitlements (250 MB free, 5 GB Premium/Admin) in addition to the existing 10 MB per-file cap. | **P3** | **S** | 7.2 | Storage limits match the exposed capability model. |
| 7.5 | **Stripe billing** | **P3** | **L** | 7.2 | Still blocked on **Stripe keys** — the only remaining hard blocker. Tiers are now decided. |
| 7.6 | ✅ **DONE (2026-07-30)** — public CV (`/cv/{guid}`), privacy-first random links, revoke/rotate sharing | **P3** | **M** | 3.4, 4.2 | Anonymous rendering is isolated behind an explicit public flag, served with `noindex`, and revoked links cannot be restored accidentally. |
| 7.5 | **IMPLEMENTED; configuration required (2026-07-31)** — hosted subscription Checkout, customer portal, signed subscription webhooks, persisted Stripe state, and idempotent Premium-role provisioning. | **P3** | **L** | 7.2 | Activation needs the operator-created monthly price, portal, webhook registration, and three deployment secrets in `BLOCKERS.md`. |
| 7.6 | ✅ **DONE (2026-07-31)** — public CV (`/cv/{guid}`), privacy-first random links, revoke/rotate sharing, recruiter PDF download | **P3** | **M** | 3.4, 4.2 | Anonymous rendering is isolated behind an explicit public flag, served with `noindex`; revoked links cannot be restored accidentally, and rate-limited PDF export uses the same visibility check. |
| 7.7 | ✅ **DONE (2026-07-30)** — three free CV themes plus five Premium themes, enforced by account entitlement and clearly locked in the picker | **P3** | **S** | 4.3, 7.2 | Existing Premium-theme CVs remain editable and exportable after downgrade so user data is never held hostage. |
| 7.8 | **DONE (2026-07-30)** — CI runs NuGet transitive vulnerability reporting and a production-only npm audit. The npm audit reports the existing no-fix advisory baseline without blocking unrelated deploys. | **P2** | **S** | none | Vulnerable dependencies are now visible before deployment. |
| 7.8 | **DONE (2026-07-31)** — CI runs NuGet transitive vulnerability reporting and blocks high/critical npm findings across production and test/browser tooling. The documented React Router baseline is moderate. | **P2** | **S** | none | Vulnerable dependencies are visible and high-severity regressions stop deployment. |
| 7.9 | ✅ **DONE (2026-07-30)** — per-user monthly AI token ceilings (100k free, 1M Premium/Admin) enforced alongside generation limits and exposed in usage totals | **P3** | **S** | 5.2, 7.2 | Existing metering is the single accounting source; paid-provider spend now has both request and token ceilings. |
---
## Maintenance milestone — Technical-debt reduction ✅ DONE (2026-07-31)
Removed the dead 232 MB vendor snapshot and transitional link-compilation project; consolidated API
source ownership; added Problem Details, traceable structured logs, trusted proxy handling, durable CV
queue restart recovery, CV artifact cleanup, PDF retention, and warning-free frontend tests; replaced
placeholder docs and reconciled stale architecture records. Remaining conditional debt and its trigger
conditions are tracked in `docs/architecture/technical-debt.md`.
---
## Critical path
```
[Phase 0 DONE] pipeline stages · DateApplied nullable · Job entity · sidecar secured · docs restored
All implementation dependencies through Phase 6 are closed. The remaining release path is:
1.1 Prospect stages in UI ── 1.2 Wizard target (finishes the workflow users can see)
1.8 Fix red CI (independent — do first; everything lands on this baseline)
1.4 Rotate DP keys · 1.5 CORS fix (independent security)
1.9 Orphan tables ── informs 3.1
`production key rotation → backup/restore rehearsal → deploy/smoke test → registration verification`
2.1 Split profile/career ── 2.2 Decompose ProfilePage ── 3.3 Career Workspace
└─ 3.4 Profile ≠ Master CV ──┬─ 4.1 CvTheme model ── 4.2 Renderer ──┬─ 4.3 Themes
│ ├─ 4.5 Customise tab
│ └─ 4.6 Live preview ── 4.7 Export
└─ 4.4 Content tab
4.9 Reactive Resume research ── must precede 4.1
6.6 Market as data ── 6.3 Official APIs
5.2 AI metering ── 7.3 Quotas ── 7.1 Open registration
```
**Two things now gate everything:** `3.4` (profile ≠ CV) and `4.1` (themes as data). The third — the workflow — was unblocked by Phase 0; only its UI surface (1.1) remains.
Stripe code is complete; activation can follow once the product, monthly price, portal, webhook, and credentials exist.
---
@@ -230,13 +226,14 @@ Goal: commercialise. Last, per the guide's "do not over-engineer before needed.
| Phase | Rough size | Note |
|---|---|---|
| 0 — Foundation | **done** | Delivered 2026-07-17. |
| 1 — Critical fixes | ~3–5 days | Shrunk: Phase 0 absorbed most of it. Mostly UI surfacing + two operator tasks. |
| 2 — UX | ~2–3 wk | 2.5 (data layer) is the multiplier. |
| 3 — Career Workspace | ~2–3 wk | Grew slightly: relational profile (3.1) is now L, not a coin-flip. |
| 4 — CV Builder | **~4–6 wk** | The big one. Do not underestimate because a tab exists. |
| 5 — AI | ~1 wk | Shrunk: 5.1 is a docs fix, not an abstraction build. |
| 6 — Job discovery | ~2–3 wk | Shrunk: no scraping, and (a) is mostly built. The extension (6.2) carries most of the value. |
| 7 — SaaS | ~3–4 wk | Tiers decided; needs Stripe keys. |
| 1 — Critical fixes | **code complete** | DataProtection rotation remains an operator task. |
| 2 — UX | **done** | Delivered 2026-07-30. |
| 3 — Career Workspace | **done** | Delivered 2026-07-30. |
| 4 — CV Builder | **done** | Delivered 2026-07-30; public PDF completed 2026-07-31. |
| 5 — AI | **done** | Metering and quotas included. |
| 6 — Job discovery | **done** | Official NAV feed plus reviewed save flow. |
| 7 — SaaS | **operationally blocked** | Remote CI, Stripe activation, and interactive production signup/OAuth verification remain. |
| Maintenance — Technical debt | **done** | Conditional future debt remains trigger-based, not current blocking work. |
---
@@ -255,14 +252,12 @@ All six of the original blocking questions are answered. Recorded here so they a
## Remaining blockers
Only two things now block work, and both need you rather than a decision:
The authoritative list is `BLOCKERS.md`. Repository implementation is currently blocked only by
external systems, credentials/configuration, or production access: remote CI, Stripe activation, production signup/OAuth verification,
DataProtection key rotation, production verification/deployment, and the production-backed legacy
job/application cutover. Job-specific learning paths are implemented, and portfolio content stays in public CVs.
1. **Stripe keys** (gates 7.5). Tiers are decided; the integration needs credentials.
2. **DataProtection key rotation** (task 1.4). Needs an operator with production access.
## Open questions raised by Phase 0
## Open questions raised *by* Phase 0
Not product decisions — engineering findings that need a call before the phase they touch:
1. **Orphan DB tables** (task 1.9). The dev database carries `CareerProfiles`, `CareerProfileVersions`, `CvVariants`, `CvVersions`, `TailoredApplications`, `InterviewPrepNotes`, `AiWorkspaceNotes` — in no model, no migration. An abandoned Career Workspace attempt. **Was there a previous design worth recovering, or is this dead weight to drop?** Answer before Phase 3 re-treads the same ground.
2. **Kanban column count** (task 1.1). The pipeline now has 9 stages; the board is built for 6. Do the three Prospect stages get their own columns, collapse into one "Not applied" column, or sit behind a toggle? A UI decision, needed to finish Phase 1.
None remain. Career Workspace data was recovered into the relational model and the Kanban groups
prospect stages explicitly.
@@ -1,5 +1,8 @@
# Infrastructure Investigation — CI runner and deploy failures
> **Historical investigation.** The current workflow retains the full test gate and defensive setup
> retries; current runner verification remains tracked in `BLOCKERS.md` until a reviewed tree passes CI.
> 2026-07-18. Supersedes `docs/ci-runner-investigation.md`.
> **Conclusion (2026-07-18): failures A and B are outside the repository.** Application code was
> eliminated as a cause for those two by direct experiment. Confirmation and repair require host
+6 -1
View File
@@ -1,3 +1,8 @@
# applications
TODO: Complete documentation.
Applications are tenant-owned and soft-deleted. Create/update/status/follow-up operations emit
`JobEvent` records; the timeline projects those events together with correspondence and attachments.
Opportunity fields dual-write to the normalized `Job` entity while compatibility columns remain during
the incremental migration.
The REST surface is summarized in `README.md`; ownership rules are in `docs/security/authorization.md`.
+1 -4
View File
@@ -1,6 +1,3 @@
# companies
TODO: Complete documentation.
# Company Management
## Purpose
@@ -55,4 +52,4 @@ Possible:
- Company research.
- Reviews.
- Hiring insights.
- Hiring insights.
+5 -1
View File
@@ -1,3 +1,7 @@
# followups
TODO: Complete documentation.
Each application can hold a follow-up date and reminder state. Setting or clearing it emits a lifecycle
event. Dashboard reminders and the background email reminder service use the same owned application
data; generated follow-up drafts remain suggestions until the user sends or saves them.
Rules can mark stale applications Ghosted, but user-authored custom statuses are preserved.
+7 -2
View File
@@ -1,6 +1,11 @@
# overview
TODO: Complete documentation.
The job domain tracks opportunities before and after application. Canonical stages cover Saved,
Interested, Preparing, Applied, Waiting, Interview, Offer, Rejected, and Ghosted while preserving
unknown custom status values. Each owned application aggregates company, correspondence, attachments,
follow-ups, checklist, timeline, analysis, and generated application material.
See `docs/architecture/application-workspace.md` and `docs/decisions/ADR-002-job-application-model.md`.
# Job Tracking Overview
## Purpose
@@ -138,4 +143,4 @@ The user should always know:
Do not require users to complete every field.
Smart defaults are preferred.
Smart defaults are preferred.
+4 -4
View File
@@ -51,7 +51,7 @@ The backend side is one place — all seven call sites route through the named `
### Priority 3 — Introduce Job separate from JobApplication ✅ (foundation)
`Job` (`Models/Job.cs`) is the opportunity; `JobApplication` is the pursuit of it. `JobApplication.JobId` is a nullable FK (`OnDelete: SetNull`). `Job` carries the same deny-on-null tenant query filter as every other owned entity.
`Job` (`JobTrackerApi/Models/Job.cs`) is the opportunity; `JobApplication` is the pursuit of it. `JobApplication.JobId` is a nullable FK (`OnDelete: SetNull`). `Job` carries the same deny-on-null tenant query filter as every other owned entity.
**Deliberately additive: nothing reads or writes `Job` yet**, no dual-write, no backfill, no legacy columns dropped. That keeps Priority 3 a pure schema change with zero behavioural risk, which is what "unblock future phases safely" asks for. The Phase 1 cutover plan (dual-write → backfill → flip reads → drop columns) is in ADR-002.
@@ -80,9 +80,9 @@ The supporting change: **`DateApplied` is now nullable**, with `SavedAt` added.
## 2. Files changed
**Backend**
- `Models/Job.cs` *(new)* — the opportunity entity
- `Models/JobApplication.cs` — `JobId`, `SavedAt`, nullable `DateApplied`, `DaysSince` → `int?`
- `Data/JobTrackerContext.cs` — `Jobs` DbSet, tenant filter, FK config, index
- `JobTrackerApi/Models/Job.cs` *(new)* — the opportunity entity
- `JobTrackerApi/Models/JobApplication.cs` — `JobId`, `SavedAt`, nullable `DateApplied`, `DaysSince` → `int?`
- `JobTrackerApi/Data/JobTrackerContext.cs` — `Jobs` DbSet, tenant filter, FK config, index
- `JobTrackerApi/Services/JobPipeline.cs` — `Prospect` category, 3 stages, `IsProspect`, `SyncAppliedDate`
- `JobTrackerApi/Services/RulesEngine.cs` — prospect guard + null-`DateApplied` fail-safe
- `JobTrackerApi/Services/AnalyticsService.cs` — exclude prospects from applied-volume, average age, response-time; `SavedAt` fallback for stage entry
+1 -1
View File
@@ -24,7 +24,7 @@ ApplyQueuedRunResultAsync → SaveVersionAsync + user.ProfileCvStructureJson =
run.Status = "applied" (no user confirmation)
```
The structured model (`Models/StructuredCvProfile.cs`) already has `Contact, Summary, Jobs,
The structured model (`JobTrackerApi/Models/StructuredCvProfile.cs`) already has `Contact, Summary, Jobs,
Education, Certifications, Projects, Skills, Languages` and per-field confidence metadata. Confidence
is **captured and displayed** (the review chips) but used for nothing else.
+11 -7
View File
@@ -1,5 +1,7 @@
# Phase 5 — Intelligent Application Workspace: completion report
> **Historical snapshot (2026-07-19).** Current release dependencies are tracked in `BLOCKERS.md`.
> 2026-07-19. What was built, what was decided, what is still risky, and what should come next.
> Companion to `docs/architecture/application-workspace.md` and
> `docs/infrastructure/database-ownership.md`.
@@ -135,13 +137,15 @@ makes.
## Future improvements
This dated list is superseded by the current roadmap and debt ledger. Authorization and lifecycle
event emission are implemented; the placeholder Portfolio/Notes workspace tabs were removed because
projects belong in public CVs and application notes remain in the existing application editor.
- **Resolve the runner**, then verify the full stack in CI and deploy. Everything else is downstream.
- **Explicit `[Authorize]`** on the pre-Phase-5 controllers, paired with a dev-mode decision.
- **AI cover-letter actions** — improve, shorten, expand, tone, tailor. `CoverLetterVersion.AiAction`
already models them; only the modes and UI are missing.
- **Portfolio section** (workspace milestone 8) is still a placeholder.
- **Emit the new lifecycle events.** `InterviewScheduled`, `InterviewCompleted`, `OfferReceived`,
`FollowUpCompleted` are *interpreted* by the timeline but only `FollowUpSet` and `StatusChanged` are
currently emitted. Wiring the emitters is small and would make the timeline noticeably richer.
- ~~**Explicit `[Authorize]`** on the pre-Phase-5 controllers~~ — implemented.
- **AI cover-letter actions** — separate improve/shorten/expand actions remain intentionally unscoped;
the shipped flow generates by tone and keeps user editing/version history authoritative.
- ~~**Portfolio section**~~ — removed; public CV projects/custom sections cover the current scope.
- ~~**Emit the new lifecycle events**~~ — implemented through `JobLifecycleEvents`.
- **Checklist GET writes on read** (seeding + auto-completion sync). Correct and idempotent, but it
makes a GET non-cacheable; worth revisiting if the workspace ever needs to scale reads.
+9 -1
View File
@@ -1,3 +1,11 @@
# business-model
TODO: Complete documentation.
Jobjakt uses capability-based plans rather than limiting the number of jobs or documents. Free accounts
receive core tracking, basic Career Profile/CV features, 250 MB storage, and bounded AI usage.
Premium/Admin accounts receive advanced AI, Premium themes, automation, analytics, 5 GB storage, and
higher request/token ceilings.
Stripe hosted Checkout, customer-portal sessions, signed subscription webhooks, persisted customer /
subscription state, and Premium-role provisioning are implemented. Production activation still needs
the operator-created monthly price, portal configuration, webhook registration, and credentials in
`BLOCKERS.md`. Existing user documents remain readable and exportable after downgrade.
+10 -4
View File
@@ -1,5 +1,11 @@
# Jobjakt Product Roadmap
Status reconciled 2026-07-31: Phases 1–8 are implemented in the repository. Phase 8 (SaaS
commercialisation) remains operationally blocked on Stripe activation and production verification.
The implementation roadmap folds public profile and SaaS preparation into its Phase 7; this product
roadmap keeps them as Phases 7 and 8. Portfolio content stays inside public CVs; separate portfolio
hosting is intentionally out of scope until it has requirements that public CVs cannot satisfy.
## Purpose
Defines the strategic direction of Jobjakt.
@@ -312,9 +318,9 @@ Possible future features:
- Salary insights. ✅ Dashboard groups comparable tracked ranges by currency and pay period (2026-07-31).
- Career analytics.
- Skill recommendations.
- Learning paths.
- Recruiter visibility.
- Portfolio hosting.
- Learning paths. ✅ Deterministic job-specific skill gaps can be marked learned or dismissed; external course integrations remain out of scope (2026-07-31).
- Recruiter visibility. ✅ Public CV links include recruiter-friendly PDF download (2026-07-31); discovery, accounts, and messaging remain intentionally unscoped.
- Portfolio hosting. ➖ Separate hosting is intentionally out of scope; public CV projects and custom sections cover the current sharing need.
---
@@ -326,4 +332,4 @@ Do not:
- Sacrifice simplicity for complexity.
- Add features because competitors have them.
Always prioritise user value.
Always prioritise user value.
+4 -1
View File
@@ -1,5 +1,8 @@
# Production readiness review
> **Historical snapshot (2026-07-19).** The current production blockers are maintained in
> `BLOCKERS.md`; current implementation status is in `docs/implementation-roadmap.md`.
> 2026-07-19, before the first production deployment after the Phase 4/5 architecture changes.
> Companion to `docs/phase-5-completion-report.md` and `docs/infrastructure/database-ownership.md`.
>
@@ -115,7 +118,7 @@ config. See `docs/infrastructure/runner-investigation.md`.
### 5. Logging is console-only — **accepted for now**
`builder.Logging` clears providers and adds Console and Debug. Adequate under Docker (captured by
`docker logs`), but there is no retention, no structure, and no aggregation. Acceptable for a
`docker logs`), and production output is structured JSON, but there is no configured retention or aggregation. Acceptable for a
self-hosted single-node deployment; revisit if that changes.
### 6. No global exception handler — **minor**
+3
View File
@@ -1,5 +1,8 @@
# Release candidate review
> **Historical snapshot (2026-07-19).** For the reconciled 2026-07-31 implementation status and
> remaining external work, use `docs/implementation-roadmap.md` and `BLOCKERS.md`.
> 2026-07-19. Final validation pass before the first production deployment. **No application code was
> changed by this review** — findings only. Every claim below was checked against the implementation,
> not against the other documents. Where a document and the code disagreed, the code is reported.
+5 -2
View File
@@ -1,5 +1,8 @@
# Release checklist
> **Historical snapshot (2026-07-19).** The current release gate and external dependencies are
> documented in `.gitea/workflows/ci-deploy.yml`, `docs/implementation-roadmap.md`, and `BLOCKERS.md`.
> 2026-07-19. State of the build before the first production deployment after the Phase 4/5
> architecture changes. Companion to `deploy/first-production-deployment.md` (how to deploy),
> `docs/production-readiness-review.md` (what was audited) and
@@ -56,9 +59,9 @@ Full evidence: `docs/infrastructure/runner-investigation.md`.
|---|---|---|
| Production is many commits behind | High | The first deploy applies the whole Phase 4/5 change at once. Reconciler builds ~12 tables against real data for the first time. |
| Reconciler path unproven on your data | Medium | Verified on containers and on a real SQLite dev database — not on production. This is what the backup is for. |
| End-to-end journey unwalked | Medium | No one has driven the authenticated flow from empty profile to recorded outcome. Sign-in needs a password, so the browser checks belong to you. |
| Production journey unwalked | Medium | The CI-gated local browser suite covers login, saved-job creation, Career Workspace, and public CV/PDF. The same authenticated and OAuth checks still require production credentials. |
| Rollback loses new-table data | Medium | A code rollback keeps everything. A *database restore* discards rows created since the dump. Keep the deploy window quiet. |
| Logging is console-only | Low | Fine under Docker; no retention or aggregation. |
| Logging is structured JSON on stdout | Low | Compose retains three 10 MB files per service; aggregation remains deployment-owned. |
| No global exception handler | Low | Unhandled errors return a bare 500 with no correlation id. No stack leaks outside Development. |
| `ClientErrorsController` is anonymous | Low | By design — browser error reports must work before sign-in. Size-limited and truncated; stores nothing. |
| Prompt quality unmeasured | Low | Interview generation gets richer context; whether the questions are *better* is a judgement no test makes. |
+3
View File
@@ -1,5 +1,8 @@
# Final release report
> **Historical snapshot (2026-07-19).** The current release state is maintained in
> `docs/implementation-roadmap.md`, with external/operator dependencies in `BLOCKERS.md`.
> 2026-07-19. Compiled at the release-candidate stage after the CI runner failure was investigated and
> a real code bug behind it was fixed. Consolidates the verification done across the release-hardening
> work. Every claim here was verified this session unless explicitly marked as owner-only or unproven.
+1 -4
View File
@@ -1,6 +1,3 @@
# flowcv
TODO: Complete documentation.
# FlowCV Analysis
## Purpose
@@ -86,4 +83,4 @@ Job applications.
Tailoring.
Career history.
Career history.
+4 -1
View File
@@ -1,3 +1,6 @@
# jobscan
TODO: Complete documentation.
Jobscan's relevant product pattern is deterministic CV-to-job keyword coverage with visible matched and
missing terms. Jobjakt implements that value through `JobCvMatchService` and the match-score panel,
without requiring an AI call. Broader competitor conclusions and pricing context are recorded in
`docs/research/competitors.md` and `docs/cv-builder-competitor-deep-research.md`.
+1 -4
View File
@@ -1,6 +1,3 @@
# novoresume
TODO: Complete documentation.
# Novoresume Analysis
## Purpose
@@ -54,4 +51,4 @@ Follow-up
- CV scoring.
- Content suggestions.
- Professional templates.
- Guided onboarding.
- Guided onboarding.
+6 -1
View File
@@ -1,3 +1,8 @@
# uploads
TODO: Complete documentation.
Uploads are tenant-scoped through their parent application. File names are normalized with
`Path.GetFileName` and stored under generated names inside the configured attachments root. The API
enforces allowed types, a per-file size limit, and the account's total storage entitlement.
Downloads resolve the owned database record before opening a file. Files selected for AI are explicit;
uploading alone does not send content to a provider.
+6 -1
View File
@@ -1,3 +1,8 @@
# validation
TODO: Complete documentation.
Validation happens at trust boundaries: controller request DTOs, file uploads, imported URLs, OAuth
state callbacks, AI sidecar authentication, and deployment configuration. Job import and IMAP targets
resolve through SSRF guards that reject private, loopback, link-local, and unsafe redirect targets.
Unhandled failures use Problem Details with a trace ID; expected validation failures retain their
specific 4xx responses. See `docs/security/input-validation.md` and `docs/security/api-security.md`.
+11 -1
View File
@@ -42,4 +42,14 @@ Include:
- Operation.
- User context where safe.
- Error details.
- Correlation IDs.
- Correlation IDs.
## Runtime output
Production emits structured JSON to stdout for Docker collection. Development keeps readable console
and debug output. The request middleware records method, path, status, elapsed milliseconds, trace ID,
and authenticated subject when present. Unhandled errors use the same trace ID in their Problem Details
response so an operator can correlate the client report with `docker logs`.
Compose retains three 10 MB local log files per service. There is no external sink; add Seq/OTLP only
when single-node Docker logs stop being operationally sufficient.