Skip to content

Commit c1c4bb0

Browse files
chenchaoyiclaude
andauthored
chore(release): v1.6.0 (#118)
Scene awareness. diting now carries an explicit notion of where the user is right now, threaded through pollers + the JSONL session header + the LLM prompt bundle. Four named scenes (home / office / public / audit), each with: - per-scene BLE presence_gate_s default (home=5s, office=15s, public=30s, audit=0s) - per-scene LLM prior injected into --for-llm prompt template - chip in the TUI title bar showing the active scene Resolution precedence (5 tiers, highest first): 1. --scene SCENE CLI flag 2. DITING_SCENE env var 3. scenes.yaml SSID / gateway_mac match (per-network pinning, mirrors aps.yaml pattern, git-ignored, human-curated only) 4. classify_environment heuristic on the active connection (WPA-Enterprise auth -> office; >= 30 BSSIDs visible -> office; otherwise home; public stays opt-in because captive-portal detection without active probing is unreliable) 5. home default scene_source field on session_meta records the tier that won: {cli, env, yaml, auto, default}. session_meta is a new JSONL event type written as line 1 of every diting session, carrying scene + scene_source + diting_version + ssid + gateway_ip + hostname (BSSID intentionally left out for PII reasons). PRs bundled: #114 (P1 + P4 scene awareness), #115 (archive), #116 (P2 auto-detect + scenes.yaml), #117 (archive). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c0f62d3 commit c1c4bb0

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ behaviours between releases.
1111

1212
## [Unreleased]
1313

14+
## [1.6.0] — 2026-05-22
15+
16+
Minor release. **Scene awareness** — diting now carries an explicit
17+
notion of *where the user is right now*. Four named scenes
18+
(`home` / `office` / `public` / `audit`) each set their own BLE
19+
presence-gate default and carry a baseline-expectation prior that
20+
the `--for-llm` analysis bundle hands to the LLM as load-bearing
21+
context. Scene resolves from a 5-tier precedence: `--scene` CLI
22+
flag → `DITING_SCENE` env var → `scenes.yaml` per-network pinning
23+
→ auto-detect heuristic (WPA-Enterprise / dense BSSID surface) →
24+
`home` default. Every JSONL session now opens with a `session_meta`
25+
line tagging the scene + how it was resolved, so the analyzer
26+
can group cross-session aggregations by scene and the LLM bundle
27+
prepends a "here's what 'office' looks like as a baseline" prior
28+
to the prompt template.
29+
30+
For the audit / debug use case, `--scene audit` (or
31+
`--ble-presence-gate 0`) disables the gate entirely and restores
32+
the v1.4.0 "record everything" contract.
33+
1434
### Added
1535
- **Scene auto-detect + `scenes.yaml` per-network persistence.** When neither `--scene` nor `DITING_SCENE` is set, diting now picks the scene itself at startup by inspecting the active Wi-Fi connection: enterprise auth (WPA2 / WPA3 Enterprise) → `office`; ≥ 30 visible BSSIDs in the CoreWLAN scan cache → `office`; otherwise `home`. A one-line stderr banner explains the choice (`auto-detected scene: office (WPA2 Enterprise auth)`); suppress with `DITING_SCENE_QUIET=1`. For networks you visit regularly, `scenes.yaml` (mirror of `aps.yaml` — optional, in cwd, git-ignored) pins SSID → scene (or `gateway_mac` → scene for SSID-collision cases like `eduroam`); yaml hit wins over auto-detect, banner becomes `pinned scene: office (matched "Meituan" in scenes.yaml)`. `scene_source` JSONL field extends from `{cli, env, default}` to `{cli, env, yaml, auto, default}` so the analyzer and LLM bundle can distinguish explicit user choice from automated guess. Resolution precedence: CLI flag > env var > scenes.yaml > heuristic > `home` default. `public` stays opt-in (captive-portal detection without active probing is unreliable).
1636
- **Scene awareness — `--scene SCENE` flag + `DITING_SCENE` env var.** Four named environments (`home` / `office` / `public` / `audit`) each carry default knobs and a plain-language baseline expectation. Selected via CLI flag (highest priority), env var, or the default `home`. Drives the BLE presence-gate default per scene (`home=5s`, `office=15s`, `public=30s`, `audit=0s`); `--ble-presence-gate D` continues to override. Active scene renders as a chip in the TUI title bar (`scan 7s · [home]` / `扫描间隔 7s · [家]`). Spec lives in the new `scenes` capability.

docs/zh/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010

1111
## [Unreleased]
1212

13+
## [1.6.0] — 2026-05-22
14+
15+
Minor release。**场景感知** —— diting 现在明确知道「你身处什么
16+
环境」。四个命名场景(`home` / `office` / `public` / `audit`
17+
各有 BLE presence-gate 默认值和基线预期;`--for-llm` 分析包会
18+
把这份预期作为先验注入 LLM prompt。场景按 5 层优先级解析:
19+
`--scene` flag → `DITING_SCENE` env → `scenes.yaml` 网络粘贴
20+
→ 启发式自动判别(WPA-Enterprise / 密集 BSSID 面)→ `home`
21+
默认。每个 JSONL 会话开头都会写一行 `session_meta` 标明场景
22+
+ 怎么定的,让 analyzer 按场景做跨会话聚合,LLM bundle 也能
23+
在 prompt 模板前面塞上「office 长什么样」的基线先验。
24+
25+
如果做审计 / 排查需要,`--scene audit`(或
26+
`--ble-presence-gate 0`)直接关掉门控,恢复 v1.4.0 「记一切」
27+
契约。
28+
1329
### 新增
1430
- **场景自动识别 + `scenes.yaml` 按网络持久化。** 不传 `--scene`、也不设 `DITING_SCENE` 时,diting 启动时会自己看当前 Wi-Fi 连接选场景:企业认证(WPA2 / WPA3 Enterprise)→ `office`;CoreWLAN 缓存里 ≥ 30 BSSID → `office`;其他 → `home`。一行 stderr banner 说明结果(`auto-detected scene: office (WPA2 Enterprise auth)`),`DITING_SCENE_QUIET=1` 可静音。常去的网络可以拷 `scenes.example.yaml` 成 `scenes.yaml`(与 `aps.yaml` 同模式,可选、在 cwd、git-ignored),按 SSID → 场景固定(或 `gateway_mac` → 场景,给 SSID 撞名场景如 `eduroam`);yaml 命中优先于启发式,banner 变成 `pinned scene: office (matched "Meituan" in scenes.yaml)`。JSONL `scene_source` 字段从 `{cli, env, default}` 扩到 `{cli, env, yaml, auto, default}`,让 analyzer 和 LLM bundle 区分「用户明确指定」与「diting 自己猜的」。解析顺序:CLI flag > env var > scenes.yaml > 启发式 > `home` 默认。`public` 保持手动(无主动探测时区分不开公共 Wi-Fi 和邻居开放 AP)。
1531
- **场景感知 —— `--scene SCENE` flag + `DITING_SCENE` 环境变量。** 四个命名环境(`home` / `office` / `public` / `audit`),每个带一套默认旋钮和一句白话的基线预期。CLI flag(最高优先级)/ env var / 默认 `home` 三层解析。决定 BLE presence gate 的每场景默认值(`home=5s``office=15s``public=30s``audit=0s`);`--ble-presence-gate D` 仍然能单点覆盖。激活的场景在 TUI 标题栏里显示成 chip(`扫描间隔 7s · [家]` / `scan 7s · [home]`)。Spec 单独成一个 `scenes` capability。

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "diting"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
description = "macOS terminal listening post for Wi-Fi, BLE, link health, and the RF environment — your Mac hears more than it tells you"
55
readme = "README.md"
66
license = "MIT"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)