Skip to content

guardrails/telemetry: harden telemetry-upsert.sh with post-write read-back verification + canonicalize @path-as-body anti-pattern rule #952

Description

@kyle-sexton

This was generated by AI during triage.

Part of #943 (telemetry @path-as-body observability fail-open). This is the repo-actionable defense-in-depth split out of #943 so it can be picked up autonomously; the remaining part of #943 (routing the operator loop-prompt through the sanctioned wrapper — out of this repo) stays on #943 as a human-gated item.

Scope (from the #943 planning analysis — see plan)

Two repo-local hardenings, neither of which alone closes #943 but which make the fail-open catchable and documented:

  1. Harden the sanctioned telemetry wrapper (telemetry-upsert.sh) with post-write read-back verification — after the comment upsert, re-read the written body via the API and fail loud (non-zero exit / visible error) if the body starts with a literal @ or is below a sanity-length floor. The wrapper is structurally safe today (it uses --body-file), so this guards against future misuse / other callsites, not a current wrapper defect.
  2. Canonicalize the anti-pattern rule — document, in the shared lane doctrine, that telemetry/comment edits MUST use --body-file <path> (or piped content) and MUST NEVER interpolate an @path string into a --body / -f body= argument (gh expands @ only for --body-file / -F field syntax).

Decision defaulted: the anti-pattern rule's home is lanes/SKILL.md (the shared lane doctrine), NOT babysit-prs (which has zero telemetry surface of its own) — veto before merge.

Acceptance

  • An @path-as-body write routed through the wrapper is caught at write time and fails loudly instead of silently degrading (a comment that "looks fresh" but carries no data).
  • The anti-pattern rule is stated once in the canonical lane doctrine location.
  • Regression coverage if a test harness exists for the wrapper script.

Note: full closure of #943's fail-open also requires the operator loop-prompt to route its telemetry writes through this wrapper (out-of-repo, tracked on #943).

Activity

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

Metadata

Metadata

Assignees

Labels

agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions