Skip to content

Commit c585af7

Browse files
chenchaoyiclaude
andauthored
chore(archive): apply add-scene-awareness spec deltas (#115)
Applies the spec deltas from add-scene-awareness (#114) into the canonical openspec/specs/ tree: - NEW openspec/specs/scenes/spec.md — full capability spec (Purpose + 3 requirements + 8 scenarios) - MODIFIED specs/cli/spec.md — adds --scene SCENE requirement - MODIFIED specs/event-log/spec.md — adds session_meta requirement - MODIFIED specs/analyze/spec.md — adds session_meta consumer + --for-llm scene context requirements - MODIFIED specs/bluetooth-scanning/spec.md — presence_gate_s default sourced from scene, --ble-presence-gate flag overrides - MODIFIED specs/tui-shell/spec.md — adds subtitle scene chip requirement (EN + ZH formats) Moves the change dir to openspec/changes/archive/2026-05-22-add-scene-awareness/. All artifacts done, all tasks complete, validate --specs --strict green (22/22 — scenes is the 22nd capability). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0aff717 commit c585af7

15 files changed

Lines changed: 221 additions & 3 deletions

File tree

openspec/changes/add-scene-awareness/design.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/design.md

File renamed without changes.

openspec/changes/add-scene-awareness/proposal.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/proposal.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/analyze/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/analyze/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/bluetooth-scanning/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/bluetooth-scanning/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/cli/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/cli/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/event-log/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/event-log/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/scenes/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/scenes/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/specs/tui-shell/spec.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/specs/tui-shell/spec.md

File renamed without changes.

openspec/changes/add-scene-awareness/tasks.md renamed to openspec/changes/archive/2026-05-22-add-scene-awareness/tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@
6969

7070
## 10. Merge + archive
7171

72-
- [ ] PR open, reviewed, merged
73-
- [ ] `/opsx:archive add-scene-awareness`
72+
- [x] PR open, reviewed, merged (#114)
73+
- [x] `/opsx:archive add-scene-awareness`

openspec/specs/analyze/spec.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,41 @@ takeaway — the rest is context.
8080
- **WHEN** three heuristics fire
8181
- **THEN** the report ends with a TODO section containing three bulleted `todo` lines, one per Insight
8282

83+
84+
### Requirement: Analyze SHALL consume `session_meta` and surface scene in the report header
85+
`diting analyze` SHALL parse the first line of each input JSONL as a potential `session_meta` event; when present, the report header SHALL include a "Scene:" line naming the scene plus its resolution source.
86+
87+
For multi-file glob input where input JSONLs were captured under different scenes, the report header SHALL summarise the mix (e.g., `Scenes: 3 × home, 1 × office`) rather than picking one. Per-network rankings and the top-contributors table SHALL note when their data spans multiple scenes so the user reads ranks knowing different baselines are mixed.
88+
89+
JSONL files written by pre-`session_meta` diting builds SHALL be tolerated — when `session_meta` is absent, the analyzer SHALL render `Scene: unknown (pre-scene-aware capture)` in the report header and proceed without scene-derived assumptions.
90+
91+
#### Scenario: Single-session report header surfaces scene
92+
- **WHEN** `diting analyze diting-20260522-130000.jsonl` runs against a JSONL whose first line is `{"type":"session_meta","scene":"office","scene_source":"cli",...}`
93+
- **THEN** the report header includes `Scene: office (cli)`
94+
95+
#### Scenario: Multi-session mix is reported
96+
- **WHEN** `diting analyze logs/*.jsonl --since 30d` runs across files captured under different scenes
97+
- **THEN** the header summarises the scene mix instead of picking one
98+
99+
#### Scenario: Pre-scene-aware log degrades gracefully
100+
- **WHEN** the input JSONL has no `session_meta` line (e.g. a v1.5.0 capture)
101+
- **THEN** the report renders `Scene: unknown (pre-scene-aware capture)` and continues normally
102+
103+
### Requirement: `--for-llm` SHALL inject scene context into the prompt template
104+
The Markdown prompt written by `diting analyze --for-llm` SHALL include a `[Scene context]` paragraph immediately before the role section. The paragraph is sourced from `scene_defaults(scene)["llm_prior"]` and tells the LLM what baseline to expect for the captured environment, framed as "look for departures from this baseline, not the baseline itself".
105+
106+
For single-scene input the paragraph mentions the scene + observed BSSID / BLE counts from the data. For multi-scene input the paragraph names the mix and instructs the LLM to compare across scenes.
107+
108+
For JSONL input lacking `session_meta` the paragraph SHALL still be present but acknowledge the gap: "Scene unknown (pre-scene-aware capture). Apply general priors only."
109+
110+
#### Scenario: Office-mode capture gives the LLM the office prior
111+
- **WHEN** `diting analyze diting-office.jsonl --for-llm` runs against an office-scene log
112+
- **THEN** the generated `prompt.txt` includes a `[Scene context]` paragraph mentioning `office` mode and the "dense enterprise env" prior; the paragraph appears BEFORE the role / tasks / output-format / guardrail sections
113+
114+
#### Scenario: Multi-scene bundle acknowledges the mix
115+
- **WHEN** the bundle spans both home-scene and office-scene logs
116+
- **THEN** the paragraph names the mix and instructs the LLM to compare across scenes rather than apply one prior
117+
118+
#### Scenario: Pre-scene-aware log
119+
- **WHEN** the input has no session_meta
120+
- **THEN** the paragraph notes the gap and tells the LLM to use general priors only

0 commit comments

Comments
 (0)