Skip to content

ttl: emit runtime task lifecycle log events #222

@kdy1

Description

@kdy1

Summary

Logging currently emphasizes compile/cache stage events but does not emit the runtime task lifecycle event names required by the contract.

Evidence

Contract Evidence:

  • docs/project-ttl-language.md:206
  • cmds/ttlc/internal/compiler/service.go:496

Current Gap

Logging currently emphasizes compile/cache stage events but does not emit the runtime task lifecycle event names required by the contract.

Proposed Scope

  • Not documented yet.

Acceptance Criteria

  • Emit lifecycle events: task_scheduled, task_started, task_cache_hit, task_cache_miss, task_completed, task_failed.
  • Include required structured fields (compile_stage, task_id, cache_key, cache_hit, invalidation_reason, worker_id, duration_ms, error_kind).
  • Keep ANSI color/no-color behavior intact for operator-facing output.
  • Provide deterministic event ordering guarantees where applicable.

Test Scenarios

  • Successful execution path emits scheduled/start/completed events.
  • Cache-hit path emits task_cache_hit.
  • Failure path emits task_failed with error_kind.

Out of Scope

  • External log shipping integrations.
  • Metrics backend instrumentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions