Diagnose investigation outcomes and version synthetic question selection corrections
This commit is contained in:
parent
be459d22c6
commit
283f6fd7ef
480
Docs/Writer/Investigations/Question-Quality-Audit.md
Normal file
480
Docs/Writer/Investigations/Question-Quality-Audit.md
Normal file
@ -0,0 +1,480 @@
|
||||
# Synthetic question and answer quality audit
|
||||
|
||||
17 November 2026 · 28 questions / 89 options. Complete synthetic catalogue comparison, not production questionnaire authoring.
|
||||
|
||||
## Findings and correction boundary
|
||||
|
||||
Twenty direct/discovery/discrimination/challenge questions reused “Yes, that describes it” / “No, that does not describe it”. They were comprehensible for some descriptions but grammatically indirect for “Can you…” questions, and obscured reverse scoring. Version 2 replaces all 40 generic yes/no labels with question-specific responses. Five clarification questions were indistinguishable and unnecessarily required two correlated questions before becoming eligible; they now identify the hypothesis in plain wording, require two answers, and are selected only for an actual matching material conflict. The remaining two discriminators and one preference question retain coherent labels, with explanatory text about neutral/unused preference evidence.
|
||||
|
||||
The original catalogue bytes remain unchanged as `synthetic-3d1-v1`. The new `synthetic-3d1-v2` explicitly selects engine version 2. IDs, all 89 option mappings, numeric weights, uncertainty flags, dimensions, groups, hypothesis mappings and completion requirements remain unchanged. Because two questions now ask more directly about a difficulty rather than hypothetical usefulness, and other wording is clarified, version 2 is a new immutable catalogue; existing investigations retain original wording and scoring/selection.
|
||||
|
||||
## Semantics and limits
|
||||
|
||||
- Direct difficulty answers support their hypothesis (+3); denying that difficulty opposes it (−3). Challenges ask whether the relevant ability already exists: yes opposes (−3), no gives only +1 support. The same-direction yes across every question is deliberately not consistent evidence.
|
||||
- Uncertainty and neutral choices add no confidence. “Both, or I’m not sure” intentionally combines ambiguity with uncertainty; it does not discriminate. Production should distinguish those concepts explicitly.
|
||||
- Clarification adds no support: different aspects removes the conflict veto only, while retaining both weighted contributions; changed understanding requires the author to revisit an answer; confirming a same-moment conflict leaves it unresolved. Free text is stored privately and never interpreted or scored.
|
||||
- Binary answers are sufficient to exercise this test mechanism; no arbitrary intermediate weight was invented. Compound challenges require both conditions for yes and allow no when either is absent. A richer production matrix should handle partial clarity separately.
|
||||
- Same-signal questions 1/2 intentionally repeat one dimension/group and cannot create independent support. Questions 3 are authored as a separate consequence/decision dimension; this is synthetic metadata, requiring substantive editorial independence validation before production use.
|
||||
- `organisation-3` previously asked whether a view would help; it now asks about difficulty reconstructing existing scene order. `next-event-3` previously asked whether a relationship change might help; it now asks whether the author needs to develop that possibility. The latter remains an intentionally narrow next-event example mapped to Relationships, not a claim that every next-event problem requires relationships.
|
||||
- No internal scoring terminology is required to answer the direct questions. Clarification now identifies the concern, though these descriptions remain test labels. Preference is recorded but does not tailor the destination in this phase; Help says so rather than implying it changes the result.
|
||||
|
||||
## Complete question/option audit
|
||||
|
||||
### motivation-1 · Discovery
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Is it hard to say what the central character wants in the moment that concerns you?
|
||||
|
||||
**Corrected:** Is it hard to say what the central character wants in the moment that concerns you?
|
||||
|
||||
Dimension(s): `motivation`. Independence group: `motivation-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I find it hard to say what they want. | motivation / motivation / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I can say what they want. | motivation / motivation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### motivation-2 · Corroboration
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** When you imagine that moment again, does the character’s reason for acting still feel unclear?
|
||||
|
||||
**Corrected:** When you imagine that moment again, does the character’s reason for acting still feel unclear?
|
||||
|
||||
Dimension(s): `motivation`. Independence group: `motivation-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, their reason still feels unclear. | motivation / motivation / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, their reason feels clear. | motivation / motivation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### motivation-3 · Discrimination
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Could several different actions fit equally well because you are unsure what matters to this character?
|
||||
|
||||
**Corrected:** Could several different actions fit equally well because you are unsure what matters to this character?
|
||||
|
||||
Dimension(s): `constraints`. Independence group: `motivation-independent-2`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I’m unsure what matters to them, so several actions seem equally plausible. | motivation / constraints / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I know what matters to them and can narrow down their actions. | motivation / constraints / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### motivation-4 · Challenge
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Can you point to a clear desire and an understandable reason behind the character’s action?
|
||||
|
||||
**Corrected:** Can you point to a clear desire and an understandable reason behind the character’s action?
|
||||
|
||||
Dimension(s): `motivation`. Independence group: `motivation-independent-3`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I can identify both their desire and their reason. | motivation / motivation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I cannot identify both clearly. | motivation / motivation / current-concern: +1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### motivation-clarify · Clarification
|
||||
|
||||
**Issue:** Repeated unspecific prompt / prerequisite mismatch.
|
||||
|
||||
**Original:** Your answers about this concern point in different directions. How should we understand that?
|
||||
|
||||
**Corrected:** Your answers about the character’s reasons for acting point in different directions. How should we understand that?
|
||||
|
||||
Dimension(s): `motivation`. Independence group: `motivation-clarification`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| aspects | I was thinking about different aspects or moments. | None | Interpretation only; no score |
|
||||
| changed | My understanding has changed; I would like to revisit an answer. | None | Interpretation only; no score |
|
||||
| conflict | Both answers still seem true for the same moment. | None | Interpretation only; no score |
|
||||
| uncertain | I’m not sure how to explain it yet. | None | Uncertain; no confidence |
|
||||
|
||||
### change-1 · Discovery
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Does the scene that concerns you leave the situation much as it was?
|
||||
|
||||
**Corrected:** Does the scene that concerns you leave the situation much as it was?
|
||||
|
||||
Dimension(s): `change`. Independence group: `change-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, the situation stays much the same. | change / change / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, the situation changes meaningfully. | change / change / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### change-2 · Corroboration
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Thinking of its ending, is the important situation still essentially unchanged?
|
||||
|
||||
**Corrected:** Thinking of its ending, is the important situation still essentially unchanged?
|
||||
|
||||
Dimension(s): `change`. Independence group: `change-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, the important situation is essentially unchanged. | change / change / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, the ending changes the important situation. | change / change / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### change-3 · Discrimination
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** If you removed this scene, would later choices remain much the same?
|
||||
|
||||
**Corrected:** If you removed this scene, would later choices remain much the same?
|
||||
|
||||
Dimension(s): `constraints`. Independence group: `change-independent-2`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, later choices would remain much the same. | change / constraints / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, removing it would change later choices. | change / constraints / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### change-4 · Challenge
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Can you name an important change caused by that scene?
|
||||
|
||||
**Corrected:** Can you name an important change caused by that scene?
|
||||
|
||||
Dimension(s): `change`. Independence group: `change-independent-3`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I can name an important change it causes. | change / change / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I cannot name an important change it causes. | change / change / current-concern: +1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### change-clarify · Clarification
|
||||
|
||||
**Issue:** Repeated unspecific prompt / prerequisite mismatch.
|
||||
|
||||
**Original:** Your answers about this concern point in different directions. How should we understand that?
|
||||
|
||||
**Corrected:** Your answers about how the scene changes the situation point in different directions. How should we understand that?
|
||||
|
||||
Dimension(s): `change`. Independence group: `change-clarification`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| aspects | I was thinking about different aspects or moments. | None | Interpretation only; no score |
|
||||
| changed | My understanding has changed; I would like to revisit an answer. | None | Interpretation only; no score |
|
||||
| conflict | Both answers still seem true for the same moment. | None | Interpretation only; no score |
|
||||
| uncertain | I’m not sure how to explain it yet. | None | Uncertain; no confidence |
|
||||
|
||||
### connections-1 · Discovery
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Do important events seem to happen without depending on earlier choices?
|
||||
|
||||
**Corrected:** Do important events seem to happen without depending on earlier choices?
|
||||
|
||||
Dimension(s): `causality`. Independence group: `connections-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, important events seem disconnected from earlier choices. | connections / causality / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, important events depend on earlier choices. | connections / causality / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### connections-2 · Corroboration
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Looking again at the troublesome event, is its link to what came before hard to identify?
|
||||
|
||||
**Corrected:** Looking again at the troublesome event, is its link to what came before hard to identify?
|
||||
|
||||
Dimension(s): `causality`. Independence group: `connections-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, its connection to earlier events is hard to identify. | connections / causality / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I can identify that connection. | connections / causality / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### connections-3 · Discrimination
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Could you rearrange these events without affecting what follows?
|
||||
|
||||
**Corrected:** Could you rearrange these events without affecting what follows?
|
||||
|
||||
Dimension(s): `constraints`. Independence group: `connections-independent-2`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I could rearrange them without affecting what follows. | connections / constraints / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, rearranging them would affect what follows. | connections / constraints / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### connections-4 · Challenge
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Can you describe a clear chain from a choice to its consequence?
|
||||
|
||||
**Corrected:** Can you describe a clear chain from a choice to its consequence?
|
||||
|
||||
Dimension(s): `causality`. Independence group: `connections-independent-3`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I can describe that chain. | connections / causality / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I cannot describe a clear chain. | connections / causality / current-concern: +1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### connections-clarify · Clarification
|
||||
|
||||
**Issue:** Repeated unspecific prompt / prerequisite mismatch.
|
||||
|
||||
**Original:** Your answers about this concern point in different directions. How should we understand that?
|
||||
|
||||
**Corrected:** Your answers about the connections between events point in different directions. How should we understand that?
|
||||
|
||||
Dimension(s): `causality`. Independence group: `connections-clarification`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| aspects | I was thinking about different aspects or moments. | None | Interpretation only; no score |
|
||||
| changed | My understanding has changed; I would like to revisit an answer. | None | Interpretation only; no score |
|
||||
| conflict | Both answers still seem true for the same moment. | None | Interpretation only; no score |
|
||||
| uncertain | I’m not sure how to explain it yet. | None | Uncertain; no confidence |
|
||||
|
||||
### organisation-1 · Discovery
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Do you lose track of information you have already decided?
|
||||
|
||||
**Corrected:** Do you lose track of information you have already decided?
|
||||
|
||||
Dimension(s): `organisation`. Independence group: `organisation-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I lose track of decisions I have already made. | organisation / organisation / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I can keep track of those decisions. | organisation / organisation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### organisation-2 · Corroboration
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** When returning to the story, is finding those existing decisions still difficult?
|
||||
|
||||
**Corrected:** When returning to the story, is finding those existing decisions still difficult?
|
||||
|
||||
Dimension(s): `organisation`. Independence group: `organisation-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, finding those decisions is still difficult. | organisation / organisation / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I can find those decisions easily. | organisation / organisation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### organisation-3 · Discrimination
|
||||
|
||||
**Issue:** Generic labels / polarity obscured; hypothetical usefulness vs difficulty clarified in new version.
|
||||
|
||||
**Original:** Would seeing the order of your existing scenes help more than inventing something new?
|
||||
|
||||
**Corrected:** Is your difficulty working out the order of existing scenes, rather than inventing something new?
|
||||
|
||||
Dimension(s): `constraints`. Independence group: `organisation-independent-2`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, working out the existing scene order is my difficulty. | organisation / constraints / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, working out the existing scene order is not my difficulty. | organisation / constraints / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### organisation-4 · Challenge
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Can you easily find the existing facts and event order that you need?
|
||||
|
||||
**Corrected:** Can you easily find the existing facts and event order that you need?
|
||||
|
||||
Dimension(s): `organisation`. Independence group: `organisation-independent-3`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I can find both the facts and the event order. | organisation / organisation / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I cannot easily find everything I need. | organisation / organisation / current-concern: +1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### organisation-clarify · Clarification
|
||||
|
||||
**Issue:** Repeated unspecific prompt / prerequisite mismatch.
|
||||
|
||||
**Original:** Your answers about this concern point in different directions. How should we understand that?
|
||||
|
||||
**Corrected:** Your answers about finding existing story information point in different directions. How should we understand that?
|
||||
|
||||
Dimension(s): `organisation`. Independence group: `organisation-clarification`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| aspects | I was thinking about different aspects or moments. | None | Interpretation only; no score |
|
||||
| changed | My understanding has changed; I would like to revisit an answer. | None | Interpretation only; no score |
|
||||
| conflict | Both answers still seem true for the same moment. | None | Interpretation only; no score |
|
||||
| uncertain | I’m not sure how to explain it yet. | None | Uncertain; no confidence |
|
||||
|
||||
### next-event-1 · Discovery
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Do you have several possible next events without a clear way to choose?
|
||||
|
||||
**Corrected:** Do you have several possible next events without a clear way to choose?
|
||||
|
||||
Dimension(s): `options`. Independence group: `next-event-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I have several possibilities and cannot choose between them. | next-event / options / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, that is not my difficulty. | next-event / options / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### next-event-2 · Corroboration
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Are you still uncertain which possible event to develop next?
|
||||
|
||||
**Corrected:** Are you still uncertain which possible event to develop next?
|
||||
|
||||
Dimension(s): `options`. Independence group: `next-event-same-signal`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I am still unsure which event to develop. | next-event / options / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I know which event to develop. | next-event / options / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### next-event-3 · Discrimination
|
||||
|
||||
**Issue:** Generic labels / polarity obscured; hypothetical usefulness vs difficulty clarified in new version.
|
||||
|
||||
**Original:** Might a change in an existing relationship give you a useful next possibility?
|
||||
|
||||
**Corrected:** Do you need to work out how a change in an existing relationship could create the next event?
|
||||
|
||||
Dimension(s): `constraints`. Independence group: `next-event-independent-2`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I need to develop that possibility. | next-event / constraints / current-concern: +3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I do not need to develop that possibility. | next-event / constraints / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### next-event-4 · Challenge
|
||||
|
||||
**Issue:** Generic labels / polarity obscured.
|
||||
|
||||
**Original:** Can you already identify a next event that follows naturally from an existing choice?
|
||||
|
||||
**Corrected:** Can you already identify a next event that follows naturally from an existing choice?
|
||||
|
||||
Dimension(s): `options`. Independence group: `next-event-independent-3`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| yes | Yes, I can identify an event that follows from an existing choice. | next-event / options / current-concern: -3 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| no | No, I cannot identify one yet. | next-event / options / current-concern: +1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | I’m not sure. | None | Uncertain; no confidence |
|
||||
|
||||
### next-event-clarify · Clarification
|
||||
|
||||
**Issue:** Repeated unspecific prompt / prerequisite mismatch.
|
||||
|
||||
**Original:** Your answers about this concern point in different directions. How should we understand that?
|
||||
|
||||
**Corrected:** Your answers about choosing the next event point in different directions. How should we understand that?
|
||||
|
||||
Dimension(s): `options`. Independence group: `next-event-clarification`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| aspects | I was thinking about different aspects or moments. | None | Interpretation only; no score |
|
||||
| changed | My understanding has changed; I would like to revisit an answer. | None | Interpretation only; no score |
|
||||
| conflict | Both answers still seem true for the same moment. | None | Interpretation only; no score |
|
||||
| uncertain | I’m not sure how to explain it yet. | None | Uncertain; no confidence |
|
||||
|
||||
### distinguish-action · Discrimination
|
||||
|
||||
**Issue:** Combined both/uncertainty (neutral; retained).
|
||||
|
||||
**Original:** Which feels closer to what is troubling you?
|
||||
|
||||
**Corrected:** Which feels closer to what is troubling you?
|
||||
|
||||
Dimension(s): `motivation, change`. Independence group: `distinguish-action`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| first | Understanding the reason behind a choice. | motivation / motivation / current-concern: +2, change / change / current-concern: -1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| second | Seeing what the scene changes. | motivation / motivation / current-concern: -1, change / change / current-concern: +2 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | Both, or I’m not sure yet. | None | Uncertain; no confidence |
|
||||
|
||||
### distinguish-shape · Discrimination
|
||||
|
||||
**Issue:** Combined both/uncertainty (neutral; retained).
|
||||
|
||||
**Original:** Which would help you most right now?
|
||||
|
||||
**Corrected:** Which would help you most right now?
|
||||
|
||||
Dimension(s): `organisation, causality`. Independence group: `distinguish-shape`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| first | Finding the information I have already decided. | organisation / organisation / current-concern: +2, connections / causality / current-concern: -1 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| second | Connecting one event to another. | organisation / organisation / current-concern: -1, connections / causality / current-concern: +2 | Matches explicit difficulty/ability polarity; synthetic magnitude unchanged |
|
||||
| unsure | Both, or I’m not sure yet. | None | Uncertain; no confidence |
|
||||
|
||||
### action-preference · ActionPreference
|
||||
|
||||
**Issue:** Preference has no diagnostic effects (explicitly explained).
|
||||
|
||||
**Original:** How would you prefer to work on the concern?
|
||||
|
||||
**Corrected:** How would you prefer to work on the concern?
|
||||
|
||||
Dimension(s): `options`. Independence group: `preference`.
|
||||
|
||||
| Stable option ID | Corrected answer | Actual evidence | Semantic check |
|
||||
|---|---|---|---|
|
||||
| existing | Look through what I have already recorded. | None | No diagnostic contribution |
|
||||
| develop | Develop a new possibility. | None | No diagnostic contribution |
|
||||
| unsure | I’m not sure yet. | None | Uncertain; no confidence |
|
||||
|
||||
## Acceptance and remaining editorial work
|
||||
|
||||
Automated comparison verifies identical IDs, contribution arrays and uncertainty/interpretation flags in both catalogues. The reachability report proves that actual selected answer paths yield distinct supported, ambiguous, tentative, conflicting, insufficient and unavailable states. Browser acceptance verifies rendered labels, answer revision and save/resume.
|
||||
|
||||
This does not validate literary diagnosis, statistical calibration or production-quality independence. Production wording, intermediate answers, author terminology, larger capability mappings and externally reviewed editorial validity remain separately approved work. No production matrix was generated.
|
||||
149
Docs/Writer/Investigations/Synthetic-Reachability-Matrix.md
Normal file
149
Docs/Writer/Investigations/Synthetic-Reachability-Matrix.md
Normal file
@ -0,0 +1,149 @@
|
||||
# Synthetic recommendation reachability
|
||||
|
||||
17 November 2026 · Phase 3D.1A corrective diagnostic audit. Development synthetic content only.
|
||||
|
||||
## Method and bounds
|
||||
|
||||
The current production evaluator was called after every answer. Each next question is the actual `NextQuestion`, and every selected option is an actual catalogue ID. No forced presentation, fabricated evidence or bypass of completion checks was used for these witnesses. Deterministic targeted choice maximises the target’s authored evidence and discourages competing positive contributions; it selects explicit different-aspect clarification where offered. This is a reachability witness, not advice that authors should answer that way.
|
||||
|
||||
All four concerns × five hypotheses are individually asserted. The baseline already reaches all 20 pairs; the original 228-path aggregate assertion was correct about global reachability but did not assert every pair. These bounded selected paths prove existence, not exhaustive enumeration or editorial validity. “Score” includes the concern prior; qualification uses net support minus opposition, excluding that prior. Independent dimensions and corroboration groups are reported separately. Group independence is authored metadata, not proof of real-world statistical independence.
|
||||
|
||||
Requirements remain: at least 8 answers (maximum 12), net evidence ≥4, ≥2 distinct positive dimensions, ≥2 positive groups, a non-uncertain relevant challenge, an examined competing explanation, no unresolved material same-aspect conflict and an eligible destination. All 20 baseline and corrected witnesses satisfy them. No weights or thresholds changed.
|
||||
|
||||
## Reachability matrix
|
||||
|
||||
| Concern | Hypothesis | Capability | Baseline questions / score | Corrected questions / net / score | Dimensions / groups | Eligible | Final |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| story | motivation | characters | 9 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| story | change | write | 8 / 7 | 8 / 6 / 7 | 2 / 4 | True | Supported recommendation |
|
||||
| story | connections | threads | 8 / 7 | 8 / 6 / 7 | 2 / 4 | True | Supported recommendation |
|
||||
| story | organisation | timeline | 9 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| story | next-event | relationships | 11 / 6 | 8 / 6 / 6 | 2 / 3 | True | Supported recommendation |
|
||||
| character | motivation | characters | 8 / 8 | 8 / 6 / 8 | 2 / 4 | True | Supported recommendation |
|
||||
| character | change | write | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| character | connections | threads | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| character | organisation | timeline | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| character | next-event | relationships | 10 / 6 | 8 / 6 / 6 | 2 / 3 | True | Supported recommendation |
|
||||
| next | motivation | characters | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| next | change | write | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| next | connections | threads | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| next | organisation | timeline | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| next | next-event | relationships | 8 / 8 | 8 / 6 / 8 | 2 / 3 | True | Supported recommendation |
|
||||
| track | motivation | characters | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| track | change | write | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| track | connections | threads | 8 / 6 | 8 / 6 / 6 | 2 / 4 | True | Supported recommendation |
|
||||
| track | organisation | timeline | 8 / 8 | 8 / 6 / 8 | 2 / 4 | True | Supported recommendation |
|
||||
| track | next-event | relationships | 11 / 6 | 8 / 6 / 6 | 2 / 3 | True | Supported recommendation |
|
||||
|
||||
## Exact corrected answer paths
|
||||
|
||||
### story → motivation
|
||||
|
||||
`change-1=no → connections-1=no → motivation-1=yes → next-event-1=no → organisation-1=no → distinguish-action=first → motivation-3=yes → motivation-4=no`
|
||||
|
||||
### story → change
|
||||
|
||||
`change-1=yes → connections-1=no → motivation-1=no → next-event-1=no → organisation-1=no → change-3=yes → change-4=no → distinguish-action=second`
|
||||
|
||||
### story → connections
|
||||
|
||||
`change-1=no → connections-1=yes → motivation-1=no → next-event-1=no → organisation-1=no → connections-3=yes → connections-4=no → distinguish-shape=second`
|
||||
|
||||
### story → organisation
|
||||
|
||||
`change-1=no → connections-1=no → motivation-1=no → next-event-1=no → organisation-1=yes → distinguish-shape=first → organisation-3=yes → organisation-4=no`
|
||||
|
||||
### story → next-event
|
||||
|
||||
`change-1=no → connections-1=no → motivation-1=no → next-event-1=yes → organisation-1=no → next-event-3=yes → next-event-4=no → next-event-2=yes`
|
||||
|
||||
### character → motivation
|
||||
|
||||
`motivation-1=yes → change-1=no → connections-1=no → next-event-1=no → organisation-1=no → distinguish-action=first → motivation-3=yes → motivation-4=no`
|
||||
|
||||
### character → change
|
||||
|
||||
`motivation-1=no → change-1=yes → connections-1=no → next-event-1=no → organisation-1=no → change-3=yes → change-4=no → distinguish-action=second`
|
||||
|
||||
### character → connections
|
||||
|
||||
`motivation-1=no → change-1=no → connections-1=yes → next-event-1=no → organisation-1=no → connections-3=yes → connections-4=no → distinguish-shape=second`
|
||||
|
||||
### character → organisation
|
||||
|
||||
`motivation-1=no → change-1=no → connections-1=no → next-event-1=no → organisation-1=yes → distinguish-shape=first → organisation-3=yes → organisation-4=no`
|
||||
|
||||
### character → next-event
|
||||
|
||||
`motivation-1=no → change-1=no → connections-1=no → next-event-1=yes → organisation-1=no → next-event-3=yes → next-event-4=no → next-event-2=yes`
|
||||
|
||||
### next → motivation
|
||||
|
||||
`next-event-1=no → change-1=no → connections-1=no → motivation-1=yes → organisation-1=no → distinguish-action=first → motivation-3=yes → motivation-4=no`
|
||||
|
||||
### next → change
|
||||
|
||||
`next-event-1=no → change-1=yes → connections-1=no → motivation-1=no → organisation-1=no → change-3=yes → change-4=no → distinguish-action=second`
|
||||
|
||||
### next → connections
|
||||
|
||||
`next-event-1=no → change-1=no → connections-1=yes → motivation-1=no → organisation-1=no → connections-3=yes → connections-4=no → distinguish-shape=second`
|
||||
|
||||
### next → organisation
|
||||
|
||||
`next-event-1=no → change-1=no → connections-1=no → motivation-1=no → organisation-1=yes → distinguish-shape=first → organisation-3=yes → organisation-4=no`
|
||||
|
||||
### next → next-event
|
||||
|
||||
`next-event-1=yes → change-1=no → connections-1=no → motivation-1=no → organisation-1=no → next-event-3=yes → next-event-4=no → next-event-2=yes`
|
||||
|
||||
### track → motivation
|
||||
|
||||
`organisation-1=no → change-1=no → connections-1=no → motivation-1=yes → next-event-1=no → distinguish-action=first → motivation-3=yes → motivation-4=no`
|
||||
|
||||
### track → change
|
||||
|
||||
`organisation-1=no → change-1=yes → connections-1=no → motivation-1=no → next-event-1=no → change-3=yes → change-4=no → distinguish-action=second`
|
||||
|
||||
### track → connections
|
||||
|
||||
`organisation-1=no → change-1=no → connections-1=yes → motivation-1=no → next-event-1=no → connections-3=yes → connections-4=no → distinguish-shape=second`
|
||||
|
||||
### track → organisation
|
||||
|
||||
`organisation-1=yes → change-1=no → connections-1=no → motivation-1=no → next-event-1=no → distinguish-shape=first → organisation-3=yes → organisation-4=no`
|
||||
|
||||
### track → next-event
|
||||
|
||||
`organisation-1=no → change-1=no → connections-1=no → motivation-1=no → next-event-1=yes → next-event-3=yes → next-event-4=no → next-event-2=yes`
|
||||
|
||||
## Representative adversarial and boundary outcomes (story concern)
|
||||
|
||||
| Pattern | Before | After | Corrected recommendations |
|
||||
|---|---|---|---|
|
||||
| all-yes | Two plausible explanations | Two plausible explanations | None |
|
||||
| all-no | Two plausible explanations | Conflicting evidence | None |
|
||||
| uncertain | More information needed | More information needed | None |
|
||||
| alternating | Two plausible explanations | Supported recommendation | change |
|
||||
| moderate | Supported recommendation | Supported recommendation | motivation |
|
||||
| weak | More information needed | More information needed | None |
|
||||
| competing | Supported recommendation | Two plausible explanations | change, motivation |
|
||||
| correlated | More information needed | Tentative conclusion | None |
|
||||
| unavailable | No suitable destination currently available | No suitable destination currently available | None |
|
||||
|
||||
“All-yes/all-no” means the first/second available option at every selected question, including discriminators and clarification. It is deliberately adversarial and not a consistent endorsement/denial of a hypothesis. Challenges reverse polarity. “Moderate” omits direct discovery evidence but can still accumulate strong enough independent evidence through other answers; its recommendation is justified by actual thresholds, not its scenario name. “Correlated” supports only discovery/repeated same-signal motivation questions and cannot qualify.
|
||||
|
||||
Revisions replace the target’s previous positive direct answers with their negative options and recompute. They remove the original recommendation and usually resume questioning. Revision examples retain the exact original presented path; the private live UI and repository tests additionally verify the normal revision/save lifecycle.
|
||||
|
||||
An unavailable-capability path has identical diagnostic scores/coverage/support to its available equivalent and no usable recommendation. Invalid mappings/catalogue versions are rejected at import; they are not silently classified as insufficient evidence. No synthetic hypothesis has a missing mapping in the accepted catalogue.
|
||||
|
||||
## Machine evidence and replay
|
||||
|
||||
- `../Writer3/Evidence/Phase3D1A/baseline-simulation.json`: original 228-path existing simulator output.
|
||||
- `../Writer3/Evidence/Phase3D1A/baseline-traces.json.gz`: 76 targeted/adversarial/revision baseline paths and per-state private-equivalent traces.
|
||||
- `../Writer3/Evidence/Phase3D1A/after-traces.json.gz`: same 76 deterministic scenario definitions against version 2, including question order, options/contributions, ranks/exclusions, independence groups, thresholds, mappings, eligibility and stopping reasons.
|
||||
- `InvestigationDiagnosticTests.Run`: all 20 corrected selected witnesses, all captured legacy states replayed against unchanged legacy semantics, non-confidence, revision, private resume and adaptive selection.
|
||||
|
||||
To reproduce: `dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj -- --writer-investigation-diagnostics --acceptance Docs/Writer/Investigations/synthetic-catalogue-v2.json /tmp/after-traces.json`. Use `synthetic-catalogue.json` for the legacy export without `--acceptance` if inspecting only the legacy paths. Compressed files contain synthetic answers only.
|
||||
|
||||
No map is claimed reachable merely because an ID exists. All five are demonstrated by selected paths; actual authenticated Development acceptance additionally verifies their scoped redirect entry points. Tool domain usefulness is still a production editorial task, especially the narrowly relationship-based next-event example.
|
||||
1659
Docs/Writer/Investigations/synthetic-catalogue-v2.json
Normal file
1659
Docs/Writer/Investigations/synthetic-catalogue-v2.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Docs/Writer/Writer3/Evidence/Phase3D1A/after-traces.json.gz
Normal file
BIN
Docs/Writer/Writer3/Evidence/Phase3D1A/after-traces.json.gz
Normal file
Binary file not shown.
3183
Docs/Writer/Writer3/Evidence/Phase3D1A/baseline-simulation.json
Normal file
3183
Docs/Writer/Writer3/Evidence/Phase3D1A/baseline-simulation.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Docs/Writer/Writer3/Evidence/Phase3D1A/baseline-traces.json.gz
Normal file
BIN
Docs/Writer/Writer3/Evidence/Phase3D1A/baseline-traces.json.gz
Normal file
Binary file not shown.
31
Docs/Writer/Writer3/Evidence/Phase3D1A/summary.json
Normal file
31
Docs/Writer/Writer3/Evidence/Phase3D1A/summary.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"baselineCatalogue": "synthetic-3d1-v1",
|
||||
"correctedCatalogue": "synthetic-3d1-v2",
|
||||
"questions": 28,
|
||||
"options": 89,
|
||||
"beforeStates": 633,
|
||||
"afterStates": 630,
|
||||
"beforePaths": 76,
|
||||
"afterPaths": 76,
|
||||
"positiveWitnesses": 20,
|
||||
"beforeOutcomes": {
|
||||
"Supported recommendation": 28,
|
||||
"Investigating": 20,
|
||||
"Two plausible explanations": 12,
|
||||
"More information needed": 12,
|
||||
"No suitable destination currently available": 4
|
||||
},
|
||||
"afterOutcomes": {
|
||||
"Supported recommendation": 26,
|
||||
"Investigating": 20,
|
||||
"Two plausible explanations": 5,
|
||||
"Conflicting evidence": 8,
|
||||
"More information needed": 7,
|
||||
"Tentative conclusion": 6,
|
||||
"No suitable destination currently available": 4
|
||||
},
|
||||
"weightsChanged": false,
|
||||
"thresholdsChanged": false,
|
||||
"readinessImplemented": false
|
||||
}
|
||||
74
Docs/Writer/Writer3/Phase3D1A-Diagnostic-Report.md
Normal file
74
Docs/Writer/Writer3/Phase3D1A-Diagnostic-Report.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Phase 3D.1A — Guided Investigation diagnostic correction
|
||||
|
||||
17 November 2026. This is the corrective diagnostic audit following the deployed Phase 3D.1 foundation, separate from the original architecture batch with a similar label. Shared branch `codex/word-companion-native-phase1-20261104`; audit baseline `be459d2`, deployed application baseline `62fa292`. Phase 3D.2A exports remain untouched. No Phase 3D.2B implementation, dependency/readiness planner, AI interpretation or production question matrix was introduced.
|
||||
|
||||
## Proven original behaviour and causes
|
||||
|
||||
The engine was **not universally unable to recommend**. Before correction, the existing simulator passed 228 representative paths / 2,560 answers, and targeted real-evaluator paths demonstrated all 20 concern–hypothesis pairs and all five destination mappings. The original full application harness and original authenticated Development recommendation workflow also passed. No missing mapping or unavailable-capability configuration was necessary to explain the reported symptom.
|
||||
|
||||
The reported repeated response was nevertheless reproducible. First/second-option, uncertain and alternating patterns reached the 12-question safety limit with different underlying states, while the Razor result used the same generic paragraph whenever `Recommendations.Count == 0`. Even its “Two plausible explanations” terminal label could have no supported recommendations: the legacy exhaustion rule counted raw positive support without net evidence or conflicts. The author could not distinguish that from genuine uncertainty or unavailable tools.
|
||||
|
||||
Three concrete contributing problems were established:
|
||||
|
||||
1. **Selection prioritised declarations rather than substantive effects.** At the empty `story` state, both challenge questions ranked 21, the zero-evidence action preference ranked 16, and the leading discovery questions ranked 7. Priors activated challenge/corroboration bonuses before supporting answers existed. Preference declared five hypotheses and bought five “dimension gaps” despite contributing no evidence. Uncertain/neutral contributions also marked coverage. This wasted the small question budget and made manual interpretation difficult.
|
||||
2. **Reverse direction was hidden by generic labels.** Twenty questions reused “Yes, that describes it” / “No, that does not describe it”, including “Can you…” questions. Direct difficulty yes contributes +3; challenge yes contributes −3 because it confirms the ability is already present. All-yes is therefore conflicting/disconfirming evidence, not strong coherent support. No reversed contribution bug was found: the labels and ordering made the existing polarity difficult to see.
|
||||
3. **Clarification and terminal presentation were too coarse.** All five clarification prompts were identical and required both same-signal questions even when the material conflict came from discovery versus challenge. The author view collapsed weak evidence, opposition, conflict, ambiguity and unavailable tools into the reported sentence. A close rival could also be left short of a useful examination when another hypothesis first qualified.
|
||||
|
||||
There was no evidence that persistence retained superseded scoring contributions or that destination availability changed numeric diagnostic evidence. Those invariants were preserved and regression-qualified.
|
||||
|
||||
## Corrections
|
||||
|
||||
A new immutable `synthetic-3d1-v2` catalogue opts into `EngineVersion: 2`. The original `synthetic-3d1-v1` bytes and evaluator remain unchanged. An omitted engine version means legacy mode (`0`); unsupported versions fail validation. Old investigations continue to use their bound catalogue, original labels, question sequence and evaluation semantics. Their author-safe conclusion presentation becomes clearer without changing recorded evidence. Authors can start another investigation to use the corrected preview; no history is silently upgraded or overwritten.
|
||||
|
||||
Version 2 selects from actual non-uncertain, nonzero option contributions, rewards uncovered substantive dimensions and discovery, and gives challenge priority only after positive multi-dimensional support. Repeated same-signal corroboration gets no independence-gap bonus. Questions remain dynamically ranked with ordinal ID tie-breaking. Clarification is eligible only when its relevant material conflict exists; its catalogue prerequisite no longer demands redundant questions. Lower initial priority does not prevent selection when later evidence makes a challenge or clarification important.
|
||||
|
||||
Before stopping with a supported result, a positively supported rival is allowed a useful remaining question if its potential authored positive contribution could bring it into the existing two-point recommendation band. This is a conservative deterministic bound, not entropy or statistical information gain. A remaining close rival can therefore receive its discrimination/challenge opportunity; the representative story competing path now reaches two supported explanations after 10 answers rather than choosing just one after 9 in the baseline. Safety bounds remain 8–12; a genuinely unresolved investigation is allowed to end without a recommendation.
|
||||
|
||||
**No evidence weights, independence aggregation, coverage/corroboration requirements, challenge requirements, minimum/maximum lengths or confidence thresholds were weakened or changed.** Strongest-sign-per-dimension/group and ±3 dimension caps remain authoritative. Concern priors influence selection/ordering, never the net-evidence qualification threshold. Different-aspect clarification clears only the conflict veto and retains both support and opposition. Readiness/preparation does not enter scoring.
|
||||
|
||||
The author result now distinguishes supported next steps, tentative possibilities, competing possibilities, conflicting answers, no clear direction and unavailable tools, without numeric scores or internal terminology. Tentative results do not expose unsupported tool actions. The question limit and safe next actions are explained. Technical/configuration/persistence errors remain explicit HTTP error paths rather than invented diagnoses.
|
||||
|
||||
Twenty questions have specific yes/no labels. Five clarification prompts identify the concern; explanatory text clarifies uncertainty, reversal and neutral preference. Two questions now directly ask about the relevant difficulty rather than hypothetical usefulness, justifying publication as a new version even though IDs/weights remain stable. All 28 questions and 89 options are audited in [Question-Quality-Audit](../Investigations/Question-Quality-Audit.md). This remains synthetic mechanism content.
|
||||
|
||||
## Diagnostic tooling and evidence
|
||||
|
||||
`InvestigationDiagnostics.Trace` projects the real evaluation: concern priors; per-state selected answers/options; positive/negative/neutral contributions; groups and redundancy; scores/coverage/conflicts; ranked candidates and excluded questions; thresholds; destination mappings/eligibility; stopping limit/exhaustion and conclusion blockers. The admin simulator and JSON diagnostics expose it only through existing Development-gated AdminOnly routes with author/book ownership checks. Administrators cannot read another author’s private investigations. Historical events retain their original evaluation shape; the new trace is computed separately and not appended to legacy payloads.
|
||||
|
||||
The test harness exports 76 deterministic representative/adversarial/revision paths before and after, with 633 baseline states and 630 corrected states. Full compressed synthetic-only JSON and summary are in `Evidence/Phase3D1A/`. No credentials, real author answers or manuscript content are exported. [Synthetic-Reachability-Matrix](../Investigations/Synthetic-Reachability-Matrix.md) contains every positive witness and its score, distinct dimensions/groups, capability and exact option path.
|
||||
|
||||
Representative `story` outcomes:
|
||||
|
||||
| Pattern | Before | Corrected |
|
||||
|---|---|---|
|
||||
| Each targeted strong hypothesis | Supported, all five reachable | Supported, all five reachable in 8 answers |
|
||||
| Moderate but consistent | Supported after enough substantive evidence | Supported after enough substantive evidence |
|
||||
| All uncertain / weak | No recommendations, generic message | No clear direction; no recommendations |
|
||||
| First option throughout | Unqualified “Two plausible explanations”, generic message | Ambiguous, no unsupported tools |
|
||||
| Second option throughout | Unqualified “Two plausible explanations”, generic message | Conflicting answers, no unsupported tools |
|
||||
| Correlated motivation evidence only | More information needed, generic message | Tentative possibility, no unsupported tools |
|
||||
| Competing motivation/change | One supported result after 9 baseline answers | Two supported results after 10 answers |
|
||||
| Destination unavailable | No suitable destination, generic message plus availability line | Explicit relevant-area/unavailable-tool explanation |
|
||||
| Target’s positive answers revised | Original recommendation removed | Original recommendation removed; further questions retained |
|
||||
|
||||
Pattern labels are not diagnoses: “moderate” can accumulate enough independently supported evidence to qualify, and alternating raw options can form a coherent supported answer pattern. Results are assessed against actual contributions, not arbitrary scenario names.
|
||||
|
||||
## Automated qualification
|
||||
|
||||
- `dotnet build PlotLine.slnx`: succeeds, zero warnings/errors.
|
||||
- `dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj`: succeeds; 603 PASS records (including diagnostic acceptance output), existing public Problem Solver and Word/Writer regressions green.
|
||||
- Existing legacy simulator: 228 paths / 2,560 answers; no loops, repeated questions, premature recommendations, invalid destinations or non-deterministic replay.
|
||||
- Corrective acceptance: all 20 actual selected positive witnesses; five distinct destinations; unchanged option IDs/effects and thresholds; exact replay of all 633 captured legacy states; dynamic divergence; genuine conflict clarification; correlated/uncertain non-confidence; unavailable destinations without rescoring; answer revision; private memory persistence/resume; cross-user/book denial; safe exhaustion; two supported competing results and refusal to terminate before a useful rival question.
|
||||
- Isolated real MVC/Razor browser and simulated PWA: 20 runs cover five recommendations, uncertainty, conflict, correlation, first-option and competing patterns; per-path save/resume, scoped redirects, cross-user/book isolation, admin trace/replay, revision and narrow overflow. Existing legacy authenticated Development browser/PWA workflow passes before rollout, including CSRF400, stale409 and Help.
|
||||
- Existing catalogue and Phase 3D.2A machine-readable audit exports preserved. No Windows/Office binaries changed. Browser checks reject inference-provider requests; the evaluator/trace remain pure, with no external inference service.
|
||||
|
||||
## Development deployment and acceptance
|
||||
|
||||
Pending final rollout and authenticated corrected-catalogue acceptance. This section is updated in the reporting commit after verification. No schema migration is required: the existing immutable catalogue publication procedure stores the new JSON version. A verified copy-only/checksum Development backup was taken before fixtures/publication.
|
||||
|
||||
## Remaining limitations and review boundary
|
||||
|
||||
These are bounded selected witnesses, not exhaustive enumeration of 3–5 choices across all possible states or production editorial validation. Independence groups and synthetic numeric weights remain authored test assumptions. The five destinations are the original narrow adapters; particularly next-event→Relationships is a deliberately narrow test example. Preference is recorded but does not tailor the tool. Uncertain and “both” remain combined neutral discriminator answers. Free text is not interpreted. Conflict/different-aspect handling retains a single current answer per question; the author must revise answers when understanding changes. A conservative rival bound can use remaining budget; a hard maximum can still end with useful unanswered questions, which diagnostics explicitly show.
|
||||
|
||||
Legacy investigations deliberately retain their legacy selection behaviour for reproducible history. The catalogue is Development only; recommendations are not production writing guidance. Physical Windows, Office, installed PWA and screen-reader acceptance are outside this correction; responsive browser/simulated PWA and semantic controls were checked. Public Problem Solver source, routes/content/SEO, Word Companion source/binaries, accepted manuscript data and Phase 3D.2A exports are preserved.
|
||||
|
||||
The questionnaire appeared to give the same answer because **different inconclusive states shared one result paragraph, while misleading labels and poor early question priorities made those states easy to reach**. Supported recommendations were already reachable; the correction makes coherent paths easier to follow and explains the actual outcome. Stop for review before Phase 3D.2B.
|
||||
37
PlotLine.Tests/Browser/writer3-investigation-diagnostics.cjs
Normal file
37
PlotLine.Tests/Browser/writer3-investigation-diagnostics.cjs
Normal file
@ -0,0 +1,37 @@
|
||||
// Actual rendered MVC experience; uses exported engine witnesses, never client-side scoring.
|
||||
const {chromium}=require('playwright'),fs=require('fs'),assert=require('node:assert/strict');
|
||||
const base=process.env.PD_INV_BASE||'http://127.0.0.1:5238';
|
||||
const identity=process.env.PD_INV_IDENTITY?JSON.parse(fs.readFileSync(process.env.PD_INV_IDENTITY)):null;
|
||||
const w=identity||{UserID:4,book:12,other:13,project:7};
|
||||
const report=JSON.parse(fs.readFileSync(process.env.PD_INV_TRACE||'/tmp/plotdirector-3d1a-after-traces.json'));
|
||||
const wanted=['motivation','change','connections','organisation','next-event','uncertain','all-no','correlated','all-yes','competing'];
|
||||
(async()=>{const browser=await chromium.launch();try{for(const pwa of[false,true]){
|
||||
const c=await browser.newContext({viewport:{width:pwa?390:1440,height:pwa?844:1000}});await c.addInitScript(({u,pwa})=>{localStorage.setItem('plotdirector.desktop.v1.'+u,JSON.stringify({dismissedAt:Date.now()}));if(pwa)Object.defineProperty(navigator,'standalone',{value:true});},{u:w.UserID,pwa});
|
||||
const p=await c.newPage(),errors=[],external=[];p.on('pageerror',e=>errors.push(e.message));p.on('request',r=>{if(/openai|anthropic|inference|generativelanguage/i.test(r.url()))external.push(r.url());});
|
||||
if(identity){await p.goto(base+'/Account/Login');await p.locator('[name=Email]').fill(w.Email);await p.locator('[name=Password]').fill(w.Password);await Promise.all([p.waitForURL('**/Projects'),p.locator('button[type=submit]').click()]);}
|
||||
for(const target of wanted){
|
||||
const witness=report.paths.find(x=>x.concern==='story'&&x.target===target);assert(witness);
|
||||
await p.goto(`${base}/Writer/Explore/Investigate?bookId=${w.book}`);await p.locator('[name=concern][value=story]').check();await p.getByRole('button',{name:'Begin',exact:true}).click();const url=p.url(),id=new URL(url).searchParams.get('id');
|
||||
for(let i=0;i<witness.answers.length;i++){
|
||||
const a=witness.answers[i],form=p.locator('[data-investigation-answer]');assert.equal(await form.locator('[name=question]').inputValue(),a.Question,target+' selected question');
|
||||
await form.locator(`[name=option][value="${a.Option}"]`).check();
|
||||
if(i===1){await form.locator('[name=explanation]').fill('Disposable diagnostic acceptance answer');await form.locator('button[value=save]').click();await p.goto(`${base}/Writer/Explore/Investigate?bookId=${w.book}`);await p.locator(`aside a[href*="${id}"]`).click();}
|
||||
else await form.locator('button[value=answer]').click();
|
||||
}
|
||||
assert.equal(await p.locator('[data-investigation-answer]').count(),0,target+' terminal');const kind=await p.locator('#investigation-question').getAttribute('data-conclusion');
|
||||
if(witness.final.Recommendations.length){assert.equal(kind,'supported');const form=p.locator('form[action$="/Open"]').first();const data=await form.evaluate(f=>Object.fromEntries(new FormData(f)));data.capability=await form.locator('[name=capability]').getAttribute('value');const r=await p.request.post(base+'/Writer/Explore/Investigate/Open',{form:data,maxRedirects:0});assert.equal(r.status(),302);const dest=r.headers().location;assert(!/solver|writing-problems/.test(dest));assert(dest.includes('projectId='+w.project)&&dest.includes('bookId='+w.book));await p.reload();}
|
||||
else {assert.equal(await p.locator('form[action$="/Open"]').count(),0);assert.notEqual(kind,'supported');}
|
||||
if(target==='uncertain')assert.equal(kind,'insufficient');if(target==='all-no')assert.equal(kind,'conflicting');if(target==='correlated')assert.equal(kind,'tentative');
|
||||
assert(!(await p.locator('body').textContent()).includes("There isn't enough independent, consistent evidence"));assert.equal(await p.locator('iframe').count(),0);assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));
|
||||
assert.equal((await p.request.get(`${base}/Writer/Explore/Investigate?bookId=${w.other||w.book+1}&id=${id}`)).status(),404);
|
||||
const anon=await browser.newContext();const r=await anon.request.get(url,{maxRedirects:0});if(identity)assert.equal(r.status(),302);await anon.close();
|
||||
if(!identity){const other=await browser.newContext();await other.addCookies([{name:'fixture-user',value:'5',url:base}]);assert.equal((await other.request.get(url)).status(),404);await other.close();}
|
||||
if(process.env.PD_INV_SCREENSHOTS&&!pwa&&['motivation','uncertain','all-no','correlated','competing'].includes(target)){fs.mkdirSync(process.env.PD_INV_SCREENSHOTS,{recursive:true});await p.screenshot({path:process.env.PD_INV_SCREENSHOTS+'/'+target+'.png'});}
|
||||
if(target==='motivation'){
|
||||
await p.goto(url+'&question=motivation-4');await p.locator('[name=option][value=yes]').check();await p.locator('button[value=answer]').click();assert(await p.locator('[data-investigation-answer]').count()>0);await p.reload();assert.equal(await p.locator('[name=question]').inputValue(),'motivation-clarify');
|
||||
if(!identity){await c.addCookies([{name:'solver-reviewer',value:'true',url:base}]);const d=await(await p.request.get(`${base}/admin/writer-investigations/diagnostics?bookId=${w.book}&id=${id}`)).json();assert(d.trace.conclusionReasons.conflictingEvidence);assert(d.trace.questions.some(q=>q.reason==='already answered'));assert(d.trace.blockers.length===5);const sim=await p.request.get(`${base}/admin/writer-investigations/simulator?bookId=${w.book}&id=${id}`);assert(!(await sim.text()).includes('matches: False'));await c.clearCookies({name:'solver-reviewer'});}
|
||||
}
|
||||
console.log(`PASS ${identity?'Development':'isolated'} ${pwa?'simulated PWA':'browser'} ${target}: ${kind}, save/resume, private scope, original tool context`);
|
||||
}
|
||||
assert.equal(external.length,0);assert.deepEqual(errors,[]);await c.close();
|
||||
} }finally{await browser.close();}})().catch(e=>{console.error(e.stack);process.exitCode=1;});
|
||||
86
PlotLine.Tests/InvestigationDiagnosticTests.cs
Normal file
86
PlotLine.Tests/InvestigationDiagnosticTests.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using System.Text.Json;
|
||||
using PlotLine.Models.Investigations;
|
||||
using PlotLine.Services.Investigations;
|
||||
|
||||
internal static class InvestigationDiagnosticTests
|
||||
{
|
||||
static void Check(bool ok,string message){if(!ok)throw new Exception(message);}
|
||||
static List<Answer> Follow(Catalogue c,string concern,string target,ISet<string> caps)
|
||||
{
|
||||
var answers=new List<Answer>();
|
||||
for(int n=0;n<=c.MaxAnswers;n++){
|
||||
var e=InvestigationEngine.Evaluate(c,concern,answers,caps);if(e.NextQuestion==null)return answers;
|
||||
Check(n<c.MaxAnswers,"question bound");var q=c.Questions.Single(q=>q.Id==e.NextQuestion);
|
||||
var targets=target=="competing"?new[]{"motivation","change"}:new[]{target};
|
||||
var o=q.Options.OrderByDescending(o=>o.Contributions.Sum(v=>targets.Contains(v.Hypothesis)?v.Weight*20:-Math.Max(0,v.Weight))+(o.Interpretation=="different-aspects"?1:0)).ThenBy(o=>o.Id,StringComparer.Ordinal).First();
|
||||
Check(!answers.Any(a=>a.Question==q.Id),"question repeated");answers.Add(new(q.Id,o.Id));
|
||||
}
|
||||
throw new Exception("loop");
|
||||
}
|
||||
public static void Run()
|
||||
{
|
||||
var old=CatalogueValidator.Parse(File.ReadAllText("Docs/Writer/Investigations/synthetic-catalogue.json"));
|
||||
var c=CatalogueValidator.Parse(File.ReadAllText("Docs/Writer/Investigations/synthetic-catalogue-v2.json"));var caps=c.Capabilities.Select(d=>d.Id).ToHashSet();
|
||||
Check(old.EngineVersion==0&&c.EngineVersion==2&&old.Version!=c.Version,"version compatibility");
|
||||
Check(old.MinAnswers==c.MinAnswers&&old.MaxAnswers==c.MaxAnswers,"bounds unchanged");
|
||||
Check(JsonSerializer.Serialize(old.Hypotheses)==JsonSerializer.Serialize(c.Hypotheses),"thresholds and mappings unchanged");
|
||||
foreach(var q in old.Questions)Check(JsonSerializer.Serialize(q.Options.Select(o=>new{o.Id,o.Uncertain,o.Interpretation,o.Contributions}))==JsonSerializer.Serialize(c.Questions.Single(x=>x.Id==q.Id).Options.Select(o=>new{o.Id,o.Uncertain,o.Interpretation,o.Contributions})),"stable option/evidence semantics "+q.Id);
|
||||
using(var input=File.OpenRead("Docs/Writer/Writer3/Evidence/Phase3D1A/baseline-traces.json.gz"))
|
||||
using(var gzip=new System.IO.Compression.GZipStream(input,System.IO.Compression.CompressionMode.Decompress))
|
||||
using(var baseline=JsonDocument.Parse(gzip)){
|
||||
foreach(var baselinePath in baseline.RootElement.GetProperty("paths").EnumerateArray())foreach(var step in baselinePath.GetProperty("trace").EnumerateArray()){
|
||||
var a=step.GetProperty("answers").Deserialize<List<Answer>>(CatalogueValidator.Json)!;var recorded=step.GetProperty("evaluation").Deserialize<Evaluation>(CatalogueValidator.Json)!;
|
||||
var replay=InvestigationEngine.Evaluate(old,baselinePath.GetProperty("concern").GetString()!,a,recorded.AvailableCapabilities.ToHashSet());
|
||||
Check(JsonSerializer.Serialize(recorded,CatalogueValidator.Json)==JsonSerializer.Serialize(replay,CatalogueValidator.Json),"exact legacy evaluation replay: "+baselinePath.GetProperty("target").GetString()+" / "+a.Count);
|
||||
}
|
||||
}
|
||||
var outcomes=new HashSet<string>();
|
||||
foreach(var concern in c.Concerns)foreach(var h in c.Hypotheses){var a=Follow(c,concern.Id,h.Id,caps);var e=InvestigationEngine.Evaluate(c,concern.Id,a,caps);Check(e.Recommendations.Contains(h.Id),"valid reachable path "+concern.Id+"/"+h.Id);Check(InvestigationConclusion.From(c,e).Kind=="supported","author supported projection");Check(e.AnswerCount>=c.MinAnswers,"no premature confidence");outcomes.Add(string.Join(",",e.Recommendations));}
|
||||
Check(outcomes.Count==5,"five distinct recommendations");
|
||||
var competing=Follow(c,"story","competing",caps);Check(InvestigationEngine.Evaluate(c,"story",competing,caps).Recommendations.Count==2,"two actually selected supported explanations");
|
||||
var beforeChallenge=InvestigationEngine.Evaluate(c,"story",competing.Take(8),caps);Check(beforeChallenge.NextQuestion!=null&&beforeChallenge.Recommendations.Count==0&&beforeChallenge.Hypotheses.Any(h=>h.Supported),"useful rival question precedes terminal recommendation");
|
||||
var start=InvestigationEngine.Evaluate(c,"character",[],caps);Check(start.NextQuestion=="motivation-1","discovery before challenge/preference");
|
||||
var yes=InvestigationEngine.Evaluate(c,"story",[new("motivation-1","yes")],caps);var no=InvestigationEngine.Evaluate(c,"story",[new("motivation-1","no")],caps);Check(yes.NextQuestion!=no.NextQuestion,"adaptive evidence-based selection");
|
||||
var unknown=new List<Answer>();for(int n=0;n<c.MaxAnswers;n++){var e=InvestigationEngine.Evaluate(c,"story",unknown,caps);if(e.NextQuestion==null)break;var q=c.Questions.Single(q=>q.Id==e.NextQuestion);unknown.Add(new(q.Id,q.Options.First(o=>o.Uncertain).Id));}
|
||||
var weak=InvestigationEngine.Evaluate(c,"story",unknown,caps);Check(weak.Recommendations.Count==0&&InvestigationConclusion.From(c,weak).Kind=="insufficient","uncertainty has no confidence");
|
||||
var conflict=InvestigationEngine.Evaluate(c,"character",[new("motivation-1","yes"),new("motivation-4","yes")],caps);Check(conflict.NextQuestion=="motivation-clarify","material challenge conflict can clarify without redundant second question");Check(conflict.Recommendations.Count==0,"conflict no confidence");
|
||||
var redundant=InvestigationEngine.Evaluate(c,"character",[new("motivation-1","yes"),new("motivation-2","yes")],caps).Hypotheses.Single(h=>h.Id=="motivation");Check(redundant.Support==3&&redundant.Dimensions==1&&!redundant.Supported,"correlated not independent");
|
||||
var path=Follow(c,"story","motivation",caps);var supported=InvestigationEngine.Evaluate(c,"story",path,caps);var unavailable=InvestigationEngine.Evaluate(c,"story",path,new HashSet<string>());Check(unavailable.Recommendations.Count==0&&InvestigationConclusion.From(c,unavailable).Kind=="unavailable","unavailable not usable");Check(supported.Hypotheses.Select(h=>(h.Id,h.Score,h.Supported)).SequenceEqual(unavailable.Hypotheses.Select(h=>(h.Id,h.Score,h.Supported))),"availability never rescores");
|
||||
var row=new Investigation{ID=Guid.NewGuid(),UserID=4,ProjectID=7,BookID=12,CatalogueVersion=c.Version,Concern="story",Answers=path,Presented=path.Select(a=>a.Question).ToList()};
|
||||
var repo=new InvestigationMemoryRepository();repo.Publish(JsonSerializer.Serialize(c,CatalogueValidator.Json),"test").GetAwaiter().GetResult();repo.Save(row,0,"save",supported).GetAwaiter().GetResult();var resumed=repo.Read(4,12,row.ID).GetAwaiter().GetResult()!;
|
||||
Check(JsonSerializer.Serialize(InvestigationService.Evaluate(c,resumed))==JsonSerializer.Serialize(supported),"resume same semantics");Check(repo.Read(5,12,row.ID).Result==null&&repo.Read(4,13,row.ID).Result==null,"private scope");
|
||||
InvestigationService.Answer(resumed,c,"motivation-4","yes", "reconsidered");Check(!InvestigationService.Evaluate(c,resumed).Recommendations.Contains("motivation"),"revision changes conclusion");
|
||||
Check(repo.Catalogue(old.Version).Result!.EngineVersion==0,"old catalogue remains readable");
|
||||
var exhausted=CatalogueValidator.Parse(JsonSerializer.Serialize(c,CatalogueValidator.Json));foreach(var q in exhausted.Questions)q.Retired=true;
|
||||
var end=InvestigationEngine.Evaluate(exhausted,"story",[],caps);Check(end.NextQuestion==null&&end.Recommendations.Count==0,"safe question exhaustion");
|
||||
Console.WriteLine("PASS diagnostic acceptance: 20 actual selected recommendation witnesses; stable v1 semantics; unchanged evidence/thresholds; adaptive, contradiction, revision, persistence, isolation, uncertainty, exhaustion and author outcomes");
|
||||
}
|
||||
public static void Export(string catalogue, string output)
|
||||
{
|
||||
var c=CatalogueValidator.Parse(File.ReadAllText(catalogue));var available=c.Capabilities.Where(d=>d.Available).Select(d=>d.Id).ToHashSet();var paths=new List<object>();
|
||||
foreach(var concern in c.Concerns)foreach(var target in c.Hypotheses.Select(h=>h.Id).Concat(["all-yes","all-no","uncertain","alternating","moderate","weak","competing","correlated","unavailable"]))
|
||||
{
|
||||
var a=new List<Answer>();var trace=new List<object>();var caps=target=="unavailable"?new HashSet<string>():available;var desired=target=="unavailable"?"motivation":target;
|
||||
for(int n=0;n<=c.MaxAnswers;n++)
|
||||
{
|
||||
var state=InvestigationEngine.Evaluate(c,concern.Id,a,caps);trace.Add(InvestigationDiagnostics.Trace(c,concern.Id,a,caps));if(state.NextQuestion==null)break;
|
||||
if(n==c.MaxAnswers)throw new Exception("Loop");var q=c.Questions.Single(q=>q.Id==state.NextQuestion);AnswerOption o;
|
||||
if(target=="uncertain" || target=="weak"&&n>1 || target=="correlated"&&!q.Id.StartsWith("motivation-"))o=q.Options.First(x=>x.Uncertain);
|
||||
else if(target=="all-yes")o=q.Options.First();else if(target=="all-no")o=q.Options[1];else if(target=="alternating")o=q.Options[n%q.Options.Count];
|
||||
else {var targets=target=="competing"?new[]{"motivation","change"}:new[]{target is "moderate" or "weak" or "correlated"?"motivation":desired};
|
||||
o=q.Options.OrderByDescending(o=>o.Contributions.Sum(v=>targets.Contains(v.Hypothesis)?v.Weight*20:-Math.Max(0,v.Weight))+(o.Interpretation=="different-aspects"?1:0)).ThenBy(o=>o.Id,StringComparer.Ordinal).First();
|
||||
if(target=="moderate"&&q.Purpose=="Discovery")o=q.Options.First(x=>x.Uncertain);
|
||||
if(target=="correlated"&&q.Purpose!="Discovery"&&q.Purpose!="Corroboration")o=q.Options.First(x=>x.Uncertain);
|
||||
}
|
||||
a.Add(new(q.Id,o.Id));
|
||||
}
|
||||
var final=InvestigationEngine.Evaluate(c,concern.Id,a,caps);paths.Add(new{concern=concern.Id,target,answers=a,final,trace});
|
||||
if(c.Hypotheses.Any(h=>h.Id==target)) {
|
||||
var revised=a.Select(x=>x.Question.StartsWith(target+"-")&&x.Option=="yes"?x with{Option="no"}:x).ToList();
|
||||
paths.Add(new{concern=concern.Id,target=target+"-revision",answers=revised,final=InvestigationEngine.Evaluate(c,concern.Id,revised,caps),trace=new[]{InvestigationDiagnostics.Trace(c,concern.Id,revised,caps)}});
|
||||
}
|
||||
}
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(output)!);File.WriteAllText(output,JsonSerializer.Serialize(new{catalogue=c.Version,paths},CatalogueValidator.Json));
|
||||
Console.WriteLine($"PASS diagnostic export: {paths.Count} deterministic paths through actual engine ({c.Version})");
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,7 @@ using PlotLine.Services.Investigations;
|
||||
internal sealed class InvestigationMemoryRepository:IInvestigationRepository
|
||||
{
|
||||
readonly Dictionary<string,string> catalogues=[];readonly Dictionary<Guid,string> rows=[];readonly Dictionary<Guid,List<string>> events=[];readonly object sync=new();string current="";
|
||||
public InvestigationMemoryRepository(){var json=File.ReadAllText("Docs/Writer/Investigations/synthetic-catalogue.json");var c=CatalogueValidator.Parse(json);catalogues[c.Version]=json;current=c.Version;}
|
||||
public InvestigationMemoryRepository(){var json=File.ReadAllText(Environment.GetEnvironmentVariable("PD_INV_CATALOGUE")??"Docs/Writer/Investigations/synthetic-catalogue.json");var c=CatalogueValidator.Parse(json);catalogues[c.Version]=json;current=c.Version;}
|
||||
public Task<Catalogue?> Catalogue(string? version=null){lock(sync)return Task.FromResult(catalogues.TryGetValue(version??current,out var json)?CatalogueValidator.Parse(json):null);}
|
||||
public Task Publish(string json,string actor){lock(sync){var c=CatalogueValidator.Parse(json);if(catalogues.ContainsKey(c.Version))throw new ArgumentException("Version already exists.");catalogues[c.Version]=json;current=c.Version;}return Task.CompletedTask;}
|
||||
public Task<IReadOnlyList<Investigation>> List(int user,int book){lock(sync)return Task.FromResult<IReadOnlyList<Investigation>>(rows.Values.Select(Parse).Where(i=>i.UserID==user&&i.BookID==book).OrderByDescending(i=>i.UpdatedUtc).ToArray());}
|
||||
|
||||
@ -15,6 +15,7 @@ using PlotLine.Models;
|
||||
using PlotLine.Services;
|
||||
using PlotLine.ViewModels;
|
||||
|
||||
if(args.Contains("--writer-investigation-diagnostics")){if(args.Contains("--acceptance"))InvestigationDiagnosticTests.Run();InvestigationDiagnosticTests.Export(args[^2],args[^1]);return;}
|
||||
if(args.Contains("--writer-investigation-sim")){InvestigationTests.Run();var output=args.SkipWhile(x=>x!="--writer-investigation-sim").Skip(1).FirstOrDefault();var report=InvestigationTests.Simulate(output);Console.WriteLine($"PASS investigation simulation: {report.Paths} paths, {report.Steps} answers; all hypotheses and destinations reachable; no loops/repeats/premature/invalid/non-deterministic outcomes.");return;}
|
||||
if(args.Contains("--map-topology-database")){await MapGeographicHierarchyDatabaseTests.Run(args.Last(),true);return;}
|
||||
if(args.Contains("--map-topology")){MapTopologyTests.Run();return;}
|
||||
@ -172,6 +173,7 @@ var tests = new (string Name, Action Test)[]
|
||||
("Approved native import source and confirmation remain safe", () => NativeImportTests.Run().GetAwaiter().GetResult()),
|
||||
("Native installation renewal and revocation remain account/security scoped", () => NativeInstallationTests.Run().GetAwaiter().GetResult()),
|
||||
("Guided investigation evidence, validation, revision and deterministic simulation",()=>InvestigationTests.Run()),
|
||||
("Guided investigation diagnostic corrective acceptance",()=>InvestigationDiagnosticTests.Run()),
|
||||
("Review accepted anchors, immutable provenance and author decisions",()=>WriterReviewTests.Run()),
|
||||
("Writer Word verified navigation and acknowledgement",()=>WriterWordTests.Run().GetAwaiter().GetResult()),
|
||||
("Writer inline authoring validation",()=>WriterAuthoringTests.Run()),
|
||||
|
||||
@ -49,5 +49,5 @@ public sealed class WriterInvestigationsController(InvestigationAccess gate,IInv
|
||||
[Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations/simulator")]
|
||||
public Task<IActionResult> Simulator(int bookId,Guid id)=>Guard(async()=>{var(i,c)=await service.Read(Author,bookId,id);ViewData["Events"]=await repository.Replay(Author,bookId,id);return View("Simulator",new InvestigationPage(i,c,service.Current(c,i),[],i.ProjectID,i.BookID));});
|
||||
[Authorize(Policy="AdminOnly"),HttpGet("/admin/writer-investigations/diagnostics")]
|
||||
public Task<IActionResult> Diagnostics(int bookId,Guid id)=>Guard(async()=>{var(i,c)=await service.Read(Author,bookId,id);return Json(new{investigation=i,evaluation=service.Current(c,i),destinations=c.Capabilities,events=await repository.Replay(Author,bookId,id)});});
|
||||
public Task<IActionResult> Diagnostics(int bookId,Guid id)=>Guard(async()=>{var(i,c)=await service.Read(Author,bookId,id);return Json(new{investigation=i,evaluation=service.Current(c,i),trace=InvestigationDiagnostics.Trace(c,i.Concern,i.Answers,service.Current(c,i).AvailableCapabilities.ToHashSet(),i.ContinueUntil),destinations=c.Capabilities,events=await repository.Replay(Author,bookId,id)});});
|
||||
}
|
||||
|
||||
@ -23,6 +23,10 @@ You can keep multiple investigations. Starting another does not overwrite the pr
|
||||
|
||||
Suggestions explain which questionnaire answers informed them and what remains uncertain. They do not claim to analyse the manuscript. You can agree, disagree or investigate further when questions remain. Sometimes there is not enough evidence or an appropriate tool is unavailable; the preview will say so.
|
||||
|
||||
A tentative possibility is different from a supported next step: it may identify an area to think about, but does not offer a tool as confidently recommended. If answers point in different directions, you can revisit them; they may describe different moments or reflect a change in understanding. If no clear direction emerges, you can save your work or return to Explore. The test has a question limit, so further questions are not always offered.
|
||||
|
||||
New investigations use the latest preview catalogue. Existing investigations keep their original questions and evaluation rules; starting another leaves the earlier one intact.
|
||||
|
||||
Opening a recommended tool uses your authorised project and book in another tab. Your investigation remains open, ready to return to. It does not change your working objective, Word position, manuscript, scene status or session. After opening a tool, reload this investigation before another action if its version has changed.
|
||||
|
||||
# Development content only
|
||||
|
||||
@ -2,6 +2,8 @@ namespace PlotLine.Models.Investigations;
|
||||
|
||||
public sealed class Catalogue
|
||||
{
|
||||
[System.Text.Json.Serialization.JsonIgnore(Condition=System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public int EngineVersion {get;set;}
|
||||
public int SchemaVersion {get;set;}=1;
|
||||
public string Version {get;set;}="";
|
||||
public bool Synthetic {get;set;}=true;
|
||||
|
||||
@ -10,6 +10,7 @@ public static class CatalogueValidator
|
||||
{
|
||||
void Require(bool ok,string message){if(!ok)throw new ArgumentException(message);}
|
||||
void Ids(IEnumerable<string> ids,string label){var a=ids.ToArray();Require(a.Length>0&&a.Length<=2000&&a.All(x=>x!=null&&Regex.IsMatch(x,"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"))&&a.Distinct(StringComparer.Ordinal).Count()==a.Length,"Invalid/duplicate "+label+" identifiers.");}
|
||||
Require(c.EngineVersion is 0 or 2,"Unsupported investigation engine version.");
|
||||
Require(c.SchemaVersion==1&&c.Synthetic,"Only schema1 synthetic catalogues are supported in this phase.");Ids([c.Version],"version");Ids(c.Dimensions,"dimension");Ids(c.Concerns.Select(x=>x.Id),"concern");Ids(c.Hypotheses.Select(x=>x.Id),"hypothesis");Ids(c.Questions.Select(x=>x.Id),"question");Ids(c.Capabilities.Select(x=>x.Id),"capability");
|
||||
Require(c.MinAnswers>=2&&c.MaxAnswers>=c.MinAnswers&&c.MaxAnswers<=40,"Invalid question bounds.");
|
||||
var qs=c.Questions.ToDictionary(q=>q.Id);var hs=c.Hypotheses.Select(h=>h.Id).ToHashSet();var ds=c.Dimensions.ToHashSet();var caps=c.Capabilities.Select(d=>d.Id).ToHashSet();
|
||||
|
||||
20
PlotLine/Services/Investigations/InvestigationConclusion.cs
Normal file
20
PlotLine/Services/Investigations/InvestigationConclusion.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using PlotLine.Models.Investigations;
|
||||
namespace PlotLine.Services.Investigations;
|
||||
|
||||
// Author-safe projection; numeric evidence and private diagnostic reasons stay in the admin trace.
|
||||
public sealed record InvestigationConclusion(string Kind,string Title,string Message,string[] Areas)
|
||||
{
|
||||
public static InvestigationConclusion From(Catalogue c, Evaluation e)
|
||||
{
|
||||
InvestigationConclusion Result(string kind,string title,string message,IEnumerable<HypothesisEvidence>? areas=null)=>new(kind,title,message,(areas??[]).Take(2).Select(h=>c.Hypotheses.Single(x=>x.Id==h.Id).Description).ToArray());
|
||||
if(e.Recommendations.Count>0)return Result("supported", "A possible next step", "Your answers support the following next step. This reflects the questionnaire, not an analysis of your manuscript.");
|
||||
var supported=e.Hypotheses.Where(h=>h.Supported).ToArray();
|
||||
if(supported.Length>0&&!supported.Any(h=>h.Eligible))return Result("unavailable","A relevant tool is currently unavailable","Your answers point towards an area worth exploring, but its tool cannot be offered right now. Your investigation is saved. You can revisit an answer or return later.",supported);
|
||||
var conflicts=e.Hypotheses.Where(h=>h.Conflicts.Length>0).ToArray();
|
||||
if(conflicts.Length>0)return Result("conflicting","Let's check what you meant","Some answers point in different directions. They may concern different moments, or your understanding may have changed. Revisit the relevant answers before choosing a next step.",conflicts);
|
||||
var tentative=e.Hypotheses.Where(h=>h.Support+h.Opposition>0).ToArray();
|
||||
if(tentative.Length>1)return Result("ambiguous","More than one explanation may fit","Your answers raise more than one possibility. They do not yet support choosing a tool confidently. You can revisit an answer, or continue if further questions are offered.",tentative);
|
||||
if(tentative.Length==1)return Result("tentative","One area may be worth exploring","Your answers give us a possible direction, but leave too much uncertain to recommend a tool confidently. This is a tentative possibility. You can revisit your answers, or continue if further questions are offered.",tentative);
|
||||
return Result("insufficient","We haven't found a clear direction yet","Your answers have not identified a particular difficulty that this small test catalogue can help with. That does not mean there is a problem with your story. You can revisit an answer, save this investigation, or return to Explore to try another approach.");
|
||||
}
|
||||
}
|
||||
33
PlotLine/Services/Investigations/InvestigationDiagnostics.cs
Normal file
33
PlotLine/Services/Investigations/InvestigationDiagnostics.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using PlotLine.Models.Investigations;
|
||||
|
||||
namespace PlotLine.Services.Investigations;
|
||||
|
||||
// Private diagnostic projection only. No diagnostic fields are persisted into legacy evaluations.
|
||||
public static class InvestigationDiagnostics
|
||||
{
|
||||
public static object Trace(Catalogue c, string concern, IReadOnlyList<Answer> answers, ISet<string> available, int continueUntil = 0)
|
||||
{
|
||||
var e = InvestigationEngine.Evaluate(c, concern, answers, available, continueUntil);
|
||||
var current = answers.GroupBy(a => a.Question).ToDictionary(g => g.Key, g => g.Last());
|
||||
var stop = e.NextQuestion != null ? "continue" : e.Recommendations.Count > 0 ? "supported-evidence" : e.Hypotheses.Any(h=>h.Supported)&&!e.Hypotheses.Any(h=>h.Supported&&h.Eligible) ? "capability-unavailable" : answers.Count >= c.MaxAnswers ? "maximum-questions" : e.Candidates.Count == 0 ? "no-useful-questions" : "completion";
|
||||
return new {
|
||||
catalogue = c.Version, engineVersion=c.EngineVersion, minimumAnswers=c.MinAnswers,maximumAnswers=c.MaxAnswers,continueUntil, concern, activated = c.Concerns.Single(x=>x.Id==concern).Priors, answers = answers.ToArray(),
|
||||
evaluation = e, stoppingCondition = stop,
|
||||
conclusionReasons = new {
|
||||
insufficientEvidence=e.Hypotheses.All(h=>!h.Supported),
|
||||
conflictingEvidence=e.Hypotheses.Any(h=>h.Conflicts.Length>0),
|
||||
noRemainingUsefulQuestions=e.Candidates.Count==0,
|
||||
safetyLimit=e.AnswerCount>=c.MaxAnswers,
|
||||
missingCapabilityMapping=c.Hypotheses.Any(h=>h.Capabilities.Count==0||h.Capabilities.Any(id=>!c.Capabilities.Any(d=>d.Id==id))),
|
||||
capabilityUnavailable=e.Hypotheses.Any(h=>h.Supported&&!h.Eligible),
|
||||
unresolvedCompetitor=e.Hypotheses.Any(h=>h.Supported&&h.Eligible)&&e.Recommendations.Count==0,
|
||||
configuration="Validated before evaluation; invalid imports fail explicitly rather than becoming an inconclusive diagnosis.",
|
||||
persistence="Evaluation is pure. Save/replay failures are handled as HTTP errors; no successful persistence is inferred from this trace."
|
||||
},
|
||||
blockers = e.Hypotheses.Select(h=>new {h.Id, h.Missing, h.Conflicts, threshold=c.Hypotheses.Single(x=>x.Id==h.Id).Threshold,
|
||||
capabilities=c.Hypotheses.Single(x=>x.Id==h.Id).Capabilities.Select(id=>new {id, mapped=c.Capabilities.Any(d=>d.Id==id), eligible=available.Contains(id) && c.Capabilities.Any(d=>d.Id==id&&d.Available&&InvestigationEngine.Allows(d.Prerequisites,current))})}),
|
||||
questions = c.Questions.Select(q=>new {q.Id, q.Purpose, options=q.Options.Select(o=>new{o.Id,o.Text,o.Uncertain,o.Contributions}), reason = q.Retired ? "retired" : current.ContainsKey(q.Id) ? "already answered" : !InvestigationEngine.Allows(q.Eligibility,current) ? "prerequisites or exclusions" : e.Candidates.Any(x=>x.Id==q.Id) ? e.Candidates.Single(x=>x.Id==q.Id).Reason : "not useful in this state"}),
|
||||
independence = e.Evidence.GroupBy(v=>(v.Hypothesis,v.Dimension,v.Group)).Select(g=>new{g.Key.Hypothesis,g.Key.Dimension,g.Key.Group,questions=g.Select(v=>v.Question),positive=g.Where(v=>!v.Uncertain).Select(v=>Math.Max(0,v.Raw)).DefaultIfEmpty().Max(),negative=g.Where(v=>!v.Uncertain).Select(v=>Math.Min(0,v.Raw)).DefaultIfEmpty().Min(),redundant=g.Count(v=>v.Raw!=0)>1})
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -41,12 +41,44 @@ public static class InvestigationEngine
|
||||
var rank=q.InformationValue+overlap*3+gaps*2+conflicts*30+challenge*15+corroboration*8+(q.Purpose=="Discrimination"&&overlap>1?8:0);
|
||||
result.Candidates.Add(new(q.Id,rank,$"Relevant leading explanations: {string.Join(", ",q.Hypotheses.Where(plausible.Contains))}; unexamined dimensions: {gaps}; unresolved conflicts: {conflicts}; challenge gaps: {challenge}; corroboration gaps: {corroboration}; authored information value: {q.InformationValue}."));
|
||||
}
|
||||
if(c.EngineVersion==2)result.Candidates=SelectQuestions(c,answers,result);
|
||||
result.Candidates=result.Candidates.OrderByDescending(x=>x.Rank).ThenBy(x=>x.Id,StringComparer.Ordinal).ToList();
|
||||
var qualified=result.Hypotheses.Where(h=>h.Supported).ToArray();var ready=answers.Count>=Math.Max(c.MinAnswers,continueUntil);
|
||||
if(c.EngineVersion==2&&qualified.Length>0){
|
||||
var best=qualified.Max(h=>h.Score);
|
||||
// A close, positively supported rival deserves its missing challenge/clarification before choosing a tool.
|
||||
var unresolved=result.Hypotheses.Any(h=>!h.Supported&&h.Support+h.Opposition>=c.Hypotheses.Single(x=>x.Id==h.Id).Threshold-2&&result.Candidates.Any(candidate=>{var q=c.Questions.Single(x=>x.Id==candidate.Id);var possible=q.Options.Where(o=>!o.Uncertain).Select(o=>o.Contributions.Where(v=>v.Hypothesis==h.Id).Sum(v=>Math.Max(0,v.Weight))).DefaultIfEmpty().Max();return q.Hypotheses.Contains(h.Id)&&h.Score+possible>=best-2;}));
|
||||
if(unresolved)ready=false;
|
||||
}
|
||||
if(ready&&qualified.Length>0){var usable=qualified.Where(h=>h.Eligible).ToArray();if(usable.Length==0)result.Outcome="No suitable destination currently available";else{result.Recommendations=usable.Where(h=>h.Score>=usable[0].Score-2).Take(2).Select(h=>h.Id).ToList();result.Outcome=result.Recommendations.Count==2?"Two plausible explanations":"Supported recommendation";}}
|
||||
if(result.Outcome=="Investigating"&&(answers.Count>=c.MaxAnswers||result.Candidates.Count==0))result.Outcome=result.Hypotheses.Count(h=>h.Support>0)>=2?"Two plausible explanations":"More information needed";
|
||||
if(c.EngineVersion==2&&result.Outcome!="Investigating"&&result.Recommendations.Count==0&&result.Outcome!="No suitable destination currently available")
|
||||
result.Outcome=result.Hypotheses.Any(h=>h.Conflicts.Length>0)?"Conflicting evidence":result.Hypotheses.Count(h=>h.Support+h.Opposition>0)>=2?"Two plausible explanations":result.Hypotheses.Any(h=>h.Support+h.Opposition>0)?"Tentative conclusion":"More information needed";
|
||||
// Ambiguous terminal outcomes do not invent qualified recommendations.
|
||||
if(result.Outcome=="Investigating")result.NextQuestion=result.Candidates.FirstOrDefault()?.Id;
|
||||
return result;
|
||||
}
|
||||
// Versioned selection preserves exact legacy evaluation/replay while correcting synthetic preview ordering.
|
||||
static List<CandidateQuestion> SelectQuestions(Catalogue c, Dictionary<string,Answer> answers, Evaluation e)
|
||||
{
|
||||
var leaders=e.Hypotheses.Where(h=>h.Score>0).Take(2).Select(h=>h.Id).ToHashSet();
|
||||
var covered=e.Evidence.Where(v=>!v.Uncertain&&v.Raw!=0).Select(v=>(v.Hypothesis,v.Dimension)).ToHashSet();
|
||||
var candidates=new List<CandidateQuestion>();
|
||||
foreach(var q in c.Questions.Where(q=>!q.Retired&&!answers.ContainsKey(q.Id)&&Allows(q.Eligibility,answers)))
|
||||
{
|
||||
var conflicts=e.Hypotheses.Count(h=>q.Hypotheses.Contains(h.Id)&&h.Conflicts.Any(f=>q.Clarifies.Any(d=>f.Contains('/'+d+'/'))));
|
||||
if(q.Purpose=="Clarification"&&conflicts==0)continue;
|
||||
var effects=q.Options.Where(o=>!o.Uncertain).SelectMany(o=>o.Contributions).Where(v=>v.Weight!=0).Select(v=>(v.Hypothesis,v.Dimension)).Distinct().ToArray();
|
||||
// Non-evidence preference questions cannot buy priority by declaring many hypotheses/dimensions.
|
||||
var overlap=effects.Select(v=>v.Hypothesis).Distinct().Count(leaders.Contains);
|
||||
var gaps=effects.Count(v=>!covered.Contains(v));
|
||||
var discovery=q.Purpose=="Discovery"?q.Hypotheses.Count(h=>!e.Evidence.Any(v=>v.Hypothesis==h&&!v.Uncertain&&v.Raw!=0))*5:0;
|
||||
var challenge=q.Purpose=="Challenge"?e.Hypotheses.Count(h=>leaders.Contains(h.Id)&&q.Hypotheses.Contains(h.Id)&&h.Support>0&&h.Dimensions>=c.Hypotheses.Single(x=>x.Id==h.Id).MinDimensions&&!h.Challenged):0;
|
||||
var corroboration=q.Purpose=="Corroboration"?e.Hypotheses.Count(h=>leaders.Contains(h.Id)&&q.Hypotheses.Contains(h.Id)&&h.Support>0&&h.Groups<c.Hypotheses.Single(x=>x.Id==h.Id).MinGroups&&effects.Any(v=>v.Hypothesis==h.Id&&!covered.Contains(v))):0;
|
||||
var rank=q.InformationValue+overlap*3+gaps*2+discovery+conflicts*100+challenge*20+corroboration*8+(q.Purpose=="Discrimination"&&overlap>1?8:0);
|
||||
candidates.Add(new(q.Id,rank,$"Leading explanations: {string.Join(", ",effects.Select(v=>v.Hypothesis).Distinct().Where(leaders.Contains))}; substantive dimension gaps: {gaps}; discovery: {discovery}; conflicts: {conflicts}; challenge gaps: {challenge}; independent corroboration gaps: {corroboration}; information value: {q.InformationValue}."));
|
||||
}
|
||||
return candidates;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -29,9 +29,12 @@
|
||||
<button class="btn btn-primary" name="operation" value="answer">Continue</button><button class="btn btn-outline-secondary" name="operation" value="save">Save for later</button></div>
|
||||
</form>
|
||||
}else{
|
||||
<h2 id="investigation-question">@(state!.Recommendations.Count>0?"A possible next step":"Let's leave room for uncertainty")</h2>
|
||||
<p>Your answers suggest the following. This reflects the questionnaire, not an analysis of your manuscript.</p><p class="writer3-caption">Tools open in another tab. Your investigation stays here so you can return to it.</p>
|
||||
@if(state.Recommendations.Count==0){<p>There isn't enough independent, consistent evidence for an available tool recommendation yet. You can revisit an answer or save this investigation. @if(state.Outcome=="No suitable destination currently available"){<span>A relevant tool is currently unavailable.</span>}</p>}
|
||||
var conclusion=InvestigationConclusion.From(Model.Catalogue,state!);
|
||||
<h2 id="investigation-question" data-conclusion="@conclusion.Kind">@conclusion.Title</h2>
|
||||
<p>@conclusion.Message</p>
|
||||
@if(conclusion.Areas.Length>0){<p>Areas your answers touched on:</p><ul>@foreach(var area in conclusion.Areas){<li>@area</li>}</ul>}
|
||||
@if(state!.Recommendations.Count>0){<p class="writer3-caption">Tools open in another tab. Your investigation stays here so you can return to it.</p>}
|
||||
@if(row.Answers.Count>=Model.Catalogue.MaxAnswers&&state.Recommendations.Count==0){<p>We've reached the question limit for this test. You can still change earlier answers or save and return later.</p>}
|
||||
@foreach(var id in state.Recommendations){var h=Model.Catalogue.Hypotheses.Single(h=>h.Id==id);<section class="writer3-inset"><h3>@h.Summary</h3><p>@h.Reason</p><p class="muted">@h.Uncertainty</p>
|
||||
<p>Answers that informed this suggestion:</p><ul>@foreach(var evidence in state.Evidence.Where(e=>e.Hypothesis==id&&e.Raw>0&&!e.Uncertain).DistinctBy(e=>e.Question).Take(3)){var q=Model.Catalogue.Questions.Single(q=>q.Id==evidence.Question);<li>@q.Text — @q.Options.Single(o=>o.Id==evidence.Option).Text</li>}</ul>
|
||||
@foreach(var cap in Model.Catalogue.Capabilities.Where(d=>h.Capabilities.Contains(d.Id)&&state.AvailableCapabilities.Contains(d.Id))){<p>@cap.Description</p><form asp-action="Open" method="post" target="_blank"><input type="hidden" name="bookId" value="@Model.BookID"/><input type="hidden" name="id" value="@row.ID"/><input type="hidden" name="version" value="@row.Version"/><button class="btn btn-primary" name="capability" value="@cap.Id">@cap.ActionText <span class="visually-hidden">(opens another tab; return here afterwards)</span></button></form>}
|
||||
|
||||
@ -11,3 +11,6 @@
|
||||
<h2>Destination mappings</h2><ul>@foreach(var d in Model.Catalogue.Capabilities){<li>@d.Id → @d.Resolver · available @e.AvailableCapabilities.Contains(d.Id) · @d.Description</li>}</ul>
|
||||
<h2>Replay saved states</h2><p>Each committed action contains the reproducible state and evaluation. Revisions replace live evidence while retaining these earlier events.</p>
|
||||
@foreach(var json in (string[]?)ViewData["Events"]??[]){using var doc=JsonDocument.Parse(json);var state=doc.RootElement.GetProperty("state").Deserialize<PlotLine.Models.Investigations.Investigation>(CatalogueValidator.Json)!;var recorded=doc.RootElement.GetProperty("evaluation").GetRawText();var old=JsonSerializer.Deserialize<PlotLine.Models.Investigations.Evaluation>(recorded,CatalogueValidator.Json)!;var replay=InvestigationEngine.Evaluate(Model.Catalogue,state.Concern,state.Answers,old.AvailableCapabilities.ToHashSet(),state.ContinueUntil);var identical=JsonSerializer.Serialize(replay,CatalogueValidator.Json)==JsonSerializer.Serialize(JsonSerializer.Deserialize<PlotLine.Models.Investigations.Evaluation>(recorded,CatalogueValidator.Json),CatalogueValidator.Json);<details><summary>Version @state.Version · recomputation matches: @identical</summary><pre>@json</pre></details>}
|
||||
|
||||
<h2>Decision trace: stop reasons, exclusions and thresholds</h2>
|
||||
<pre>@JsonSerializer.Serialize(InvestigationDiagnostics.Trace(Model.Catalogue,row.Concern,row.Answers,e.AvailableCapabilities.ToHashSet(),row.ContinueUntil),CatalogueValidator.Json)</pre>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user