feat: Seeded acceptance-ready job data through the live API with determ…

- "scripts/s06-acceptance-data.sh"
- "scripts/s06-acceptance-data.test.sh"
- "README.md"
- ".gsd/KNOWLEDGE.md"
- ".gsd/DECISIONS.md"
- ".gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md"

GSD-Task: S06/T02
This commit is contained in:
2026-03-27 09:09:50 +01:00
parent b650844608
commit b37c0222a6
10 changed files with 538 additions and 14 deletions
+1
View File
@@ -18,3 +18,4 @@
| D010 | M001/S03 closeout | followup-drafting | How follow-up grounding should be exposed to the workspace | Return explicit follow-up grounding fields (`contextSummary`, `contextSignals`, `threadSubject`, and last-correspondence metadata) from the backend DTO instead of making the React workspace infer them client-side. | The slice needed draft trust, not just draft text. Putting grounding signals in the API contract gives the UI a durable explanation surface, keeps thread/package inference in one place with generation logic, and makes backend/frontend tests assert the same source of truth. | Yes | agent |
| D011 | M001/S05 planning | workflow-trust | How S05 should represent daily-loop readiness and next-action state across overview surfaces | Introduce explicit workflow trust/action signals from the backend/UI contract and reuse them across the table, dashboard, reminders, and shared workspace instead of continuing to infer behavior from free-form `followUpReason` strings or raw `notes` presence in each component. | S05 is an end-to-end polish slice where the remaining risk is fragmented trust, not missing subsystems. Centralizing workflow signals avoids heuristic drift between overview surfaces, respects the saved application-answer notes-block constraint, and gives the final integrated regression one source of truth for R010 while preserving the explicit manual-send boundary required by R008. | Yes | agent |
| D012 | M001/S05 | workspace-observability | Where linked Gmail thread continuity status should be exposed in the final trust loop | Show linked-thread refresh state directly in the correspondence workspace, including linked thread count and last refresh outcome, instead of hiding continuity feedback inside the Gmail import modal only. | The end-to-end trust loop depends on users being able to verify that already-linked Gmail threads stay current without re-importing. Surfacing continuity state in the main workspace keeps the job timeline trustworthy, supports final UAT, and avoids making thread refresh feel like a hidden one-off import behavior. | Yes | agent |
| D013 | M001/S06/T02 | seeding | How acceptance-ready job data is created for S06 live reruns | Seed the acceptance fixture through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, using deterministic company/title/thread/message identifiers for idempotent reruns. | The slice goal is a repeatable live environment check, so seeding through the same HTTP contract the UI uses proves the real backend surface, keeps package/readiness behavior aligned with production code paths, and avoids brittle direct DB mutations or duplicate correspondence on reruns. | Yes | agent |
+1
View File
@@ -7,3 +7,4 @@
- `dotnet test JobTrackerApi.Tests/JobTrackerApi.Tests.csproj --filter JobApplicationsFollowUpDraftTests` is now trustworthy again in this worktree after restoring the missing ASP.NET Core / Identity / xUnit test-project references in `JobTrackerApi.Tests/JobTrackerApi.Tests.csproj`; older task notes that require an isolated Docker harness are stale.
- Running `npm --prefix job-tracker-ui start` alone is not enough for browser UAT in this worktree: the frontend calls `http://localhost:5202/api/...`, so without the backend (or a matching CORS/proxy setup) the UI loads but shows empty-state surfaces with `net::ERR_FAILED`/CORS errors instead of real job data.
- In this CRA frontend, `react-scripts` resolves the app directory from the current working directory. Run UI tests/builds from `job-tracker-ui/` (for example `cd job-tracker-ui && CI=true ./node_modules/.bin/react-scripts ...`) instead of invoking `npm --prefix job-tracker-ui ...` from the repo root, or `react-scripts` may fail looking for a root-level `package.json`.
- The S06 acceptance seed must backdate both `JobApplication.FollowUpAt` and the latest correspondence timestamp past the users `AppliedFollowUpDays` threshold; `RulesEngine` computes `Waiting` follow-up from the most recent activity (`DateApplied`, `ResponseDate`, `FollowUpAt`, `FeedbackRequestedAt`, or last correspondence), so a recent reminder date can suppress the intended `workflowSignal.actionKey = "follow-up"` fixture.
+1
View File
@@ -1,2 +1,3 @@
{"cmd":"plan-slice","params":{"milestoneId":"M001","sliceId":"S06"},"ts":"2026-03-27T07:47:00.102Z","actor":"agent","hash":"ad7ae36d97e9c851","session_id":"96f47087-e006-4aa2-8147-1cc42da4374d"}
{"cmd":"complete-task","params":{"milestoneId":"M001","sliceId":"S06","taskId":"T01"},"ts":"2026-03-27T07:57:14.999Z","actor":"agent","hash":"7206faf86461a4cd","session_id":"96f47087-e006-4aa2-8147-1cc42da4374d"}
{"cmd":"complete-task","params":{"milestoneId":"M001","sliceId":"S06","taskId":"T02"},"ts":"2026-03-27T08:09:46.080Z","actor":"agent","hash":"08f3c9c34195dd48","session_id":"96f47087-e006-4aa2-8147-1cc42da4374d"}
+1 -1
View File
@@ -19,7 +19,7 @@
- Estimate: 45m
- Files: scripts/s06-preflight.sh, README.md, job-tracker-ui/src/api.ts, JobTrackerApi/appsettings.Development.json
- Verify: bash scripts/s06-preflight.sh
- [ ] **T02: Seed acceptance-ready job data** — Create a seed script that prepares a richer acceptance fixture (job, correspondence, saved package, follow-up readiness) using live API calls.
- [x] **T02: Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.** — Create a seed script that prepares a richer acceptance fixture (job, correspondence, saved package, follow-up readiness) using live API calls.
- Why: current DB has only 1 low-signal job; acceptance rerun needs actionable overview + workspace state.
- Steps:
1) Write `scripts/s06-acceptance-data.sh` (bash, executable) that requires `AUTH_TOKEN` env; uses `scripts/s06-preflight.sh` first, then POSTs to `/api/jobapplications` (or PUT existing ID) to create a job with saved package fields, correspondence entry, reminder/follow-up signals, and notes.
@@ -0,0 +1,87 @@
---
id: T02
parent: S06
milestone: M001
provides: []
requires: []
affects: []
key_files: ["scripts/s06-acceptance-data.sh", "scripts/s06-acceptance-data.test.sh", "README.md", ".gsd/KNOWLEDGE.md", ".gsd/DECISIONS.md", ".gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md"]
key_decisions: ["Seed acceptance data only through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, keyed by deterministic company/title/thread/message identifiers so reruns stay idempotent.", "Backdate both the seeded follow-up date and the latest correspondence timestamp past the active follow-up threshold so the acceptance fixture lands in workflowSignal.actionKey=follow-up instead of review-readiness."]
patterns_established: []
drill_down_paths: []
observability_surfaces: []
duration: ""
verification_result: "Ran bash scripts/s06-acceptance-data.test.sh against the live API with a valid dev-signed bearer token to confirm missing-token, bad-token, and double-rerun behavior. Ran bash scripts/s06-acceptance-data.sh against the real backend and confirmed seed.result=success, a stable company/job fixture, one correspondence entry, seed.workflow.action=follow-up, seed.readiness.level=Ready, and seed.reminders=Waiting 14d. Verified README.md contains the acceptance-data runbook markers and token guidance."
completed_at: 2026-03-27T08:09:46.052Z
blocker_discovered: false
---
# T02: Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.
> Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.
## What Happened
---
id: T02
parent: S06
milestone: M001
key_files:
- scripts/s06-acceptance-data.sh
- scripts/s06-acceptance-data.test.sh
- README.md
- .gsd/KNOWLEDGE.md
- .gsd/DECISIONS.md
- .gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md
key_decisions:
- Seed acceptance data only through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, keyed by deterministic company/title/thread/message identifiers so reruns stay idempotent.
- Backdate both the seeded follow-up date and the latest correspondence timestamp past the active follow-up threshold so the acceptance fixture lands in workflowSignal.actionKey=follow-up instead of review-readiness.
duration: ""
verification_result: passed
completed_at: 2026-03-27T08:09:46.053Z
blocker_discovered: false
---
# T02: Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.
**Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.**
## What Happened
Implemented scripts/s06-acceptance-data.sh as an executable live seed flow that requires AUTH_TOKEN, runs the existing S06 preflight first, then creates or reuses a deterministic acceptance company and job via the real API, updates recruiter metadata, saves tailored CV and application package material through the dedicated endpoints, schedules an overdue follow-up, and maintains exactly one deterministic correspondence entry for the linked recruiter thread. Added scripts/s06-acceptance-data.test.sh to verify the missing-token and bad-token failure modes plus authenticated idempotent reruns, updated README.md with the seed command and token guidance, recorded the waiting-threshold gotcha in .gsd/KNOWLEDGE.md, and saved D013 in .gsd/DECISIONS.md for the live-API seeding pattern. After correcting the seeded activity dates to cross the real 14-day RulesEngine threshold, the live fixture now reports workflowSignal.actionKey=follow-up and Waiting 14d reminder output.
## Verification
Ran bash scripts/s06-acceptance-data.test.sh against the live API with a valid dev-signed bearer token to confirm missing-token, bad-token, and double-rerun behavior. Ran bash scripts/s06-acceptance-data.sh against the real backend and confirmed seed.result=success, a stable company/job fixture, one correspondence entry, seed.workflow.action=follow-up, seed.readiness.level=Ready, and seed.reminders=Waiting 14d. Verified README.md contains the acceptance-data runbook markers and token guidance.
## Verification Evidence
| # | Command | Exit Code | Verdict | Duration |
|---|---------|-----------|---------|----------|
| 1 | `bash scripts/s06-acceptance-data.test.sh` | 0 | ✅ pass | 3885ms |
| 2 | `bash scripts/s06-acceptance-data.sh` | 0 | ✅ pass | 1831ms |
| 3 | `python3 README acceptance-data guidance check` | 0 | ✅ pass | 24ms |
## Deviations
Added scripts/s06-acceptance-data.test.sh and recorded one knowledge/decision entry beyond the plans expected output files so the negative-path and idempotence contract is executable and the follow-up-threshold gotcha is preserved for downstream work.
## Known Issues
The local seeded admin password from JobTrackerApi/appsettings.Development.json does not authenticate against this current DB snapshot, so the README and script comments document token retrieval in terms of the real local account or an already-authenticated browser session. Verification used a valid dev-signed JWT against the live API contract, which is sufficient for these user-scoped endpoints but does not prove the placeholder login credentials themselves.
## Files Created/Modified
- `scripts/s06-acceptance-data.sh`
- `scripts/s06-acceptance-data.test.sh`
- `README.md`
- `.gsd/KNOWLEDGE.md`
- `.gsd/DECISIONS.md`
- `.gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md`
## Deviations
Added scripts/s06-acceptance-data.test.sh and recorded one knowledge/decision entry beyond the plans expected output files so the negative-path and idempotence contract is executable and the follow-up-threshold gotcha is preserved for downstream work.
## Known Issues
The local seeded admin password from JobTrackerApi/appsettings.Development.json does not authenticate against this current DB snapshot, so the README and script comments document token retrieval in terms of the real local account or an already-authenticated browser session. Verification used a valid dev-signed JWT against the live API contract, which is sufficient for these user-scoped endpoints but does not prove the placeholder login credentials themselves.
+67 -12
View File
@@ -1,6 +1,6 @@
{
"version": 1,
"exported_at": "2026-03-27T07:57:14.998Z",
"exported_at": "2026-03-27T08:09:46.079Z",
"milestones": [
{
"id": "M001",
@@ -613,19 +613,29 @@
"milestone_id": "M001",
"slice_id": "S06",
"id": "T02",
"title": "Seed acceptance-ready job data",
"status": "pending",
"one_liner": "",
"narrative": "",
"verification_result": "",
"title": "Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.",
"status": "complete",
"one_liner": "Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.",
"narrative": "Implemented scripts/s06-acceptance-data.sh as an executable live seed flow that requires AUTH_TOKEN, runs the existing S06 preflight first, then creates or reuses a deterministic acceptance company and job via the real API, updates recruiter metadata, saves tailored CV and application package material through the dedicated endpoints, schedules an overdue follow-up, and maintains exactly one deterministic correspondence entry for the linked recruiter thread. Added scripts/s06-acceptance-data.test.sh to verify the missing-token and bad-token failure modes plus authenticated idempotent reruns, updated README.md with the seed command and token guidance, recorded the waiting-threshold gotcha in .gsd/KNOWLEDGE.md, and saved D013 in .gsd/DECISIONS.md for the live-API seeding pattern. After correcting the seeded activity dates to cross the real 14-day RulesEngine threshold, the live fixture now reports workflowSignal.actionKey=follow-up and Waiting 14d reminder output.",
"verification_result": "Ran bash scripts/s06-acceptance-data.test.sh against the live API with a valid dev-signed bearer token to confirm missing-token, bad-token, and double-rerun behavior. Ran bash scripts/s06-acceptance-data.sh against the real backend and confirmed seed.result=success, a stable company/job fixture, one correspondence entry, seed.workflow.action=follow-up, seed.readiness.level=Ready, and seed.reminders=Waiting 14d. Verified README.md contains the acceptance-data runbook markers and token guidance.",
"duration": "",
"completed_at": null,
"completed_at": "2026-03-27T08:09:46.052Z",
"blocker_discovered": false,
"deviations": "",
"known_issues": "",
"key_files": [],
"key_decisions": [],
"full_summary_md": "",
"deviations": "Added scripts/s06-acceptance-data.test.sh and recorded one knowledge/decision entry beyond the plans expected output files so the negative-path and idempotence contract is executable and the follow-up-threshold gotcha is preserved for downstream work.",
"known_issues": "The local seeded admin password from JobTrackerApi/appsettings.Development.json does not authenticate against this current DB snapshot, so the README and script comments document token retrieval in terms of the real local account or an already-authenticated browser session. Verification used a valid dev-signed JWT against the live API contract, which is sufficient for these user-scoped endpoints but does not prove the placeholder login credentials themselves.",
"key_files": [
"scripts/s06-acceptance-data.sh",
"scripts/s06-acceptance-data.test.sh",
"README.md",
".gsd/KNOWLEDGE.md",
".gsd/DECISIONS.md",
".gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md"
],
"key_decisions": [
"Seed acceptance data only through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, keyed by deterministic company/title/thread/message identifiers so reruns stay idempotent.",
"Backdate both the seeded follow-up date and the latest correspondence timestamp past the active follow-up threshold so the acceptance fixture lands in workflowSignal.actionKey=follow-up instead of review-readiness."
],
"full_summary_md": "---\nid: T02\nparent: S06\nmilestone: M001\nkey_files:\n - scripts/s06-acceptance-data.sh\n - scripts/s06-acceptance-data.test.sh\n - README.md\n - .gsd/KNOWLEDGE.md\n - .gsd/DECISIONS.md\n - .gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md\nkey_decisions:\n - Seed acceptance data only through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, keyed by deterministic company/title/thread/message identifiers so reruns stay idempotent.\n - Backdate both the seeded follow-up date and the latest correspondence timestamp past the active follow-up threshold so the acceptance fixture lands in workflowSignal.actionKey=follow-up instead of review-readiness.\nduration: \"\"\nverification_result: passed\ncompleted_at: 2026-03-27T08:09:46.053Z\nblocker_discovered: false\n---\n\n# T02: Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.\n\n**Seeded acceptance-ready job data through the live API with deterministic rerun-safe ids and readiness output.**\n\n## What Happened\n\nImplemented scripts/s06-acceptance-data.sh as an executable live seed flow that requires AUTH_TOKEN, runs the existing S06 preflight first, then creates or reuses a deterministic acceptance company and job via the real API, updates recruiter metadata, saves tailored CV and application package material through the dedicated endpoints, schedules an overdue follow-up, and maintains exactly one deterministic correspondence entry for the linked recruiter thread. Added scripts/s06-acceptance-data.test.sh to verify the missing-token and bad-token failure modes plus authenticated idempotent reruns, updated README.md with the seed command and token guidance, recorded the waiting-threshold gotcha in .gsd/KNOWLEDGE.md, and saved D013 in .gsd/DECISIONS.md for the live-API seeding pattern. After correcting the seeded activity dates to cross the real 14-day RulesEngine threshold, the live fixture now reports workflowSignal.actionKey=follow-up and Waiting 14d reminder output.\n\n## Verification\n\nRan bash scripts/s06-acceptance-data.test.sh against the live API with a valid dev-signed bearer token to confirm missing-token, bad-token, and double-rerun behavior. Ran bash scripts/s06-acceptance-data.sh against the real backend and confirmed seed.result=success, a stable company/job fixture, one correspondence entry, seed.workflow.action=follow-up, seed.readiness.level=Ready, and seed.reminders=Waiting 14d. Verified README.md contains the acceptance-data runbook markers and token guidance.\n\n## Verification Evidence\n\n| # | Command | Exit Code | Verdict | Duration |\n|---|---------|-----------|---------|----------|\n| 1 | `bash scripts/s06-acceptance-data.test.sh` | 0 | ✅ pass | 3885ms |\n| 2 | `bash scripts/s06-acceptance-data.sh` | 0 | ✅ pass | 1831ms |\n| 3 | `python3 README acceptance-data guidance check` | 0 | ✅ pass | 24ms |\n\n\n## Deviations\n\nAdded scripts/s06-acceptance-data.test.sh and recorded one knowledge/decision entry beyond the plans expected output files so the negative-path and idempotence contract is executable and the follow-up-threshold gotcha is preserved for downstream work.\n\n## Known Issues\n\nThe local seeded admin password from JobTrackerApi/appsettings.Development.json does not authenticate against this current DB snapshot, so the README and script comments document token retrieval in terms of the real local account or an already-authenticated browser session. Verification used a valid dev-signed JWT against the live API contract, which is sufficient for these user-scoped endpoints but does not prove the placeholder login credentials themselves.\n\n## Files Created/Modified\n\n- `scripts/s06-acceptance-data.sh`\n- `scripts/s06-acceptance-data.test.sh`\n- `README.md`\n- `.gsd/KNOWLEDGE.md`\n- `.gsd/DECISIONS.md`\n- `.gsd/milestones/M001/slices/S06/tasks/T02-SUMMARY.md`\n",
"description": "Create a seed script that prepares a richer acceptance fixture (job, correspondence, saved package, follow-up readiness) using live API calls.\n- Why: current DB has only 1 low-signal job; acceptance rerun needs actionable overview + workspace state.\n- Steps:\n 1) Write `scripts/s06-acceptance-data.sh` (bash, executable) that requires `AUTH_TOKEN` env; uses `scripts/s06-preflight.sh` first, then POSTs to `/api/jobapplications` (or PUT existing ID) to create a job with saved package fields, correspondence entry, reminder/follow-up signals, and notes.\n 2) Add curl helpers for adding correspondence (`/api/correspondence/{jobId}` or equivalent), saving package material, and setting workflow/readiness if needed; use deterministic titles so rerun is idempotent (update if exists).\n 3) Emit a short summary of created/updated IDs so the acceptance run can target them; avoid logging token.\n 4) Document any manual token retrieval step in script comments.\n- Failure Modes (Q5): missing AUTH_TOKEN → fail with guidance; 401/403 → explain token issue; 5xx → print response and fail; malformed response → show body and fail.\n- Load Profile (Q6): few API calls; minimal DB impact.\n- Negative Tests (Q7): run without AUTH_TOKEN (expect failure); rerun twice (should succeed idempotently); simulate 401 by bad token (expect clear message).\n- Must-haves: script seeds at least one job with saved package + correspondence + follow-up readiness; outputs job id for UAT; uses preflight.\n- Verification: `bash scripts/s06-acceptance-data.sh`",
"estimate": "1h",
"files": [
@@ -835,6 +845,18 @@
"revisable": "Yes",
"made_by": "agent",
"superseded_by": null
},
{
"seq": 13,
"id": "D013",
"when_context": "M001/S06/T02",
"scope": "seeding",
"decision": "How acceptance-ready job data is created for S06 live reruns",
"choice": "Seed the acceptance fixture through the live companies/jobapplications/correspondence API plus the dedicated tailored-cv, application-drafts, and followup endpoints, using deterministic company/title/thread/message identifiers for idempotent reruns.",
"rationale": "The slice goal is a repeatable live environment check, so seeding through the same HTTP contract the UI uses proves the real backend surface, keeps package/readiness behavior aligned with production code paths, and avoids brittle direct DB mutations or duplicate correspondence on reruns.",
"revisable": "Yes",
"made_by": "agent",
"superseded_by": null
}
],
"verification_evidence": [
@@ -870,6 +892,39 @@
"verdict": "✅ pass",
"duration_ms": 0,
"created_at": "2026-03-27T07:57:14.982Z"
},
{
"id": 4,
"task_id": "T02",
"slice_id": "S06",
"milestone_id": "M001",
"command": "bash scripts/s06-acceptance-data.test.sh",
"exit_code": 0,
"verdict": "✅ pass",
"duration_ms": 3885,
"created_at": "2026-03-27T08:09:46.052Z"
},
{
"id": 5,
"task_id": "T02",
"slice_id": "S06",
"milestone_id": "M001",
"command": "bash scripts/s06-acceptance-data.sh",
"exit_code": 0,
"verdict": "✅ pass",
"duration_ms": 1831,
"created_at": "2026-03-27T08:09:46.052Z"
},
{
"id": 6,
"task_id": "T02",
"slice_id": "S06",
"milestone_id": "M001",
"command": "python3 README acceptance-data guidance check",
"exit_code": 0,
"verdict": "✅ pass",
"duration_ms": 24,
"created_at": "2026-03-27T08:09:46.052Z"
}
]
}