8000 M9.6 telemetry: consent from the ledger, journeys by record, live verify by adeelahmad · Pull Request #83 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content

M9.6 telemetry: consent from the ledger, journeys by record, live verify - #83

Merged
adeelahmad merged 4 commits into
masterfrom
claude/m9-telemetry-9jviy9
Oct 20, 2026
Merged

adeelahmad merged 4 commits into
masterfrom
claude/m9-telemetry-9jviy9

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Before: telemetry (#71) read consent and revoke from the git-ignored run log, so a fresh checkout lost them. It took "active" journeys from their hand-editable status field, and nothing could prove a live GA setup, because the Measurement Protocol answers 2xx to dropped hits and its validator checks no secret.

After: consent and revoke are human rows in the committed ledger (#77), and the journeys telemetry binds are the ones the records pin. aloop mission telemetry verify sends one probe through the real Measurement Protocol and waits for it in the stream's realtime report, which is the proof M9.14 needs.

How:

  • Ledger. consent is M.approve. revoke is M.record_human, which needs the one change outside the M9.6 files: telemetry.revoked joins HUMAN_EVENTS in _mission.py. The newest human row for the record, by time, decides; file order doesn't, because a merge=union merge can append a branch's older row last. While the ledger fails its own check, nothing is decided, so a lost revoke never brings usage back. Network commands and check block with the recovery command.
  • Journeys. It binds those frozen by a confirmed baseline or recorded as a frozen one's replacement, and not retired, using journeys.pins and lifecycle. A bound journey that changed after it was pinned blocks check. Malformed journey files never crash it.
  • Names. Reserved event names are never fewer than journeys.GA4_RESERVED_NAMES (the union of both lists, plus session_start_with_rollout). Prefixes match in any case, and names must match whole (fullmatch). aloop_probe is reserved for the probe.
  • verify. It proves the local secret on the Admin API, sends aloop_probe with session_id and engagement_time_msec (Realtime needs both), and polls runRealtimeReport scoped to the stream until the count rises, within ALADDIN_GA_VERIFY_WAIT (0–900 s, default 180). It stops if the consent or setup changes while it waits, and writes nothing back then. A new stream or MP secret clears the last verification. verify never gates check.
  • Usage numbers. The settled users report excludes the probe's client (notExpression eventName == aloop_probe), so verifying never moves the 50-user minimum-sample line.
  • Quota project. ALADDIN_GA_QUOTA_PROJECT is sent as x-goog-user-project on Admin and Data calls only, never to the MP host.

Evidence:

  • mission-telemetry.test.py runs 15 checks against the fake GA, which now has a real /mp/collect that only a live secret reaches realtime through, plus mp_drop. The checks cover a fresh checkout, an edited ledger row, a union-merge order, a lost revoke, replacement/retired/drifted/malformed journeys, a revoke mid-verify, wait bounds, and the secret and stream resets.
  • An adversarial review used four lenses, with two skeptics per finding. Its confirmed findings are fixed, and 13 mutants of the fixes are each killed by the suite.
  • make ci passes locally, conformance included (78/78).

Not changed: setup never deletes GA key events that no journey needs any more. They may be the owner's own.


Generated by Claude Code

Consent and revoke are human rows in the committed ledger, so a fresh
checkout keeps them and a broken ledger blocks. Active journeys come
from journeys.lifecycle, never the status field, and the reserved event
names are never fewer than journeys refuses. `telemetry verify` sends
one probe through the real Measurement Protocol endpoint and waits for
it in the stream's realtime report, the only proof of a live setup.
ALADDIN_GA_QUOTA_PROJECT sends x-goog-user-project. 14 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ro7iYo3scQt6vAuAWdYpV
The newest consent or revoke by time decides, since a union merge can
append a branch's older row last; a ledger that fails its own check
decides nothing, so a lost revoke never brings usage back. Telemetry
binds the journeys the records pin (frozen or a recorded replacement,
not retired) and blocks one changed since. Event names match whole and
reserved prefixes in any case; the probe event is ours alone. The users
report never counts the probe's client. verify sends a session id,
stops when consent or setup changes mid-wait, caps its wait, and a new
MP secret clears the last verification. 15 checks; 13 mutants killed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ro7iYo3scQt6vAuAWdYpV
…-9jviy9

# Conflicts:
#	plugin/bin/_mission.py
#78 reads replacements from the journey.retired record's data, so the
test's hand-made retirement records journey_id, replaced_by and its sha256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ro7iYo3scQt6vAuAWdYpV
@adeelahmad
adeelahmad marked this pull request as ready for review October 20, 2026 04:06
@adeelahmad
adeelahmad merged commit 939321f into master Oct 20, 2026
5 checks passed
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
… the human's line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RxETAY6S1gcmdctBK8a8Z
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
Docs only: ROADMAP takes master's M9.8 and M9.20–M9.25 rows beside this track's M9.9, M9.26 and
M9.27; TRACKING marks both M9.8 and M9.9 implemented. make ci (conformance 78/78) passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197nSutKR1QAAqgJhFZ8fPj
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.

2 participants

0