| name | observability-injection-author |
| description | Walk the critical paths of the task's implementation plan and emit an `observability-injection@1`: (a) structured-log lines at every state transition (always carrying tenant_id + subject_id when in-scope), (b) trace spans wrapping every external IO call, (c) counter increments for every error branch, (d) a coverage estimate (% of branches with a log/metric/trace point). Used by chief-technology-officer/ship-tasks as step 11. Use when user asks to "draft a observability injection" or "create the observability injection". Do NOT use for "audit existing observability injection" (use observability-injection-audit instead). |
| license | Apache-2.0 |
| metadata | {"version":"1.0.0","module":"skill","stage":"e","cyberos-template":"observability-injection@1","cyberos-rubric-target":"observability_injection_rubric@1.0"} |
| allowed_memory_scopes | {"read":["project:*","module:*"],"write":["project:task/{task_id}/observability-injection"]} |
| audit | {"row_kind":"observability_injection_authored","required_fields":["task_id","log_points","trace_spans","error_counters","branch_coverage_pct"]} |
| inputs | [{"name":"task","format":"task@1","required":true},{"name":"impl_plan","format":"implementation-plan@1","required":true}] |
| outputs | [{"name":"obs_injection","format":"observability-injection@1"}] |
| triggers | ["workflow `chief-technology-officer/ship-tasks` step 11"] |
| blockers | ["no observability sink configured in repo (tracing/log subscriber missing) — must be resolved first","implementation-plan has zero critical paths — author misclassified the task; escalate"] |
| untrusted_inputs | {"wrap_in_marker":"untrusted_content","injection_scan":"required","on_marker_hit":"surface_to_human"} |
observability-injection-author
1. Purpose
Make the new code legible at runtime — every state transition logged, every external IO traced, every error branch counted — without bolting observability on as an afterthought. Plan the instrumentation before implementation; the implementation-plan-author treats this as a required input for any path it generates.
2. Output schema
task_id: task-<MODULE>-<NNN>
generated_at: <ISO-8601>
language: rust | python | typescript | mixed
subscriber: "tracing / log / structlog / pino / ..."
log_points:
- { id: LOG-001, file: "<absolute>", line_hint: "<int|null>", level: info | warn | error, message_shape: "...", carries: [tenant_id, subject_id, task_id], when: "<state transition>" }
trace_spans:
- { id: SPAN-001, file: "<absolute>", wraps: "<function or external IO call>", attributes: [tenant_id, , ], }
{ , , [, ], }
{ , }
{ , }