Add intentional neutral outcomes and prepare approved Curated V2 Development activation
This commit is contained in:
parent
911a72effa
commit
8ea1bb9856
@ -0,0 +1,22 @@
|
||||
# Known Development review items
|
||||
|
||||
The following 16 suspicious mappings are unchanged from the completed choice audit. They are not newly retuned or promoted to confirmed defects. The owner approved hands-on Development evaluation with the eight separately documented secondary-result exceptions. Production/editorial approval is not implied.
|
||||
|
||||
- `rescue-happening/flat-or-wrong` → `flat-progression=2`: The disjunction permits a problem other than flat progression. Do not assume the author necessarily chose the flat half.
|
||||
- `rescue-confidence/characters-consistent` → `continuity-conflict=1`: Wanting consistency does not itself establish a contradiction; distinguish concern from an observed conflict.
|
||||
- `rescue-confidence/story-moving` → `flat-progression=3`: Wanting confidence that the story moves is not an assertion that it stalls. The next focused question can establish that; this row is a prior hypothesis.
|
||||
- `track-what/structure` → `scene-purpose=1`: Scenes/chapters identifies an organisational domain, not scene contribution. This remaining +1 also currently serves routing; suspicious rather than a demonstrated false result from this row alone.
|
||||
- `track-plots/where-appear` → `plot-dormancy=2`: Looking for appearances does not by itself establish excessive absence. This low weight is a hypothesis rather than a confirmed dormant thread.
|
||||
- `feel-where/whole` → `flat-progression=1`: The whole story identifies location/scope of a problem, not its form. Flatness has not been stated.
|
||||
- `feel-how/disappears` → `plot-dormancy=4`: Something may be a character, object or thread. The question has not identified it as a storyline.
|
||||
- `flow-thread/concentrated` → `late-concentration=2`: One place does not identify the ending; the concentration could be early or in the middle. Review the unstated timing assumption.
|
||||
- `flow-relationship/slow-but-moving` → `flat-progression=3`: Checking whether deliberate slow development still progresses does not assert stagnation. Existing case 57 intentionally expects D18; clarify concern-versus-finding semantics before changing that approved intent.
|
||||
- `change-what/character` → `character-arc=2`: Editing a character or role is not necessarily changing their development arc.
|
||||
- `change-what/cut-add` → `scene-purpose=2`: Cutting/adding scenes does not establish doubt about their contribution. This is a revision action, not a scene-purpose complaint.
|
||||
- `change-damage/plot` → `flat-progression=2`: Plot progression being affected does not establish stasis; the effect could instead be abruptness or ordering.
|
||||
- `scale-effect/forget` → `continuity-conflict=2`: Forgetting or making a mistake does not specifically establish contradictory facts. This is an unspecified-error signal.
|
||||
- `series-thread/characters-change` → `character-arc=3`: The characters involved changing can mean changing participants rather than development within one character.
|
||||
- `cast-size/importance` → `character-presence=3`: Importance is not the same as appearance frequency. The relationship between the two is useful to inspect but not stated by this answer.
|
||||
- `time-nonlinear/characters` → `simultaneous-events=3`: Different character timelines can be in separate eras. Parallel activity is not explicit.
|
||||
|
||||
The 52 solution advice paragraphs remain templated; the larger editorial rewrite is explicitly out of scope. Supporting-result quality beyond the exact approved exceptions is not certified by primary reachability alone.
|
||||
103
Docs/WritingSolver/CuratedV2/DevelopmentGate/Report.md
Normal file
103
Docs/WritingSolver/CuratedV2/DevelopmentGate/Report.md
Normal file
@ -0,0 +1,103 @@
|
||||
# Curated V2 Development engineering gate
|
||||
|
||||
1 November 2026. This gate continues from `911a72e`. The owner explicitly authorised Development-only activation **with the eight documented secondary-result exceptions** after reviewing the reconciled metadata. This is not Production or final editorial approval.
|
||||
|
||||
## Result and approval boundary
|
||||
|
||||
- Real repository validator: **PASS**, normally, without instrumentation or bypasses.
|
||||
- Original literal regression: **60/60 cases and 185/185 prefixes**.
|
||||
- Reconciled strict semantic expectations: **52/60 and 177/185 prefixes**. The eight pre-existing secondary-result exceptions remain visible, not relabelled as semantic passes.
|
||||
- Development gate: checks exactly the approved eight supports, correct primary/neutral outcomes and all literal journeys; new exceptions, primary changes, missing required support and unrelated forbidden results fail the guard.
|
||||
- Exhaustive real-engine traversal: **11,325 states**, **44/44 nodes**, **52/52 solutions**, all **52 primary-capable**, below the ceiling. Counts remain 48 signals, 44 nodes, 52 solutions and 15 features.
|
||||
- Operational release and live-site verification are recorded in `Deployment.md` after activation.
|
||||
|
||||
The explicit approval and the strict-vs-literal distinction are recorded in `SupportingDecision.md` and `development-exceptions.json`. No unrelated diagnosis was retuned to hide the metadata findings.
|
||||
|
||||
## Three approved signal repairs
|
||||
|
||||
Only the requested weights were removed:
|
||||
|
||||
| Choice | Removed weight | Preserved evidence |
|
||||
|---|---|---|
|
||||
| `continuity-object/wrong-place` | `possession=4` | Existing continuity-conflict evidence |
|
||||
| `cast-presence/major-barely` | `flat-progression=4` | `character-presence=6` |
|
||||
| `cast-presence/protagonist-disappears` | `flat-progression=4` | `character-presence=6` |
|
||||
|
||||
D41 and D43 coefficients/thresholds were not changed. The approved D50 correction and earlier Case 30 scene-purpose correction remain intact. No diagnostic route or choice wording was changed in this gate.
|
||||
|
||||
Focused witnesses use the real engine and verify each prefix. The repaired wrong-location witness no longer returns D41 (18, below threshold 24); the repaired absence witnesses no longer return D43 (4, below threshold 20), while retaining D10. In-memory reintroduction of the historical +4 weights reproduces the original false recommendations and proves the causal regression checks.
|
||||
|
||||
Genuine wrong-possession case 38 remains D41-primary. Genuine flat-progression case 40 remains D43-primary. Genuine D05 witnesses remain primary at 24, 28 and 22 without scale/overwhelm. Case 30 returns D33/D52 without D05/D50. D50 has zero qualifying states without series evidence (maximum 9, threshold 12); genuine D50 cases 47/59 and D51 case 48 retain their intended outcomes.
|
||||
|
||||
## First-class neutral endpoints
|
||||
|
||||
Schema-v1 nodes can explicitly declare `neutralEndpoint: true`, default false. Nodes have fallback `reassurance`; choices may override it. A reassurance has required title/summary, up to three advice paragraphs, and at most one active feature reference.
|
||||
|
||||
Validation requires neutral endpoints to be genuinely terminal, single-choice, without routing affinity or diagnostic choice weights. Missing content, invalid/inactive feature references, routes, evidence-bearing choices and orphan reassurance are rejected. Ordinary undeclared evidence-free dead ends remain invalid. Old/demo graphs retain their previous behaviour.
|
||||
|
||||
The engine returns selected reassurance rather than a fabricated solution, preserves previously accumulated signals without adding evidence, and recalculates reassurance during replay/revision. No runtime controller copy or conditions recognise adoption node/choice IDs. The only V2 endpoint declaration is on the existing neutral adoption question.
|
||||
|
||||
The new neutral validation and replay tests include malformed declarations, ordinary dead ends, prior diagnostic signals, all eight adoption answers, earlier-answer revision, demo compatibility and rejection before opening a database connection for invalid publication.
|
||||
|
||||
Database tables/procedures need no migration: the graph remains an immutable validated JSON snapshot. Updated runtime code must be deployed before activating its additive schema fields.
|
||||
|
||||
## Tailored reassurance in the existing UI
|
||||
|
||||
The normal `/writing-problems` MVC route renders the chosen reassurance as server-side Razor content. It retains Back/Restart, supports no-JavaScript use and excludes the entire diagnostic library for authored neutral outcomes.
|
||||
|
||||
- Existing manuscript/manual entry: “You don't need to start again”; explains beginning with an existing draft without manually recreating hundreds of scenes. Links only to Manuscript Import.
|
||||
- Discovery writing: does not require planning before drafting; helps inspect what has emerged. No compulsory feature catalogue or extra question.
|
||||
- Creative control: PlotDirector shows what is present; the author decides what to do. No claim to judge creative quality.
|
||||
- Just writing: organisation reduces maintenance work so the author can return to writing; use only useful structure.
|
||||
- Scattered notes, uncertainty about where to start and fallback receive their own authored reassurance, with at most one relevant capability.
|
||||
|
||||
Ordinary insufficient-evidence cases 13/58 remain distinct, receive no invented diagnosis and retain their existing practical advice. Warm public styling is preserved; only narrowly scoped neutral-content layout rules were added.
|
||||
|
||||
## Acceptance metadata decisions
|
||||
|
||||
All 19 relevant cases were reviewed individually. Full reasons and keep/reject decisions are in `metadata-decisions.json`.
|
||||
|
||||
- Cases 7/10/11: retain optional network/presence/POV knowledge cross-checks tied to the literal cast/viewpoint complaint; no supporting result is required solely to enrich output.
|
||||
- Case 15: retain intermediate relationship-state inspection, reject network overload.
|
||||
- Cases 16/17/52/57: reject network overload for a single relationship; case 16 also rejects global story stagnation.
|
||||
- Case 18: six changing relationships genuinely justify network inspection.
|
||||
- Cases 22/51/60: changing information/reveal timing makes optional reader-facing timing review relevant. Other possible compound outcomes remain optional because the literal path does not collect their discriminating evidence.
|
||||
- Case 25: reject age/character-fact diagnoses from a calendar contradiction.
|
||||
- Case 30: retain D33/D52; forbid D05/D50.
|
||||
- Case 36: retain the related material-state/history cross-check for a changed house; remove the unrelated optional character-details expectation.
|
||||
- Case 39: reject location/character-fact diagnoses from a destroyed letter reappearing.
|
||||
- Case 43: reject global story stagnation from internal character-arc stagnation.
|
||||
- Case 49: the literal “Pretty much everything” / “All of that” choices support optional scene/thread management views for the stated broad burden.
|
||||
- Case 56: D11 remains forbidden and is removed from the contradictory acceptable list.
|
||||
|
||||
The original literal baseline is preserved separately. Corrected strict expectations are now the candidate's `acceptance-paths.json`. Eight reviewed cases still produce rejected secondary results; the owner explicitly accepted those known limitations for hands-on **Development** review. They are cases **15, 16, 17, 25, 39, 43, 52, 57**. This permission does not change their semantic verdict or any production scoring.
|
||||
|
||||
## Verification
|
||||
|
||||
- `dotnet build PlotLine.slnx`: pass; two existing nullable warnings in the regression harness.
|
||||
- Full executable regression harness: **385 PASS results**, including explicit neutral validation, data-driven reassurance, revision, old graphs, literal paths and the exact approved-exception guard.
|
||||
- Real `Tools/WritingSolver validate` command: pass, with only two non-blocking low solution-route-coverage warnings (`character-development`, `manuscript-import`). Neutral adoption links are not counted as diagnostic solution routes by that warning.
|
||||
- Real-engine audit with `--development-accepted`: pass for the authorised Development gate; strict 52/60 and 177/185 are retained in the report.
|
||||
- All 52 solution and 15 feature pages render without JavaScript; H1/description/canonical/social/JSON-LD/links and encoding checked.
|
||||
- 390px and 1440px browser journeys pass multi-select, ordinary/intentional neutral outcomes, Back/Forward, revised earlier answers and all eight tailored adoption concerns. No horizontal overflow or significant layout shift.
|
||||
- A complete adoption journey also passes with JavaScript disabled.
|
||||
- Shared public-browser suite passes all six application themes in ordinary/PWA contexts, signed-in/out, authentication presentation/forms, responsiveness, assets/navigation and SEO checks.
|
||||
- Automated testing reuses the existing regression host and real MVC/Razor UI; no alternate product or preview UI was built. Live Development smoke tests use the same ordinary public routes.
|
||||
|
||||
`engine-results.json`, `focused-witnesses.json` and the captured command outputs contain paths, scores, exact exception IDs and reachability witnesses. The strict audit can still be run without `--development-accepted` to return a nonzero exit for the eight outstanding semantic results.
|
||||
|
||||
## Development safety and review items
|
||||
|
||||
`WritingSolver:EnableIndexing=false` in the Development service forces solver/feature pages and responses to noindex and excludes solver URLs from the sitemap. Default existing public behaviour is unchanged elsewhere. Production is not modified.
|
||||
|
||||
`KnownReviewItems.md` preserves the 16 suspicious mappings from the prior completed audit without changing them. Larger practical-advice rewrites remain out of scope. The owner is explicitly evaluating a Development candidate with documented secondary-result limitations, not a catalogue certified as final editorial content.
|
||||
|
||||
## Changed files
|
||||
|
||||
Runtime: `Models/WritingSolver/SolverGraph.cs`, `Services/WritingSolverEngine.cs`, `Services/WritingSolverValidator.cs`, `Controllers/WritingProblemsController.cs`, `Controllers/SitemapController.cs`, `Views/WritingProblems/Index.cshtml`, `Neutral.cshtml`, `Admin.cshtml`, and `wwwroot/css/writing-solver.css`.
|
||||
|
||||
Data/tooling: the V2 graph and acceptance metadata, `Tools/WritingSolver/Program.cs` (safe standalone Development backup), and `Docs/WritingSolver/Framework.md`.
|
||||
|
||||
Tests: `WritingSolverNeutralTests.cs`, existing V2 and choice-witness tests, `Program.cs`, the existing browser fixture and curated browser suite.
|
||||
|
||||
Reports: this `DevelopmentGate` directory, metadata decisions, exact approved exceptions, original literal baseline, engine/focused evidence and operational release verification. Historical audit reports are retained unchanged.
|
||||
@ -0,0 +1,33 @@
|
||||
# Supporting-result review: decision before Development activation
|
||||
|
||||
The three approved signal repairs and neutral-endpoint implementation pass the normal validator, original 60 literal paths and all 185 original prefix expectations. The build and full existing regression harness pass. No Production changes or database publication have occurred.
|
||||
|
||||
The required supporting-result metadata review identified these **pre-existing** result sets which do not match the complaint. They were present in the audited baseline; the three approved removals did not create them.
|
||||
|
||||
| Case | Supporting results rejected by the semantic review | Reason |
|
||||
|---|---|---|
|
||||
| 15 | D15 | One unearned romance does not establish an unmanageable relationship network. D16's intermediate-stage view remains useful. |
|
||||
| 16 | D43, D15 | One stagnant romance does not establish global story stagnation or network overload. |
|
||||
| 17 | D15 | Two people's different perspectives do not establish too many relationships. |
|
||||
| 25 | D29, D13 | Tuesday before Monday says nothing about ages, birthdays or character facts. |
|
||||
| 39 | D39, D13 | A destroyed letter reappearing does not establish a changed location or character details. |
|
||||
| 43 | D43 | An internally unchanged protagonist does not prove that the external story stops progressing. |
|
||||
| 52 | D15 | Rushed development of one relationship does not establish a large network. |
|
||||
| 57 | D15 | A deliberately slow romance does not establish network overload. |
|
||||
|
||||
The complete case-by-case decisions (including accepted supports, case 30 and the case-56 contradiction) are in `metadata-decisions.json`. Corrected expectations are staged separately in `acceptance-paths.review.json` so the historical 60/60 audit is not silently rewritten.
|
||||
|
||||
Running the actual engine against these reviewed expectations gives **52/60**, with eight final-prefix mismatches and the newly forbidden secondary results. Primary diagnoses remain correct in all 60 cases. No related weights, thresholds, scoring or routes have been changed.
|
||||
|
||||
These are not the 16 suspicious choice weights being re-audited; this is the specifically requested reconciliation of the existing supporting-result metadata inconsistencies.
|
||||
|
||||
The current instruction authorises Development activation **once the engineering gate passes**, and does not authorise retuning other diagnoses. Consequently one of the following is needed before activation:
|
||||
|
||||
- Keep the strict semantic gate: do not activate until a separately approved correction addresses these supporting recommendations.
|
||||
- Explicitly allow Development-only activation with these eight known secondary-result limitations for hands-on owner review. Preserve the failed strict review and report it; do not claim the revised semantic suite passes. The original literal-path regression remains 60/60.
|
||||
|
||||
Production remains outside scope in either case. Tailored neutral reassurance is already implemented generically and does not show the diagnostic catalogue. The normal application UI is the deployment target; no alternative product UI has been created.
|
||||
|
||||
## Owner decision
|
||||
|
||||
The owner explicitly selected **“Activate in Development with documented exceptions”** in this chat on 1 November 2026. The strict reviewed expectation file remains authoritative for semantic reporting (52/60); the original literal baseline remains 60/60. The development regression guard permits exactly the eight recorded supports and rejects changes to primaries, paths or additional forbidden results. This approval is Development-only and does not authorise Production publication or indexing.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
PASS curated V2 rendering: all 67 no-JS pages; desktop/mobile neutral, nonlinear, absence, multi-select, revision and Back/Forward journeys; all adoption concerns and no-JS reassurance; no overflow/CLS; noindex.
|
||||
@ -0,0 +1,56 @@
|
||||
{
|
||||
"approval": "Owner explicitly authorised Development activation with these documented secondary-result limitations in this chat on 1 November 2026. Not Production approval or final editorial acceptance.",
|
||||
"cases": [
|
||||
{
|
||||
"id": 15,
|
||||
"supporting": [
|
||||
"d15"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"supporting": [
|
||||
"d43",
|
||||
"d15"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"supporting": [
|
||||
"d15"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"supporting": [
|
||||
"d29",
|
||||
"d13"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"supporting": [
|
||||
"d39",
|
||||
"d13"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"supporting": [
|
||||
"d43"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
"supporting": [
|
||||
"d15"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 57,
|
||||
"supporting": [
|
||||
"d15"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
Actual validator: PASS;
|
||||
Exploration: 11325 states, 44/44 nodes, 52/52 solutions, complete=True.
|
||||
D50 without series: maximum score 9, threshold 12, qualifying states 0.
|
||||
Acceptance: 52/60; strict prefixes 177/185. Lengths 2–4, median 3, mean 3.08.
|
||||
Development gate: PASS with exactly eight owner-approved secondary-result exceptions; literal baseline 60/60 and 185/185; strict semantic review remains 52/60.
|
||||
Case 15: Prefix 3: results expected [d17,d16], actual [d17,d15,d16]. Prefix 3: forbidden result d15 was returned.
|
||||
Case 16: Prefix 3: results expected [d18], actual [d18,d43,d15]. Prefix 3: forbidden result d43 was returned. Prefix 3: forbidden result d15 was returned.
|
||||
Case 17: Prefix 3: results expected [d19], actual [d19,d15]. Prefix 3: forbidden result d15 was returned.
|
||||
Case 25: Prefix 3: results expected [d27], actual [d27,d29,d13]. Prefix 3: forbidden result d29 was returned. Prefix 3: forbidden result d13 was returned.
|
||||
Case 39: Prefix 3: results expected [d42], actual [d42,d39,d13]. Prefix 3: forbidden result d39 was returned. Prefix 3: forbidden result d13 was returned.
|
||||
Case 43: Prefix 3: results expected [d46], actual [d46,d43]. Prefix 3: forbidden result d43 was returned.
|
||||
Case 52: Prefix 3: results expected [d17], actual [d17,d15]. Prefix 3: forbidden result d15 was returned.
|
||||
Case 57: Prefix 3: results expected [d18], actual [d18,d15]. Prefix 3: forbidden result d15 was returned.
|
||||
88545
Docs/WritingSolver/CuratedV2/DevelopmentGate/engine-results.json
Normal file
88545
Docs/WritingSolver/CuratedV2/DevelopmentGate/engine-results.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
Focused correction: PASS; strict acceptance 52/60, 177/185 matching prefixes; 11325 states, 44/44 nodes, 52/52 solutions, 52/52 primary-capable.
|
||||
Case 30 navigation: d33,d52; D05=0.
|
||||
Explicit scene contribution: d05; D05=24.
|
||||
Why a scene exists: d05; D05=28.
|
||||
Which scenes advance a thread: d05; D05=22.
|
||||
REPAIRED continuity-object/wrong-place: removed possession=4; d41 now 18 (not returned), historical +4 value 34 (returned).
|
||||
REPAIRED cast-presence/major-barely: removed flat-progression=4; d43 now 4 (not returned), historical +4 value 20 (returned).
|
||||
REPAIRED cast-presence/protagonist-disappears: removed flat-progression=4; d43 now 4 (not returned), historical +4 value 20 (returned).
|
||||
89169
Docs/WritingSolver/CuratedV2/DevelopmentGate/focused-witnesses.json
Normal file
89169
Docs/WritingSolver/CuratedV2/DevelopmentGate/focused-witnesses.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,165 @@
|
||||
[
|
||||
{
|
||||
"id": 7,
|
||||
"keep": [
|
||||
"d15"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "Forty difficult-to-identify characters make the relationship network a relevant supporting way to anchor who they are; retain it as an optional cast-management cross-check, not a separate confirmed network fault."
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"keep": [
|
||||
"d10"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "Disproportionate attention to a minor character makes checking gaps in important characters a useful complementary presence check. It remains optional rather than required."
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"keep": [
|
||||
"d23"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "Four viewpoints explicitly establish separate perspectives; inspecting who knows what alongside restoring a neglected viewpoint is a relevant optional cross-check."
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"keep": [
|
||||
"d16"
|
||||
],
|
||||
"reject": [
|
||||
"d15"
|
||||
],
|
||||
"reason": "Mapping intermediate relationship stages can help an unearned jump. One romance does not establish too many relationships to manage."
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d43",
|
||||
"d15"
|
||||
],
|
||||
"reason": "Stalled development within one romance does not establish story-wide stagnation or an unmanageable relationship network."
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d15"
|
||||
],
|
||||
"reason": "Two people understanding their relationship differently is not evidence of excessive network complexity."
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"keep": [
|
||||
"d15"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "Six relationships changing after one event directly establish network-management burden as well as the consequence problem."
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"keep": [
|
||||
"d26"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "The literal path changes when information is revealed; checking its reader-facing timing is relevant alongside logical revelation ordering."
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d29",
|
||||
"d13"
|
||||
],
|
||||
"reason": "Tuesday before Monday establishes a calendar contradiction. It establishes no birthday, age or other character-fact problem."
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"keep": [
|
||||
"d52"
|
||||
],
|
||||
"reject": [
|
||||
"d05",
|
||||
"d50"
|
||||
],
|
||||
"reason": "Navigation burden supports scene organisation and overload; neither scene contribution nor a series is established. Approved earlier corrections retained."
|
||||
},
|
||||
{
|
||||
"id": 36,
|
||||
"keep": [
|
||||
"d42"
|
||||
],
|
||||
"reject": [
|
||||
"d13"
|
||||
],
|
||||
"reason": "The same house has a contradictory physical state across scenes; the closely related material-state/history view is an optional cross-check. No character details are implicated."
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d39",
|
||||
"d13"
|
||||
],
|
||||
"reason": "A destroyed letter reappearing establishes object-history continuity, not a changed place or inconsistent character details."
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d43"
|
||||
],
|
||||
"reason": "The protagonist remaining internally unchanged does not establish that the external story stops moving."
|
||||
},
|
||||
{
|
||||
"id": 49,
|
||||
"keep": [
|
||||
"d33",
|
||||
"d01"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "The literal answer selects Pretty much everything and then All of that after a list of manuscript-management domains. Scene/thread views are optional ways to inspect that stated broad burden; no additional result is required."
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"keep": [
|
||||
"d26"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "The accepted path explicitly changes reveal timing, so checking reader-facing timing is related to the information-order problem. Do not require a clue-network or revision-consequence diagnosis from evidence the path never collects."
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d15"
|
||||
],
|
||||
"reason": "An unearned two-person relationship despite six calendar months does not establish too many relationships."
|
||||
},
|
||||
{
|
||||
"id": 56,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d11"
|
||||
],
|
||||
"reason": "Deliberate absence must not be silently converted to accidental presence imbalance. Remove D11 from acceptableSupporting and retain the existing prohibition."
|
||||
},
|
||||
{
|
||||
"id": 57,
|
||||
"keep": [],
|
||||
"reject": [
|
||||
"d15"
|
||||
],
|
||||
"reason": "A deliberately slow romance may warrant a progression check, as already approved, but does not establish an unmanageable relationship network."
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"keep": [
|
||||
"d26"
|
||||
],
|
||||
"reject": [],
|
||||
"reason": "The actual accepted path establishes changed revelation timing and premature knowledge. D26 is a related timing check. Other complaint elements are not encoded by this path, so do not invent required D02/D48/D44 outputs."
|
||||
}
|
||||
]
|
||||
@ -0,0 +1 @@
|
||||
PASS public theme isolation: all six themes, browser/standalone, signed in/out; authentication palette and validation; responsive layouts, assets, navigation, checkout links and public SEO.
|
||||
@ -0,0 +1,3 @@
|
||||
Valid graph writing-solver-curated-v2: 44 nodes, 52 solutions, 15 features.
|
||||
Few solution routes to feature: character-development
|
||||
Few solution routes to feature: manuscript-import
|
||||
@ -54,3 +54,32 @@ The decorative asset `wwwroot/images/public/writing-solver-desk.png` was generat
|
||||
## Verification
|
||||
|
||||
Run `dotnet build PlotLine.slnx`, then `dotnet run --project PlotLine.Tests/PlotLine.Tests.csproj` serially. Engine/import regressions are in `WritingSolverTests.cs`. For real MVC/Razor browser tests, start the isolated `--toolbar-browser-host` from the repository root, then run `node PlotLine.Tests/Browser/writing-solver.cjs` and `node PlotLine.Tests/Browser/public-site.cjs`. These use seed fixtures and never touch the database. The solver suite covers desktop/mobile, browser Back, fallback revision, native no-JS forms, multi-feature results, anonymous invalid-state recovery, direct pages, canonical/social/structured data, demo sitemap exclusion, overflow and cumulative layout shift.
|
||||
|
||||
## Explicit neutral outcomes (Curated V2 engineering gate)
|
||||
|
||||
A schema-v1 question can now declare `neutralEndpoint: true` (default false). The declaration means **after answering this question**, the conversation ends with reassurance rather than a diagnosis. It is generic; runtime code does not recognise adoption node or choice IDs.
|
||||
|
||||
A neutral endpoint must have no routes, routing affinity, multi-select mode or diagnostic choice weights. It must supply a node-level `reassurance` fallback. A choice may override that reassurance with its own `reassurance` object. Other nodes cannot carry reassurance without the explicit declaration. Existing undeclared evidence-free dead ends remain invalid. Invalid/missing fields or inactive/missing feature references fail normal import validation.
|
||||
|
||||
```json
|
||||
{
|
||||
"neutralEndpoint": true,
|
||||
"reassurance": {
|
||||
"title": "Use only what helps.",
|
||||
"summary": "You can leave with this reassurance, or return another time.",
|
||||
"advice": ["One useful next step is enough."]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`reassurance` requires a nonempty `title` and `summary`, permits up to three plain-text `advice` paragraphs and one optional `feature` ID. The feature is linked through its existing active public record; there are no arbitrary outcome URLs. The selected choice's content takes precedence over the fallback. All copy is encoded Razor text.
|
||||
|
||||
The engine retains previously accumulated signals, adds none at the neutral endpoint, returns no diagnostic solutions and records the selected reassurance in `SolverOutcome`. Replay and revision recompute that outcome from protected answer history. The existing UI renders it server-side with Back/Restart and an optional single capability, without the diagnostic library. Ordinary insufficient-evidence endings retain their existing neutral advice/reading links and are distinct from authored reassurance.
|
||||
|
||||
Old/demo graphs omit these properties and keep their previous behaviour. Additive JSON properties require deploying the updated parser before publishing a graph containing them. Database storage and procedures need no migration because publication remains a validated, immutable JSON snapshot.
|
||||
|
||||
`WritingSolver:EnableIndexing` defaults true for existing public behaviour. Set it false in the Development service environment to force all solver/feature responses to `noindex, follow` (including an HTTP robots header) and exclude solver URLs from the sitemap. Development activation is not editorial/Production indexing approval.
|
||||
|
||||
Before development graph publication, `Tools/WritingSolver backup development` takes a unique COPY_ONLY/CHECKSUM backup and verifies mapped-file existence/size. It refuses any configured database other than `PlotDirector_Development`. Then `publish FILE` uses the normal repository validation and `dbo.WritingSolver_Publish` transaction. This is not a restore test.
|
||||
|
||||
Curated V2's reconciled semantic expectations live in its `acceptance-paths.json`. The original literal baseline is retained under `Docs/WritingSolver/CuratedV2/DevelopmentGate/`. The owner explicitly approved **eight known secondary-result exceptions for Development only**; regression checks permit exactly those known supports, prohibit new exceptions, and continue to require all 60 correct primaries and all literal prefixes. The strict semantic report remains 52/60, rather than being relabelled green. These acceptance exceptions are test/review metadata, not production scoring overrides.
|
||||
|
||||
@ -6,7 +6,8 @@ const path = require('node:path');
|
||||
const candidate = path.resolve('PlotLine/Content/WritingSolver/Candidates/curated-v2');
|
||||
const graph = JSON.parse(fs.readFileSync(path.join(candidate,'writing-solver-curated-v2.json'),'utf8'));
|
||||
const cases = JSON.parse(fs.readFileSync(path.join(candidate,'acceptance-paths.json'),'utf8')).cases;
|
||||
const base = 'http://127.0.0.1:5238';
|
||||
const base = process.env.SOLVER_BASE_URL || 'http://127.0.0.1:5238';
|
||||
assert(['127.0.0.1:5238','127.0.0.1:5050','dev.plotdirector.com'].includes(new URL(base).host),'Test only local or Development.');
|
||||
(async () => {
|
||||
const browser = await chromium.launch();
|
||||
try {
|
||||
@ -34,6 +35,14 @@ const base = 'http://127.0.0.1:5238';
|
||||
}
|
||||
}
|
||||
}
|
||||
await page.goto(base+'/writing-problems');
|
||||
for(const choice of ['unsure','reread-cant-see','using-tool-concern','draft-done','too-much-written']) {
|
||||
await page.locator(`input[name=choices][value="${choice}"]`).check();
|
||||
await page.locator('.solver-form button[type=submit]').click();
|
||||
}
|
||||
assert.match(await page.locator('.solver-neutral h1').innerText(),/don't need to start again/);
|
||||
assert.equal(await page.locator('.solver-library').count(),0);
|
||||
assert(await page.locator('a[href="/features/manuscript-import"]').count());
|
||||
await context.close();
|
||||
for(const width of [390,1440]) {
|
||||
const context=await browser.newContext({viewport:{width,height:1000}});
|
||||
@ -72,22 +81,36 @@ const base = 'http://127.0.0.1:5238';
|
||||
await page.goBack();await page.locator('input[value="who-knows-fact"]').check();await page.locator('.solver-form button[type=submit]').click();
|
||||
assert.equal(await page.locator('.solver-result').count(),0);
|
||||
assert(await page.locator('main').innerText().then(t=>t.includes('isn’t enough evidence')));
|
||||
// The adoption branch is neutral; record the current renderer's lack of tailored guidance.
|
||||
await page.goto(base+'/writing-problems');
|
||||
for(const [node,choice] of [['entry','unsure'],['rescue-happening','reread-cant-see'],['rescue-confidence','using-tool-concern'],['existing-stage','planning'],['existing-barrier','discovery']]) {
|
||||
assert.equal(await page.locator('input[name=node]').getAttribute('value'),node);
|
||||
await page.locator(`input[name=choices][value="${choice}"]`).check();
|
||||
await page.locator('.solver-form button[type=submit]').click();
|
||||
// All adoption concerns use their authored content, with at most one relevant capability.
|
||||
const endpoint=graph.nodes.find(n=>n.neutralEndpoint);
|
||||
for(const concern of endpoint.choices.filter(c=>c.active)) {
|
||||
await page.goto(base+'/writing-problems');
|
||||
for(const [node,choice] of [['entry','unsure'],['rescue-happening','reread-cant-see'],['rescue-confidence','using-tool-concern'],['existing-stage','draft-done'],[endpoint.id,concern.id]]) {
|
||||
assert.equal(await page.locator('input[name=node]').getAttribute('value'),node);
|
||||
await page.locator(`input[name=choices][value="${choice}"]`).check();
|
||||
await page.locator('.solver-form button[type=submit]').click();
|
||||
}
|
||||
const expected=concern.reassurance || endpoint.reassurance;
|
||||
assert.equal(await page.locator('.solver-neutral h1').innerText(),expected.title);
|
||||
assert.equal(await page.locator('.solver-neutral .solver-intro').innerText(),expected.summary);
|
||||
assert.equal(await page.locator('.solver-result').count(),0);
|
||||
assert.equal(await page.locator('.solver-library').count(),0);
|
||||
assert(!(await page.locator('main').innerText()).includes('isn’t enough evidence'));
|
||||
assert.equal(await page.locator('.solver-neutral a[href^="/features/"]').count(),expected.feature ? 1 : 0);
|
||||
if(expected.feature) assert(await page.locator(`.solver-neutral a[href="/features/${graph.features.find(f=>f.id===expected.feature).slug}"]`).count());
|
||||
assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth>innerWidth),false);
|
||||
}
|
||||
assert.equal(await page.locator('.solver-result').count(),0);
|
||||
assert.equal(await page.locator('.solver-library a').count(),52);
|
||||
assert.equal(await page.locator('main a[href="/features/manuscript-import"]').count(),0);
|
||||
console.log(`NOTE ${width}px: adoption endpoint is neutral but uses generic advice and 52 reading links, without a direct manuscript-import link.`);
|
||||
await page.goBack();await page.goForward();assert.equal(await page.locator('.solver-neutral').count(),1);
|
||||
await page.goBack();await page.goBack();await page.goBack();
|
||||
assert.equal(await page.locator('input[name=node]').getAttribute('value'),'rescue-confidence');
|
||||
await page.locator('input[value="story-moving"]').check();await page.locator('.solver-form button[type=submit]').click();
|
||||
assert.equal(await page.locator('.solver-neutral').count(),0);
|
||||
assert.equal(await page.locator('input[name=node]').getAttribute('value'),'flow-target');
|
||||
assert.equal(errors.length,0,errors.join('\n'));
|
||||
await context.close();
|
||||
}
|
||||
// Existing renderer lists every public solution under a neutral result. Record its size
|
||||
// as a UX finding rather than silently treating a blank recommendation as a diagnosis.
|
||||
console.log('PASS curated V2 rendering: all 67 no-JS pages; desktop/mobile neutral, nonlinear, absence, multi-select, revision and Back/Forward journeys; no overflow/CLS; offline noindex.');
|
||||
console.log('PASS curated V2 rendering: all 67 no-JS pages; desktop/mobile neutral, nonlinear, absence, multi-select, revision and Back/Forward journeys; all adoption concerns and no-JS reassurance; no overflow/CLS; noindex.');
|
||||
} finally {await browser.close();}
|
||||
})().catch(error=>{console.error(error);process.exit(1);});
|
||||
|
||||
@ -71,11 +71,13 @@ if (args.Contains("--plot-lines"))
|
||||
|
||||
var tests = new (string Name, Action Test)[]
|
||||
{
|
||||
("Neutral endpoints require explicit valid terminal declarations", WritingSolverNeutralTests.Validation),
|
||||
("Neutral reassurance follows selected concerns without evidence and survives revision", WritingSolverNeutralTests.ReassuranceAndRevision),
|
||||
("Scene navigation does not invent purpose evidence; genuine D05 witnesses survive", () => WritingSolverChoiceSemanticsTests.VerifyCorrection()),
|
||||
("D50 requires actual series evidence and preserves D50/D51 witnesses", WritingSolverCuratedV2Tests.D50EvidenceRequirement),
|
||||
("Curated V2 replays all supplied acceptance prefixes and supporting-result rules", WritingSolverCuratedV2Tests.Acceptance),
|
||||
("Curated V2 preserves 60 literal paths and enforces eight explicit Development review exceptions", WritingSolverCuratedV2Tests.Acceptance),
|
||||
("Curated V2 exhausts real-engine states and preserves revision/multi-select behaviour", WritingSolverCuratedV2Tests.ReachabilityAndRevision),
|
||||
("Curated V2 records the existing neutral adoption validator boundary", WritingSolverCuratedV2Tests.ExistingValidatorBoundary),
|
||||
("Curated V2 passes normal validation and invalid publication stays guarded", WritingSolverCuratedV2Tests.ExistingValidatorBoundary),
|
||||
("Writing Solver anonymous state is protected, expires and rejects stale versions", WritingSolverTests.AnonymousState),
|
||||
("Writing Solver scoring, multi-select, revision, fallback and graph routes", WritingSolverTests.RoutingAndRevision),
|
||||
("Writing Solver import rejects invalid graphs and editorial identities", WritingSolverTests.Validation),
|
||||
|
||||
@ -338,17 +338,21 @@ internal static class ToolbarBrowserHost
|
||||
|
||||
internal sealed class WritingSolverFixtureRepository(IHttpContextAccessor accessor) : IWritingSolverRepository
|
||||
{
|
||||
private readonly Lazy<string?> candidateSnapshot = new(() =>
|
||||
{
|
||||
var path=Environment.GetEnvironmentVariable("PD_WRITING_SOLVER_CANDIDATE");
|
||||
if(string.IsNullOrEmpty(path)) return null;
|
||||
var graph=WritingSolverRepository.Parse(File.ReadAllText(path));
|
||||
foreach(var page in graph.Solutions.Cast<PlotLine.Models.WritingSolver.SolverPage>().Concat(graph.Features)) page.Index=false;
|
||||
return System.Text.Json.JsonSerializer.Serialize(graph,WritingSolverRepository.JsonOptions);
|
||||
});
|
||||
public Task<PlotLine.Models.WritingSolver.SolverGraph> GetAsync()
|
||||
{
|
||||
// Read-only, loopback-only candidate rendering. Strict schema parsing is kept
|
||||
// separate from semantic validation so rejected candidates can still be inspected.
|
||||
var candidatePath = Environment.GetEnvironmentVariable("PD_WRITING_SOLVER_CANDIDATE");
|
||||
var graph = string.IsNullOrEmpty(candidatePath)
|
||||
var snapshot=candidateSnapshot.Value;
|
||||
var graph=snapshot is null
|
||||
? WritingSolverRepository.Parse(File.ReadAllText("PlotLine/Content/WritingSolver/demo.json"))
|
||||
: System.Text.Json.JsonSerializer.Deserialize<PlotLine.Models.WritingSolver.SolverGraph>(File.ReadAllText(candidatePath), WritingSolverRepository.JsonOptions)!;
|
||||
if (!string.IsNullOrEmpty(candidatePath))
|
||||
foreach(var page in graph.Solutions.Cast<PlotLine.Models.WritingSolver.SolverPage>().Concat(graph.Features)) page.Index = false;
|
||||
if (string.IsNullOrEmpty(candidatePath) && accessor.HttpContext?.Request.Query["curated"].ToString() == "true")
|
||||
: System.Text.Json.JsonSerializer.Deserialize<PlotLine.Models.WritingSolver.SolverGraph>(snapshot,WritingSolverRepository.JsonOptions)!;
|
||||
if (snapshot is null && accessor.HttpContext?.Request.Query["curated"].ToString() == "true")
|
||||
{
|
||||
graph.IsDemo = false;
|
||||
foreach(var page in graph.Solutions.Cast<PlotLine.Models.WritingSolver.SolverPage>().Concat(graph.Features)) page.Index = true;
|
||||
|
||||
@ -44,7 +44,7 @@ internal static class WritingSolverChoiceSemanticsTests
|
||||
Require(witness.Results.FirstOrDefault()=="d05" && witness.Signals.GetValueOrDefault("scale")==0 && witness.Signals.GetValueOrDefault("overwhelm")==0,$"Genuine D05 witness failed: {witness.Name}.");
|
||||
WritingSolverCuratedV2Tests.D50EvidenceRequirement();
|
||||
var results=WritingSolverCuratedV2Tests.Replay(graph);
|
||||
Require(results.All(c=>c.Pass),"The focused correction regressed an existing acceptance case.");
|
||||
WritingSolverCuratedV2Tests.VerifyDevelopmentExceptions(graph);
|
||||
return witnesses;
|
||||
}
|
||||
public static Finding[] ReviewWitnesses()
|
||||
@ -62,13 +62,14 @@ internal static class WritingSolverChoiceSemanticsTests
|
||||
foreach(var definition in definitions)
|
||||
{
|
||||
var choice=graph.Nodes.Single(n=>n.Id==definition.Node).Choices.Single(c=>c.Id==definition.Choice);
|
||||
Require(!choice.Weights.ContainsKey(definition.Signal),"The approved unsupported weight must be absent.");
|
||||
var actual=Replay(graph,definition.Node+"/"+definition.Choice,definition.Path);
|
||||
var clone=JsonSerializer.Deserialize<SolverGraph>(original,Json)!;
|
||||
clone.Nodes.Single(n=>n.Id==definition.Node).Choices.Single(c=>c.Id==definition.Choice).Weights.Remove(definition.Signal);
|
||||
clone.Nodes.Single(n=>n.Id==definition.Node).Choices.Single(c=>c.Id==definition.Choice).Weights[definition.Signal]=4;
|
||||
var counterfactual=Replay(clone,"In-memory causal check only",definition.Path);
|
||||
Require(actual.Results.Contains(definition.Diagnosis),"The proposed audit finding is not actually returned by the engine.");
|
||||
Require(!counterfactual.Results.Contains(definition.Diagnosis),"The proposed weight did not cause qualification in this witness.");
|
||||
findings.Add(new(definition.Node,definition.Choice,choice.Text,definition.Signal,choice.Weights[definition.Signal],"clearly incorrect",definition.Reason,definition.Diagnosis,actual,counterfactual));
|
||||
Require(!actual.Results.Contains(definition.Diagnosis),"The repaired candidate still returns the unrelated diagnosis.");
|
||||
Require(counterfactual.Results.Contains(definition.Diagnosis),"The historical +4 weight must reproduce the original false recommendation.");
|
||||
findings.Add(new(definition.Node,definition.Choice,choice.Text,definition.Signal,4,"corrected",definition.Reason,definition.Diagnosis,actual,counterfactual));
|
||||
}
|
||||
Require(original==JsonSerializer.Serialize(graph,Json),"Audit counterfactuals must never mutate the candidate graph.");
|
||||
return findings.ToArray();
|
||||
@ -79,10 +80,10 @@ internal static class WritingSolverChoiceSemanticsTests
|
||||
var witnesses=VerifyCorrection();var findings=ReviewWitnesses();
|
||||
var graph=WritingSolverCuratedV2Tests.Graph();var exploration=WritingSolverCuratedV2Tests.Explore(graph);var cases=WritingSolverCuratedV2Tests.Replay(graph);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(report))!);
|
||||
File.WriteAllText(report,JsonSerializer.Serialize(new {CorrectionWitnesses=witnesses,UnresolvedFindings=findings,Exploration=exploration,Passed=cases.Count(c=>c.Pass),Total=cases.Length,Prefixes=cases.Sum(c=>c.Prefixes.Length),Cases=cases},Json)+"\n");
|
||||
Console.WriteLine($"Focused correction: PASS; acceptance {cases.Count(c=>c.Pass)}/60, {cases.Sum(c=>c.Prefixes.Length)}/185 prefixes; {exploration.StateCount} states, {exploration.Nodes.Count}/44 nodes, {exploration.Solutions.Count}/52 solutions, {exploration.PrimarySolutions.Length}/52 primary-capable.");
|
||||
File.WriteAllText(report,JsonSerializer.Serialize(new {CorrectionWitnesses=witnesses,CorrectedFindings=findings,Exploration=exploration,Passed=cases.Count(c=>c.Pass),Total=cases.Length,PrefixExpectationsReplayed=cases.Sum(c=>c.Prefixes.Length),StrictMatchedPrefixes=WritingSolverCuratedV2Tests.MatchedPrefixes(cases),Cases=cases},Json)+"\n");
|
||||
Console.WriteLine($"Focused correction: PASS; strict acceptance {cases.Count(c=>c.Pass)}/60, {WritingSolverCuratedV2Tests.MatchedPrefixes(cases)}/185 matching prefixes; {exploration.StateCount} states, {exploration.Nodes.Count}/44 nodes, {exploration.Solutions.Count}/52 solutions, {exploration.PrimarySolutions.Length}/52 primary-capable.");
|
||||
foreach(var witness in witnesses)Console.WriteLine($"{witness.Name}: {string.Join(",",witness.Results)}; D05={witness.Scores.Single(s=>s.Id=="d05").Value}.");
|
||||
foreach(var finding in findings)Console.WriteLine($"BLOCKER {finding.Node}/{finding.Choice}: {finding.Signal}={finding.Weight}; {finding.FalseDiagnosis} returned at {finding.Actual.Scores.Single(s=>s.Id==finding.FalseDiagnosis).Value}, counterfactual {finding.Counterfactual.Scores.Single(s=>s.Id==finding.FalseDiagnosis).Value} (not returned).");
|
||||
if(findings.Length>0)Environment.ExitCode=1;
|
||||
foreach(var finding in findings)Console.WriteLine($"REPAIRED {finding.Node}/{finding.Choice}: removed {finding.Signal}={finding.Weight}; {finding.FalseDiagnosis} now {finding.Actual.Scores.Single(s=>s.Id==finding.FalseDiagnosis).Value} (not returned), historical +4 value {finding.Counterfactual.Scores.Single(s=>s.Id==finding.FalseDiagnosis).Value} (returned).");
|
||||
Require(findings.All(f=>!f.Actual.Results.Contains(f.FalseDiagnosis)),"An approved semantic repair failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ internal static class WritingSolverCuratedV2Tests
|
||||
public sealed record AcceptanceCase(int Id, string Complaint, SolverAnswer[] Answers, PrefixExpectation[] PrefixExpectations,
|
||||
string? ExpectedPrimary, string[] AcceptableSupporting, string[] RequiredSupporting, string[] ForbiddenResults, string Notes);
|
||||
public sealed record AcceptanceFile(string Version, AcceptanceCase[] Cases);
|
||||
public sealed record DevelopmentException(int Id, string[] Supporting);
|
||||
public sealed record DevelopmentApproval(string Approval, DevelopmentException[] Cases);
|
||||
public sealed record Score(string Id, int Value, int Threshold, bool Qualified);
|
||||
public sealed record Step(SolverAnswer Answer, string? Next, Dictionary<string,int> Signals, Score[] Scores, string[] Results);
|
||||
public sealed record CaseResult(int Id, string Complaint, SolverAnswer[] RequestedPath, SolverAnswer[] AcceptedPath,
|
||||
@ -66,13 +68,23 @@ internal static class WritingSolverCuratedV2Tests
|
||||
var primary=outcome.Solutions.FirstOrDefault()?.Id; var supporting=outcome.Solutions.Skip(1).Select(s=>s.Id).ToArray();
|
||||
if(primary!=test.ExpectedPrimary) errors.Add($"Expected primary {test.ExpectedPrimary ?? "none"}, actual {primary ?? "none"}.");
|
||||
foreach(var required in test.RequiredSupporting.Except(supporting)) errors.Add($"Required supporting result missing: {required}.");
|
||||
foreach(var id in supporting.Except(test.AcceptableSupporting)) warnings.Add($"Supporting result {id} is present in the explicit prefix expectation but absent from acceptableSupporting; reconcile the supplied metadata.");
|
||||
foreach(var id in supporting.Except(test.AcceptableSupporting)) warnings.Add($"Supporting result {id} is absent from acceptableSupporting; the strict semantic expectation rejects this recommendation.");
|
||||
foreach(var conflict in test.AcceptableSupporting.Intersect(test.ForbiddenResults)) warnings.Add($"{conflict} is both acceptable and forbidden in the supplied metadata; the explicit forbidden rule takes precedence.");
|
||||
return new CaseResult(test.Id,test.Complaint,test.Answers,outcome.Answers.ToArray(),test.ExpectedPrimary,test.AcceptableSupporting,test.RequiredSupporting,test.ForbiddenResults,
|
||||
steps.ToArray(),new(outcome.Scores),Scores(graph,outcome),primary,supporting,outcome.Next?.Id,errors.Count==0,errors.ToArray(),warnings.ToArray());
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
public static int MatchedPrefixes(IEnumerable<CaseResult> results, string? pathsFile=null)
|
||||
{
|
||||
var expected=Cases(pathsFile).ToDictionary(c=>c.Id);
|
||||
return results.Sum(result=>result.Prefixes.Select((step,index)=>
|
||||
{
|
||||
var prefix=expected[result.Id].PrefixExpectations.Single(p=>p.AfterAnswers==index+1);
|
||||
return step.Next==prefix.ExpectedNext && step.Results.SequenceEqual(prefix.ExpectedResults);
|
||||
}).Count(matches=>matches));
|
||||
}
|
||||
|
||||
// Faithful instrumentation of the existing validator traversal, including its exact
|
||||
// history/score key and seen+pending ceiling. This intentionally does not replace it.
|
||||
public static Exploration Explore(SolverGraph graph, Action<SolverOutcome>? inspect = null)
|
||||
@ -130,10 +142,34 @@ internal static class WritingSolverCuratedV2Tests
|
||||
Require(!cases.Single(c=>c.Id==30).Supporting.Contains("d50"),"Case 30 still returns D50.");
|
||||
}
|
||||
|
||||
private static string GateDirectory => Path.Combine(Root(),"Docs/WritingSolver/CuratedV2/DevelopmentGate");
|
||||
public static void Acceptance()
|
||||
{
|
||||
var results=Replay(Graph());
|
||||
Require(results.All(r=>r.Pass),string.Join("; ",results.Where(r=>!r.Pass).Select(r=>$"Case {r.Id}: {string.Join(" ",r.Errors)}")));
|
||||
var graph=Graph();
|
||||
var literal=Replay(graph,Path.Combine(GateDirectory,"acceptance-paths.literal-baseline.json"));
|
||||
Require(literal.All(r=>r.Pass),"A literal baseline journey/prefix regressed.");
|
||||
VerifyDevelopmentExceptions(graph);
|
||||
}
|
||||
public static void VerifyDevelopmentExceptions(SolverGraph graph)
|
||||
{
|
||||
var approval=JsonSerializer.Deserialize<DevelopmentApproval>(File.ReadAllText(Path.Combine(GateDirectory,"development-exceptions.json")),Json)!;
|
||||
Require(!string.IsNullOrWhiteSpace(approval.Approval) && approval.Cases.Length==8,"Explicit Development exception approval is required.");
|
||||
var results=Replay(graph);var cases=Cases();
|
||||
Require(results.Where(r=>!r.Pass).Select(r=>r.Id).Order().SequenceEqual(approval.Cases.Select(c=>c.Id).Order()),"Strict review failures changed; do not silently expand the approved exceptions.");
|
||||
foreach(var result in results)
|
||||
{
|
||||
var allowed=approval.Cases.SingleOrDefault(c=>c.Id==result.Id)?.Supporting ?? [];
|
||||
var expected=cases.Single(c=>c.Id==result.Id);
|
||||
Require(result.Primary==expected.ExpectedPrimary && result.AcceptedPath.Length==expected.Answers.Length,$"Primary or journey changed in case {result.Id}.");
|
||||
foreach(var step in result.Prefixes.Select((value,index)=>(value,index)))
|
||||
{
|
||||
var prefix=expected.PrefixExpectations.Single(p=>p.AfterAnswers==step.index+1);
|
||||
Require(step.value.Next==prefix.ExpectedNext && step.value.Results.Where(id=>!allowed.Contains(id)).SequenceEqual(prefix.ExpectedResults),$"Unapproved prefix result changed in case {result.Id}.");
|
||||
}
|
||||
Require(expected.RequiredSupporting.All(result.Supporting.Contains),"A required supporting result was lost.");
|
||||
Require(!result.Supporting.Except(allowed).Intersect(expected.ForbiddenResults).Any(),"An unapproved forbidden support was returned.");
|
||||
Require(result.Supporting.Except(allowed).All(expected.AcceptableSupporting.Contains),"An unreviewed supporting result was returned.");
|
||||
}
|
||||
}
|
||||
public static void ReachabilityAndRevision()
|
||||
{
|
||||
@ -181,17 +217,18 @@ internal static class WritingSolverCuratedV2Tests
|
||||
}
|
||||
public static void ExistingValidatorBoundary()
|
||||
{
|
||||
var errors=WritingSolverValidator.Validate(Graph());
|
||||
Require(errors.SequenceEqual(new[]{"Dead end without diagnostic evidence: existing-barrier"}),"The known neutral adoption endpoint blocker changed: "+string.Join("; ",errors));
|
||||
var graph=Graph();
|
||||
Require(WritingSolverValidator.Validate(graph).Count==0,"Curated V2 must pass the normal validator with its explicit neutral endpoint.");
|
||||
graph.Nodes.Single(n=>n.NeutralEndpoint).NeutralEndpoint=false;
|
||||
var connections=new NoDatabaseConnection();
|
||||
try
|
||||
{
|
||||
new WritingSolverRepository(connections).PublishAsync(File.ReadAllText(Path.Combine(DirectoryPath,"writing-solver-curated-v2.json")),"validation-only").GetAwaiter().GetResult();
|
||||
throw new Exception("The current publication guard accepted a rejected graph.");
|
||||
new WritingSolverRepository(connections).PublishAsync(JsonSerializer.Serialize(graph,Json),"validation-only").GetAwaiter().GetResult();
|
||||
throw new Exception("The publication guard accepted an undeclared evidence-free endpoint.");
|
||||
}
|
||||
catch(InvalidDataException exception)
|
||||
{
|
||||
Require(exception.Message.Contains("existing-barrier") && connections.Calls==0,"Publication did not reject before opening a database connection.");
|
||||
Require(exception.Message.Contains("neutral endpoint") && connections.Calls==0,"Invalid graph must be rejected before opening a database connection.");
|
||||
}
|
||||
}
|
||||
public static void Run(string[] args)
|
||||
@ -210,6 +247,8 @@ internal static class WritingSolverCuratedV2Tests
|
||||
if(score>=d50.Threshold) noSeriesQualified++;
|
||||
});
|
||||
var results=Replay(graph,pathsFile);
|
||||
var developmentAccepted=args.Contains("--development-accepted");
|
||||
if(developmentAccepted) Acceptance();
|
||||
var reportIndex=Array.IndexOf(args,"--report");
|
||||
var report=reportIndex<0 ? Path.Combine(Root(),"Docs/WritingSolver/CuratedV2/results.json") : args[reportIndex+1];
|
||||
var lengths=results.Select(r=>r.AcceptedPath.Length).Order().ToArray();
|
||||
@ -222,14 +261,15 @@ internal static class WritingSolverCuratedV2Tests
|
||||
}).ToArray();
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(report))!);
|
||||
File.WriteAllText(report,JsonSerializer.Serialize(new {graph.Version,Counts=new {Signals=signals.Length,Nodes=graph.Nodes.Count,Solutions=graph.Solutions.Count,Features=graph.Features.Count},
|
||||
ValidationPassed=validation.Count==0,ValidationErrors=validation,Exploration=exploration,D50Evidence=new {MaximumScoreWithoutSeries=maximumWithoutSeries,MaximumWithoutSeriesWitness=maximumWithoutSeriesWitness,QualifiedStatesWithoutSeries=noSeriesQualified,Threshold=d50.Threshold},Passed=results.Count(r=>r.Pass),Total=results.Length,
|
||||
StrictMatchedPrefixes=MatchedPrefixes(results,pathsFile),PrefixExpectations=results.Sum(r=>r.RequestedPath.Length),LiteralCasesPassed=developmentAccepted ? 60 : (int?)null,LiteralMatchedPrefixes=developmentAccepted ? 185 : (int?)null,DevelopmentExceptionsExplicitlyAccepted=developmentAccepted,ValidationPassed=validation.Count==0,ValidationErrors=validation,Exploration=exploration,D50Evidence=new {MaximumScoreWithoutSeries=maximumWithoutSeries,MaximumWithoutSeriesWitness=maximumWithoutSeriesWitness,QualifiedStatesWithoutSeries=noSeriesQualified,Threshold=d50.Threshold},Passed=results.Count(r=>r.Pass),Total=results.Length,
|
||||
JourneyLengths=new {Min=lengths.Min(),Median=(lengths[29]+lengths[30])/2.0,Mean=lengths.Average(),Max=lengths.Max(),ContinuingCases=results.Where(r=>r.Next is not null).Select(r=>r.Id).ToArray()},
|
||||
NeutralAdoptionWitnesses=neutral,Results=results},Json)+"\n");
|
||||
Console.WriteLine($"Actual validator: {(validation.Count==0 ? "PASS" : "FAIL")}; {string.Join("; ",validation)}");
|
||||
Console.WriteLine($"Exploration: {exploration.StateCount} states, {exploration.Nodes.Count}/44 nodes, {exploration.Solutions.Count}/52 solutions, complete={exploration.Complete}.");
|
||||
Console.WriteLine($"D50 without series: maximum score {maximumWithoutSeries}, threshold {d50.Threshold}, qualifying states {noSeriesQualified}.");
|
||||
Console.WriteLine($"Acceptance: {results.Count(r=>r.Pass)}/60. Lengths {lengths.Min()}–{lengths.Max()}, median {(lengths[29]+lengths[30])/2.0}, mean {lengths.Average():F2}.");
|
||||
Console.WriteLine($"Acceptance: {results.Count(r=>r.Pass)}/60; strict prefixes {MatchedPrefixes(results,pathsFile)}/185. Lengths {lengths.Min()}–{lengths.Max()}, median {(lengths[29]+lengths[30])/2.0}, mean {lengths.Average():F2}.");
|
||||
if(developmentAccepted) Console.WriteLine("Development gate: PASS with exactly eight owner-approved secondary-result exceptions; literal baseline 60/60 and 185/185; strict semantic review remains 52/60.");
|
||||
foreach(var result in results.Where(r=>!r.Pass)) Console.WriteLine($"Case {result.Id}: {string.Join(" ",result.Errors)}");
|
||||
if(validation.Count>0 || !exploration.Complete || exploration.Errors.Length>0 || noSeriesQualified>0 || results.Any(r=>!r.Pass)) Environment.ExitCode=1;
|
||||
if(validation.Count>0 || !exploration.Complete || exploration.Errors.Length>0 || noSeriesQualified>0 || (!developmentAccepted && results.Any(r=>!r.Pass))) Environment.ExitCode=1;
|
||||
}
|
||||
}
|
||||
|
||||
64
PlotLine.Tests/WritingSolverNeutralTests.cs
Normal file
64
PlotLine.Tests/WritingSolverNeutralTests.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System.Text.Json;
|
||||
using PlotLine.Data;
|
||||
using PlotLine.Models.WritingSolver;
|
||||
using PlotLine.Services;
|
||||
|
||||
internal static class WritingSolverNeutralTests
|
||||
{
|
||||
private static void Check(bool condition,string message) { if(!condition) throw new Exception(message); }
|
||||
private static SolverGraph Empty(bool declared=false) => new()
|
||||
{
|
||||
Version="neutral-test",EntryNode="question",MinAnswers=1,MaxAnswers=6,
|
||||
Nodes=[new() {Id="question",Title="What would help?",NeutralEndpoint=declared,
|
||||
Reassurance=declared ? new(){Title="Take your time.",Summary="You can leave with this reassurance."} : null,
|
||||
Choices=[new(){Id="other",Text="Something else",Fallback=true}]}]
|
||||
};
|
||||
public static void Validation()
|
||||
{
|
||||
var ordinary=Empty();Check(WritingSolverValidator.Validate(ordinary).Any(e=>e.Contains("Dead end without diagnostic evidence")),"Undeclared evidence-free dead end passed.");
|
||||
var valid=Empty(true);Check(WritingSolverValidator.Validate(valid).Count==0,"Explicit neutral endpoint failed.");
|
||||
var outcome=WritingSolverEngine.Evaluate(valid,[new("question",["other"])]);
|
||||
Check(outcome.Next is null && outcome.Solutions.Count==0 && outcome.Scores.Count==0 && outcome.Reassurance?.Title=="Take your time.","Neutral endpoint manufactured evidence or a solution.");
|
||||
foreach(var change in new Action<SolverNode>[] {
|
||||
n=>n.Routes.Add(new(){Target="question",AllowCycle=true}),n=>n.Multiple=true,
|
||||
n=>n.Choices[0].Weights["knowledge"]=1,n=>n.Affinity["knowledge"]=1,
|
||||
n=>n.Reassurance=null,n=>n.Reassurance!.Title="",n=>n.Reassurance!.Feature="missing",
|
||||
n=>n.Reassurance!.Advice=["One","Two","Three","Four"]})
|
||||
{
|
||||
var malformed=Empty(true);change(malformed.Nodes[0]);Check(WritingSolverValidator.Validate(malformed).Count>0,"Malformed neutral configuration passed.");
|
||||
}
|
||||
ordinary.Nodes[0].Reassurance=new(){Title="Hidden",Summary="Not declared"};
|
||||
Check(WritingSolverValidator.Validate(ordinary).Any(e=>e.Contains("requires an explicit")),"Undeclared reassurance passed.");
|
||||
var demo=WritingSolverRepository.Parse(File.ReadAllText(Path.Combine(WritingSolverCuratedV2Tests.Root(),"PlotLine/Content/WritingSolver/demo.json")));
|
||||
Check(demo.Nodes.All(n=>!n.NeutralEndpoint),"Old graph compatibility changed.");
|
||||
Check(WritingSolverValidator.Validate(WritingSolverCuratedV2Tests.Graph()).Count==0,"Curated V2 does not pass the real validator.");
|
||||
}
|
||||
private static SolverAnswer[] Prefix => [new("entry",["unsure"]),new("rescue-happening",["reread-cant-see"]),new("rescue-confidence",["using-tool-concern"]),new("existing-stage",["draft-done"])];
|
||||
public static void ReassuranceAndRevision()
|
||||
{
|
||||
var graph=WritingSolverCuratedV2Tests.Graph();var before=WritingSolverEngine.Evaluate(graph,Prefix);
|
||||
foreach(var choice in graph.Nodes.Single(n=>n.NeutralEndpoint).Choices.Where(c=>c.Active))
|
||||
{
|
||||
var after=WritingSolverEngine.Evaluate(graph,[..Prefix,new("existing-barrier",[choice.Id])]);
|
||||
Check(after.Next is null && after.Solutions.Count==0 && after.Reassurance is not null,"Neutral concern did not receive reassurance.");
|
||||
Check(after.Scores.OrderBy(s=>s.Key).SequenceEqual(before.Scores.OrderBy(s=>s.Key)),"Adoption added diagnostic evidence.");
|
||||
var expected=choice.Reassurance ?? graph.Nodes.Single(n=>n.NeutralEndpoint).Reassurance;
|
||||
Check(after.Reassurance==expected,"The selected choice did not determine the reassurance.");
|
||||
var replay=WritingSolverEngine.Evaluate(graph,after.Answers);
|
||||
Check(replay.Reassurance==after.Reassurance && replay.Solutions.Count==0,"Forward/replay changed reassurance.");
|
||||
var revised=after.Answers.ToArray();revised[0]=new("entry",["feels-wrong"]);
|
||||
var changed=WritingSolverEngine.Evaluate(graph,revised);
|
||||
Check(changed.Reassurance is null && changed.Answers.Count==1 && changed.Next?.Id=="feel-where","Revised answer retained an adoption outcome.");
|
||||
}
|
||||
var assertive=WritingSolverCuratedV2Tests.Graph();assertive.MinAnswers=6;
|
||||
assertive.Nodes.Single(n=>n.Id=="entry").Choices.Single(c=>c.Id=="unsure").Weights["overwhelm"]=100;
|
||||
var neutral=WritingSolverEngine.Evaluate(assertive,[..Prefix,new("existing-barrier",["discovery"])]);
|
||||
Check(neutral.Solutions.Count==0 && neutral.Reassurance is not null && neutral.Scores["overwhelm"]==100,"A neutral outcome must not become a diagnosis because of prior signals.");
|
||||
foreach(var id in new[]{13,58})
|
||||
{
|
||||
var result=WritingSolverCuratedV2Tests.Replay(graph).Single(c=>c.Id==id);
|
||||
var ordinary=WritingSolverEngine.Evaluate(graph,result.AcceptedPath);
|
||||
Check(ordinary.Reassurance is null && ordinary.Solutions.Count==0,"Ordinary insufficient evidence was reclassified as adoption.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "writing-solver-curated-v2",
|
||||
"version": "writing-solver-curated-v2-support-review",
|
||||
"cases": [
|
||||
{
|
||||
"id": 1,
|
||||
@ -315,13 +315,14 @@
|
||||
],
|
||||
"expectedPrimary": "d08",
|
||||
"acceptableSupporting": [
|
||||
"d52"
|
||||
"d52",
|
||||
"d15"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d18"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Forty difficult-to-identify characters make the relationship network a relevant supporting way to anchor who they are; retain it as an optional cast-management cross-check, not a separate confirmed network fault."
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
@ -507,13 +508,14 @@
|
||||
],
|
||||
"expectedPrimary": "d11",
|
||||
"acceptableSupporting": [
|
||||
"d04"
|
||||
"d04",
|
||||
"d10"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d08"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Disproportionate attention to a minor character makes checking gaps in important characters a useful complementary presence check. It remains optional rather than required."
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
@ -571,13 +573,14 @@
|
||||
],
|
||||
"expectedPrimary": "d12",
|
||||
"acceptableSupporting": [
|
||||
"d11"
|
||||
"d11",
|
||||
"d23"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d04"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Four viewpoints explicitly establish separate perspectives; inspecting who knows what alongside restoring a neglected viewpoint is a relevant optional cross-check."
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
@ -793,20 +796,21 @@
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d17",
|
||||
"d15",
|
||||
"d16"
|
||||
]
|
||||
}
|
||||
],
|
||||
"expectedPrimary": "d17",
|
||||
"acceptableSupporting": [
|
||||
"d44"
|
||||
"d44",
|
||||
"d16"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d18"
|
||||
"d18",
|
||||
"d15"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Mapping intermediate relationship stages can help an unearned jump. One romance does not establish too many relationships to manage."
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
@ -846,9 +850,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d18",
|
||||
"d43",
|
||||
"d15"
|
||||
"d18"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -858,9 +860,11 @@
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d17"
|
||||
"d17",
|
||||
"d43",
|
||||
"d15"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Stalled development within one romance does not establish story-wide stagnation or an unmanageable relationship network."
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
@ -900,8 +904,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d19",
|
||||
"d15"
|
||||
"d19"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -911,9 +914,10 @@
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d21"
|
||||
"d21",
|
||||
"d15"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Two people understanding their relationship differently is not evidence of excessive network complexity."
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
@ -960,13 +964,14 @@
|
||||
],
|
||||
"expectedPrimary": "d20",
|
||||
"acceptableSupporting": [
|
||||
"d48"
|
||||
"d48",
|
||||
"d15"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d08"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Six relationships changing after one event directly establish network-management burden as well as the consequence problem."
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
@ -1170,13 +1175,14 @@
|
||||
"expectedPrimary": "d24",
|
||||
"acceptableSupporting": [
|
||||
"d48",
|
||||
"d25"
|
||||
"d25",
|
||||
"d26"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d34"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The literal path changes when information is revealed; checking its reader-facing timing is relevant alongside logical revelation ordering."
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
@ -1322,9 +1328,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d27",
|
||||
"d29",
|
||||
"d13"
|
||||
"d27"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -1332,9 +1336,11 @@
|
||||
"acceptableSupporting": [],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d33"
|
||||
"d33",
|
||||
"d29",
|
||||
"d13"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Tuesday before Monday establishes a calendar contradiction. It establishes no birthday, age or other character-fact problem."
|
||||
},
|
||||
{
|
||||
"id": 26,
|
||||
@ -1619,7 +1625,7 @@
|
||||
"d50",
|
||||
"d05"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. D50 is forbidden: this complaint and literal path establish no series evidence. D05 is also forbidden: scene count/navigation does not establish uncertainty about scene contribution."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. D50 is forbidden: this complaint and literal path establish no series evidence. D05 is also forbidden: scene count/navigation does not establish uncertainty about scene contribution. Supporting review: Navigation burden supports scene organisation and overload; neither scene contribution nor a series is established. Approved earlier corrections retained."
|
||||
},
|
||||
{
|
||||
"id": 31,
|
||||
@ -1926,13 +1932,14 @@
|
||||
],
|
||||
"expectedPrimary": "d39",
|
||||
"acceptableSupporting": [
|
||||
"d13"
|
||||
"d42"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d38"
|
||||
"d38",
|
||||
"d13"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The same house has a contradictory physical state across scenes; the closely related material-state/history view is an optional cross-check. No character details are implicated."
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
@ -2076,9 +2083,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d42",
|
||||
"d39",
|
||||
"d13"
|
||||
"d42"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -2088,9 +2093,11 @@
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d38"
|
||||
"d38",
|
||||
"d39",
|
||||
"d13"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: A destroyed letter reappearing establishes object-history continuity, not a changed place or inconsistent character details."
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
@ -2287,8 +2294,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d46",
|
||||
"d43"
|
||||
"d46"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -2298,9 +2304,10 @@
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d10"
|
||||
"d10",
|
||||
"d43"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The protagonist remaining internally unchanged does not establish that the external story stops moving."
|
||||
},
|
||||
{
|
||||
"id": 44,
|
||||
@ -2612,10 +2619,13 @@
|
||||
}
|
||||
],
|
||||
"expectedPrimary": "d52",
|
||||
"acceptableSupporting": [],
|
||||
"acceptableSupporting": [
|
||||
"d33",
|
||||
"d01"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The literal answer selects Pretty much everything and then All of that after a list of manuscript-management domains. Scene/thread views are optional ways to inspect that stated broad burden; no additional result is required."
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
@ -2702,13 +2712,14 @@
|
||||
"expectedPrimary": "d24",
|
||||
"acceptableSupporting": [
|
||||
"d25",
|
||||
"d48"
|
||||
"d48",
|
||||
"d26"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d44"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The accepted path explicitly changes reveal timing, so checking reader-facing timing is related to the information-order problem. Do not require a clue-network or revision-consequence diagnosis from evidence the path never collects."
|
||||
},
|
||||
{
|
||||
"id": 52,
|
||||
@ -2748,8 +2759,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d17",
|
||||
"d15"
|
||||
"d17"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -2757,9 +2767,10 @@
|
||||
"acceptableSupporting": [],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d28"
|
||||
"d28",
|
||||
"d15"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: An unearned two-person relationship despite six calendar months does not establish too many relationships."
|
||||
},
|
||||
{
|
||||
"id": 53,
|
||||
@ -2978,14 +2989,12 @@
|
||||
}
|
||||
],
|
||||
"expectedPrimary": "d10",
|
||||
"acceptableSupporting": [
|
||||
"d11"
|
||||
],
|
||||
"acceptableSupporting": [],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [
|
||||
"d11"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: Deliberate absence must not be silently converted to accidental presence imbalance. Remove D11 from acceptableSupporting and retain the existing prohibition."
|
||||
},
|
||||
{
|
||||
"id": 57,
|
||||
@ -3025,8 +3034,7 @@
|
||||
"afterAnswers": 3,
|
||||
"expectedNext": null,
|
||||
"expectedResults": [
|
||||
"d18",
|
||||
"d15"
|
||||
"d18"
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -3035,8 +3043,10 @@
|
||||
"d44"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"forbiddenResults": [
|
||||
"d15"
|
||||
],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: A deliberately slow romance may warrant a progression check, as already approved, but does not establish an unmanageable relationship network."
|
||||
},
|
||||
{
|
||||
"id": 58,
|
||||
@ -3185,11 +3195,12 @@
|
||||
"acceptableSupporting": [
|
||||
"d02",
|
||||
"d48",
|
||||
"d44"
|
||||
"d44",
|
||||
"d26"
|
||||
],
|
||||
"requiredSupporting": [],
|
||||
"forbiddenResults": [],
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear."
|
||||
"notes": "Literal path curated for v2; optional supporting results need not all appear. Supporting review: The actual accepted path establishes changed revelation timing and premature knowledge. D26 is a related timing check. Other complaint elements are not encoded by this path, so do not invent required D02/D48/D44 outputs."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -402,7 +402,7 @@
|
||||
},
|
||||
{
|
||||
"id": "using-tool-concern",
|
||||
"text": "Before that, I’m not sure a story-planning tool would suit how I write",
|
||||
"text": "Before that, I\u2019m not sure a story-planning tool would suit how I write",
|
||||
"help": "Existing manuscripts, discovery writing and creative control.",
|
||||
"icon": "book",
|
||||
"active": true,
|
||||
@ -896,7 +896,7 @@
|
||||
},
|
||||
{
|
||||
"id": "who-knows-fact",
|
||||
"text": "I know the fact or object state; I can’t remember which characters know about it",
|
||||
"text": "I know the fact or object state; I can\u2019t remember which characters know about it",
|
||||
"help": "Use this when the uncertainty is who knows a fact, not where the object is.",
|
||||
"icon": "people",
|
||||
"active": true,
|
||||
@ -3109,7 +3109,6 @@
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {
|
||||
"possession": 4,
|
||||
"continuity-conflict": 4
|
||||
}
|
||||
},
|
||||
@ -4211,8 +4210,7 @@
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {
|
||||
"character-presence": 6,
|
||||
"flat-progression": 4
|
||||
"character-presence": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4233,8 +4231,7 @@
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {
|
||||
"character-presence": 6,
|
||||
"flat-progression": 4
|
||||
"character-presence": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4735,7 +4732,15 @@
|
||||
"order": 1,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "You don't need to start again.",
|
||||
"summary": "PlotDirector can begin with an existing manuscript. You should not have to manually recreate hundreds of scenes just to start organising your novel.",
|
||||
"advice": [
|
||||
"Bring in the draft you already have, then begin with the part you most want to understand."
|
||||
],
|
||||
"feature": "manuscript-import"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "manual-entry",
|
||||
@ -4743,7 +4748,15 @@
|
||||
"order": 2,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "You don't have to recreate your novel as data.",
|
||||
"summary": "Your manuscript is the starting point. Import can help you bring the existing writing into view without manually entering hundreds of scenes first.",
|
||||
"advice": [
|
||||
"Keep your draft as the writing you have already done, and organise only what will help with your next session."
|
||||
],
|
||||
"feature": "manuscript-import"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "discovery",
|
||||
@ -4751,7 +4764,14 @@
|
||||
"order": 3,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "That's fine. You can discover the story as you write.",
|
||||
"summary": "PlotDirector doesn't require you to plan the story before you write it. It can help organise and make visible what has already emerged through writing.",
|
||||
"advice": [
|
||||
"Keep discovering the story in your own way. Use a view when you want to understand what is there, rather than to prescribe what must happen next."
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "telling-me",
|
||||
@ -4759,7 +4779,14 @@
|
||||
"order": 4,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "Nor should it.",
|
||||
"summary": "PlotDirector can show you what's there. What you do with it remains your decision.",
|
||||
"advice": [
|
||||
"The tools help you see, track and compare your story. They don't judge whether a plot, relationship, pace or creative choice is good."
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "scattered-notes",
|
||||
@ -4767,7 +4794,15 @@
|
||||
"order": 5,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "Bring together just enough to make writing easier.",
|
||||
"summary": "You do not need a perfect system for every note before you can move forward. Start with the information you keep having to look up.",
|
||||
"advice": [
|
||||
"Keep the useful connections close to the writing, and leave the rest until you need it."
|
||||
],
|
||||
"feature": "story-organisation"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "where-begin",
|
||||
@ -4775,7 +4810,15 @@
|
||||
"order": 6,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "Start with the story you already have.",
|
||||
"summary": "Choose one manageable place to begin: the draft itself, a short sequence of scenes, or one thing you keep checking.",
|
||||
"advice": [
|
||||
"If you already have a manuscript, import can give you a starting point without rebuilding the book by hand."
|
||||
],
|
||||
"feature": "manuscript-import"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "just-write",
|
||||
@ -4783,7 +4826,14 @@
|
||||
"order": 7,
|
||||
"active": true,
|
||||
"fallback": false,
|
||||
"weights": {}
|
||||
"weights": {},
|
||||
"reassurance": {
|
||||
"title": "That's the point: get back to writing.",
|
||||
"summary": "Organisation should remove maintenance work from your head so you can return to the writing. It doesn't need to become a project of its own.",
|
||||
"advice": [
|
||||
"Use only the amount of structure that helps. One useful view is enough to start; you do not have to adopt a whole new way of working."
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "other",
|
||||
@ -4794,7 +4844,15 @@
|
||||
"weights": {}
|
||||
}
|
||||
],
|
||||
"routes": []
|
||||
"routes": [],
|
||||
"neutralEndpoint": true,
|
||||
"reassurance": {
|
||||
"title": "Use only what helps your writing.",
|
||||
"summary": "You do not have to change the way you create a story to make use of a clearer view of it.",
|
||||
"advice": [
|
||||
"Take away whatever is useful here. You can return to the conversation whenever you want."
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "character-meeting",
|
||||
|
||||
@ -26,9 +26,12 @@ public sealed class SitemapController(IHelpService help, IConfiguration configur
|
||||
};
|
||||
|
||||
var graph = await solver.GetAsync();
|
||||
if (configuration.GetValue("WritingSolver:EnableIndexing", true))
|
||||
{
|
||||
urls.Add(new("/writing-problems", "monthly", "0.8"));
|
||||
urls.AddRange(graph.Solutions.Where(p => p.Active && p.Index).Select(p => new SitemapUrl($"/writing-problems/{p.Slug}", "monthly", "0.7")));
|
||||
urls.AddRange(graph.Features.Where(p => p.Active && p.Index).Select(p => new SitemapUrl($"/features/{p.Slug}", "monthly", "0.7")));
|
||||
}
|
||||
|
||||
var articles = help.GetAllArticles();
|
||||
urls.AddRange(articles
|
||||
|
||||
@ -70,6 +70,8 @@ public sealed class WritingProblemsController(IWritingSolverRepository repositor
|
||||
}
|
||||
private void SetSeo(string title,string description,string path,bool index,string? image=null)
|
||||
{
|
||||
index = index && configuration.GetValue("WritingSolver:EnableIndexing", true);
|
||||
if (!index) Response.Headers["X-Robots-Tag"] = "noindex, follow";
|
||||
ViewData["Robots"] = index ? "index, follow" : "noindex, follow";
|
||||
PublicSeo.Apply(ViewData,configuration,new SeoMetadata
|
||||
{
|
||||
|
||||
@ -22,6 +22,8 @@ public sealed class SolverNode
|
||||
public string Help { get; set; } = "";
|
||||
public bool Active { get; set; } = true;
|
||||
public bool Multiple { get; set; }
|
||||
public bool NeutralEndpoint { get; set; }
|
||||
public SolverReassurance? Reassurance { get; set; }
|
||||
public int Order { get; set; }
|
||||
public Dictionary<string,int> Affinity { get; set; } = [];
|
||||
public List<SolverChoice> Choices { get; set; } = [];
|
||||
@ -37,6 +39,14 @@ public sealed class SolverChoice
|
||||
public bool Fallback { get; set; }
|
||||
public int Order { get; set; }
|
||||
public Dictionary<string,int> Weights { get; set; } = [];
|
||||
public SolverReassurance? Reassurance { get; set; }
|
||||
}
|
||||
public sealed class SolverReassurance
|
||||
{
|
||||
public string Title { get; set; } = "";
|
||||
public string Summary { get; set; } = "";
|
||||
public List<string> Advice { get; set; } = [];
|
||||
public string? Feature { get; set; }
|
||||
}
|
||||
public sealed class SolverRoute
|
||||
{
|
||||
@ -82,6 +92,6 @@ public sealed class SolverFeatureLink
|
||||
public string Reason { get; set; } = "";
|
||||
}
|
||||
public sealed record SolverAnswer(string Node, string[] Choices);
|
||||
public sealed record SolverOutcome(SolverNode? Next, IReadOnlyList<SolverSolution> Solutions, IReadOnlyDictionary<string,int> Scores, IReadOnlyList<SolverAnswer> Answers);
|
||||
public sealed record SolverOutcome(SolverNode? Next, IReadOnlyList<SolverSolution> Solutions, IReadOnlyDictionary<string,int> Scores, IReadOnlyList<SolverAnswer> Answers, SolverReassurance? Reassurance = null);
|
||||
public sealed record SolverJourney(SolverGraph Graph, SolverOutcome Outcome, string History, string? Error = null);
|
||||
public sealed record SolverPageView(SolverGraph Graph, SolverPage Page, bool IsFeature);
|
||||
|
||||
@ -19,6 +19,8 @@ public static class WritingSolverEngine
|
||||
foreach (var choice in choices)
|
||||
foreach (var weight in choice.Weights)
|
||||
scores[weight.Key] = scores.GetValueOrDefault(weight.Key) + weight.Value;
|
||||
if (next.NeutralEndpoint)
|
||||
return new(null, [], scores, accepted, choices.Single().Reassurance ?? next.Reassurance);
|
||||
next = SelectNext(graph, next, ids, accepted, scores);
|
||||
}
|
||||
var solutions = graph.Solutions.Where(s => s.Active)
|
||||
|
||||
@ -38,6 +38,22 @@ public static partial class WritingSolverValidator
|
||||
Check(!string.IsNullOrWhiteSpace(node.Title), $"Missing question: {node.Id}");
|
||||
Unique(node.Choices.Select(c => c.Id), $"choice in {node.Id}");
|
||||
Check(!node.Active || node.Choices.Any(c => c.Active && c.Fallback), $"Missing fallback choice: {node.Id}");
|
||||
void Reassurance(SolverReassurance? content, string label)
|
||||
{
|
||||
if (content is null) return;
|
||||
Check(!string.IsNullOrWhiteSpace(content.Title) && !string.IsNullOrWhiteSpace(content.Summary), $"Missing neutral reassurance title/summary: {label}");
|
||||
Check(content.Advice.Count <= 3 && content.Advice.All(a => !string.IsNullOrWhiteSpace(a)), $"Invalid neutral next steps: {label}");
|
||||
Check(content.Feature is null || (features.TryGetValue(content.Feature, out var linked) && (!node.Active || linked.Active)), $"Missing/inactive neutral feature: {label}");
|
||||
}
|
||||
if (node.NeutralEndpoint)
|
||||
{
|
||||
Check(node.Routes.Count == 0 && !node.Multiple && node.Affinity.Count == 0, $"Neutral endpoint must be terminal, single-choice and have no routing affinity: {node.Id}");
|
||||
Check(node.Choices.All(c => c.Weights.Count == 0), $"Neutral endpoint must not create diagnostic evidence: {node.Id}");
|
||||
Check(node.Reassurance is not null, $"Missing neutral endpoint fallback reassurance: {node.Id}");
|
||||
}
|
||||
else Check(node.Reassurance is null && node.Choices.All(c => c.Reassurance is null), $"Reassurance requires an explicit neutral endpoint: {node.Id}");
|
||||
Reassurance(node.Reassurance, node.Id);
|
||||
foreach (var choice in node.Choices) Reassurance(choice.Reassurance, $"{node.Id}/{choice.Id}");
|
||||
Weights(node.Affinity, node.Id);
|
||||
Check(node.Affinity.Keys.All(signalNames.Contains), $"Unknown affinity signal: {node.Id}");
|
||||
foreach (var choice in node.Choices)
|
||||
@ -102,7 +118,7 @@ public static partial class WritingSolverValidator
|
||||
Check(upperBound >= solution.Threshold, $"Unreachable solution (insufficient signals): {solution.Id}");
|
||||
}
|
||||
foreach (var node in graph.Nodes.Where(n => n.Active && n.Routes.Count == 0))
|
||||
Check(node.Choices.Any(c => c.Weights.Keys.Any(k => graph.Solutions.Any(s => s.Active && s.Signals.ContainsKey(k)))), $"Dead end without diagnostic evidence: {node.Id}");
|
||||
Check(node.NeutralEndpoint || node.Choices.Any(c => c.Weights.Keys.Any(k => graph.Solutions.Any(s => s.Active && s.Signals.ContainsKey(k)))), $"Dead end without diagnostic evidence: {node.Id}");
|
||||
if (errors.Count == 0) errors.AddRange(ValidateJourneys(graph));
|
||||
return errors;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<div class="table-responsive"><table class="table"><thead><tr><th>Node</th><th>Question / active</th><th>Connections and conditions</th><th>Choice signals</th></tr></thead><tbody>
|
||||
@foreach(var node in graph.Nodes.OrderBy(n=>n.Order))
|
||||
{
|
||||
<tr><td>@node.Id (@node.Type)</td><td>@node.Title<br />Active: @node.Active · Multiple: @node.Multiple</td>
|
||||
<tr><td>@node.Id (@node.Type)</td><td>@node.Title<br />Active: @node.Active · Multiple: @node.Multiple · Neutral ending: @node.NeutralEndpoint</td>
|
||||
<td>@foreach(var route in node.Routes) { <p>→ @route.Target<br />Choice: @(route.Choice ?? "any") · Signal: @(route.Signal ?? "any") ≥ @route.Minimum · Priority: @route.Priority · Cycle allowed: @route.AllowCycle</p> }</td>
|
||||
<td>@foreach(var choice in node.Choices.OrderBy(c=>c.Order)) { <p><strong>@choice.Id</strong>: @choice.Text<br />Active: @choice.Active · Fallback: @choice.Fallback<br />@string.Join(", ",choice.Weights.Select(w=>$"{w.Key}: {w.Value}"))</p> }</td></tr>
|
||||
}
|
||||
|
||||
@ -39,6 +39,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@if(Model.Outcome.Reassurance is not null)
|
||||
{
|
||||
<partial name="Neutral" model="Model" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="solver-resolution">✓ Here’s a useful way forward</p>
|
||||
@if(Model.Outcome.Solutions.Count == 0)
|
||||
{
|
||||
@ -50,6 +56,7 @@
|
||||
{
|
||||
<partial name="Solution" model="@(new SolverPageView(Model.Graph,solution,false))" />
|
||||
}
|
||||
}
|
||||
<div class="solver-controls">
|
||||
@if (ViewData["BackState"] is string resultBack) { <a class="editorial-link" href="/writing-problems?state=@resultBack">← Back</a> }
|
||||
<a class="marketing-btn marketing-btn--secondary" href="/writing-problems">Start again</a>
|
||||
@ -72,9 +79,12 @@
|
||||
@if(Model.Graph.IsDemo) { <p class="solver-demo">Preview journey · This small plot-line demonstration will grow into a curated collection of writing problems.</p> }
|
||||
</div>
|
||||
</section>
|
||||
@if(Model.Outcome.Reassurance is null)
|
||||
{
|
||||
<section class="solver-library marketing-container">
|
||||
<h2>A little help, whenever you need it.</h2>
|
||||
<p>You can read this advice directly, without starting the conversation.</p>
|
||||
@foreach(var solution in Model.Graph.Solutions.Where(s=>s.Active).OrderBy(s=>s.Order)) { <a class="editorial-link" href="/writing-problems/@solution.Slug">@solution.PageTitle →</a> }
|
||||
</section>
|
||||
}
|
||||
@section Scripts { <script src="~/js/writing-solver.js" asp-append-version="true"></script> }
|
||||
|
||||
16
PlotLine/Views/WritingProblems/Neutral.cshtml
Normal file
16
PlotLine/Views/WritingProblems/Neutral.cshtml
Normal file
@ -0,0 +1,16 @@
|
||||
@using PlotLine.Models.WritingSolver
|
||||
@model SolverJourney
|
||||
@{ var reassurance = Model.Outcome.Reassurance!; }
|
||||
<article class="solver-neutral">
|
||||
<p class="solver-resolution">A little reassurance before you go</p>
|
||||
<h1>@reassurance.Title</h1>
|
||||
<p class="solver-intro">@reassurance.Summary</p>
|
||||
@foreach(var paragraph in reassurance.Advice) { <p class="solver-editorial">@paragraph</p> }
|
||||
@if(reassurance.Feature is string id)
|
||||
{
|
||||
var feature=Model.Graph.Features.Single(f=>f.Id==id && f.Active);
|
||||
<p><a class="editorial-link" href="/features/@feature.Slug">@feature.Title →</a></p>
|
||||
}
|
||||
<p class="solver-help">You can leave it there, or return whenever you want a little help untangling a writing problem.</p>
|
||||
<a class="editorial-link" href="/">Back to PlotDirector →</a>
|
||||
</article>
|
||||
@ -59,3 +59,6 @@ html[data-site-theme="public"] {
|
||||
}
|
||||
html[data-site-theme="public"] main.marketing-shell > section.solver-space { max-width:none; width:100%; }
|
||||
html[data-site-theme="public"] .public-footer { background:#f0e5d4; }
|
||||
|
||||
html[data-site-theme="public"] .solver-neutral { max-width:760px; margin-inline:auto; }
|
||||
html[data-site-theme="public"] .solver-neutral .solver-intro { margin-left:0; }
|
||||
|
||||
@ -6,7 +6,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using PlotLine.Data;
|
||||
using PlotLine.Services;
|
||||
|
||||
if (args.Length < 2) throw new ArgumentException("Usage: validate|publish FILE | migrate SQL | inspect development | query SQLFILE");
|
||||
if (args.Length < 2) throw new ArgumentException("Usage: validate|publish FILE | backup development | migrate SQL | inspect development | query SQLFILE");
|
||||
var operation = args[0];
|
||||
if (operation is "validate" or "publish")
|
||||
{
|
||||
@ -25,13 +25,14 @@ await using var connection = new SqlConnection(cs.ConnectionString);
|
||||
await connection.OpenAsync();
|
||||
if (await connection.ExecuteScalarAsync<string>("SELECT DB_NAME()") != "PlotDirector_Development") throw new InvalidOperationException("Wrong database.");
|
||||
Console.WriteLine("Verified PlotDirector_Development.");
|
||||
if (operation == "migrate")
|
||||
if (operation is "migrate" or "backup")
|
||||
{
|
||||
var backup=$"/var/opt/mssql/backup/PlotDirector_Development_solver_{DateTime.UtcNow:yyyyMMdd_HHmmss}.bak";
|
||||
var backup=$"/var/opt/mssql/backup/PlotDirector_Development_solver_{DateTime.UtcNow:yyyyMMdd_HHmmss}_{Guid.NewGuid():N}.bak";
|
||||
await connection.ExecuteAsync("BACKUP DATABASE [PlotDirector_Development] TO DISK=@path WITH COPY_ONLY, INIT, CHECKSUM",new {path=backup}, commandTimeout:180);
|
||||
var hostBackup = new FileInfo(backup.Replace("/var/opt/mssql/", "/sql/mssql/", StringComparison.Ordinal));
|
||||
if (!hostBackup.Exists || hostBackup.Length == 0) throw new IOException("Backup command succeeded but the mapped backup file is missing/empty.");
|
||||
Console.WriteLine($"Backup completed with CHECKSUM; file verified: {backup} ({hostBackup.Length} bytes). This is not a restore test.");
|
||||
if (operation == "backup") return;
|
||||
var sql=await File.ReadAllTextAsync(args[1]);
|
||||
await connection.ExecuteAsync("SET ANSI_NULLS ON; SET QUOTED_IDENTIFIER ON;");
|
||||
foreach(var batch in Regex.Split(sql,@"^\s*GO\s*$",RegexOptions.Multiline|RegexOptions.IgnoreCase))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user