Skip to content

Commit 94021ca

Browse files
authored
Merge pull request #19 from jtrackingai/dev/zzc/v1.0.12
Add telemetry consent gate across workflows and Google site verification file
2 parents 9251a24 + 80a7de0 commit 94021ca

12 files changed

Lines changed: 510 additions & 40 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ npm run debug:codegen -- https://www.example.com
200200
- OAuth credentials are cached in the artifact directory for the current site run
201201
- generic sites use automated preview verification
202202
- Shopify uses the Shopify-specific branch and manual post-install validation
203-
- optional anonymous telemetry is opt-in, stores consent in local user config, and can be disabled with `DO_NOT_TRACK=1` or `EVENT_TRACKING_TELEMETRY=0`
203+
- optional anonymous usage diagnostics are opt-in and the first explicit choice is stored in local user config; if enabled, future runs send high-level workflow data such as command name, success/failure status, rough counts, site hostname, detected platform, and broad workflow checkpoints so operators can improve the product and troubleshoot reliability; if declined, future runs continue normally without sending diagnostics until the user changes that local config choice; diagnostics do not send full URLs, page paths, query strings, file paths, GTM/GA IDs, selectors, OAuth data, raw errors, or page content; the remaining privacy risk is that the site hostname and workflow metadata still reveal which domain was worked on and broad usage patterns; if a workflow prompt asks for telemetry consent and no stored preference exists, the operator must stop and let the user choose `yes` or `no` instead of answering on the user's behalf
204204
- installed copy bundles can self-check GitHub for updates and reinstall the same selected bundle set
205205

206206
## Need A More Advanced Setup?

SKILL.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ compatibility: >
55
Requires Node.js 18+, npm, and Playwright Chromium for browser-backed steps.
66
Analyze, selector validation, preview, and GTM sync must run outside sandboxed
77
environments. GTM sync uses interactive Google OAuth and caches credentials in
8-
the artifact directory. Optional anonymous telemetry is opt-in.
8+
the artifact directory. Optional anonymous telemetry is opt-in, used only to
9+
improve the skill experience and workflow quality, and is not used for
10+
sensitive actions or sensitive behavior tracking.
911
---
1012

1113
# Analytics Tracking Automation
@@ -60,6 +62,10 @@ Once `site-analysis.json` indicates Shopify, keep discovery and grouping shared,
6062
- Use `./event-tracking status <artifact-dir-or-file>` whenever the current checkpoint or next step is unclear.
6163
- Use `./event-tracking runs <output-root>` when the artifact directory is unknown but the output root is known.
6264
- Prefer high-level entry commands for user-facing flows: `run-new-setup`, `run-tracking-update`, `run-upkeep`, `run-health-audit`.
65+
- Before first workflow command, honor the telemetry consent gate. Treat telemetry consent as a required user-choice checkpoint for the session. Follow [telemetry-consent.md](references/telemetry-consent.md) as the single-source interaction contract. If consent is missing or invalid, explain both outcomes before asking: `yes` stores local consent and enables high-level anonymous usage diagnostics for future runs, while `no` stores local decline and continues the workflow without sending diagnostics.
66+
- Never decide telemetry consent on the user's behalf. Telemetry consent is recorded only in the local telemetry config file, not through enable/disable environment-variable overrides.
67+
- If the user agrees, continue through the interactive prompt so it can record local consent. If the user declines, continue through the prompt so it can record the local decline. The workflow can continue either way, but the choice must come from the user.
68+
- If the current run surfaces a telemetry prompt and the user has not answered it yet, stop and follow [telemetry-consent.md](references/telemetry-consent.md) before asking for a choice. Explain the purpose, what `yes` does, what `no` does, and the remaining privacy tradeoff before asking the user to reply `yes` or `no`. Do not ask a bare `yes`/`no` question with no context, do not answer the prompt for them, and do not continue to the next workflow command until the user makes that choice.
6369
- Treat workflow mode metadata as an internal workflow-state layer, not a user-facing command surface.
6470
- Treat Playwright-backed and OAuth-prompting steps as non-sandbox commands by default. In practice: `analyze`, `validate-schema --check-selectors`, `preview`, and `sync`.
6571
- Run prompt-driven GTM sync with an interactive TTY from the start unless exact `--account-id`, `--container-id`, and `--workspace-id` values are already confirmed.
@@ -110,6 +116,7 @@ If only the root skill is available, follow the same routing logic directly and
110116
- GTM target selection (account/container/workspace during `sync`)
111117
- publish decision (before `publish`)
112118
- If confirmation is missing or ambiguous, stop and ask; do not auto-proceed.
119+
- Treat telemetry consent the same way as other explicit approval gates: if the user has not chosen `yes` or `no`, stop and ask instead of making the decision for them.
113120
- A broad request such as "full workflow", "全流程", "end-to-end", or "continue all the way" is scope authorization only. It does not count as checkpoint approval.
114121
- Never record checkpoint approval on the user's behalf with `confirm-page-groups --yes` or `confirm-schema --yes` unless the user explicitly confirms that checkpoint in the current turn.
115122
- When live GTM containers are detected on the site, do not bypass the live baseline review before schema generation.
@@ -139,3 +146,4 @@ When a phase or the full workflow ends, keep the closeout answer-first:
139146
- [architecture.md](references/architecture.md) for lifecycle, checkpoints, and resume semantics
140147
- [output-contract.md](references/output-contract.md) for artifact files and gate semantics
141148
- [shopify-workflow.md](references/shopify-workflow.md) for Shopify-specific branch expectations
149+
- [telemetry-consent.md](references/telemetry-consent.md) for the telemetry consent gate wording and behavior contract

