From d89e0816b676e7fd006240c92a4b1fb31b3de5be Mon Sep 17 00:00:00 2001 From: robbond Date: Fri, 9 Oct 2026 09:12:41 +0100 Subject: [PATCH] refactor(reconstruction): strengthen open-question semantic fidelity --- prompts/reconstruct-v0.5.md | 2 +- tests/v03-reasoning.test.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/prompts/reconstruct-v0.5.md b/prompts/reconstruct-v0.5.md index b83522a..45c3af9 100644 --- a/prompts/reconstruct-v0.5.md +++ b/prompts/reconstruct-v0.5.md @@ -26,7 +26,7 @@ You are a neutral analyst performing evidence-based situation reconstruction. 7. When the user explicitly names multiple distinct possible explanations, causes, constraints, or dependencies for the situation, preserve those user-stated alternatives as separate importantUnknowns when they can sensibly be investigated independently. Do not collapse them into one "which factor", "relative contribution", or equivalent umbrella unknown. Do not turn a user-stated possibility into an asserted plausible interpretation — preserve its uncertain status. Only split concepts when the user has presented materially distinct dimensions that each warrant independent investigation. -7a. For every importantUnknown, preserve its uncertainty meaning in `description` and provide `question` as a natural, direct interrogative addressed to the user. The question must retain the meaning, scope, conditions, timeframes, and qualifications in the description without adding assumptions or an implied conclusion. Do not use fragments or indirect proposition forms such as "Whether …". This applies across domains. +7a. For every importantUnknown, preserve its canonical uncertainty meaning in `description` and express that same uncertainty in `question` as a concise, natural, direct interrogative addressed to the user. The question may improve grammar and readability, but it must be semantically equivalent: preserve the subject, epistemic openness, material scope, timing, conditions, and qualifications without assuming the unresolved outcome has occurred or adding unsupported premises. Do not narrow the uncertainty to one possible indicator or form of evidence, or replace it with a question about how to investigate it; evidence-gathering belongs to focused investigation. For example, if the uncertainty is whether indicated demand will become commitments sufficient to justify an investment, ask that uncertainty directly rather than whether customers have supplied written commitments yet. Do not use fragments or indirect proposition forms such as "Whether …". This applies across domains. 8. Distinguish: what was said / what it may mean / why it may have been said. diff --git a/tests/v03-reasoning.test.js b/tests/v03-reasoning.test.js index fa26e79..e66fe1b 100644 --- a/tests/v03-reasoning.test.js +++ b/tests/v03-reasoning.test.js @@ -211,6 +211,23 @@ describe("v0.5 prompt", () => { expect(result.prompt).toContain("Default prompt scenario"); }); + it("requires Open Questions to express the canonical uncertainty without taking over focused investigation", async () => { + const { prompt } = await buildPrompt("Semantic equivalence scenario", "v0.5"); + + expect(prompt).toContain("canonical uncertainty meaning in `description`"); + expect(prompt).toContain("express that same uncertainty in `question`"); + expect(prompt).toContain("concise, natural, direct interrogative"); + expect(prompt).toContain("semantically equivalent"); + expect(prompt).toContain("subject, epistemic openness, material scope, timing, conditions, and qualifications"); + expect(prompt).toContain("without assuming the unresolved outcome has occurred or adding unsupported premises"); + expect(prompt).toContain("Do not narrow the uncertainty to one possible indicator or form of evidence"); + expect(prompt).toContain("evidence-gathering belongs to focused investigation"); + expect(prompt).toContain('"importantUnknowns"'); + expect(prompt).toContain('"description": ""'); + expect(prompt).toContain('"question": ""'); + expect(prompt).toContain("Return ONLY the JSON object"); + }); + it("keeps explicit v0.4 unchanged", async () => { const result = await buildPrompt("Explicit v0.4 scenario", "v0.4"); @@ -218,6 +235,8 @@ describe("v0.5 prompt", () => { expect(result.prompt).toContain( "with no dedicated schema field MUST be preserved explicitly in summary", ); + expect(result.prompt).not.toContain("semantically equivalent"); + expect(result.prompt).not.toContain("evidence-gathering belongs to focused investigation"); }); it("loads the v0.5 relationship contract", async () => {