microsoft / microsoft/hve-core
refactor(hooks): reduce telemetry to a 3-hook spine and read host session stores
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 301
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 92
Description
### Issue Description
The telemetry hook manifest registers one command against 11 lifecycle events. Most of that collection duplicates data the host already writes.
Hooks still earn their place as the opt-in consent gate and as coverage where no host log exists, and as the cross-project registry.
### Proposal
- Keep sessionStart (opt-in gate, sid<->cwd binding, registry, launchers) and preCompact + one terminal event (sessionEnd on CLI, stop on VS Code, which has no sessionEnd).
- Retire preToolUse, postToolUse, userPromptSubmitted, subagentStart, subagentStop as always-on; retain as fallback for hosts with no usable log.
- Read session-store.db ahead of the process-log parser.
### Additional Context
Trade-off: Tool Heatmap, Tool Latency, and Instructions/Skills become host-log-dependent and will be empty where debug logging is off. The report must say so rather than render a silent zero.
### Worth exploring
- How much of the report could be sourced from session-store.db instead of the process-log parser, and whether that's retroactive. assistant_usage_events does not cover every session in the local store; if /chronicle reindex doesn't backfill, it's prospective-only and the parser stays.
- Whether a reduced hook set (something like sessionStart + preCompact + a terminal event) preserves the consent gate, the session<->repo binding, and the pre-rotation snapshot while dropping the high-volume tool events.
- If tool events are dropped, what the report should show on a host with no usable log. Rendering a silent zero would be worse than the current behavior.
Contributor guide
Research direction
Start by tracing the telemetry hook manifest, the process-log parser, and the session-store.db integration, then check whether /chronicle reindex backfills assistant_usage_events. Compare the proposed sessionStart, preCompact, and terminal events with the consent and binding requirements. Done means the reduced hooks and store-reading behavior are defined, and reports explicitly distinguish missing host logs from zero activity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100