You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: openspec/specs/analyze/spec.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,3 +80,41 @@ takeaway — the rest is context.
80
80
-**WHEN** three heuristics fire
81
81
-**THEN** the report ends with a TODO section containing three bulleted `todo` lines, one per Insight
82
82
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
-**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