exp(18): implement investigation state assessment layer

Implement the three-dimensional assessment (phase, progress, conversation
health) that sits between narrative and behaviour selection.

Key changes:
- lib/assessment/investigation-state-assessor.js: assessor module with
  countObservations, assessPhase, assessProgress, assessConversationHealth,
  assessInvestigationState — deterministic classifiers using known rules
- tests/investigation-state-assessor.test.js: 51 tests covering phase
  classification (orienting→concluding), progress thresholds, health
  conditions, confidence aggregation, edge cases, and observation counting
- lib/graph/orchestrator.js: integration calls passing correctly-shaped input
  to assessInvestigationState() at three call sites (~552, ~904, ~1013)

Design decisions encoded in this iteration:
- countObservations counts nodes with known/resolved status + high-confidence
  non-unknown non-state nodes (not just explicit observation-kind nodes)
- Phase uses seven values including cannot_determine for insufficient data
- Progress uses resolution ratio thresholds: accelerating (>0.6), steady
  (0.2-0.6), stalled (<0.2 with ≥1 resolved)
- Overall confidence = minimum across all three dimensions (conservative)

Also adds investigation-state-assessment-contract.md and updates
design-evolution-log, investigation-state-assessment.md (status header),
and investigation-turn-cycle.md (implementation status table).
This commit is contained in:
2026-08-05 17:52:18 +01:00
parent a0a76d6171
commit 1273861f0c
7 changed files with 1608 additions and 7 deletions
+17
View File
@@ -257,6 +257,23 @@ Nothing system-generated. The next observation originates entirely from the user
---
## Implementation Status
| Stage | Description | Status | Experiment |
|-------|-------------|--------|------------|
| 1 | User Observation | Implemented (input) | — |
| 2 | Reasoning Graph Update | Implemented | Various |
| 3 | Investigation Narrative Update | Partially implemented | — |
| 4 | State Assessment | **Implemented** (v0.1) | Exp 18 |
| 5 | Behaviour Selection | Design only | **Exp 19 next** |
| 6 | Conversation Response | Design only | Post-Exp 19 |
| 7 | Workspace Projection | Implemented (UI) | Various |
| 8 | Wait for Next Observation | Implemented (state machine) | — |
Stages 4 and 5 remain as architectural specifications without executable code. Stage 4 was completed in Experiment 18; Stage 5 is the next implementation target.
---
## What This Turn Cycle Proves
The investigation turn cycle is not a new layer. It is an observation about how existing layers interact during a real investigation. It confirms that: