Repository navigation
Implement assistant job model and lifecycle #30
Description
Implement assistant job model and lifecycle
Status: done — historical baseline shipped; current hardening is owned by #158
Tags: enhancement, assistant, backend, data, P0
Depends on: None
Blocks: None
Current implementation owner: #158
Launch-disposition owner: #71
Final disposition
The original assistant-job baseline was implemented, reviewed, accepted, deployed, and source-gated in commit 553f576d05cdf46f44950824a5415ce769d3f716, which remains an ancestor of current source.
That implementation was later consolidated from the retired work-engine/ and old bundle/workflow architecture into the canonical TypeScript backend/, top-level frontend/, and Template → Card → Task model. This issue is therefore a completed historical delivery record, not the parent or implementation tracker for further assistant lifecycle work.
What remains and where it belongs
#158 — current Assistant Job contract
#158 is the sole current implementation owner for:
- strict Assistant Job schema validation and integer versioning;
- conditional, atomic lifecycle/event/review writes;
- pagination and deterministic conflict behavior;
- URI-free browser DTOs and mediated Artifact access;
- verified interactive actor integration;
- canonical Task/Card reference and approval composition;
- explicit draft, Retry, Submit retry, confirmation, refresh, focus, and browser behavior.
Do not implement those changes under #30 or preserve compatibility with the old work-engine/bundle/export contract.
#71 — human launch disposition
The old remaining checkbox on #30 requested a real Telegram/Heru/Codex/Claude execution smoke or an explicit decision to defer it. #71 already owns that exact V1 launch decision and is the source of truth.
Current source does not expose a production Podcast/Heru executor through Assistant Job routes. The canonical route provides deterministic local/test run-dry; shared conversational Telegram is a separate system and does not prove a live Podcast executor. Therefore there is no valid live Assistant Job provider path to smoke under #30.
Closing #30 does not claim that external Podcast execution passed or was deferred. #71 must still classify it as deferred, launch-blocking, or implemented under a separately identified accepted owner. If real execution is later selected, create a bounded implementation issue for its worker/auth/queue/storage/error contract and put the credentialed HUMAN canary there.
Historical acceptance evidence
- Baseline commit:
553f576d05cdf46f44950824a5415ce769d3f716 - Tester PASS: Implement assistant job model and lifecycle #30 (comment)
- PM acceptance: Implement assistant job model and lifecycle #30 (comment)
- On-Call green report: Implement assistant job model and lifecycle #30 (comment)
- Current hardening issue: Make assistant output review safe and lifecycle-complete #158
- V1 production/human disposition tracker: Coordinate V1 sandbox rollout and human-gate closeout #71
No ongoing work under this issue
Do not run old work-engine, portable export/import/restore, credentialed assistant, provider, AWS, or production-data commands from this historical issue. Do not reopen it for #158 defects or a future external executor; use the owning issue and current lifecycle instead.
Activity
[-]Define assistant job model and lifecycle[/-][+]Implement assistant job model and lifecycle[/+]alexeygrigorev commentedon Jun 27, 2026
PM grooming complete. I rewrote this into an implementable assistant job lifecycle issue covering intake, durable job state, bounded logs/events, retries, approvals, artifact references, operator visibility, DynamoDB/SAM ownership, portable export safety, and Podcast Assistant dry-run boundaries. It depends on #29 for the final artifact storage policy and is ready for an implementation agent once #29 is groomed/closed as needed.
alexeygrigorev commentedon Jun 27, 2026
SWE handoff for #30 assistant job lifecycle.
Changed files:
work-engine/src/types.ts,work-engine/src/db/setup.ts,work-engine/src/db/assistantJobs.ts,work-engine/src/routes/assistantJobs.ts,work-engine/src/router.ts.work-engine/src/public/api.js,work-engine/src/public/app.js,work-engine/src/pages/index.html.work-engine/src/export/portable.ts,work-engine/scripts/export-execution-data.ts,work-engine/package.json.lambda-functions/template.full.yaml.assistants/podcast/dry_run.py,assistants/podcast/tests/test_dry_run.py,assistants/podcast/README.md.docs/v1-runtime-architecture.md,docs/v1-workflow-data-model.md,docs/v1-execution-state-schema.md,docs/v1-execution-data-safety.md.work-engine/tests/api-assistant-jobs.test.ts,work-engine/tests/assistant-ui.test.ts,work-engine/tests/export-portable.test.ts,work-engine/tests/setup-env.test.ts,work-engine/e2e/assistant-jobs.spec.js.Implementation notes:
outputArtifactIds,artifactRefs, and artifactassistantJobId; task/bundle records only mirror lightweight assistant references and artifact refs.assistant_jobs.jsonlandaudit_events.jsonl, with relationship checks and secret/raw-log leakage guards.Verification run:
git diff --checkpassed.npm --prefix work-engine testpassed: 644 tests across 131 suites.npm --prefix work-engine run typecheckpassed.npm --prefix work-engine run buildpassed.npm --prefix work-engine run test:e2epassed: 291 tests.uv run --project assistants/podcast pytestpassed: 31 tests.npm --prefix work-engine run export:data -- ../.tmp/exports/assistant-jobspassed.npm --prefix work-engine run validate:export -- ../.tmp/exports/assistant-jobspassed.npm --prefix work-engine run dry-run:import -- ../.tmp/exports/assistant-jobspassed.samwas unavailable; uvx fallback passed with isolated AWS config:uvx --from aws-sam-cli sam validate --template-file lambda-functions/template.full.yaml --region eu-west-1.Artifacts/screenshots:
.tmp/exports/assistant-jobs/includingassistant_jobs.jsonlandaudit_events.jsonl..tmp/screenshots/issue-30-assistants-queue.png..tmp/screenshots/issue-30-bundle-assistant-context.png..tmp/screenshots/issue-30-task-assistant-context.png.Acceptance criteria status:
Skipped/deferred:
6 remaining items
Implement assistant job lifecycle
alexeygrigorev commentedon Jun 27, 2026
ON-CALL REPORT for commit 553f576 (
Implement assistant job lifecycle).Run status:
assistants/podcast/**changes; Podcast Assistant tests and the real-engine opt-in guard passed.Classification:
Current status:
humanlabel, as required.Next step:
alexeygrigorev commentedon Jun 28, 2026
PM/Assistant Engineer triage update for #30/#44 dependency.
Non-human work remaining for #30: none found. The assistant job model/lifecycle work was implemented on
mainin553f576, tester passed after retry-policy fixes, PM accepted the agent-verifiable behavior, and on-call reported the triggered CI/deploy runs green.Remaining acceptance criterion for #30:
Next owner for #30: human verifier. Keep #30 open with the
humanlabel until that manual production-credential check is complete.Dependency decision: #44 can start while #30 remains open, because #44 depends on the durable assistant job API/lifecycle contract now present on
main; #30's remaining live external execution check is explicitly out of scope for #44.alexeygrigorev commentedon Jun 28, 2026
Human-gate audit update (2026-06-28): no agent-verifiable implementation work remains for #30.\n\nCurrent evidence:\n- Assistant job model, APIs, UI, SAM/DynamoDB tables, export validation, dry-run Podcast Assistant boundary, retry/approval lifecycle, and E2E/screenshots are implemented on current main.\n- Commit 553f576 (Implement assistant job lifecycle) is an ancestor of current main.\n- Current main has green deploy/content/planning validation runs.\n- Existing issue history includes SWE handoff, Tester failure/fix/pass, PM acceptance, and On-Call deploy evidence.\n\nRemaining HUMAN verification to close #30 or treat real assistant execution as production-ready:\n1. Use the deployed production DataOps V1 portal.\n2. Create/select a real podcast workflow/task/bundle.\n3. Trigger the real production assistant execution path, not the deterministic dry-run.\n4. Verify lifecycle progression, e.g. queued -> running -> waiting_approval or succeeded.\n5. Verify outputs/artifacts attach back to the linked task/bundle.\n6. Verify logs/errors are bounded and sanitized, with no raw secrets or credential leakage.\n7. Verify operator actions work where applicable: approve, reject, retry, cancel.\n8. Comment evidence here, then remove human and close #30 if the smoke passes or explicitly defer real execution from V1.
alexeygrigorev commentedon Jul 31, 2026
PM tracker reconciliation: removed the completed artifact-model dependency and updated historical conditional wording to the shipped current state. All agent-verifiable work remains complete. The real external assistant execution smoke or explicit V1 deferral remains the sole HUMAN gate; the issue stays blocked/open with
human.alexeygrigorev commentedon Aug 13, 2026
PM lifecycle/model reconciliation complete.
Decision: #30 is closed as a completed historical baseline, not treated as the parent or current implementation issue for #158.
Evidence and ownership:
553f576d05cdf46f44950824a5415ce769d3f716is an ancestor of current source and already has Tester PASS, PM acceptance, deployment, and On-Call green evidence in this issue.work-engine/, bundle/workflow, SAM, and portable import/export instructions are retired architecture and must not drive current work.run-dry; the shared Telegram system is not a live Podcast/Heru executor. A real provider smoke cannot validly run from Implement assistant job model and lifecycle #30.The obsolete
humangate and stale work-engine/frontend/infra labels were removed. A future real executor must get its own bounded issue and lifecycle rather than reopening #30.No repository file, test, AWS/provider action, credential, production data, import/export/restore path, deployment, commit, or push was touched.
Implement assistant job lifecycle