feat: optimize default prompt structure for U-shaped attention + fix opfs/ranking flakes

- Restructure all 7 task templates: add assistant identity-ack and info-ack blocks, restore reference materials to system role, keep only format+rules as user tail
- Fix writeJsonFile treating empty serializedText as valid (opfs-persistence flake)
- Fix shared-ranking test: strip diagnostic lastSearchTimings from side-effect comparison
- Update all related test assertions (prompt-builder-defaults, task-profile-migration, task-profile-storage, prompt-builder-mixed-transcript, p0-regressions, extractor-phase3-layered-context)
This commit is contained in:
Youzini-afk
2026-04-23 00:28:06 +08:00
parent e73407c156
commit e7cb7b31b6
7 changed files with 508 additions and 275 deletions

View File

@@ -428,7 +428,7 @@ async function readJsonFile(parentHandle, name, fallbackValue = null) {
async function writeJsonFile(parentHandle, name, value, options = {}) {
const serializedText =
typeof options?.serializedText === "string"
typeof options?.serializedText === "string" && options.serializedText
? options.serializedText
: JSON.stringify(value);
const fileHandle = await parentHandle.getFileHandle(String(name || ""), {