# E-038 — Awareness integration and an inert installed CLI

- Objective: O-AGENT-CONTEXT — keep guard integration coherent with worktree-scoped Awareness.
- Round: R-AWARENESS-INTEGRATION; KR-CONTEXT; criterion AC-CONTEXT.
- Classification: integration failure and maintenance-protocol correction, not a detector-performance measurement.

## Observed trajectory

[Fact] The prompt scripts called `awareness status` twice and required a worklog and
handoff before every reply. This contradicted the newly deployed Awareness flow:
worktree/session routing, optional context and one progress record that synchronizes
state and continuation. The installer compared exact command strings, allowing a
new package prefix to add another copy of its hooks.

[Fact] Invoking the published `oguard task-flow --json` through npm's executable
symlink exited successfully without output. The entrypoint compared a resolved
module URL with the unresolved argv path. Importing that same published module and
calling its exported `main` ran the real preflight: the checkout had a typed legacy
contract but no baseline. `adopt-baseline`, followed by an explicit successor round,
produced `ready` before implementation. No guard was disabled.

## Expected and actual guard behavior

Expected: the installed executable runs preflight and returns structured evidence.
Actual: the symlink path never invoked `main`; success status alone was misleading.
The existing direct-source CLI tests did not exercise that entrypoint. This is an
integration gap, not a measured false negative of a semantic detector.

## Correction and evidence

- `src/cli.mjs` resolves the executable path before deciding whether to run `main`.
- Both shell hooks delegate to `scripts/prompt-context.mjs`; Awareness is read once,
  bounded, JSON-safe, advisory and omitted on failure or context divergence.
- Guard preflight/closure instructions still apply independently of Awareness.
- The installer replaces its earlier-prefix hooks and suppresses its Awareness
  contribution when a dedicated Awareness prompt hook already exists.
- `test/prompt-context.test.mjs` executes both shell hooks, a real executable
  symlink, failure/timeout cases and the installed command after duplicate cleanup.

## Impact and follow-up

[Inference] Fewer mandatory context operations should reduce interaction overhead;
the regression tests prove the integration behavior, not productivity or semantic
goal achievement. AWC remains an independent package: its legacy board reads and
transition failures are not repaired by this change. Validate installed entrypoints
as well as source invocation in future release work.
