# E-018 — The global inventory hid real events due to non-canonical paths

- Date: 2026-08-03
- Status: confirmed observability false negative, fixed and covered by regression.

## Objective hierarchy

- Main objective: detect deterministic drift with an early, traceable signal.
- Phase objective: observe global hook activity without exposing repository content.
- Round objective: pre-register a control/placebo/guard trial and verify Claude and Codex dogfooding.

## Observed trajectory

During this round's dogfooding, Claude and Codex ran against `src/intervention-trial-design.mjs`. `~/.oguard/inventory/events.jsonl` received four new sanitized events, two per harness, all with a `pass` result. However, `oguard inventory report --json` still showed only four historical events.

The hook computes `repository_hash` using the physical root (`realpath`) to avoid the E-015 problem. `inventory discover`, however, stored the textual root passed by the user. When the two representations differed, the report filtered events by a different hash and hid them. This was not an absence of activity or a silent `pass`: it was a loss of observability in the global aggregation.

## Correction and evidence

`discoverProjects` canonicalizes each root with `realpath` before persisting it and computing its hash. It also preserves previous hashes from the same record as read aliases: when the inventory is updated, sanitized events already written under the previous identity still count. If a historical hash can no longer be safely associated, `inventory report` exposes it as `unregistered_events` instead of silently discarding it. `test/global-inventory.test.mjs` covers a project registered via a symlink, an update from a legacy hash, and unassociated events. The fix keeps the inventory sanitized: only internal roots and hashes change; no file paths, content, or prompts are added.

## Impact on the thesis

Hook telemetry is only evidence if the inventory can reconstruct it. Before this fix, a low count could be mistakenly interpreted as low activity, low incidence, or low sensitivity. This episode strengthens the instrument's traceability, but does not by itself increase detector sensitivity or demonstrate the guard's causal effectiveness.

## Follow-up

After every installation or new harness, run `oguard inventory discover` and compare the number of sanitized events against the local log before interpreting usage metrics.
