code_context
The runtime context a coding agent needs to fix a workload's code, in one compact read. For a Deployment, StatefulSet, DaemonSet or Pod it returns: (1) each container's image and digest mapped to the commit it was built from - repository owner/name, branch and full sha - from Ankra Pipelines publish records (the immutable sha- tag or the digest) or the Ankra application installed in the namespace, else the image's own org.opencontainers.image.revision label (via oci_label), else commit.state unresolved or ambiguous with the reason; (2) when the running revision started (its ReplicaSet or ControllerRevision) and the previous revision's images and commits; (3) the error lines in the running revision's container logs, including the previous (crashed) instance of a restarting container, grouped by fingerprint (numbers, ids and timestamps stripped) with counts, samples and before_deploy: seen, not_seen or unknown in the log store's window before the deploy; (4) the stack frames in those lines (Go, Python, Node, Java) as repository-relative file:line guesses with a link to the line at the deployed commit; (5) restarts and the last termination (OOMKilled, Error, exit code) per container. Call it FIRST when asked to fix, debug or explain a crashing or erroring service in code, when asked which commit a workload runs, or before handing a production error to a coding agent, then read the named files at the named commit. An unknown or unresolved part is a read that did not happen, never a finding. Read-only; secrets in log lines are redacted; the result stays under 8 KB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Kind of the named workload. Optional: Deployment, StatefulSet, DaemonSet and Pod are tried in that order when omitted. | |
| name | Yes | Name of the Deployment, StatefulSet, DaemonSet or Pod. A pod name is followed to its controller. | |
| container | No | Read only this container's image and logs. Optional; every container of the pod template by default. | |
| namespace | Yes | Namespace of the workload. | |
| cluster_id | Yes | Ankra cluster id (UUID) the call targets. Discover ids with list_clusters. | |
| max_samples | No | Sample lines kept per error fingerprint (default 2, max 5). |