docs/googlecdf2410123e7225d.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: googlecdf2410123e7225d.html

references/telemetry-consent.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Telemetry Consent Interaction
2+
3+
This reference defines the single-source interaction contract for the telemetry consent gate.
4+
5+
Use it whenever the workflow reaches the diagnostics consent prompt and the user has not already made a recorded choice.
6+
7+
## Purpose
8+
9+
Telemetry consent is a user-choice checkpoint, not an implementation detail.
10+
11+
The agent must explain the decision in user-facing language before asking for the choice:
12+
13+
- what telemetry is for: improving workflow quality and product reliability
14+
- what `yes` does: stores local consent and enables high-level anonymous diagnostics for future runs
15+
- what `no` does: stores local decline and continues the workflow normally without diagnostics
16+
- what is not sent: full URLs, page paths, query strings, file paths, GTM or GA IDs, selectors, OAuth data, raw errors, and page content
17+
- remaining privacy tradeoff: the site hostname and broad workflow metadata may still reveal which domain was worked on and the rough type of work performed
18+
19+
## Required Asking Style
20+
21+
When the telemetry gate is reached, ask in plain language for the user's decision.
22+
23+
Recommended shape:
24+
25+
1. one short sentence on purpose
26+
2. one short sentence on what `yes` does
27+
3. one short sentence on what `no` does
28+
4. one direct choice prompt asking the user to reply `yes` or `no`
29+
30+
Recommended wording pattern:
31+
32+
> Before continuing, I need your choice on whether to enable anonymous diagnostics for this workflow.
33+
> `yes` stores consent in local config and enables high-level anonymous usage diagnostics for future runs so the workflow can be improved and kept reliable.
34+
> `no` also stores your choice in local config, and the workflow continues normally without sending those diagnostics.
35+
> These diagnostics do not include full URLs, page content, selectors, GTM or GA IDs, OAuth data, or raw errors, but they do include the site hostname and broad workflow metadata. Reply `yes` or `no`.
36+
37+
The exact wording can vary, but all of the points above must remain present.
38+
39+
## Required Behaviors
40+
41+
- stop when the gate appears and wait for the user's explicit answer
42+
- keep the explanation concise and user-facing
43+
- treat `yes` and `no` as equally valid workflow outcomes
44+
- once the user answers, continue through the interactive CLI prompt so the local telemetry config is written by the tool itself
45+
46+
## Prohibited Behaviors
47+
48+
- do not paste the raw CLI prompt to the user without explanation
49+
- do not ask only "`yes` or `no`?" with no context
50+
- do not frame `yes` as the preferred or expected answer
51+
- do not answer the prompt on the user's behalf
52+
- do not suggest config-file hacks, env overrides, or pre-seeding consent outside the intended prompt
53+
- do not continue to the next workflow command before consent is explicitly chosen

skills/tracking-discover/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ In this repository, use the repo-root wrapper:
2222
```
2323

2424
Run `analyze` outside sandboxed environments by default. Do not first attempt the Playwright crawl inside the sandbox and then retry after it is intercepted.
25+
Before `run-new-setup` or `analyze`, if the tool needs a telemetry consent answer and no prior choice is already recorded, stop and follow [../../references/telemetry-consent.md](../../references/telemetry-consent.md). Do not choose on the user's behalf, and do not continue until they answer.
2526

2627
Partial mode:
2728

@@ -55,6 +56,7 @@ Report:
5556
## Stop Boundary
5657

5758
Unless the user explicitly asks for the next phase, stop after analysis.
59+
If telemetry consent is still unanswered, stop before analysis starts and wait for the user's explicit choice.
5860

5961
If the user wants to continue, the default next command is:
6062

@@ -67,3 +69,4 @@ If the user wants to continue, the default next command is:
6769
- [../../references/crawl-guide.md](../../references/crawl-guide.md)
6870
- [../../references/architecture.md](../../references/architecture.md)
6971
- [../../references/output-contract.md](../../references/output-contract.md)
72+
- [../../references/telemetry-consent.md](../../references/telemetry-consent.md)

0 commit comments

Comments
 (0)