chore: auto-commit after execute-task
GSD-Unit: M001/S06/T01
This commit is contained in:
@@ -1,60 +1,12 @@
|
||||
# S02: Stronger AI application package drafting
|
||||
|
||||
**Goal:** Make the application package generator use imported job/correspondence context well enough that tailored CV, cover-letter, and recruiter-message drafts feel specific, credible, and worth starting from inside the job workspace.
|
||||
**Demo:** From a job that already has imported correspondence and profile/CV context, the user generates an application package in the workspace, sees drafts that clearly reflect the job plus imported Gmail context, edits and saves those drafts, and reopens the job to find the saved material still there as working output.
|
||||
|
||||
S02 directly owns active requirement **R003** and materially supports **R007** because the job workspace needs to behave like a place to prepare real application material, not just preview one-off AI output. The key risk is not missing endpoints; it is that the existing generator in `JobApplicationsController` may still produce generic drafts because it underuses S01 correspondence and saved recruiter/job context. The slice therefore stays backend-first again, then tightens the workspace save/edit loop around the improved contract.
|
||||
|
||||
## Must-Haves
|
||||
|
||||
- Application-package generation in `JobTrackerApi/Controllers/JobApplicationsController.cs` uses imported correspondence, recruiter/job context, profile CV structure, and attachment context deliberately enough to produce more specific drafts.
|
||||
- The generated package returns and persists real working material for the job: tailored CV, cover letter, recruiter message, and any supporting package signals the workspace needs to show what was saved.
|
||||
- The job workspace in `job-tracker-ui/src/components/JobDetailsDialog.tsx` makes generation, editing, and saving feel like one coherent loop instead of disconnected draft widgets.
|
||||
|
||||
## Proof Level
|
||||
|
||||
- This slice proves: integration
|
||||
- Real runtime required: yes
|
||||
- Human/UAT required: yes
|
||||
|
||||
## Verification
|
||||
|
||||
- `dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests`
|
||||
- `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx`
|
||||
- Manual UAT: open a job with imported correspondence, generate the application package, confirm the drafts mention job/company/correspondence-specific details, save edits in the workspace, reload the job, and verify the saved package material is still present and usable.
|
||||
|
||||
## Observability / Diagnostics
|
||||
|
||||
- Runtime signals: application-package responses should expose the specific draft artifacts and package signals used by the workspace, while save endpoints should update persisted job fields clearly enough to inspect reload behavior.
|
||||
- Inspection surfaces: `POST /api/jobapplications/{id}/generate-application-package`, `PUT /api/jobapplications/{id}/tailored-cv`, `PUT /api/jobapplications/{id}/application-drafts`, and the Tailored CV tab in `job-tracker-ui/src/components/JobDetailsDialog.tsx`.
|
||||
- Failure visibility: backend tests should make empty-context and weak-context failures obvious, while the workspace should distinguish generation failure, unsaved edits, and saved package state.
|
||||
- Redaction constraints: no raw secrets in AI prompts or logs; correspondence/body context should stay inside application data flows, not new diagnostic logging.
|
||||
|
||||
## Integration Closure
|
||||
|
||||
- Upstream surfaces consumed: S01 correspondence persistence in `Models/Correspondence.cs`, Gmail-linked workspace rendering in `job-tracker-ui/src/components/Correspondence.tsx`, profile CV state from `JobTrackerApi/Controllers/ProfileCvController.cs`, and the existing package endpoints/UI in `JobTrackerApi/Controllers/JobApplicationsController.cs` and `job-tracker-ui/src/components/JobDetailsDialog.tsx`.
|
||||
- New wiring introduced in this slice: stronger draft-generation context assembly that consumes imported correspondence, plus clearer persistence/display of saved application package material in the job workspace.
|
||||
- What remains before the milestone is truly usable end-to-end: S03 still needs to consume the saved package plus imported correspondence for reply/follow-up drafting, and final milestone slices still need full live-loop revalidation.
|
||||
**Demo:** After this: From an imported job plus profile/CV context, the app generates materially better tailored CV and cover-letter drafts that feel specific and usable.
|
||||
|
||||
## Tasks
|
||||
|
||||
- [x] **T01: Strengthen application-package context assembly and backend draft tests** `est:4h`
|
||||
- Why: S02 succeeds or fails on draft quality, so the generator must consume the right job, correspondence, recruiter, attachment, and profile-CV context before the workspace polish matters.
|
||||
- Files: `JobTrackerApi/Controllers/JobApplicationsController.cs`, `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs`
|
||||
- Do: Audit `generate-application-package` and related helpers, add deliberate use of imported correspondence and recruiter/job context to the package prompt assembly, keep the no-auto-send boundary intact, and add focused backend tests that prove the returned package reflects stronger job-specific context instead of generic output.
|
||||
- [x] **T01: Strengthen application-package context assembly and backend draft tests** —
|
||||
- Files: JobTrackerApi/Controllers/JobApplicationsController.cs, JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs
|
||||
- Verify: `dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests`
|
||||
- Done when: the backend package contract clearly uses imported job context and focused backend tests prove the response contains stronger, job-specific draft material.
|
||||
- [x] **T02: Make the job workspace save and present the application package as real working material** `est:4h`
|
||||
- Why: Even a better generator will still feel weak if the workspace treats drafts like disposable previews instead of editable saved material tied to the job.
|
||||
- Files: `job-tracker-ui/src/components/JobDetailsDialog.tsx`, `job-tracker-ui/src/types.ts`, `job-tracker-ui/src/job-details-generated-drafts.test.tsx`
|
||||
- Do: Refine the Tailored CV/application package tab so generated artifacts, saved edits, and package state read clearly as one working loop; surface the stronger backend outputs without adding a second draft system; and expand the existing dialog test to prove generation, editing, saving, and reload behavior for the package flow.
|
||||
- [x] **T02: Make the job workspace save and present the application package as real working material** —
|
||||
- Files: job-tracker-ui/src/components/JobDetailsDialog.tsx, job-tracker-ui/src/types.ts, job-tracker-ui/src/job-details-generated-drafts.test.tsx
|
||||
- Verify: `CI=true npm --prefix job-tracker-ui test -- --watch=false --runTestsByPath src/job-details-generated-drafts.test.tsx`
|
||||
- Done when: the workspace generates, edits, saves, and re-displays application package material coherently, and the focused frontend test proves that loop.
|
||||
|
||||
## Files Likely Touched
|
||||
|
||||
- `JobTrackerApi/Controllers/JobApplicationsController.cs`
|
||||
- `JobTrackerApi.Tests/JobApplicationsApplicationPackageTests.cs`
|
||||
- `job-tracker-ui/src/components/JobDetailsDialog.tsx`
|
||||
- `job-tracker-ui/src/types.ts`
|
||||
- `job-tracker-ui/src/job-details-generated-drafts.test.tsx`
|
||||
|
||||
@@ -1,43 +1,22 @@
|
||||
---
|
||||
title: T01 summary
|
||||
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
|
||||
- $HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests
|
||||
id: T01
|
||||
parent: S02
|
||||
milestone: M001
|
||||
provides: []
|
||||
requires: []
|
||||
affects: []
|
||||
key_files: []
|
||||
key_decisions: []
|
||||
patterns_established: []
|
||||
drill_down_paths: []
|
||||
observability_surfaces: []
|
||||
duration: ""
|
||||
verification_result: ""
|
||||
completed_at: 2026-03-27T07:30:18.613Z
|
||||
blocker_discovered: false
|
||||
---
|
||||
|
||||
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.
|
||||
# T01: Strengthen application-package context assembly and backend draft tests
|
||||
|
||||
## 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:
|
||||
- recruiter name/email and greeting baseline
|
||||
- imported correspondence context from S01
|
||||
- existing saved job material (tailored CV / cover letter / recruiter message) when present
|
||||
- job URL in the package context
|
||||
- updated prompts so tailored CV, cover letter, application answer, recruiter message, and variants all explicitly use imported correspondence when helpful without crossing the manual-send boundary
|
||||
- expanded `KeyPoints` to include correspondence-derived and attachment-derived signals
|
||||
- `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
|
||||
|
||||
## Diagnostics
|
||||
|
||||
- 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 |
|
||||
## What Happened
|
||||
No summary recorded.
|
||||
|
||||
@@ -1,51 +1,22 @@
|
||||
---
|
||||
title: T02 summary
|
||||
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
|
||||
- $HOME/.dotnet/dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsApplicationPackageTests
|
||||
id: T02
|
||||
parent: S02
|
||||
milestone: M001
|
||||
provides: []
|
||||
requires: []
|
||||
affects: []
|
||||
key_files: []
|
||||
key_decisions: []
|
||||
patterns_established: []
|
||||
drill_down_paths: []
|
||||
observability_surfaces: []
|
||||
duration: ""
|
||||
verification_result: ""
|
||||
completed_at: 2026-03-27T07:30:18.613Z
|
||||
blocker_discovered: false
|
||||
---
|
||||
|
||||
Turned the Tailored CV tab into a real package workspace instead of a one-shot draft preview.
|
||||
# T02: Make the job workspace save and present the application package as real working material
|
||||
|
||||
## 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
|
||||
- generation now replaces the editable working copy for all package artifacts, not only the tailored CV
|
||||
- added package-level save flow that writes the tailored CV plus draft artifacts back to the job together
|
||||
- added explicit saved/generated/unsaved status chips so the user can tell what is persisted versus still in the working draft
|
||||
- added reset-to-saved behavior so the workspace can recover from unwanted edits
|
||||
- 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
|
||||
|
||||
## Diagnostics
|
||||
|
||||
- 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 |
|
||||
## What Happened
|
||||
No summary recorded.
|
||||
|
||||
Reference in New Issue
Block a user