MVP 0.93 - stabile, aber Writing Profile ohne erkennbaren Nutzen

This commit is contained in:
Lars committed 2026-08-27 10:03:05 +02:00
1 parent 53b1eff833
commit f17b3083e8
56 files changed
+5366 -784

No files matched your search

+21 -13
View File
@@ -151,8 +151,9 @@ def main() -> None:
impulse, decision = parse_turn_payload('{"operation":"konkretisieren","impulse":"Wo war das?"}')
expect(impulse == "Wo war das?" and decision["parsed"] is True, "operation json parsed")
hidden = visible_for_role({"trace": {"egress": "x"}, "decision": decision, "calls": 1}, "user")
hidden = visible_for_role({"trace": {"egress": "x"}, "run_log": [{"kind": "detect"}], "decision": decision, "calls": 1}, "user")
expect("trace" not in hidden and "decision" not in hidden, "user does not see test spur")
expect(hidden.get("run_log"), "compact generate log remains visible")
expect(is_plot_continuation("Und dann mit dem Tee auf dem Balkon?"), "echo then-question rejected")
expect(is_plot_continuation("Ihr seid dann zur Bootstour aufgebrochen."), "invented departure rejected")
expect(is_plot_continuation("Und dann seid ihr zur Wanderung aufgebrochen."), "invented hike rejected")
@@ -313,20 +314,25 @@ def main() -> None:
expect(draft.status_code == 200, f"A generate {draft.text}")
expect("Markt" in draft.json()["body"] or "Kirschen" in draft.json()["body"], "A draft keeps user words")
stages_a = {item.get("purpose"): item for item in (draft.json().get("trace") or {}).get("stages") or []}
reconstruct_a = stages_a.get("journal_reconstruct")
reconstruct_a = stages_a.get("local_source_artifact")
last_a = stages_a.get("journal_generate") or (draft.json().get("trace") or {})
expect(reconstruct_a is not None, "A stage 1 reconstruct ran")
expect(reconstruct_a is not None, "A stage 1 local artifact ran")
reconstruct_intern = reconstruct_a.get("intern") or ""
narrate_intern = last_a.get("intern") or ""
expect("Kirschen" in reconstruct_intern or "Markt" in reconstruct_intern, "A reconstruct sees user words")
expect("user:" in reconstruct_intern, "A reconstruct sees the day as dialogue")
expect("Kirschen" in reconstruct_intern or "Markt" in reconstruct_intern, "A local artifact sees user words")
expect("assistant:" not in reconstruct_intern, "A local artifact has no assistant lines")
expect("assistant:" not in narrate_intern, "A stage 2 does not resend the day dialogue")
expect("verified_artifact" in narrate_intern or "sources" in narrate_intern, "A stage 2 receives the reconstruction")
expect("Stilquellen" in narrate_intern or "Dialog" in narrate_intern or "Erzählmerkmale" in narrate_intern or "Core:" in narrate_intern, "A style brief reaches generate")
style_part = narrate_intern
expect("Erzählmerkmale" in style_part, "A first generate still gets form hints")
expect("CURRENT_DAY_SOURCES" in narrate_intern or "[u1]" in narrate_intern, "A stage 2 receives the day sources")
expect(
"Heute war der Markt voll" not in style_part.split("Verified Artifact:")[0],
"WRITING_PROFILE" in narrate_intern or "Neutraler Journalstil" in narrate_intern or "Core:" in narrate_intern,
"A style brief reaches generate",
)
expect("STYLE_EXAMPLES" in narrate_intern, "A style examples block is labeled")
style_part = narrate_intern.split("CURRENT_DAY_SOURCES")[0]
expect("Erzählmerkmale" not in style_part, "A current day dialogue is not appended as style signals")
expect("Neutraler Journalstil" in style_part or "Core:" in style_part, "A empty profile uses the neutral journal voice")
expect(
"Heute war der Markt voll" not in style_part,
"A source dialogue is not pasted a second time as style",
)
current_version = None
@@ -364,7 +370,7 @@ def main() -> None:
expect(day_again.json()["day"]["calendar_date"] == "2026-08-20", "B journal day stays calendar day")
msgs = client.get(f"/api/journal/conversations/{conv['id']}", headers=headers).json()["messages"]
expect(any("Wind" in item["body"] for item in msgs), "B later message kept")
expect(msgs[-1]["created"] != "2026-08-20" or True, "B message time is independent")
expect(not str(msgs[-1]["created"]).startswith("2026-08-20"), "B message time is independent of the calendar day")
prior_space, prior_day = open_space_day(client, headers, "Urlaub", "2026-08-01")
prior_conv, _ = start_and_turn(
@@ -510,7 +516,9 @@ def main() -> None:
if stage.get("purpose") == "journal_generate":
intern_i = stage.get("intern") or ""
intern_i = intern_i or ((gen_i.json().get("trace") or {}).get("intern") or "")
expect("knapp" in intern_i, "I style brief reaches generate")
expect("STYLE_EXAMPLES" in intern_i, "I style examples reach generate")
expect("WRITING_PROFILE" in intern_i or "Neutraler Journalstil" in intern_i, "I writing profile reaches generate")
expect("knapp" in imported.json()["compiled_brief"], "I stored brief still lists the import")
profile = client.get("/api/journal/writing-profile", headers=headers).json()
expect(all(item.get("kind") != "journal_draft" for item in profile["sources"]), "I no draft kind")
expect(not any((item.get("body") or "") == gen_i.json()["body"] for item in profile["sources"]), "I draft not a style source")
@@ -586,7 +594,7 @@ def main() -> None:
if stage.get("purpose") == "journal_generate":
with_intern = stage.get("intern") or ""
expect(marker in with_intern, "include_existing true sends the saved body only after explicit flag")
existing_section = with_intern.split("Bestehender Text")[-1].split("Verified Artifact")[0]
existing_section = with_intern.split("EXISTING_TEXT")[-1]
expect(marker in existing_section, "saved Fassung is the included existing text, not a leftover draft")
after_with = client.get(f"/api/journal/entries/{saved.json()['id']}", headers=headers).json()
expect(after_with["current_version_id"] == marked_version, "include_existing generate still does not overwrite")