You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(review): address consensus review findings on #1064
Major:
- `countByCategory` used an object literal plus `in`, so every `Object.prototype`
member passed the allowlist: a finding categorised `toString` both minted a
dimension and evaluated `<native function> + 1` into a
`Record<string, number>`. Now `Object.create(null)` + `Object.hasOwn`. Zod
makes this unreachable today; the guard exists for when validation is bypassed.
- `review_post_outcome` had no stated cardinality and three paths that skipped
it. The contract is now written down — exactly one per **completed** review, so
absence means the review failed rather than that an event was lost — and
enforced with a latch plus a `finally` rather than by control flow that only
looked exhaustive. `not_requested` moved ahead of the `--output` write and the
stdout render; a new `not_attempted` bucket covers a run that dies between the
completed review and the post attempt; a throwing `resolveGitHubTarget()`
reports `target_unresolved`.
Minor:
- `classifyReviewFailure` dropped the `message.includes("git diff")` fallback its
own docstring disclaimed. It was unreachable for the real git path — `execFile`
always sets `cmd`, and its message begins `Command failed: `, so the `cmd`
check returns first.
- Added the adversarial prototype-key case to the guard test; the existing
ordinary-string case cannot reach it.
- Added coverage that a throwing `Telemetry.track` cannot propagate out of either
emitter, which is what the two empty `catch` blocks promise.
Nits:
- Deleted the e2e's 500 ms sleep. `proc.exited` already implies the flush landed:
the CLI awaits `shutdown()` → `flush()` → the sink's HTTP response.
- `ALTIMATE_TELEMETRY_DISABLED` restored conditionally; unconditional assignment
wrote the literal string `"undefined"` when the variable was originally absent.
- `postStartedAt` moved inside `if (args.post)`, and the `if`/`if` pair is now a
single branch.
- Corrected the e2e comment claiming the object-valued `by_category` follows the
house convention — the sibling map-shaped fields stringify at the call site.
Also covers three of the review's flagged test gaps: `stale_manifest` /
`degraded` field mapping, and CLI-level control flow through a real process — a
new e2e drives `--post` with an unwritable `--output` and asserts exactly one
post outcome. Both new unit tests and the new e2e were mutation-checked against
their fixes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SLUQF3xgZHsGZHSjxe7vb
Copy file name to clipboardExpand all lines: docs/docs/reference/telemetry.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ We collect the following categories of events:
48
48
|`validator_check`| A completion-gate validator ran on session end — validator name, `ok` boolean, step, retry count, `enforced` flag (false in shadow mode), and structured `details` (model counts, elapsed time, concurrency limit — no SQL or model content). Only emitted when `ALTIMATE_VALIDATORS_ENABLED=1` or `ALTIMATE_VALIDATORS_SHADOW=1`. See [Validators](../data-engineering/validators.md). |
49
49
|`validator_retries_exhausted`| A session terminated with unresolved validator failures after exhausting the synthetic-retry budget — names of the failing validators (no failure body content). |
50
50
|`review_run`| A dbt/SQL review completed or failed — `invocation` (`cli` for `altimate-code review`, `tool` for the `dbt_pr_review` tool), status, duration, and on success the verdict, the pre-gating verdict, mode, risk tier, and finding counts by severity and by category. No file paths, model or column names, finding titles or bodies, SQL, diff content, or repository/branch/PR names. |
51
-
|`review_post_outcome`| Whether a review was published to GitHub — `not_requested`, `target_unresolved`, `full`, `partial`, or `summary_failed`, plus duration. No repository, PR, or comment content. |
51
+
|`review_post_outcome`| Whether a review was published to GitHub — `not_requested`, `not_attempted`, `target_unresolved`, `full`, `partial`, or `summary_failed`, plus duration. Exactly one per **completed** review: a review that failed emits `review_run: failed` and no post event, so absence means the review failed rather than that an event was lost. `not_attempted` is publication requested but never reached (a bad `--output` path, a stdout write error). No repository, PR, or comment content. |
0 commit comments