17 lines
3.5 KiB
Plaintext
17 lines
3.5 KiB
Plaintext
@using System.Text.Json
|
|
@using PlotLine.Services.Investigations
|
|
@model PlotLine.Models.Investigations.InvestigationPage
|
|
@{ViewData["Title"]="Investigation simulator";ViewData["ProjectSection"]="Writer";var e=Model.Evaluation!;var row=Model.Investigation!;}
|
|
<h1>Investigation simulator and replay</h1><p>Private author-owned test @row.ID · catalogue @row.CatalogueVersion · @row.Answers.Count answers · state @e.Outcome</p>
|
|
<p><a asp-action="Index" asp-route-bookId="@row.BookID" asp-route-id="@row.ID">Select or revise answers</a> · <a href="/admin/writer-investigations/diagnostics?bookId=@row.BookID&id=@row.ID">Machine-readable diagnostics</a></p>
|
|
<h2>Hypotheses and completion requirements</h2><div class="table-responsive"><table class="table"><thead><tr><th>Hypothesis</th><th>Prior</th><th>Support</th><th>Opposition</th><th>Score</th><th>Dimensions/groups</th><th>Challenged</th><th>Destination eligible</th><th>Missing requirements/conflicts</th></tr></thead><tbody>@foreach(var h in e.Hypotheses){<tr><td>@h.Id</td><td>@h.Prior</td><td>@h.Support</td><td>@h.Opposition</td><td>@h.Score</td><td>@h.Dimensions / @h.Groups</td><td>@h.Challenged</td><td>@h.Eligible</td><td>@string.Join(", ",h.Missing) @string.Join(", ",h.Conflicts)</td></tr>}</tbody></table></div>
|
|
<h2>Evidence and redundancy</h2><p>@e.RedundantContributions contributions share a dimension/group. Strongest positive/negative per group and dimension caps apply; these are evidence scores, not probabilities.</p>
|
|
<div class="table-responsive"><table class="table"><thead><tr><th>Question/answer</th><th>Hypothesis</th><th>Dimension/aspect</th><th>Group</th><th>Raw contribution</th><th>Uncertain</th></tr></thead><tbody>@foreach(var v in e.Evidence){<tr><td>@v.Question / @v.Option</td><td>@v.Hypothesis</td><td>@v.Dimension / @v.Aspect</td><td>@v.Group</td><td>@v.Raw</td><td>@v.Uncertain</td></tr>}</tbody></table></div>
|
|
<h2>Next-question selection</h2><p>Selected: @e.NextQuestion</p><ol>@foreach(var q in e.Candidates){<li><strong>@q.Id (@q.Rank)</strong> @q.Reason</li>}</ol>
|
|
<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>
|