chore(M001/S02): auto-commit after complete-slice

This commit is contained in:
2026-03-24 12:32:21 +01:00
parent bc8bbbfddd
commit b2d9358d58
9 changed files with 242 additions and 51 deletions
@@ -4,14 +4,19 @@ status: done
files:
- JobTrackerApi/Controllers/JobApplicationsController.cs
- JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs
observability_surfaces:
- POST /api/jobapplications/{id}/generate-application-package
- JobApplicationsApplicationPackageTests in JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs
- persisted package fields and notes markers on JobApplication records after generation/save loops
verification:
- $HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj
- docker run --rm -v "$PWD":/src -w /src mcr.microsoft.com/dotnet/sdk:9.0 bash -lc '...dotnet test /tmp/apptests/AppPkgTests.csproj...'
- $HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests
---
Strengthened application-package generation so it now consumes imported correspondence and recruiter/job context instead of relying mostly on job description text plus the profile CV.
What changed:
## What changed
- `JobTrackerApi/Controllers/JobApplicationsController.cs`
- added `BuildCorrespondenceContextAsync(...)` to gather recent imported correspondence, participants, thread ids, and AI-derived package signals
- enriched `generate-application-package` context with:
@@ -24,9 +29,15 @@ What changed:
- `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs`
- added focused backend proof that package generation reacts to imported correspondence and recruiter context rather than falling back to generic output
Verification:
- Native backend build passed with `$HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj`
- Focused application-package backend test passed in an isolated Docker harness (`1 passed`)
## Diagnostics
Important caveat:
- As with S01 backend verification, the repositorys broader `JobTrackerApi.Tests` project still has unrelated compile drift, so the focused package test was isolated instead of relying on the full test project.
- Call `POST /api/jobapplications/{id}/generate-application-package` on a job that already has imported correspondence; inspect whether the response package now includes recruiter-aware wording, correspondence-derived `keyPoints`, and non-generic draft content.
- Check `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs` first when the package feels generic; it is the narrowest automated proof that imported correspondence and recruiter context reach the generator.
- If runtime output looks weak, inspect the job record and linked `Correspondence` rows first; this generator now depends on persisted correspondence quality rather than only the raw job description.
## Verification Evidence
| Command | Exit code | Verdict | Duration |
|---|---:|---|---|
| `$HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj` | 0 | PASS | 4.8s |
| `$HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests` | 0 | PASS | 8.4s |
@@ -4,15 +4,23 @@ status: done
files:
- job-tracker-ui/src/components/JobDetailsDialog.tsx
- job-tracker-ui/src/job-details-generated-drafts.test.tsx
- JobTrackerApi/Controllers/JobApplicationsController.cs
- JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs
observability_surfaces:
- Tailored CV tab in job-tracker-ui/src/components/JobDetailsDialog.tsx
- PUT /api/jobapplications/{id}/tailored-cv
- PUT /api/jobapplications/{id}/application-drafts
- job-tracker-ui/src/job-details-generated-drafts.test.tsx
verification:
- CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx
- $HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj
- docker run --rm -v "$PWD":/src -w /src mcr.microsoft.com/dotnet/sdk:9.0 bash -lc '...dotnet test /tmp/apptests/AppPkgTests.csproj...'
- $HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests
---
Turned the Tailored CV tab into a real package workspace instead of a one-shot draft preview.
What changed:
## What changed
- `job-tracker-ui/src/components/JobDetailsDialog.tsx`
- added package workspace state for cover letter, application answer, and recruiter message alongside the tailored CV
- initialized that workspace from saved job material so reopening the dialog shows the last trusted copy, not just blank/generated state
@@ -23,14 +31,21 @@ What changed:
- normalized application-answer persistence into a replaceable notes block instead of endlessly appending
- `job-tracker-ui/src/job-details-generated-drafts.test.tsx`
- expanded the focused dialog test to prove saved material loads into the workspace, generation replaces the working copy, edits can be saved, and the save payload reflects the coherent package state
- backend support tightened during T02
- `JobTrackerApi/Controllers/JobApplicationsController.cs`: `SaveApplicationDrafts` now replaces `Notes` when notes are provided, which makes the saved application-answer loop trustworthy instead of append-only
- `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs`: added focused proof that notes replacement no longer appends indefinitely
Backend support tightened during T02:
- `JobTrackerApi/Controllers/JobApplicationsController.cs`
- `SaveApplicationDrafts` now replaces `Notes` when notes are provided, which makes the saved application-answer loop trustworthy instead of append-only
- `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs`
- added focused proof that notes replacement no longer appends indefinitely
## Diagnostics
Verification:
- Frontend focused test passed: `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx`
- Backend host build passed: `$HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj`
- Focused backend package tests passed in isolated Docker harness (`2 passed`)
- Open the Tailored CV tab and inspect the four package editors plus status chips; `Saved to job`, `Generated only`, and `Unsaved edits` are the fastest UI-level signals for whether persistence is working.
- Inspect the payloads to `PUT /api/jobapplications/{id}/tailored-cv` and `PUT /api/jobapplications/{id}/application-drafts` when save behavior looks wrong; the package loop depends on both requests succeeding with aligned content.
- Check `job-tracker-ui/src/job-details-generated-drafts.test.tsx` first for regressions in regenerate/edit/save/reset behavior; it is the narrowest proof of the workspace contract.
- If the application answer keeps duplicating, inspect the marker-delimited block inside `JobApplication.Notes`; the persistence contract now replaces the `<<<APPLICATION_ANSWER_DRAFT>>> ... <<<END_APPLICATION_ANSWER_DRAFT>>>` block instead of appending.
## Verification Evidence
| Command | Exit code | Verdict | Duration |
|---|---:|---|---|
| `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx` | 0 | PASS | 8.3s |
| `$HOME/.dotnet/dotnet build JobTrackerApi/JobTrackerApi.csproj` | 0 | PASS | 4.8s |
| `$HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests` | 0 | PASS | 8.4s |