Skip to content

ci: stop new direct reads of cached telemetry - #1677

Merged
frahlg merged 3 commits into
masterfrom
agent-plan/telemetry-read-ratchet
Oct 17, 2026
Merged

frahlg merged 3 commits into
masterfrom
agent-plan/telemetry-read-ratchet

Conversation

@frahlg

@frahlg frahlg commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Reject per-file increases in four cached-telemetry read forms outside go/internal/telemetry: .RawW, .SmoothedW, ReadingsByType( and ReadingsByDriver(. The script now counts every occurrence, including multiple reads on one line. It uses a POSIX regex for Git and Python for counting, so Apple Git and Linux agree.

An exception must include a reason, a valid unexpired date and a named approver on the same line:
// telemetry-read-ok: <reason>; expires YYYY-MM-DD; approved-by <name>
The named owner must review the exception in the PR; the script checks its form and date. Git errors fail the check.

Validation:

A count increase is evidence of a new read, not proof of a stale-data bug. This ratchet permits count-neutral replacements and does not supply S3's typed freshness guarantee. The earlier 42-of-1,423 cost estimate used the old line counter and has not been rerun for the revised check.

Part of #1679. CI-only change; no changeset. Remains draft for the owner's merge decision.

…ackage

A reading stays in telemetry.Store after its driver goes stale, offline
or faulted. Every direct reader of RawW, SmoothedW, ReadingsByType or
ReadingsByDriver must check driver health itself, and review caught the
missing check in #36, #85, #310, #647, #664 and #740.

The check counts those reads per file outside go/internal/telemetry and
fails when a pull request adds one. Existing reads (147 today) may only
go down. The error names the health-gated accessors to use instead.
On the merged commits of #36, #85, #310 and #647 it fails.
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review October 17, 2026 05:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T05:47:07.079705Z e6879c9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6879c9c03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

READ = re.compile(r"\.(?:RawW|SmoothedW)\b|\.(?:ReadingsByType|ReadingsByDriver)\s*\(")
EXCEPTION = re.compile(
r"//\s*telemetry-read-ok:\s*(?P<reason>[^;]+);\s*"
r"expires (?P<date>\d{4}-\d{2}-\d{2});\s*approved-by (?P<owner>@?[\w.-]+)\s*$"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject punctuation-only approver placeholders

For any new direct read annotated with approved-by - or approved-by ..., this character class matches, and the exception is treated as valid based only on its reason and date. CI therefore suppresses the read even though no named owner exists to review it; require the approver value to contain at least one alphanumeric character before accepting the exception.

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 69613e1 into master Oct 17, 2026
15 checks passed
frahlg added a commit that referenced this pull request Oct 17, 2026
…1679)

* docs: propose a stepwise plan to make FTW safe for agents to change

Agents write most of FTW, and review bots raised 1,150 findings on 573
of their pull requests. This plan groups those findings into recurring
mistake classes, proposes a structural fix for each at the highest level
that works, backtests each fix against the history, and orders the fixes
into independently mergeable steps. Steps 1, 2 and 4 are draft PRs
#1676, #1677 and #1678.

tools/agent-pitfalls holds the script and the labels so a reviewer can
rerun or spot-check every number.

* docs: keep the pitfall lever under docs/ so the PR stays docs-only

* docs: distinguish model estimates from executable evidence

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>

---------

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant