GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(nix): keep T3 Code from sending telemetry by furedea-agent[bot] · Pull Request #507 · furedea/dotfiles

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

T3 Code が既定で送るテレメトリ(ingest.t3.codes の利用イベント,api.axiom.co への relay トレース)を,mbp と mba で 4 層で止める.上流では opt-out が効かない期間があった(pingdotgg/t3code#16563,#14413)ので,環境変数 1 つに頼らない.

Closes #506

層 内容
設定 T3CODE_TELEMETRY_ENABLED=false を zsh/.zshenv,t3-server agent,launchctl setenv(両ホストの 1 回限り agent)に置く
ポリシー darwin activation が /Library/Application Support/T3Code/policy.json(limits.telemetry: false)を root:wheel,0644,親 0755 で書く
ネットワーク darwin activation が /etc/hosts の印付きブロックを冪等に書き換え,3 ドメインを 0.0.0.0 と :: に向ける
確認 T3 の server bundle の store path が変わったときだけ home-manager activation が scripts/t3/check_telemetry.sh を走らせ,ポリシー,hosts,launchd 環境,bundle 内の https:// ホストと T3CODE_* / OTEL* 名の差分を警告し,~/.local/state/t3-telemetry に記録する.警告で switch は失敗しない

ブロックしないホスト(app.t3.codes,GitHub,npm,u.expo.dev)と理由は ADR-0048 に記録した.

確認

  • bats tests/t3:hosts 書き換え 12 件(追記,冪等,置換,改行なし末尾,マーカー重複・不対・逆順で無変更,欠落・symlink で失敗,モード維持)と check 16 件
  • nix build で checks.aarch64-darwin.home-configuration と host-configuration(t3-telemetry-* の contract を含む)
  • 実際の T3 0.1.10 bundle に check を走らせ,ingest.t3.codes,relay.t3.codes,OTEL_* を拾うことを確認
  • リポジトリの pre-commit hook
  • CI
  • 利用者:sudo darwin-rebuild switch(mbp・mba)と home-manager switch.その後 ~/.local/state/t3-telemetry/last_check.txt が warnings=0 か確認する
範囲
  • 対象外:スマホ(クラッシュレポート切替と NextDNS は手動),外向きファイアウォール(LuLu),T3 本体の変更と上流報告.
  • この作業では darwin-rebuild switch,home-manager switch,/etc/hosts と /Library への書き込みは行っていない.
  • /etc/hosts はマーカーが重複・不対のとき,通常ファイルでないときは触らず警告だけ出す.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@furedea @claude
feat(nix): keep T3 Code from sending telemetry
af81742
Set T3CODE_TELEMETRY_ENABLED=false in the shell, the t3-server agent and the
launchd environment, write a managed policy with limits.telemetry false, block
the telemetry and relay hosts in /etc/hosts, and check the setup and the T3
bundle's endpoints whenever the T3 package changes (ADR-0048).

Closes #506

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary: no blocking findings (no P0/P1) and no inline comments.

I read the full diff: the nix wiring, the hosts rewrite script, the check script, and the bats tests. I did not run the tests or build the nix checks.

  • update_hosts_block.sh handles the cases I traced: appending to a file with no trailing newline, replacing an existing block, comparing against the current content with the trailing-newline sentinel, and refusing on duplicate, unpaired or reversed markers. The temp-file-then-rename write keeps the mode, and the symlink and not-a-regular-file guards are in place. /etc/hosts itself is a regular file, since only /etc is a symlink, so the -L guard does not reject it.
  • The darwin activation steps are ||-guarded, so a failed write does not abort the switch. The nix contracts in nix/checks.nix cover each layer on both hosts.

Minor notes, none blocking:

  • (P3) checked_package is written even when the check records warnings, and the check only runs when the T3 store path changes. If the darwin activation (policy and hosts) runs after the home-manager check on a first switch, the check can record 'missing' warnings and not re-run until the next T3 update. The ADR admits the once-per-store-path limit. Consider writing checked_package only when warnings=0, or after the rewrite, so a failed layer is re-checked on the next switch.
  • (P3) render captures output through $(...), which strips trailing blank lines. A /etc/hosts that ends in blank lines gets them trimmed on the first rewrite, which departs slightly from 'lines outside the block never change'. It is harmless.
  • (P3) check_hosts only confirms that a 0.0.0.0 or :: line exists for each host. An earlier conflicting entry for the same name would win in resolver order and would not be flagged.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@furedea @claude
feat(nix): also disable T3 OTel export with T3CODE_OTEL_SDK_DISABLED
7c6c640
Relay tracing stops when either telemetry is off or OTel export is disabled,
so set both as belt and braces in the shell, the t3-server agent and the login
launchctl setenv agent (ADR-0048).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T19:43:20.304362Z
We couldn’t complete this review. Comment @codex review to try again.
64c482e Manual request
ℹ️ 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread scripts/t3/update_hosts_block.sh
printf x
)
# Both sides carry the sentinel x, so trailing newlines take part in the comparison.
if [[ "$_updated"$'\n'x == "$_current" ]]; then

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: The right side of == inside [[ ]] is unquoted, so bash treats the file contents in $_current as a glob pattern, not a literal string. If /etc/hosts has *, ?, [ or \ in a comment, the comparison can report "unchanged" when it isn't. For example, a last line like # foo * gives the pattern ...# foo *\nx, which matches updated. The script then returns 0 without writing, so the block is never installed and no warning is printed. The idempotence tests only use plain hosts lines, so they miss this.

Suggested change
if [[ "$_updated"$'\n'x == "$_current" ]]; then
if [[ "$_updated"$'\n'x == "$_current" ]]; then

Quoting the right side ("$_current", as in the suggestion) makes it a literal comparison. Please add a bats case with a glob character in a hosts comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread scripts/t3/check_telemetry.sh Outdated
printf 'warning=%s\n' "$_warning"
done
} >"$STATE_DIR/last_check.txt"
printf '%s\n' "$_package" >"$STATE_DIR/checked_package"

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: checked_package is written even when the check produced warnings. The activation in nix/home/default.nix only reruns the check when this value differs from the T3 store path. So a run that warns because a layer isn't in place yet is never repeated until T3 updates. Two cases can cause this:

  • darwin-rebuild and home-manager run in the wrong order, so policy.json and the hosts block don't exist yet.
  • The t3-telemetry-off or t3-server agent isn't loaded yet when the check runs after linkGeneration. Nothing orders the check after setupLaunchAgents.

In both cases the one-time warning scrolls past in the switch output and the layer stays broken without being rechecked. The PR's own test plan says to look at warnings=0 afterwards, which hides the problem if the first run was early.

Consider recording checked_package only when ${#warnings[@]} -eq 0. The bundle baseline is already moved separately, so the check would simply rerun on each switch until clean. Alternatively, order the activation entry after the launchd agent setup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary for #507. No P0 or P1 findings. I posted 2 inline comments, both P2.

  • P2: update_hosts_block.sh compares the file with an unquoted [[ ... == $_current ]], so glob characters in /etc/hosts can make it report "unchanged" and skip the write.
  • P2: check_telemetry.sh records checked_package even when it produced warnings, so a layer that wasn't ready on the first run isn't rechecked until T3 updates.

I read the diff only. I did not run the tests or the Nix build.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@furedea @claude
test(nix): read the file mode with GNU stat first
c551196
BSD stat -f prints filesystem info with exit 0 on Linux, so the mode check
failed in CI.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread nix/home/default.nix
mkdir -p "${t3ServerLogDirectory}"
''
);
t3TelemetryCheck = lib.hm.dag.entryAfter [ "linkGeneration" ] ''

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: The check can run before the launchd agents are loaded, and it is then never re-run.

t3TelemetryCheck is ordered only entryAfter [ "linkGeneration" ]. Home Manager's setupLaunchAgents is ordered entryAfter [ "writeBoundary" ], so nothing guarantees it runs first. Even if it does, launchctl bootstrap returns before t3-telemetry-off (RunAtLoad) has called launchctl setenv.

On the first switch, check_launchctl_environment and check_service_environment can therefore warn falsely: launchctl getenv is empty, or the old t3-server plist is still loaded. The same happens if home-manager switch runs before darwin-rebuild switch, because the policy and hosts checks then fail.

record_result writes checked_package regardless of warnings. The [ "$(cat checked_package)" != store-path ] guard then skips the check on every later switch until the T3 store path changes. The PR's rollout step ("check that last_check.txt has warnings=0") can end on a stale, false warnings>0 with no supported way to re-run. The only workaround is deleting checked_package by hand.

Suggested fix: write checked_package only when warnings is 0. The check also re-runs on the next switch whenever the previous run warned, and it stays quiet once clean. Alternatively, order the entry after setupLaunchAgents.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary

The change is well structured: four layers, a hosts rewriter that is idempotent and refuses to touch duplicated, unpaired or non-regular files, and tests for both scripts. I read the diff only and did not run bats or nix build. I found one problem.

  • P2 (nix/home/default.nix:778): the telemetry check records checked_package even when it warned. The check can also run before setupLaunchAgents has loaded the agents, or before darwin-rebuild has written the policy and hosts. The first switch can then record false warnings, and the check never re-runs until the T3 store path changes. Writing checked_package only when warnings=0 would fix it.

Not verified: the upstream behaviour the PR relies on. That covers the /Library/Application Support/T3Code/policy.json schema, T3CODE_TELEMETRY_ENABLED, and T3CODE_OTEL_SDK_DISABLED actually stopping the traffic. Nothing in the repo can confirm it, so the PR's own test run against a real bundle is the only evidence.

🤖 Generated with Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@furedea @claude
refactor(nix): trim locals in the T3 telemetry scripts and tests
16bdf7d
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary

I found no P0 or P1 problems. I read the code and did not run it, so the bats results and nix build runs in the PR description are unverified by me.

  • P2 (inline, scripts/t3/check_telemetry.sh): checked_package is recorded even when the check warned, so the once-per-store-path gate never retries. If home-manager switch runs before darwin-rebuild switch, or the activation entry runs before the launchd agents are loaded, the warnings stay pinned until the next T3 update.

What I checked and found fine:

  • update_hosts_block.sh: idempotence, marker handling, the symlink and non-regular-file guards, and the temp-file rename keeping mode and owner.
  • The darwin activation steps fail soft.
  • The Nix contracts cover the declarative layers.

I did not review T3's actual behavior, such as whether the policy file or env var is honored upstream.

🤖 Generated with Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread scripts/t3/check_telemetry.sh Outdated
printf 'warning=%s\n' "$_warning"
done
} >"$STATE_DIR/last_check.txt"
printf '%s\n' "$_package" >"$STATE_DIR/checked_package"

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: checked_package is written even when the check produced warnings. nix/home/default.nix reruns the check only when that marker differs from the T3 store path. So a warning-producing run is never repeated until T3 updates.

Two ways this goes wrong:

  • If home-manager switch runs before sudo darwin-rebuild switch, the policy and hosts warnings are recorded. The later switch skips the check, and last_check.txt keeps showing warnings>0 until the next T3 update.
  • The check is ordered entryAfter [ "linkGeneration" ], which I don't think guarantees it runs after the launchd agents are loaded. On the first switch, launchctl getenv and launchctl print can report the opt-out as missing, and the result is then pinned.

Consider writing checked_package only when ${#warnings[@]} -eq 0, so a failing check retries on the next switch. Alternatively, order the activation entry after the launchd agent setup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@furedea @claude
fix(nix): rerun the T3 telemetry check until it passes and flush DNS …
95bcd92
…after hosts change

Record the package as checked only when no warning was found, so a switch that
runs before the policy, hosts or setenv agent exist does not hide the warning
until the next T3 update. Flush the resolver cache when /etc/hosts changed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread nix/home/default.nix
mkdir -p "${t3ServerLogDirectory}"
''
);
t3TelemetryCheck = lib.hm.dag.entryAfter [ "linkGeneration" ] ''

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: t3TelemetryCheck is ordered only entryAfter [ "linkGeneration" ]. In Home Manager, setupLaunchAgents is ordered only after writeBoundary, and this repo already uses that name at line 774. So nothing orders the check against setupLaunchAgents, and the check may run before the agents are loaded or reloaded.

If it does, the first switch can report spurious warnings. launchctl getenv T3CODE_TELEMETRY_ENABLED would be empty because t3-telemetry-off hasn't run yet. The t3-server check could also report an old plist. Warnings delete checked_package, so the check reruns on the next switch and the problem corrects itself. Still, the "warnings=0" confirmation step in the PR may fail on the first run for this reason alone.

Consider entryAfter [ "linkGeneration" "setupLaunchAgents" ]. Note that setupLaunchAgents may be absent from the DAG on some configurations, and a missing dependency can make the DAG resolution fail. If so, add a short comment saying the first switch can warn spuriously.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary

I found no P0 or P1 problems. I read the diff only. I did not run the tests or build anything.

What I checked

  • update_hosts_block.sh: the trailing-newline handling, the idempotence comparison, marker validation, the same-directory rename, and the mode-preserving copy. I found no bugs, and the bats cases cover the edge cases I thought of.
  • check_telemetry.sh: the awk host matching, the pipefail and || true usage, and the comm baseline diff. A warning removes the checked_package record, so a failed check reruns on the next switch.
  • Darwin activation: the policy install, the hosts rewrite, and the DNS cache flush that runs only when the file changed. Failures are reported without stopping the switch.
  • Nix wiring: the t3-server environment variables, the one-shot launchctl setenv agent, and the build-time contracts in nix/checks.nix.

Findings

  • P2 (inline, nix/home/default.nix:778): t3TelemetryCheck is not ordered against setupLaunchAgents. The first switch may warn spuriously about the launchctl environment or the server plist. The check is self-healing because warnings clear checked_package.

Observations, no action needed

  • The nix/checks.nix contracts for the activation text only match strings. A typo in the shell logic would not be caught there, but the bats tests cover that logic.
  • Blocking api.axiom.co in /etc/hosts applies system-wide, not only to T3. The ADR documents the block but doesn't say that it affects all apps, so it may be worth a line.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@furedea @claude
docs(adr): note that a warned check reruns on every switch
64c482e
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot reviewed Nov 24, 2026
View reviewed changes
Comment thread nix/home/default.nix
mkdir -p "${t3ServerLogDirectory}"
''
);
t3TelemetryCheck = lib.hm.dag.entryAfter [ "linkGeneration" ] ''

@github-actions github-actions Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: t3TelemetryCheck has no ordering against setupLaunchAgents, so it can warn falsely.

This entry runs entryAfter [ "linkGeneration" ]. The launchctl getenv check and the launchctl print check for the t3-server agent only see the new state once setupLaunchAgents has loaded the new plists. Nothing orders the two: the log-directory entry about 10 lines above uses entryBetween [ "setupLaunchAgents" ] [ "writeBoundary" ], which shows that ordering is explicit in this file. Both entries only need to come after writeBoundary.

The check runs only when the T3 store path changes. That is exactly when the agents may still be running the old plist or not be loaded yet. The first switch after this PR is the clearest case, because t3-telemetry-off has never run. It can then warn that launchctl getenv is not false, or that the service lacks T3CODE_TELEMETRY_ENABLED => false.

Warnings are not recorded as done, so it reruns on the next switch and recovers. But the PR's own post-switch step is "confirm last_check.txt has warnings=0", and that step can fail on a correct setup.

Suggestion: add "setupLaunchAgents" to the after list, e.g. entryAfter [ "linkGeneration" "setupLaunchAgents" ]. Please confirm the DAG has no cycle.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Review summary (read-only)

One finding, inline: P2. t3TelemetryCheck is not ordered against setupLaunchAgents, so on the first switch, or on a switch that changes the plist, the launchd checks can warn falsely. That can make the "warnings=0" post-switch step fail on a correct setup. The check reruns on the next switch, so nothing breaks permanently.

I read through the following and found no correctness or security problems:

  • update_hosts_block.sh: marker handling, symlink and non-regular-file refusal, idempotence, same-directory atomic replace.
  • The darwin activation: each step is guarded with || echo, and the DNS cache flush runs only when the file changed.
  • The policy install: root-owned, 0644.
  • The Nix contracts.

Not verified: the bats and nix build results. I did not run them.

Minor notes, not worth blocking on:

  • The ADR is dated 2026-11-25. The review ran on 2026-11-24.
  • Blocking api.axiom.co is machine-wide, so any other Axiom use on these hosts stops working. The ADR does not mention this.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

furedea
furedea approved these changes Nov 24, 2026
View reviewed changes
@furedea
furedea merged commit ac5dcbe into main Nov 24, 2026
21 of 23 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@furedea
furedea deleted the feat/block-t3-code-telemetry branch November 24, 2026 19:55
@furedea-agent furedea-agent Bot mentioned this pull request Nov 24, 2026
fix(nix): give the T3 telemetry scripts their own tool PATH #515
Merged
3 of 5 tasks
furedea added a commit that referenced this pull request Nov 24, 2026
@furedea-agent @furedea @claude
fix(nix): give the T3 telemetry scripts their own tool PATH (#515)
d7b950f
#507 の `t3TelemetryCheck` が実際の `darwin-rebuild switch` で偽の警告を 6
件出していたのを直す.#506 は閉じたままで,関連として参照する.

## 原因

Home Manager の activation は PATH が最小で,`awk` がない.`check_telemetry.sh` の
`resolves_to` が素の `awk` を呼び,`awk: command not found` になって,`/etc/hosts`
が正しくても 3 ドメイン × 2 アドレスの 6 件が「未設定」と警告された(`last_check.txt` は
`warnings=6`).bats は PATH に awk があるテスト環境で走るので通っていた.

## 修正

- `check_telemetry.sh` と `update_hosts_block.sh` は `TOOLS_PATH`
を必須にし,`PATH` をそれだけにする.呼び出し側の PATH には依存しない.
- Nix の wrapper が `TOOLS_PATH` を `lib.makeBinPath` で渡す.check は
coreutils,gawk,gnugrep,gnused,hosts 書き換えは coreutils.
- 工具ごとの変数(`AWK_BIN`
など)を足す案より,`awk`,`grep`,`sed`,`sort`,`comm`,`tr`,`date`,`mkdir`,`rm`,`cat`,`id`
をまとめて 1 変数で覆えるので小さい.既存の `JQ_BIN` は残す.
- darwin の postActivation は root で `/usr/bin/install` と `/usr/bin/cksum`
などを絶対パスで呼び,`update_hosts_block` の wrapper には
`TOOLS_PATH`(coreutils)を渡すようにした.

## 確認

- [x] 再現テスト:PATH が `bash` だけの環境で,`TOOLS_PATH` を渡してスクリプトを走らせる bats
を両スクリプトに追加.修正前は両方 exit 127 で落ち,修正後は通る
- [x] `bats tests/t3`,shellcheck,`home-configuration` と
`host-configuration` の `nix build`,pre-commit hook
- [x] 実際にビルドした `check_t3_telemetry` wrapper を `env -i PATH=/var/empty`
で実行(状態の置き場とポリシーのパスだけ作業用に差し替え)し,正しい hosts で `warnings=0`,exit 0
- [ ] CI
- [ ] 利用者:`sudo darwin-rebuild switch --flake .#mbp` を再実行.前回の警告で
`checked_package`
は記録されていないので,確認は自動で再実行され,`~/.local/state/t3-telemetry/last_check.txt` が
`warnings=0` になる

<details>
<summary>範囲</summary>

switch 後の `~/.nix-profile/bin/starship` / `direnv` のエラーは,standalone Home
Manager から nix-darwin module に移った後の古い対話シェルが原因で,#507 とは無関係なので対象外.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
@furedea-agent furedea-agent Bot mentioned this pull request Nov 24, 2026
chore(nix): block PostHog hosts and limit Office diagnostics #514
Merged
furedea added a commit that referenced this pull request Nov 25, 2026
@furedea-agent @furedea
@claude @noreply
chore(nix): block PostHog hosts and limit Office diagnostics (#514)
21d3e5f
## 概要

- Homerow 3.0.0(クローズドソース)が,プライバシーポリシーに記載のない PostHog
解析(`us.i.posthog.com`)を内蔵し,オプトアウトもできないため,PostHog
のクラウド取り込みホストをシステム全体でブロックする.
- Nani のファビコンプロキシ `f.kiok.jp`(`https://f.kiok.jp/?size=..&url=<origin>`
で閲覧ページのオリジンを受け取る)も同じ仕組みでブロックする.
- Microsoft Office の診断データを最小化し,任意の接続エクスペリエンスを無効化する.

## 変更内容

### テレメトリホストのブロック

- `0.0.0.0`(IPv4)と `::`(IPv6)に対応付けるホスト: `us.i.posthog.com`,
`us-assets.i.posthog.com`, `eu.i.posthog.com`,
`eu-assets.i.posthog.com`, `app.posthog.com`, `f.kiok.jp`.他のホストは追加しない.
- 機構: main にマージ済みの T3 Code 用
`scripts/t3/update_hosts_block.sh`(`/etc/hosts` のマーカー付きブロックを activation
で書き換える方式)を再利用する.
- 当初は `environment.etc."hosts"`(Apple 既定内容を保持し `knownSha256Hashes`
で置換)を使っていたが,T3 側が同じ `/etc/hosts` を直接書き換える方式を main
に入れたため,両立しない(`/etc/hosts` が symlink になると T3
のスクリプトは「通常ファイルではない」として失敗する).このため方式を差し替えた.
- スクリプトに環境変数 `HOSTS_BLOCK_NAME`(既定
`t3-telemetry-block`)を追加し,`app-telemetry-block` という別名のブロックを併存させる.既存の T3
ブロックの挙動は変えない(既定のマーカーは従来のままなので,#507
を適用済みのマシンのブロックはその場で書き換えられ,古いブロックが重複して残ることはない).ADR-0048 は,承認済み ADR
の本文を変えず front matter の `amended` に追記した.ブロック外の行には触れず,hosts が変わったときだけ DNS
キャッシュを消去する既存処理もそのまま効く.
- DNS キャッシュは,hosts が変わった場合に activation が自動で消去する(`dscacheutil
-flushcache` と `killall -HUP mDNSResponder`).

### Office

`system.defaults.CustomUserPreferences."com.microsoft.office"` に設定:

- `DiagnosticDataTypePreference = "ZeroDiagnosticData"`
- `OfficeExperiencesAnalyzingContentPreference = false`
- `OfficeExperiencesDownloadingContentPreference = false`
- `OptionalConnectedExperiencesPreference = false`

`ConnectedOfficeExperiencesPreference` は変更しない(無効化すると OneDrive
と共同編集が使えなくなるため).キー名と値は Microsoft の「Use preferences to manage privacy
controls for Office for Mac」で確認済み.

注意:

- 反映には Office アプリの再起動が必要.
- 職場・学校アカウントでは,テナントのポリシーがこれらの設定を上書きする場合がある.

mbp / mba の両ホストは `nix/darwin/default.nix` を共有しているため,両方に適用される.

## 検証

- `nix/checks.nix` の `host-configuration`
に契約を追加(`app-telemetry-hosts-blocked-only`: 上記 6 ホストだけを
`app-telemetry-block` で遮断し,`environment.etc."hosts"`
を持たないこと.`office-telemetry-limited`).実装前に失敗することを確認し,実装後に成功.
- `tests/t3/update_hosts_block.bats`
に名前付きブロックの併存を指定するテストを追加(先に失敗,実装後に成功).`bats tests/t3` 全件成功.
- `nix build` で `host-configuration`, `home-configuration`,
`system-configurations` が成功.
- main(#507,#515)を merge して競合を解消.#515 の `TOOLS_PATH`
要件とそのテストはそのまま維持している.
- `lefthook run pre-commit --all-files` が成功.
- `darwin-rebuild` は未実行(適用は利用者が行う).

計画からの逸脱: ブロック機構を `environment.etc` から T3 と共通のマーカー付きブロックに変更した(上記).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Co-authored-by: furedea-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments
@furedea furedea furedea approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat(t3): keep T3 Code from sending telemetry on mbp and mba

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@furedea
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.