Skip to content

Implement assistant job model and lifecycle #30

Closed

Description

@alexeygrigorev

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

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

  1. added
    needs groomingRaw intake that needs PM grooming
    assistantAssistant modules and jobs
    dataData model, migration, storage
    P0Must have
    on Jun 27, 2026
  2. changed the title [-]Define assistant job model and lifecycle[/-] [+]Implement assistant job model and lifecycle[/+] on Jun 27, 2026
  3. added
    enhancementNew or improved functionality
    podcastPodcast workflow and assistant
    work-engineDataTasks task execution engine
    portalShared portal shell and UX
    infraDeployment and infrastructure
    and removed
    needs groomingRaw intake that needs PM grooming
    on Jun 27, 2026
  4. alexeygrigorev commented on Jun 27, 2026

    @alexeygrigorev
    MemberAuthor

    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.

  5. alexeygrigorev commented on Jun 27, 2026

    @alexeygrigorev
    MemberAuthor

    SWE handoff for #30 assistant job lifecycle.

    Changed files:

    • Work-engine model/API/storage: 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.
    • Portal UI/API client: work-engine/src/public/api.js, work-engine/src/public/app.js, work-engine/src/pages/index.html.
    • Export/import/data safety: work-engine/src/export/portable.ts, work-engine/scripts/export-execution-data.ts, work-engine/package.json.
    • Infra: lambda-functions/template.full.yaml.
    • Podcast dry-run boundary: assistants/podcast/dry_run.py, assistants/podcast/tests/test_dry_run.py, assistants/podcast/README.md.
    • Docs: docs/v1-runtime-architecture.md, docs/v1-workflow-data-model.md, docs/v1-execution-state-schema.md, docs/v1-execution-data-safety.md.
    • Tests: 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:

    • Added durable assistant jobs and audit events with typed lifecycle contracts, SAM-owned DynamoDB tables/env vars, local/test table auto-create, and least-privilege WorkEngineFunction access.
    • Added authenticated assistant-job APIs for draft intake/update, submit, list/detail, bounded events/logs, transitions, retry, cancel, approve/reject, artifact attachment, and deterministic podcast dry-run.
    • Reused Define artifact model and storage policy #29 artifact records/relationships through outputArtifactIds, artifactRefs, and artifact assistantJobId; task/bundle records only mirror lightweight assistant references and artifact refs.
    • Integrated assistant jobs into the daily operations flow: contextual Podcast help from task/bundle screens, an Assistants queue, inline next actions, approval/retry/cancel controls, output artifact visibility, and failure notifications.
    • Added portable export/validation/dry-run import support for assistant_jobs.jsonl and audit_events.jsonl, with relationship checks and secret/raw-log leakage guards.

    Verification run:

    • git diff --check passed.
    • npm --prefix work-engine test passed: 644 tests across 131 suites.
    • npm --prefix work-engine run typecheck passed.
    • npm --prefix work-engine run build passed.
    • npm --prefix work-engine run test:e2e passed: 291 tests.
    • uv run --project assistants/podcast pytest passed: 31 tests.
    • npm --prefix work-engine run export:data -- ../.tmp/exports/assistant-jobs passed.
    • npm --prefix work-engine run validate:export -- ../.tmp/exports/assistant-jobs passed.
    • npm --prefix work-engine run dry-run:import -- ../.tmp/exports/assistant-jobs passed.
    • Local sam was 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:

    • Export output: .tmp/exports/assistant-jobs/ including assistant_jobs.jsonl and audit_events.jsonl.
    • Assistants queue screenshot: .tmp/screenshots/issue-30-assistants-queue.png.
    • Bundle assistant context screenshot: .tmp/screenshots/issue-30-bundle-assistant-context.png.
    • Task assistant context screenshot: .tmp/screenshots/issue-30-task-assistant-context.png.

    Acceptance criteria status:

    • Checked all implementation/test/export/UI/SAM acceptance boxes satisfied by this work.
    • Left the human-only production credential verification checkbox unchecked.

    Skipped/deferred:

    • No automated required checks were skipped.
    • Real Telegram/Heru/Codex/Claude production execution was not run; it remains the explicit human-only rollout verification item.
  6. 6 remaining items

  7. added
    humanCode done or issue blocked on human verification
    on Jun 27, 2026
  8. alexeygrigorev commented on Jun 27, 2026

    @alexeygrigorev
    MemberAuthor

    ON-CALL REPORT for commit 553f576 (Implement assistant job lifecycle).

    Run status:

    Classification:

    • CI/deployment infrastructure: no failure observed.
    • Commit-related code/test failure: no failure observed.
    • Content/search validation failure: no failure observed; search index build passed inside the deployment workflow, and no separate Validate DataOps Content run was triggered for this commit.
    • Assistant CI failure: no failure observed.
    • External account/secret issue: no failure observed in CI/CD; AWS deployment credentials worked. Real Telegram/Heru/Codex/Claude production assistant execution remains intentionally unverified.
    • Flake: no flake observed.

    Current status:

    Next step:

  9. alexeygrigorev commented on Jun 28, 2026

    @alexeygrigorev
    MemberAuthor

    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 main in 553f576, 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:

    • [HUMAN] Any real Telegram/Heru/Codex/Claude production execution path is manually verified with real credentials before being treated as production-ready.

    Next owner for #30: human verifier. Keep #30 open with the human label 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.

  10. alexeygrigorev commented on Jun 28, 2026

    @alexeygrigorev
    MemberAuthor

    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.

  11. alexeygrigorev commented on Jul 31, 2026

    @alexeygrigorev
    MemberAuthor

    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.

  12. removed
    humanCode done or issue blocked on human verification
    on Aug 13, 2026
  13. removed
    portalShared portal shell and UX
    work-engineDataTasks task execution engine
    podcastPodcast workflow and assistant
    infraDeployment and infrastructure
    on Aug 13, 2026
  14. alexeygrigorev commented on Aug 13, 2026

    @alexeygrigorev
    MemberAuthor

    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:

    • Baseline commit 553f576d05cdf46f44950824a5415ce769d3f716 is an ancestor of current source and already has Tester PASS, PM acceptance, deployment, and On-Call green evidence in this issue.
    • The old work-engine/, bundle/workflow, SAM, and portable import/export instructions are retired architecture and must not drive current work.
    • Canonical Assistant Job source is now the single TypeScript backend plus top-level frontend and Template/Card/Task vocabulary.
    • Make assistant output review safe and lifecycle-complete #158 owns every remaining model/lifecycle defect: strict versions, atomic conditional state/event/review transactions, pagination, URI privacy/mediation, verified actors, Task/Card composition, and explicit UI/browser recovery.
    • Current Assistant Job routes expose only deterministic Podcast 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.
    • Coordinate V1 sandbox rollout and human-gate closeout #71 already owns the HUMAN product decision to classify external Podcast execution as deferred, launch-blocking, or implemented by a separately accepted owner. Closing Implement assistant job model and lifecycle #30 does not claim that smoke passed or that the human decision was made.

    The obsolete human gate 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must haveassistantAssistant modules and jobsbackendBackend/APIdataData model, migration, storageenhancementNew or improved functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions